/* My Ops Dash — navy → teal → green, quiet surfaces, one accent, motion that explains. */
:root {
  --bg: #f3f5fa; --panel: #ffffff; --panel-2: #f8f9fc; --ink: #0f1a33; --ink-2: #33415c; --muted: #6b7690; --line: #e3e8f1; --soft: #eef1f7;
  --accent: #2f5bea; --accent-2: #1597bd; --accent-3: #1fb57e; --accent-ink: #ffffff; --accent-soft: #e9eeff;
  --grad: linear-gradient(135deg, #2a3f9e 0%, #1aa3c8 55%, #2fd28a 100%);
  --crit: #d23a43; --crit-soft: #fdeced; --warn: #b9740c; --warn-soft: #fff4de; --ok: #1d9653; --ok-soft: #e5f7ec;
  --ai: #fff1c2; --radius: 16px; --radius-s: 10px;
  --shadow: 0 1px 2px rgba(15, 26, 51, .04), 0 10px 28px -14px rgba(15, 26, 51, .16);
  --shadow-lift: 0 2px 4px rgba(15, 26, 51, .05), 0 22px 44px -18px rgba(15, 26, 51, .28);
  --side-bg: linear-gradient(180deg, #0d1631 0%, #0a1229 100%); --side-ink: #cdd6ee; --side-muted: #7f8bb3; --side-line: rgba(255, 255, 255, .07); --side-hover: rgba(255, 255, 255, .06);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #090e1c; --panel: #111a2e; --panel-2: #0e1628; --ink: #e8edf8; --ink-2: #c3cbe0; --muted: #8f9abb; --line: #212b45; --soft: #172038;
  --accent: #7895ff; --accent-2: #3cc3e6; --accent-3: #46dc9e; --accent-ink: #0b1124; --accent-soft: #1b2650;
  --crit: #ff7b83; --crit-soft: #3a1a22; --warn: #f3c057; --warn-soft: #362a12; --ok: #5fdc8f; --ok-soft: #13301f;
  --ai: #463b12; --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 30px -16px rgba(0, 0, 0, .7); --shadow-lift: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 48px -18px rgba(0, 0, 0, .8);
  --side-bg: linear-gradient(180deg, #0b1226 0%, #070c1a 100%);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090e1c; --panel: #111a2e; --panel-2: #0e1628; --ink: #e8edf8; --ink-2: #c3cbe0; --muted: #8f9abb; --line: #212b45; --soft: #172038;
    --accent: #7895ff; --accent-2: #3cc3e6; --accent-3: #46dc9e; --accent-ink: #0b1124; --accent-soft: #1b2650;
    --crit: #ff7b83; --crit-soft: #3a1a22; --warn: #f3c057; --warn-soft: #362a12; --ok: #5fdc8f; --ok-soft: #13301f;
    --ai: #463b12; --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 30px -16px rgba(0, 0, 0, .7); --shadow-lift: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 48px -18px rgba(0, 0, 0, .8);
    --side-bg: linear-gradient(180deg, #0b1226 0%, #070c1a 100%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--bg);
  font: 15px/1.55 "Inter", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
body.app::before { /* a soft wash of the brand colours behind the content */
  content: ""; position: fixed; inset: 0 0 auto 0; height: 420px; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 300px at 85% -60px, rgba(26, 163, 200, .10), transparent 70%), radial-gradient(700px 260px at 30% -80px, rgba(47, 91, 234, .10), transparent 70%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.025em; font-weight: 750; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 700; }
h3 { font-size: 11.5px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
::selection { background: rgba(47, 91, 234, .18); }

/* ---------- shell: sidebar + content ---------- */
body.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; z-index: 20; display: flex; flex-direction: column; gap: 10px;
  padding: 18px 14px 14px; background: var(--side-bg); color: var(--side-ink); border-right: 1px solid var(--side-line);
}
.sidetop { display: flex; align-items: center; justify-content: space-between; padding: 2px 6px 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); white-space: nowrap; letter-spacing: -.02em; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 4px 10px rgba(26, 163, 200, .35)); }
.logo .lb1 { fill: #6fc8f2; } .logo .lb2 { fill: #4fd7a6; }
.brand .name .w1, .brand .name .w3 { color: inherit; }
.brand .name .w2 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; margin: 0 .22em; }
.side .brand { color: #fff; }
.side .brand .name .w2 { background: linear-gradient(90deg, #5aa2ff, #3fd0c9); -webkit-background-clip: text; background-clip: text; }
.brandrow { text-align: center; margin-bottom: 22px; }
.brand.big { font-size: 24px; }
.brand.big .logo { width: 42px; height: 42px; }
.navsearch { position: relative; margin: 2px 2px 4px; }
.navsearch .ni { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--side-muted); }
.side .navsearch input { width: 100%; padding: 9px 12px 9px 34px !important; background: rgba(255, 255, 255, .06) !important; border: 1px solid var(--side-line) !important; color: #fff; border-radius: 10px; }
.side .navsearch input::placeholder { color: var(--side-muted); }
.side .navsearch input:focus { outline: 2px solid rgba(90, 162, 255, .6); background: rgba(255, 255, 255, .09) !important; }
.side nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; padding: 2px; margin: 0 -2px; scrollbar-width: thin; }
.navgroup { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--side-muted); font-weight: 700; padding: 14px 10px 6px; }
.side nav > a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--side-ink); font-weight: 550; font-size: 14px; transition: background .2s var(--ease), color .2s; }
.side nav > a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.side nav > a.on { color: #fff; background: linear-gradient(90deg, rgba(47, 91, 234, .45), rgba(26, 163, 200, .18)); box-shadow: inset 0 0 0 1px rgba(120, 160, 255, .25); }
.side nav > a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.ni { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: inline-block; }
.side nav > a .ni { opacity: .85; } .side nav > a.on .ni { opacity: 1; }
.side nav > a .badge { margin-left: auto; }
.badge { display: inline-block; min-width: 19px; padding: 0 6px; border-radius: 10px; background: var(--crit); color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; }
.usermenu { position: relative; border-top: 1px solid var(--side-line); padding-top: 10px; }
.usermenu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: var(--side-ink); margin: 0; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--side-hover); }
.usermenu .who { display: flex; flex-direction: column; line-height: 1.25; }
.usermenu .who b { color: #fff; font-weight: 650; }
.usermenu .who .muted { color: var(--side-muted); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--grad); flex: none; }
.usermenu .dd { position: absolute; left: 0; right: 0; bottom: 58px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 6px; display: flex; flex-direction: column; animation: pop .18s var(--ease); }
.usermenu .dd a, .usermenu .dd button { padding: 8px 10px; border-radius: 8px; color: var(--ink); text-align: left; font-size: 14px; }
.usermenu .dd a:hover, .usermenu .dd button:hover { background: var(--soft); text-decoration: none; }
.menu-btn { display: none; background: none; border: 1px solid var(--side-line); border-radius: 10px; padding: 9px 9px; cursor: pointer; }
.menu-btn span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; margin: 3px 0; }

main { position: relative; z-index: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 30px 36px 70px; }
main.wide { max-width: 1500px; }
body.bare main { max-width: 1100px; }

/* ---------- cards & layout ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cardhead h2 { margin: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; }
.span2 { grid-column: span 2; }
.recgrid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.pagehead h1 { margin: 0; }
.crumbs { font-size: 13px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline { display: inline; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row2, .row3 { display: grid; gap: 12px; }
.row2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.empty { text-align: center; padding: 30px 12px; color: var(--muted); }
.welcome p { max-width: 640px; }

/* motion: content rises in, in order; never for people who prefer less motion */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: var(--len, 300); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes growx { from { transform: scaleX(0); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
main > .card, main > .tiles, main > .grid2, main > .grid3, main > .hero, main > .kpis, main > .entgrid, main > section, main > .billstrip { animation: rise .55s var(--ease) both; }
main > :nth-child(2) { animation-delay: .04s; } main > :nth-child(3) { animation-delay: .08s; } main > :nth-child(4) { animation-delay: .12s; }
main > :nth-child(5) { animation-delay: .16s; } main > :nth-child(6) { animation-delay: .2s; } main > :nth-child(n+7) { animation-delay: .24s; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- tiles (KPIs) ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.tile { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; color: var(--ink); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); opacity: .85; }
a.tile:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: transparent; }
.tile .n { font-size: 30px; font-weight: 780; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile .l { color: var(--muted); font-size: 13px; }
.tile.warn::before { background: linear-gradient(90deg, #f3b13b, #f08a24); } .tile.warn .n { color: var(--warn); }
.tile.crit::before { background: linear-gradient(90deg, #ff6b6b, #d23a43); } .tile.crit .n { color: var(--crit); }

/* ---------- forms ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); transition: border-color .15s, box-shadow .15s;
}
input:hover:not([type=checkbox]):not([type=radio]), select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; }
input[type=color] { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); padding: 3px; }
input[type=file] { font-size: 13px; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); padding: 7px 12px; border-radius: 9px; margin-right: 10px; cursor: pointer; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 450; font-size: 14px; color: var(--ink); }
label.check input { width: auto; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 12px; background: var(--panel-2); }
fieldset[disabled] { opacity: .55; }
legend { font-weight: 700; padding: 0 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ai { background: var(--ai) !important; }
.ai.legend { padding: 1px 6px; border-radius: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select, .filters input { width: auto !important; min-width: 150px; background-color: var(--panel); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font-weight: 650; font-size: 14px; white-space: nowrap; transition: transform .15s var(--ease), box-shadow .2s, border-color .2s, background .2s; }
.btn:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 6px 16px -10px rgba(47, 91, 234, .5); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); background-size: 140% 140%; border-color: transparent; color: #fff; box-shadow: 0 8px 20px -10px rgba(26, 120, 200, .8); }
.btn.primary:hover { background-position: 100% 0; box-shadow: 0 12px 26px -10px rgba(26, 140, 200, .9); filter: saturate(1.1); }
.btn.subtle { background: transparent; }
.btn.danger, .linklike.danger { color: var(--crit); }
.btn.small { padding: 4px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.google { justify-content: center; width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; }
table.list th, table.list td, table.matrix th, table.matrix td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list thead th, table.matrix thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; border-bottom-color: var(--line); background: var(--panel-2); }
table.list thead th:first-child, table.matrix thead th:first-child { border-top-left-radius: 10px; }
table.list thead th:last-child, table.matrix thead th:last-child { border-top-right-radius: 10px; }
table.list tbody tr { transition: background .15s; }
table.list tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, transparent); }
table.list tbody tr:last-child td { border-bottom: 0; }
table.matrix tbody th, table.matrix tfoot th { font-weight: 650; }
table.matrix tfoot td, table.matrix tfoot th { border-top: 2px solid var(--line); }
table.list td.num, table.matrix td.num, table.matrix th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- chips, tags, dates ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 750; letter-spacing: .03em; color: var(--ink-2); background: color-mix(in srgb, var(--c, #888) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c, #888) 28%, transparent); vertical-align: 1px; white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, #888); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c, #888) 25%, transparent); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--soft); color: var(--ink-2); white-space: nowrap; }
.tag.deadline { background: var(--crit-soft); color: var(--crit); font-weight: 650; }
.tag.end { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.tag.start { background: var(--ok-soft); color: var(--ok); }
.tag.pay { background: var(--warn-soft); color: var(--warn); }
.tag.sample, .tag.warn { background: var(--warn-soft); color: var(--warn); }
.date.urgent, .date.past { color: var(--crit); font-weight: 700; }
.date.soon { color: var(--warn); font-weight: 650; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot.crit { background: var(--crit); } .dot.warn { background: var(--warn); }
.up { color: var(--crit); font-weight: 650; }
.down { color: var(--ok); font-weight: 650; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--soft); border-radius: 12px; border: 1px solid var(--line); }
.seg a { padding: 5px 12px; color: var(--muted); font-size: 13px; font-weight: 600; border-radius: 9px; transition: background .2s, color .2s; }
.seg a.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(15, 26, 51, .1), 0 4px 10px -6px rgba(15, 26, 51, .25); }
.seg a:hover { text-decoration: none; color: var(--ink); }
.pill { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 13px; font-size: 13px; cursor: pointer; color: var(--ink); transition: border-color .2s, transform .15s; }
.pill:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ---------- flashes & flags ---------- */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); animation: pop .3s var(--ease); }
.flash.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.flash.err { background: var(--crit-soft); color: var(--crit); border-color: color-mix(in srgb, var(--crit) 22%, transparent); }
.flash.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.flags, .attn { list-style: none; padding: 0; margin: 0 0 16px; }
.flags li { padding: 9px 13px; border-radius: 10px; margin-bottom: 6px; }
.flags li.crit { background: var(--crit-soft); color: var(--crit); font-weight: 600; }
.flags li.warn { background: var(--warn-soft); color: var(--warn); }
.flags li.info { background: var(--soft); color: var(--muted); }
.attn li { padding: 9px 0 9px 14px; border-left: 3px solid var(--warn); margin-bottom: 8px; border-radius: 0 8px 8px 0; transition: background .2s; }
.attn li:hover { background: var(--panel-2); }
.attn li.crit { border-left-color: var(--crit); }

/* ---------- bars ---------- */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar { display: grid; grid-template-columns: 190px 1fr 96px; gap: 12px; align-items: center; font-size: 13px; }
.bar .bt { height: 10px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.bar .bt span { display: block; height: 100%; border-radius: 6px; transform-origin: left; animation: growx .9s var(--ease) both; }
.bar .bv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.bar .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.changes, .plain, .docs, .contacts, .connectors, .checklist { list-style: none; padding: 0; margin: 0; }
.changes li, .plain li, .docs li, .contacts li, .connectors li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.changes li:last-child, .plain li:last-child, .docs li:last-child, .contacts li:last-child, .connectors li:last-child { border-bottom: 0; }
.checklist li { padding: 6px 0; }
.checklist li.todo { color: var(--muted); }

/* ---------- tasks ---------- */
.tasks { list-style: none; padding: 0; margin: 0 0 12px; }
.tasks li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tasks li:last-child { border-bottom: 0; }
.tasks li.done > span:first-of-type { text-decoration: line-through; color: var(--muted); }
.check:not(label) { width: 20px; height: 20px; border-radius: 7px; border: 2px solid color-mix(in srgb, var(--muted) 55%, transparent); background: var(--panel); cursor: pointer; padding: 0; display: inline-block; flex: none; transition: border-color .2s, background .2s, transform .15s; }
.check:not(label):hover { border-color: var(--accent-3); transform: scale(1.08); }
.check:not(label).on { background: var(--accent-3); border-color: var(--accent-3); }
.addtask { display: flex; gap: 8px; }
.addtask input[name=title] { flex: 1; }
.addtask input[type=date] { width: 160px !important; }

/* ---------- record view ---------- */
dl.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0 0 12px; }
dl.details dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
dl.details dd { margin: 2px 0 0; font-weight: 500; }
.notes { white-space: normal; background: var(--panel-2); border: 1px solid var(--line); padding: 12px 14px; border-radius: 12px; }
.termsum { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent); border-left: 3px solid var(--accent); padding: 11px 14px; border-radius: 0 10px 10px 0; margin: 10px 0 4px; }
.upload { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.upload input[name=label] { flex: 1; min-width: 160px; }
details summary { cursor: pointer; color: var(--accent); margin: 8px 0; font-weight: 550; }

/* ---------- intake review ---------- */
.review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.review .source { position: sticky; top: 20px; }
.srcframe { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.srcimg { max-width: 100%; border: 1px solid var(--line); border-radius: 12px; }
.srctext { white-space: pre-wrap; background: var(--panel-2); padding: 14px; border-radius: 12px; max-height: 70vh; overflow: auto; font-size: 13px; }
.aisum { background: var(--accent-soft); padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; font-size: 14px; }
.quote { margin: 0 0 12px; padding: 10px 14px; border-left: 4px solid var(--warn); background: var(--warn-soft); border-radius: 0 10px 10px 0; font-size: 14px; }
.matchbox { border-color: var(--accent); }
.dropzone { transition: outline-color .2s; }
.dropzone.over { outline: 3px dashed var(--accent); outline-offset: -10px; }

/* ---------- search, chat, auth ---------- */
.searchbig { display: flex; gap: 8px; margin-bottom: 20px; }
.searchbig input { font-size: 17px; padding: 13px 16px !important; border-radius: 14px !important; }
mark { background: var(--ai); color: inherit; padding: 0 2px; border-radius: 4px; }
.chat .log { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.msg { padding: 11px 15px; border-radius: 16px; max-width: 85%; white-space: pre-wrap; animation: pop .25s var(--ease); }
.msg.assistant { white-space: normal; }
.msg p { margin: 0 0 8px; } .msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: 4px 0 8px; padding-left: 20px; } .msg li { margin: 2px 0; }
.msg.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 5px; box-shadow: var(--shadow); }
.msg.pending { color: var(--muted); font-style: italic; background: linear-gradient(90deg, var(--panel) 0, var(--soft) 50%, var(--panel) 100%); background-size: 800px 100%; animation: shimmer 1.4s linear infinite; }
.msg.error { color: var(--crit); }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.askform { display: flex; gap: 8px; align-items: flex-end; }
body.bare { background: radial-gradient(1000px 500px at 80% -10%, rgba(26, 163, 200, .18), transparent 60%), radial-gradient(900px 500px at 0% 110%, rgba(47, 210, 138, .14), transparent 60%), var(--bg); min-height: 100vh; }
.authbox { max-width: 420px; margin: 9vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 32px 30px; box-shadow: var(--shadow-lift); animation: rise .5s var(--ease) both; }
.authbox h1 { font-size: 22px; }
.or { text-align: center; color: var(--muted); margin: 12px 0; font-size: 13px; }
.steps li { margin-bottom: 10px; }
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 18px; letter-spacing: .08em; background: var(--soft); padding: 8px 12px; border-radius: 10px; margin: 6px 0; cursor: copy; display: inline-block; }
.secret.copied { outline: 2px solid var(--ok); }

/* ---------- sharing ---------- */
.shares { list-style: none; padding: 0; margin: 0 0 10px; }
.shares li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.sharelink code, code[data-copy] { display: inline-block; max-width: 100%; overflow-wrap: anywhere; word-break: break-all; background: var(--soft); padding: 5px 9px; border-radius: 8px; cursor: copy; font-size: 12px; margin: 4px 0; }
code[data-copy].copied { outline: 2px solid var(--ok); }
.sharebox h1 { overflow-wrap: anywhere; }
.drivefrm select { width: auto; display: inline-block; }
.card h3 { margin-top: 18px; }

/* ---------- bills ---------- */
.billstrip { position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 18px 13px 22px; margin: -4px 0 20px; color: var(--ink); box-shadow: var(--shadow); overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; }
.billstrip::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--ok); }
.billstrip.warn::before { background: var(--warn); } .billstrip.crit::before { background: var(--crit); }
.billstrip:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lift); }
table.bills tr.paid td, table.bills tr.skipped td { color: var(--muted); }
table.bills tr.paid a, table.bills tr.skipped a { color: var(--muted); }
.linkrow select { width: auto; max-width: 260px; display: inline-block; }

/* ---------- month chart: one series, thin bars, rounded data end, 2px gaps, hover tooltip ---------- */
.mchart { margin: 0; }
.mchart .mbars { display: flex; flex-direction: row; align-items: flex-end; gap: 2px; height: 200px; border-bottom: 1px solid var(--line); padding-top: 24px; background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 25%; background-position: 0 24px; }
.mchart .mcol { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; outline: none; }
.mchart .mbar { position: relative; width: min(64%, 34px); background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-radius: 4px 4px 0 0; transform-origin: bottom; animation: grow .8s var(--ease) both; }
.mchart .mcol:nth-child(odd) .mbar { animation-delay: .05s; }
.mchart .mcol:hover .mbar, .mchart .mcol:focus .mbar { filter: brightness(1.15); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
.mchart .tip { display: none; position: absolute; bottom: calc(100% - 18px); white-space: nowrap; background: var(--ink); color: var(--panel); font-size: 12px; padding: 4px 9px; border-radius: 8px; z-index: 2; pointer-events: none; box-shadow: var(--shadow-lift); }
.mchart .mcol:hover .tip, .mchart .mcol:focus .tip { display: block; }
.mchart .val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.mchart .xlab { display: flex; gap: 2px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.mchart .xlab span { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; }
.sheetprev td { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
ul.links li { padding: 8px 0; }
.checks.scrollbox { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--panel-2); }

/* ---------- dashboard: hero, rings, timeline, company cards ---------- */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 26px 28px; margin-bottom: 20px; color: #fff; background: radial-gradient(600px 220px at 100% 0, rgba(47, 210, 138, .35), transparent 60%), radial-gradient(500px 240px at 0 100%, rgba(26, 163, 200, .35), transparent 60%), linear-gradient(135deg, #0f1c4d 0%, #142a6e 55%, #0f3b62 100%); box-shadow: 0 30px 60px -30px rgba(15, 30, 90, .7); }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent, #000 60%); pointer-events: none; }
.hero .hi { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-end; position: relative; z-index: 1; }
.hero .greet { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .7); font-weight: 700; }
.hero h1 { color: #fff; font-size: 30px; margin: 4px 0 8px; }
.hero .sum { color: rgba(255, 255, 255, .86); max-width: 680px; font-size: 15px; margin: 0; }
.hero .sum b { color: #fff; }
.hero .heroact { display: flex; gap: 8px; flex-wrap: wrap; }
.hero .btn { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.hero .btn:hover { background: rgba(255, 255, 255, .2); }
.hero .filters select { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .22); }
.hero .filters select option { color: #000; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { position: relative; display: flex; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); color: var(--ink); transition: transform .25s var(--ease), box-shadow .25s; }
a.kpi:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.kpi .kn { font-size: 26px; font-weight: 780; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .kl { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.kpi .kx { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.crit .kn { color: var(--crit); } .kpi.warn .kn { color: var(--warn); }
.ring { flex: none; width: 58px; height: 58px; }
.ring .rt { fill: none; stroke: var(--soft); }
.ring .rv { fill: none; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; animation: draw 1.2s var(--ease) both; }
.ring text { font-size: 13px; font-weight: 750; fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.ring.big { width: 120px; height: 120px; }
.ring.big text { font-size: 20px; }

.timeline { position: relative; padding: 8px 0 4px; }
.tl-track { position: relative; height: 92px; margin: 6px 6px 0; }
.tl-axis { position: absolute; left: 0; right: 0; bottom: 22px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3)); border-radius: 2px; opacity: .55; }
.tl-today { position: absolute; bottom: 14px; width: 2px; height: 18px; background: var(--ink); border-radius: 2px; }
.tl-tick { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.tl-dot { position: absolute; transform: translate(-50%, 50%); width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--panel); background: var(--accent); box-shadow: 0 2px 6px rgba(0, 0, 0, .18); cursor: pointer; transition: transform .2s var(--ease); outline: none; animation: pop .5s var(--ease) both; }
.tl-dot.deadline { background: var(--crit); } .tl-dot.end { background: var(--accent); } .tl-dot.pay { background: var(--warn); } .tl-dot.start { background: var(--accent-3); } .tl-dot.other { background: var(--accent-2); }
.tl-dot:hover, .tl-dot:focus { transform: translate(-50%, 50%) scale(1.45); z-index: 3; }
.tl-dot .tip { display: none; position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 7px 10px; border-radius: 10px; font-size: 12px; line-height: 1.35; white-space: nowrap; box-shadow: var(--shadow-lift); pointer-events: none; text-align: left; }
.tl-dot .tip b { display: block; font-size: 12.5px; }
.tl-dot:hover .tip, .tl-dot:focus .tip { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.entgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 16px; margin-bottom: 20px; }
.entcard { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); transition: transform .25s var(--ease), box-shadow .25s; }
.entcard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 70px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, transparent), transparent); pointer-events: none; }
a.entcard:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.entcard .eh { position: relative; display: flex; align-items: center; gap: 10px; }
.entcard .elogo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; background: var(--c); box-shadow: 0 8px 18px -8px var(--c); overflow: hidden; flex: none; }
.entcard .elogo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.entcard .en { font-weight: 750; letter-spacing: -.01em; line-height: 1.2; }
.entcard .es { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; position: relative; }
.entcard .es div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 8px; }
.entcard .es b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.entcard .es span { font-size: 11px; color: var(--muted); }
.entcard .meter { height: 6px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.entcard .meter span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 55%, #2fd28a)); transform-origin: left; animation: growx 1s var(--ease) both; }
.entcard .ef { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }

.donutwrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.donut { width: 170px; height: 170px; flex: none; }
@keyframes fade { from { opacity: 0; } }
.donut circle.seg2 { fill: none; stroke-width: 22; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-width .2s; cursor: pointer; animation: fade .9s var(--ease) both; }
.donut circle.seg2:hover { stroke-width: 27; }
.donut text { text-anchor: middle; dominant-baseline: central; fill: var(--ink); }
.donut .dv { font-size: 19px; font-weight: 780; letter-spacing: -.02em; }
.donut .dl { font-size: 10.5px; fill: var(--muted); }
.dlegend { list-style: none; padding: 0; margin: 0; flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.dlegend li { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; }
.dlegend i { width: 10px; height: 10px; border-radius: 3px; }
.dlegend b { font-variant-numeric: tabular-nums; }

.catlist { display: flex; flex-direction: column; gap: 11px; }
.catrow { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr) auto; gap: 12px; align-items: center; font-size: 13.5px; }
.catrow .cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.catrow .ct { height: 9px; border-radius: 6px; background: var(--soft); overflow: hidden; }
.catrow .ct span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; animation: growx .9s var(--ease) both; }
.catrow .cv { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.catrow .cv small { display: block; color: var(--muted); font-weight: 500; }
.spark { width: 100%; height: 44px; display: block; }
.spark path.sl { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 600; animation: draw 1.4s var(--ease) both; --len: 600; }
.spark path.sa { fill: url(#sparkfill); opacity: .35; }
.estimate { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.estimate .big { font-size: 34px; font-weight: 800; letter-spacing: -.03em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.minirow { display: flex; flex-wrap: wrap; gap: 8px; }
.kbd { font: 600 11px ui-monospace, Consolas, monospace; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; color: var(--muted); background: var(--panel-2); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  body.app { display: block; }
  .side { position: sticky; top: 0; height: auto; flex-direction: column; gap: 0; padding: 10px 14px; }
  .sidetop { padding: 0; }
  .menu-btn { display: block; }
  .side .navsearch, .side nav, .side .usermenu { display: none; }
  .side.open .navsearch, .side.open nav, .side.open .usermenu { display: flex; }
  .side.open { max-height: 100vh; overflow-y: auto; }
  .side.open .navsearch { display: block; margin-top: 10px; }
  .usermenu .dd { position: static; box-shadow: none; margin-top: 6px; }
  .side.open .usermenu { flex-direction: column; }
  main { padding: 22px 18px 56px; }
  .grid2, .grid3, .recgrid, .review { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .review .source { position: static; }
}
@media (max-width: 640px) {
  main { padding: 16px 16px 48px; }
  h1 { font-size: 24px; }
  .hero { padding: 20px; border-radius: 18px; }
  .hero h1 { font-size: 24px; }
  .kpis, .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { flex-direction: column; align-items: flex-start; padding: 14px; }
  .ring { width: 46px; height: 46px; }
  .row2, .row3, dl.details { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 110px 1fr 80px; }
  .catrow { grid-template-columns: 1fr auto; } .catrow .ct { grid-column: 1 / -1; grid-row: 2; }
  .filters select, .filters input { min-width: 0; flex: 1 1 140px; }
  .addtask { flex-wrap: wrap; }
  .card { padding: 16px; }
}

/* ---- files & gaps ---- */
.filegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 6px 0 14px; }
.filethumb { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; min-width: 0; }
.filethumb:hover { border-color: var(--muted); }
.filethumb-img { display: flex; align-items: center; justify-content: center; height: 110px; background: var(--soft); border-radius: 6px; overflow: hidden; }
.filethumb-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.filethumb-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filegroup h3 { margin: 14px 0 6px; }
.filegroup-logo { height: 24px; width: auto; max-width: 90px; object-fit: contain; vertical-align: middle; margin-right: 8px; }
.filepreview { display: flex; align-items: center; justify-content: center; background: var(--soft); border-radius: 8px; padding: 12px; margin-bottom: 12px; }
.filepreview img { max-width: 100%; max-height: 360px; object-fit: contain; }
.filepreview-icon { font-size: 48px; margin: 0 0 8px; }
.gaprecs > li { padding: 8px 0; border-top: 1px solid var(--line); }
.gaprecs > li:first-child { border-top: 0; }
.gapitems { list-style: none; padding: 4px 0 0 14px; margin: 0; }
.gapitems li { padding: 3px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gap-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-left: auto; }
@media (max-width: 640px) { .filegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .gap-actions { margin-left: 0; } }
.filethumb { border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); transition: transform .2s var(--ease), box-shadow .2s; }
.filethumb:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); text-decoration: none; }
.filethumb-img { border-radius: 10px; background: repeating-conic-gradient(var(--soft) 0 25%, var(--panel) 0 50%) 0 0 / 16px 16px; }
.entcard .elogo.has-img { background: #fff; border: 1px solid var(--line); box-shadow: none; padding: 3px; }

/* ---- assistant widget, to-dos, updates ---- */
/* Everything for the floating Ask button and panel (lib/widget.js, public/widget.js), the /todos
   page and the record "Updates" card. Uses only the :root colour variables so it re-themes. */
.opsw { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.opsw > * { pointer-events: auto; }
.opsw-fab { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 6px 20px rgba(0, 0, 0, .18); padding: 0; cursor: pointer; display: grid; place-items: center; transition: transform .12s ease; }
.opsw-fab:hover, .opsw-fab:focus-visible { transform: scale(1.06); outline: 2px solid var(--accent); outline-offset: 2px; }
.opsw-fab .logo { width: 34px; height: 34px; }
.opsw.open .opsw-fab { box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.opsw-panel { width: min(440px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0, 0, 0, .22); overflow: hidden; }
.opsw-panel[hidden] { display: none; }
.opsw-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 0 10px; border-bottom: 1px solid var(--line); }
.opsw-tabs { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
.opsw-tab { border: 0; background: none; padding: 8px 10px; border-radius: 8px 8px 0 0; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; }
.opsw-tab:hover { color: var(--ink); }
.opsw-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.opsw-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 6px 8px; border-radius: 6px; }
.opsw-x:hover { background: var(--soft); color: var(--ink); }
.opsw-pane { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.opsw-pane[hidden] { display: none; }
.opsw-askform { display: flex; gap: 6px; }
.opsw-askform input { flex: 1; }
.opsw-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.opsw-results:empty { display: none; }
.opsw-results li a { display: flex; flex-direction: column; padding: 7px 10px; border-radius: 8px; color: var(--ink); position: relative; }
.opsw-results li a:hover, .opsw-results li.sel a { background: var(--accent-soft); text-decoration: none; }
.opsw-t { font-weight: 600; font-size: 14px; padding-right: 64px; }
.opsw-s { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opsw-k { display: inline-block; font-size: 11px; color: var(--muted); background: var(--soft); border-radius: 8px; padding: 0 7px; text-transform: lowercase; }
.opsw-results .opsw-k { position: absolute; right: 8px; top: 8px; }
.opsw-answer:empty { display: none; }
.opsw-answer .msg { max-width: 100%; }
.opsw-answer .msg .opsw-k { margin-top: 6px; }
.opsw-hint { margin: 0; }
.opsw-pick { position: relative; }
.opsw-pick[hidden] { display: none; }
.opsw-pick .opsw-results { margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; max-height: 240px; overflow-y: auto; background: var(--panel); }
.opsw-upd { display: flex; flex-direction: column; gap: 8px; }
.opsw-upd[hidden] { display: none; }
.opsw-upd textarea { resize: vertical; }
.opsw-ok { color: var(--ok); margin: 0; }
.opsw-upd-result:empty { display: none; }

/* dictation button while listening */
[data-dictate].listening { border-color: var(--crit); color: var(--crit); background: var(--crit-soft); animation: opsw-pulse 1.2s ease-in-out infinite; }
@keyframes opsw-pulse { 50% { box-shadow: 0 0 0 4px var(--crit-soft); } }

/* to-do quick add + preview */
.todo-quick { display: flex; flex-direction: column; gap: 10px; }
.todo-quick-row { display: flex; gap: 8px; }
.todo-quick-row input { flex: 1; }
.todo-preview[hidden] { display: none; }
.todo-prev { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.opsw .todo-prev .row2, .opsw .todo-prev .row3 { grid-template-columns: 1fr; }
.todo-prev-rec { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.todo-prev-rec .opsw-pick { flex-basis: 100%; }

/* /todos page */
.todo-sec.crit h2 { color: var(--crit); }
.todo-list .todo-item { align-items: flex-start; flex-wrap: nowrap; }
.todo-list .todo-item > form .check, .todo-list .todo-item > .check { margin-top: 2px; }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-weight: 500; overflow-wrap: anywhere; }
.todo-item.done .todo-title { text-decoration: line-through; color: var(--muted); }
.todo-meta { color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; }
.todo-edit { flex: none; }
.todo-edit summary { margin: 0; }
.todo-edit[open] { flex-basis: 100%; order: 5; }
.todo-list .todo-item:has(.todo-edit[open]) { flex-wrap: wrap; }
.todo-done > summary { font-weight: 700; color: var(--ink); margin: 0; }

/* record page: Updates card */
.upd-form { margin-bottom: 12px; }
.upd-form textarea { resize: vertical; }
.upd-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.upd-tools input[type=file] { flex: 1; min-width: 160px; font-size: 13px; }
.upd-list { list-style: none; padding: 0; margin: 0; }
.upd-list > li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.upd-list > li:target { background: var(--accent-soft); border-radius: 8px; padding: 10px; }
.upd-body { overflow-wrap: anywhere; }
.upd-files { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.upd-files img { max-width: 120px; max-height: 90px; border: 1px solid var(--line); border-radius: 6px; display: block; object-fit: cover; }
.upd-suggest { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 8px; background: var(--soft); border-left: 3px solid var(--accent); }
.upd-suggest p { margin: 0; }
.upd-suggest label.check { align-items: flex-start; font-size: 14px; }
.upd-suggest label.check input { margin-top: 3px; }
.upd-applied { list-style: none; padding: 0; margin: 0; color: var(--ok); }

@media (max-width: 640px) {
  .opsw { right: 12px; bottom: 12px; left: 12px; }
  .opsw-panel { width: 100%; max-height: calc(100vh - 96px); }
  .opsw-fab { width: 50px; height: 50px; }
  .todo-quick-row { flex-wrap: wrap; }
  .todo-quick-row input { flex-basis: 100%; }
}
@media print { .opsw { display: none !important; } }
