/* Systemwise owner tools. Frosted-glass panels over a live weather background (weather.js).
   Brand tokens match the public site. Panels stay mostly opaque so text keeps its contrast in every weather. */
:root {
  --blue: #0057FF; --blue-ink: #0047D1; --blue-soft: #E6EEFF;
  --ink: #0A0A0A; --body: #2F3644; --muted: #3A4150; --link: #0047D1;
  --track: rgba(10, 10, 10, .1); --hover: rgba(255, 255, 255, .7);
  --line: rgba(10, 10, 10, .09); --field: #D5DBE5;
  --good: #0E8A4F; --good-ink: #0B6E3F; --good-soft: #E3F5EC;
  --warn-ink: #7A4800; --warn-soft: #FFF2DC;
  --bad: #C2302B; --bad-ink: #A8261F; --bad-soft: #FDE9E8;
  --purple-ink: #5B2BC4; --purple-soft: #EFE8FF;
  --grey-ink: #454D5C; --grey-soft: #EEF1F6;
  --glass: rgba(255, 255, 255, .84); --glass-strong: rgba(255, 255, 255, .92);
  /* Real glass: mostly see-through, tinted by the sky behind it. weather.js sets these per scene. */
  --glass-tint: rgba(255, 255, 255, .62); --glass-side: rgba(255, 255, 255, .55); --glass-top: rgba(255, 255, 255, .5);
  --glass-soft: rgba(255, 255, 255, .5);
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .38) 0%, rgba(255, 255, 255, .06) 38%, rgba(255, 255, 255, 0) 100%);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: #1E2638; color: var(--body); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 600; letter-spacing: -0.02em; }
a { color: var(--link); }
a:hover { color: var(--link); text-decoration-thickness: 2px; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-size: 13px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* Weather canvas sits behind everything */
#wx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }

/* Glass */
.glass, .card { background: var(--sheen), var(--glass-tint); -webkit-backdrop-filter: blur(30px) saturate(150%); backdrop-filter: blur(30px) saturate(150%); border: 1px solid rgba(255, 255, 255, .55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65), inset 0 -1px 0 rgba(255, 255, 255, .12), 0 12px 40px -18px rgba(5, 10, 30, .45); border-radius: 20px; transition: background-color .8s; }
.glass { padding: 18px 22px; }
.card { padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card h2 { font-size: 16px; }
.inset { background: var(--glass-soft); border-radius: 14px; padding: 14px 16px; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass, .card { background: var(--glass-strong); } }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; font-weight: 500; font-size: 14px; line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.b-ink, .b-ink:hover { background: #0A0A0A; color: #fff; }
.b-blue, .b-blue:hover { background: var(--blue); color: #fff; }
.b-ghost, .b-ghost:hover { background: #fff; color: var(--ink); border-color: var(--field); }
.b-ghost:not(:disabled):hover { border-color: var(--ink); }
.b-danger, .b-danger:hover { background: #fff; color: var(--bad-ink); border-color: #F3C9C6; }
.link { background: none; border: 0; padding: 0; color: var(--blue-ink); font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: underline; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 9px; white-space: nowrap; line-height: 1.3; }
.c-blue { background: var(--blue-soft); color: var(--blue-ink); }
.c-good { background: var(--good-soft); color: var(--good-ink); }
.c-warn { background: var(--warn-soft); color: var(--warn-ink); }
.c-bad { background: var(--bad-soft); color: var(--bad-ink); }
.c-grey { background: var(--grey-soft); color: var(--grey-ink); }
.c-purple { background: var(--purple-soft); color: var(--purple-ink); }
.c-white { background: rgba(255, 255, 255, .92); color: var(--ink); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .lab { font-size: 13px; font-weight: 600; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=date], input[type=datetime-local], input[type=tel], select, textarea {
  width: 100%; border: 1px solid var(--field); background: #fff; color: var(--ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.4;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 87, 255, .14); }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.err { color: var(--bad-ink); font-size: 14px; }
.saved { font-size: 12px; color: var(--muted); }

/* Tabs and segmented controls */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab { border: 1px solid var(--field); background: #fff; color: var(--body); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; cursor: pointer; }
.tab[aria-pressed=true] { background: #0A0A0A; color: #fff; border-color: var(--ink); }
.seg { display: inline-flex; gap: 4px; background: #fff; padding: 4px; border-radius: 999px; border: 1px solid rgba(10, 10, 10, .08); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 500; font-size: 14px; color: var(--body); cursor: pointer; }
.seg button[aria-pressed=true] { background: #0A0A0A; color: #fff; }

/* ---------- Sign in ---------- */
.signin { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; padding: 48px 20px; }
.signin form { width: min(420px, 100%); background: #fff; border-radius: 24px; padding: 32px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 30px 80px -30px rgba(0, 20, 110, .6); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; color: var(--ink); letter-spacing: -0.02em; text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.digits { display: flex; gap: 8px; justify-content: space-between; }
.digits input { width: 48px; height: 56px; text-align: center; font-size: 22px; font-weight: 600; padding: 0; }

/* ---------- App shell ---------- */
.shell { position: relative; isolation: isolate; min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 236px; background: var(--sheen), var(--glass-side); -webkit-backdrop-filter: blur(32px) saturate(150%); backdrop-filter: blur(32px) saturate(150%); border-right: 1px solid rgba(255, 255, 255, .45); box-shadow: inset -1px 0 0 rgba(255, 255, 255, .25); padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.side { transition: flex-basis .35s cubic-bezier(.2, .8, .2, 1), padding .35s; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 12px 8px; }
.side .brand { padding: 0; min-width: 0; }
.side-toggle { width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.side-toggle:hover { background: var(--hover); color: var(--ink); }
.side-toggle svg { width: 19px; height: 19px; }
.side .brand small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--body); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current=page] { color: var(--ink); font-weight: 600; }
.nav a[aria-current=page] svg { color: var(--blue); }
html.glass-dark .nav a[aria-current=page] svg { color: #9CC2FF; }
.nav svg, .ico { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--blue); color: #fff; }
.navlab { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; display: flex; justify-content: space-between; align-items: center; }
.navlab a { text-transform: none; letter-spacing: 0; font-weight: 500; text-decoration: none; }
.sproj { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.sproj:hover { background: var(--hover); color: var(--ink); }
.sproj .sp-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 1.3; }
.sproj .sp-top b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sproj .sp-top span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.track { display: block; height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.track > span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--blue); transition: width 1.4s cubic-bezier(.2, .8, .2, 1); }
.ai-pill { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--glass-soft); text-decoration: none; color: var(--ink); margin-top: auto; }
.ai-pill:hover { color: var(--ink); background: var(--hover); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; }
.dot.off { background: #9AA3B2; }

.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; background: var(--glass-top); -webkit-backdrop-filter: blur(32px) saturate(150%); backdrop-filter: blur(32px) saturate(150%); border-bottom: 1px solid rgba(255, 255, 255, .45); }
.search { position: relative; flex: 1 1 260px; max-width: 460px; }
.search svg { position: absolute; left: 13px; top: 11px; color: var(--muted); }
.search input { padding-left: 40px; border-radius: 999px; background: rgba(255, 255, 255, .9); border-color: transparent; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border-radius: 16px; box-shadow: 0 20px 50px -20px rgba(10, 20, 60, .45); padding: 6px; z-index: 20; max-height: 360px; overflow: auto; }
.results a { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.results a:hover, .results a:focus { background: var(--blue-soft); outline: none; }
.results small { color: var(--muted); }
.top .right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page { padding: 28px; display: flex; flex-direction: column; gap: 18px; max-width: 1260px; width: 100%; }
@media (max-width: 640px) { .page { padding: 16px; } .top { padding: 12px 16px; } }
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.head h1 { font-size: 30px; }
.head p { font-size: 14px; color: var(--muted); }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .list-col { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.split > .detail { flex: 999 1 540px; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > * { flex: 1 1 380px; min-width: 0; }
.split > * { min-width: 0; }

/* Lists */
.item { text-align: left; width: 100%; background: var(--sheen), var(--glass-tint); -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%); border: 1px solid rgba(255, 255, 255, .55); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; color: inherit; font: inherit; }
a.item, a.item:hover { text-decoration: none; color: inherit; }
.item:hover { border-color: var(--field); }
.item[aria-current=true] { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 87, 255, .12); }
.item .r { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.item b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item p { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 28px 20px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* Tables */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: rgba(0, 87, 255, .04); }
.tbl tbody tr[aria-selected=true] td { background: rgba(0, 87, 255, .07); }
.tbl b { color: var(--ink); font-weight: 600; }

/* Stage bars (Projects) */
.stages { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.stage { display: flex; flex-direction: column; gap: 6px; min-width: 0; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font: inherit; }
.stage .bar { display: block; height: 10px; border-radius: 5px; background: var(--track); overflow: hidden; }
.stage .bar > span { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--blue); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.stage .lbl { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage.done .lbl { color: var(--body); }
.stage.cur .lbl { color: var(--ink); font-weight: 600; }
.stage.cur .bar { animation: sw-pulse 1.8s ease-out infinite; }
.stage:hover .bar { outline: 2px solid rgba(0, 87, 255, .25); outline-offset: 1px; }
.support .stage .bar > span { background: var(--good); }
@keyframes sw-pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 87, 255, .45); } 100% { box-shadow: 0 0 0 8px rgba(0, 87, 255, 0); } }

/* Pipeline tiles (Today) */
.pipe { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.pipe li a { background: var(--glass-soft); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--body); }
.pipe li a:hover { background: var(--hover); }
.big { font-size: 26px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.next li { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.next { list-style: none; margin: 0; padding: 0; }
.next .what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.next .what b { color: var(--ink); font-weight: 600; }
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tool { background: var(--glass-soft); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--body); border: 1px solid transparent; }
.tool:hover { border-color: var(--blue); color: var(--body); }
.tool .ic { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--blue); display: grid; place-items: center; }
.tool b { color: var(--ink); font-weight: 600; }

/* Claude panels */
.ai { background: var(--blue-soft); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.ai .t { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.ai .out { white-space: pre-wrap; color: var(--ink); font-size: 14px; line-height: 1.6; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0, 87, 255, .25); border-top-color: var(--blue); animation: sw-spin .8s linear infinite; flex: none; }
@keyframes sw-spin { to { transform: rotate(360deg); } }

/* Quote numbers */
.money { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.money > div { background: var(--glass-soft); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.money .good { background: var(--good-soft); }
.money .good .big { color: var(--good-ink); }
.compare { display: flex; flex-direction: column; gap: 12px; }
.compare .lab2 { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink); gap: 10px; }
.compare .bar { height: 14px; border-radius: 7px; background: var(--track); overflow: hidden; }
.compare .bar span { display: block; height: 100%; border-radius: 7px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.items td { padding: 8px 6px; vertical-align: top; }
.items td input, .items td select { padding: 8px 8px; }

/* Contract paper */
.paper { background: #fff; border-radius: 20px; padding: 40px 44px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 40px -18px rgba(10, 20, 60, .35); color: #2A303A; }
.paper h2 { font-size: 24px; }
.paper h3 { font-size: 15px; margin-top: 6px; }
.paper p { font-size: 14px; line-height: 1.65; white-space: pre-wrap; }
@media (max-width: 640px) { .paper { padding: 24px 20px; } }
.tpl { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--field); border-radius: 14px; cursor: pointer; background: #fff; }
.tpl:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 87, 255, .12); }
.tpl input { margin-top: 3px; accent-color: var(--blue); }
.stepnum { width: 26px; height: 26px; border-radius: 50%; background: #0A0A0A; color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
.flag { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }

/* Option cards (AI connection) */
.opt { flex: 1 1 340px; text-align: left; background: var(--glass-strong); border: 2px solid rgba(255, 255, 255, .7); border-radius: 20px; padding: 22px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; font: inherit; color: var(--body); }
.opt[aria-pressed=true] { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 87, 255, .12); }
.opt ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink); }

/* Dialog */
dialog { border: 0; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px -20px rgba(0, 20, 60, .5); }
dialog::backdrop { background: rgba(10, 16, 32, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
dialog h2 { font-size: 20px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: #0A0A0A; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 50; max-width: calc(100vw - 32px); }

/* Insights (kept from the first dashboard) */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--sheen), var(--glass-tint); -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%); border: 1px solid rgba(255, 255, 255, .55); border-radius: 16px; padding: 14px 16px; display: grid; gap: 2px; }
.tile b { font-size: 26px; color: var(--ink); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile small { color: var(--muted); font-size: 12px; }
.tile.alert b { color: var(--bad); }
.notice { background: var(--warn-soft); color: #6B4300; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; gap: 4px; }
.bar-row .lab { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--ink); font-weight: 400; }
.bar-row .lab span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-row .tr { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; }
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 36px; }
@media (max-width: 900px) { .qa-grid { grid-template-columns: 1fr; } }
.top-ans .lab span:first-child { font-weight: 600; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .col:focus { outline: none; }
.tip { position: absolute; pointer-events: none; background: #0A0A0A; color: #fff; font-size: 13px; padding: 8px 10px; border-radius: 10px; white-space: nowrap; transform: translate(-50%, calc(-100% - 8px)); z-index: 3; line-height: 1.45; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin: 0; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }
.facts div { display: grid; gap: 2px; min-width: 0; }
.facts dt { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.quote { background: var(--glass-soft); border-radius: 14px; padding: 14px 16px; color: var(--ink); white-space: pre-wrap; }
.s-new { background: var(--blue-soft); color: var(--blue-ink); } .s-replied { background: var(--good-soft); color: var(--good-ink); }
.s-booked { background: var(--purple-soft); color: var(--purple-ink); } .s-closed { background: var(--grey-soft); color: var(--grey-ink); }
.due-ok { background: var(--grey-soft); color: var(--body); } .due-soon { background: var(--warn-soft); color: var(--warn-ink); } .due-late { background: var(--bad-soft); color: var(--bad-ink); }

/* Print: quotes and contracts print on plain paper */
@media print {
  body { background: #fff; }
  #wx, .side, .top, .noprint { display: none !important; }
  .page { padding: 0; max-width: none; }
  .glass, .card, .paper { box-shadow: none; border: 0; background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .track > span, .stage .bar > span, .compare .bar span { transition: none; }
  .stage.cur .bar, .spin { animation: none; }
}

/* Phones: the menu becomes one scrolling row above the page */
@media (max-width: 760px) {
  .side { flex-basis: 100%; min-width: 0; max-width: 100%; padding: 10px 12px; gap: 6px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, .6); }
  .side .brand { padding: 2px 4px 4px; font-size: 16px; }
  .side .brand svg { width: 28px; height: 28px; }
  .side .brand small, .navlab, .sproj, .side > .ai-pill, .side > p.muted { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; scrollbar-width: none; }
  .nav a { white-space: nowrap; min-height: 38px; padding: 0 12px; flex: none; }
  .top { position: static; }
  .cols > *, .split > .list-col, .split > .detail { flex-basis: 100%; }
  .head h1 { font-size: 26px; }
  .card, .glass { padding: 16px; }
}

/* Dark skies (night, rain, storms): smoky see-through glass with light text, so the sky's colour shows
   through instead of being washed out by white frosting. weather.js switches this on per scene. */
html.glass-dark {
  --ink: #FFFFFF; --body: rgba(255, 255, 255, .9); --muted: rgba(255, 255, 255, .76); --link: #B9D2FF;
  --line: rgba(255, 255, 255, .16); --track: rgba(255, 255, 255, .2); --hover: rgba(255, 255, 255, .14);
}
html.glass-dark .glass, html.glass-dark .card, html.glass-dark .item, html.glass-dark .tile, html.glass-dark .side, html.glass-dark .top { border-color: rgba(255, 255, 255, .22); }
html.glass-dark .glass, html.glass-dark .card { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 14px 44px -18px rgba(0, 0, 0, .55); }
html.glass-dark .search input { background: rgba(255, 255, 255, .92); }
/* Light "islands" stay dark-on-light whatever the sky: paper, forms, menus, dialogs, chips and Claude panels. */
.paper, .tpl, dialog, .results, .opt, .tab, .seg, .ai, .money .good, .notice, .b-ghost, .c-white, .signin form, .inset-light,
input, select, textarea {
  --ink: #0A0A0A; --body: #2F3644; --muted: #3A4150; --link: #0047D1; --line: rgba(10, 10, 10, .09); --track: rgba(10, 10, 10, .1); --hover: rgba(10, 10, 10, .05);
}
@media print { html.glass-dark { --ink: #0A0A0A; --body: #2F3644; --muted: #3A4150; --line: rgba(10, 10, 10, .09); } }

/* Liquid-glass lens: a clear, bright-edged capsule behind the current page. It glides (and stretches a little)
   to whatever you point at, squishes when pressed, and its glint follows the pointer. */
.lens { position: absolute; left: 0; top: 0; z-index: 0; width: 0; height: 40px; border-radius: 12px; pointer-events: none; opacity: 0;
  --mx: 30%; --my: 0%; --sx: 1; --sy: 1;
  background:
    radial-gradient(120% 90% at var(--mx) var(--my), rgba(255, 255, 255, .75), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, rgba(255, 255, 255, .5) 0%, rgba(255, 255, 255, .16) 55%, rgba(255, 255, 255, .28) 100%);
  -webkit-backdrop-filter: blur(3px) saturate(200%) brightness(1.06); backdrop-filter: blur(3px) saturate(200%) brightness(1.06);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .95), inset 0 -1px 1px rgba(255, 255, 255, .45), inset 1px 0 1px rgba(160, 200, 255, .5),
    inset -1px 0 1px rgba(255, 190, 230, .35), inset 0 0 0 1px rgba(255, 255, 255, .4), 0 8px 22px -10px rgba(0, 40, 140, .55), 0 1px 3px rgba(0, 30, 90, .18);
  transition: transform .55s cubic-bezier(.3, 1.45, .55, 1), width .45s cubic-bezier(.3, 1.3, .55, 1), height .45s cubic-bezier(.3, 1.3, .55, 1), opacity .2s, scale .25s cubic-bezier(.3, 1.6, .5, 1);
  scale: 1 1; }
.lens::after { content: ""; position: absolute; inset: 1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(100deg, rgba(120, 180, 255, .18), rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0) 70%, rgba(255, 160, 220, .14)); }
.lens.moving { scale: var(--sx) var(--sy); }
.lens.pressed { scale: .95 .9; }
.lens.still { transition: none; }
html.glass-dark .lens {
  background:
    radial-gradient(120% 90% at var(--mx) var(--my), rgba(255, 255, 255, .38), rgba(255, 255, 255, 0) 55%),
    linear-gradient(180deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, .05) 55%, rgba(255, 255, 255, .1) 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .7), inset 0 -1px 1px rgba(255, 255, 255, .2), inset 1px 0 1px rgba(160, 200, 255, .4),
    inset -1px 0 1px rgba(255, 190, 230, .3), inset 0 0 0 1px rgba(255, 255, 255, .22), 0 8px 22px -10px rgba(0, 0, 0, .6); }
@media (prefers-reduced-motion: reduce) { .lens { transition: opacity .2s; } .lens.moving, .lens.pressed { scale: 1 1; } }

/* Project rings, shown when the sidebar is collapsed */
.pring { display: none; width: 34px; height: 34px; border-radius: 50%; flex: none; place-items: center;
  background: conic-gradient(var(--blue) calc(var(--p) * 1%), var(--track) 0); }
.pring.done { background: conic-gradient(var(--good) calc(var(--p) * 1%), var(--track) 0); }
.pring i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 700; color: var(--ink); background: var(--glass-soft); }

/* Collapsed sidebar: an icon rail (computers only; phones keep the scrolling strip) */
@media (min-width: 761px) {
  html.side-collapsed .side { flex: 0 0 76px; padding: 20px 10px; align-items: stretch; }
  html.side-collapsed .side .txt, html.side-collapsed .nav .count, html.side-collapsed .sp-top, html.side-collapsed .sproj .track { display: none !important; }
  html.side-collapsed .side-head { flex-direction: column; padding: 0 0 10px; gap: 10px; }
  html.side-collapsed .nav a { justify-content: center; padding: 0; }
  html.side-collapsed .navlab { padding: 10px 6px 6px; font-size: 0; }
  html.side-collapsed .navlab::after { content: ""; display: block; height: 1px; width: 100%; background: var(--line); }
  html.side-collapsed .nav a .count, html.side-collapsed .nav a:has(.count)::after { display: block; }
  html.side-collapsed .nav a:has(.count)::after { content: ""; position: absolute; top: 8px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); }
  html.side-collapsed .nav a .count { display: none; }
  html.side-collapsed .sproj { align-items: center; padding: 6px 0; }
  html.side-collapsed .pring { display: grid; }
  html.side-collapsed .ai-pill { justify-content: center; padding: 14px 0; }
}
@media (max-width: 760px) { .side-toggle { display: none; } .nav { flex-direction: row; } }
