:root {
  --canvas: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f2f5;
  --ink: #111318;
  --ink-2: #4b5160;
  --ink-3: #8a909c;
  --line: #e4e6eb;
  --line-strong: #d3d6dd;
  --side: #121418;
  --side-2: #1b1e24;
  --side-ink: #e9ebef;
  --side-ink-2: #9aa0ab;
  --accent: #f6752e;
  --accent-ink: #ffffff;
  --accent-soft: #fdf0e7;
  --ok: #1f8a4c;
  --ok-soft: #e7f5ec;
  --warn: #a8670b;
  --warn-soft: #fbf2e1;
  --bad: #c1353a;
  --bad-soft: #fbeaea;
  --info: #2c5fb3;
  --info-soft: #e9f0fb;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 19, 24, 0.04), 0 4px 16px rgba(17, 19, 24, 0.04);
  --shimmer: #eceef2;
  --shimmer-hi: #f6f7f9;
  --ring: 0 0 0 3px rgba(246, 117, 46, 0.28);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-underline-offset: 2px; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: 24px; font-weight: 650; line-height: 1.25; letter-spacing: -0.02em; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 14px; font-weight: 620; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.hidden, [hidden] { display: none !important; }

.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; }
.brand strong { display: block; font-size: 15px; }
.brand small { display: block; color: var(--side-ink-2); font-size: 11.5px; }
.sidebar nav { flex: 1; overflow-y: auto; }
.nav-group { margin-bottom: 14px; }
.nav-group p { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: #6b717c; padding: 0 10px 6px; }
.nav-group a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink-2); text-decoration: none; font-weight: 500; }
.nav-group a svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nav-group a { transition: background-color 0.15s, color 0.15s; }
.nav-group a:hover { background: var(--side-2); color: var(--side-ink); }
.nav-group a:focus-visible, .sidebar .icon-button:focus-visible, .brand:focus-visible { outline-offset: -2px; }
.nav-group a[aria-current="page"] { background: var(--side-2); color: #ffffff; box-shadow: inset 2px 0 0 var(--accent); }
.badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 650; text-align: center; line-height: 18px; }
.account { display: flex; align-items: center; gap: 10px; padding: 12px 8px 0; border-top: 1px solid #22262d; }
.avatar { width: 34px; height: 34px; border-radius: 9px; background: #2a2e36; display: grid; place-items: center; font-weight: 650; font-size: 13px; overflow: hidden; flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.who { min-width: 0; flex: 1; }
.who strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { display: block; font-size: 11.5px; color: var(--side-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-button { border: 0; background: none; color: inherit; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar .icon-button:hover { background: var(--side-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar .menu { display: none; }
.crumb { font-weight: 600; color: var(--ink-2); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }
.content { padding: 28px 32px 64px; max-width: 1240px; width: 100%; }
.legal-banner { margin: 16px 32px 0; max-width: 1176px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
ul.legal-links { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; color: var(--ink-2); max-width: 68ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-body { padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.side { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.grid.designer { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; }
.stat .label { font-size: 12px; color: var(--ink-3); font-weight: 550; }
.stat .value { font-size: 26px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat .hint { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s, filter 0.15s; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(0.5px); }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(0.96); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; height: 44px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.loading:disabled { opacity: 1; cursor: progress; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.loading { color: transparent !important; position: relative; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: #fff #fff transparent transparent; animation: spin 0.7s linear infinite; }
.btn:not(.primary):not(.dark).loading::after { border-color: var(--ink-2) var(--ink-2) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink-3); border-color: var(--ink-2) var(--ink-2) transparent transparent; animation: spin 0.7s linear infinite; }

label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--ink); }
label.field small { font-weight: 400; color: var(--ink-3); }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 11px; width: 100%; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
input:hover:not(:disabled):not(:focus), select:hover:not(:disabled):not(:focus), textarea:hover:not(:disabled):not(:focus) { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: var(--ring); outline: none; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--ink-2); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
[aria-invalid="true"] { border-color: var(--bad); }
[aria-invalid="true"]:focus { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(193, 53, 58, 0.18); }
textarea { min-height: 88px; resize: vertical; }
input[type="color"] { padding: 3px; height: 38px; width: 56px; cursor: pointer; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.field-error { display: flex; align-items: flex-start; gap: 6px; color: var(--bad); font-size: 12px; font-weight: 500; line-height: 1.4; }
.field-error::before { content: ""; flex: none; width: 13px; height: 13px; margin-top: 1px; border-radius: 50%; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm-.9 4h1.8v5H7.1Zm0 6.4h1.8v1.8H7.1Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0Zm-.9 4h1.8v5H7.1Zm0 6.4h1.8v1.8H7.1Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.link { cursor: pointer; }
.table tr.link td { transition: background-color 0.12s; }
.table tr.link:hover td, .table tr.link:focus-visible td { background: #fafbfc; }
.table tr.link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.table .sub { color: var(--ink-3); font-size: 12px; }

.list-item { display: flex; gap: 14px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); text-decoration: none; }
.list-item:last-child { border-bottom: 0; }
a.list-item, button.list-item { transition: background-color 0.12s; }
a.list-item:hover, button.list-item:hover { background: #fafbfc; }
a.list-item:focus-visible, button.list-item:focus-visible { outline-offset: -2px; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trade-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink-2); flex: none; }
.empty { padding: 40px 24px; text-align: center; color: var(--ink-2); display: grid; justify-items: center; gap: 4px; }
.empty strong { display: block; color: var(--ink); font-size: 15px; font-weight: 620; }
.empty p { max-width: 44ch; color: var(--ink-3); }
.empty-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--ink-3); display: grid; place-items: center; margin-bottom: 8px; }
.empty-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.empty-action { margin-top: 12px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.state-error .empty-icon { background: var(--bad-soft); color: var(--bad); }
.empty-row td, .empty-row:hover td { background: none !important; }

.tabs { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.tabs button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: inherit; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background-color 0.15s, color 0.15s, box-shadow 0.15s; }
.tabs button:hover { color: var(--ink); }
.tabs button:focus-visible { outline-offset: 0; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); }

.lines { display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 80px 120px 110px 36px; gap: 8px; align-items: center; }
.line-head { font-size: 11.5px; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.totals { display: grid; gap: 6px; margin-left: auto; width: 280px; }
.totals div { display: flex; justify-content: space-between; color: var(--ink-2); }
.totals .grand { padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 650; font-size: 16px; }

.preview { width: 100%; height: 860px; border: 0; border-radius: var(--radius); background: #e9ebef; }
.preview-frame { position: sticky; top: 80px; }
.preview-frame .card-head { border-bottom: 0; }
.logo-box { display: flex; align-items: center; gap: 14px; }
.logo-box .logo { width: 132px; height: 56px; border: 1px dashed var(--line-strong); border-radius: 10px; display: grid; place-items: center; background: #fff; overflow: hidden; color: var(--ink-3); font-size: 12px; }
.logo-box .logo img { width: 100%; height: 100%; object-fit: contain; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }

.chat { display: flex; flex-direction: column; gap: 8px; padding: 20px; height: 520px; overflow-y: auto; background: #fafbfc; }
.msg { max-width: 72%; padding: 9px 13px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; }
.msg.mine { align-self: flex-end; background: var(--ink); color: #fff; border-color: var(--ink); }
.msg.system { align-self: center; background: none; border: 0; color: var(--ink-3); font-size: 12.5px; text-align: center; max-width: 85%; }
.msg.staff { border-color: var(--accent); }
.msg .who { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-bottom: 2px; }
.msg.mine .who { color: rgba(255, 255, 255, 0.6); }
.composer { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.composer textarea { min-height: 42px; height: 42px; }
.split { display: grid; grid-template-columns: 320px minmax(0, 1fr); }
.split > .threads { border-right: 1px solid var(--line); max-height: 640px; overflow-y: auto; }

.steps { display: grid; gap: 0; }
.step { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); font-weight: 650; flex: none; }
.step.done .dot { background: var(--ok-soft); color: var(--ok); }
.callout { padding: 14px 16px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); }
.callout.accent { background: var(--accent-soft); color: #7a3a12; }
.callout.ok { background: var(--ok-soft); color: var(--ok); }
.callout.bad { background: var(--bad-soft); color: var(--bad); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 550; }
.signature { width: 100%; height: 150px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; }
.qr { width: 184px; height: 184px; border: 1px solid var(--line); border-radius: 10px; image-rendering: pixelated; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.codes span { background: var(--surface-2); border-radius: 8px; padding: 6px; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs a { display: block; width: 84px; height: 84px; border-radius: 9px; overflow: hidden; background: var(--surface-2); }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line); display: block; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100vw - 32px)); background: var(--ink); color: #fff; padding: 11px 16px 11px 13px; border-radius: 11px; font-weight: 550; line-height: 1.4; z-index: 60; box-shadow: 0 10px 30px rgba(17, 19, 24, 0.22); cursor: default; animation: toast-in 0.24s var(--ease); }
.toast::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; background: #3fb36f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4.5 8.2 2.3 2.3 4.7-4.9' fill='none' stroke='%23fff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.toast.bad { background: var(--bad); }
.toast.bad::before { background: rgba(255, 255, 255, 0.22) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 4.2v4.6M8 11.4v.1' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 16px no-repeat; }
.toast.leaving { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 6px); } }
.dialog { border: 0; border-radius: 14px; padding: 0; width: min(520px, 92vw); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2); }
.dialog[open] { animation: dialog-in 0.2s var(--ease); }
.dialog::backdrop { background: rgba(17, 19, 24, 0.45); }
.dialog[open]::backdrop { animation: fade-in 0.2s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.dialog form { padding: 22px; display: grid; gap: 14px; }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }

.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth.single { grid-template-columns: 1fr; }
.auth-side { background: var(--side); color: var(--side-ink); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h1 { color: #fff; font-size: 34px; line-height: 1.15; max-width: 440px; }
.auth-side ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; color: var(--side-ink-2); max-width: 420px; }
.auth-side li strong { color: #fff; display: block; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); display: grid; gap: 16px; }
.auth-card .code { font-size: 26px; letter-spacing: 8px; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.skeleton { display: block; background: linear-gradient(90deg, var(--shimmer) 25%, var(--shimmer-hi) 50%, var(--shimmer) 75%); background-size: 300% 100%; animation: shimmer 1.6s ease-in-out infinite; border-radius: 6px; height: 12px; width: 100%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

@media (max-width: 1100px) {
  .grid.side, .grid.designer { grid-template-columns: 1fr; }
  .preview-frame { position: static; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 20; transform: translateX(-100%); transition: transform 0.2s; }
  body.menu-open .sidebar { transform: none; }
  .topbar { padding: 0 12px; }
  body.menu-open .sidebar { box-shadow: 0 0 40px rgba(0, 0, 0, 0.3); }
  body.menu-open .scrim { opacity: 1; pointer-events: auto; }
  body.menu-open { overflow: hidden; }
  .topbar .menu { display: grid; }
  .content { padding: 20px 16px 48px; }
  .legal-banner { margin: 12px 16px 0; }
  .grid.two, .grid.three, .form-grid, .split, .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .line { grid-template-columns: 1fr 60px 90px; }
  .line .vat, .line .remove { display: none; }
}
.logo-box .stack { gap: 6px; align-items: flex-start; }
details summary { cursor: pointer; }
.list-item[aria-current] { background: #fafbfc; box-shadow: inset 2px 0 0 var(--accent); }
.tabs button { white-space: nowrap; }

fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 8px; font-size: 13px; font-weight: 550; }
fieldset.field legend small { font-weight: 400; color: var(--ink-3); }
input[type="range"] { padding: 0; border: 0; box-shadow: none; accent-color: var(--accent); }
.pill.accent { background: var(--accent-soft); color: #9a4310; }
.prewrap { white-space: pre-wrap; }
.ellipsis { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.stack.tight { gap: 8px; }
.card-foot { padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.link-button { border: 0; background: none; padding: 0; font: inherit; color: var(--ink-3); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-button:hover { color: var(--ink); }
.dialog.wide { width: min(760px, 94vw); }
.dialog form { max-height: 88vh; overflow-y: auto; }
.dialog .actions.wrap { flex-wrap: wrap; }

.person { display: flex; align-items: center; gap: 12px; }
.person .title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.avatar-sm { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; font-weight: 650; flex: none; }
.avatar-lg { width: 56px; height: 56px; border-radius: 14px; background: var(--side); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 18px; flex: none; }

.portfolio { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; padding: 20px; }
.portfolio.compact { padding: 0; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.project { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.project img, .project-empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-2); }
.project-empty { display: grid; place-items: center; color: var(--ink-3); font-size: 12px; }
.project figcaption { padding: 10px 12px 12px; display: grid; gap: 2px; }
.project figcaption .btn { justify-self: start; margin: 6px 0 0 -10px; }
.profile-preview { display: grid; gap: 18px; }
.review { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; }
.stars-static { color: var(--ink); letter-spacing: 1px; }
.stars-static span, .star-off { color: var(--line-strong); }
.stars { display: flex; gap: 2px; }
.stars button { border: 0; background: none; padding: 0 2px; font-size: 26px; line-height: 1; color: var(--line-strong); cursor: pointer; }
.stars button.on { color: var(--accent); }
.mini-list { display: grid; gap: 8px; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day { border-right: 1px solid var(--line); min-height: 380px; display: flex; flex-direction: column; min-width: 0; }
.day:last-child { border-right: 0; }
.day.past { background: #fbfbfc; }
.day-head { display: flex; align-items: baseline; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.day-head strong { font-size: 16px; color: var(--ink); letter-spacing: 0; }
.day.today .day-head strong { color: var(--accent-ink); background: var(--accent); border-radius: 999px; min-width: 26px; text-align: center; padding: 0 6px; }
.day-body { padding: 8px; display: grid; gap: 8px; align-content: start; }
.visit { display: grid; gap: 2px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--ink); border-radius: 8px; padding: 8px 10px; }
.visit:hover { background: #fafbfc; }
.visit.proposed { border-left-color: var(--accent); }
.visit.completed { border-left-color: var(--line-strong); }
.visit.declined, .visit.cancelled { border-left-color: var(--line); opacity: 0.6; }
.visit.cancelled .visit-title { text-decoration: line-through; }
.visit .pill { justify-self: start; margin-top: 4px; }
.visit-time { font-weight: 650; font-size: 12.5px; }
.visit-title { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visit-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-empty { padding: 12px 20px; border-top: 1px solid var(--line); margin: 0; }
.agenda-day { display: grid; grid-template-columns: 150px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.agenda-day:last-child { border-bottom: 0; }
.agenda-date { padding: 14px 20px; font-weight: 600; color: var(--ink-2); border-right: 1px solid var(--line); }
.agenda-date.today { color: var(--accent); }
.visit-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.visit-row:hover { background: #fafbfc; }
.visit-when { width: 120px; display: grid; flex: none; }

.thread .thread-top, .thread .thread-last { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.thread .thread-last { margin-top: 2px; color: var(--ink-3); }
.thread.unread .title { font-weight: 700; }
.thread.unread .thread-last { color: var(--ink); font-weight: 550; }
.thread .badge { margin-left: 0; flex: none; }
.bubble { display: flex; flex-direction: column; align-items: flex-start; max-width: 72%; gap: 3px; }
.bubble.mine { align-self: flex-end; align-items: flex-end; }
.bubble .msg { max-width: 100%; white-space: normal; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.bare { padding: 4px; }
.msg.staff { white-space: normal; }
.msg-meta { font-size: 11px; color: var(--ink-3); display: flex; gap: 8px; padding: 0 4px; }
.msg-meta .link-button { visibility: hidden; font-size: 11px; }
.bubble:hover .msg-meta .link-button, .msg-meta .link-button:focus { visibility: visible; }
.attachments { display: grid; grid-template-columns: repeat(2, minmax(0, 140px)); gap: 4px; margin-top: 6px; }
.msg.bare .attachments, .msg.bare .voice, .msg.bare video, .msg.bare .removed { margin-top: 0; }
.attachments.single { grid-template-columns: minmax(0, 260px); }
.attachments a { display: block; }
.attachments img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.voice { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.voice audio { width: 260px; max-width: 100%; height: 36px; }
.voice-length { font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.7; }
.msg video { display: block; width: 300px; max-width: 100%; border-radius: 10px; margin-top: 6px; background: #000; }
.removed { display: grid; gap: 2px; margin-top: 6px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); }
.msg.mine .removed { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.3); color: rgba(255, 255, 255, 0.85); }
.composer { align-items: flex-end; }
.composer .attach { color: var(--ink-2); border: 1px solid var(--line-strong); width: 42px; height: 42px; flex: none; }
.composer .attach:hover { background: var(--surface-2); }
.composer-main { flex: 1; min-width: 0; display: grid; gap: 8px; }
.composer.blocked { justify-content: center; }
.pending-files { display: flex; gap: 8px; flex-wrap: wrap; }
.pending-file { position: relative; }
.pending-file img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.pending-file button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 13px; line-height: 20px; padding: 0; cursor: pointer; }

.table th.check, .table td.check { text-align: center; width: 72px; }
.prefs td { padding-top: 11px; padding-bottom: 11px; }

@media (max-width: 860px) {
  .week { grid-template-columns: 1fr; }
  .day { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .day:last-child { border-bottom: 0; }
  .agenda-day { grid-template-columns: 1fr; }
  .agenda-date { border-right: 0; padding-bottom: 0; }
  .bubble { max-width: 88%; }
}

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
label.btn { position: relative; }
label.btn:focus-within { box-shadow: 0 0 0 3px rgba(17, 19, 24, 0.12); }
.nowrap { white-space: nowrap; }
.grow-row { flex: 1; min-width: 0; }
.grow-row input[type="search"] { max-width: 320px; }
.grow-row select { width: auto; min-width: 160px; }
.card-head input[type="search"] { height: 36px; padding: 6px 11px; }
.card-head select { height: 36px; padding: 6px 11px; }

.table.compact th { padding: 8px 12px; }
.table.compact td { padding: 8px 12px; }
.table tfoot td { border-top: 1px solid var(--line); border-bottom: 0; background: #fafbfc; }
.pricebook td { padding-top: 10px; padding-bottom: 10px; }
.pricebook th:nth-child(2), .pricebook td:nth-child(2) { width: 150px; }
.pricebook th:nth-child(3), .pricebook td:nth-child(3) { width: 110px; }
.pricebook th:nth-child(4), .pricebook td:nth-child(4) { width: 120px; }
.pricebook th:nth-child(5), .pricebook td:nth-child(5) { width: 104px; }
.pricebook th:nth-child(6), .pricebook td:nth-child(6) { width: 110px; }
.pricebook th:last-child, .pricebook td:last-child { width: 196px; }
.pricebook input, .pricebook select { padding: 7px 9px; }
.pricebook td.num input { text-align: right; }
.pricebook .add-row td { background: var(--accent-soft); border-bottom: 1px solid var(--line); }
.pricebook .add-row input, .pricebook .add-row select { background: var(--surface); }
.pricebook .edit-row td { background: #fafbfc; vertical-align: top; }
.pricebook .sub-input { margin-top: 6px; font-size: 12.5px; }
.pricebook tr.inactive td { color: var(--ink-3); }
.pricebook tr.inactive strong { color: var(--ink-2); font-weight: 550; }
.pricebook td .btn + .btn { margin-left: 2px; }

.pick-list { display: grid; max-height: 50vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 400; }
.pick:last-child { border-bottom: 0; }
.pick:hover { background: #fafbfc; }
.pick:has(input:checked) { background: var(--accent-soft); }
.pick input { width: auto; flex: none; accent-color: var(--accent); }
.pick .grow { flex: 1; min-width: 0; display: grid; }
.pick .sub, .pick .num .sub { display: block; color: var(--ink-3); font-size: 12px; }
.pick .num { flex: none; }

.quote-tools { gap: 8px; }
[data-save-template] { justify-self: center; align-self: center; }

.grid.templates { grid-template-columns: 340px minmax(0, 1fr); align-items: start; }
.template-item { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.template-item:hover { background: #fafbfc; }
.stages { display: grid; gap: 8px; }
.stage-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px 36px; gap: 8px; align-items: center; }
.percent { position: relative; display: block; }
.percent input { padding-right: 28px; text-align: right; }
.percent span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
[data-preset] { width: auto; height: 32px; padding: 4px 10px; font-size: 13px; }

.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); }
.legend .key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.legend .key.net { background: #2a2e36; }
.legend .key.vat { background: var(--line-strong); }
.bar-chart { display: block; width: 100%; height: auto; overflow: visible; }
.bar-chart .grid { stroke: var(--line); stroke-width: 1; }
.bar-chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.bar-chart .tick { font-size: 11px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.bar-chart .tick.current { fill: var(--ink); font-weight: 650; }
.bar-chart .net { fill: #2a2e36; }
.bar-chart .vat { fill: var(--line-strong); }
.bar-chart .negative { fill: var(--bad); opacity: 0.6; }
.bar-chart .current .net { fill: var(--accent); }
.bar-chart .current .vat { fill: #f9b48b; }
.bar-chart .hit { fill: transparent; }
.bar-chart .bar:hover .hit, .bar-chart .bar:focus .hit { fill: rgba(17, 19, 24, 0.035); }
.bar-chart .bar:focus { outline: none; }
.big-number { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.compare { display: grid; gap: 6px; }
.compare svg, .meter-cell svg { display: block; width: 100%; height: 6px; }
.compare .track, .meter-cell .track { fill: var(--surface-2); }
.compare .fill { fill: var(--accent); }
.meter-cell { display: grid; grid-template-columns: minmax(60px, 1fr) auto; gap: 12px; align-items: center; justify-items: end; }
.meter-cell .fill { fill: var(--ink-2); }
.years td:first-child { color: var(--ink-2); }
details.card-foot summary { list-style: revert; }
details.card-foot[open] { padding-bottom: 0; }
details.card-foot .table { margin: 8px -20px 0; width: calc(100% + 40px); }

.photo-stage { display: grid; gap: 10px; }
.photo-stage + .photo-stage { padding-top: 16px; border-top: 1px solid var(--line); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.shot { position: relative; display: block; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; aspect-ratio: 1; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s; }
.shot:hover img { transform: scale(1.03); }
.shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.shot-tag { position: absolute; left: 6px; bottom: 6px; background: rgba(17, 19, 24, 0.72); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; }
.pick-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.pick-photo { position: relative; display: block; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; font-weight: 400; }
.pick-photo:has(input:checked) { border-color: var(--accent); }
.pick-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.pick-photo input { position: absolute; top: 6px; left: 6px; width: auto; }
.pick-photo span { position: absolute; right: 6px; bottom: 6px; background: rgba(17, 19, 24, 0.72); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(10, 11, 14, 0.9); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; display: grid; gap: 10px; justify-items: center; max-width: min(1100px, 88vw); }
.lightbox img { max-width: 100%; max-height: 80vh; border-radius: 10px; display: block; background: #000; }
.lightbox figcaption { color: rgba(255, 255, 255, 0.82); font-size: 13px; text-align: center; }
.lightbox button { position: fixed; border: 0; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, 0.22); }
.lightbox button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lightbox .prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox .next { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-close { top: 20px; right: 20px; }
label.btn.loading { color: transparent !important; pointer-events: none; }
label.btn.loading::after { content: ""; position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid; border-color: var(--ink-2) var(--ink-2) transparent transparent; animation: spin 0.7s linear infinite; }

@media (max-width: 1100px) {
  .grid.templates { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .pricebook thead, .pricebook td:nth-child(3), .pricebook td:nth-child(5), .pricebook td:nth-child(6) { display: none; }
  .stage-row { grid-template-columns: minmax(0, 1fr) 90px 36px; }
  .stage-row [data-stage-amount] { display: none; }
}

[data-quote] .line-head { display: none; }
[data-quote] .lines { gap: 0; border: 1px solid var(--line); border-radius: 10px; }
[data-quote] .line { grid-template-columns: 64px minmax(0, 1fr) 92px 32px; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); }
[data-quote] .line:last-child { border-bottom: 0; }
[data-quote] .line [name="description"] { grid-column: 1 / -1; }
[data-quote] .line .vat, [data-quote] .line .remove { display: initial; }
[data-quote] .line .remove { padding: 0; width: 32px; }
input.upper { text-transform: uppercase; }
.check-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 10px; }
.check-list .check { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.check-list .check:last-child { border-bottom: 0; }
.check-list .check p { margin: 2px 0 0; }

select.auto { width: auto; min-width: 150px; }
.stats.flush { margin-bottom: 0; }
.card-head.wrap { flex-wrap: wrap; }
.scroll-x { overflow-x: auto; }
.self-start { align-self: flex-start; }
.field-label { font-size: 13px; font-weight: 550; }
.field-label small { font-weight: 400; color: var(--ink-3); }
label.field.half { max-width: 340px; }
label.field.half small:last-child { font-size: 12px; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.choice-row .pick { border-bottom: 0; align-items: flex-start; }
.choice-row .pick + .pick { border-left: 1px solid var(--line); }
.choice-row .pick input { margin-top: 3px; }
.choice-row .pick strong { font-weight: 600; }
label.toggle { align-items: flex-start; gap: 12px; cursor: pointer; }
label.toggle input { width: auto; flex: none; margin-top: 3px; accent-color: var(--accent); }
label.toggle strong { display: block; font-weight: 600; }
label.toggle .sub { display: block; color: var(--ink-3); font-size: 12px; }
.kv.compact { grid-template-columns: 128px 1fr; gap: 6px 14px; font-size: 13px; }
.figures { display: grid; border-top: 1px solid var(--line); }
.figures div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.figures div span:last-child { font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.figures .total { border-bottom: 0; font-weight: 650; color: var(--ink); }
.disclaimer { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: 9px; padding: 10px 12px; }
.disclaimer strong { color: var(--ink); }
.meter.warn .fill { fill: var(--warn); }
.tax-table td { vertical-align: top; }
.tax-table td.row-actions { white-space: nowrap; text-align: right; padding-top: 9px; padding-bottom: 9px; }
.tax-table td .btn + .btn { margin-left: 2px; }
.tax-table tfoot td { font-variant-numeric: tabular-nums; }
.receipt-thumb { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); overflow: hidden; cursor: pointer; font: inherit; font-size: 10px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.04em; }
.receipt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.receipt-thumb:hover { border-color: var(--line-strong); }
.receipt-preview { display: grid; place-items: center; min-height: 120px; max-height: 340px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); overflow: hidden; padding: 10px; text-align: center; }
.receipt-preview.large { max-height: 64vh; min-height: 240px; }
.receipt-preview img { max-width: 100%; max-height: 320px; display: block; border-radius: 6px; }
.receipt-preview.large img { max-height: 60vh; }
.receipt-preview iframe { width: 100%; height: 320px; border: 0; border-radius: 6px; background: #fff; }
.receipt-file { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; }
.receipt-file span { display: grid; place-items: center; width: 40px; height: 48px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line-strong); font-size: 11px; color: var(--ink-2); }
.status-card .pill { flex: none; }
.status-card .detail { color: var(--ink-2); }
@media (max-width: 860px) {
  .choice-row { grid-template-columns: 1fr; }
  .choice-row .pick + .pick { border-left: 0; border-top: 1px solid var(--line); }
  .kv.compact { grid-template-columns: 1fr; gap: 2px; }
  .kv.compact dd { margin-bottom: 6px; }
}
.tax-table th { white-space: nowrap; }
.tax-table td.num .sub { white-space: nowrap; }
.dialog .receipt-preview { max-height: 260px; }
.dialog .receipt-preview img { max-height: 240px; }
.dialog .receipt-preview.large, .dialog .receipt-preview.large img { max-height: 62vh; }
#self-employment { scroll-margin-top: 72px; }
[data-tax], [data-tax] > *, [data-tax] .grid > * { min-width: 0; }
@media (max-width: 860px) {
  [data-tabs] { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  [data-tax] .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  [data-tax] .stat { padding: 14px; min-width: 0; }
  [data-tax] .stat .value { font-size: 20px; }
  [data-tax] .card-head { flex-wrap: wrap; }
}

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 80; padding: 8px 14px; border-radius: 9px; background: var(--ink); color: #fff; font-weight: 600; text-decoration: none; transform: translateY(-160%); transition: transform 0.15s; }
.skip-link:focus { transform: none; }
.content:focus { outline: none; }
.scrim { position: fixed; inset: 0; z-index: 15; background: rgba(17, 19, 24, 0.4); opacity: 0; pointer-events: none; transition: opacity 0.2s; }

.progress { position: fixed; top: 0; left: 0; right: 0; z-index: 90; height: 2px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); opacity: 0; pointer-events: none; box-shadow: 0 0 8px rgba(246, 117, 46, 0.45); }
.progress[data-state="loading"] { opacity: 1; transform: scaleX(0.82); transition: transform 8s cubic-bezier(0.08, 0.7, 0.2, 1), opacity 0.1s; }
.progress[data-state="done"] { opacity: 0; transform: scaleX(1); transition: transform 0.2s ease-out, opacity 0.3s 0.15s; }

.offline-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 55; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 11px; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line-strong); box-shadow: 0 10px 30px rgba(17, 19, 24, 0.14); font-size: 13px; animation: toast-in 0.24s var(--ease); }
.offline-bar strong { color: var(--ink); }
.offline-bar:not([hidden]) ~ .toast { bottom: 76px; }

.fade-in { animation: fade-in 0.28s var(--ease) both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(3px); } }
tr.fade-in { animation-name: row-in; }
@keyframes row-in { from { opacity: 0; } }
img.fade { opacity: 0; transition: opacity 0.35s ease-out; }
img.fade.loaded { opacity: 1; }
.shot:has(img.fade:not(.loaded)), .attachments a:has(img.fade:not(.loaded)), .project:has(img.fade:not(.loaded)) > a, .thumbs a:has(img.fade:not(.loaded)), .pick-photo:has(img.fade:not(.loaded)), .receipt-thumb:has(img.fade:not(.loaded)) { background: linear-gradient(90deg, var(--shimmer) 25%, var(--shimmer-hi) 50%, var(--shimmer) 75%); background-size: 300% 100%; animation: shimmer 1.6s ease-in-out infinite; }
.project > a { display: block; background: var(--surface-2); }
.attachments a { border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.pick-photo { background: var(--surface-2); }

.sk { pointer-events: none; user-select: none; }
.sk .grow { flex: 1; min-width: 0; }
.stack > .tabs { align-self: flex-start; max-width: 100%; }
[data-warnings]:empty { display: none; }
.content > .callout { margin-bottom: 16px; }
.sk .skeleton + .skeleton { margin-top: 10px; }
.sk-lines .skeleton:nth-child(4n + 1) { width: 92%; }
.sk-lines .skeleton:nth-child(4n + 2) { width: 78%; }
.sk-lines .skeleton:nth-child(4n + 3) { width: 86%; }
.sk-lines .skeleton:nth-child(4n) { width: 54%; }
.skeleton.thin { height: 10px; }
.skeleton.tall { height: 24px; border-radius: 7px; }
.skeleton.box { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.skeleton.dot { width: 30px; height: 30px; border-radius: 50%; flex: none; }
.skeleton.button { height: 38px; border-radius: 9px; flex: none; min-width: 120px; }
.skeleton.heading { display: inline-block; width: min(320px, 60vw); height: 26px; vertical-align: middle; border-radius: 7px; }
.sk .skeleton.w-10, .skeleton.w-10 { width: 10%; min-width: 48px; }
.sk .skeleton.w-20, .skeleton.w-20 { width: 20%; }
.sk .skeleton.w-30, .skeleton.w-30 { width: 30%; }
.sk .skeleton.w-40, .skeleton.w-40 { width: 40%; }
.sk .skeleton.w-50, .skeleton.w-50 { width: 50%; }
.sk .skeleton.w-60, .skeleton.w-60 { width: 60%; }
.sk .skeleton.w-70, .skeleton.w-70 { width: 70%; }
.stat.sk { display: grid; gap: 12px; align-content: start; min-height: 116px; }
.stat.sk .skeleton + .skeleton { margin-top: 0; }
.list-item.sk { min-height: 69px; }
.list-item.sk .sk-lines .skeleton { width: 60%; }
.list-item.sk .sk-lines .skeleton.thin { width: 38%; }
.list-item.sk .skeleton + .skeleton { margin-top: 8px; }
tr.sk td { padding-top: 17px; padding-bottom: 17px; }
tr.sk td:first-child .skeleton { width: 72%; }
tr.sk td:nth-child(2) .skeleton { width: 58%; }
tr.sk td:nth-child(3) .skeleton { width: 46%; }
tr.sk td:nth-child(n + 4) .skeleton { width: 64%; }
tr.sk td:last-child:not(:first-child) .skeleton { width: 48%; margin-left: auto; }
tr.sk:nth-child(2n) td .skeleton { opacity: 0.8; }
.step.sk .grow .skeleton { width: 55%; }
.step.sk:nth-child(2n) .grow .skeleton { width: 40%; }
.sk-thread .chat { height: 520px; overflow: hidden; }
.sk-thread .card-head .skeleton + .skeleton { margin-top: 8px; }
.skeleton.bubble { width: 46%; height: 40px; border-radius: 14px; flex: none; margin: 0; }
.skeleton.bubble:nth-child(3n) { width: 32%; }
.skeleton.bubble.mine { align-self: flex-end; width: 38%; }
.sk-thread .chat .skeleton + .skeleton { margin-top: 0; }
.week.sk .day { min-height: 380px; }
.week.sk .day-head .skeleton { width: 42px; margin: 4px 0; }
.week.sk .skeleton.block { height: 64px; border-radius: 8px; }
.sk-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; align-items: end; height: 240px; padding-bottom: 22px; }
.sk-chart .skeleton { margin: 0 !important; }
.skeleton.column { height: 30%; border-radius: 6px 6px 2px 2px; }
.skeleton.column:nth-child(3n + 1) { height: 46%; }
.skeleton.column:nth-child(4n + 2) { height: 64%; }
.skeleton.column:nth-child(5n) { height: 38%; }
.skeleton.column:last-child { height: 72%; }
.portfolio.sk .skeleton { margin: 0; }
.skeleton.tile { aspect-ratio: 4 / 3; height: auto; border-radius: 10px; }
.page-head.sk { align-items: center; }
.page-head.sk .skeleton.tall { width: 220px; }
.page-head.sk .skeleton + .skeleton { margin-top: 10px; }
.page-head.sk .skeleton.w-30 { width: 340px; max-width: 70vw; }
.grid.side > .card.sk { min-height: 260px; }

[data-loading] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) { color: transparent; border-color: transparent; background: linear-gradient(90deg, var(--shimmer) 25%, var(--shimmer-hi) 50%, var(--shimmer) 75%); background-size: 300% 100%; animation: shimmer 1.6s ease-in-out infinite; pointer-events: none; }
[data-loading] :is(input, select, textarea)::placeholder { color: transparent; }
[data-loading] :is(.btn, input[type="checkbox"], input[type="radio"], input[type="range"], .choice-row, canvas) { opacity: 0.5; pointer-events: none; }
select[data-loading] { color: transparent; border-color: transparent; background: var(--shimmer); min-width: 160px; pointer-events: none; }
[data-loading]:empty:not(select) { display: block; min-height: 72px; border-radius: 8px; background: linear-gradient(90deg, var(--shimmer) 25%, var(--shimmer-hi) 50%, var(--shimmer) 75%); background-size: 300% 100%; animation: shimmer 1.6s ease-in-out infinite; }
[data-refreshing] { opacity: 0.55; pointer-events: none; transition: opacity 0.15s; }
.preview-frame[aria-busy="true"] .preview { background: linear-gradient(90deg, var(--shimmer) 25%, var(--shimmer-hi) 50%, var(--shimmer) 75%); background-size: 300% 100%; animation: shimmer 1.6s ease-in-out infinite; }
.preview { transition: opacity 0.2s; }
.preview-frame[aria-busy="true"] .preview { opacity: 0.7; }

@media (max-width: 860px) {
  .page-head { align-items: flex-start; margin-bottom: 18px; }
  .page-head > .row, .page-head > .btn { flex-wrap: wrap; }
  h1 { font-size: 22px; }
  .stats { gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat .value { font-size: 22px; }
  .card-head { padding: 14px 16px; flex-wrap: wrap; }
  .card-body, .card.pad { padding: 16px; }
  .list-item { padding: 12px 16px; }
  .card:has(> .table), .card:has(> table) { overflow-x: auto; }
  .card > .table, .card > table.table { min-width: 640px; }
  .card > .table:has(.empty-row), .card > .table:has(tr.sk) { min-width: 0; }
  .table:has(.empty-row) thead, .table:has(tr.sk) thead { display: none; }
  .table tr.sk td:nth-child(n + 3) { display: none; }
  .table.pricebook { min-width: 0; }
  .grow-row input[type="search"] { max-width: none; }
  .grow-row { flex-wrap: wrap; }
  .grow-row select { flex: 1; }
  .card-head input[type="search"] { flex: 1 1 200px; }
  .split > .threads { max-height: 280px; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat, .sk-thread .chat { height: 420px; }
  .week.sk { grid-template-columns: 1fr; }
  .week.sk .day { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .week.sk .day:nth-child(n + 4) { display: none; }
  .sk-chart { gap: 6px; height: 180px; }
  .toast, .offline-bar { bottom: 16px; }
  .dialog form { padding: 18px; }
  .dialog .actions { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .value { font-size: 20px; }
  .page-head > .row { width: 100%; }
  .page-head > .row > .btn { flex: 1; }
}

.side-footer-link { align-self: flex-start; margin: 10px 8px 0; padding: 2px 0; border: 0; background: none; font: inherit; font-size: 11.5px; color: var(--side-ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.side-footer-link:hover { color: var(--side-ink); }
.auth-main { grid-template-rows: 1fr auto; }
.auth-foot { margin: 0; font-size: 12px; }

.consent { position: fixed; left: 16px; bottom: 16px; z-index: 70; width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; display: grid; gap: 14px; padding: 18px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: 0 12px 36px rgba(17, 19, 24, 0.16); animation: consent-in 0.24s var(--ease); }
.consent[hidden] { display: none; }
.consent h2 { font-size: 15px; outline: none; }
.consent-text { display: grid; gap: 8px; }
.consent-text p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.consent-text a { color: var(--ink); font-weight: 600; }
.consent-options { display: grid; gap: 2px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.consent-options[hidden] { display: none; }
.consent-option { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; background: var(--surface-2); }
.consent-option strong { display: block; font-size: 13px; }
.consent-option small { display: block; color: var(--ink-2); font-size: 12px; line-height: 1.45; margin-top: 2px; }
label.consent-option { cursor: pointer; }
.consent-fixed { flex: none; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.consent-switch { appearance: none; flex: none; position: relative; width: 38px; height: 22px; margin: 0; border-radius: 999px; background: var(--line-strong); cursor: pointer; transition: background-color 0.15s; }
.consent-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(17, 19, 24, 0.2); transition: transform 0.15s var(--ease); }
.consent-switch:checked { background: var(--accent); }
.consent-switch:checked::after { transform: translateX(16px); }
.consent-switch:focus-visible { outline: none; box-shadow: var(--ring); }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.consent-actions .btn.ghost { margin-right: auto; padding: 0 8px; }
@keyframes consent-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 480px) {
  .consent { left: 12px; right: 12px; bottom: 12px; width: auto; padding: 16px; }
  .consent-actions .btn:not(.ghost) { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .skeleton, [data-loading] :is(input, select, textarea), [data-loading]:empty:not(select) { animation: none !important; background: var(--shimmer) !important; }
  .progress[data-state="loading"] { transform: scaleX(0.5); }
  img.fade { opacity: 1; }
}
.card.pad > .card-body.sk { padding: 0; }
.agreement-text { max-height: 420px; overflow-y: auto; font-size: 13px; line-height: 1.55; }
.agreement-text h3 { margin: 16px 0 6px; font-size: 13.5px; color: var(--ink); }
.agreement-text h3:first-child { margin-top: 0; }
.agreement-text p + p { margin-top: 8px; }
.auth-legal { display: grid; gap: 6px; }
.auth-legal a { color: inherit; }
.legal-links a { color: inherit; }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.combo { position: relative; }
.suggestions { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 8px 24px rgba(17, 19, 24, 0.12); max-height: 260px; overflow-y: auto; }
.suggestions li { padding: 7px 10px; border-radius: 7px; font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; }
.suggestions li:hover, .suggestions li[aria-selected="true"] { background: var(--accent-soft); color: #7a3a12; }
.field-hint { font-size: 12px; font-weight: 500; color: var(--ink-3); min-height: 0; }
.field-hint:empty { display: none; }
.field-hint.ok { color: var(--ok); }
.finder { display: grid; gap: 8px; align-content: end; }
.finder-slot { align-self: end; }
.address-search { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 12px; align-items: end; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: #fafbfc; }
.address-search .finder { padding-bottom: 2px; }
.money-input { position: relative; display: block; }
.money-input > span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 500; }
.money-input input { padding-left: 24px; font-variant-numeric: tabular-nums; }
.meter-wrap { padding: 0 20px 6px; }
.meter { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.meter::-webkit-progress-value { background: var(--accent); border-radius: 999px; transition: width 0.4s var(--ease); }
.meter::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.checklist { margin: 0; padding: 0; list-style: none; }
.checklist .step { padding: 0; }
.step-link { display: flex; align-items: center; gap: 14px; padding: 14px 20px; width: 100%; text-decoration: none; color: inherit; }
.step-link:hover { background: #fafbfc; }
.step-link:focus-visible { outline-offset: -2px; }
.step-link .grow { flex: 1; display: grid; gap: 2px; min-width: 0; }
.step-link .sub { color: var(--ink-3); font-size: 12px; }
.step.current .step-link { box-shadow: inset 2px 0 0 var(--accent); }
.step.current .dot { background: var(--accent-soft); color: var(--accent); }
.ready { margin-bottom: 16px; }
.ready a { color: inherit; font-weight: 600; }
.status-line { display: grid; gap: 4px; padding-left: 12px; border-left: 3px solid var(--line-strong); }
.status-line.ok { border-color: var(--ok); }
.status-line.warn { border-color: var(--warn); }
.status-line.bad { border-color: var(--bad); }
.status-line.info { border-color: var(--info); }
.status-line p { color: var(--ink-2); }
.callout p { margin-top: 4px; }
.callout ul { margin: 6px 0 0; padding-left: 18px; }
.why { font-size: 13px; }
label.chip { gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font-weight: 500; cursor: pointer; }
label.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
label.chip:has(input:focus-visible) { box-shadow: var(--ring); }
.consents { border: 0; padding: 0; margin: 0; }
.sticky { position: sticky; top: 72px; }
.align-end { align-items: flex-end; }
.bad-text { color: var(--bad); }
.tight-top { margin-top: -4px; }
.bell { position: relative; color: var(--ink-2); }
.bell:hover { background: var(--surface-2); color: var(--ink); }
.bell .badge { position: absolute; top: 2px; right: 0; margin: 0; min-width: 17px; line-height: 16px; padding: 0 4px; font-size: 10px; }
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 14px 20px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.notice:last-child { border-bottom: 0; }
.notice:hover { background: #fafbfc; }
.notice:focus-visible { outline-offset: -2px; }
.notice .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.notice .body { color: var(--ink-2); }
.notice .meta { color: var(--ink-3); font-size: 12px; }
.notice .mark { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: transparent; }
.notice.unread .mark { background: var(--accent); }
.notice.unread .title { font-weight: 650; }
.notice .action { flex: none; align-self: center; font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.alerts-strip { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.alerts-strip p { color: var(--ink-2); }
.lines-error { margin-top: -4px; }
.line [aria-invalid="true"] { border-color: var(--bad); }
.download-links { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .address-search { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .notice .action { display: none; }
}
.notice .small-icon { width: 32px; height: 32px; margin: 0; flex: none; border-radius: 10px; }
.notice .small-icon svg { width: 16px; height: 16px; }
.notice.unread .small-icon { background: var(--accent-soft); color: var(--accent); }
.checklist .step.sk { padding: 16px 20px; }
.card[id], [id="job-alerts"] { scroll-margin-top: 72px; }
