/* Components. Every screen is built from these; no inline styles anywhere (enforced by tests). */

/* ── Glass and surfaces ───────────────────────────────────────── */
.glass {
  position: relative; background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(180%); backdrop-filter: blur(var(--blur)) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 0 var(--glass-lo), var(--glass-shadow);
}
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: var(--sheen); mix-blend-mode: var(--sheen-blend); }
.card {
  background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--card-shadow);
}
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px var(--pad-card) 6px; }
.card-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: 12.5px; color: var(--ink-3); }
.card-body { padding: 8px var(--pad-card) var(--pad-card); }
.card-foot { padding: 0 var(--pad-card) var(--pad-card); display: flex; gap: 8px; flex-wrap: wrap; }
@media (prefers-reduced-transparency: reduce) {
  .glass, .card { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface-solid); }
}

/* ── Buttons ───────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 16px;
  border-radius: var(--r-pill); border: 1px solid transparent; background: transparent; color: var(--ink);
  font: 500 13.5px/1 var(--font-ui); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--on-ink); box-shadow: 0 6px 16px -8px rgba(28, 26, 24, .6), inset 0 1px 0 rgba(255, 255, 255, .16); }
.btn.accent { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 18px -8px rgba(var(--accent-rgb), .7), inset 0 1px 0 rgba(255, 255, 255, .28); }
.btn.soft { background: var(--surface-sunk); border-color: var(--line); }
.btn.soft:hover { background: var(--line); }
.btn.glassy { background: var(--glassy-bg); border-color: var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi); }
.btn.danger { background: var(--rose-soft); color: var(--rose); border-color: rgba(166, 61, 76, .25); }
.btn.quiet { color: var(--ink-3); }
.btn.quiet:hover { color: var(--ink); background: var(--surface-sunk); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.icon { width: 36px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Pills, badges, keys, avatars ───────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.accent { color: var(--accent-ink); background: var(--accent-soft); }
.pill.sage { color: var(--sage); background: var(--sage-soft); }
.pill.amber { color: var(--amber); background: var(--amber-soft); }
.pill.rose { color: var(--rose); background: var(--rose-soft); }
.pill.sky { color: var(--sky); background: var(--sky-soft); }
.pill.plain { color: var(--ink-2); background: var(--surface-sunk); }
.kbd { font: 500 11px/1 var(--font-ui); color: var(--ink-3); padding: 4px 6px; border-radius: 6px; background: var(--surface-sunk); border: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 600; font-size: 12.5px; color: var(--accent-ink); background: var(--accent-soft); }
.ico-tile { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--surface-sunk); color: var(--ink-2); }
.ico-tile.accent { background: var(--accent-soft); color: var(--accent-ink); }
.ico-tile.sage { background: var(--sage-soft); color: var(--sage); }
.ico-tile.amber { background: var(--amber-soft); color: var(--amber); }
.ico-tile.rose { background: var(--rose-soft); color: var(--rose); }
.ico-tile.sky { background: var(--sky-soft); color: var(--sky); }

/* ── Lists ───────────────────────────────────────── */
.list { padding: 4px 0 8px; }
.row { display: flex; align-items: center; gap: 14px; padding: var(--row-pad) var(--pad-card); border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 550; font-size: 13.5px; }
.row .s { color: var(--ink-3); font-size: 12.5px; margin-top: 1px; }
.row .when { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
a.row { color: inherit; text-decoration: none; }
a.row:hover { background: var(--surface-sunk); }

.steps { padding: 2px 0 10px; }
.step { display: flex; gap: 14px; align-items: center; padding: 11px var(--pad-card); color: inherit; text-decoration: none; }
.step:hover { background: var(--surface-sunk); }
.step .ck { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1.5px solid var(--line-2); color: transparent; }
.step.done .ck { background: var(--sage); border-color: var(--sage); color: #fff; }
.step.done .t { color: var(--ink-3); }
.step .t { font-size: 13.5px; font-weight: 550; }
.step .s { font-size: 12.5px; color: var(--ink-3); }
.step .go { margin-left: auto; color: var(--ink-4); }

.progress { height: 6px; border-radius: 99px; background: var(--surface-sunk); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), rgba(var(--accent-rgb), .7)); }
.progress.w0 > span { width: 0; } .progress.w25 > span { width: 25%; } .progress.w50 > span { width: 50%; }
.progress.w75 > span { width: 75%; } .progress.w100 > span { width: 100%; }

/* ── Notices, empty states, prompts ───────────────────────────────── */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; font-size: 13px; line-height: 1.5; background: var(--surface-sunk); color: var(--ink-2); }
.notice svg { margin-top: 1px; }
.notice b { color: var(--ink); font-weight: 600; }
.notice.info { background: var(--sky-soft); } .notice.info svg { color: var(--sky); }
.notice.success { background: var(--sage-soft); } .notice.success svg { color: var(--sage); }
.notice.warning { background: var(--amber-soft); } .notice.warning svg { color: var(--amber); }
.notice.error { background: var(--rose-soft); } .notice.error svg { color: var(--rose); }

.empty { text-align: center; padding: 34px 20px; color: var(--ink-3); }
.empty .ico-tile { margin: 0 auto 12px; width: 44px; height: 44px; border-radius: 14px; }
.empty .t { font-weight: 600; color: var(--ink); font-size: 14.5px; margin-bottom: 4px; }

.prompt { display: flex; gap: 16px; align-items: center; padding: 20px 22px; border-radius: var(--r-lg); }
.prompt .ico-tile { width: 44px; height: 44px; border-radius: 14px; }
.prompt .t { font-weight: 600; font-size: 15px; }
.prompt .s { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; line-height: 1.5; }
.prompt .btn { margin-left: auto; }

/* ── Forms ───────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.fld label.lbl, .fld .lbl { display: block; font-size: 12.5px; font-weight: 550; color: var(--ink-2); margin-bottom: 6px; }
.fld .help, fieldset > .help { font-size: 12px; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }
.fld .err { font-size: 12px; color: var(--rose); margin-top: 6px; display: flex; gap: 5px; align-items: center; }
.input, select.input, textarea.input {
  width: 100%; height: var(--control-h); padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--surface-solid); color: var(--ink); font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.input::placeholder { color: var(--ink-4); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.fld.invalid .input { border-color: var(--rose); }
select.input { appearance: none; padding-right: 34px; background-image: url("../img/chevron.svg"); background-repeat: no-repeat; background-position: right 12px center; background-size: 14px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-sunk); color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.secret-saved { display: flex; align-items: center; gap: 10px; height: var(--control-h); padding: 0 6px 0 12px; border-radius: var(--r-sm); border: 1px dashed var(--line-2); background: var(--surface-sunk); font-size: 13.5px; color: var(--ink-2); }
.secret-saved svg { color: var(--sage); }
.secret-saved .btn { margin-left: auto; }

/* Segmented control: real radio buttons, styled */
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border-radius: var(--r-pill); background: var(--surface-sunk); border: 1px solid var(--line); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { padding: 7px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.seg input:checked + label { background: var(--surface-solid); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08), inset 0 1px 0 var(--glass-hi); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Choice cards: radio buttons as cards */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label { display: block; height: 100%; padding: 12px 14px; border-radius: 16px; border: 1.5px solid var(--line-2); background: var(--surface-solid); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.choice label .t { display: block; font-weight: 600; font-size: 13.5px; }
.choice label .s { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; line-height: 1.35; }
.choice input:checked + label { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.choice input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Toggle switch: a checkbox */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 42px; height: 26px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); transition: left .15s; }
.switch input:checked + .track { background: var(--sage); }
.switch input:checked + .track::after { left: 19px; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Color swatches */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch label { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font-size: 11.5px; color: var(--ink-3); }
.swatch .chip { width: 38px; height: 38px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1), 0 4px 10px -6px rgba(0, 0, 0, .4); }
.swatch input:checked + label .chip { box-shadow: 0 0 0 3px var(--surface-solid), 0 0 0 5px var(--ink); }
.swatch input:checked + label { color: var(--ink); font-weight: 600; }
.swatch input:focus-visible + label .chip { outline: 2px solid var(--accent); outline-offset: 4px; }
.chip.ember { background: #b9502a; } .chip.sage { background: #3f6b4d; } .chip.ocean { background: #2f5f8f; }
.chip.plum { background: #7a4a7e; } .chip.rose { background: #a63d4c; } .chip.graphite { background: #3d3b38; }
.chip.custom { background: conic-gradient(from 90deg, #e2725b, #e3b04b, #6aa874, #4b8fd1, #9a6bc4, #e2725b); }
.custom-color { display: none; align-items: center; gap: 8px; margin-top: 10px; }
.custom-color.show { display: flex; }
.custom-color input[type="color"] { width: 44px; height: 36px; border: 1px solid var(--line-2); border-radius: 10px; padding: 2px; background: var(--surface-solid); }

.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding-top: 18px; margin-top: 6px; border-top: 1px solid var(--line); }
.form-actions .left { margin-right: auto; }

/* ── Recovery codes, QR ───────────────────────────────── */
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; padding: 16px 18px; border-radius: 16px; background: var(--surface-sunk); font-size: 15px; }
.qr { width: 196px; height: 196px; padding: 10px; border-radius: 18px; background: #fff; box-shadow: var(--card-shadow); }
.qr svg { width: 100%; height: 100%; }
.secret-key { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: var(--surface-sunk); word-break: break-all; }

/* ── Toasts ───────────────────────────────────────── */
.toasts { position: fixed; z-index: 60; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 44px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px 12px 14px; border-radius: 18px; font-size: 13.5px; line-height: 1.45; animation: toast-in .35s cubic-bezier(.2, .7, .2, 1) both; }
.toast .ico { margin-top: 1px; }
.toast.success .ico { color: var(--sage); } .toast.error .ico { color: var(--rose); } .toast.warning .ico { color: var(--amber); } .toast.info .ico { color: var(--sky); }
.toast .x { margin-left: 6px; color: var(--ink-4); background: none; border: 0; cursor: pointer; padding: 0; }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ── Dialogs and command palette ───────────────────────────────── */
dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: none; }
dialog::backdrop { background: rgba(20, 14, 10, .28); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dlg { width: min(460px, calc(100vw - 32px)); border-radius: var(--r-xl); padding: 22px; }
.dlg h2 { font-family: var(--font-display); font-weight: 380; font-size: 24px; margin-bottom: 6px; }
.dlg p { color: var(--ink-2); line-height: 1.55; }
.dlg .btn-row { justify-content: flex-end; margin-top: 18px; }
.cmdk { width: min(620px, calc(100vw - 32px)); border-radius: var(--r-xl); margin-top: 12vh; overflow: hidden; }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmdk-input input { flex: 1; border: 0; background: transparent; font-size: 16px; outline: none; }
.cmdk-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmdk-results a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; color: inherit; text-decoration: none; }
.cmdk-results a:hover, .cmdk-results a.active { background: var(--surface-sunk); }
.cmdk-results .k { margin-left: auto; font-size: 11.5px; color: var(--ink-4); }
.cmdk-results .t { font-weight: 550; font-size: 13.5px; }
.cmdk-results .txt { flex: 1; min-width: 0; }
.cmdk-results .s { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-results .t { display: block; }
.cmdk-input input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.cmdk-hint { padding: 14px 18px; font-size: 12.5px; color: var(--ink-3); }

/* ── Tables ───────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 550; color: var(--ink-3); padding: 8px var(--pad-card); border-bottom: 1px solid var(--line); }
.table td { padding: var(--row-pad) var(--pad-card); border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }

/* ── Skeleton ───────────────────────────────────────── */
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--surface-sunk), var(--line), var(--surface-sunk)); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; height: 14px; }
.skel.w60 { width: 60%; } .skel.w40 { width: 40%; } .skel.tall { height: 38px; }
@keyframes skel { to { background-position: -200% 0; } }

fieldset.bare, fieldset.fld { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.bare legend, fieldset.fld legend { padding: 0; margin-bottom: 8px; }
.sp-12 { height: 12px; }
.sp-20 { height: 20px; }

/* Checkbox chips (multichoice) */
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check label { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface-solid); font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.check input:checked + label { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.check input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Brand editor */
.brand-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 440px); gap: 16px; align-items: start; }
.brand-preview { position: sticky; top: 90px; border-radius: var(--r-xl); padding: 12px; }
.brand-preview iframe { width: 100%; height: 560px; border: 0; border-radius: 20px; background: #fff; display: block; }
.brand-preview .bar-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px 12px; }
.opt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt label { display: block; height: 100%; padding: 12px; border-radius: 18px; border: 1.5px solid var(--line-2); background: var(--surface-solid); cursor: pointer; }
.opt input:checked + label { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.opt input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt .t { display: block; font-weight: 600; font-size: 13.5px; margin-top: 8px; }
.opt .s { display: block; font-size: 12px; color: var(--ink-3); line-height: 1.35; }
.swatch-row { display: flex; height: 34px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.swatch-row span { flex: 1; }
.font-sample { display: block; font-size: 26px; line-height: 1.1; color: var(--ink); }
.cover-mini { display: block; height: 64px; border-radius: 10px; background: var(--surface-sunk); position: relative; overflow: hidden; }
.cover-mini::before, .cover-mini::after { content: ""; position: absolute; }
.cm-full::before { inset: 0; background: linear-gradient(135deg, rgba(var(--accent-rgb), .45), rgba(var(--accent-rgb), .15)); }
.cm-full::after { left: 22%; right: 22%; bottom: 8px; height: 16px; border-radius: 8px; background: rgba(255, 255, 255, .7); }
.cm-split::before { left: 0; top: 0; bottom: 0; width: 58%; background: linear-gradient(135deg, rgba(var(--accent-rgb), .45), rgba(var(--accent-rgb), .15)); }
.cm-split::after { right: 10%; width: 24%; top: 26px; height: 10px; border-radius: 6px; background: var(--ink-4); }
.cm-classic::before { left: 34%; right: 34%; top: 8px; height: 8px; border-radius: 6px; background: var(--ink-4); }
.cm-classic::after { left: 14%; right: 14%; top: 22px; bottom: 0; border-radius: 8px 8px 0 0; background: linear-gradient(135deg, rgba(var(--accent-rgb), .45), rgba(var(--accent-rgb), .15)); }
.logo-box { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 16px; background: var(--surface-sunk); }
.logo-box img { max-height: 48px; width: auto; background: #fff; border-radius: 8px; padding: 6px; }
.history-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.history-row:first-child { border-top: 0; }
@media (max-width: 1100px) { .brand-grid { grid-template-columns: minmax(0, 1fr); } .brand-preview { position: static; } }

/* Galleries (admin) */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 2px 16px; }
.tabs a { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--ink-3); text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--current-bg); box-shadow: var(--current-shadow); }
.tabs .c { font-size: 11px; color: var(--ink-4); }
.g-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.g-card { display: block; border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: inherit; }
.g-card .thumb { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--accent-soft), var(--surface-sunk)); overflow: hidden; }
.g-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.g-card:hover .thumb img { transform: scale(1.03); }
.g-card .meta { padding: 12px 14px 14px; }
.g-card .t { font-weight: 600; font-size: 14px; }
.g-card .s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.g-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.set-nav { padding: 10px 8px; border-radius: var(--r-lg); position: sticky; top: 90px; }
.set-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 34px; padding: 0 12px; border-radius: 11px; color: var(--ink-2); text-decoration: none; font-size: 13px; font-weight: 500; }
.set-nav a:hover { background: var(--surface-sunk); }
.set-nav a[aria-current="page"] { background: var(--current-bg); color: var(--ink); box-shadow: var(--current-shadow); }
.set-nav .n { font-size: 11.5px; color: var(--ink-4); }
.set-nav form { padding: 8px 4px 2px; display: flex; gap: 6px; }
.set-nav .input { height: 32px; font-size: 13px; }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); padding: 22px; text-align: center; color: var(--ink-3); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone b { color: var(--ink); }
.file-pick { position: relative; overflow: hidden; display: inline-flex; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.up-list { list-style: none; margin: 10px 0 0; padding: 0; max-height: 200px; overflow: auto; }
.up-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 140px; gap: 10px; align-items: center; padding: 6px 0; font-size: 12.5px; border-top: 1px solid var(--line); }
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-bar { height: 5px; border-radius: 99px; background: var(--surface-sunk); overflow: hidden; }
.up-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.up-row.ok .up-bar span { background: var(--sage); width: 100%; }
.up-row.bad .up-state { color: var(--rose); }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ph { position: relative; border-radius: 14px; overflow: hidden; background: var(--surface-sunk); aspect-ratio: 1; cursor: grab; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.dragging { opacity: .4; }
.ph.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.ph .ph-check { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.ph .ph-badges { position: absolute; bottom: 6px; left: 6px; right: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.ph .ph-badges .pill { height: 20px; font-size: 11px; padding: 0 7px; background: rgba(255, 255, 255, .9); color: #1c1a18; }
.ph .ph-state { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--ink-3); }
.bulk-bar { position: sticky; bottom: 16px; z-index: 9; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-radius: 99px; margin-top: 14px; }
.bulk-bar select.input { width: auto; height: 32px; font-size: 13px; }
.link-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--surface-sunk); font-size: 13px; min-width: 0; max-width: 100%; }
.link-box code { flex: 1 1 180px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-group { padding: 4px 0 14px; }
.fav-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; margin-top: 8px; }
.fav-strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.size-table input.input { height: 32px; font-size: 13px; padding: 0 8px; }
.size-table td { padding-top: 6px; padding-bottom: 6px; }
.size-table .err-note { font-size: 11.5px; color: var(--rose); }
.money-in { display: flex; align-items: center; gap: 4px; }
@media (max-width: 900px) { .g-layout { grid-template-columns: minmax(0, 1fr); } .set-nav { position: static; } .up-row { grid-template-columns: 1fr 80px; } .up-row .up-state { grid-column: 1 / -1; } }

/* File inputs: designed button instead of the browser default */
input[type="file"].input { height: auto; padding: 6px; font-size: 13px; color: var(--ink-3); }
input[type="file"].input::file-selector-button { font: 500 13px var(--font-ui); color: var(--ink); background: var(--surface-sunk); border: 1px solid var(--line-2);
  border-radius: 999px; padding: 7px 14px; margin-right: 10px; cursor: pointer; }
input[type="file"].input::file-selector-button:hover { background: var(--line); }

/* Inputs inside button rows size to content; stacked page cards get breathing room */
.btn-row .input { width: auto; flex: 1 1 180px; max-width: 420px; }
.card-foot > form.btn-row { flex: 1 1 auto; }
#main > .card + .card, #main > section + section.card, #main > .card + section { margin-top: var(--gap); }

/* ---------- CRM ---------- */
.crm-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.crm-grid > .stack, .crm-side { display: flex; flex-direction: column; gap: var(--gap); }
.hero { position: relative; border-radius: var(--r-xl); overflow: hidden; min-height: 232px; margin-bottom: 16px; isolation: isolate;
  background: radial-gradient(120% 140% at 0% 0%, rgba(var(--accent-rgb), .55), transparent 60%), radial-gradient(120% 120% at 100% 100%, #3d2f28, #1c1714); }
.hero-img { position: absolute; inset: 0; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; display: block; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(20,14,10,.05) 0%, rgba(20,14,10,.14) 45%, rgba(20,14,10,.55) 100%); pointer-events: none; }
.hero-top { position: absolute; z-index: 1; top: 16px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px; color: #fff; font-size: 13px; font-weight: 500; text-decoration: none;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); box-shadow: inset 0 1px 0 rgba(255,255,255,.4); }
.crumb a { color: #fff; text-decoration: none; }
.hero-card { position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 16px; border-radius: 24px; padding: 18px 22px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.12)); border: 1px solid rgba(255,255,255,.38);
  -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 20px 40px -20px rgba(0,0,0,.5); color: #fff; }
.hero-card h1 { font-family: var(--font-display); font-weight: 330; font-size: 40px; line-height: 1.02; letter-spacing: -0.02em; text-shadow: 0 1px 12px rgba(0,0,0,.25); }
.hero-card .sub { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13.5px; }
.hero-card .sub span { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.hero-stat { padding-left: 22px; border-left: 1px solid rgba(255,255,255,.3); }
.hero-stat.first { margin-left: auto; }
.hero-stat .l { font-size: 12px; opacity: .9; white-space: nowrap; }
.hero-stat .v { font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.hero .btn.white { background: #fff; color: #1c1a18; border-color: transparent; }
.hero .btn.ghost { color: #fff; background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.35); }
.stages { display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 99px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.stages form { flex: 1; min-width: max-content; display: flex; }
.stage { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 12px; border: 0; border-radius: 99px; font: 500 12.5px var(--font-ui); color: var(--ink-3); background: transparent; cursor: pointer; white-space: nowrap; }
.stage:hover { color: var(--ink); }
.stage.done { color: var(--sage); }
.stage.cur { background: var(--ink); color: var(--on-ink); box-shadow: 0 8px 18px -10px rgba(0,0,0,.6); cursor: default; }
.stage .n { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; background: var(--surface-sunk); }
.stage.cur .n { background: rgba(255,255,255,.18); }
.stage.done .n { background: var(--sage-soft); }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 14px; padding: 4px var(--pad-card) 18px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.people { display: flex; flex-direction: column; gap: 12px; padding: 4px var(--pad-card) 16px; }
.person { display: flex; align-items: center; gap: 10px; }
.person .s { font-size: 12.5px; color: var(--ink-3); }
.inst { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 11px var(--pad-card); border-top: 1px solid var(--line); font-size: 13.5px; }
.inst .b { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.inst .b.later { background: var(--line-2); }
.inst .amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.inst .when { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
.summary { margin: 0 var(--pad-card) var(--pad-card); padding: 14px 16px; border-radius: 16px; background: var(--sage-soft); color: var(--ink-2); font-size: 13.5px; line-height: 1.55; display: flex; gap: 10px; }
.summary svg { color: var(--sage); margin-top: 2px; flex: none; }
.summary.error { background: var(--rose-soft); } .summary.error svg { color: var(--rose); }
.tline { position: relative; margin: 6px calc(var(--pad-card) + 64px) 14px calc(var(--pad-card) + 30px); height: 112px; }
.tline .bar { position: absolute; left: 0; right: 0; top: 40px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent-soft), var(--accent) 70%, var(--ink)); opacity: .7; }
.tline .pt { position: absolute; top: 0; transform: translateX(-50%); text-align: center; width: 92px; }
.tline .pt .k { font-size: 11.5px; color: var(--ink-3); height: 30px; display: flex; align-items: flex-end; justify-content: center; line-height: 1.2; }
.tline .pt .d { width: 14px; height: 14px; border-radius: 50%; margin: 3px auto 6px; background: var(--surface-solid); border: 3px solid var(--accent); }
.tline .pt .a { font-family: var(--font-display); font-size: 17px; white-space: nowrap; }
.tline .pt.ev .d { border-color: var(--ink); background: var(--ink); }
.tline .pt.ev .k, .tline .pt.ev .a { visibility: hidden; }
.tline .ev-l { position: absolute; left: 100%; top: 30px; transform: translateX(10px); font-size: 12px; color: var(--ink-3); white-space: nowrap; line-height: 1.25; }
.tline .pt .k2 { display: none; font-size: 11.5px; color: var(--ink-3); }
.tline .pt.alt .k { visibility: hidden; } .tline .pt.alt .k2 { display: block; }
.notes .row { align-items: flex-start; }
.notes .body { white-space: pre-wrap; font-size: 13.5px; line-height: 1.5; }
.tl { padding: 4px var(--pad-card) 16px; }
.tl .ev { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 10px; padding: 7px 0; font-size: 13px; }
.tl .ev i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); margin: 6px 0 0 3px; display: block; }
.tl .ev .when { color: var(--ink-4); font-size: 12px; white-space: nowrap; }
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px var(--pad-card) var(--pad-card); }
.strip img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; display: block; }
/* lists and board */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 2px 16px; }
.filters .tabs { margin: 0; }
.filters .search { margin-left: auto; display: flex; gap: 6px; }
.filters .search .input { width: 220px; height: 34px; }
.table a.t { color: var(--ink); text-decoration: none; font-weight: 550; }
.table a.t:hover { text-decoration: underline; }
.table .s { color: var(--ink-3); font-size: 12.5px; }
.table tbody tr:hover td { background: var(--surface-sunk); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { border-radius: var(--r-lg); padding: 10px; min-height: 160px; background: var(--glassy-bg); border: 1px solid var(--line); }
.col.over { outline: 2px dashed var(--accent-line); outline-offset: -4px; }
.col-hd { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 10px; font-size: 13px; font-weight: 600; }
.col-hd .c { color: var(--ink-4); font-weight: 500; font-size: 12px; }
.col-more { display: block; margin: 8px 6px 2px; font-size: 12.5px; color: var(--ink-3); }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 16px 16px; }
.pager > :last-child { justify-self: end; }
.bcard { display: block; padding: 12px 14px; margin-bottom: 8px; border-radius: 16px; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--card-shadow); color: var(--ink); }
.bcard[draggable="true"] { cursor: grab; }
.bcard.dragging { opacity: .45; }
.bcard .t { font-weight: 600; font-size: 13.5px; color: var(--ink); text-decoration: none; }
.bcard .s { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; display: flex; justify-content: space-between; gap: 8px; }
.bcard .move { margin-top: 8px; display: flex; gap: 6px; }
.bcard .move select { height: 30px; font-size: 12px; flex: 1; min-width: 0; }
/* repeaters */
.rep-row { display: grid; gap: 8px; align-items: center; }
.rep-row + .rep-row { margin-top: 8px; }
.rep-person { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.3fr) minmax(0, .9fr) minmax(0, .7fr) 34px; }
.rep-venue { grid-template-columns: minmax(0, .6fr) minmax(0, 1.1fr) minmax(0, 1.4fr) 34px; }
.rep-line { grid-template-columns: 18px minmax(0, 1fr) 34px; }
.rep-line .grip, .prow .grip { color: var(--ink-4); cursor: grab; display: grid; place-items: center; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; }
.icon-btn:hover { background: var(--surface-sunk); color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: default; }
/* settings: packages, schedules */
.cols-3 { display: grid; grid-template-columns: 250px minmax(0, 1fr); grid-template-areas: "list edit" "prev edit"; gap: var(--gap); align-items: start; }
.cols-3 > :nth-child(1) { grid-area: list; } .cols-3 > :nth-child(2) { grid-area: edit; } .cols-3 > .prev-col { grid-area: prev; }
@container (min-width: 1080px) { .cols-3 { grid-template-columns: 260px minmax(0, 1fr) 300px; grid-template-areas: "list edit prev"; } }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: var(--gap); align-items: start; }
.pkg-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 2px 6px; border-radius: 14px; color: var(--ink); text-decoration: none; }
.pkg-item:hover { background: var(--surface-sunk); }
.pkg-item[aria-current="page"] { background: var(--current-bg); box-shadow: var(--current-shadow); }
.pkg-item .th { width: 40px; height: 40px; border-radius: 10px; flex: none; object-fit: cover; background: linear-gradient(135deg, var(--accent-soft), var(--surface-sunk)); display: block; }
.pkg-item .t { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.pkg-item .s { color: var(--ink-3); font-size: 12px; }
.pkg-item .p { margin-left: auto; font-family: var(--font-display); font-size: 17px; white-space: nowrap; }
.pkg-item.off .t, .pkg-item.off .p { color: var(--ink-4); }
.pkg-photo { position: relative; height: 150px; border-radius: 18px; overflow: hidden; background: linear-gradient(135deg, var(--accent-soft), var(--surface-sunk)); display: grid; place-items: center; color: var(--ink-3); font-size: 13px; }
.pkg-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pkg-photo form { position: absolute; right: 10px; bottom: 10px; }
.pkg-prev { margin: 0 var(--pad-card) var(--pad-card); padding: 14px; border-radius: 22px; background: linear-gradient(160deg, var(--accent-soft), var(--surface-sunk)); }
.pkg-card { border-radius: 18px; padding: 16px; background: var(--surface-solid); border: 1.5px solid var(--accent-line); }
.pkg-card .badge { display: inline-block; font-size: 11px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); padding: 3px 9px; border-radius: 99px; margin-bottom: 8px; }
.pkg-card .hd { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.pkg-card .nm { font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.pkg-card .pr { font-family: var(--font-display); font-size: 22px; white-space: nowrap; }
.pkg-card .ds { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.pkg-card .inst-note { font-size: 12px; color: var(--ink-3); text-align: right; }
.pkg-card ul { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 7px; font-size: 13px; }
.pkg-card li { display: flex; gap: 8px; } .pkg-card li svg { color: var(--accent); flex: none; margin-top: 2px; }
.tpls { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 99px; font-size: 13px; font-weight: 500; background: var(--surface-sunk); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; }
.tpl[aria-current="page"] { background: var(--ink); color: var(--on-ink); border-color: transparent; }
.prow { display: grid; grid-template-columns: 18px minmax(0, 1fr) 210px 34px; grid-template-areas: "grip label amount rm" ". due due ."; gap: 8px 10px; align-items: center; padding: 12px var(--pad-card); border-top: 1px solid var(--line); }
.prow > .grip { grid-area: grip; } .prow > input[name=label] { grid-area: label; } .prow > .amt-in { grid-area: amount; } .prow > .due-in { grid-area: due; } .prow > [data-rep-remove] { grid-area: rm; }
.prow.head { grid-template-areas: "grip label amount rm"; }
.prow.head { border-top: 0; padding-top: 2px; padding-bottom: 6px; font-size: 12px; color: var(--ink-4); font-weight: 500; }
.amt-in { display: flex; gap: 6px; }
.amt-in .input { min-width: 0; }
.amt-in select { width: 96px; flex: none; }
.amt-in input[hidden] + select { flex: 1; width: auto; }
.due-in { display: flex; gap: 6px; }
.due-in .days { width: 84px; flex: none; }
.due-in select { flex: 1; min-width: 0; }
.used-row { display: flex; align-items: center; gap: 8px; padding: 10px var(--pad-card); border-top: 1px solid var(--line); font-size: 13px; }
.used-row .pill { margin-left: auto; }
.mini-portal { margin: 0 var(--pad-card) var(--pad-card); border-radius: 22px; padding: 14px; background: linear-gradient(160deg, var(--accent-soft), var(--surface-sunk)); }
.mini-portal .pm { border-radius: 16px; padding: 14px; background: var(--surface-solid); border: 1px solid var(--line); }
.mini-portal h3 { font-family: var(--font-display); font-weight: 400; font-size: 20px; margin-bottom: 8px; }
.mini-portal .r { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; padding: 7px 0; border-top: 1px solid var(--line); }
.edit-table td { vertical-align: middle; }
.edit-table .input { height: 36px; }
.edit-table .actions { white-space: nowrap; text-align: right; }
.cf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 980px) {
  .crm-grid, .cols-2, .cols-3 { grid-template-columns: minmax(0, 1fr); grid-template-areas: "list" "edit" "prev"; }
  .hero-card { position: relative; left: auto; right: auto; bottom: auto; margin: 120px 12px 12px; }
  .hero-stat.first { margin-left: 0; }
  .rep-person, .rep-venue { grid-template-columns: 1fr 34px; }
  .rep-person > :not(:first-child):not(:last-child), .rep-venue > :not(:first-child):not(:last-child) { grid-column: 1; }
  .prow { grid-template-columns: minmax(0, 1fr) 34px; grid-template-areas: "label rm" "amount amount" "due due"; } .prow > .grip { display: none; } .prow.head { display: none; }
  .filters .search { margin-left: 0; width: 100%; } .filters .search .input { flex: 1; width: auto; }
}
.dlg.wide { width: min(720px, calc(100vw - 32px)); }
.pkg-item .s { display: block; }
.input-group .addon.pre { border-left: 1px solid var(--line-2); border-right: 0; border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .addon.pre + .input { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.tpl { gap: 6px; }
.pkg-card .hd { flex-wrap: wrap; }
.msg-body { white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.inq-row .t { display: flex; align-items: center; gap: 8px; }
.inq-row .pill { flex: none; }
.btn-row.center { justify-content: center; }
.code-box { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.5; padding: 12px 14px; border-radius: 14px; background: var(--surface-sunk); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-all; }
.field-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto 34px; gap: 12px; align-items: center; padding: 10px var(--pad-card); border-top: 1px solid var(--line); }
.field-row .kind { font-size: 12px; color: var(--ink-4); white-space: nowrap; }
.field-row .switch { gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.field-row .choices { grid-column: 2 / -1; }

/* ---------- Document editor ---------- */
.editor { border: 1px solid var(--line-2); border-radius: var(--r-md, 16px); background: var(--surface-solid); }
.editor:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; background: var(--surface-solid); border-radius: var(--r-md, 16px) var(--r-md, 16px) 0 0; }
.ed-bar-line { border-bottom: 0; position: static; justify-content: flex-end; padding: 4px 6px 0; }
.editor.line { display: flex; flex-direction: row-reverse; align-items: center; }
.editor.line .ed-surface { flex: 1; min-width: 0; }
.editor.line .ed-bar-line { padding: 0 6px; }
.ed-btn { min-width: 32px; height: 32px; padding: 0 9px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: 600 13px var(--font-ui); cursor: pointer; }
.ed-btn:hover { background: var(--surface-sunk); color: var(--ink); }
.ed-btn[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); }
.ed-italic { font-style: italic; } .ed-underline { text-decoration: underline; } .ed-h3 { font-size: 11.5px; }
.ed-insert { margin-left: auto; background: var(--surface-sunk); font-weight: 550; }
.ed-fieldmenu { position: relative; margin-left: auto; }
.ed-pop { position: absolute; right: 0; top: calc(100% + 6px); width: 280px; max-height: 360px; overflow: auto; padding: 8px; border-radius: 16px; z-index: 20; background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--glass-shadow); }
.ed-pop .input { height: 34px; margin-bottom: 6px; }
.ed-group { font-size: 11px; font-weight: 600; color: var(--ink-4); text-transform: uppercase; letter-spacing: .04em; padding: 8px 8px 4px; }
.ed-item { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; font: 500 13px var(--font-ui); color: var(--ink); cursor: pointer; }
.ed-item:hover, .ed-item:focus { background: var(--accent-soft); outline: none; }
.ed-hint { color: var(--ink-4); font-weight: 400; font-size: 12px; }
.ed-empty { padding: 10px; color: var(--ink-3); font-size: 13px; }
.ed-doc { min-height: 260px; padding: 16px 18px; outline: none; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.ed-doc.ed-line { min-height: 0; padding: 9px 12px; white-space: nowrap; overflow-x: auto; }
.ed-doc p { margin: 0 0 10px; } .ed-doc.ed-line p { margin: 0; }
.ed-doc h2 { font-family: var(--font-display); font-weight: 400; font-size: 24px; margin: 18px 0 8px; }
.ed-doc h3 { font-size: 15.5px; font-weight: 650; margin: 14px 0 6px; }
.ed-doc ul, .ed-doc ol, .doc-preview ul, .doc-preview ol { padding-left: 22px; margin: 0 0 10px; }
.ed-doc a { color: var(--accent-ink); }
.ed-doc .ProseMirror-selectednode, .ed-doc .chip-field.ProseMirror-selectednode { outline: 2px solid var(--accent); }
.ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.ProseMirror-focused .ProseMirror-gapcursor { display: block; }
.chip-field { display: inline-flex; align-items: center; padding: 1px 8px; margin: 0 1px; border-radius: 99px; background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent-line); font-size: .9em; font-weight: 550; white-space: nowrap; user-select: all; }
.chip-field.unknown { background: var(--rose-soft); color: var(--rose); }
.doc-cols { grid-template-columns: minmax(0, 1fr) 380px; }
.doc-preview { font-size: 14px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.doc-preview p { margin: 0 0 10px; }
.doc-preview h2 { font-family: var(--font-display); font-weight: 400; font-size: 22px; margin: 16px 0 6px; }
.doc-preview h3 { font-size: 15px; margin: 12px 0 4px; }
.doc-subject { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); font-weight: 600; }
.doc-table { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 13px; }
.doc-table th, .doc-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.doc-table .r { text-align: right; }
@media (max-width: 1180px) { .doc-cols { grid-template-columns: minmax(0, 1fr); } }
.ed-btn svg { vertical-align: middle; }
.ed-btn.ed-undo { margin-left: 8px; }
/* ProseMirror's own base rules (Tiptap's CSS injection is off under the strict CSP) */
.ProseMirror { position: relative; }
.ProseMirror [contenteditable="false"] { white-space: normal; }
.ProseMirror-hideselection *::selection { background: transparent; }
.ProseMirror-hideselection { caret-color: transparent; }
img.ProseMirror-separator { display: inline !important; border: none !important; margin: 0 !important; width: 0 !important; height: 0 !important; }
.ed-line .ProseMirror-trailingBreak { display: none; }
.pay-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 0 var(--pad-card) 12px; }
.pay-sum > div { padding: 10px 12px; border-radius: 14px; background: var(--surface-sunk); }
.pay-sum .l { display: block; font-size: 12px; color: var(--ink-3); } .pay-sum b { font-family: var(--font-display); font-weight: 400; font-size: 20px; }
.inst .amt { display: inline-flex; align-items: center; gap: 4px; }
.card-title.small { font-size: 13px; color: var(--ink-3); }
.card-title .num { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-size: 11.5px; }
.callnotes { padding: 12px 14px; border-radius: 14px; background: var(--surface-sunk); font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.callnotes p { margin: 0 0 8px; } .callnotes p:last-child { margin: 0; }
.pb-cols { grid-template-columns: minmax(0, 1fr) 360px; }
.pb-th { width: 46px; height: 46px; border-radius: 12px; object-fit: cover; flex: none; background: linear-gradient(135deg, var(--accent-soft), var(--surface-sunk)); display: block; }
.pb-price { font-family: var(--font-display); font-size: 20px; min-width: 80px; text-align: right; }
.muted-row .t, .muted-row .pb-price { color: var(--ink-3); }
.check.solo label { width: 22px; height: 22px; padding: 0; justify-content: center; border-radius: 7px; }
.check.solo input:checked + label { background: var(--ink); border-color: var(--ink); }
.check.solo input:checked + label::after { content: "✓"; color: var(--on-ink); font-size: 13px; }
.rec-pick input { position: absolute; opacity: 0; pointer-events: none; }
.rec-pick label { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-3); cursor: pointer; }
.rec-pick input:checked + label { color: var(--accent-ink); border-color: var(--accent-line); background: var(--accent-soft); }
.rec-pick input:checked + label span::after { content: "ed"; }
.rec-pick input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.phone-frame { margin: 0 var(--pad-card); border-radius: 36px; padding: 10px; background: #1c1a18; box-shadow: var(--card-shadow); }
.phone-frame iframe { display: block; width: 100%; height: 640px; border: 0; border-radius: 28px; background: #fff; }
.sp-top { margin-top: 14px; }
@media (max-width: 1180px) { .pb-cols { grid-template-columns: minmax(0, 1fr); } }
.error-text { color: var(--rose); }
.thread { display: flex; flex-direction: column; gap: 10px; padding: 0 var(--pad-card) var(--pad-card); }
.msg { padding: 12px 14px; border-radius: 16px; background: var(--surface-sunk); max-width: 92%; }
.msg.out { align-self: flex-end; background: var(--accent-soft); }
.msg-hd { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.msg-subj { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.msg-body { white-space: pre-wrap; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.tasks { padding: 0 0 6px; }
.task { display: flex; align-items: center; gap: 12px; padding: 9px var(--pad-card); }
.task form { display: contents; }
.task .ck { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1.5px solid var(--line-2); background: transparent; color: transparent; cursor: pointer; }
.task .ck:hover { border-color: var(--sage); color: var(--sage); }
.task.done .ck { background: var(--sage); border-color: var(--sage); color: #fff; }
.task.done .t { color: var(--ink-3); }
.task.now { background: linear-gradient(90deg, var(--accent-soft), transparent); }
.task.now .ck { border-color: var(--accent); }
.task .t { font-size: 13.5px; font-weight: 500; }
.task .s { font-size: 11.5px; color: var(--ink-3); display: inline-flex; gap: 4px; align-items: center; }
.task .due { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.task .due.late { color: var(--rose); font-weight: 550; }
.task .icon-btn { width: 28px; height: 28px; opacity: 0; } .task:hover .icon-btn, .task .icon-btn:focus-visible { opacity: 1; }
.task-add { display: flex; gap: 8px; padding-top: 4px; } .task-add .input { height: 36px; } .task-add .input[type=date] { width: 160px; flex: none; }
.wrow { grid-template-columns: 18px minmax(0, 1fr) 170px 34px; grid-template-areas: "grip label amount rm" ". due due ." ". mail mail ."; }
.wrow > .mail-in { grid-area: mail; display: flex; gap: 6px; } .mail-in select { flex: 1; min-width: 0; }
.wrow > input[name=title] { grid-area: label; } .wrow > select[name=client] { grid-area: amount; }
.wrow .due-in select[name=auto] { flex: 1; }
/* calendar */
.cal-cols { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--gap); align-items: start; }
.cal-card { overflow: hidden; }
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal th { font-size: 12px; font-weight: 550; color: var(--ink-3); padding: 12px 8px 8px; text-align: left; }
.cal td { vertical-align: top; height: 112px; padding: 6px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); overflow: hidden; }
.cal td:first-child { border-left: 0; }
.cal td.other { background: var(--surface-sunk); } .cal td.other .dn { color: var(--ink-4); }
.cal .dn { font-size: 12.5px; font-weight: 550; margin: 0 0 4px 2px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal td.today .dn { background: var(--accent); color: var(--on-accent); }
.cal .ev { display: block; font-size: 11.5px; line-height: 1.3; padding: 3px 7px; margin-bottom: 3px; border-radius: 7px; text-decoration: none; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .ev.sessions { background: var(--accent-soft); } .cal .ev.payments { background: var(--amber-soft); } .cal .ev.tasks { background: var(--sky-soft); }
.cal .ev.tentative { background: transparent; box-shadow: inset 0 0 0 1px var(--accent-line); }
.cal .ev .tm { color: var(--ink-3); }
.cal .more { font-size: 11px; color: var(--ink-3); padding-left: 6px; }
.ldot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; flex: none; }
.ldot.sessions { background: var(--accent); } .ldot.payments { background: var(--amber); } .ldot.tasks { background: var(--sky); }
.ldot.tentative { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day-hd { padding: 14px var(--pad-card) 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.cal-day-hd.today { color: var(--accent-ink); }
.cal-row { border-top: 0; }
@media (max-width: 980px) { .cal-cols { grid-template-columns: minmax(0, 1fr); } .cal td { height: 76px; } .cal .ev { font-size: 10px; } }
.qrow { display: grid; grid-template-columns: 18px minmax(0, 1fr) 34px; gap: 10px; align-items: start; padding: 12px var(--pad-card); border-top: 1px solid var(--line); }
.qrow .grip { padding-top: 10px; color: var(--ink-4); cursor: grab; }
.qmain { display: grid; gap: 8px; }
.qline { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; gap: 8px; align-items: center; }
.switch.small { gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.qchoices-ed { display: grid; gap: 6px; justify-items: start; } .qchoices-ed > div { width: 100%; }
.kv.qa { padding: 0; } .qa-sec { grid-column: 1 / -1; font-weight: 650; color: var(--ink); padding-top: 8px; }
@media (max-width: 980px) { .qline { grid-template-columns: minmax(0, 1fr); } }
.bell { position: relative; }
.dot-count { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 650; display: grid; place-items: center; }
.notif.unread .t { font-weight: 650; }
.notif-grid td { vertical-align: middle; } .notif-grid select { max-width: 210px; }
.qr-box svg { width: 160px; height: 160px; display: block; }
.stat-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.stat { padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.stat .l { font-size: 12.5px; color: var(--ink-3); } .stat b { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.1; }
.stat .pill { justify-self: start; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.report-grid .wide { grid-column: 1 / -1; }
.bars { width: 100%; height: auto; display: block; }
.bars rect { fill: var(--accent); opacity: .85; } .bars rect.zero { fill: var(--line-2); }
.bars text { font: 500 11px var(--font-ui); fill: var(--ink-3); } .bars text.val { fill: var(--ink-2); font-size: 10.5px; }
.table-wrap { overflow-x: auto; }
.import-table th { vertical-align: top; min-width: 160px; } .import-table td { font-size: 12.5px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1180px) { .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .report-grid { grid-template-columns: minmax(0, 1fr); } }
.as-cols { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.as-list .row { border-top: 0; } .as-list .row.on { background: var(--current-bg); }
.as-list .t { display: block; font-size: 13px; font-weight: 550; } .as-list .s { display: block; font-size: 11.5px; color: var(--ink-3); }
.as-main { display: flex; flex-direction: column; min-height: 520px; }
.as-thread { flex: 1; padding: var(--pad-card); display: flex; flex-direction: column; gap: 12px; }
.as-msg { max-width: 86%; padding: 12px 14px; border-radius: 16px; background: var(--surface-sunk); display: grid; gap: 8px; }
.as-msg.user { align-self: flex-end; background: var(--accent-soft); }
.as-body { white-space: pre-wrap; font-size: 14px; line-height: 1.6; }
.as-msg .s { font-size: 11.5px; color: var(--ink-3); }
.as-hints { margin: auto 0; } .as-hint { font-family: var(--font-display); font-size: 18px; margin: 6px 0; color: var(--ink-2); }
.as-ask { display: flex; gap: 10px; align-items: flex-end; padding: var(--pad-card); border-top: 1px solid var(--line); }
.as-ask textarea { flex: 1; }
.ai-banner { margin-bottom: var(--gap); }
@media (max-width: 980px) { .as-cols { grid-template-columns: minmax(0, 1fr); } }
.ask-btn { gap: 6px; padding: 0 14px; } .ask-btn span { font-size: 13px; font-weight: 550; }
.kv.shortcuts { padding: 8px 0 0; grid-template-columns: 90px 1fr; }

/* Help: guides, contact support, diagnostic report */
.help-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.report summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.report pre { margin: 12px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--surface-sunk); font: 12.5px/1.55 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.help-foot { margin: 14px 4px 0; }
.guide-cols { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; align-items: start; }
.guide-side { position: sticky; top: 92px; display: grid; gap: 14px; }
.guide-toc ul { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.guide-toc a { color: var(--ink-2); text-decoration: none; }
.guide-toc a:hover { color: var(--ink); text-decoration: underline; }
.guide { font-size: 15px; line-height: 1.65; color: var(--ink); max-width: 76ch; overflow-wrap: anywhere; }
.guide > :first-child { margin-top: 0; }
.guide h2 { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.2; margin: 34px 0 10px; scroll-margin-top: 96px; }
.guide h3 { font-size: 16px; margin: 24px 0 8px; scroll-margin-top: 96px; }
.guide p, .guide ul, .guide ol { margin: 0 0 14px; }
.guide ul, .guide ol { padding-left: 1.3em; }
.guide li { margin: 0 0 8px; }
.guide li > pre { margin: 10px 0 4px; }
.guide code { font: 0.88em ui-monospace, Menlo, Consolas, monospace; padding: 1px 5px; border-radius: 6px; background: var(--surface-sunk); }
.guide pre { margin: 0 0 16px; padding: 14px 16px; border-radius: 14px; background: var(--surface-sunk); overflow-x: auto; }
.guide pre code { padding: 0; background: none; font-size: 13px; line-height: 1.55; }
.guide hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.guide .table-wrap { overflow-x: auto; margin: 0 0 16px; }
.guide .table th, .guide .table td { vertical-align: top; font-size: 13.5px; }
@media (max-width: 1080px) { .help-grid, .guide-cols { grid-template-columns: minmax(0, 1fr); } .guide-side { position: static; } }
.btn-row.end { justify-content: flex-end; flex-wrap: nowrap; }
.narrow-input { width: 110px; }
.ph .ph-video { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; text-align: center; font-size: 12px; }
.ph .ph-video > span:first-of-type { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.autopay-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 20px 12px; }
.autopay-row form { margin-left: auto; }
.cal .ev.appointments { background: var(--sage-soft); } .cal .ev.busy { background: var(--surface-sunk); color: var(--ink-3); }
.ldot.appointments { background: var(--sage); } .ldot.busy { background: var(--ink-4); }
.week-hours { display: grid; gap: 8px; }
.wh-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wh-row .switch { min-width: 150px; }
.wh-row .input[type="time"], .wh-row .input[type="date"] { width: auto; }
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit .input { width: 110px; }
.input-unit span { font-size: 13px; color: var(--ink-3); }
.copy-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.err-text { color: var(--rose); }
.cf-connect { padding: 16px 18px; border-radius: 18px; background: var(--surface-sunk); margin-bottom: 14px; }
.cf-title { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 8px; }
.cf-steps { margin: 0; padding-left: 20px; display: grid; gap: 12px; }
.cf-steps li > .btn-row, .cf-steps li > .fld { margin-top: 8px; }
.cf-manual { margin: 0 0 10px; }
.notices { white-space: pre-wrap; font-size: 12px; line-height: 1.5; max-height: 70vh; overflow: auto; padding: 14px; border-radius: 14px; background: var(--surface-sunk); }
.auth-card.wide.terms-card { width: min(820px, 100%); text-align: left; }
.legal-hint { display: flex; gap: 6px; align-items: center; margin: 0 0 12px; }
.as-note { margin: 8px 2px 0; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--ink-2); cursor: pointer; text-align: left; }
.consent input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.consent a { color: var(--accent-ink); }
.share-way { display: grid; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.share-way:first-of-type { border-top: 0; padding-top: 4px; }
.share-hd { display: flex; gap: 10px; align-items: flex-start; }
.share-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-ink); }
.share-guides { display: grid; gap: 6px; }
.share-guides details { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.share-guides summary { cursor: pointer; font-weight: 500; font-size: 14px; }
.share-guides ol { margin: 8px 0 4px 18px; padding: 0; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.share-guides p { margin: 6px 0 2px; font-size: 13px; }
.lead-q { margin: 0; color: var(--ink-2); }
.cal-add { display: flex; flex-wrap: wrap; gap: 8px; }
.cal-other summary { cursor: pointer; color: var(--ink-2); }
.cal-other[open] { display: grid; gap: 8px; }
.lab-connect { display: flex; gap: 14px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); }
.whcc-pick summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.whcc-pick[open] summary { margin-bottom: 10px; }
.whcc-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* day plan editor */
.plan-edit { display: grid; grid-template-columns: 140px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 8px; padding: 6px 20px; align-items: center; }
.plan-edit.shots { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr) minmax(0, 1fr) 34px; }
@media (max-width: 760px) {
  .plan-edit, .plan-edit.shots { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px; padding: 10px 14px; border-top: 1px solid var(--line); }
  .plan-edit [name=title], .plan-edit [name=shot_title] { grid-column: 2 / 4; }
  .plan-edit [name=shot_notes] { grid-column: 1 / 3; }
}
.gift-row { display: flex; gap: 8px; align-items: center; padding-top: 0; } .gift-row .input { max-width: 220px; }
.logo-up { flex-wrap: wrap; min-width: 0; } .logo-up .input[type=file] { flex: 1 1 220px; min-width: 0; max-width: 100%; }
.card-foot > form { min-width: 0; max-width: 100%; }
.how-list { margin: 0; padding-left: 1.2rem; display: grid; gap: 10px; line-height: 1.55; color: var(--ink-2); } .how-list b { color: var(--ink); font-weight: 600; }
.notice a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }  /* readable on every notice color */
.more-steps > summary { cursor: pointer; padding: 10px var(--pad-card) 16px; font-size: 13px; color: var(--ink-3); } .more-steps > summary:hover { color: var(--ink); }
.inline-form { display: inline-block; margin-left: 8px; vertical-align: middle; }
.import-table select.input { min-width: 170px; }
.book-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; } .book-pick select { max-width: 260px; }
/* PDF contracts: the box editor */
.pdfedit { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.pdfedit-side { position: sticky; top: 90px; }
.pe-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.pe-tool[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.pdfpages { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pdfpage { position: relative; background: #fff; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08); user-select: none; }
.pdfpage img { display: block; width: 100%; height: auto; border-radius: 6px; }
.pdfpage-n { position: absolute; right: -28px; top: 4px; font-size: 11px; color: var(--ink-4); }
.pdfpages.placing .pdfpage { cursor: crosshair; }
.pbox { position: absolute; display: flex; align-items: flex-start; padding: 1px 4px; border: 1.5px dashed var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
        border-radius: 3px; font: 600 10.5px/1.25 var(--font-ui); color: #1b1b2f; text-align: left; overflow: hidden; cursor: move; touch-action: none; }
.pbox span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbox.k-sign, .pbox.k-initials, .pbox.k-date { border-color: #b7791f; background: rgba(214, 158, 46, .16); }
.pbox.k-client { border-color: #2b6cb0; background: rgba(66, 153, 225, .14); }
.pbox.k-studio { border-color: #2f855a; background: rgba(72, 187, 120, .14); }
.pbox.sel { border-style: solid; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.pbox:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.pgrip { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; background: currentColor; opacity: .35; cursor: nwse-resize; }
@media (max-width: 980px) { .pdfedit { grid-template-columns: minmax(0, 1fr); } .pdfedit-side { position: static; } }
/* PDF contracts: filled-in view (contract page) */
.pdfview { display: flex; flex-direction: column; gap: 14px; }
.pdfview .pval { position: absolute; font: 500 11px/1.2 var(--font-ui); color: #13183d; overflow: hidden; padding: 0 2px; white-space: pre-wrap; }
.pdfview .pspot { position: absolute; border: 1.5px dashed #b7791f; background: rgba(214, 158, 46, .14); border-radius: 3px; font: 600 10px var(--font-ui); color: #6b4a12; padding: 1px 3px; overflow: hidden; }
.pdfview .pspot.k-client { border-color: #2b6cb0; background: rgba(66, 153, 225, .12); color: #1c4170; }

/* phones: long words and links wrap, wide tables scroll inside their card */
.table-wrap { position: relative; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
code, .mono, .link-box { overflow-wrap: anywhere; }
.card-body, .notice { overflow-wrap: break-word; }
@media (max-width: 900px) {
  .edit-table .input { min-width: 120px; }
  .edit-table td.actions { min-width: 0; }
  .card-hd { flex-wrap: wrap; }
  .btn-row { flex-wrap: wrap; }
  .row-flex > * { min-width: 0; }
  .filters .search { margin-left: 0; flex-wrap: wrap; width: 100%; }
  .filters .search .input { width: auto; flex: 1 1 140px; min-width: 0; }
  .row .when { white-space: normal; }
  .field-row { display: flex; flex-wrap: wrap; gap: 10px 14px; }
  .field-row > .input { flex: 1 1 calc(100% - 40px); }
  .field-row > form { margin-left: auto; }
  .field-row .choices { flex-basis: 100%; }
}

/* Sign in with Google for email */
.google-email { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line-2); background: var(--surface-solid); }
.google-email > div { flex: 1 1 240px; display: flex; flex-direction: column; gap: 2px; }
.google-email.connected { border-color: var(--sage); background: var(--sage-soft); }
.g-mark { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 600 17px var(--font-ui); color: #fff; background: #4285f4; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
