/* Exceptional contracts (6.10.2026): the approvers' card and Irit's states
   (app/approvals-ui.js), the builder's "חוזה מותאם אישית" (index.html) and the
   approval column of quotes.html. Tokens only (tokens.css); phone first: one column
   at 360px, every target at least 44px. No pink here: a page keeps it for its one
   main action. */
.approvals-card {
  border-inline-start: 4px solid var(--ds-navy); border-radius: var(--ds-r-card); background: var(--ds-ground);
  padding: 14px 16px; margin: 0 0 var(--ds-gap); display: grid; gap: 10px; min-width: 0;
}
.approvals-card h2 { margin: 0; font-size: 20px; }
.approvals-card .hint { margin: 0; color: var(--ds-muted); font-size: 14px; }
.apv-sub { margin: 6px 0 0; font-size: 16px; }
.apv-item { border-radius: var(--ds-r-item); background: var(--ds-surface); padding: 14px; display: grid; gap: 8px; min-width: 0; }
.apv-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; }
.apv-title { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.apv-state { display: inline-block; border-radius: var(--ds-r-sm); padding: 2px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.apv-state.is-pending { color: var(--ds-amber); background: var(--ds-amber-soft); }
.apv-state.is-approved { color: var(--ds-ok); background: var(--ds-ok-soft); }
.apv-state.is-rejected { color: var(--ds-danger); background: var(--ds-danger-soft); }
.apv-meta { margin: 0; color: var(--ds-ink-2); font-size: 14px; overflow-wrap: anywhere; }
.apv-note { margin: 0; padding: 10px 12px; border-radius: var(--ds-r-sm); background: var(--ds-danger-soft); color: var(--ds-ink); font-size: 14.5px; overflow-wrap: anywhere; white-space: pre-line; }
.apv-diff { border-radius: var(--ds-r-sm); background: var(--ds-amber-soft); padding: 10px 12px; }
.apv-diff h4 { margin: 0 0 4px; font-size: 14px; color: var(--ds-amber); }
.apv-diff ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 2px; font-size: 14.5px; color: var(--ds-ink); }
.apv-diff li { overflow-wrap: anywhere; }
.apv-facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 8px 14px; }
.apv-facts div { min-width: 0; }
.apv-facts dt { font-size: 12.5px; color: var(--ds-muted); }
.apv-facts dd { margin: 0; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.apv-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.apv-acts .btn { min-height: 44px; }
/* "מאשר": the card's own main action, navy and filled (pink stays the page's). */
.apv-yes { background: var(--ds-navy); border-color: var(--ds-navy); color: var(--ds-on-navy); }
.apv-yes:hover { background: var(--ds-navy-2); border-color: var(--ds-navy-2); color: var(--ds-on-navy); }
.apv-reject { display: grid; gap: 6px; }
.apv-reject label { font-weight: 600; font-size: 14.5px; }
.apv-reject textarea { min-height: 88px; }
.apv-own { font-size: 13.5px; }
.apv-hint { color: var(--ds-muted); font-size: 13px; }
dialog.apv-share { max-width: min(560px, calc(100vw - 32px)); }
@media (max-width: 480px) {
  .apv-acts .btn { flex: 1 1 40%; }
  .apv-acts .apv-yes { flex-basis: 100%; }
  .apv-facts { grid-template-columns: 1fr 1fr; }
}

/* quotes.html: the approval column. */
.apv-cell { display: grid; gap: 2px; font-size: 13px; max-width: 260px; }
.apv-cell .apv-state { justify-self: start; }
.apv-cell small { color: var(--ds-ink-2); overflow-wrap: anywhere; white-space: normal; }
.pill.awaiting { color: var(--ds-amber); }
.pill.rejected { color: var(--ds-danger); }

/* The builder: "חוזה מותאם אישית". A tile like the packages and the add-ons (the same
   surface, the same navy frame when chosen), with its fields opening under it. */
.custom-group { display: grid; gap: 0; }
.custom-head {
  display: flex; align-items: center; gap: 14px; min-height: 96px;
  padding: 16px; border-radius: var(--radius-md); border: 2px solid transparent; background: var(--bg-2);
  transition: border-color .2s, box-shadow .2s;
}
.custom-head:hover { border-color: var(--line); }
.custom-group.is-on .custom-head, .custom-group.is-on .custom-head:hover { border-color: var(--ds-navy); }
.custom-head label { flex: 1 1 auto; min-width: 0; display: grid; gap: 4px; cursor: pointer; }
.custom-head .t { font-weight: 600; font-size: 16px; line-height: 1.35; color: var(--ds-ink); }
.custom-head .s { font-size: 13px; line-height: 1.5; color: var(--muted); }
.custom-body { display: grid; gap: 16px; margin-top: 12px; padding: 16px; border-radius: var(--radius-md); background: var(--ds-ground); }
.custom-sec { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px; }
.custom-sec legend { padding: 0; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.custom-sec .sub { margin: 0; color: var(--ds-muted); font-size: 13px; }
.custom-qty { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.custom-q { background: var(--ds-surface); border-radius: var(--ds-r-ctl); padding: 10px 12px; display: grid; gap: 6px; min-width: 0; }
.custom-q.is-changed { box-shadow: inset 0 0 0 2px var(--ds-amber-line); }
.custom-q label { font-size: 14px; font-weight: 600; }
.custom-q .was { font-size: 12.5px; color: var(--ds-muted); }
/* 44px targets (the page's older steppers are 42px high with 40px buttons). */
.custom-q .stepper { justify-self: start; grid-template-columns: 46px 60px 46px; height: 47px; }
.custom-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.custom-money .field { min-width: 0; }
.custom-money .discount-input { inline-size: 100%; }
.custom-money small { color: var(--ds-muted); font-size: 12.5px; }
.custom-lines { display: grid; gap: 8px; }
.custom-line { display: grid; grid-template-columns: minmax(0, 1fr) 84px 120px 44px; gap: 6px; align-items: end; background: var(--ds-surface); border-radius: var(--ds-r-ctl); padding: 8px; }
.custom-line label { font-size: 12.5px; color: var(--ds-muted); display: grid; gap: 2px; min-width: 0; }
.custom-line .x { min-height: 44px; min-width: 44px; border: 0; border-radius: var(--ds-r-sm); background: var(--ds-soft); color: var(--ds-ink); font-size: 18px; cursor: pointer; }
.custom-line .x:hover { background: var(--ds-soft-2); }
.custom-add { justify-self: start; min-height: 44px; }
.custom-diff { border-radius: var(--ds-r-item); background: var(--ds-amber-soft); padding: 12px 14px; }
.custom-diff h4 { margin: 0 0 6px; font-size: 15px; color: var(--ds-amber); }
.custom-diff ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 3px; font-size: 14.5px; }
.custom-diff p { margin: 0; font-size: 14px; color: var(--ds-ink-2); }
.custom-diff .needs { margin-top: 8px; font-weight: 600; color: var(--ds-ink); }
.sum-diff { margin: 10px 0 0; padding: 10px 12px; border-radius: var(--ds-r-sm); background: var(--ds-amber-soft); font-size: 13.5px; color: var(--ds-ink); }
.sum-diff strong { color: var(--ds-amber); }
.revise-note { display: block; margin: 0 0 var(--ds-gap); padding: 12px 14px; border-radius: var(--ds-r-item); background: var(--ds-danger-soft); color: var(--ds-ink); font-size: 14.5px; overflow-wrap: anywhere; }
.revise-note.is-plain { background: var(--ds-amber-soft); }
.pending-list { margin: 0 0 14px; padding-inline-start: 18px; display: grid; gap: 3px; color: var(--ds-ink); }
@media (max-width: 560px) {
  .custom-line { grid-template-columns: 1fr 1fr 44px; }
  .custom-line .l-label { grid-column: 1 / -1; }
}

/* The builder: "הכנת חוזה עם AI" (docs/ops.md, section 68), at the top of the custom contract.
   The pink button stays the page's one primary action (the link); this one is navy. */
.ai-box { display: grid; gap: 10px; margin-bottom: 12px; padding: 16px; border-radius: var(--radius-md); background: var(--ds-surface); box-shadow: inset 0 0 0 2px var(--ds-soft); min-width: 0; }
.ai-head { display: grid; gap: 4px; }
.ai-head .t { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; color: var(--ds-ink); }
.ai-head .s { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ds-muted); }
.ai-label { font-size: 14px; font-weight: 600; color: var(--ds-ink); }
/* 16px: a phone does not zoom into the field. */
.ai-box textarea { min-height: 92px; resize: vertical; font-size: 16px; line-height: 1.5; }
.ai-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ai-acts small { flex: 1 1 200px; color: var(--ds-muted); font-size: 12.5px; line-height: 1.45; }
.btn.ai-go { min-height: 48px; background: var(--ds-navy); border-color: var(--ds-navy); color: var(--ds-on-navy); }
.btn.ai-go:hover { background: var(--ds-navy-text); border-color: var(--ds-navy-text); color: var(--ds-on-navy); }
.ai-quiet { margin: 0; font-size: 14px; color: var(--ds-muted); }
.ai-result { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--ds-r-item); background: var(--ds-ground); outline: none; min-width: 0; }
.ai-result:focus-visible { box-shadow: 0 0 0 2px var(--ds-navy-mid); }
.ai-result h4 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ds-ink); }
.ai-result ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 3px; font-size: 14.5px; overflow-wrap: anywhere; }
.ai-result .ai-check-h { margin-top: 6px; color: var(--ds-amber); }
.ai-result #ai-check { padding: 8px 12px; padding-inline-start: 28px; border-radius: var(--ds-r-sm); background: var(--ds-amber-soft); }
.ai-notes, .ai-flag { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ds-ink-2); }
.ai-flag { font-weight: 600; color: var(--ds-ink); }
/* "מולא אוטומטית": a quiet navy tag on every field the AI filled, and a ring on its tile. */
.tag-ai { color: var(--ds-navy-text); background: var(--ds-soft); font-weight: 600; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ds-navy-mid) 40%, transparent); }
label .tag-ai, legend .tag-ai, h3 .tag-ai, .tile-title .tag-ai { margin-inline-start: 6px; vertical-align: 1px; }
.inf-text .tag-ai { justify-self: start; margin-top: 4px; }
.tier-top > .tag-ai { margin-top: 8px; grid-column: 1 / -1; justify-self: start; }
.tile.is-ai, .custom-q.is-ai { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-navy-mid) 45%, transparent); }
.discount-input.is-ai .input, textarea.input.is-ai { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-navy-mid) 45%, transparent); }
.sum-diff.is-ai { background: var(--ds-ok-soft); }
.sum-diff.is-ai strong { color: var(--ds-ok); }
.custom-diff .needs.is-ai { color: var(--ds-ok); }

/* deal.html: "חבילה מובנית" or "הצעה אחרת". */
.deal-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.deal-status.is-approval { color: var(--ds-amber); background: var(--ds-amber-soft); }
.deal-status.is-rejected { color: var(--ds-danger); background: var(--ds-danger-soft); }
.deal-custom-qty { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.deal-custom-qty .deal-num, .deal-custom-money .deal-num { max-width: none; }
.deal-custom-money { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Fields side by side stand on one grid (docs/ops.md, section 54): the labels share a
   row and start at its top, the inputs share the next one. (The first field of a card
   had its own top margin, so it stood higher than its neighbours; and a label that
   broke into two lines pushed its input down.) */
.deal-custom-qty, .deal-custom-money { grid-template-rows: auto auto; row-gap: 6px; align-items: end; margin-top: 12px; }
.deal-sec :is(.deal-custom-qty, .deal-custom-money) > .field { margin: 0; min-width: 0; display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 6px; align-content: end; }
.deal-sec :is(.deal-custom-qty, .deal-custom-money) > .field > label { margin: 0; align-self: start; overflow-wrap: anywhere; }
.deal-sec :is(.deal-custom-qty, .deal-custom-money) > .field > .input { inline-size: 100%; min-width: 0; }
@supports not (grid-template-rows: subgrid) {
  .deal-sec :is(.deal-custom-qty, .deal-custom-money) > .field { display: flex; flex-direction: column; justify-content: flex-end; }
  .deal-sec :is(.deal-custom-qty, .deal-custom-money) > .field > label { margin-bottom: 6px; }
}

/* quotes.html: a contract prepared with "הכנת חוזה עם AI" (docs/ops.md, section 68). */
.qtable .doc-ai { display: inline-flex; margin-top: 4px; }


/* "בדיוק כמו שכתבתי (חוזה חופשי)" (29.10.2026; docs/ops.md, section 79): the switch, the drafts. */
.ai-free { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 700; font-size: 15px; color: var(--ds-ink); }
.ai-free .switch { flex: none; }
.ai-free-hint { margin: -4px 0 0; font-size: 13px; line-height: 1.5; color: var(--ds-muted); }
.ai-drafts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 4px; }
.ai-draft { display: grid; gap: 2px; min-height: 56px; padding: 10px 12px; text-align: start; border-radius: var(--ds-r-sm); border: 2px solid var(--ds-soft); background: var(--ds-surface); color: var(--ds-ink); cursor: pointer; font: inherit; }
.ai-draft:hover { border-color: var(--ds-navy-mid); }
.ai-draft:focus-visible { outline: 2.5px solid var(--ds-navy-2); outline-offset: 2px; }
.ai-draft.is-on { border-color: var(--ds-navy); box-shadow: inset 0 0 0 1px var(--ds-navy); }
.ai-draft.is-done { background: var(--ds-ground); }
.ai-draft-t { font-weight: 700; font-size: 14.5px; overflow-wrap: anywhere; }
.ai-draft-s { font-size: 12.5px; color: var(--ds-muted); }
.ai-draft.is-done .ai-draft-s { color: var(--ds-green, #1f7a4d); font-weight: 600; }
.custom-flags { gap: 4px; }
.custom-flag { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-size: 14.5px; }
.custom-flag input:disabled + span { color: var(--ds-muted); }
.influencers.is-noinf { opacity: .45; }
.inf-none { margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--ds-ink); }
.sh-next { min-height: 44px; }

/* "שינויים להצעה הזו" (the managers, 9.11.2026; docs/ops.md, section 118): the package's price and
   its name for this quote only, under the packages. */
.quote-edit { margin-top: 14px; padding: 14px 16px; border-radius: var(--ds-r-item); border: 1px solid var(--ds-line); background: var(--ds-surface); }
.quote-edit .group-head { margin-bottom: 10px; }
.qe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.qe-grid .field { min-width: 0; }
.qe-grid .discount-input { inline-size: 100%; }
.qe-grid small { color: var(--ds-muted, #5B6680); font-size: 12.5px; }
.discount-input.is-changed .input { border-color: var(--ds-navy-text); box-shadow: 0 0 0 2px var(--ds-soft); }
@media (max-width: 640px) { .qe-grid .input { font-size: 16px; } }
/* Several influencers in one contract (16.11.2026): chips to add them, and with more than one the
   collabs and the stories as one small stepper per influencer. */
.custom-also { display: grid; gap: 6px; padding: 8px 0 4px; }
.custom-also[hidden] { display: none; }
.custom-also-h { font-size: 14.5px; font-weight: 600; color: var(--ds-ink); }
.custom-also-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.also-chip { min-height: 44px; padding: 0 16px; border-radius: var(--ds-r-pill, 999px); border: 1px solid var(--ds-line-strong); background: var(--ds-surface); color: var(--ds-ink); font: inherit; font-size: 14.5px; cursor: pointer; }
.also-chip[aria-pressed='true'] { background: var(--ds-navy); border-color: var(--ds-navy); color: var(--ds-on-navy); font-weight: 600; }
.also-chip[aria-pressed='true']::before { content: '✓ '; content: '✓ ' / ''; }
.also-chip:disabled { opacity: .45; cursor: not-allowed; }
.custom-also small { font-size: 12.5px; color: var(--ds-muted); line-height: 1.5; }
.custom-per { grid-column: 1 / -1; gap: 4px; }
.custom-per-h { font-size: 14px; font-weight: 600; }
.custom-per-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--ds-line); }
.custom-per-row:first-of-type { border-top: 0; }
.custom-per-row label { font-size: 14px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.custom-per .stepper { grid-template-columns: 46px 60px 46px; height: 47px; }
