/* ASA OS job workspace: the editable Estimate tab (request 242). Loaded after shop.css and uses only its tokens. */

/* lines: quantity is a quiet button, remove sits at the end of the row */
.je .lines td.l-act { width: 72px; text-align: right; padding-right: 14px; }
.je button.je-qty { min-height: 28px; padding: 0 8px; margin-right: -8px; border-radius: 7px; background: transparent; color: var(--ink-2); font-weight: 400; font-size: 14px; }
.je button.je-qty:hover { background: var(--fill); color: var(--ink); }
.je button.je-x { min-height: 26px; padding: 0 8px; background: transparent; color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.je button.je-x:hover { background: var(--red-soft); color: var(--red); }
.je .lines tr:hover button.je-x { color: var(--ink-2); }
.je .lines tr:hover button.je-x:hover { color: var(--red); }
.je-sub { color: var(--ink-2); }
.je .lines .l-flag + .l-flag { margin-left: 6px; }
.je-foot-acts { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 12px 12px; margin-top: -4px; }
.je button.je-act { min-height: 28px; padding: 0 10px; font-size: 13px; background: transparent; color: var(--accent); }
.je button.je-act:hover { background: var(--accent-soft); }

/* inline editors and confirmations */
.je-edit-row td, .je .lines .je-edit-row td:first-child { padding: 0 20px 12px; width: auto; }
.je-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-m);
  box-shadow: 0 0 0 .5px var(--hair); }
.je-inline-field { color: var(--ink-2); }
.je-qty-in { width: 92px; }
.je-unit { color: var(--ink-2); font-size: 14px; }
.je-unit:empty { display: none; }
.je-inline-msg { flex-basis: 100%; }
.je-inline-msg:empty { display: none; }
.je-inline-msg .notice { margin: 2px 0 0; }
.je-inline-note { flex-basis: 100%; margin: 0; }
.je-confirm-t { flex-basis: 100%; margin: 0 0 2px; font-size: 14px; }
.je button.je-danger { background: var(--red); color: #fff; }
.je button.je-danger:hover { background: color-mix(in srgb, var(--red) 88%, #000); }
.je-group-confirm { margin: 0 20px 14px; }
.je .svc-head:has(.je-req-edit) { display: block; }
.je-req-edit { flex-direction: column; align-items: stretch; }
.je-req-edit input, .je-req-edit textarea { width: 100%; box-sizing: border-box; }
.je-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* messages */
.je-msg { padding: 0 20px; }
.je-msg:empty { display: none; }
.je-msg-acts { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 12px; }
.je-readonly { margin: 0; padding: 10px 20px 0; font-size: 13px; color: var(--ink-2); }
.je-saving { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }

/* what was just saved: a brief glow, and a short confirmation */
@keyframes je-glow { 0%, 35% { background-color: var(--accent-soft); } 100% { background-color: transparent; } }
.je-new { animation: je-glow 2.6s ease-out 1; }
@keyframes je-toast { 0% { opacity: 0; transform: translate(-50%, 8px); } 8%, 82% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 0); } }
.je-toast { animation: je-toast 3.4s ease forwards; pointer-events: none; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }

/* the Add service sheet */
.je-layer { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
@keyframes je-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes je-rise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes je-up { from { transform: translateY(100%); } to { transform: none; } }
.je-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .3); animation: je-fade .18s ease; }
.je-sheet { position: relative; width: min(580px, 100%); max-height: min(780px, calc(100vh - 48px)); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-pop); overflow: hidden; animation: je-rise .22s cubic-bezier(.2, .8, .2, 1); }
.je-sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--hair); }
.je-sheet-head > :first-child { justify-self: start; }
.je-close { justify-self: end; }
.je-title, .focus-app .je-title { margin: 0; font-size: 16px; text-align: center; }
.je-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 20px; }
.je-box { padding: 0 20px; }
.je-box:empty { display: none; }
.je-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--hair); }
.je-foot:empty { display: none; }
.je-foot button.primary { min-width: 150px; min-height: 40px; }
.je-loading { font-size: 14px; }

.je-choices, .je-picks { display: flex; flex-direction: column; gap: 2px; margin: -6px -10px; }
.je button.je-choice, .je button.je-pick { display: grid; justify-content: stretch; align-items: start; gap: 2px; width: 100%; min-height: 0; padding: 12px;
  text-align: left; white-space: normal; background: transparent; border-radius: var(--r-m); }
.je button.je-choice:hover, .je button.je-pick:hover { background: var(--fill); }
.je-choice-t, .je-pick-t { font-size: 15px; font-weight: 600; color: var(--ink); }
.je-choice-s, .je-pick-s { font-size: 13px; font-weight: 400; color: var(--ink-2); }
.je button.je-pick { grid-template-columns: 1fr auto; column-gap: 16px; }
.je-pick-v { grid-column: 2; grid-row: 1 / 3; align-self: center; font-weight: 600; color: var(--ink); }

.je-review-name { font-size: 17px; margin-bottom: 6px; }
.je-review .lines td, .je-review .lines td:first-child { padding: 7px 12px 7px 0; }
.je-review .lines td:last-child { padding-right: 0; }
.je-review-sum { display: flex; justify-content: space-between; padding: 10px 0; margin-bottom: 6px; border-top: 1px solid var(--hair); font-size: 14px; }
.je-review-sum .warn { color: var(--amber); font-weight: 500; }
.je-review-sec { margin: 14px 0; }
.je-review-sec h3 { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.je-list { margin: 0; padding-left: 18px; font-size: 14px; }
.je-list li { margin: 3px 0; }

.je-form, .je-tires { display: flex; flex-direction: column; gap: 12px; }
.je-field { display: flex; flex-direction: column; gap: 4px; }
.je-field input, .je-field select, .je-field textarea { width: 100%; box-sizing: border-box; }
.je-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.je-line-total { min-height: 20px; font-size: 14px; color: var(--ink-2); }
.je-line-total strong { color: var(--ink); }
.je-seg { margin: 14px 0 12px; }
.je-search { display: flex; flex-wrap: wrap; gap: 8px; }
.je-search input { flex: 1; min-width: 180px; }
.je-chips { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.je button.je-chip { min-height: 28px; padding: 0 12px; font-size: 13px; }
.je-results { margin-top: 10px; }
.je-cand { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--hair); }
.je-cand:last-child { border-bottom: 0; }
.je-cand-meta { margin-top: 2px; font-size: 12.5px; color: var(--ink-2); }
.je-cand-meta .l-flag { color: var(--amber); font-weight: 500; }
.je-cand-acts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.je-cand-acts button { min-height: 30px; padding: 0 12px; font-size: 13px; }
.je-on { font-size: 12.5px; font-weight: 500; color: var(--green); }

@media (prefers-reduced-motion: reduce) {
  .je-sheet, .je-scrim { animation: none; }
  .je-toast { animation-name: je-fade; }
}

/* phones: the sheet rises from the bottom; row actions sit under the amount */
@media (max-width: 640px) {
  .je-layer { align-items: flex-end; padding: 0; }
  .je-sheet { width: 100%; max-height: calc(100vh - 36px); border-radius: var(--r-l) var(--r-l) 0 0; padding-bottom: env(safe-area-inset-bottom);
    animation: je-up .28s cubic-bezier(.2, .8, .2, 1); }
  .je-body { padding: 14px 16px; }
  .je-box { padding: 0 16px; }
  .je-foot { padding: 10px 16px 14px; }
  .je-foot button.primary { flex: 1; }
  .je .lines td.l-act { grid-column: 3; grid-row: 2; width: auto; padding: 0; text-align: right; }
  .je .lines td.l-act:empty { display: none; }
  .je button.je-qty { margin-right: 0; padding: 0 6px; min-height: 24px; font-size: 12px; }
  .je .lines tr.je-edit-row { display: block; padding: 0 16px 10px; }
  .je .lines tr.je-edit-row td { display: block; padding: 0; }
  .je-foot-acts { padding: 0 8px 10px; }
  .je-group-confirm { margin: 0 16px 12px; }
  .je-msg { padding: 0 16px; }
  .je-readonly { padding: 10px 16px 0; }
}
/* Ratchet: the AI's write-up of an online booking */
.je-ai { margin: 0 0 14px; }
.je-ai p { margin: 4px 0 0; }
.je-ai .je-sub { color: var(--muted, #6b6b70); font-size: 13px; }
/* Oct 20: one-tap pricing */
.je-pw .je-act { font-weight: 650; }
/* PA16 parts markup: a stocked part's suggested price (cost + the shop's markup) in the Custom line form */
.je-pp-list { display: flex; flex-direction: column; }
.je-pp-list:empty { display: none; }
.je button.je-pp-pick { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 8px 10px;
  background: transparent; color: var(--ink); font-weight: 400; text-align: left; border-radius: 8px; border-bottom: 1px solid var(--hair); }
.je button.je-pp-pick:last-child { border-bottom: 0; }
.je button.je-pp-pick:hover { background: var(--fill); }
.je button.je-pp-pick.is-on { background: var(--accent-soft); }
.je-pp-t { min-width: 0; font-size: 14px; }
.je-pp-m { color: var(--ink-2); font-size: 12.5px; }
.je-pp-v { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.je-pp-v.is-none { color: var(--ink-3); font-weight: 500; font-size: 13px; }
.je-pp-note { margin: 2px 0 0; }
.je-pp-note:empty { display: none; }
.je-pp-note .je-pp-use { margin-left: 6px; }
/* B1 (navigation cleanup): room for a line's actions (Core charge, Discount, Remove) without squeezing its description */
@media (min-width: 641px) { .je .lines td.l-act { text-align: right; width: 170px; } }
.je .lines td.l-act button { display: inline-flex; vertical-align: middle; }

.je .je-counts { margin: 4px 0 0; }
.je .je-next { margin-top: 10px; }
@media (max-width: 640px) { .je-grid2.je-fee { grid-template-columns: minmax(0, 1fr); } }   /* B1: the fee name is not cut off on a phone */
/* B2: links to the older tools that still do something unique (until they have a home here) */
.je .je-tools { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; font-size: 13px; }
.je .je-rev-tools { margin: 0 0 8px; padding: 0 20px; }
.je a.je-tool { color: var(--accent); text-decoration: none; }
.je a.je-tool:hover { text-decoration: underline; }

/* Oct 22 (walkthrough #1252, 375 px): the header row, the history links and a line's actions wrap inside the card (the card's
   width itself comes from shop.css's one shrinkable job column). */
@media (max-width: 640px) {
  .je { min-width: 0; max-width: 100%; }
  .je .lines td.l-act { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; min-width: 0; }
  .je .est-top { flex-wrap: wrap; row-gap: 4px; }
  .je .est-rev { white-space: normal; }
  .je .je-tools, .je a.je-tool { min-width: 0; overflow-wrap: anywhere; }
  .je .je-rev-tools { padding: 0 16px; }
}
.je .je-note { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
/* Job page cleanup (Oct 22): a line's actions in one "…" menu */
.je .je-more-wrap { position: relative; display: inline-flex; justify-content: flex-end; }
.je button.je-more { min-height: 28px; min-width: 32px; padding: 0 8px; background: transparent; color: var(--ink-2); font-size: 16px; line-height: 1; border-radius: var(--r-s); }
.je button.je-more:hover, .je button.je-more[aria-expanded="true"] { background: var(--fill); color: var(--ink); }
.je .je-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; display: flex; flex-direction: column; align-items: stretch; min-width: 160px;
  padding: 4px; background: var(--surface, var(--bg)); border-radius: var(--r-m, 10px); box-shadow: 0 6px 24px rgba(0, 0, 0, .18), 0 0 0 .5px var(--hair); }
.je .je-menu[hidden] { display: none; }
.je .je-menu button { justify-content: flex-start; text-align: left; min-height: 34px; padding: 0 10px; background: transparent; color: var(--ink); border-radius: var(--r-s); white-space: nowrap; }
.je .je-menu button:hover { background: var(--fill); }
.je .je-menu button.je-x:hover { background: var(--red-soft); color: var(--red); }
.je button.je-see-approval { display: inline; min-height: 0; padding: 0; background: none; color: var(--accent); font: inherit; text-decoration: none; }
.je button.je-see-approval:hover { text-decoration: underline; }

/* Batch 30 (the approved look, 02-repair-order): the estimate under a square accent band with white italic lettering; each
   service a grey head row over its table, with one column header row; numbers right-aligned. The "…" menu and the Add part /
   Add labor / Add fee actions stay as they are (no big duplicate buttons). The shell and shop.css components aren't restyled. */
.je-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.je .est-top.band { border-bottom: 0; padding: 9px 18px; }   /* stream A's .band; shop.css's older .est-top padding and border give way */
.je .est-top .est-rev button.link, .je .est-top .est-rev a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.je .je-groups { padding: 4px 12px 0; display: flex; flex-direction: column; gap: 12px; }
.je .svc { border: 0; border-radius: var(--r-s); box-shadow: 0 0 0 .5px var(--hair); overflow: hidden; background: var(--surface); }
.je .svc-head { background: var(--surface-2); padding: 12px 16px; align-items: center; }
.je .svc-total { font-variant-numeric: tabular-nums; }
.je .lines { margin: 0 0 4px; }
.je .lines thead th { padding: 9px 20px 8px 0; font: 500 11.5px/1.2 var(--font); letter-spacing: .03em; text-transform: uppercase; color: var(--ink-2); text-align: left;
  background: var(--surface-2); border-bottom: 1px solid var(--hair); white-space: nowrap; }   /* the shared .tbl header look; .lines keeps its own phone layout */
.je .lines thead th:first-child { padding-left: 16px; }
.je .lines thead th.l-qty, .je .lines thead th.l-unit, .je .lines thead th.l-amt { text-align: right; }
.je .lines tbody tr + tr td { border-top: .5px solid var(--hair); }
.je .lines td:first-child { padding-left: 16px; }
.je .lines td.l-kind { font-size: 13px; color: var(--ink); }
.je .lines td.l-qty, .je .lines td.l-unit, .je .lines td.l-amt { font-variant-numeric: tabular-nums; }
.je .lines td.l-unit { color: var(--ink); }
.je .je-foot-acts { padding: 6px 10px 10px; margin-top: 0; border-top: .5px solid var(--hair); }
.je .je-foot-acts button.je-add-line::before { content: "+"; margin-right: 5px; font-weight: 600; }
.je .svc-empty { padding: 12px 16px; }
@media (max-width: 640px) {
  .je .lines thead { display: none; }
  .je .je-groups { padding: 4px 8px 0; }
  .je .lines td:first-child { padding-left: 0; }
  .je .lines tbody tr + tr td { border-top: 0; }   /* rows are grids here: one divider per row, not per cell */
  .je .lines tbody tr + tr { border-top: .5px solid var(--hair); }
}
.je .est-top + .je-rev-tools { padding-top: 10px; }
.je.est.band-panel { box-shadow: none; }   /* the shared panel border only */
/* U20-C (408): the lines the customer decides as one */
.je-together-box { margin: 6px 0 8px; font-size: 14px; }
.je-together-box summary { cursor: pointer; font-weight: 600; }
.je-checks { display: grid; gap: 4px; margin: 6px 0; }
.je-check { display: flex; gap: 8px; align-items: center; }
.je-together-box input[type="text"] { width: 100%; box-sizing: border-box; min-height: 36px; margin-bottom: 6px; }
.je-together { font-weight: 500; }

/* Menus must escape both service and estimate cards; rounded surfaces no longer clip actions. */
.est.je.band-panel, .je .svc { overflow: visible; }
.je .est-top { border-radius: var(--r-s) var(--r-s) 0 0; }
.je .svc-head { border-radius: var(--r-s) var(--r-s) 0 0; }
.je .je-menu { max-width: calc(100vw - 32px); }
