/* Sono client dashboard (mockup). Mobile-first; desktop layout at >= 960px.
   Same language as the landing page: black, Geist, white chat bubbles, quiet greys. */
@font-face { font-family: "Geist"; src: url("../assets/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #000;
  --card: #0d0d0d;
  --card-2: #141414;
  --line: #1f1f1f;
  --line-2: #2a2a2a;
  --fg: #fff;
  --text: #ececec;
  --muted: #9b9b9b;     /* 7.9:1 on black */
  --dim: #6f6f6f;
  --bar: #3a3a3a;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pad: 18px;
  --r: 22px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100svh; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.5; font-feature-settings: "tnum" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 10px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: #fff; color: #000; padding: 10px 14px; border-radius: 12px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.wrap { position: relative; z-index: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* ---------- header ---------- */
.top { position: relative; z-index: 2; padding-top: calc(14px + env(safe-area-inset-top)); }
.top::before { /* soft glow behind the greeting, like the landing hero */
  content: ""; position: absolute; left: 50%; top: -120px; width: 680px; height: 420px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255,255,255,.07), transparent 75%); pointer-events: none;
}
.top-row { display: flex; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--fg); font-weight: 650; font-size: 17px; letter-spacing: -.02em; }
.brand-mark { width: 24px; height: 24px; }
.preview-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 550; letter-spacing: .01em; color: #d9d9d9;
  padding: 5px 11px 5px 10px; border-radius: 999px; border: 1px dashed #4a4a4a; background: rgba(255,255,255,.04);
  white-space: nowrap;
}
.pdot { width: 6px; height: 6px; border-radius: 50%; background: #bdbdbd; }
.pill {
  font-size: 12.5px; font-weight: 500; color: #cfcfcf; text-decoration: none; white-space: nowrap;
  padding: 5px 11px; border: 1px solid #2c2c2c; border-radius: 999px; background: rgba(255,255,255,.03);
  transition: color .2s, border-color .2s, background .2s;
}
.pill:hover { color: #fff; border-color: #555; background: rgba(255,255,255,.08); }

.hello { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "m t" "r r"; align-items: center; column-gap: 14px; row-gap: 14px; margin-top: 20px; }
.hello-mascot { grid-area: m; width: 48px; height: 48px; filter: drop-shadow(0 10px 26px rgba(255,255,255,.14)); animation: float 6s var(--ease) infinite; }
.hello-mascot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mascot-eyes { transform-box: fill-box; transform-origin: center; animation: blink 5.5s infinite; }
.hello-text { grid-area: t; min-width: 0; }
.hello h1 { font-size: 29px; line-height: 1.05; font-weight: 700; letter-spacing: -.04em; color: var(--fg); }
.hello-sub { margin-top: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 0 7px; font-size: 13px; color: var(--muted); }
.hello-sub .last { flex-basis: 100%; }
.hello-sub > .sep { display: none; }
.hello-sub .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: ping 2.4s infinite; }
.sep { color: #555; margin: 0 2px; }
.goal-line { margin-top: 12px; font-size: 13px; color: var(--dim); }
.goal-line:empty { display: none; }

/* segmented range toggle */
.range { grid-area: r; justify-self: start; display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: #111; border: 1px solid var(--line-2); }
.range button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  min-width: 54px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 600; letter-spacing: -.01em;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.range button:hover { color: #fff; }
.range button[aria-pressed="true"] { background: #fff; color: #000; }

/* ---------- tabs ---------- */
.tabs-wrap {
  position: sticky; top: 0; z-index: 10; margin-top: 14px;
  background: rgba(0,0,0,.78); -webkit-backdrop-filter: saturate(140%) blur(14px); backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid #141414;
}
.tabs-inner { padding-left: 0; padding-right: 0; position: relative; }
.tabs-inner::before, .tabs-inner::after { content: ""; position: absolute; top: 0; bottom: 0; width: 28px; z-index: 2; pointer-events: none; transition: opacity .2s; }
.tabs-inner::before { left: 0; background: linear-gradient(90deg, #000, transparent); }
.tabs-inner::after { right: 0; background: linear-gradient(270deg, #000, transparent); }
.at-start .tabs-inner::before, .at-end .tabs-inner::after { opacity: 0; }
.tabs {
  display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  padding: 10px var(--pad); -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; scroll-snap-align: center; cursor: pointer; white-space: nowrap;
  height: 36px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line-2); background: #0b0b0b;
  color: #bdbdbd; font-size: 14px; font-weight: 550; letter-spacing: -.01em;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.tab:hover { color: #fff; border-color: #444; }
.tab[aria-selected="true"] { background: #fff; color: #000; border-color: #fff; }
.tab:focus-visible { outline-offset: 2px; border-radius: 999px; }

/* ---------- panels ---------- */
#panels { padding-top: 18px; padding-bottom: 8px; outline: none; }
.panel { outline: none; }
.panel.enter { animation: enter .38s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.layout, .col-side, .col-main, .ov { display: grid; gap: 14px; align-content: start; min-width: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.cc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.cc-titles { min-width: 0; }
.card h3 { font-size: 15px; font-weight: 650; letter-spacing: -.015em; color: var(--fg); }
.cc-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.readout { text-align: right; flex: none; line-height: 1.2; min-height: 34px; }
.readout strong { display: block; font-size: 17px; font-weight: 650; letter-spacing: -.02em; color: var(--fg); }
.readout span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sec-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--fg); letter-spacing: -.005em; margin: 4px 2px 10px; }
.sec-title span { font-size: 12px; font-weight: 450; color: var(--dim); }

/* Sono speaking: the written summary is a white chat bubble from the mascot */
.card.say { background: transparent; border: 0; padding: 0; border-radius: 0; }
.say-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px 2px; }
.say-mascot { width: 26px; height: 26px; }
.say-name { font-size: 13.5px; font-weight: 650; color: var(--fg); letter-spacing: -.01em; }
.say-kicker { font-size: 12.5px; color: var(--muted); }
.say-kicker::before { content: "·"; margin-right: 8px; color: #555; }
.say-bubble {
  position: relative; background: #fff; color: #111; border-radius: 6px var(--r) var(--r) var(--r);
  padding: 15px 17px 16px; font-size: 15.5px; line-height: 1.5; letter-spacing: -.008em;
  box-shadow: 0 12px 40px -18px rgba(255,255,255,.35);
}
.say-bubble p + p { margin-top: 7px; }
.say-bubble b { font-weight: 680; color: #000; }

/* stat tiles */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles-1 { grid-template-columns: minmax(0, 1fr); }
.tile { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 13px 13px 12px; min-width: 0; overflow: hidden; }
.tiles-3 .tile { padding: 12px 11px 11px; border-radius: 16px; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 20px; }
.tile-label { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles-3 .tile-label { font-size: 11.5px; }
.tile-value { margin-top: 6px; font-size: 26px; font-weight: 650; letter-spacing: -.04em; line-height: 1.05; color: var(--fg); white-space: nowrap; }
.tiles-3 .tile-value { font-size: 22px; }
.unit { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: -.01em; margin-left: 4px; }
.tiles-3 .unit { font-size: 12px; margin-left: 3px; }
.tile-sub { margin-top: 4px; font-size: 12px; color: var(--dim); line-height: 1.35; }
.tiles-3 .tile-sub { font-size: 11px; }
.chip { flex: none; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: #1d1d1d; color: #bdbdbd; white-space: nowrap; }
.chip.good { background: #fff; color: #000; }
.chip.bad { background: #1d1d1d; color: #9b9b9b; }
.tiles-3 .chip { display: none; }
.tile-spark { margin: 8px -2px -2px; height: 26px; }
.spark { width: 100%; height: 100%; display: block; overflow: visible; }
.spark path { fill: none; stroke: #8a8a8a; stroke-width: 1.6; stroke-linecap: round; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; touch-action: pan-y; border-radius: 12px; }
.chart:focus-visible { outline-offset: 4px; }
.chart-svg { display: block; overflow: visible; user-select: none; -webkit-user-select: none; }
.ax { fill: #777; font-size: 10.5px; font-family: var(--font); font-feature-settings: "tnum" 1; }
.grid line { stroke: #1c1c1c; stroke-width: 1; }
.target line { stroke: #9b9b9b; stroke-width: 1.2; stroke-dasharray: 3 4; }
.target-label { fill: #d0d0d0; font-size: 10.5px; font-weight: 600; font-family: var(--font); }
.target-chip { fill: #000; stroke: #333; }
.guide { stroke: #555; stroke-width: 1; }
.s-raw .dot { fill: #6b6b6b; }
.s-avg .ln { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.marker { fill: #fff; stroke: #000; stroke-width: 2; pointer-events: none; }
.marker.ring { fill: none; stroke: #fff; stroke-width: 1.6; }
.bar { transition: opacity .15s; }
.bar.hit { fill: #f2f2f2; }
.bar.miss { fill: var(--bar); }
.bar.neutral { fill: #cfcfcf; }
.bar-empty { fill: #222; }
.bars.scrub .bar { opacity: .45; }
.bars.scrub .bar.on { opacity: 1; }
.sdot { fill: #4a4a4a; }
.sdot.hi { fill: #e8e8e8; fill-opacity: .9; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.lg-title { color: var(--fg); font-weight: 600; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg i { display: inline-block; flex: none; }
.lg-dot { width: 7px; height: 7px; border-radius: 50%; background: #6b6b6b; }
.lg-line { width: 14px; height: 2.4px; border-radius: 2px; background: #fff; }
.lg-dash { width: 14px; height: 0; border-top: 1.5px dashed #9b9b9b; }
.lg-hit { width: 9px; height: 9px; border-radius: 3px; background: #f2f2f2; }
.lg-miss { width: 9px; height: 9px; border-radius: 3px; background: var(--bar); }
.lg-cal-none, .lg-cal-l0, .lg-cal-l1, .lg-cal-l2, .lg-cal-l3 { width: 10px; height: 10px; border-radius: 3px; }
.lg-cal-none { background: #111; box-shadow: inset 0 0 0 1px #262626; }
.lg-cal-l0 { background: #161616; box-shadow: inset 0 0 0 1.5px #6a6a6a; }
.lg-cal-l1 { background: #3a3a3a; } .lg-cal-l2 { background: #8a8a8a; } .lg-cal-l3 { background: #f2f2f2; }

.mini + .mini { margin-top: 6px; padding-top: 8px; border-top: 1px solid #161616; }
.mini-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; }
.mini-name { color: var(--fg); font-weight: 600; }
.mini-ro { color: var(--muted); }
.mini-ro strong { color: var(--fg); font-weight: 650; font-size: 14px; }

/* PR list */
.pr-list { list-style: none; margin: 0; padding: 0; }
.pr-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #191919; }
.pr-list li:first-child { border-top: 0; padding-top: 4px; }
.pr-badge { flex: none; width: 34px; height: 26px; display: grid; place-items: center; border-radius: 9px 9px 9px 3px; background: #fff; color: #000; font-size: 10.5px; font-weight: 750; letter-spacing: .02em; }
.pr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pr-ex { font-size: 14.5px; font-weight: 600; color: var(--fg); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-meta { font-size: 12px; color: var(--dim); }
.pr-val { flex: none; text-align: right; font-size: 15.5px; font-weight: 650; color: var(--fg); letter-spacing: -.02em; }
.pr-val small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.more, .empty { font-size: 13px; color: var(--muted); margin-top: 8px; }
.empty { padding: 18px 0; text-align: center; }

/* overview: on phones the two columns dissolve into one ordered stack */
.ov-col { display: contents; }
.ov-recap { order: 1; } .ov-tiles { order: 2; } .ov-cal { order: 3; } .ov-notes { order: 4; }

/* check-in calendar */
.cal-wrap { --cell: 17px; --gap: 3px; display: flex; flex-direction: column; gap: 14px; }
.cal-grid { display: flex; gap: 6px; }
.cal-dow { display: grid; grid-template-rows: repeat(7, var(--cell)); gap: var(--gap); font-size: 9.5px; color: var(--dim); line-height: var(--cell); width: 10px; flex: none; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, var(--cell)); grid-auto-columns: var(--cell); gap: var(--gap); }
.cal-stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cal-stats div { border-left: 1px solid #262626; padding-left: 10px; }
.cal-stats dt { font-size: 11.5px; color: var(--muted); }
.cal-stats dd { margin: 1px 0 0; font-size: 20px; font-weight: 650; letter-spacing: -.03em; color: var(--fg); line-height: 1.15; }
.cal-stats small { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
@media (min-width: 400px) { .cal-wrap { --cell: 19px; --gap: 4px; } }
.cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 40px)); gap: 6px; }
.cw-day { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cw-day .cal-c { width: 100%; aspect-ratio: 1; border-radius: 9px; }
.cw-l { font-size: 11px; color: var(--muted); }
.cal-c { border-radius: 5px; background: #121212; box-shadow: inset 0 0 0 1px #2a2a2a; }
.cal-c.out { background: transparent; box-shadow: none; }
.cal-c.l0 { background: #161616; box-shadow: inset 0 0 0 1.5px #6a6a6a; }
.cal-c.l1 { background: #3a3a3a; box-shadow: none; }
.cal-c.l2 { background: #8a8a8a; box-shadow: none; }
.cal-c.l3 { background: #f2f2f2; box-shadow: none; }

/* client notes look like the client's own Telegram messages */
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.notes li { display: flex; flex-direction: column; align-items: flex-end; }
.note-bubble { max-width: 88%; background: #1c1c1c; color: #eee; border: 1px solid #262626; padding: 9px 13px; border-radius: 18px 18px 5px 18px; font-size: 14px; line-height: 1.4; }
.note-date { font-size: 11.5px; color: var(--dim); margin: 4px 6px 0 0; }

/* "not tracked yet" */
.nt { background: #0a0a0a; border-style: dashed; border-color: #2a2a2a; }
.nt-row { display: flex; gap: 14px; align-items: flex-start; }
.nt-mascot { flex: none; width: 34px; height: 34px; opacity: .9; }
.nt h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.nt p { margin-top: 4px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.nt-compact .nt-mascot { width: 26px; height: 26px; }
.nt-pill { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .01em; color: #bdbdbd; border: 1px dashed #4a4a4a; border-radius: 999px; padding: 1px 8px; }
.nt-inline { margin-top: 12px; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nt-ov { margin: 10px 2px 0; }
.logout { margin: 0; }
.logout button { cursor: pointer; }

/* ---------- footer ---------- */
.foot { display: flex; flex-direction: column; gap: 6px; padding-top: 22px; padding-bottom: calc(26px + env(safe-area-inset-bottom)); font-size: 12.5px; color: var(--dim); }
.foot a { text-underline-offset: 3px; }
.foot a:hover { color: #fff; }
.foot-badge { display: inline-block; font-size: 11px; font-weight: 600; color: #cfcfcf; border: 1px dashed #4a4a4a; border-radius: 999px; padding: 1px 8px; margin-right: 4px; }

/* ---------- small phones ---------- */
@media (max-width: 370px) {
  .preview-pill { font-size: 11px; padding: 4px 9px; }
  .pill { display: none; }
  .tiles-3 .tile-value { font-size: 19px; }
}

/* ---------- tablet+ ---------- */
@media (min-width: 640px) {
  :root { --pad: 28px; }
  .tiles-ov { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hello { grid-template-columns: auto 1fr auto; grid-template-areas: "m t r"; }
  .range { justify-self: end; }
}

/* ---------- desktop ---------- */
@media (min-width: 960px) {
  :root { --pad: 40px; --r: 24px; }
  body { font-size: 15.5px; }
  .top { padding-top: 26px; }
  .hello { margin-top: 34px; column-gap: 18px; }
  .hello-mascot { width: 64px; height: 64px; }
  .hello h1 { font-size: 40px; }
  .hello-sub { font-size: 14px; }
  .hello-sub .last { flex-basis: auto; }
  .hello-sub > .sep { display: inline; }
  .goal-line { padding-left: calc(var(--pad) + 64px + 18px); margin-top: 4px; }
  .tabs-wrap { margin-top: 22px; }
  .tabs { padding-top: 12px; padding-bottom: 12px; }
  #panels { padding-top: 24px; }
  .layout { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
  .col-side { position: sticky; top: 84px; gap: 14px; }
  .col-main { gap: 16px; }
  .card { padding: 20px 22px; }
  .card h3 { font-size: 16px; }
  .readout strong { font-size: 19px; }
  .tiles-3 .tile-value { font-size: 24px; }
  .ax { font-size: 11px; }
  .ov { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
  .ov-col { display: grid; gap: 20px; align-content: start; min-width: 0; }
  .cal-wrap { --cell: 24px; --gap: 5px; flex-direction: row; justify-content: space-between; gap: 20px; }
  .cal-stats { grid-template-columns: 1fr; min-width: 150px; gap: 16px; align-content: start; }
  .cal-stats dd { font-size: 24px; }
  .foot { flex-direction: row; justify-content: space-between; }
}

/* ---------- motion ---------- */
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); } 70%, 100% { box-shadow: 0 0 0 7px rgba(255,255,255,0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.still *, .still *::before, .still *::after { animation: none !important; transition: none !important; }
