:root {
  --bg: #edf3fc; --surface: #ffffff; --surface-2: #f1f6fe; --border: #d9e3f3; --text: #0f1b33; --muted: #5a6883;
  --accent: #2563eb; --accent-soft: #e5eefe; --accent-text: #ffffff; --accent-2: #0ea5e9;
  --navy: #0b1f44; --navy-2: #143a7a;
  --green: #12805c; --green-soft: #e3f5ee; --amber: #a15c00; --amber-soft: #fdf1dc;
  --red: #c4302b; --red-soft: #fce8e7; --blue: #1d64c9; --blue-soft: #e5effc; --gray-soft: #eceef2;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --sidebar: 232px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
    --bg: #0a1222; --surface: #101a2e; --surface-2: #16223a; --border: #233252; --text: #e6ecf7; --muted: #92a2c2;
    --accent: #5b9bff; --accent-soft: #16284d; --accent-text: #0a1222; --accent-2: #38bdf8;
    --navy: #060d1f; --navy-2: #0e1f45;
    --green: #4cc79a; --green-soft: #15302a; --amber: #f0b454; --amber-soft: #352914;
    --red: #ff7b72; --red-soft: #3a1b1b; --blue: #6ea8ff; --blue-soft: #16263f; --gray-soft: #262a33;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  } }
:root[data-theme="dark"] {
    --bg: #0a1222; --surface: #101a2e; --surface-2: #16223a; --border: #233252; --text: #e6ecf7; --muted: #92a2c2;
    --accent: #5b9bff; --accent-soft: #16284d; --accent-text: #0a1222; --accent-2: #38bdf8;
    --navy: #060d1f; --navy-2: #0e1f45;
    --green: #4cc79a; --green-soft: #15302a; --amber: #f0b454; --amber-soft: #352914;
    --red: #ff7b72; --red-soft: #3a1b1b; --blue: #6ea8ff; --blue-soft: #16263f; --gray-soft: #262a33;
    --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark;
  }
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* author display rules (flex, grid…) must never un-hide an element */
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* layout */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; padding: 4px 8px 16px; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-size: 13px; }
.sidebar-logo { display: block; flex: 1; min-width: 0; }
.sidebar-logo img { width: 100%; max-width: 160px; height: auto; display: block; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); font-weight: 500; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav .count { margin-left: auto; background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; }
.nav .soon { margin-left: auto; font-size: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 99px; padding: 0 6px; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--border); padding-top: 12px; display: flex; align-items: center; gap: 10px; }
.main { min-width: 0; }
.topbar { display: none; }
.page { padding: 24px 32px 48px; max-width: 1400px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* components */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
/* "card after card" spacing is for stacked cards; side-by-side cards in a grid must line up */
:is(.grid, .kb-cats, .kb-pinned, .brand-grid, .file-grid) > .card + .card { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.stat { padding: 14px 16px; }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.stat.warn .value { color: var(--red); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 7px 12px; border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.btn.ghost { border-color: transparent; background: transparent; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.b-green, .b-done, .b-available, .b-active, .b-completed, .b-fulfilled, .b-approved { background: var(--green-soft); color: var(--green); }
.b-amber, .b-review, .b-repair, .b-on_hold, .b-high, .b-pending, .b-expiring { background: var(--amber-soft); color: var(--amber); }
.b-red, .b-urgent, .b-lost, .b-rejected, .b-expired, .b-overdue { background: var(--red-soft); color: var(--red); }
.b-blue, .b-in_progress, .b-assigned, .b-planning { background: var(--blue-soft); color: var(--blue); }
.b-low { background: var(--gray-soft); color: var(--muted); }
.b-medium { background: var(--blue-soft); color: var(--blue); }
.tag { font-size: 11px; padding: 0 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }

.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.person { display: inline-flex; align-items: center; gap: 8px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
th a { color: inherit; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.activity-list { max-height: 420px; overflow-y: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* forms */
label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; }
.field { margin-bottom: 14px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 3px; }
.field .error, .errorlist { color: var(--red); font-size: 12px; margin: 3px 0 0; padding: 0; list-style: none; }
.field.checkbox label { display: flex; gap: 8px; align-items: center; }
.field ul.checks, .field div[id$=members] { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.field div[id$=members] label { font-weight: 400; display: flex; gap: 6px; align-items: center; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 140px; padding: 6px 10px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--accent); border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg a { padding: 5px 12px; color: var(--muted); border-right: 1px solid var(--border); font-weight: 500; }
.seg a:last-child { border-right: 0; }
.seg a.active { background: var(--accent-soft); color: var(--accent); }
.seg a:hover { text-decoration: none; }

.messages { margin-bottom: 16px; display: grid; gap: 8px; }
.msg { padding: 10px 14px; border-radius: 8px; background: var(--green-soft); color: var(--green); font-weight: 500; }
.msg.error { background: var(--red-soft); color: var(--red); }
.notice { padding: 12px 14px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* kanban */
.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.column { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; font-weight: 600; }
.column-head .n { color: var(--muted); font-weight: 500; margin-left: 6px; }
.dropzone { display: flex; flex-direction: column; gap: 8px; min-height: 60px; border-radius: 8px; }
.dropzone.over { outline: 2px dashed var(--accent); outline-offset: 2px; }
.tcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; box-shadow: var(--shadow); cursor: grab; display: block; color: var(--text); }
.tcard:hover { border-color: var(--accent); text-decoration: none; }
.tcard.dragging { opacity: .45; }
.tcard .title { font-weight: 500; margin: 2px 0 8px; }
.tcard .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.tcard .meta .spacer { flex: 1; }
.quick-add input { background: transparent; border: 1px dashed var(--border); margin-top: 8px; }
.quick-add input:focus { background: var(--surface); border-style: solid; }
.overdue-text { color: var(--red); font-weight: 600; }

/* task page */
.prose { white-space: pre-wrap; word-wrap: break-word; }
.props { display: grid; grid-template-columns: 100px 1fr; gap: 10px; align-items: center; }
.props dt { color: var(--muted); font-size: 12.5px; }
.props dd { margin: 0; }
.props select, .props input { padding: 4px 8px; }
.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment:last-of-type { border-bottom: 0; }
.comment .body { flex: 1; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; border-left: 2px solid var(--border); margin-left: 6px; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.timeline li.closed::before { border-color: var(--muted); }
.timeline li:last-child { border-color: transparent; }
details.panel { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--surface); }
details.panel + details.panel { margin-top: 10px; }
details.panel summary { cursor: pointer; font-weight: 600; }
details.panel[open] summary { margin-bottom: 12px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.inline-form > * { flex: 1 1 120px; }
.inline-form .btn { flex: 0 0 auto; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 18px; padding: 16px; }
.auth .card { width: 100%; max-width: 380px; padding: 28px; }
.auth-logo { display: flex; justify-content: center; padding: 0 8px 24px; }
.auth-logo img { width: 100%; max-width: 260px; height: auto; display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-logo { background: #fff; border-radius: 10px; padding: 14px 12px; margin-bottom: 24px; } :root:not([data-theme="light"]) .auth-logo img { max-width: 240px; } }
:root[data-theme="dark"] .auth-logo { background: #fff; border-radius: 10px; padding: 14px 12px; margin-bottom: 24px; } :root[data-theme="dark"] .auth-logo img { max-width: 240px; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s; z-index: 20; box-shadow: var(--shadow); }
  .shell.nav-open .sidebar { transform: none; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
  .page { padding: 16px; }
  .g2, .g3, .g4, .form-grid { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(4, 82vw); }
}
.bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 12px; position: sticky; top: 8px; z-index: 5; }
.bulkbar[hidden] { display: none; }
.bulkbar select { width: auto; min-width: 220px; padding: 5px 8px; }

/* notification centre */
.brand .grow { flex: 1; }
.bell { position: relative; display: inline-grid; place-items: center; width: 34px; height: 30px; background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer; color: inherit; padding: 0; line-height: 1; }
.bell svg { width: 19px; height: 19px; display: block; }
.app-back { display: inline-grid; place-items: center; padding: 0 8px; }
.app-back[hidden] { display: none; }
.app-back svg { width: 18px; height: 18px; }
.bell:hover { background: var(--surface-2); }
.bell-count { position: absolute; top: -4px; right: -6px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 99px; padding: 1px 5px; }
.bell-count[hidden] { display: none; }
.bell-panel { position: fixed; top: 56px; left: 16px; width: 380px; max-width: calc(100vw - 32px); max-height: 70vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.2); z-index: 50; }
.bell-panel[hidden] { display: none; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.bell-list { overflow-y: auto; padding: 6px; }
.notif { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 8px; color: var(--text); }
.notif:hover { background: var(--surface-2); text-decoration: none; }
.notif .grow { display: flex; flex-direction: column; min-width: 0; }
.notif.unread { background: var(--accent-soft); }
.notif.unread .notif-text { font-weight: 600; }
.notif-ico { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex: none; font-size: 13px; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; }
.toast { display: flex; gap: 10px; align-items: center; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-width: 360px; transition: opacity .5s, transform .5s; }
.toast:hover { text-decoration: none; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* presence dots on avatars */
[data-presence] { position: relative; }
[data-presence]::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--surface); background: transparent; }
[data-presence].p-online::after { background: #22a06b; }
[data-presence].p-away::after { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
[data-presence].p-busy::after { background: #e5484d; }
@media (max-width: 800px) { .bell-panel { top: 56px; left: auto; right: 16px; } .sidebar .bell { display: none; } }

/* task files */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.file-tile { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; position: relative; background: var(--surface); }
.file-tile .thumb { height: 100px; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.file-tile .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-tile .thumb.icon { font-size: 34px; text-decoration: none; }
.file-tile .meta { padding: 6px 8px; display: flex; flex-direction: column; min-width: 0; }
.file-tile form { position: absolute; top: 4px; right: 4px; }
.file-tile form .btn { background: var(--surface); padding: 1px 7px; }
.drop-target { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px dashed var(--border); border-radius: 10px; padding: 16px; cursor: pointer; font-weight: 400; text-align: center; margin: 0; }
.drop-target:hover, .drop-target.over { border-color: var(--accent); background: var(--accent-soft); }

/* charts (palette validated: blue #2a78d6 / orange #eb6834 light; #3987e5 / #d95926 dark) */
:root { --series-1: #2a78d6; --series-2: #eb6834; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --series-1: #3987e5; --series-2: #d95926; } }
:root[data-theme="dark"] { --series-1: #3987e5; --series-2: #d95926; }
.chart { margin: 0; }
.chart svg { width: 100%; height: 220px; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .tick { fill: var(--muted); font-size: 10px; }
.chart .ln { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln.dashed { stroke: var(--muted) !important; stroke-dasharray: 5 4; }
.chart .s1 { stroke: var(--series-1); fill: var(--series-1); }
.chart .ln.s1, .chart .ln.s2 { fill: none; }
.chart .s2 { stroke: var(--series-2); fill: var(--series-2); }
.chart .bar { stroke: none; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover { fill: color-mix(in srgb, var(--text) 6%, transparent); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.sw.s1 { background: var(--series-1); } .sw.s2 { background: var(--series-2); }
.sw.dashed { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
.tip { position: fixed; pointer-events: none; background: var(--text); color: var(--bg); font-size: 12px; padding: 5px 8px; border-radius: 6px; z-index: 70; max-width: 320px; }
.hbar-cell { min-width: 140px; }
.hbar { height: 8px; border-radius: 0 4px 4px 0; background: var(--series-1); min-width: 2px; }
.hbar-track { background: var(--surface-2); border-radius: 4px; }

/* gantt / timeline */
.gantt { display: grid; grid-template-columns: 240px minmax(0, 1fr); padding: 0; overflow: hidden; }
.gantt-labels { border-right: 1px solid var(--border); background: var(--surface); z-index: 2; }
.gantt-corner { height: 48px; border-bottom: 1px solid var(--border); }
.gantt-label { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 13px; min-width: 0; }
.gantt-label:hover { background: var(--surface-2); text-decoration: none; }
.gantt-scroll { overflow-x: auto; position: relative; }
.gantt-head { height: 48px; border-bottom: 1px solid var(--border); position: relative; background: var(--surface); }
.gantt-months, .gantt-ticks { position: relative; height: 24px; }
.gantt-months span { position: absolute; top: 0; height: 24px; line-height: 24px; padding-left: 6px; font-size: 12px; font-weight: 600; border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.gantt-ticks span { position: absolute; top: 0; height: 24px; line-height: 24px; font-size: 10.5px; color: var(--muted); padding-left: 3px; border-left: 1px solid var(--border); white-space: nowrap; }
.gantt-ticks span.we { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.gantt-body { position: relative; }
.gantt-row { position: relative; height: 34px; border-bottom: 1px solid var(--border); }
.gantt-weekend { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--red); opacity: .6; z-index: 1; }
.gantt-bar { position: absolute; top: 6px; height: 22px; border-radius: 6px; display: flex; align-items: center; padding: 0 8px; font-size: 12px; color: #fff; cursor: grab; user-select: none; touch-action: none; overflow: hidden; z-index: 2; }
.gantt-bar:hover { text-decoration: none; filter: brightness(1.08); }
.gantt-bar.saving { opacity: .6; }
.gantt-bar.late { box-shadow: 0 0 0 2px var(--red); }
.gantt-bar .gantt-grip { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.gantt-bar .gantt-grip:hover { background: rgba(255,255,255,.35); }
.st-todo { background: #8b93a7; } .st-in_progress { background: var(--series-1); } .st-review { background: #b7791f; } .st-done { background: #22a06b; }
.sw.st { height: 10px; width: 14px; border-radius: 3px; } .sw.late-sw { background: transparent; box-shadow: inset 0 0 0 2px var(--red); }
.gantt-bar.portfolio { background: color-mix(in srgb, var(--series-1) 35%, var(--surface)); color: var(--text); cursor: pointer; }
.gantt-bar .progress-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--series-1); opacity: .55; }
.gantt-band { position: absolute; top: 7px; height: 20px; border-radius: 4px; font-size: 11px; line-height: 20px; padding: 0 6px; background: var(--surface-2); border: 1px dashed var(--border); color: var(--muted); overflow: hidden; white-space: nowrap; }
.gantt-band.active { background: var(--blue-soft); border-style: solid; border-color: var(--blue); color: var(--blue); font-weight: 600; }
.gantt-project { position: absolute; top: 14px; height: 6px; border-radius: 3px; background: var(--muted); opacity: .5; }
.gantt-diamond { position: absolute; top: 10px; width: 13px; height: 13px; margin-left: -6px; transform: rotate(45deg); background: var(--amber); border: 2px solid var(--surface); z-index: 3; }
.gantt-diamond.done { background: #22a06b; }
@media (max-width: 800px) { .gantt { grid-template-columns: 130px minmax(0, 1fr); } }
.edit-table td { padding: 4px 6px; }
.edit-table input, .edit-table select { padding: 5px 8px; }
.sprint-move { width: auto; padding: 3px 6px; font-size: 12px; }
table.ts th.num, table.ts td.num, td.num, th.num { text-align: right; }
table.ts td.num input { width: 64px; text-align: right; padding: 5px 6px; }
table.ts .today { background: var(--accent-soft); }
table.ts .we { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }

/* search palette */
.palette-backdrop { position: fixed; inset: 0; background: rgba(10,12,18,.45); z-index: 80; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.palette-backdrop[hidden] { display: none; }
.palette { width: 640px; max-width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 24px 64px rgba(0,0,0,.35); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.palette input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 16px 18px; font-size: 16px; }
.palette input:focus { outline: 0; }
.palette-results { overflow-y: auto; padding: 6px; }
.pal-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 4px; font-weight: 600; }
.pal-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; color: var(--text); min-width: 0; }
.pal-item .grow { display: flex; flex-direction: column; min-width: 0; }
.pal-item.active, .pal-item:hover { background: var(--accent-soft); text-decoration: none; }
.palette-foot { border-top: 1px solid var(--border); padding: 8px 14px; }
.search-trigger { display: flex; align-items: center; gap: 8px; width: 100%; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; color: var(--muted); font: inherit; cursor: pointer; margin: 0 0 8px; }
.search-trigger kbd, kbd { margin-left: auto; font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; background: var(--surface); }
kbd { margin-left: 0; }
.gantt-label .mono { white-space: nowrap; flex: none; }
.gantt-bar { -webkit-user-drag: none; }

/* keyboard shortcut hints */
.nav-kbd, .btn-kbd, .tab-kbd { font: 600 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 2px 4px; background: var(--surface); letter-spacing: .02em; white-space: nowrap; }
.nav a .nav-kbd { margin-left: auto; opacity: .75; }
.nav a:hover .nav-kbd { opacity: 1; }
.nav a .count + .nav-kbd, .nav a .dot + .nav-kbd { margin-left: 8px; }
/* unread / due marker in the sidebar (on every page, not only in chat), keeping the shortcut aligned on the right */
.nav a .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.sidebar .nav a .dot { background: #93c5fd; }
.sidebar .nav a.active .dot { background: #fff; }
.nav a.active .nav-kbd { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: transparent; }
.btn .btn-kbd { margin-left: 4px; padding: 1px 4px; background: transparent; }
.btn.primary .btn-kbd { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent-text) 45%, transparent); }
.tabs .tab-kbd { margin-left: 6px; padding: 1px 4px; opacity: .6; }
.tabs a.active .tab-kbd { opacity: 1; color: var(--accent); }
.kbd-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.shortcuts-link { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 12.5px; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.shortcuts-link:hover { background: var(--surface-2); color: var(--text); }
.shortcuts-link kbd { margin-left: auto; }
.key-hint { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 10px; font-size: 13px; z-index: 90; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.key-hint[hidden] { display: none; }
.key-hint kbd { background: var(--bg); color: var(--text); }
.key-hint .muted { color: color-mix(in srgb, var(--bg) 70%, var(--text)); }
.shortcuts-sheet { width: 760px; max-height: 80vh; }
.sc-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.sc-body { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 16px 18px; overflow-y: auto; }
.sc-body h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.sc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.sc-row:last-of-type { border-bottom: 0; }
.sc-row > span:last-child { white-space: nowrap; color: var(--muted); font-size: 11px; }
@media (max-width: 700px) { .sc-body { grid-template-columns: 1fr; } }
/* No keyboard on touch devices: hide the hints */
@media (hover: none) { .nav-kbd, .btn-kbd, .tab-kbd, .shortcuts-link, .search-trigger kbd { display: none; } }
.badge.dept { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.module-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.field div[id$=departments], .field div[id$=people], .field div[id$=module_keys] { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; max-height: 260px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.field div[id$=departments] label, .field div[id$=people] label, .field div[id$=module_keys] label { font-weight: 400; display: flex; gap: 6px; align-items: center; margin: 0; }

/* ---- social media module ---- */
.pf { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 5px; border-radius: 5px; font: 700 10px/1 ui-sans-serif, system-ui, sans-serif; color: #fff; margin-right: 2px; letter-spacing: .02em; }
.pf-instagram { background: #d62976; } .pf-facebook { background: #1877f2; } .pf-linkedin { background: #0a66c2; }
.pf-youtube { background: #e00000; } .pf-x { background: #111; } .pf-threads { background: #333; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pf-x, :root:not([data-theme="light"]) .pf-threads { background: #e7e9ee; color: #111; } }
:root[data-theme="dark"] .pf-x, :root[data-theme="dark"] .pf-threads { background: #e7e9ee; color: #111; }
.b-idea, .b-draft, .b-cancelled { background: var(--gray-soft); color: var(--muted); }
.b-changes { background: var(--red-soft); color: var(--red); }
.b-approved { background: var(--blue-soft); color: var(--blue); }
.b-published { background: var(--green-soft); color: var(--green); }
.pillar-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--pillar); margin-right: 6px; vertical-align: middle; }
.planner-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.planner-bar .filters { margin: 0; }
.plan-card { display: grid; grid-template-columns: 1.3fr 1.2fr .8fr; gap: 24px; margin-bottom: 14px; }
.pp-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; margin-bottom: 6px; }
.pp-bar { position: relative; height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.pp-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; max-width: 100%; }
.pp-planned { background: color-mix(in srgb, var(--series-1) 30%, transparent); }
.pp-done { background: var(--series-1); }
.sw.pp-legend-done { background: var(--series-1); } .sw.pp-legend-planned { background: color-mix(in srgb, var(--series-1) 30%, transparent); }
.planner-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; align-items: start; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--border); gap: 1px; }
.cal-head { background: var(--surface-2); padding: 6px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cal-day { background: var(--surface); min-height: 118px; padding: 4px 5px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.out { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.cal-day.out .cal-date span { color: var(--muted); opacity: .6; }
.cal-day.today .cal-date span { background: var(--accent); color: var(--accent-text); border-radius: 99px; padding: 0 7px; }
.cal-day.over { outline: 2px dashed var(--accent); outline-offset: -3px; background: var(--accent-soft); }
.cal-date { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; min-height: 20px; }
.cal-add { opacity: 0; font-size: 15px; padding: 0 5px; border-radius: 5px; color: var(--muted); }
.cal-day:hover .cal-add { opacity: 1; }
.cal-add:hover { background: var(--surface-2); text-decoration: none; }
.cal-key { font-size: 10.5px; color: var(--amber); background: var(--amber-soft); border-radius: 4px; padding: 1px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-post { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px 4px 8px; border-radius: 6px; background: var(--surface-2); border-left: 3px solid var(--pillar); color: var(--text); font-size: 11.5px; cursor: grab; min-width: 0; position: relative; }
.cal-post:hover { text-decoration: none; filter: brightness(.97); box-shadow: var(--shadow); }
.cal-post.dragging, .cal-post.saving { opacity: .45; }
.cal-time { font-size: 10px; color: var(--muted); font-weight: 600; }
.cal-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-meta { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.cal-meta .pf { height: 15px; min-width: 18px; font-size: 9px; padding: 0 3px; }
.dot-status { width: 8px; height: 8px; border-radius: 50%; margin-left: auto; background: var(--muted); }
.st-review .dot-status, .legend-st.st-review { background: var(--amber); }
.st-changes .dot-status, .legend-st.st-changes { background: var(--red); }
.st-approved .dot-status, .legend-st.st-approved { background: var(--blue); }
.st-published .dot-status, .legend-st.st-published { background: #22a06b; }
.st-completed .dot-status, .legend-st.st-completed { background: #0f7a52; }
.legend-st { width: 10px; height: 10px; border-radius: 50%; }
.legend-st.st-draft { background: var(--muted); }
.cal-post.st-completed, .cal-post.st-published { opacity: .8; cursor: pointer; }
.ideas { margin: 0; position: sticky; top: 12px; max-height: calc(100vh - 40px); overflow: auto; }
.ideas-list { display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.stepper { display: flex; list-style: none; padding: 0; margin: 0 0 16px; gap: 0; counter-reset: s; }
.stepper li { flex: 1; text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 4px; border-bottom: 3px solid var(--border); counter-increment: s; }
.stepper li::before { content: counter(s) " · "; }
.stepper li.done { color: var(--green); border-color: #22a06b; }
.stepper li.current { color: var(--accent); border-color: var(--accent); }
.next-step { border-left: 4px solid var(--accent); }
.review-note { margin: 0 0 12px; padding: 10px 12px; background: var(--red-soft); border-radius: 8px; color: var(--text); }
.copy-block { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.copy-block.brief { background: var(--surface-2); }
.copy-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.copy-head .btn { margin-left: auto; }
.hashtags { color: var(--blue); }
.tag-link { color: var(--blue); }
.pf-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-option { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 9px; font-weight: 400; margin: 0; cursor: pointer; }
.pf-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pf-option .pf { height: 20px; font-size: 11px; }
.counter { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.count-chip { border: 1px solid var(--border); border-radius: 99px; padding: 1px 8px 1px 2px; display: inline-flex; align-items: center; gap: 4px; }
.count-chip.over { border-color: var(--red); color: var(--red); background: var(--red-soft); font-weight: 600; }
.hashtag-sets { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.preview { font-size: 13.5px; line-height: 1.5; max-height: 320px; overflow: auto; word-wrap: break-word; }
.result-block { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px 12px; margin: 0 0 12px; }
.result-block legend { padding: 0 6px; font-weight: 600; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-bottom: 8px; }
.metric-grid label { display: flex; flex-direction: column; gap: 3px; font-weight: 500; margin: 0; }
.metric-grid input { padding: 5px 8px; }
.results-table th, .results-table td { padding: 7px 8px; }
.approval-card .approval-caption { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; white-space: pre-wrap; }
.approval-thumb { max-height: 180px; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 10px; display: block; }
.approval-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.timeline li.ev-changes::before { border-color: var(--red); }
.timeline li.ev-approved::before { border-color: #22a06b; background: #22a06b; }
.ev-note { background: var(--surface-2); border-radius: 6px; padding: 4px 8px; margin-top: 3px; }
@media (max-width: 1100px) { .planner-wrap { grid-template-columns: 1fr; } .ideas { position: static; max-height: none; } .plan-card { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .calendar { grid-template-columns: 1fr; background: transparent; gap: 6px; border: 0; }
  .cal-head { display: none; } .cal-day.out { display: none; } .cal-day { min-height: 0; border: 1px solid var(--border); border-radius: 8px; }
  .approval-actions { grid-template-columns: 1fr; }
}
.audit-fail td { background: var(--red-soft); }

/* knowledge base */
.kb-search input { font-size: 16px; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.kb-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.kb-cat, .kb-pin, .kb-row { display: flex; gap: 12px; color: var(--text); margin: 0; }
.kb-cat:hover, .kb-pin:hover, .kb-row:hover { border-color: var(--accent); text-decoration: none; }
.kb-row { flex-direction: column; gap: 2px; margin-bottom: 8px; }
.kb-pin { flex-direction: column; gap: 2px; }
.kb-pinned { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 12px; }
.kb-icon { font-size: 24px; line-height: 1; }
.md { line-height: 1.65; font-size: 14.5px; overflow-wrap: anywhere; }
.md h2 { font-size: 19px; margin: 22px 0 8px; } .md h3 { font-size: 16px; margin: 18px 0 6px; } .md h4, .md h5 { font-size: 14px; margin: 14px 0 4px; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow: auto; font-size: 12.5px; }
.md code { background: var(--surface-2); border-radius: 4px; padding: 0 4px; font-size: 12.5px; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--accent); background: var(--accent-soft); margin: 10px 0; padding: 8px 12px; border-radius: 0 8px 8px 0; }
.md ul, .md ol { padding-left: 22px; } .md li { margin: 3px 0; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.md .lead { font-size: 15.5px; color: var(--muted); margin-top: 0; }
.md-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.md-editor textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; min-height: 420px; }
.md-preview { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; min-height: 420px; max-height: 70vh; overflow: auto; background: var(--surface); }
.kb-vote { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toc { position: sticky; top: 12px; }
@media (max-width: 900px) { .md-editor { grid-template-columns: 1fr; } }

/* helpdesk */
.prio-urgent { background: var(--red-soft); color: var(--red); } .prio-high { background: var(--amber-soft); color: var(--amber); }
.prio-normal { background: var(--blue-soft); color: var(--blue); } .prio-low { background: var(--gray-soft); color: var(--muted); }
.tk-new { background: var(--accent-soft); color: var(--accent); } .tk-open { background: var(--blue-soft); color: var(--blue); }
.tk-waiting { background: var(--amber-soft); color: var(--amber); } .tk-resolved, .tk-closed { background: var(--green-soft); color: var(--green); }
.tk-closed { opacity: .75; }
tr.row-breach td { background: color-mix(in srgb, var(--red-soft) 60%, transparent); }
.thread { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.msg-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.msg-card.agent { border-left: 3px solid var(--blue); }
.msg-card.note { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, var(--border)); }
.msg-card.first { border-left: 3px solid var(--accent); }
.msg-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.msg-card-head .small.muted { margin-left: auto; }
.thread-event { font-size: 12px; color: var(--muted); padding: 2px 14px; }
.ticket-files { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.file-chip-link { border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; color: var(--text); background: var(--surface-2); }
.reply-box.is-note { background: var(--amber-soft); }
.reply-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.reply-actions input[type=file] { width: auto; }
.agent-panel form { margin-bottom: 8px; }
.agent-panel label { margin-bottom: 2px; }
.kb-suggest { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.kb-suggest .list li { flex-wrap: wrap; }

/* products */
.product-card { border-top: 3px solid var(--pc); }
.pstat { display: flex; flex-direction: column; color: var(--text); padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.pstat:hover { text-decoration: none; background: var(--accent-soft); }
.pstat strong { font-size: 20px; }
.demand { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 12px; }
.demand::before { content: "▲ "; font-size: 9px; }
.roadmap { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
.shipped-col { opacity: .85; }
.ft-idea, .rl-planned, .fb-new { background: var(--gray-soft); color: var(--muted); }
.ft-planned, .rl-in_progress, .fb-reviewed { background: var(--blue-soft); color: var(--blue); }
.ft-in_progress, .fb-planned { background: var(--accent-soft); color: var(--accent); }
.ft-shipped, .rl-released, .fb-done { background: var(--green-soft); color: var(--green); }
.ft-cancelled, .fb-declined { background: var(--red-soft); color: var(--red); }
.sev-critical { background: var(--red); color: #fff; } .sev-major { background: var(--red-soft); color: var(--red); }
.sev-minor { background: var(--amber-soft); color: var(--amber); } .sev-trivial { background: var(--gray-soft); color: var(--muted); }
.bg-new { background: var(--accent-soft); color: var(--accent); } .bg-confirmed, .bg-in_progress { background: var(--blue-soft); color: var(--blue); }
.bg-fixed, .bg-verified, .bg-closed { background: var(--green-soft); color: var(--green); } .bg-wont_fix, .bg-duplicate { background: var(--gray-soft); color: var(--muted); }

/* social: links & brand */
.link-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 3px 0; }
.utm-preview { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; word-break: break-all; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.swatch { display: flex; align-items: center; gap: 10px; }
.swatch-chip { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; flex: none; }
.swatch-chip.copied { outline: 3px solid var(--green); }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; align-content: start; }
.brand-tile { margin: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.brand-tile .thumb { height: 130px; display: grid; place-items: center; background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 50% / 16px 16px; font-size: 40px; }
.brand-tile .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-tile .thumb:hover { text-decoration: none; }
.brand-meta { padding: 10px 12px; min-width: 0; }
.use-in-post select { padding: 3px 6px; font-size: 12px; width: auto; max-width: 140px; }
.announcement.unread { border-left: 4px solid var(--accent); }
.announcement.pinned { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.dash-announce { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-left: 4px solid var(--accent); margin-bottom: 12px; }
.personal-todos { margin-bottom: 16px; padding: 22px; border-radius: 16px; scroll-margin-top: 80px; }
.personal-todo-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.personal-todo-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.personal-todo-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.personal-todo-icon svg { width: 23px; height: 23px; }
.personal-todo-heading h2 { margin: 0 0 3px; font-size: 16px; letter-spacing: -.02em; }
.personal-todo-heading p { margin: 0; font-size: 12px; color: var(--muted); }
.personal-todo-private { display: inline-flex; gap: 5px; align-items: center; background: var(--surface-2); border: 1px solid var(--border); padding: 4px 8px; border-radius: 20px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.personal-todo-private svg { width: 13px; height: 13px; }
.personal-todo-add { display: flex; align-items: center; gap: 8px; padding: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.personal-todo-add:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.personal-todo-plus { margin-left: 7px; color: var(--muted); font-size: 22px; line-height: 1; }
.personal-todo-add input[type=text] { flex: 1; min-width: 0; width: auto; background: transparent; border: 0; padding: 8px 2px; font-size: 13px; outline: none; }
.personal-todo-add .btn { flex: 0 0 auto; border-radius: 8px; font-size: 12px; min-height: 36px; padding: 8px 12px; }
.personal-todo-summary { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin: 18px 0 8px; font-size: 11px; color: var(--muted); }
.personal-todo-summary strong { font-weight: 600; color: var(--text); }
.personal-todo-summary-dot { margin: 0 7px; }
.personal-todo-summary a { font-weight: 500; }
.personal-todo-list { list-style: none; margin: 0; padding: 0; }
.personal-todo-row { display: flex; align-items: center; gap: 11px; min-height: 49px; border-bottom: 1px solid var(--border); }
.personal-todo-row:last-child { border-bottom: 0; }
.personal-todo-row form { margin: 0; flex: 0 0 auto; }
.personal-todo-check { display: grid; place-items: center; width: 23px; height: 23px; border: 1.5px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--accent-text); cursor: pointer; transition: border-color .15s, background .15s; }
.personal-todo-check svg { width: 15px; height: 15px; opacity: 0; }
.personal-todo-check:hover { border-color: var(--accent); background: var(--accent-soft); }
.personal-todo-title { flex: 1; min-width: 0; padding: 12px 0; overflow-wrap: anywhere; font-size: 13px; }
.personal-todo-list .is-done .personal-todo-check { background: var(--accent); border-color: var(--accent); }
.personal-todo-list .is-done .personal-todo-check svg { opacity: 1; }
.personal-todo-list .is-done .personal-todo-title { color: var(--muted); text-decoration: line-through; }
.personal-todo-delete { display: grid; place-items: center; width: 32px; height: 32px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 8px; opacity: .6; }
.personal-todo-delete svg { width: 16px; height: 16px; }
.personal-todo-delete:hover { opacity: 1; color: var(--red); background: var(--red-soft); }
.personal-todo-check:focus-visible, .personal-todo-delete:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.personal-todo-empty { display: flex; align-items: center; gap: 12px; padding: 20px 4px 10px; }
.personal-todo-empty > span { display: grid; place-items: center; width: 32px; height: 32px; background: var(--surface-2); color: var(--muted); border-radius: 50%; }
.personal-todo-empty strong { font-size: 12px; font-weight: 500; }
.personal-todo-empty p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.personal-todo-completed { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
.personal-todo-completed summary { color: var(--muted); cursor: pointer; font-size: 12px; }
.personal-todo-completed summary span { margin-left: 5px; border-radius: 12px; background: var(--surface-2); padding: 2px 7px; font-size: 10px; }
@media(max-width:600px) { .personal-todos { padding: 16px; } .personal-todo-head { gap: 8px; } .personal-todo-heading { gap: 9px; } .personal-todo-heading p { font-size: 11px; } .personal-todo-icon { width: 36px; height: 36px; } .personal-todo-private { font-size: 10px; padding: 3px 6px; } .personal-todo-add input[type=text] { font-size: 16px; } .personal-todo-add .btn { padding: 8px 10px; } .personal-todo-add .personal-todo-plus { display: none; } }
.security-dialog { border: 1px solid var(--border); border-radius: 16px; padding: 26px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 24px 70px rgba(5,20,55,.28); text-align: center; }
.security-dialog::backdrop { background: rgba(8,25,58,.52); backdrop-filter: blur(2px); }
.security-dialog h2 { margin: 8px 0; }
.security-dialog p { color: var(--muted); line-height: 1.55; margin: 0 auto 20px; max-width: 360px; }
.security-dialog-icon { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto; border-radius: 14px; background: var(--accent-soft); font-size: 26px; }
.security-dialog-close { position: absolute; right: 12px; top: 10px; }
.security-dialog-close button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 24px; }
.security-dialog-actions { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.security-dialog-actions form { margin: 0; }

/* ---- HR & recruitment ---------------------------------------------------------------------- */
input[type=datetime-local], input[type=file] { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.field div[id$=interviewers] { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.field div[id$=interviewers] label { font-weight: 400; display: flex; gap: 6px; align-items: center; margin: 0; }
.ok-text { color: var(--green); }
.st-new { background: var(--blue-soft); color: var(--blue); }
.st-screening { background: var(--accent-soft); color: var(--accent); }
.st-interview { background: var(--amber-soft); color: var(--amber); }
.st-offer { background: color-mix(in srgb, var(--green-soft) 60%, var(--amber-soft)); color: var(--green); }
.st-hired { background: var(--green); color: #fff; }
.st-rejected, .st-withdrawn { background: var(--gray-soft); color: var(--muted); }
.jb-open { background: var(--green-soft); color: var(--green); } .jb-draft { background: var(--gray-soft); color: var(--muted); } .jb-closed { background: var(--red-soft); color: var(--red); }
.lv-pending { background: var(--amber-soft); color: var(--amber); } .lv-approved { background: var(--green-soft); color: var(--green); }
.lv-rejected { background: var(--red-soft); color: var(--red); } .lv-cancelled { background: var(--gray-soft); color: var(--muted); }
.iv-scheduled { background: var(--blue-soft); color: var(--blue); } .iv-done { background: var(--green-soft); color: var(--green); } .iv-cancelled { background: var(--gray-soft); color: var(--muted); }
.v-strong_yes { background: var(--green); color: #fff; } .v-yes { background: var(--green-soft); color: var(--green); }
.v-no { background: var(--red-soft); color: var(--red); } .v-strong_no { background: var(--red); color: #fff; }
.diff-easy { background: var(--green-soft); color: var(--green); } .diff-medium { background: var(--blue-soft); color: var(--blue); } .diff-hard { background: var(--red-soft); color: var(--red); }
.stars { color: var(--border); letter-spacing: 1px; font-size: 13px; white-space: nowrap; } .stars .on { color: #f5a623; }
.rate { display: flex; align-items: center; gap: 2px; }
.rate button { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--border); cursor: pointer; padding: 0 1px; }
.rate button.on, .rate:hover button { color: #f5a623; }
.rate button:hover ~ button:not(.clear) { color: var(--border); }
.rate button.clear { font-size: 12px; margin-left: 8px; color: var(--muted); }
.stage-quick { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.notice-info { background: var(--blue-soft); color: var(--blue); } .notice-ok { background: var(--green-soft); color: var(--green); }
.copy-row { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 260px; }
.copy-row input { flex: 1; min-width: 0; padding: 5px 8px; font-size: 12.5px; }
.props-wide { grid-template-columns: 120px 1fr; }
.funnel-row { display: grid; grid-template-columns: 74px 1fr 30px; gap: 8px; align-items: center; margin: 5px 0; font-size: 12.5px; }
.funnel-bar { height: 16px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.funnel-bar span { display: block; height: 100%; background: var(--accent); opacity: .85; border-radius: 4px; min-width: 2px; }
.funnel-num { text-align: right; font-weight: 600; }
.score-row { display: flex; gap: 16px; align-items: center; }
.score-big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; min-width: 92px; text-align: center; padding: 6px 10px; border-radius: 10px; }
.score-big.ok { background: var(--green-soft); color: var(--green); } .score-big.bad { background: var(--red-soft); color: var(--red); }
.iv { padding: 10px 0; border-bottom: 1px solid var(--border); } .iv:last-child { border-bottom: 0; }
.fb { margin-top: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: 8px; }
.comment.sys .body .prose { color: var(--muted); }
.qa, .qcard { padding: 12px 0; border-bottom: 1px solid var(--border); }
.qa:last-child { border-bottom: 0; }
.qcard { padding: 14px 16px; }
.qa-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.qa-head .grow { flex: 1; }
.qa-head form.inline { display: inline-flex; gap: 2px; }
.qa-mark { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.qa-right .qa-mark { background: var(--green-soft); color: var(--green); } .qa-wrong .qa-mark { background: var(--red-soft); color: var(--red); } .qa-skip .qa-mark { background: var(--gray-soft); color: var(--muted); }
.qa-text { font-weight: 500; margin-bottom: 8px; }
.qa-note { margin-top: 6px; color: var(--amber); }
.opts { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; }
.opts li { padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); font-size: 13px; }
.opts .pick { margin-right: 6px; }
.opts .opt-correct { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); background: var(--green-soft); }
.opts .opt-wrong { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); background: var(--red-soft); }
.topic-row { margin-bottom: 12px; }
.topic-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; gap: 8px; }
.bar { position: relative; height: 8px; background: var(--surface-2); border-radius: 99px; }
.bar span { display: block; height: 100%; border-radius: 99px; background: var(--blue); }
.bar span.good { background: var(--green); } .bar span.bad { background: var(--red); }
.bar i { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text); opacity: .55; }
.summary { margin: 0; padding-left: 18px; } .summary li { margin-bottom: 6px; }
.dist { display: grid; gap: 3px; margin: 4px 0 6px; }
.dist-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 38px; gap: 8px; align-items: center; font-size: 12.5px; }
.dist-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-row.is-correct .dist-label { color: var(--green); font-weight: 600; }
.dist-bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.dist-bar span { display: block; height: 100%; background: var(--muted); opacity: .6; }
.dist-row.is-correct .dist-bar span { background: var(--green); opacity: 1; }
.dist-bar span.skip { background: var(--border); }
.dist-num { text-align: right; color: var(--muted); }
.flag { font-size: 12.5px; padding: 5px 9px; border-radius: 6px; margin-top: 4px; }
.flag-red { background: var(--red-soft); color: var(--red); } .flag-amber { background: var(--amber-soft); color: var(--amber); } .flag-gray { background: var(--surface-2); color: var(--muted); }
.hist { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; height: 140px; align-items: end; }
.hist-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 2px; }
.hist-bar { width: 100%; background: var(--red); opacity: .55; border-radius: 3px 3px 0 0; min-height: 1px; }
.hist-bar.pass { background: var(--green); opacity: .8; }
.hist-n { font-size: 11px; font-weight: 600; } .hist-l { font-size: 10px; color: var(--muted); }
.rank { margin: 0; padding-left: 22px; } .rank li { padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.rank li { display: list-item; } .rank li .badge { float: right; }
.opt-edit { display: grid; gap: 6px; margin-top: 4px; }
.opt-edit-row { display: flex; gap: 8px; align-items: center; }
.opt-edit-row label { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; flex: none; }
.opt-edit-row label:has(input:checked) { background: var(--green-soft); border-color: var(--green); }
.bal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.bal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.split .bal-grid { grid-template-columns: 1fr; } .split .bal { box-shadow: none; }
.bal-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 4px; gap: 6px; }
.bal-num { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.lv-req { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.lv-req:last-child { border-bottom: 0; } .lv-req .grow { flex: 1; min-width: 240px; }
.lv-actions { display: flex; gap: 6px; align-items: center; }
.lv-actions input { width: 180px; padding: 5px 8px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-h { font-size: 11px; color: var(--muted); text-align: center; padding: 4px 0; font-weight: 600; }
.cal-d { min-height: 74px; border: 1px solid var(--border); border-radius: 6px; padding: 4px 5px; font-size: 11.5px; overflow: hidden; }
.cal-d.blank { border: 0; } .cal-d.we { background: var(--surface-2); } .cal-d.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-d.hol { background: var(--amber-soft); }
.cal-n { font-weight: 600; margin-bottom: 2px; } .cal-hol { color: var(--amber); font-weight: 600; font-size: 11px; }
.cal-who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 4px; margin-top: 2px; }
.out-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 3px; border: 1px solid var(--border); border-radius: 99px; font-size: 12.5px; }
.avatar.sm { width: 20px; height: 20px; font-size: 9px; }
.verdicts { display: flex; flex-wrap: wrap; gap: 6px; }
.verdict { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border: 1px solid var(--border); border-radius: 99px; cursor: pointer; font-size: 13px; background: var(--surface); color: var(--text); }
.verdict:has(input:checked) { border-color: currentColor; font-weight: 600; }
.verdict.v-strong_yes:has(input:checked), .verdict.v-yes:has(input:checked) { background: var(--green-soft); color: var(--green); }
.verdict.v-no:has(input:checked), .verdict.v-strong_no:has(input:checked) { background: var(--red-soft); color: var(--red); }
@media (max-width: 800px) { .cal-d { min-height: 48px; } .cal-who { font-size: 0; height: 6px; padding: 0; } .dist-row { grid-template-columns: minmax(0, 1fr) 70px 34px; } }

/* ---- public careers site --------------------------------------------------------------------- */
body.careers { background: var(--bg); }
.c-wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.c-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.c-head .c-wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.c-logo img { height: 30px; width: auto; display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .c-logo { background: #fff; padding: 5px 10px; border-radius: 8px; } }
:root[data-theme="dark"] .c-logo { background: #fff; padding: 5px 10px; border-radius: 8px; }
.c-hero { padding: 48px 0 20px; } .c-hero h1 { font-size: 32px; margin-bottom: 8px; }
.c-group { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 28px 0 10px; }
.c-job { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 10px; color: inherit; transition: border-color .15s, transform .15s; }
.c-job:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.c-job-title { font-weight: 700; font-size: 16px; margin-bottom: 2px; }
.c-go { color: var(--accent); font-weight: 600; white-space: nowrap; }
.c-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.c-tags span { font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.c-job-page { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; padding: 32px 0; }
.c-title { font-size: 30px; margin: 6px 0 4px; }
.c-apply { position: sticky; top: 16px; padding: 22px; }
.c-apply .field { margin-bottom: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.c-center { max-width: 620px; margin: 48px auto; text-align: center; padding: 32px; }
.c-center h1 { margin-bottom: 8px; }
.c-big { font-size: 44px; margin-bottom: 8px; }
.c-next { margin-top: 20px; padding: 18px; border-radius: 10px; background: var(--accent-soft); text-align: left; }
.c-next h2 { color: var(--accent); }
.c-foot { padding: 32px 16px; text-align: center; }
.t-rules { padding-left: 18px; line-height: 1.8; }
.t-bar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); padding: 10px 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.t-timer { font: 700 22px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 4px 12px; border-radius: 8px; background: var(--surface-2); }
.t-timer.low { background: var(--red-soft); color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.t-q { border: 1px solid var(--border); margin: 0 0 14px; padding: 16px 18px; }
.t-q legend { padding: 0; float: left; width: 100%; margin-bottom: 6px; }
.t-text { font-weight: 600; font-size: 15px; margin-bottom: 10px; clear: both; }
.t-opt { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; cursor: pointer; }
.t-opt:hover { border-color: var(--accent); }
.t-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.t-opt input { margin-top: 3px; }
.t-submit { display: flex; gap: 12px; align-items: center; margin: 20px 0 40px; flex-wrap: wrap; }
@media (max-width: 860px) { .c-job-page { grid-template-columns: 1fr; } .c-apply { position: static; } .c-hero h1 { font-size: 26px; } .c-go { display: none; } }
.otp-input { font: 600 22px ui-monospace, SFMono-Regular, Menlo, monospace !important; letter-spacing: .35em; text-align: center; }
table.ts .ts-hol { font-size: 10.5px; color: var(--amber); font-weight: 600; white-space: nowrap; }
table.ts tr.ts-leave td { background: var(--green-soft); }
table.ts .ts-leave-cell { color: var(--green); font-weight: 600; white-space: nowrap; }
.topbar-logo { flex: 1; display: flex; align-items: center; min-width: 0; }
.topbar-logo img { height: 26px; width: auto; max-width: 200px; display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .topbar-logo img { background: #fff; padding: 4px 8px; border-radius: 6px; height: 30px; } }
:root[data-theme="dark"] .topbar-logo img { background: #fff; padding: 4px 8px; border-radius: 6px; height: 30px; }

/* ---- blue theme --------------------------------------------------------------------------------- */
/* Navy sidebar: re-point the colour tokens inside it so every existing sidebar rule follows. */
.sidebar {
  --surface: rgba(255,255,255,.06); --surface-2: rgba(255,255,255,.09); --border: rgba(255,255,255,.12);
  --text: #e4ecfb; --muted: #95a8d0; --accent: #ffffff; --accent-soft: rgba(96,165,250,.22);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); border-right: 0; color: var(--text);
}
.sidebar-logo { background: #fff; border-radius: 10px; padding: 8px 10px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.sidebar .nav a { color: #cbd8f3; }
.sidebar .nav a:hover { color: #fff; }
.sidebar .nav a.active { background: linear-gradient(90deg, #2563eb, #3b82f6); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.35); }
.sidebar .nav a.active .nav-kbd { color: #fff; border-color: rgba(255,255,255,.45); }
.sidebar .nav-label { color: #7d93c2; }
.sidebar .avatar { background: #2563eb; color: #fff; }
.sidebar .btn.ghost { color: #cbd8f3; }
.sidebar .btn.ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar::-webkit-scrollbar { width: 8px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 8px; }

/* Cards and tables pick up a hint of blue */
.card { border-color: var(--border); box-shadow: 0 1px 2px rgba(15,40,90,.05), 0 4px 14px rgba(15,40,90,.05); }
.card-head h2::before { content: ""; display: inline-block; width: 4px; height: 15px; border-radius: 2px; margin-right: 9px; vertical-align: -2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
th { background: var(--surface-2); }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.progress > span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.btn.primary { background: linear-gradient(135deg, #2563eb, #1d4ed8); border-color: #1d4ed8; box-shadow: 0 2px 8px rgba(37,99,235,.3); }
.topbar { border-bottom: 3px solid var(--accent); }

/* Stat tiles: first one solid blue, the rest tinted with a coloured edge */
.stat { position: relative; overflow: hidden; background: linear-gradient(135deg, var(--surface) 40%, var(--accent-soft) 100%); border-left: 4px solid var(--accent); }
.grid > .stat:nth-child(2) { border-left-color: #0ea5e9; }
.grid > .stat:nth-child(3) { border-left-color: #6366f1; }
.grid > .stat:nth-child(4) { border-left-color: #0891b2; }
.stat.warn { border-left-color: var(--red); background: linear-gradient(135deg, var(--surface) 40%, var(--red-soft) 100%); }
.grid > .stat:first-child { background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%); border-color: transparent; color: #fff; }
.grid > .stat:first-child .label, .grid > .stat:first-child .muted { color: rgba(255,255,255,.8); }
.grid > .stat:first-child a { color: #fff; }
.grid > .stat:first-child::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.12); }

/* Dashboard greeting banner */
.page-head.hero { background: linear-gradient(120deg, var(--navy) 0%, #1e40af 55%, #3b82f6 100%); color: #fff; border-radius: 14px; padding: 22px 26px;
  box-shadow: 0 8px 24px rgba(30,64,175,.25); position: relative; overflow: hidden; align-items: center; }
.page-head.hero::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none; }
.page-head.hero h1 { font-size: 24px; }
.page-head.hero p { color: rgba(255,255,255,.78); }
.page-head.hero .actions { position: relative; z-index: 1; }
.page-head.hero .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; box-shadow: none; }
.page-head.hero .btn:hover { background: rgba(255,255,255,.24); }
.page-head.hero .btn.primary { background: #fff; color: #1d4ed8; border-color: #fff; }
.page-head.hero .btn-kbd { color: inherit; border-color: currentColor; opacity: .6; background: transparent; }

/* Sign-in page on a blue backdrop */
.auth { background: radial-gradient(circle at 15% 20%, rgba(59,130,246,.35), transparent 45%), linear-gradient(135deg, var(--navy) 0%, #1e40af 60%, #3b82f6 100%); }
.auth .card { box-shadow: 0 20px 50px rgba(6,20,60,.4); border: 0; }
.c-head { border-bottom: 3px solid var(--accent); }

/* online / busy switch above the account row */
.status-switch { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.status-switch + .sidebar-foot { margin-top: 10px; }
.status-switch button { display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 7px; padding: 6px 8px; background: transparent;
  color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.status-switch button:hover { color: var(--text); }
.status-switch button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.sidebar .status-switch button.on { background: rgba(255,255,255,.16); color: #fff; }
.s-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.s-online { background: #22a06b; } .s-busy { background: #e5484d; }
.sidebar [data-presence]::after { border-color: var(--navy); }

/* ---- schedule (My work) and meeting requests ------------------------------------------------- */
.sched { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sched-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border-left: 4px solid var(--accent); }
.sched-item.k-interview { border-left-color: #7c3aed; }
.sched-item.is-now { background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.sched-item.is-past { opacity: .55; }
.sched-time { display: flex; flex-direction: column; min-width: 78px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.sched-time .muted { font-size: 12px; }
.sched-day { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent); font-weight: 700; }
.sched-body { flex: 1; min-width: 0; }
.sched-title { font-weight: 600; color: var(--text); }
.sched.compact .sched-item { padding: 9px 12px; }
.req-card { border-left: 4px solid var(--amber); }
.people-filter { margin-bottom: 8px; }
.people-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; max-height: 240px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.pick { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.pick[hidden] { display: none; }
.pick:has(input:checked) { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg-radio { display: flex; gap: 8px; }
.seg-radio .pick { border: 1px solid var(--border); padding: 7px 12px; border-radius: 8px; }

/* ---- phones and tablets ----------------------------------------------------------------------- */
.tabbar, .nav-scrim { display: none; }
@media (max-width: 800px) {
  /* bottom tab bar */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    background: var(--surface); border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(15,40,90,.08); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px;
    font: inherit; font-size: 11px; font-weight: 600; color: var(--muted); background: none; border: 0; border-radius: 10px; cursor: pointer; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .active { color: var(--accent); }
  .tab-count { position: absolute; top: 1px; left: calc(50% + 6px); background: var(--red); color: #fff; font-size: 10px; border-radius: 99px; padding: 0 5px; line-height: 16px; }
  .tab-dot { position: absolute; top: 5px; left: calc(50% + 9px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
  .shell.has-tabbar .page { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }

  /* menu drawer: dim the page behind it, tap to close, no background scrolling */
  .sidebar { width: min(84vw, 300px); z-index: 30; padding-top: calc(16px + env(safe-area-inset-top)); }
  .nav-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(6,14,32,.5); opacity: 0; pointer-events: none; transition: opacity .2s; display: block; }
  .shell.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  html.no-scroll, html.no-scroll body { overflow: hidden; }
  .topbar { padding-top: calc(10px + env(safe-area-inset-top)); }

  /* iPhones zoom into any field under 16px; keep them at 16px so the page doesn't jump */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url],
  input[type=search], input[type=datetime-local], input[type=time], select, textarea { font-size: 16px; }

  /* headings and stat tiles: two tiles per row instead of one tall column */
  .page-head { margin-bottom: 14px; }
  .page-head h1, h1 { font-size: 20px; }
  .page-head .actions { width: 100%; }
  .page-head.hero { padding: 18px; border-radius: 12px; }
  .page-head.hero h1 { font-size: 21px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat .value { font-size: 22px; }
  .card { padding: 14px; }
  .card + .card { margin-top: 12px; }
  .grid > .card + .card { margin-top: 0; }

  /* wide tables scroll sideways with the first column pinned, instead of squashing every cell */
  .table-wrap th, .table-wrap td { white-space: nowrap; }
  .table-wrap tr > :first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--border); }
  .table-wrap thead tr > :first-child { background: var(--surface-2); }

  /* social planner: on a phone list only days that have something on them */
  .cal-day:not(.today):not(:has(.cal-post)):not(:has(.cal-key)) { display: none; }

  /* schedule rows stack the Join button under the text on narrow screens */
  .sched-item { flex-wrap: wrap; }
  .sched-item > .btn { margin-left: 92px; }
}
@media (max-width: 380px) { .g4 { grid-template-columns: 1fr 1fr; } .stat .value { font-size: 20px; } .tabbar a, .tabbar button { font-size: 10px; } }
/* comfortable tap targets on touch screens, and no keyboard hints there */
@media (pointer: coarse) {
  .btn { min-height: 40px; } .btn.sm { min-height: 34px; }
  .nav a { padding: 10px; }
  .nav-kbd, .btn-kbd, .tab-kbd, .shortcuts-link, .search-trigger kbd { display: none; }
}

/* ---- welcome tour ---------------------------------------------------------------------------- */
.tour-veil { position: fixed; inset: 0; z-index: 95; }
.tour-hole { position: fixed; z-index: 96; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(6,14,32,.62), 0 0 0 3px #60a5fa;
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; }
.tour-card { position: fixed; z-index: 97; width: min(340px, calc(100vw - 24px)); background: var(--surface); color: var(--text); border-radius: 14px;
  padding: 18px 18px 14px; box-shadow: 0 18px 48px rgba(6,14,32,.35); transition: left .25s ease, top .25s ease; }
.tour-card.centered { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); padding: 26px 24px 18px; }
.tour-card h3 { font-size: 17px; margin: 10px 0 6px; }
.tour-card.centered h3 { font-size: 21px; }
.tour-card p { margin: 0 0 14px; color: var(--muted); line-height: 1.55; }
.tour-progress { display: flex; gap: 4px; }
.tour-progress span { flex: 1; height: 4px; border-radius: 99px; background: var(--border); }
.tour-progress span.done { background: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.tour-progress span.on { background: var(--accent); }
.tour-actions { display: flex; align-items: center; gap: 8px; }
.tour-skip { color: var(--muted); font-size: 13px; }
.tour-count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* on/off switch (department visibility) */
.switch { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 2px; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.switch-knob { position: relative; width: 36px; height: 20px; border-radius: 99px; background: var(--border); transition: background .15s; flex: none; }
.switch-knob::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch.on { color: var(--green); }
.switch.on .switch-knob { background: var(--green); }
.switch.on .switch-knob::after { transform: translateX(16px); }
.dept-hidden { opacity: .72; border-style: dashed; }

/* light / dark switch */
.theme-toggle { position: relative; width: 34px; height: 30px; flex: none; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle span { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .2s, transform .3s; }
.theme-toggle .tt-moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
.theme-toggle.is-dark .tt-sun { opacity: 0; transform: rotate(60deg) scale(.6); }
.theme-toggle.is-dark .tt-moon { opacity: 1; transform: none; }
.topbar .theme-toggle { margin-left: auto; }
.topbar .topbar-logo { flex: 1; }
.pw-card.has-errors { border: 2px solid var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.pw-card.has-errors .error { font-size: 13px; font-weight: 600; }
.star-btn { color: var(--muted); }
.star-btn.on { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); background: var(--amber-soft); font-weight: 600; }

/* Sales */
.board.pipeline { grid-template-columns: repeat(6, minmax(190px, 1fr)); }
.pipeline .col-sum { padding: 0 4px 8px; margin-top: -6px; }
.pipeline .deal-acc { color: var(--text); font-size: 12.5px; }
.deal-lead, .deal-contacted { background: var(--gray-soft); color: var(--muted); }
.deal-demo, .deal-proposal { background: var(--blue-soft); color: var(--blue); }
.deal-pilot { background: #ede9fe; color: #6d28d9; }
:root[data-theme="dark"] .deal-pilot { background: #2e1f57; color: #c4b5fd; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .deal-pilot { background: #2e1f57; color: #c4b5fd; } }
.pilot-box { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, #7c3aed 8%, var(--surface)); border: 1px solid color-mix(in srgb, #7c3aed 30%, var(--border));
  display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pilot-box.ended { border-color: var(--red); background: var(--red-soft); }
.pilot-box p { flex-basis: 100%; }
.deal-negotiation { background: var(--amber-soft); color: var(--amber); }
.deal-won { background: var(--green-soft); color: var(--green); }
.deal-lost { background: var(--red-soft); color: var(--red); }
.stage-steps { display: flex; gap: 4px; flex-wrap: wrap; }
.stage-steps form { flex: 1; min-width: 110px; }
.stage-step { width: 100%; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); padding: 8px 6px; font: inherit; font-size: 12.5px;
  font-weight: 600; cursor: pointer; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%); }
.stage-steps form:first-child .stage-step { clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%); }
.stage-step:hover { color: var(--text); }
.stage-step.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.sub-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.won-card { border-left: 4px solid var(--green); }
.warn-text { color: var(--amber); font-weight: 600; }

/* QA testing */
.qa-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin-top: 6px; }
.qa-bar span { display: block; height: 100%; transition: width .2s; }
.qa-bar .qp, .dot-p { background: var(--green); } .qa-bar .qf, .dot-f { background: var(--red); }
.qa-bar .qb, .dot-b { background: var(--amber); } .qa-bar .qs, .dot-s { background: #94a3b8; }
.qa-summary .qa-bar { height: 12px; margin: 0 0 12px; }
.qa-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.qa-counts a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; color: var(--muted); border: 1px solid transparent; }
.qa-counts a.on { border-color: var(--accent); color: var(--text); text-decoration: none; }
.qa-counts [class^="dot-"] { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.qa-row { align-items: flex-start !important; border-left: 3px solid transparent; padding-left: 8px !important; }
.qa-row summary { cursor: pointer; list-style: none; } .qa-row summary::-webkit-details-marker { display: none; }
.qa-row.st-passed { border-left-color: var(--green); } .qa-row.st-failed { border-left-color: var(--red); }
.qa-row.st-blocked { border-left-color: var(--amber); } .qa-row.st-skipped { border-left-color: #94a3b8; }
.qa-row.st-passed .qa-st, .qa-passed { background: var(--green-soft); color: var(--green); }
.qa-row.st-failed .qa-st, .qa-failed { background: var(--red-soft); color: var(--red); }
.qa-row.st-blocked .qa-st, .qa-blocked { background: var(--amber-soft); color: var(--amber); }
.qa-case { margin: 10px 0 4px; } .qa-case h3 { margin: 6px 0 4px; font-size: 13px; } .qa-case textarea { margin-top: 8px; }
.qa-btns { display: flex; gap: 4px; flex-shrink: 0; }
.qa-btn { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 15px; cursor: pointer; }
.qa-btn.p:hover, .st-passed .qa-btn.p { background: var(--green-soft); color: var(--green); border-color: var(--green); }
.qa-btn.f:hover, .st-failed .qa-btn.f { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.qa-btn.b:hover, .st-blocked .qa-btn.b { background: var(--amber-soft); color: var(--amber); border-color: var(--amber); }
.qa-btn.s:hover, .st-skipped .qa-btn.s { background: var(--gray-soft); color: var(--text); }
.pri-critical { background: var(--red-soft); color: var(--red); } .pri-high { background: var(--amber-soft); color: var(--amber); }
.pri-normal { background: var(--blue-soft); color: var(--blue); } .pri-low { background: var(--gray-soft); color: var(--muted); }
@media (max-width: 800px) {
  .qa-row { flex-wrap: wrap; } .qa-btns { width: 100%; justify-content: flex-end; }
  .qa-btn { width: 44px; height: 40px; }
  .stage-steps form { min-width: 0; flex-basis: calc(50% - 4px); }
  .stage-step, .stage-steps form:first-child .stage-step { clip-path: none; border-radius: 8px; }
}
.split > * { min-width: 0; }  /* long content never widens a column past the screen */

/* Sales phase 2 */
.qt-draft, .qt-declined { background: var(--gray-soft); color: var(--muted); }
.qt-pending { background: var(--amber-soft); color: var(--amber); }
.qt-approved, .qt-sent { background: var(--blue-soft); color: var(--blue); }
.qt-accepted { background: var(--green-soft); color: var(--green); }
.qt-rejected { background: var(--red-soft); color: var(--red); }
.quote-lines th, .quote-lines td { padding: 8px 6px; border-bottom: 1px solid var(--border); }
.quote-lines tfoot td { border: 0; padding: 4px 6px; }
.quote-lines tfoot .grand td { font-weight: 700; font-size: 15px; border-top: 2px solid var(--text); padding-top: 8px; }
.quote-lines td input { min-width: 0; }
.quote-lines td.num input { max-width: 150px; text-align: right; margin-left: auto; }
table.targets th, table.targets td { padding: 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.targets .cur { background: var(--accent-soft); }
table.targets .t-in { margin-top: 6px; max-width: 130px; padding: 4px 8px; font-size: 12.5px; text-align: right; margin-left: auto; display: block; }

/* QA phase 2 */
.so-requested { background: var(--amber-soft); color: var(--amber); }
.so-approved { background: var(--green-soft); color: var(--green); }
.so-rejected { background: var(--red-soft); color: var(--red); }
.signoff-card.ok { border-left: 4px solid var(--green); } .signoff-card.no { border-left: 4px solid var(--red); } .signoff-card.wait { border-left: 4px solid var(--amber); }
.dist-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin: 4px 0; } .dist-row span { width: 12px; color: var(--muted); } .dist-row strong { min-width: 20px; text-align: right; }
.pt-resp { padding: 12px 0; border-bottom: 1px solid var(--border); } .pt-resp:last-child { border-bottom: 0; } .pt-resp p { margin: 6px 0; }
.eval-bad { border-left: 4px solid var(--red); }
.field.scale > div { display: flex; gap: 6px; flex-wrap: wrap; }
.field.scale > div > div { flex: 1; min-width: 44px; }
.field.scale label:has(input[type=radio]) { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; font-weight: 600; }
.field.scale label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* Sales daily reports */
.daily-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0 14px; }
.daily-grid input { font-size: 18px; font-weight: 600; }
.daily-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .daily-nav .grow { flex: 1; }
table.daily-table th, table.daily-table td { padding: 8px; border-bottom: 1px solid var(--border); }
table.daily-table td.hit { color: var(--green); font-weight: 700; } table.daily-table td.miss { color: var(--red); }
table.daily-table tr.missing td:first-child { box-shadow: inset 3px 0 var(--red); }
.trend { font-size: 10px; } .trend.up { color: var(--green); } .trend.down { color: var(--red); }
.daily-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.daily-stats div { display: flex; flex-direction: column; } .daily-stats strong { font-size: 24px; }

/* Local AI drafts */
.ai-box { margin: 12px 0; padding: 12px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); }
.ai-box h3 { font-size: 13px; margin: 10px 0 4px; } .ai-box ul, .ai-box ol { margin: 4px 0; padding-left: 20px; }
.ai-head { font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.ai-error { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.ai-wait { display: flex; gap: 10px; align-items: center; color: var(--muted); padding: 10px 0; font-size: 13px; }
.ai-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: ai-spin .8s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-case { padding: 10px 0; border-top: 1px solid var(--border); } .ai-case:first-of-type { border-top: 0; }
.ai-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; cursor: pointer; }
.ai-case-body { margin: 6px 0 0 26px; } .ai-case-body select { width: auto; padding: 3px 6px; margin-left: 4px; }
.ai-dupe { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.ai-dupe .grow { flex: 1; }
.qa-shot { display: flex; gap: 12px; align-items: flex-start; margin-top: 10px; flex-wrap: wrap; }
.qa-shot img { width: 160px; max-height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.qa-shot .grow { flex: 1; min-width: 220px; } .qa-shot input[type=file] { max-width: 260px; font-size: 12.5px; }

/* Subtasks */
.subtask-list li { gap: 10px; }
.subtask-list li.is-done .sub-title { text-decoration: line-through; color: var(--muted); }
.sub-title { color: inherit; font-weight: 500; }
button.sub-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border); background: var(--surface); color: #fff; font-weight: 800;
  font-size: 13px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
button.sub-check:hover { border-color: var(--green); }
.is-done button.sub-check { background: var(--green); border-color: var(--green); }
.subtask-add { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.subtask-add input[name=title] { flex: 1 1 220px; min-width: 0; }
.subtask-add select, .subtask-add input[type=date] { flex: 0 1 160px; width: auto; }
.tcard.is-sub { border-left: 3px solid var(--accent); }
.tcard .sub-of { color: var(--accent); font-weight: 600; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-of a { color: inherit; }

/* Email templates */
.email-preview { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.email-preview hr { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }
.email-preview pre { white-space: pre-wrap; word-break: break-word; font: 13px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; margin: 0; }
.ph-list li { gap: 8px; align-items: flex-start; } .ph-list .btn { white-space: nowrap; }
textarea.mono-ish { font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.tpl-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.tpl-editor > * { min-width: 0; }
.tpl-side { position: sticky; top: 12px; }
@media (max-width: 1100px) { .tpl-editor { grid-template-columns: 1fr; } .tpl-side { position: static; } }
.code-area { width: 100%; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; white-space: pre-wrap; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; margin-bottom: 10px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg.sm button { padding: 4px 10px; font-size: 12px; }
.pv-subject { display: block; margin: 2px 0 10px; }
.pv-frame { display: block; width: 100%; height: 640px; border: 1px solid var(--border); border-radius: 10px; background: #edf3fc; margin: 0 auto; transition: width .2s; }
.pv-text { white-space: pre-wrap; word-break: break-word; font: 13px/1.55 system-ui, sans-serif; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; min-height: 300px; margin: 0; }

/* Ask Chronexa panel (Sales and QA pages) */
.cx-fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 14px; color: #fff;
  padding: 11px 18px; border-radius: 99px; background: linear-gradient(135deg, #0b1f44, #2563eb); box-shadow: 0 8px 24px rgba(37, 99, 235, .35); }
.cx-panel { position: fixed; right: 22px; bottom: 22px; z-index: 41; width: 380px; max-width: calc(100vw - 24px); height: 540px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 16px 48px rgba(11, 31, 68, .25); overflow: hidden; }
.cx-panel[hidden] { display: none; }  /* display:flex above would otherwise keep it on screen */
.cx-panel header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; color: #fff; background: linear-gradient(135deg, #0b1f44, #143a7a 60%, #2563eb); }
.cx-panel header .muted, .cx-panel header a { color: #c7d7f5; } .cx-panel header .grow { flex: 1; } .cx-panel header .btn { color: #fff; }
.cx-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cx-msg { padding: 9px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; max-width: 92%; word-break: break-word; }
.cx-msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.cx-msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.cx-msg .bot-thinking { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.cx-msg .ai-spin { width: 14px; height: 14px; }
.cx-msg .bot-confirm { display: flex; gap: 6px; margin-top: 8px; }
.cx-panel form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); align-items: flex-end; }
.cx-panel textarea { flex: 1; resize: none; min-height: 40px; }
@media (max-width: 800px) { .cx-fab { bottom: 76px; right: 14px; } .cx-panel { right: 8px; bottom: 70px; height: 70vh; } }

/* footer: copyright and version on every page (not in chat, which fills the screen) */
.app-footer { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); text-align: center; }
.auth .app-footer { margin: 0; padding: 0; border: 0; color: rgba(255,255,255,.75); }

/* client feedback form (public, /feedback/<token>/) */
.fbf-pill { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 4px 10px; border-radius: 99px; }
.fbf { max-width: 720px; margin: 28px auto 8px; padding: 32px; border-radius: 16px; }
.fbf-head { margin-bottom: 22px; }
.fbf-head h1 { font-size: 28px; line-height: 1.2; margin: 6px 0 8px; }
.fbf-head p { margin: 0; }
.fbf-eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.fbf-section { border: 0; padding: 0; margin: 0 0 18px; }
.fbf-section legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.fbf-kinds { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.fbf-kind { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; padding: 12px 8px;
  border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: center; transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; }
.fbf-kind:hover { border-color: var(--accent); transform: translateY(-1px); }
.fbf-kind input { position: absolute; opacity: 0; pointer-events: none; }
.fbf-kind-icon { font-size: 26px; line-height: 1; }
.fbf-kind-label { font-size: 13px; font-weight: 600; line-height: 1.25; }
.fbf-kind:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.fbf-kind:has(input:checked)::after { content: "✓"; position: absolute; top: 6px; right: 8px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent);
  color: var(--accent-text); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.fbf-kind:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.fbf input[type=text], .fbf input[type=email], .fbf textarea { width: 100%; padding: 11px 13px; font-size: 15px; border-radius: 10px; }
.fbf-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; border: 2px dashed var(--border); border-radius: 12px;
  background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; font-weight: 400; }
.fbf-drop:hover, .fbf-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.fbf-drop.full { opacity: .55; pointer-events: none; }
.fbf-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.fbf-drop-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.fbf-link { color: var(--accent); font-weight: 600; text-decoration: underline; }
.fbf-files { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.fbf-files li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.fbf-files img, .fbf-file-icon { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--surface-2); font-size: 20px; }
.fbf-file-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.fbf-file-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fbf-remove { border: 0; background: transparent; color: var(--muted); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.fbf-remove:hover { background: var(--surface-2); color: var(--text); }
.fbf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fbf-submit { width: 100%; justify-content: center; gap: 10px; padding: 14px 18px; font-size: 16px; font-weight: 700; border-radius: 12px; margin-top: 6px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); transition: transform .15s, box-shadow .15s; }
.fbf-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 38%, transparent); }
.fbf-submit:disabled { opacity: .75; cursor: progress; }
.fbf-note { text-align: center; margin: 12px 0 0; }
.fbf-done { max-width: 560px; margin: 56px auto; text-align: center; padding: 40px 32px; border-radius: 16px; }
.fbf-done h1 { margin: 14px 0 8px; }
.fbf-done-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #16a34a, #22c55e); box-shadow: 0 10px 24px rgba(22,163,74,.3); }
.fbf-done-icon.off { background: var(--surface-2); color: var(--muted); box-shadow: none; }
.fbf-ghost { margin-top: 10px; padding: 10px 18px; font-weight: 600; }
.fbf-pill { white-space: nowrap; }
@media (max-width: 720px) {
  .fbf-pill { display: none; }
  .fbf { padding: 22px 18px; margin-top: 16px; }
  .fbf-head h1 { font-size: 23px; }
  .fbf-kinds { grid-template-columns: repeat(2, 1fr); }
  .fbf-kind { min-height: 78px; }
  .fbf-kind:last-child { grid-column: span 2; }
  .fbf-row { grid-template-columns: 1fr; gap: 0; }
}
.fb-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.fb-file { display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; color: inherit; background: var(--surface-2); min-width: 0; }
.fb-file:hover { border-color: var(--accent); text-decoration: none; }
.fb-file img, .fb-file-icon { width: 100%; height: 96px; object-fit: cover; border-radius: 6px; display: grid; place-items: center; font-size: 32px; background: var(--surface); margin-bottom: 4px; }
.fb-file-name { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* product client page */
.cl-back { display: inline-block; margin-bottom: 12px; }
.cl-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cl-avatar { width: 56px; height: 56px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 20px; font-weight: 800; letter-spacing: .02em;
  color: #fff; background: linear-gradient(135deg, #1d4ed8, #0ea5e9); box-shadow: 0 6px 16px rgba(37,99,235,.25); }
.cl-title { flex: 1; min-width: 200px; }
.cl-title h2 { margin: 0 0 6px; font-size: 22px; }
.cl-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; }
.cl-chip { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 10px; border-radius: 99px; }
.cl-actions { display: flex; gap: 8px; align-items: center; }
.cl-actions form { margin: 0; }
.cl-danger { color: var(--red); }
.cl-danger:hover { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, transparent); }
.card.cl-head + .cl-stats { margin-top: 16px; }
.cl-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.cl-stats > .card + .card, .cl-grid > .card + .card { margin-top: 0; }
.cl-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; }
.cl-stat-n { font-size: 26px; font-weight: 800; line-height: 1.1; }
.cl-stat-date { font-size: 22px; }
.cl-stat-l { font-size: 12.5px; color: var(--muted); }
.cl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.cl-card h3, .cl-feedback h3 { margin: 0; font-size: 15px; }
.cl-card > h3 { margin-bottom: 14px; }
.cl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cl-card-head form { margin: 0; }
.cl-contact { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cl-contact li { display: flex; align-items: center; gap: 12px; }
.cl-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); flex: none; font-size: 15px; }
.cl-notes { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.cl-empty-mini { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border: 1px dashed var(--border); border-radius: 12px; }
.cl-empty-mini > span { font-size: 22px; }
.cl-empty-mini p { margin: 0; }
.cl-linkbox { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.cl-linkbox.off { opacity: .6; }
.cl-linkbox input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 8px 0; font-size: 13px; color: var(--text); box-shadow: none; }
.cl-linkbox input:focus { outline: none; }
.cl-linkbox .btn { flex: none; }
.cl-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.cl-wa { background: #128c4a; border-color: #128c4a; color: #fff; font-weight: 600; }
.cl-wa:hover { background: #0e7a40; border-color: #0e7a40; color: #fff; text-decoration: none; }
.btn.is-disabled { opacity: .5; cursor: not-allowed; }
.cl-reset { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.cl-feedback .table-wrap { margin: 0 -10px -10px; }
.cl-empty { text-align: center; padding: 26px 16px 18px; }
.cl-empty-ico { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: var(--accent-soft); }
.cl-empty p { margin: 4px 0 14px; }
@media (max-width: 860px) {
  .cl-grid { grid-template-columns: 1fr; }
  .cl-stats { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cl-actions { width: 100%; }
}
.cl-avatar.public { background: linear-gradient(135deg, #7c3aed, #ec4899); font-size: 24px; }
.cl-chip.alt { color: #7c3aed; background: color-mix(in srgb, #7c3aed 12%, transparent); }
.cl-section { font-size: 15px; margin: 6px 0 10px; }

/* daily updates */
.du-form .du-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.du-logged { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.du-logged li { display: flex; gap: 6px; padding: 6px 10px; background: var(--surface-2); border-radius: 8px; }
.du-time { display: grid; gap: 6px; }
.du-time-row { display: grid; grid-template-columns: minmax(0, 2fr) 80px minmax(0, 2fr); gap: 6px; }
.du-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.du-cards > .card + .card { margin-top: 0; }
.du-card { display: flex; flex-direction: column; gap: 10px; }
.du-card.unreviewed { border-left: 3px solid var(--accent); }
.du-card-head { display: flex; align-items: center; gap: 10px; }
.du-preview { font-size: 13.5px; line-height: 1.5; max-height: 9.5em; overflow: hidden; }
.du-blocker { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--amber-soft); color: var(--amber); }
.du-card-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.du-week { display: flex; gap: 4px; margin-top: auto; }
.du-week span { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 10.5px; font-weight: 600;
  background: var(--red-soft); color: var(--red); }
.du-week span.on { background: var(--green-soft); color: var(--green); }
.du-week span.off { background: var(--surface-2); color: var(--muted); }
@media (max-width: 720px) { .du-form .du-two, .du-time-row { grid-template-columns: 1fr; } }

/* email history */
.eh-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.eh-stats > .card + .card { margin-top: 0; }
.eh-stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; }
.eh-stat.bad .eh-n { color: var(--red); }
.eh-n { font-size: 24px; font-weight: 800; line-height: 1.1; }
.eh-l { font-size: 12.5px; color: var(--muted); }
.eh-to { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.eh-frame { width: 100%; height: 640px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.eh-text { white-space: pre-wrap; font: inherit; font-size: 13.5px; background: var(--surface-2); padding: 14px; border-radius: 10px; margin: 0; }
.eh-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.eh-dl dt { color: var(--muted); }
.eh-dl dd { margin: 0; word-break: break-word; }
@media (max-width: 760px) { .eh-stats { grid-template-columns: repeat(2, 1fr); } }

/* detailed question sets on the feedback form */
.fbf-kinds:has(.fbf-kind:nth-child(6)) { grid-template-columns: repeat(3, 1fr); }
.fbf-set { margin: 4px 0 20px; padding: 18px; border: 1.5px solid var(--accent); border-radius: 14px; background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.fbf-set-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.fbf-set-head h2 { margin: 0 0 4px; font-size: 18px; }
.fbf-set-head p { margin: 0; font-size: 13.5px; }
.fbf-set-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--accent-soft); flex: none; }
.fbf-sec { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); margin-top: 10px; overflow: hidden; }
.fbf-sec summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 600; list-style: none; }
.fbf-sec summary::-webkit-details-marker { display: none; }
.fbf-sec summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.fbf-sec:not([open]) summary::after { transform: rotate(-90deg); }
.fbf-sec-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--accent); color: var(--accent-text); flex: none; }
.fbf-sec-title { flex: 1; min-width: 0; }
.fbf-sec-count { font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 99px; }
.fbf-sec-count:empty { display: none; }
.fbf-sec-body { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.fbf-group { margin-top: 12px; }
.fbf-group-title { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.fbf-check { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; font-weight: 400; font-size: 14px; line-height: 1.45; cursor: pointer; }
.fbf-check:hover { background: var(--surface-2); }
.fbf-check:has(input:checked) { background: var(--accent-soft); }
.fbf-check input { margin-top: 3px; width: 17px; height: 17px; flex: none; accent-color: var(--accent); }
.fbf-diag { margin-top: 14px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.fbf-diag-q { font-size: 13.5px; font-weight: 600; margin-bottom: 10px; }
.fbf-diag-q::before { content: "✍️ "; }
.fbf-diag-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px dashed var(--border); }
.fbf-diag-row:has(.fbf-diag-field.wide) { grid-template-columns: 1fr 1fr; }
.fbf-diag-field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fbf-diag-field input, .fbf-diag-field select, .fbf-diag-field textarea { font-size: 14px; padding: 8px 10px; border-radius: 8px; color: var(--text); font-weight: 400; }
.fbf-add { margin-top: 0; }
@media (max-width: 720px) { .fbf-kinds:has(.fbf-kind:nth-child(6)) { grid-template-columns: repeat(2, 1fr); } .fbf-diag-row:has(.fbf-diag-field.wide) { grid-template-columns: 1fr; } }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.5; }
@media (max-width: 720px) { .fbf-kinds:has(.fbf-kind:nth-child(6)) .fbf-kind:last-child { grid-column: auto; } }
.qs-preview .fbf-sec { margin-top: 8px; }
.qs-counts { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.fb-answers { margin-top: 16px; display: grid; gap: 12px; }
.fb-answer { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); }
.fb-answer h3 { margin: 0 0 8px; font-size: 14px; }
.fb-answer .grp { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 8px 0 4px; }
.fb-answer ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-size: 13.5px; }
.fb-answer li::before { content: "☑ "; color: var(--accent); }
.fb-answer table { width: 100%; margin-top: 8px; font-size: 13px; }
.fb-answer .q { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.off-partner { border: 1px solid var(--border); border-radius: 12px; padding: 4px 16px 6px; margin: 4px 0 14px; background: var(--surface-2); }
.off-partner legend { font-weight: 700; font-size: 13px; padding: 0 6px; }

/* task types */
.tk { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  padding: 1px 6px; border-radius: 5px; line-height: 1.5; white-space: nowrap; background: var(--gray-soft); color: var(--muted); }
.tk-implementation { background: var(--blue-soft); color: var(--blue); }
.tk-bug { background: var(--red-soft); color: var(--red); }
.tk-spike { background: color-mix(in srgb, #7c3aed 14%, transparent); color: #7c3aed; }
.tk-content { background: var(--amber-soft); color: var(--amber); }
.card-task .meta .tk, .meta .tk { margin-right: 6px; }
.finish-box { border-left: 3px solid var(--amber); margin-bottom: 16px; }
.finish-box h2 { margin-top: 0; }
.finish-box ul { margin: 6px 0 12px; padding-left: 18px; }

/* Chronexa log */
.cx-tool { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; padding: 1px 6px; margin: 1px 3px 1px 0;
  border-radius: 5px; background: var(--blue-soft); color: var(--blue); }
.cx-tool.bad { background: var(--red-soft); color: var(--red); }
.cx-state-done, .cx-state-confirmed { background: var(--green-soft); color: var(--green); }
.cx-state-failed { background: var(--red-soft); color: var(--red); }
.cx-state-confirm, .cx-state-limited, .cx-state-working { background: var(--amber-soft); color: var(--amber); }
.cx-state-cancelled { background: var(--gray-soft); color: var(--muted); }
.cx-q, .cx-a { font-size: 14px; line-height: 1.55; }
.cx-call { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; margin-top: 8px; }
.cx-call summary { cursor: pointer; }

/* subtask progress on board cards */
.tcard .subcount { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 2px 8px 2px 6px;
  border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }
.subcount-bar { width: 28px; height: 4px; border-radius: 99px; background: var(--border); overflow: hidden; display: inline-block; }
.subcount-bar > span { display: block; height: 100%; background: var(--muted); }
.tcard .subcount.some { border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: var(--amber-soft); color: var(--amber); }
.tcard .subcount.some .subcount-bar > span { background: var(--amber); }
.tcard .subcount.all { border-color: color-mix(in srgb, var(--green) 40%, transparent); background: var(--green-soft); color: var(--green); }
.tcard .subcount.all .subcount-bar > span { background: var(--green); }

/* subtask checklist (board window and task page) */
.sub-dialog { border: 1px solid var(--border); border-radius: 14px; padding: 22px; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--text);
  box-shadow: 0 24px 60px rgba(11, 31, 68, .3); max-height: calc(100dvh - 32px); overflow-y: auto; }
.sub-dialog::backdrop { background: rgba(11, 31, 68, .45); }
.sub-dialog h2 { margin: 0 0 6px; font-size: 18px; }
.sub-checklist { display: grid; gap: 8px; margin: 14px 0 18px; max-height: min(45vh, 320px); overflow-y: auto; }
.sub-checklist .sub-check { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; height: auto; min-height: 52px; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--text); cursor: pointer;
  font-weight: 400; font-size: 14px; line-height: 1.5; }
.sub-checklist .sub-check > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sub-checklist .sub-check .mono { color: var(--muted); font-size: 12px; margin-right: 5px; }
.sub-checklist .sub-check:hover { border-color: var(--accent); }
.sub-checklist .sub-check:has(input:checked) { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.sub-checklist .sub-check:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.sub-checklist .sub-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--green); flex: 0 0 auto; }
.sub-check-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sub-check-actions .btn:disabled { opacity: .5; cursor: not-allowed; }

/* task owner + collaborators */
.tcard .avatars { display: inline-flex; flex-direction: row; }
.tcard .avatars .avatar + .avatar { margin-left: -6px; }
.avatar.collab { box-shadow: 0 0 0 2px var(--surface); opacity: .85; }
.collab-list { display: flex; flex-direction: column; gap: 4px; }
.collab-edit summary { cursor: pointer; color: var(--accent); margin-top: 4px; }
.collab-options { display: grid; gap: 4px; margin: 6px 0 8px; max-height: 220px; overflow-y: auto; font-size: 13px; }
.collab-options label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.collab-tag { color: var(--accent); }
.ts-locked { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ts-ask { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; }
.ts-ask input { min-width: 240px; padding: 5px 8px; font-size: 13px; }
.nav a .nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a > svg { flex: none; }
.nav a .count, .nav a .nav-kbd { flex: none; }

/* Profile photos: shown as the avatar's background; the initials stay in the markup for screen readers */
.avatar[data-photo] { background-size: cover; background-position: center; background-color: var(--surface-2); color: transparent; overflow: hidden; }
.sidebar .avatar[data-photo] { background-color: #143a7a; }
.avatar.xl { width: 88px; height: 88px; font-size: 30px; }
.photo-row { display: flex; gap: 18px; align-items: center; }
.photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.photo-actions .error { color: var(--red); }
.visually-hidden { position: absolute !important; left: 0; top: 0; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 520px) { .photo-row { flex-direction: column; align-items: flex-start; } }

/* "What's new" tip: card with an arrow towards the spot to click, which pulses */
.tip-card { position: fixed; z-index: 97; width: min(300px, calc(100vw - 24px)); background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px 16px 12px; box-shadow: 0 18px 50px rgba(6,14,32,.28), 0 2px 6px rgba(6,14,32,.12); opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.tip-card.on { opacity: 1; transform: none; }
.tip-card h3 { font-size: 16px; margin: 6px 0 4px; }
.tip-card p { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.tip-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 2px 8px; }
.tip-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.tip-later { color: var(--muted); font-size: 13px; margin-right: auto; }
.tip-arrow { position: absolute; width: 14px; height: 14px; background: var(--surface); border: 1px solid var(--border); transform: rotate(45deg); }
.tip-card[data-side="left"] .tip-arrow { left: -8px; margin-top: -7px; border-top-color: transparent; border-right-color: transparent; }
.tip-card[data-side="top"] .tip-arrow { top: -8px; margin-left: -7px; border-bottom-color: transparent; border-right-color: transparent; }
.tip-card[data-side="bottom"] .tip-arrow { bottom: -8px; margin-left: -7px; border-top-color: transparent; border-left-color: transparent; }
.tip-target { position: relative; z-index: 2; border-radius: 10px; animation: tip-pulse 1.6s ease-out infinite; }
@keyframes tip-pulse { 0% { box-shadow: 0 0 0 0 rgba(96,165,250,.75); } 70% { box-shadow: 0 0 0 10px rgba(96,165,250,0); } 100% { box-shadow: 0 0 0 0 rgba(96,165,250,0); } }
@media (prefers-reduced-motion: reduce) { .tip-target { animation: none; box-shadow: 0 0 0 3px #60a5fa; } .tip-card { transition: none; } }

/* Photo crop window (profile photo, web and phone) */
.crop-dialog { position: fixed; inset: 0; z-index: 130; background: rgba(6,14,32,.6); display: grid; place-items: center; padding: 16px; }
.crop-panel { width: min(400px, 100%); background: var(--surface); color: var(--text); border-radius: 18px; padding: 20px; box-shadow: 0 20px 60px rgba(6,14,32,.35); }
.crop-panel h2 { margin: 0 0 4px; font-size: 20px; }
.crop-help { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #0b1f44; touch-action: none; cursor: grab; user-select: none; outline: none; }
.crop-stage:active { cursor: grabbing; }
.crop-stage:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.crop-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(6,14,32,.5); outline: 2px solid rgba(255,255,255,.9); outline-offset: -2px; pointer-events: none; }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin: 16px 0; font-size: 14px; color: var(--muted); }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
.crop-actions { display: flex; gap: 10px; justify-content: flex-end; }
.crop-actions .btn { min-height: 44px; padding: 0 20px; font-size: 15px; justify-content: center; }
@media (max-width: 600px) { .crop-actions .btn { flex: 1; } }

/* QA: start a run for a product or for project tasks */
.qa-target { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.qa-target-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; background: var(--surface); }
.qa-target-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.qa-target-opt input { margin-top: 3px; }
.qa-target-opt strong, .qa-target-opt .small { display: block; }
[data-for][hidden] { display: none !important; }
.qa-picker { position: relative; }
.qa-picker-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; padding: 8px 12px; cursor: pointer; text-align: left; }
.qa-picker-btn:disabled { color: var(--muted); cursor: not-allowed; }
.qa-picker-panel { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px rgba(16,24,40,.15); }
.qa-picker-tools { display: flex; gap: 10px; align-items: center; padding: 8px; border-bottom: 1px solid var(--border); }
.qa-picker-tools input { flex: 1; min-width: 0; }
.qa-picker-list { max-height: 300px; overflow-y: auto; padding: 4px; }
.qa-picker-list label { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.qa-picker-list label:hover { background: var(--surface-2); }
.qa-picker-list label[hidden] { display: none; }
.qa-picker-list p { margin: 8px; }
.qa-picker-list label.is-sub { padding-left: 30px; }
.qa-who { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.qa-add-subs { margin-left: 6px; }
.qa-subs-toggle { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; color: var(--muted); }
@media (max-width: 600px) { .qa-who { display: none; } }

/* Project board: what QA is testing now */
.qa-strip { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.qa-strip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.qa-strip-runs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.qa-strip-run { display: block; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: inherit; background: var(--surface-2); }
a.qa-strip-run:hover { border-color: var(--accent); text-decoration: none; }
.qa-strip-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-strip-counts { display: block; margin-top: 6px; color: var(--muted); }
.qa-strip-counts .green { color: var(--green); } .qa-strip-counts .red { color: var(--red); }

/* ---- work areas (core/nav.py) ------------------------------------------------------------------- */
/* Only the open area's links show; the rest stay in the page for shortcuts and the tour. */
.nav-group { display: none; }
.nav-group.is-current { display: block; }
.nav-group > .nav-label:first-child { padding-top: 6px; }
.nav.area-swap .nav-group.is-current { animation: area-in .2s ease-out; }
@keyframes area-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

.area-switch { position: relative; margin: 2px 0 10px; }
.area-current { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px 8px 8px; border-radius: 12px; cursor: pointer;
  font: inherit; text-align: left; color: #fff; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.13);
  transition: background .15s, border-color .15s; }
.area-current:hover, .area-switch.open .area-current { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); }
.area-current:focus-visible, .area-menu button:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.area-icon { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--area, #3b82f6), color-mix(in srgb, var(--area, #3b82f6) 55%, #000));
  box-shadow: 0 3px 10px color-mix(in srgb, var(--area, #3b82f6) 40%, transparent), inset 0 1px 0 rgba(255,255,255,.25); }
.area-icon svg { width: 17px; height: 17px; }
.area-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.2; }
.area-kicker { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: #8fa6d6; }
.area-text strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.area-alert { background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; flex: none; }
.area-chevron { width: 16px; height: 16px; flex: none; color: #8fa6d6; transition: transform .18s; }
.area-switch.open .area-chevron { transform: rotate(180deg); }

.area-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40; padding: 6px; border-radius: 14px;
  background: #0c1b3d; border: 1px solid rgba(255,255,255,.14); box-shadow: 0 20px 44px rgba(2,8,23,.55);
  max-height: min(70vh, 560px); overflow-y: auto; animation: area-menu-in .16s ease-out; }
@keyframes area-menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.area-menu button, .area-soon { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 10px;
  background: transparent; color: #e4ecfb; font: inherit; text-align: left; cursor: pointer; }
.area-menu button:hover { background: rgba(255,255,255,.07); }
.area-menu button[aria-checked="true"] { background: rgba(96,165,250,.16); }
.area-menu .area-icon { width: 30px; height: 30px; border-radius: 8px; box-shadow: none; }
.area-item-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.area-item-text strong { font-size: 13.5px; }
.area-item-text small { font-size: 11px; color: #8fa6d6; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.area-menu .count { background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 0 7px; flex: none; }
.area-check { width: 15px; height: 15px; flex: none; color: #93c5fd; visibility: hidden; }
.area-menu button[aria-checked="true"] .area-check { visibility: visible; }
.area-soon { cursor: default; opacity: .55; margin-top: 4px; border-top: 1px solid rgba(255,255,255,.08); border-radius: 0 0 10px 10px; padding-top: 10px; }
.area-soon .soon { margin-left: auto; font-size: 10px; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; padding: 0 6px; color: #cbd8f3; }


/* Dashboard: one tile per work area */
.area-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin: 0 0 18px; }
.area-tile { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: 0 1px 2px rgba(15,40,90,.05);
  transition: transform .15s, box-shadow .15s, border-color .15s; }
.area-tile::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--area); opacity: .85; }
.area-tile:hover { transform: translateY(-2px); text-decoration: none; border-color: color-mix(in srgb, var(--area) 45%, var(--border));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--area) 18%, transparent); }
.area-tile .area-icon { width: 40px; height: 40px; border-radius: 11px; }
.area-tile .area-icon svg { width: 20px; height: 20px; }
.area-tile-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.area-tile-text strong { font-size: 15px; }
.area-tile-text small { color: var(--muted); font-size: 12px; }
.area-tile .waiting { flex: none; font-size: 11.5px; font-weight: 700; color: var(--amber); background: var(--amber-soft); border-radius: 99px; padding: 2px 9px; }
.area-tiles-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 10px; }
.area-tiles-head h2 { font-size: 15px; margin: 0; }
@media (max-width: 800px) { .area-tiles { grid-template-columns: 1fr 1fr; } .area-tile { padding: 12px; } .area-tile-text small { display: none; } }
@media (prefers-reduced-motion: reduce) { .nav.area-swap .nav-group.is-current, .area-menu { animation: none; } .area-tile { transition: none; } }
/* Sub-pages listed under an area's main link */
.nav-sub { margin: 1px 0 6px 19px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; }
.nav .nav-sub a { padding: 4px 10px; font-size: 13px; font-weight: 500; color: #a9bbe0; border-radius: 6px; }
.nav .nav-sub a:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav .nav-sub a.active { color: #fff; background: rgba(96,165,250,.18); box-shadow: none; }

/* ---- billing ------------------------------------------------------------------------------------- */
.kv-list { display: grid; gap: 8px; }
.kv-list > div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; align-items: start; }
.kv-list > div > span:first-child { font-size: 12px; }
.schedule-choices { display: flex; flex-direction: column; gap: 6px; }
.chip-radio { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; }
.chip-radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.issue-card { border-left: 4px solid var(--accent); }
.issue-form .field, .payment-form .field { margin-bottom: 8px; }
tfoot.totals td { border: 0; padding: 4px 8px; }
tfoot.totals .grand td { border-top: 2px solid var(--text); padding-top: 8px; font-size: 15px; }
.gst-export { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.gst-export input { width: auto; padding: 5px 8px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin: 0 4px 0 10px; vertical-align: 0; }
.legend-dot.inv, .bill-col .inv { background: var(--series-1, #2a78d6); }
.legend-dot.col, .bill-col .col { background: var(--green); }
.bill-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: end; height: 170px; padding: 8px 4px 0; margin-bottom: 10px; }
.bill-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.bill-col .bars { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--border); }
.bill-col .bars span { width: 38%; max-width: 16px; min-height: 2px; border-radius: 3px 3px 0 0; }
.invoice-lines tr.line-removed td { opacity: .45; text-decoration: line-through; }
.invoice-lines [data-line-amount] { white-space: nowrap; min-width: 110px; }
.totals-preview { margin: 16px 0 4px auto; max-width: 420px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 10px; }
.totals-preview h2 { font-size: 15px; margin: 0 0 6px; }
.totals-preview table { width: 100%; border-collapse: collapse; }
.totals-preview td { border: 0; padding: 4px 0; }
.totals-preview td.num { white-space: nowrap; padding-left: 16px; }
.totals-preview tr[hidden] { display: none; }
.totals-preview .grand td { border-top: 2px solid var(--text); padding-top: 8px; font-weight: 700; font-size: 16px; }
.totals-preview p { margin: 8px 0 0; }
/* Email the team */
.team-email .field { margin-bottom: 16px; }
.team-email .field > label { display: block; font-weight: 600; margin-bottom: 6px; }
.team-email input[type=text], .team-email textarea { width: 100%; box-sizing: border-box; }
.pick-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.pick-bar input[type=search] { flex: 1 1 200px; min-width: 160px; }
.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: var(--surface-2); }
.pick { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; background: var(--surface); border: 1px solid transparent; }
.pick[hidden] { display: none; }
.pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pick strong { display: block; font-size: 14px; }
.pick .small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .grow { min-width: 0; }
.send-when { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.send-when [hidden] { display: none; }
.team-email .checkbox-line { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
/* Newsletters */
.nl-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .nl-form { grid-template-columns: 1fr; } }
.nl-form .field { margin-bottom: 16px; }
.nl-form .field > label { display: block; font-weight: 600; margin-bottom: 6px; }
.nl-form input[type=text], .nl-form textarea { width: 100%; box-sizing: border-box; }
.nl-aud { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.nl-aud:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.nl-aud .small { display: block; }
.nl-preview .md img { max-width: 100%; height: auto; }
.nl-preview { position: sticky; top: 16px; }
