/* Software Builders: shared theme (phone-first). Light is the default working theme; dark is optional. Accent is used sparingly. */
@font-face { font-family: "Poppins"; src: url("fonts/poppins-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/poppins-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
:root, html.theme-light {
  --bg: #F4F5F7; --card: #FFFFFF; --card-2: #EEF0F3; --input: #FFFFFF; --border: #E2E3E8;
  --text: #16161A; --muted: #5C5C66; --nav: #3F3F48;
  --accent: #FF3400; --accent-text: #D42B00; --accent-ink: #FFFFFF; --accent-soft: rgba(255,52,0,.12);
  --ok: #0F7A4A; --bad: #C0172A; --warn: #8A6A00; --info: #3B4FBF;
  --glow: none; --card-shadow: 0 1px 2px rgba(16,16,20,.05);
  --sidebar: #FFFFFF; --topbar: rgba(244,245,247,.92); --tabbar: #FFFFFF;
  --toast: #FFFFFF; --toast-border: #E2E3E8;
  --tick: #C5C6CE; --sheet-dim: rgba(16,16,20,.45); --shadow: 0 18px 50px rgba(16,16,20,.14);
  --head: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}
html.theme-dark, body.theme-dark {
  --bg: #0B0B0D; --card: #16161A; --card-2: #1B1B20; --input: #101013; --border: #26262C;
  --text: #F2F2F3; --muted: #A4A4AD; --nav: #C9C9D0;
  --accent: #FF3400; --accent-text: #FF3400; --accent-ink: #FFFFFF; --accent-soft: rgba(255,52,0,.16);
  --ok: #3DDC97; --bad: #FF5C6A; --warn: #F2C14E; --info: #8FA3FF;
  --glow: 0 0 18px rgba(255,52,0,.32); --card-shadow: none;
  --sidebar: #0E0E11; --topbar: rgba(11,11,13,.94); --tabbar: #0E0E11;
  --toast: #26262C; --toast-border: #36363E;
  --tick: #4A4A53; --sheet-dim: rgba(0,0,0,.6); --shadow: 0 24px 80px rgba(0,0,0,.6);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); overscroll-behavior-y: none; color-scheme: light; -webkit-text-size-adjust: 100%; }
html.theme-dark { color-scheme: dark; }
body { margin: 0; overscroll-behavior-y: none; background: var(--bg); color: var(--text); font: 400 16px/1.5 var(--body); overflow-x: hidden; overflow-wrap: break-word; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; line-height: 1.15; } h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500; }
h3 { font-size: 17px; }
p { margin: 0; } a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); } .small { font-size: 14px; } .tiny { font-size: 13px; }
.bad { color: var(--bad); } .ok { color: var(--ok); } .accent { color: var(--accent-text); }
/* Bottom nav height = 60px tab + 1px border (+ the Android/iOS safe area, added on the nav itself). #app clears it plus 24px of air. */
:root { --tabbar-h: 61px; }
/* min-height uses svh (small viewport: stable while the URL bar shows or hides) with a vh fallback, so the layout never jumps on scroll */
#app { max-width: 640px; margin: 0 auto; min-height: 100vh; min-height: 100svh; padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom, 0px)); }
body.no-tabs #app { padding-bottom: 24px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 8px 0 12px; background: var(--topbar); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .title { flex: 1; min-width: 0; font: 600 20px var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); box-shadow: var(--glow); }
.iconbtn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--text); border-radius: 12px; cursor: pointer; padding: 0; text-decoration: none; position: relative; }
.iconbtn:active { background: var(--card); }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.page { padding: 16px 16px 24px; display: flex; flex-direction: column; gap: 20px; }
.section { display: flex; flex-direction: column; gap: 8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; min-height: 24px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--card-shadow); }
.pad { padding: 14px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kv { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; min-width: 0; }
.kv .k { font-size: 12px; color: var(--muted); } .kv .v { font: 600 17px var(--head); font-feature-settings: "tnum" 1; }
.row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; color: inherit; text-decoration: none; border: 0; border-bottom: 1px solid var(--border); background: none; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.row:last-child { border-bottom: 0; } a.row:active, button.row:active { background: var(--card-2); }
@media (hover: hover) and (pointer: fine) { a.row:hover, button.row:hover { background: var(--card-2); } .stat:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--card-shadow); } }
.row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; } .row .t { font-weight: 600; overflow-wrap: break-word; word-break: normal; } .row .s { font-size: 14px; color: var(--muted); overflow-wrap: break-word; word-break: normal; }
.row .end { text-align: right; font-size: 14px; color: var(--muted); flex: none; max-width: 40%; }
.chev { color: var(--muted); width: 18px; height: 18px; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .icon { width: 32px; height: 32px; color: var(--muted); opacity: .85; }
.empty-title { font: 600 16px var(--head); color: var(--text); }
.empty p { max-width: 32ch; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font: 600 15px var(--head); color: var(--text); flex: none; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; background: var(--chip-bg, var(--card-2)); border: 1px solid var(--chip-border, var(--border)); font-size: 13px; font-weight: 500; color: var(--chip-fg, var(--muted)); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--muted)); }
.badge.plain::before { display: none; }
.badge.sample { color: var(--warn); border-color: rgba(138,106,0,.3); --chip-bg: #FFF6D9; --chip-fg: #7A4E00; }
.s-lead { --dot: #6E6E78; --chip-bg: #F0F0F2; --chip-fg: #3C3C44; } .s-quoted { --dot: var(--info); --chip-bg: #E8F0FE; --chip-fg: #1543A0; } .s-in_progress { --dot: var(--accent); --chip-bg: #FFE8E0; --chip-fg: #9A1F00; } .s-review { --dot: var(--warn); --chip-bg: #FFF4D6; --chip-fg: #7A4E00; } .s-live { --dot: var(--ok); --chip-bg: #E3F6EA; --chip-fg: #0B5C2E; } .s-maintenance { --dot: #0F7A72; --chip-bg: #E6F7F5; --chip-fg: #0F5E57; }
.s-paid { --dot: var(--ok); --chip-bg: #E3F6EA; --chip-fg: #0B5C2E; } .s-sent { --dot: var(--info); --chip-bg: #E8F0FE; --chip-fg: #1543A0; } .s-draft { --dot: #6E6E78; --chip-bg: #F0F0F2; --chip-fg: #3C3C44; } .s-overdue { --dot: var(--bad); --chip-bg: #FDE8EA; --chip-fg: var(--bad); color: var(--bad); }
.s-invited { --dot: var(--warn); --chip-bg: #FFF4D6; --chip-fg: #7A4E00; } .s-active { --dot: var(--ok); --chip-bg: #E3F6EA; --chip-fg: #0B5C2E; } .s-disabled { --dot: var(--bad); --chip-bg: #FDE8EA; --chip-fg: var(--bad); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); font: 600 15px var(--body); cursor: pointer; text-decoration: none; }
.btn:active { background: var(--card-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: var(--glow); font-weight: 700; }
.btn.primary:active { filter: brightness(.92); }
.btn.danger { color: var(--bad); } .btn.block { width: 100%; } .btn.quiet { background: none; border: 0; color: var(--accent-text); font-weight: 500; min-height: 44px; width: auto; padding: 0 8px; box-shadow: none; } .btn.quiet:active { background: var(--card-2); } .btn[disabled] { opacity: .55; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick .btn { padding: 0 8px; font-size: 14px; }
label.lbl { font-size: 14px; color: var(--muted); display: block; margin-bottom: 6px; }
input, select, textarea { width: 100%; min-height: 48px; background: var(--input); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; font: 400 16px var(--body); appearance: none; -webkit-appearance: none; }
/* Checkboxes and radios: the rule above removes the native look, which also removes the checked state. Restore it with the brand accent. */
input[type=checkbox], input[type=radio] { appearance: auto; -webkit-appearance: auto; accent-color: #FF3400; width: 22px; height: 22px; min-height: 22px; padding: 0; flex: none; cursor: pointer; }
input[type=checkbox]:disabled, input[type=radio]:disabled { cursor: not-allowed; opacity: .6; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
textarea { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field { display: flex; flex-direction: column; } .field .hint { font-size: 13px; color: var(--muted); margin-top: 4px; } .field .err { font-size: 13px; color: var(--bad); margin-top: 4px; }
.field.bad-field input, .field.bad-field select, .field.bad-field textarea { border-color: var(--bad); }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.check input { width: 24px; height: 24px; min-height: 24px; flex: none; accent-color: var(--accent); }
.form-error { color: var(--bad); font-size: 14px; min-height: 0; }
.alert { padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); display: flex; gap: 10px; align-items: center; }
.alert.bad { background: rgba(255,92,106,.1); border-color: rgba(255,92,106,.4); }
/* Truly fixed: no transform, transition or scroll-linked behaviour. Sits above the Android gesture or button bar via the safe-area padding. */
.tabbar { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; display: flex; background: var(--tabbar); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom, 0px); transform: none; transition: none; }
.tab { flex: 1; min-height: 60px; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500; position: relative; }
.tab.active { color: var(--accent-text); }
html.theme-dark .tab.active .icon { filter: drop-shadow(0 0 6px rgba(255,52,0,.6)); }
.tab .pip { position: absolute; top: 8px; left: calc(50% + 8px); width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: var(--glow); }
.progress { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; } .progress > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; }
.progress.thin { height: 5px; }
.task { display: flex; align-items: center; gap: 4px; min-height: 52px; padding: 0 4px 0 0; border-bottom: 1px solid var(--border); }
.task:last-child { border-bottom: 0; }
.tick { width: 48px; height: 48px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; cursor: pointer; }
.tick i { width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--tick); display: inline-flex; align-items: center; justify-content: center; }
.tick i .icon { width: 16px; height: 16px; stroke-width: 3; opacity: 0; color: var(--accent-ink); }
.tick.on i { background: var(--ok); border-color: var(--ok); } .tick.on i .icon { opacity: 1; }
.task .tm { flex: 1; min-width: 0; padding: 8px 0; } .task.done .tm .t { text-decoration: line-through; color: var(--muted); }
.task .t { font-size: 16px; overflow-wrap: break-word; word-break: normal; } .task .s { font-size: 13px; color: var(--muted); overflow-wrap: break-word; word-break: normal; }
.upd { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; } .upd:last-child { border-bottom: 0; }
.upd .body { white-space: pre-wrap; } .upd .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.upd.unread { background: var(--accent-soft); } .upd.fromclient { border-left: 3px solid var(--info); }
.pill-btn { min-height: 44px; min-width: 44px; justify-content: center; display: inline-flex; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: var(--sheet-dim); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 640px; background: var(--card); border-top: 1px solid var(--border); border-radius: 20px 20px 0 0; padding: 8px 8px calc(16px + env(safe-area-inset-bottom)); max-height: 88dvh; overflow-y: auto; box-shadow: var(--shadow); }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--border); margin: 4px auto 10px; }
.sheet .row { border-radius: 12px; border-bottom: 0; }
.sheet h3 { padding: 6px 12px 8px; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--toast); color: var(--text); padding: 12px 16px; border-radius: 12px; border: 1px solid var(--toast-border); box-shadow: var(--shadow); max-width: calc(100vw - 32px); font-size: 14px; }
.toast.bad { border-color: var(--bad); }
.linkbox { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--input); border: 1px dashed var(--border); border-radius: 12px; padding: 10px 12px; word-break: break-all; user-select: all; }
.center-screen { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 24px 20px; max-width: 440px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; font: 600 22px var(--head); }
.logo .brand-dot { width: 14px; height: 14px; border-radius: 4px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.divider { height: 1px; background: var(--border); }
.tag-soon { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 2px 8px; }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
@media (min-width: 700px) { .page { padding-top: 24px; } }

.sheet-pad { padding: 8px 12px 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; }
.addrow { display: flex; gap: 8px; align-items: stretch; } .addrow input { flex: 1; min-width: 0; }
.addrow .btn { width: 48px; padding: 0; flex: none; min-height: 48px; }
.hstack { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 14px 14px; } .actions-row .btn { flex: 1 1 auto; font-size: 14px; }
.actions-row.tight { padding: 0; } .actions-row.tight .btn { flex: 0 1 auto; }
.sec-pad { padding: 4px 14px 14px; }
.hstack > .progress { flex: 1; min-width: 0; }
a.inline { display: inline-flex; align-items: center; min-height: 44px; }


/* ===================== v1.1: responsive shell, focus, readability ===================== */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
a.row:focus-visible, button.row:focus-visible, .tab:focus-visible, .navitem:focus-visible, .tbl a:focus-visible { outline-offset: -3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.skip { position: fixed; left: 8px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 8px; }
#view:focus { outline: none; }
.alert.info { background: var(--card-2); border-color: var(--border); }
.alert.ok { background: rgba(61,220,151,.1); border-color: rgba(61,220,151,.4); }
.stack.tight { gap: 8px; } .big { font: 600 22px var(--head); }
.brand-logo { height: 28px; max-width: 220px; width: auto; object-fit: contain; display: block; }
.brand-mark { display: inline-flex; align-items: center; }
.brand-mark .logo-on-dark { display: none; }
.brand-mark .logo-on-light { display: block; }
.brand-mark .brand-mark-icon { display: none; width: 28px; height: 28px; border-radius: 7px; }
/* Dark surfaces (and the dark theme) show the white wordmark. */
.on-dark .brand-mark .logo-on-light,
html.theme-dark .brand-mark .logo-on-light,
body.theme-dark .brand-mark .logo-on-light { display: none; }
.on-dark .brand-mark .logo-on-dark,
html.theme-dark .brand-mark .logo-on-dark,
body.theme-dark .brand-mark .logo-on-dark { display: block; }
.on-light .brand-mark .logo-on-dark { display: none; }
.on-light .brand-mark .logo-on-light { display: block; }
.logo.has-wordmark .logo-text { display: none; }
.center-screen .logo.has-wordmark .brand-logo { height: 44px; max-width: min(100%, 360px); }
.logo-previews { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .logo-previews { grid-template-columns: 1fr 1fr; } }
.logo-prev.on-dark { background: #0B0B0D; }
.logo-prev.on-light { background: #F4F4F5; }
.avatar { overflow: hidden; } .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; } .avatar.favicon { background: #fff; padding: 4px; } .avatar.favicon img { object-fit: contain; }
.avatar.sm { width: 34px; height: 34px; border-radius: 50%; font-size: 13px; } .avatar.lg { width: 48px; height: 48px; border-radius: 50%; } .avatar.xl { width: 84px; height: 84px; border-radius: 50%; font-size: 28px; }
.profile-head { display: flex; gap: 16px; align-items: center; }
.sidebar { display: none; }
.shell-main { min-width: 0; }
.wide-only { display: none; }
.phone-only { display: block; }
body.shell #app { max-width: none; margin: 0; padding-bottom: 0; }
.topbar .title { font-size: 20px; }
.topbtn { min-height: 40px; padding: 0 14px; font-size: 14px; }
.dgrid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.dcol { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.fgrid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.fsec h3 { font-size: 16px; padding-top: 6px; border-top: 1px solid var(--border); margin-top: 6px; }
.fgrid > .fsec:first-child h3 { border-top: 0; margin-top: 0; padding-top: 0; }
.check.switch { padding: 4px 0; } 
.toast { display: flex; align-items: center; gap: 14px; }
.toast-act { background: none; border: 0; color: var(--accent-text); font: 600 15px var(--body); min-height: 44px; padding: 0 8px; cursor: pointer; text-decoration: underline; }
.acct-card { display: flex; align-items: center; gap: 12px; padding: 8px 12px 12px; } .acct-card .who { display: flex; flex-direction: column; min-width: 0; } .acct-card small, .side-user small { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.qrbox { background: #fff; padding: 10px; border-radius: 14px; width: 220px; max-width: 100%; margin: 0 auto; } .qrbox svg { display: block; width: 100%; height: auto; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .codes code { background: var(--input); border: 1px solid var(--border); border-radius: 10px; padding: 10px; text-align: center; font: 15px ui-monospace, SFMono-Regular, Menlo, monospace; }
.ok-badge { color: var(--ok); border-color: rgba(61,220,151,.4); }
.dev .btn { min-height: 44px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font: 500 13px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-href] { cursor: pointer; } .tbl tbody tr[data-href]:hover { background: var(--card-2); }
.tbl td.num, .tbl th.num { text-align: right; font-feature-settings: "tnum" 1; }
.tbl td.nowrap, .tbl th.nowrap { white-space: nowrap; }
.tbl a.cell-link { font-weight: 600; } .tbl a.cell-link:hover { color: var(--accent-text); }
.tbl .sub { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.tbl tr.archived td { opacity: .65; }
.badge.prio-urgent { color: var(--bad); --chip-bg: #FDE8EA; --chip-fg: var(--bad); border-color: rgba(192,23,42,.28); } .badge.prio-high { color: #7A4E00; --chip-bg: #FFF4D6; --chip-fg: #7A4E00; border-color: rgba(138,106,0,.3); } .badge.prio-low { opacity: .85; }
.s-rejected { --dot: var(--bad); --chip-bg: #FDE8EA; --chip-fg: var(--bad); } .s-pending { --dot: var(--warn); --chip-bg: #FFF4D6; --chip-fg: #7A4E00; } .s-approved { --dot: var(--ok); --chip-bg: #E3F6EA; --chip-fg: #0B5C2E; }
.timeline { display: flex; flex-direction: column; } .tl-item { padding: 12px 14px 12px 34px; border-bottom: 1px solid var(--border); position: relative; display: flex; flex-direction: column; gap: 6px; } .tl-item:last-child { border-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 14px; top: 19px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: var(--glow); }
.tl-item::after { content: ""; position: absolute; left: 18px; top: 32px; bottom: -12px; width: 1px; background: var(--border); } .tl-item:last-child::after { display: none; }
.tl-item .body { white-space: pre-wrap; } .tl-item .meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.archived-banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.contact { padding: 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; } .contact:last-child { border-bottom: 0; }
.contact .ln { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); } .contact .ln a { color: var(--text); display: inline-flex; align-items: center; min-height: 32px; gap: 6px; text-decoration: underline; text-decoration-color: var(--border); }
.contact .nm { font-weight: 600; font-size: 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kvlist { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; padding: 14px; } .kvlist dt { color: var(--muted); font-size: 14px; } .kvlist dd { margin: 0; overflow-wrap: break-word; }
.segmented { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; } .segmented.wrap { flex-wrap: wrap; overflow: visible; } .segmented a { flex: none; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 99px; border: 1px solid var(--border); background: var(--card); font-weight: 500; }
.segmented a[aria-current=page] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.swatch { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); flex: none; }
.colorrow { display: flex; gap: 10px; align-items: flex-end; } .colorrow .field { flex: 1; }
input[type=color] { padding: 4px; min-width: 56px; width: 56px; flex: none; cursor: pointer; }
.logo-prev { background: var(--card-2); border: 1px dashed var(--border); border-radius: 12px; padding: 14px; display: flex; align-items: center; justify-content: center; min-height: 80px; } .logo-prev img { max-height: 60px; max-width: 100%; }
.pri-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--muted); } .pri-urgent { background: var(--bad); } .pri-high { background: var(--warn); }
.task .who { font-size: 13px; color: var(--muted); }
.moremenu { display: flex; gap: 8px; flex-wrap: wrap; }
body.density-compact .row { min-height: 44px; padding-top: 6px; padding-bottom: 6px; } body.density-compact .page { gap: 14px; } body.density-compact .tbl td { padding: 8px 14px; } body.density-compact .task { min-height: 44px; } body.density-compact .contact, body.density-compact .upd { padding-top: 8px; padding-bottom: 8px; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ---------- Phone (< 768px): header with avatar, bottom tabs ---------- */
@media (max-width: 767px) {
  body.shell #app { padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom, 0px)); }
  .segmented { gap: 4px; -webkit-overflow-scrolling: touch; }
  .segmented a { padding: 0 12px; font-size: 14px; }
  .topbar .topbtn { display: none; }
  .wide-only { display: none; }
  .topbar .brand-mark .brand-logo { display: none !important; }
  .topbar .brand-mark .brand-mark-icon { display: block; width: 28px; height: 28px; border-radius: 7px; }
  .topbar .brand-logo.custom { height: 24px; max-width: 120px; }
}
/* ---------- Tablet and up: sheets become centred dialogs ---------- */
@media (min-width: 768px) {
  body.shell #app { display: flex; align-items: stretch; min-height: 100dvh; }
  .sidebar { display: flex; flex: none; align-self: stretch; min-height: 100dvh; background: var(--sidebar); border-right: 1px solid var(--border); }
  .sidebar-inner { position: sticky; top: 0; height: 100dvh; max-height: 100dvh; display: flex; flex-direction: column; gap: 6px; width: 100%; box-sizing: border-box; overflow: hidden; }
  .shell-main { flex: 1; min-width: 0; margin-left: 0; }
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 20px; border: 1px solid var(--border); max-width: 560px; max-height: 86vh; padding: 12px 12px 16px; margin: 24px; box-shadow: var(--shadow); }
  .sheet .grab { display: none; }
  .phone-only { display: none; }
  .toast { bottom: 28px; }
  .page { padding: 24px 28px 40px; max-width: 1100px; margin: 0 auto; width: 100%; }
  .dgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fgrid > .full { grid-column: 1 / -1; }
  .formbtn { width: auto; align-self: flex-start; min-width: 200px; }
  .list-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .list-2 > .row:nth-child(odd), .list-2 > .contact:nth-child(odd) { border-right: 1px solid var(--border); }
  .list-2 > .empty { grid-column: 1 / -1; }
  .quick { max-width: 520px; }
}
/* ---------- Tablet (768 - 1199px): slim icon rail on the left, no bottom tabs ---------- */
@media (min-width: 768px) and (max-width: 1199px) {
  .tabbar { display: none; }
  body.shell #app { padding-bottom: 0; }
  .sidebar { width: 88px; }
  .sidebar-inner { align-items: center; padding: 14px 6px; }
  .side-brand { height: 44px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; } .side-name { display: none; } .side-brand .brand-logo { height: 30px; max-width: 64px; } .side-brand .brand-dot { width: 18px; height: 18px; border-radius: 5px; }
  .side-brand .brand-mark .brand-logo { display: none !important; } .side-brand .brand-mark .brand-mark-icon { display: block; width: 36px; height: 36px; border-radius: 9px; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; width: 100%; overflow-y: auto; }
  .navitem { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 62px; border-radius: 14px; color: var(--muted); font-size: 12px; font-weight: 500; text-decoration: none; padding: 6px 2px; }
  .navitem:hover { background: var(--card); color: var(--text); } .navitem.active { color: var(--accent-text); background: var(--accent-soft); }
  .side-sep { height: 1px; background: var(--border); margin: 6px 12px; }
  .side-user { display: flex; align-items: center; justify-content: center; background: none; border: 0; padding: 6px; border-radius: 14px; cursor: pointer; color: var(--text); min-height: 52px; width: 100%; } .side-user:hover { background: var(--card); } .side-user .who { display: none; }
  .topbar { position: sticky; background: var(--topbar); padding: 0 20px; height: 64px; }
  .topbar .brand, .topbar .acct { display: none; }
  .topbar .title { font-size: 22px; }
  .page { padding: 24px 32px 48px; }
}
/* ---------- Desktop (>= 1200px): fixed left sidebar with labels, wide tables, multi-column detail pages ---------- */
@media (min-width: 1200px) {
  .tabbar { display: none; }
  .narrow-only { display: none; }
  .wide-only { display: block; }
  .sidebar { width: 264px; }
  .sidebar-inner { padding: 18px 12px 14px; }
  .side-brand { display: flex; align-items: center; gap: 12px; padding: 6px 12px 16px; font: 600 18px var(--head); } .side-name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; overflow: hidden; text-overflow: ellipsis; } .side-name small { font: 500 12px var(--body); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
  .side-brand .brand-dot { width: 16px; height: 16px; border-radius: 5px; flex: none; }
  .side-brand.has-wordmark { flex-direction: column; align-items: flex-start; gap: 4px; } .side-brand.has-wordmark .side-trading { display: none; } .side-brand.has-wordmark .brand-logo { height: 28px; max-width: 216px; }
  .side-brand.has-custom .brand-logo { height: 32px; max-width: 160px; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
  .navitem { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 14px; border-radius: 12px; color: var(--nav); font-size: 16px; font-weight: 500; text-decoration: none; }
  .navitem:hover { background: var(--card); color: var(--text); } .navitem.active { color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); } .navitem .icon { width: 22px; height: 22px; }
  .side-sep { height: 1px; background: var(--border); margin: 8px 8px; }
  .side-user { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 1px solid var(--border); padding: 10px 12px; border-radius: 14px; cursor: pointer; color: var(--text); min-height: 60px; width: 100%; font: inherit; } .side-user:hover { background: var(--card-2); }
  .side-user .who { display: flex; flex-direction: column; min-width: 0; flex: 1; } .side-user b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .side-user small { white-space: nowrap; }
  .topbar { position: sticky; height: 72px; padding: 0 40px; background: var(--topbar); }
  .topbar .brand, .topbar .acct { display: none; }
  .topbar .title { font-size: 26px; }
  .page { max-width: none; padding: 28px 40px 56px; }
  .page.narrow { max-width: 920px; margin: 0; }
  .dgrid.wide-split { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .dgrid.thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid3.six { grid-template-columns: repeat(6, 1fr); }
  .card.table-card { overflow-x: auto; }
}
@media (min-width: 1500px) { .page { padding-left: 56px; padding-right: 56px; } }

@media (min-width: 768px) { .phone-act { display: none; } .search-act { display: none; } }

.due { margin-left: 8px; white-space: nowrap; }

@media (pointer: coarse) { .contact .ln a { min-height: 44px; } .tl-item .pill-btn, .pill-btn { min-height: 44px; min-width: 44px; } }

.topbtn { min-height: 44px; }
@media (min-width: 768px) and (max-width: 1199px) { .taskmeta { grid-template-columns: 1fr; } }

button.tab { background: none; border: 0; font-family: inherit; cursor: pointer; }
@media (min-width: 768px) and (max-width: 1199px) { .dcol .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kv { min-width: 0; }

.toolbar .field.grow { flex: 1; max-width: 480px; min-width: 0; }

/* ===================== v1.3: avatars, stats, chips, empty states, skeletons ===================== */
.avatar.tone-0 { background: #FFE8E0; color: #9A1F00; border-color: #FFD0C4; }
.avatar.tone-1 { background: #E8F0FE; color: #1543A0; border-color: #C9D9F8; }
.avatar.tone-2 { background: #E3F6EA; color: #0B5C2E; border-color: #B9E4C8; }
.avatar.tone-3 { background: #F3E8FE; color: #5B21B6; border-color: #E0C8FA; }
.avatar.tone-4 { background: #FFF4D6; color: #7A4E00; border-color: #F3E0A8; }
.avatar.tone-5 { background: #E6F7F5; color: #0F5E57; border-color: #B9E4DE; }
.avatar.tone-6 { background: #FDE8F0; color: #9D174D; border-color: #F5C4D4; }
.avatar.tone-7 { background: #EEF0F5; color: #1E3A5F; border-color: #D2D8E6; }
html.theme-dark .avatar.favicon { background: #1B1B20; }
html.theme-dark .avatar.tone-0 { background: rgba(255,52,0,.18); color: #FFB199; border-color: rgba(255,52,0,.28); }
html.theme-dark .avatar.tone-1 { background: rgba(143,163,255,.16); color: #C5D0FF; border-color: rgba(143,163,255,.28); }
html.theme-dark .avatar.tone-2 { background: rgba(61,220,151,.14); color: #8BE8C0; border-color: rgba(61,220,151,.28); }
html.theme-dark .avatar.tone-3 { background: rgba(167,139,250,.16); color: #D4C4FF; border-color: rgba(167,139,250,.28); }
html.theme-dark .avatar.tone-4 { background: rgba(242,193,78,.16); color: #F7DC96; border-color: rgba(242,193,78,.28); }
html.theme-dark .avatar.tone-5 { background: rgba(76,201,192,.16); color: #9EE8E2; border-color: rgba(76,201,192,.28); }
html.theme-dark .avatar.tone-6 { background: rgba(255,92,106,.16); color: #FFB3BB; border-color: rgba(255,92,106,.28); }
html.theme-dark .avatar.tone-7 { background: rgba(200,210,230,.1); color: #D0D7E6; border-color: rgba(200,210,230,.2); }
html.theme-dark .s-lead, html.theme-dark .s-draft { --chip-bg: rgba(110,110,120,.2); --chip-fg: #C9C9D0; }
html.theme-dark .s-quoted, html.theme-dark .s-sent { --chip-bg: rgba(143,163,255,.16); --chip-fg: #C5D0FF; }
html.theme-dark .s-in_progress { --chip-bg: rgba(255,52,0,.16); --chip-fg: #FFB199; }
html.theme-dark .s-review, html.theme-dark .s-invited, html.theme-dark .s-pending { --chip-bg: rgba(242,193,78,.16); --chip-fg: #F7DC96; }
html.theme-dark .s-live, html.theme-dark .s-paid, html.theme-dark .s-active, html.theme-dark .s-approved { --chip-bg: rgba(61,220,151,.14); --chip-fg: #8BE8C0; }
html.theme-dark .s-maintenance { --chip-bg: rgba(76,201,192,.16); --chip-fg: #9EE8E2; }
html.theme-dark .s-overdue, html.theme-dark .s-disabled, html.theme-dark .s-rejected { --chip-bg: rgba(255,92,106,.16); --chip-fg: #FFB3BB; }
html.theme-dark .badge.sample, html.theme-dark .badge.prio-high { --chip-bg: rgba(242,193,78,.16); --chip-fg: #F7DC96; }
html.theme-dark .badge.prio-urgent { --chip-bg: rgba(255,92,106,.16); --chip-fg: #FFB3BB; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 14px 16px; min-height: 76px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--card-shadow); color: inherit; text-decoration: none; }
.stat-val { font: 700 24px/1.1 var(--head); font-feature-settings: "tnum" 1; letter-spacing: -.02em; }
.stat-lbl { font-size: 13px; color: var(--muted); }
.stat.bad .stat-val { color: var(--bad); }
.stat.warn .stat-val { color: #7A4E00; }
.stat.ok .stat-val { color: var(--ok); }
.stat.info .stat-val { color: var(--info); }
html.theme-dark .stat.warn .stat-val { color: var(--warn); }
@media (max-width: 767px) { .stats > :nth-child(3):last-child { grid-column: 1 / -1; } }
@media (min-width: 768px) { .stats, .stats.stats-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }

.due-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.due-chip.bad { background: #FDE8EA; color: var(--bad); }
.due-chip.accent { background: #FFE8E0; color: var(--accent-text); }
html.theme-dark .due-chip.bad { background: rgba(255,92,106,.16); color: #FFB3BB; }
html.theme-dark .due-chip.accent { background: rgba(255,52,0,.16); color: #FFB199; }

.page-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.page-hero .muted { margin-top: 4px; }
.cell-entity { display: flex; align-items: center; gap: 10px; min-width: 0; } .cell-entity .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 12px; } .cell-entity .t { font-weight: 600; }

.contact { display: grid; grid-template-columns: 40px 1fr; gap: 8px 12px; align-items: start; }
.contact > .avatar { grid-row: 1 / span 4; margin-top: 2px; }
.contact .nm, .contact .ln, .contact .small, .contact .hstack { grid-column: 2; }

.skel-page { gap: 14px; }
.skel { height: 14px; border-radius: 8px; background: linear-gradient(90deg, var(--card-2) 25%, var(--border) 50%, var(--card-2) 75%); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
.skel-title { height: 28px; width: 42%; }
.skel-line { width: 28%; }
.skel.short { width: 55%; }
@keyframes skel { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

.tbl .progress { min-width: 72px; }
.profile-card .row { align-items: center; }

@media (min-width: 768px) and (max-width: 1199px) {
  .dcol .task .avatar { display: none; }
  .quick { max-width: none; }
}



/* ---------- Inbox accent button (top of admin nav) ---------- */
.nav-accent { position: relative; background: #FF3400; color: #fff !important; font-weight: 600; border-radius: 14px; box-shadow: none; }
.nav-accent .icon { color: #fff; stroke: #fff; }
.nav-accent:hover, .nav-accent:focus-visible { background: #E02E00; color: #fff !important; }
.nav-accent.active { background: #FF3400; color: #fff !important; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: auto; border-radius: 99px; background: #fff; color: #FF3400; font-size: 11px; font-weight: 700; line-height: 1; font-style: normal; letter-spacing: 0; }
.tab.nav-accent { flex: 1; margin: 6px 4px; min-height: 48px; padding: 4px 0; }
.tab.nav-accent.active { box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.tab.nav-accent .nav-count { position: absolute; top: 4px; right: calc(50% - 22px); margin: 0; }
@media (min-width: 700px) {
  .sidebar .nav-accent { margin: 0 0 8px; }
}
@media (min-width: 1200px) {
  .sidebar .nav-accent { min-height: 48px; padding: 0 14px; }
}
html.sidebar-collapsed .nav-accent, body.sidebar-collapsed .nav-accent,
html.sidebar-collapsed .nav-accent.active, body.sidebar-collapsed .nav-accent.active { box-shadow: none; }
html.sidebar-collapsed .nav-accent, body.sidebar-collapsed .nav-accent { width: 64px; min-height: 48px; margin: 0 0 6px; padding: 0; justify-content: center; }
html.sidebar-collapsed .nav-count, body.sidebar-collapsed .nav-count { position: absolute; top: 2px; right: 2px; margin: 0; }

/* ===================== v1.4: collapsible sidebar, profile hero, contacts ===================== */
.side-toggle { display: none; }
.profile-hero { overflow: hidden; }
.profile-hero-shot-wrap { position: relative; background: var(--card-2); }
.profile-hero-shot { display: block; width: 100%; max-height: 180px; aspect-ratio: 16 / 9; object-fit: cover; object-position: center 38%; background: var(--card-2); }
.profile-hero-shot-wrap .hero-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.profile-hero-bar { display: flex; gap: 16px; align-items: center; padding: 16px 18px; border-top: 1px solid var(--border); }
.profile-hero-bar .main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.profile-hero-bar .t { font-size: 22px; font-weight: 600; overflow-wrap: break-word; }
.profile-hero-bar .s { color: var(--muted); font-size: 14px; }
.profile-tabs { margin-bottom: 4px; }
.req { color: var(--accent-text); font-weight: 600; margin-left: 2px; }
.date-input { position: relative; display: block; width: 100%; }
.date-display { width: 100%; padding-right: 44px; font-variant-numeric: tabular-nums; }
.date-iso { position: absolute; top: 0; right: 0; bottom: 0; width: 44px !important; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; background: transparent; }
.date-input::after { content: ""; position: absolute; right: 14px; top: 50%; width: 16px; height: 15px; transform: translateY(-50%); border: 1.7px solid var(--muted); border-radius: 3px; pointer-events: none; box-shadow: inset 0 4px 0 0 var(--card-2); }
.board-col { min-height: 160px; }
.board-col .empty { padding: 24px 12px; }
@media (hover: hover) and (pointer: fine) {
  .board-card .move { opacity: 0; transition: opacity .12s ease; }
  .board-card:hover .move, .board-card:focus-within .move { opacity: 1; }
}

.ln { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.ln a { color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.contact-companies { display: flex; flex-wrap: wrap; gap: 6px; }
.contact-companies a { display: inline-flex; align-items: center; gap: 6px; }
@media (min-width: 768px) and (max-width: 1199px) {
  .side-toggle { display: none; }
}
@media (min-width: 1200px) {
  .side-toggle { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 44px; padding: 0 14px; margin-top: auto; border: 0; background: none; color: var(--muted); font: 500 14px var(--body); border-radius: 12px; cursor: pointer; text-align: left; }
  .side-toggle:hover { background: var(--card); color: var(--text); }
  .side-toggle .icon { width: 22px; height: 22px; flex: none; }
  html.sidebar-collapsed .sidebar, body.sidebar-collapsed .sidebar { width: 88px; }
  html.sidebar-collapsed .sidebar-inner, body.sidebar-collapsed .sidebar-inner { align-items: center; padding: 18px 6px 14px; }
  html.sidebar-collapsed .side-name, body.sidebar-collapsed .side-name,
  html.sidebar-collapsed .navitem span, body.sidebar-collapsed .navitem span,
  html.sidebar-collapsed .side-toggle span, body.sidebar-collapsed .side-toggle span,
  html.sidebar-collapsed .side-user .who, body.sidebar-collapsed .side-user .who { display: none; }
  html.sidebar-collapsed .side-brand, body.sidebar-collapsed .side-brand { justify-content: center; padding: 6px 0 12px; width: 100%; }
  html.sidebar-collapsed .side-brand.has-wordmark, body.sidebar-collapsed .side-brand.has-wordmark { align-items: center; flex-direction: column; }
  html.sidebar-collapsed .side-brand .brand-logo, body.sidebar-collapsed .side-brand .brand-logo { display: none !important; }
  html.sidebar-collapsed .side-brand .brand-mark .brand-mark-icon, body.sidebar-collapsed .side-brand .brand-mark .brand-mark-icon { display: block; width: 36px; height: 36px; border-radius: 9px; }
  html.sidebar-collapsed .navitem, body.sidebar-collapsed .navitem { flex-direction: column; align-items: center; justify-content: center; gap: 0; min-height: 48px; padding: 0; box-shadow: none; }
  html.sidebar-collapsed .navitem.active, body.sidebar-collapsed .navitem.active { box-shadow: none; }
  html.sidebar-collapsed .side-toggle, body.sidebar-collapsed .side-toggle { justify-content: center; padding: 0; }
  html.sidebar-collapsed .side-user, body.sidebar-collapsed .side-user { justify-content: center; padding: 6px; }
  html.sidebar-collapsed .shell-main, body.sidebar-collapsed .shell-main { margin-left: 0; }
  html.sidebar-collapsed .side-sep, body.sidebar-collapsed .side-sep { margin: 6px 12px; width: auto; align-self: stretch; }
}

/* ===================== v1.5: command palette ===================== */
.side-search { display: none; }
.kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 0 6px; height: 22px; border: 1px solid var(--border); border-radius: 6px; font: 500 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); background: var(--card-2); }
.palette-bg { position: fixed; inset: 0; z-index: 80; background: rgba(15,15,18,.45); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 24px; }
.palette { width: min(640px, 100%); background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; max-height: min(72vh, 640px); }
.palette-q { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.palette-q .icon { width: 22px; height: 22px; color: var(--muted); flex: none; }
.palette-q input { flex: 1; min-width: 0; border: 0; background: none; color: inherit; font: 500 16px var(--body); outline: none; min-height: 40px; }
.palette-list { overflow-y: auto; padding: 8px; }
.palette-sep { font: 600 11px var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: none; color: inherit; font: inherit; border-radius: 10px; padding: 8px 10px; cursor: pointer; min-height: 48px; }
.palette-item:hover, .palette-item.active { background: var(--accent-soft); color: var(--text); }
.palette-item .main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.palette-item .t { font-weight: 600; overflow-wrap: break-word; }
.palette-item .s { color: var(--muted); font-size: 13px; }
.palette-ico { flex: none; width: 28px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.palette-ico .icon { width: 20px; height: 20px; }
.palette-empty { padding: 28px 16px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 14px 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
html.theme-dark .palette-bg, body.theme-dark .palette-bg { background: rgba(0,0,0,.55); }
@media (min-width: 1200px) {
  .side-search { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 44px; padding: 0 14px; border: 0; background: var(--card); border: 1px solid var(--border); color: var(--muted); font: 500 14px var(--body); border-radius: 12px; cursor: pointer; text-align: left; margin: 4px 0; }
  .side-search:hover { background: var(--card-2); color: var(--text); }
  .side-search .icon { width: 20px; height: 20px; flex: none; }
  .side-search .side-kbd { margin-left: auto; }
  html.sidebar-collapsed .side-search span, body.sidebar-collapsed .side-search span,
  html.sidebar-collapsed .side-search .kbd, body.sidebar-collapsed .side-search .kbd { display: none; }
  html.sidebar-collapsed .side-search, body.sidebar-collapsed .side-search { justify-content: center; padding: 0; width: 100%; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .side-search { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); border-radius: 12px; cursor: pointer; }
  .side-search span, .side-search .kbd { display: none; }
  .side-search:hover { background: var(--card); color: var(--text); }
}
@media (max-width: 767px) {
  .side-search { display: none; }
  .palette-bg { padding-top: 8px; align-items: stretch; }
  .palette { max-height: 92vh; border-radius: 16px 16px 0 0; }
}

/* Health panel + activity feed (v1.6) */
.health-card { padding: 12px 14px 14px; }
.health-backup { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 12px; }
.health-backup-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.health-backup-form .date-input { width: auto; min-width: 11rem; flex: 0 0 auto; }
.health-backup-form .lbl { margin: 0; font-size: 13px; }
.health-backup-form .date-display { min-height: 40px; padding: 0 44px 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--input); color: var(--text); font: 500 14px var(--body); }
.health-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); }
.health-host .t { display: block; font-weight: 600; }
.health-host .s { color: var(--muted); font-size: 13px; }
.health-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.health-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); background: var(--card-2); color: var(--muted); }
.health-pill.t-ok { color: var(--ok); background: #E3F6EA; border-color: rgba(15,122,74,.28); }
.health-pill.t-warn { color: #7A4E00; background: #FFF4D6; border-color: rgba(138,106,0,.3); }
.health-pill.t-bad { color: var(--bad); background: #FDE8EA; border-color: rgba(192,23,42,.28); }
.health-pill.t-muted { color: var(--muted); }
html.theme-dark .health-pill.t-ok { background: rgba(61,220,151,.14); color: #8BE8C0; border-color: rgba(61,220,151,.28); }
html.theme-dark .health-pill.t-warn { background: rgba(242,193,78,.16); color: #F7DC96; border-color: rgba(242,193,78,.28); }
html.theme-dark .health-pill.t-bad { background: rgba(255,92,106,.16); color: #FFB3BB; border-color: rgba(255,92,106,.28); }
.tl-kind { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.tl-kind .icon { width: 16px; height: 16px; color: var(--muted); }
.tl-item .body .s { margin-top: 4px; color: var(--text); white-space: pre-wrap; }

/* Quotes, invoices, board, time, files (v1.7) */
.lines { width: 100%; border-collapse: collapse; }
.lines th, .lines td { padding: 6px 8px; text-align: left; vertical-align: top; }
.lines th { font-size: 12px; font-weight: 600; color: var(--muted); }
.lines input { width: 100%; min-height: 40px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); color: var(--text); font: 500 14px var(--body); }
.lines .num, .lines .num input { text-align: right; white-space: nowrap; }
.lines .qty { width: 88px; } .lines .unit { width: 110px; } .lines .amt { width: 110px; white-space: nowrap; font-weight: 600; }
.doc table.lines { table-layout: fixed; }
.doc table.lines th:nth-child(1), .doc table.lines td:nth-child(1) { width: auto; }
.doc table.lines th:nth-child(2), .doc table.lines td:nth-child(2) { width: 72px; }
.doc table.lines th:nth-child(3), .doc table.lines td:nth-child(3),
.doc table.lines th:nth-child(4), .doc table.lines td:nth-child(4) { width: 120px; }
.lines-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0 0; flex-wrap: wrap; }
.doc { padding: 28px; }
.doc-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
.doc-head h1 { margin: 0 0 4px; font-size: 28px; }
.doc-meta { text-align: right; }
.doc table.lines { margin: 16px 0; }
.doc .totals { margin-left: auto; max-width: 280px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.board-col { background: var(--card-2); border: 1px solid var(--border); border-radius: 16px; min-height: 280px; padding: 10px; }
.board-col h3 { margin: 0 8px 10px; font-size: 14px; display: flex; justify-content: space-between; }
.board-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--card-shadow); }
.board-card:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.board-card .t { font-weight: 600; }
.board-card .s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.board-card .move { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.board-col.dragover { outline: 2px dashed var(--accent); }
.timer-chip { display: inline-flex; align-items: center; gap: 8px; }
.file-row { display: flex; align-items: center; gap: 10px; }
.file-row .main { flex: 1; min-width: 0; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
@media print {
  .sidebar, .topbar, .tabbar, .hero-actions, .actions-row, .no-print, .btn, nav, .segmented, [data-act] { display: none !important; }
  body, html, #app, #view, .page, .main, .content { background: #fff !important; margin: 0 !important; padding: 0 !important; box-shadow: none !important; max-width: none !important; }
  .doc { padding: 0; }
}
.s-accepted, .s-doing { --dot: var(--info); --chip-bg: #E8F0FE; --chip-fg: #1543A0; }
.s-declined, .s-expired { --dot: var(--bad); --chip-bg: #FDE8EA; --chip-fg: var(--bad); }
.s-todo { --dot: #6E6E78; --chip-bg: #F0F0F2; --chip-fg: #3C3C44; }

/* ---- company website screenshot empty state ---- */
.profile-hero-empty { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:8px; min-height:180px; padding:22px 24px; background:var(--card-2); }
.profile-hero-empty svg { width:28px; height:28px; color:var(--accent); }
.profile-hero-empty .empty-title { font-weight:600; font-size:16px; }
.profile-hero-caption { padding:0 18px 12px; color:var(--muted); font-size:13px; }

/* ---- mail ---- */
.mail-app { display:grid; grid-template-columns: 200px minmax(0, 1fr); gap:16px; align-items:start; }
.mail-folders { position:sticky; top:12px; }
.mail-folders .folder { display:flex; align-items:center; gap:8px; width:100%; text-align:left; padding:8px 10px; border-radius:10px; border:0; background:transparent; color:inherit; font:inherit; cursor:pointer; }
.mail-folders .folder[aria-current="page"], .mail-folders .folder.is-on { background:var(--card-2); font-weight:600; }
.mail-folders .folder .n { margin-left:auto; color:var(--muted); font-size:12px; }
.mail-toolbar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:10px; }
.mail-toolbar .grow { flex:1; min-width:160px; }
.mail-row { display:grid; grid-template-columns: 28px 28px minmax(0, 1.2fr) minmax(0, 2fr) auto; gap:10px; align-items:center; padding:10px 14px; border-bottom:1px solid var(--border); text-decoration:none; color:inherit; }
.mail-row:last-child { border-bottom:0; }
.mail-row:hover, .mail-row:focus-visible { background:var(--card-2); }
.mail-row.unseen .from, .mail-row.unseen .subj { font-weight:600; }
.mail-row .from, .mail-row .subj { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mail-row .subj .s { color:var(--muted); font-weight:400; }
.mail-row .meta { color:var(--muted); font-size:13px; white-space:nowrap; }
.mail-row .star { border:0; background:transparent; color:var(--muted); padding:4px; cursor:pointer; border-radius:8px; }
.mail-row .star.on, .mail-row .star.on svg { color:var(--accent); }
.mail-read { display:flex; flex-direction:column; gap:0; }
.mail-read-head { padding:16px 18px; border-bottom:1px solid var(--border); display:flex; flex-direction:column; gap:8px; }
.mail-read-head h1 { font-size:22px; font-weight:600; margin:0; overflow-wrap:break-word; }
.mail-read-head .main, .mail-box-row .main { display:flex; flex-direction:column; gap:2px; min-width:0; }
.mail-read-body { padding:18px; overflow:auto; max-width:100%; }
.mail-read-body .mail-html { font-size:15px; line-height:1.55; overflow-wrap:break-word; }
.mail-read-body .mail-html img { max-width:100%; height:auto; }
.mail-read-body .mail-html a { color:var(--accent); }
.mail-atts { display:flex; flex-wrap:wrap; gap:8px; padding:0 18px 16px; }
.mail-atts a { display:inline-flex; align-items:center; gap:6px; }
.mail-compose textarea.body { min-height:220px; }
.mail-box-row .t { font-weight:600; }
.mailbox-pass { display:flex; gap:8px; align-items:end; flex-wrap:wrap; }
@media (max-width: 767px) {
  .mail-app { grid-template-columns: 1fr; }
  .mail-folders { position:static; display:flex; gap:6px; overflow:auto; padding-bottom:4px; }
  .mail-folders .folder { flex:0 0 auto; }
  .mail-row { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .mail-row .subj { grid-column: 2 / 3; }
  .mail-row .from { grid-column: 2 / 3; }
  .mail-row .meta { grid-column: 3 / 4; grid-row: 1 / 3; }
}

.sig-frame { display:block; width:100%; min-height:220px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.sig-assign { width:100%; border-collapse:collapse; }
.sig-assign th, .sig-assign td { text-align:left; vertical-align:middle; padding:8px 10px 8px 0; border-bottom:1px solid var(--line); }
.sig-assign th { font-size:12px; color:var(--muted); font-weight:600; }
.sig-assign input, .sig-assign select { width:100%; }
#compose-sig-card { margin-top:16px; }
.mail-read-body .mail-html table { border-collapse:collapse; }
.mail-read-body .mail-html td { vertical-align:top; }


/* v2.1 products & pricing */
.product-settings { display:flex; flex-direction:column; gap:16px; }
.product-grid { display:grid; gap:12px; }
@media (min-width: 860px) { .product-grid { grid-template-columns: 1fr 1fr; } }
.product-card h3 { margin:0; font-size:16px; }
.product-card .product-head { align-items:flex-start; justify-content:space-between; gap:12px; }
.product-card .product-desc { margin:8px 0 10px; white-space:pre-wrap; color:var(--muted); font-size:13px; }
.product-card .product-price { margin:0 0 12px; }
.product-card .product-annual { display:block; margin-top:2px; color:var(--muted); font-weight:500; font-size:13px; }
.product-card.is-recommended { border-color: var(--accent, #e85d04); }
.product-card.is-inactive { opacity:0.72; }
.field.is-disabled { opacity:0.5; }
.field.is-disabled input { pointer-events:none; }
.line-row .line-desc select,
.line-row .unit select { width:100%; margin-bottom:6px; }
.line-row .line-hint { margin-top:4px; }
@media print {
  .line-row select[data-line="product"],
  .line-row select[data-line="cycle"] { display:none; }
}

/* Credit check & FlexiPay eligibility (phase two) */
.credit-flags { display: flex; flex-direction: column; gap: 8px; }
.credit-flag { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--card-2); }
.credit-flag.fail { background: rgba(255,92,106,.1); border-color: rgba(255,92,106,.4); }
.credit-flag.refer { background: #FFF4D6; border-color: #F3E0A8; }
html.theme-dark .credit-flag.refer { background: rgba(242,193,78,.16); border-color: rgba(242,193,78,.28); }
.credit-flag .t { display: block; font-weight: 600; }
.credit-outcome { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); margin-bottom: 12px; }
.credit-outcome.pass { background: rgba(61,220,151,.1); border-color: rgba(61,220,151,.4); }
.credit-outcome.refer { background: #FFF4D6; border-color: #F3E0A8; }
.credit-outcome.fail { background: rgba(255,92,106,.1); border-color: rgba(255,92,106,.4); }
.credit-outcome.in_progress { background: var(--card-2); }
.credit-outcome h3 { margin: 0 0 4px; font-size: 1.05rem; }
.credit-check-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 12px 0; border-bottom: 1px solid var(--border); align-items: start; }
.credit-check-row:last-child { border-bottom: 0; }
.credit-check-row .s { display: block; margin-top: 2px; }
.credit-details { margin-top: 8px; }
.credit-details .kvlist { margin: 0; }
