/* Связка — design system.
   One vertical phone-width layout everywhere (site == MAX Mini App). Depth comes from surfaces and light, not outlines:
   borders are kept only where they carry meaning (inputs, data rows, timeline). */

:root {
  --bg: #050507;
  --col: 460px;
  --s1: rgba(255, 255, 255, .045);
  --s2: rgba(255, 255, 255, .075);
  --s3: rgba(255, 255, 255, .12);
  --panel: #0f0f14;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .13);
  --text: #f4f4f6;
  --muted: rgba(244, 244, 246, .6);
  --faint: rgba(244, 244, 246, .38);
  --accent: #e6f56b;
  --danger: #ff6b5e;
  --ok: #7ee0b5;
  --warn: #ffc65c;
  --pink: #e8479d;
  --teal: #35c8b6;
  --violet: #7d5cff;
  --blue: #3561ff;
  --orange: #ff5b2e;
  --r-xl: 30px;
  --r-l: 22px;
  --r-m: 16px;
  --radius: var(--r-xl);
  --radius-s: var(--r-l);
  --lift: inset 0 1px 0 rgba(255, 255, 255, .06);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --dots: var(--font);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
html { background: #020203; }
body { color: var(--text); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; background: transparent; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.02em; }
h1 { font-size: 32px; line-height: 1.08; }
h2 { font-size: 21px; line-height: 1.2; }
h3 { font-size: 16px; line-height: 1.3; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.mono { font-family: var(--font); font-weight: 600; font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- ambient background (outside the column on desktop) */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(30% 35% at 22% 25%, rgba(125, 92, 255, .22), transparent 70%),
    radial-gradient(28% 32% at 80% 72%, rgba(232, 71, 157, .15), transparent 70%),
    radial-gradient(24% 30% at 78% 18%, rgba(53, 200, 182, .11), transparent 70%);
  animation: ambient 40s ease-in-out infinite alternate;
}
@keyframes ambient { to { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.06); } }

/* ---------------------------------------------------------------- shell */
.shell, .login {
  position: relative; width: 100%; max-width: var(--col); margin: 0 auto; min-height: 100vh; background-color: var(--bg);
  background-image: radial-gradient(rgba(255, 255, 255, .065) 1px, transparent 1.2px); background-size: 16px 16px;
}
@media (min-width: 520px) { .shell, .login { box-shadow: 0 0 0 1px rgba(255, 255, 255, .03), 0 0 140px rgba(0, 0, 0, .9); } }
.side { display: none; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 12px; flex: none; background:
  radial-gradient(circle at 30% 30%, #fff 0 2px, transparent 2.5px),
  radial-gradient(circle at 70% 30%, #fff 0 2px, transparent 2.5px),
  radial-gradient(circle at 50% 70%, #fff 0 2px, transparent 2.5px),
  radial-gradient(120% 120% at 50% 100%, var(--violet), #1c1440); box-shadow: 0 0 24px rgba(125, 92, 255, .45); }
.brand b { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }

.main { min-width: 0; width: 100%; padding: calc(22px + env(safe-area-inset-top)) 16px calc(116px + env(safe-area-inset-bottom)); }

/* topbar: control row + large title below (like the references) */
.topbar { margin-bottom: 20px; }
.topbar-row { display: flex; align-items: center; gap: 10px; min-height: 46px; }
.topbar-row .kicker { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-row .btn { flex: none; padding: 8px 14px; min-height: 40px; font-size: 14px; }
.topbar h1 { margin-top: 14px; font-size: 32px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.topbar.sub h1 { font-size: 27px; margin-top: 12px; }

.round {
  width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--s2); box-shadow: var(--lift);
  display: inline-grid; place-items: center; cursor: pointer; flex: none; text-decoration: none; position: relative; color: var(--text);
  transition: background .2s var(--ease), transform .25s var(--spring);
}
.round:hover { background: var(--s3); }
.round svg { width: 20px; height: 20px; }
.round.sm-round { width: 36px; height: 36px; }
.round.sm-round svg { width: 18px; height: 18px; }
.round .badge { position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent);
  color: #000; font-size: 10px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg); }

.avatar {
  --h: 255;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 15px; flex: none;
  color: #fff; text-decoration: none; letter-spacing: .02em; text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  background: radial-gradient(120% 120% at 30% 10%, hsl(var(--h) 95% 80%), hsl(var(--h) 70% 52%) 55%, hsl(var(--h) 65% 30%));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .35), inset 0 -6px 12px rgba(0, 0, 0, .18), 0 6px 18px hsl(var(--h) 80% 40% / .35);
  transition: transform .25s var(--spring);
}
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.avatar.lg { width: 74px; height: 74px; font-size: 24px; }

/* tab bar with a sliding active pill */
.tabbar {
  display: flex; position: fixed; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30;
  left: max(12px, calc(50% - var(--col) / 2 + 12px)); right: max(12px, calc(50% - var(--col) / 2 + 12px));
  background: rgba(20, 20, 26, .78); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border-radius: 28px; padding: 6px; box-shadow: var(--lift), 0 20px 50px rgba(0, 0, 0, .55);
}
.tab-pill { position: absolute; top: 6px; bottom: 6px; left: 0; width: 0; border-radius: 22px; background: rgba(255, 255, 255, .12);
  box-shadow: var(--lift); transition: transform .45s var(--spring), width .45s var(--spring), opacity .2s; opacity: 0; pointer-events: none; }
.tabbar a { position: relative; z-index: 1; flex: 1; display: grid; justify-items: center; gap: 2px; padding: 7px 2px; border-radius: 22px;
  text-decoration: none; color: var(--muted); font-size: 11px; transition: color .25s var(--ease); }
.tabbar a:hover, .tabbar a.active { color: var(--text); }
.tabbar a svg { width: 22px; height: 22px; transition: transform .35s var(--ease); }
.tabbar a.active svg { transform: translateY(-1px); }

/* ---------------------------------------------------------------- grids */
.grid { display: grid; gap: 12px; }
.grid.two, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three, .grid.two.stack-sm { grid-template-columns: 1fr; }
.grid.three:has(> .card.tight) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid.three > .card.tight { padding: 14px 12px; border-radius: var(--r-l); }
.grid.three > .card.tight .mid-dots { font-size: 30px; }
.grid.three > .card.tight .small { font-size: 12px; line-height: 1.25; }
.span-2 { grid-column: auto; }

/* ---------------------------------------------------------------- cards */
.card {
  position: relative; border-radius: var(--r-xl); padding: 20px; min-width: 0; overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .025)), var(--panel);
  box-shadow: var(--lift);
}
.card.tight { padding: 16px; }
.card.link { cursor: pointer; text-decoration: none; display: block; color: inherit; border: 0; font: inherit;
  transition: transform .35s var(--spring), box-shadow .3s var(--ease), filter .3s var(--ease); }
.card.link:hover { transform: translateY(-2px); filter: brightness(1.08); }
.card h3 + p, .card h3 + .muted { margin-top: 4px; }

/* glow cards: the gradient lives on its own oversized layer that slowly drifts — no border, so no wrapped stripe at the edge */
.card.glow { background: #0a0a0f; box-shadow: none; }
.card.glow::before {
  content: ""; position: absolute; inset: -35%; z-index: -1; background: var(--glow);
  animation: drift 18s ease-in-out infinite alternate; will-change: transform;
}
.card.glow::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 70% at 50% -10%, rgba(255, 255, 255, .09), transparent 60%);
}
.card.glow:nth-child(2n)::before { animation-duration: 23s; animation-direction: alternate-reverse; }
.card.glow:nth-child(3n)::before { animation-duration: 27s; animation-delay: -6s; }
@keyframes drift {
  0% { transform: translate3d(-3%, 2%, 0) scale(1); }
  50% { transform: translate3d(3%, -2%, 0) scale(1.07) rotate(3deg); }
  100% { transform: translate3d(-1%, -3%, 0) scale(1.12) rotate(-2deg); }
}
.g-pink { --glow: radial-gradient(42% 36% at 50% 72%, #ff5fb1 0%, #a52576 40%, #2a0c21 78%, #0e070c 100%); }
.g-rose { --glow: radial-gradient(45% 42% at 50% 74%, #f8b0cb 0%, #c4669e 42%, #3a1830 82%, #120a10 100%); }
.g-teal { --glow: radial-gradient(42% 36% at 50% 74%, #57e6d1 0%, #1d7a72 40%, #0b2124 78%, #070d0e 100%); }
.g-violet { --glow: radial-gradient(44% 38% at 40% 74%, #a888ff 0%, #5a35e0 40%, #1b1047 76%, #09070f 100%); }
.g-blue { --glow: radial-gradient(42% 36% at 50% 74%, #5b8bff 0%, #2343dc 40%, #0b1650 76%, #07091a 100%); }
.g-orange { --glow: radial-gradient(42% 36% at 62% 74%, #ff8a55 0%, #dd3e17 40%, #3d1208 78%, #0f0705 100%); }
.g-graphite { --glow: radial-gradient(50% 40% at 50% 28%, #6c6c7a 0%, #2b2b34 45%, #121217 80%, #0b0b0e 100%); }
.g-lime { --glow: radial-gradient(42% 36% at 50% 74%, #ddf870 0%, #6f9026 38%, #1d2610 76%, #0a0b07 100%); }
.g-sky { --glow: radial-gradient(48% 40% at 50% 30%, #95b9ff 0%, #4062d4 40%, #121c4a 78%, #08091a 100%); }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-foot { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kpi { display: grid; gap: 2px; }
.kpi .label { font-size: 13px; color: var(--muted); }
.big-dots { font-family: var(--dots); font-weight: 600; font-size: 56px; line-height: 1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.mid-dots { font-family: var(--dots); font-weight: 600; font-size: 36px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.big-dots small, .mid-dots small { font-family: var(--font); font-size: 15px; font-weight: 400; color: var(--muted); margin-left: 6px; letter-spacing: 0; text-shadow: none; }
.center { text-align: center; }
.hero { padding: 24px; display: grid; align-content: space-between; gap: 18px; }

/* ruler & progress */
.ruler {
  height: 26px; margin: 10px 0 4px; position: relative;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .5) 0 1px, transparent 1px 10px) bottom/100% 12px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .75) 0 1px, transparent 1px 50px) bottom/100% 22px no-repeat;
  -webkit-mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.ruler-wrap { position: relative; }
.ruler-mark { position: absolute; bottom: 0; width: 3px; height: 30px; background: var(--accent); border-radius: 2px; box-shadow: 0 0 14px var(--accent);
  animation: mark-in .9s var(--spring) both .25s; }
.ruler-mark.danger { background: var(--danger); box-shadow: 0 0 14px var(--danger); animation-delay: .4s; }
@keyframes mark-in { from { transform: translateY(14px) scaleY(.2); opacity: 0; } }
.bar { height: 8px; border-radius: 99px; background: var(--s2); overflow: hidden; position: relative; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: linear-gradient(90deg, #f59ab8, var(--danger));
  transition: width .6s var(--ease); }
.bar > i.ok { background: linear-gradient(90deg, #8ff0cf, var(--ok)); }
.bar > i.accent { background: var(--accent); }
@keyframes grow-x { from { transform: scaleX(0); } }
.dotline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dotline i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .22); transition: background .3s var(--ease); }
.dotline i.on { background: #fff; }
.dotline i.cur { background: var(--accent); box-shadow: 0 0 10px var(--accent); width: 9px; height: 9px; }
@keyframes pop { from { transform: scale(0); opacity: 0; } }

/* ---------------------------------------------------------------- controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 99px; padding: 11px 18px; border: 0;
  background: #fff; color: #050507; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 42px;
  transition: transform .25s var(--ease), background .2s var(--ease), opacity .2s, box-shadow .3s var(--ease), filter .25s var(--ease);
}
.btn:hover { box-shadow: 0 6px 22px rgba(255, 255, 255, .14); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.ghost { background: var(--s2); color: var(--text); box-shadow: var(--lift); }
.btn.ghost:hover { background: var(--s3); }
.btn.accent { background: var(--accent); color: #111; }
.btn.accent:hover { box-shadow: 0 6px 24px rgba(230, 245, 107, .3); }
.btn.danger { background: rgba(255, 107, 94, .14); color: #ffb0a8; }
.btn.danger:hover { background: rgba(255, 107, 94, .22); box-shadow: none; }
.btn.sm { padding: 7px 13px; min-height: 34px; font-size: 13px; }
.btn.plus { padding-right: 8px; }
.btn.plus::after { content: "+"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #050507; color: #fff; font-weight: 600; }
.btn.ghost.plus::after { background: #fff; color: #000; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.seg { display: inline-flex; background: var(--s1); border-radius: 99px; padding: 4px; gap: 2px; flex-wrap: wrap; box-shadow: var(--lift); }
.seg a, .seg button { border: 0; background: none; padding: 8px 15px; border-radius: 99px; color: var(--muted); cursor: pointer; text-decoration: none; font-size: 14px;
  transition: background .25s var(--ease), color .25s var(--ease); }
.seg a:hover, .seg button:hover { color: var(--text); }
.seg .on { background: var(--s3); color: var(--text); box-shadow: var(--lift); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; background: var(--s2); white-space: nowrap;
  text-decoration: none; border: 0; color: inherit; transition: background .2s var(--ease); }
a.chip:hover, button.chip:hover { background: var(--s3); cursor: pointer; }
.chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.chip.ok { color: var(--ok); background: rgba(126, 224, 181, .12); }
.chip.warn { color: var(--warn); background: rgba(255, 198, 92, .12); }
.chip.danger { color: #ff8f85; background: rgba(255, 107, 94, .13); }
.chip.accent { color: var(--accent); background: rgba(230, 245, 107, .1); }
.chip.solid { background: #fff; color: #000; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.card.glow .chip:not(.solid):not(.ok):not(.warn):not(.danger):not(.accent) { background: rgba(0, 0, 0, .28); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--muted); }
.field .hint { font-size: 12px; color: var(--faint); }
input[type=text], input[type=email], input[type=number], input[type=datetime-local], input[type=date], input[type=time], input[type=url],
input[type=search], select, textarea {
  width: 100%; min-width: 0; max-width: 100%; background: rgba(255, 255, 255, .045); border: 1px solid var(--line); border-radius: var(--r-m);
  padding: 11px 14px; outline: none; min-height: 46px; transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
input[type=datetime-local], input[type=date], input[type=time] { font-size: 14px; padding-left: 10px; padding-right: 8px; }
textarea { min-height: 96px; resize: vertical; }
input:hover, select:hover, textarea:hover { background-color: rgba(255, 255, 255, .06); }
input:focus, select:focus, textarea:focus { border-color: rgba(230, 245, 107, .55); box-shadow: 0 0 0 4px rgba(230, 245, 107, .1); }
select option { background: #15151b; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.err { color: #ffa198; font-size: 13px; }
.form-err { margin-top: 10px; animation: shake .4s var(--ease); }
@keyframes shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 0; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.toggle { position: relative; width: 50px; height: 30px; flex: none; }
.toggle input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.toggle i { position: absolute; inset: 0; border-radius: 99px; background: rgba(255, 255, 255, .16); transition: background .3s var(--ease); }
.toggle i::after { content: ""; position: absolute; width: 24px; height: 24px; top: 3px; left: 3px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .4s var(--spring); }
.toggle input:checked + i { background: rgba(230, 245, 107, .6); }
.toggle input:checked + i::after { transform: translateX(20px); }

.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }
.stack.lg { gap: 16px; }
.mt-s { margin-top: 8px; } .mt { margin-top: 14px; } .mt-l { margin-top: 26px; } .mb { margin-bottom: 14px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 30px 2px 12px; }
.section-title h2 { font-size: 20px; }
.section-title a { color: var(--muted); font-size: 13px; text-decoration: none; transition: color .2s; }
.section-title a:hover { color: var(--text); }
form.row { flex-wrap: wrap; }
form.row > .grow { flex: 1 1 180px; }
form.row > select { flex: 1 1 140px; max-width: none !important; }

/* ---------------------------------------------------------------- lists */
.list { display: grid; gap: 8px; }
.item {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-l); background: var(--s1); box-shadow: var(--lift);
  text-decoration: none; min-width: 0; color: inherit; border: 0; font: inherit;
  transition: background .2s var(--ease), transform .3s var(--spring);
}
a.item:hover, .item.clickable:hover { background: var(--s2); cursor: pointer; }
.item .grow > * { overflow: hidden; text-overflow: ellipsis; }
.item .title { font-weight: 500; }
.item .meta { font-size: 13px; color: var(--muted); display: flex; gap: 4px 10px; flex-wrap: wrap; margin-top: 2px; }
.item > .grow { flex-basis: 160px; }
.item:has(> .stack), .item:has(> .btn), .item:has(> .chip ~ .btn) { flex-wrap: wrap; }
.item > .stack { flex-basis: 100%; display: flex !important; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-start !important; }
.meta svg, .chip svg { width: 14px; height: 14px; flex: none; }
.meta > span { display: inline-flex; align-items: center; gap: 4px; }
.prio { width: 4px; align-self: stretch; border-radius: 4px; background: rgba(255, 255, 255, .2); flex: none; }
.prio.high { background: var(--orange); box-shadow: 0 0 12px var(--orange); }
.prio.normal { background: var(--violet); box-shadow: 0 0 10px rgba(125, 92, 255, .6); }
.prio.low { background: rgba(255, 255, 255, .28); }

.timeline { display: grid; position: relative; }
.tl { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.tl::before { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 1px; background: linear-gradient(var(--line-2), var(--line)); }
.tl:last-child::before { display: none; }
.tl .node { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--line-2); margin-top: 2px; background: var(--bg); transition: all .3s var(--ease); }
.tl.done .node { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 12px rgba(126, 224, 181, .5); }
.tl.wait .node { border-color: var(--warn); animation: ring 2.4s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 198, 92, .45); } 70%, 100% { box-shadow: 0 0 0 8px rgba(255, 198, 92, 0); } }
.tl.locked { opacity: .5; }
.tl .row.top.wrap > .chips { flex-basis: 100%; }
.tl .row.top.wrap > .chips:empty { display: none; }
.stage-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); margin: 10px 0 10px 30px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--faint); font-weight: 400; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 8px 10px; }
.tbl td { padding: 11px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl tr.clickable:hover td { background: var(--s1); cursor: pointer; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }

/* ---------------------------------------------------------------- sheet / toast */
.backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: fade .25s var(--ease); }
.sheet { width: min(var(--col), 100%); max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, #1a1a21, #121217 120px); border-radius: 30px 30px 0 0;
  padding: 10px 16px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--lift), 0 -30px 80px rgba(0, 0, 0, .6);
  animation: sheet-in .5s var(--spring); }
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .2); margin: 0 auto 14px; }
.backdrop.closing { animation: fade-out .22s var(--ease) forwards; }
.backdrop.closing .sheet { animation: sheet-out .22s var(--ease) forwards; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.sheet-head h2 { min-width: 0; overflow-wrap: anywhere; }
.sheet-head .round { width: 38px; height: 38px; }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(40%); opacity: 0; } }
@keyframes up { from { transform: translateY(14px); opacity: 0; } }
.toast-wrap { position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px;
  width: min(calc(var(--col) - 32px), calc(100% - 32px)); pointer-events: none; }
.toast { background: rgba(255, 255, 255, .96); color: #000; padding: 12px 16px; border-radius: 18px; box-shadow: 0 14px 40px rgba(0, 0, 0, .45);
  font-size: 14px; animation: toast-in .5s var(--spring); }
.toast.error { background: #ffdcd8; }
.toast.out { animation: fade-out .3s var(--ease) forwards; }
@keyframes toast-in { from { transform: translateY(-24px) scale(.96); opacity: 0; } }

/* ---------------------------------------------------------------- states */
.skeleton { border-radius: var(--r-xl); min-height: 120px;
  background: linear-gradient(100deg, rgba(255, 255, 255, .035) 30%, rgba(255, 255, 255, .08) 50%, rgba(255, 255, 255, .035) 70%);
  background-size: 250% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); border-radius: var(--r-xl);
  background: radial-gradient(80% 100% at 50% 0%, rgba(255, 255, 255, .045), transparent 70%); }
.empty .mid-dots { color: var(--faint); margin-bottom: 8px; }
.notice { padding: 12px 14px; border-radius: var(--r-m); background: rgba(230, 245, 107, .08); font-size: 14px; box-shadow: inset 3px 0 0 rgba(230, 245, 107, .55); }
.notice.danger { background: rgba(255, 107, 94, .09); box-shadow: inset 3px 0 0 rgba(255, 107, 94, .6); }
.notice.info { background: rgba(125, 92, 255, .11); box-shadow: inset 3px 0 0 rgba(150, 120, 255, .7); }

/* chat */
.chat { display: grid; gap: 10px; align-content: start; }
.bubble { max-width: 86%; padding: 12px 15px; border-radius: 20px; background: var(--s2); white-space: pre-wrap; animation: up .35s var(--spring); }
.bubble.me { justify-self: end; background: #fff; color: #000; border-bottom-right-radius: 6px; }
.bubble.bot { border-bottom-left-radius: 6px; }
.bubble.faint::after { content: ""; display: inline-block; width: 18px; height: 6px; margin-left: 2px;
  background: radial-gradient(circle, currentColor 2px, transparent 2.5px) 0 50%/6px 6px repeat-x; animation: typing 1s steps(4) infinite; }
@keyframes typing { from { width: 0; } }
.sources { margin-top: 8px; display: grid; gap: 6px; }
.source { font-size: 13px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .25); }

/* login */
.login { padding: calc(20px + env(safe-area-inset-top)) 16px 24px; display: grid; align-content: center; }
.login-card { display: grid; gap: 12px; }
.login-card > * { animation: up .6s var(--spring) both; }
.login-card > :nth-child(2) { animation-delay: .08s; }
.login .card.form { padding: 18px; }
.sphere { display: block; width: 100%; height: 210px; margin: 4px 0 -4px;
  filter: drop-shadow(0 0 22px rgba(150, 120, 255, .55)); animation: breathe 7s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-4px) scale(1.02); } }
.logo { flex: none; filter: drop-shadow(0 0 10px rgba(125, 92, 255, .45)); }
.dot-matrix { display: grid; grid-template-columns: repeat(5, 8px); gap: 5px; }
.dot-matrix i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .85); }
.dot-matrix i.o { opacity: .25; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.pre { white-space: pre-wrap; }
.nowrap { white-space: nowrap; }
.right { margin-left: auto; }
.timer-pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 99px; background: rgba(230, 245, 107, .12);
  box-shadow: inset 0 0 0 1px rgba(230, 245, 107, .25); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(230, 245, 107, .6); } 70%, 100% { box-shadow: 0 0 0 7px rgba(230, 245, 107, 0); } }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.demo-flag { font-size: 11px; padding: 3px 8px; border-radius: 99px; background: rgba(230, 245, 107, .1); color: var(--accent); }
.card.link.tight .round { width: 40px; height: 40px; background: rgba(0, 0, 0, .25); }
.card.link.tight h3 { font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
    transition-duration: .01ms !important; }
}

/* wellbeing scale: radio pills */
.scale { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.scale label { cursor: pointer; }
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale span { display: inline-block; padding: 8px 12px; border-radius: 99px; font-size: 13px; background: rgba(0, 0, 0, .28);
  transition: background .2s var(--ease), color .2s, transform .3s var(--spring); }
.scale label:hover span { background: rgba(255, 255, 255, .14); }
.scale input:checked + span { background: #fff; color: #000; transform: scale(1.04); }
.scale input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* segmented control never wraps: it scrolls sideways inside the column */
.seg { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button { flex: none; white-space: nowrap; }

/* hour scale (load cards) */
.hscale { display: flex; justify-content: space-between; align-items: flex-end; height: 30px; margin: 12px 2px 6px; }
.hscale i { width: 2px; height: 10px; border-radius: 2px; background: rgba(255, 255, 255, .22); flex: none; }
.hscale i.major { height: 16px; }
.hscale i { transition: background .35s var(--ease), box-shadow .35s var(--ease); }
.hscale i.on { background: #fff; }
.hscale i.over { background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.hscale i.limit { width: 3px; height: 28px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
@keyframes tick-on { from { background: rgba(255, 255, 255, .22); box-shadow: none; } }
.legend { align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .lg { display: inline-block; width: 3px; height: 12px; border-radius: 2px; background: #fff; }
.legend .lg.over { background: var(--danger); }
.legend .lg.limit { background: var(--accent); height: 14px; }

/* ================================================================ system rules (applied across every screen)
   1. Touch targets ≥ 44px. 2. One primary action per context; the rest live in an action sheet.
   3. Sheets: content + one full-width primary button. 4. Neutral focus. 5. One status chip per card.
   6. Lime accent only for live signals (timer, limit, current step, unread). */
.btn { min-height: 48px; padding: 12px 20px; font-size: 15px; }
.btn.sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.danger { background: rgba(255, 107, 94, .12); }
.round { width: 44px; height: 44px; }
.round.sm-round { width: 40px; height: 40px; }
.topbar-row .btn { min-height: 44px; padding: 10px 16px; }
.sheet-head .round { width: 40px; height: 40px; }

/* filters: one horizontal row, scrolls instead of wrapping */
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip.filter { min-height: 38px; padding: 8px 14px; font-size: 14px; flex: none; color: var(--muted); }
.chip.filter.solid { color: #000; }
.chip.filter b { font-weight: 500; opacity: .55; margin-left: 2px; }
a.chip.filter:hover { color: var(--text); }
a.chip.filter.solid:hover { color: #000; background: #fff; }

/* neutral focus, quieter checkboxes */
input:focus, select:focus, textarea:focus { border-color: rgba(255, 255, 255, .32); box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
.check { align-items: center; min-height: 44px; padding: 4px 0; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: #8d6dff; }
.toggle input:checked + i { background: #7d5cff; }

/* sheets: one wide primary button, actions as a list */
.sheet form > .btn:last-child, .sheet form > .btn[type=submit], .sheet > .sheet-body > .btn:last-child,
.sheet .sheet-body > form > button.btn:not(.sm):not(.ghost) { width: 100%; min-height: 52px; margin-top: 8px; }
.sheet .btn-row { flex-wrap: nowrap; }
.sheet .btn-row .btn { flex: 1; min-height: 52px; }
.sheet .field:last-of-type { margin-bottom: 8px; }
.action-list { display: grid; gap: 6px; }
.action-list button { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 14px; border: 0; border-radius: var(--r-l);
  background: var(--s1); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .2s var(--ease), transform .3s var(--spring); }
.action-list button:hover { background: var(--s2); }
.action-list button svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.action-list button small { display: block; color: var(--muted); font-size: 13px; }
.action-list button.danger { color: #ff9d94; }
.action-list button.danger svg { color: #ff9d94; }

/* primary action bar on cards (task, suggestion…) */
.action-bar { display: flex; gap: 8px; align-items: center; margin: 4px 0 18px; }
.action-bar .btn { flex: 1; min-height: 52px; }
.action-bar .round { width: 52px; height: 52px; }
.meta-line { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin: 10px 0 16px; }
.meta-line > span { display: inline-flex; align-items: center; gap: 5px; }
.meta-line svg { width: 15px; height: 15px; }
.meta-line .over { color: #ff8f85; }
.round.accent-round { background: var(--accent); color: #111; box-shadow: 0 0 20px rgba(230, 245, 107, .35); }

/* segmented control: full width, equal parts, 44px */
.seg { display: flex; width: 100%; padding: 4px; }
.seg a, .seg button { flex: 1 0 auto; text-align: center; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; }
.seg + .chips.scroll { margin-top: 12px; }
.item.dim { opacity: .55; }
.item > .round { align-self: center; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.split > div + div { padding-left: 14px; box-shadow: inset 1px 0 0 var(--line); }
/* two or more buttons in a narrow card stack full-width instead of wrapping unevenly */
.card-foot:has(.btn + .btn) { flex-direction: column; align-items: stretch; }
.card-foot:has(.btn + .btn) .btn { width: 100%; }

.step .title { font-weight: 500; }
.step-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tl.done .step .title { color: var(--muted); }
/* form submit buttons inside cards are full width, like in sheets */
.card form:not(.row) > button.btn:last-child, .card form:not(.row) > .btn-row { width: 100%; }
.card form:not(.row) > .btn-row .btn { flex: 1; }

/* search: input with a round button inside one row */
.search { display: flex; gap: 8px; align-items: center; }
.search input { flex: 1; }
.search .round { flex: none; background: #fff; color: #000; }
.card.glow .search input { background: rgba(0, 0, 0, .3); border-color: transparent; }
button.item { width: 100%; text-align: left; }

.sheet .card-foot { flex-direction: column; align-items: stretch; }
.sheet .card-foot .btn { width: 100%; min-height: 52px; }
form.card > button.btn:last-child { width: 100%; }

.scale.days { flex-wrap: nowrap; gap: 5px; }
.scale.days label { flex: 1; }
.scale.days span { display: block; text-align: center; padding: 10px 0; }
.switch-list { display: grid; gap: 2px; margin-top: 8px; border-radius: var(--r-l); overflow: hidden; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 8px 14px;
  background: var(--s1); cursor: pointer; }
.switch-row:hover { background: var(--s2); }
.switch-row > span:first-child { flex: 1; }
.empty-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--s2); margin-bottom: 10px; color: var(--muted); }
.empty-ic svg { width: 22px; height: 22px; }
.scale input:disabled + span { opacity: .4; cursor: not-allowed; }
.sheet textarea { min-height: 76px; }

/* glow is reserved for hero cards; small KPI tiles stay calm */
.grid.three > .card.tight.glow, .grid.four > .card.tight.glow { background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .025)), var(--panel); }
.grid.three > .card.tight.glow::before, .grid.four > .card.tight.glow::before { display: none; }
.grid.four > .card.tight .mid-dots { font-size: 32px; }
.load-row .mono { font-size: 15px; white-space: nowrap; }
.over-text { color: #ff8f85; }
.period { display: flex; gap: 8px; align-items: center; }
.period input { flex: 1; }

.chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.steps-mini { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: 2px; }
.steps-mini li { counter-increment: st; display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; padding: 6px 0; font-size: 14px; box-shadow: inset 0 -1px 0 var(--line); }
.steps-mini li:last-child { box-shadow: none; }
.steps-mini li::before { content: counter(st); grid-row: span 2; color: var(--faint); font-family: var(--dots); font-weight: 700; }
.steps-mini small { color: var(--faint); font-size: 12px; }

/* ================================================================ timeline nodes: state markers, never empty "to-do" rings */
.tl .node { width: 18px; height: 18px; border: 0; border-radius: 50%; background: transparent; margin-top: 2px; display: grid; place-items: center; box-shadow: none; }
.tl .node::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #9a7bff; box-shadow: 0 0 10px rgba(154, 123, 255, .7); }
.tl.done .node { background: var(--ok); box-shadow: 0 0 12px rgba(126, 224, 181, .45); }
.tl.done .node::after { width: 10px; height: 10px; border-radius: 0; background: #06120d; box-shadow: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.3l2.6 2.6L10 3.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.3l2.6 2.6L10 3.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.tl.wait .node { background: rgba(255, 198, 92, .16); animation: none; }
.tl.wait .node::after { width: 8px; height: 8px; background: var(--warn); box-shadow: 0 0 8px var(--warn); animation: ring 2.4s ease-out infinite; }
.tl.locked .node::after { width: 7px; height: 7px; background: rgba(255, 255, 255, .3); box-shadow: none; }
.tl::before { left: 8.5px; top: 22px; }
/* activity log: quiet dots */
.timeline.log .tl { padding-bottom: 14px; }
.timeline.log .node { width: 18px; height: 18px; }
.timeline.log .node::after { width: 7px; height: 7px; background: rgba(255, 255, 255, .45); box-shadow: none; }
.timeline.log .tl:first-child .node::after { background: #fff; box-shadow: 0 0 8px rgba(255, 255, 255, .5); }
.timeline.log .tl.done .node { background: transparent; box-shadow: none; }
.timeline.log .tl.done .node::after { -webkit-mask: none; mask: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* ================================================================ form controls styled to the system */
input[type=checkbox]:not(.toggle input):not(.scale input), input[type=radio]:not(.scale input) {
  -webkit-appearance: none; appearance: none; flex: none; width: 22px; height: 22px; margin: 0; cursor: pointer;
  border-radius: 7px; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22);
  display: inline-grid; place-items: center; transition: background .2s var(--ease), box-shadow .2s var(--ease), transform .3s var(--spring);
}
input[type=radio]:not(.scale input) { border-radius: 50%; }
input[type=checkbox]:not(.toggle input):not(.scale input):hover, input[type=radio]:not(.scale input):hover { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .4); }
input[type=checkbox]:not(.toggle input):not(.scale input):checked, input[type=radio]:not(.scale input):checked {
  background: #7d5cff; box-shadow: 0 0 12px rgba(125, 92, 255, .45);
}
input[type=checkbox]:not(.toggle input):not(.scale input):checked::after { content: ""; width: 12px; height: 12px; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.3l2.6 2.6L10 3.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.3l2.6 2.6L10 3.4' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
input[type=radio]:not(.scale input):checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.check input { accent-color: auto; }

select { -webkit-appearance: none; appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%23ffffff' stroke-opacity='.55' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .45; cursor: pointer; }
input::-webkit-calendar-picker-indicator:hover { opacity: .8; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
input::placeholder, textarea::placeholder { color: rgba(244, 244, 246, .32); }
textarea::-webkit-resizer { display: none; }
textarea { resize: none; }

/* ================================================================ press feedback (all tappable elements)
   While held: the element settles a touch and a soft light spot sits under the finger.
   On release: a light wave spreads from the touch point. No bouncing scale. */
.fx { position: relative; overflow: hidden; isolation: isolate; -webkit-user-select: none; user-select: none; }
.fx > .spot { position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit; opacity: 0;
  background: radial-gradient(120px circle at var(--px, 50%) var(--py, 50%), var(--spot, rgba(255, 255, 255, .16)), transparent 70%);
  transition: opacity .35s var(--ease); }
.fx.pressing > .spot { opacity: 1; transition-duration: .08s; }
.fx.pressing { transform: translateY(1px) scale(.985); filter: brightness(1.06); transition-duration: .12s; }
.fx > *:not(.spot):not(.ink):not(.badge) { position: relative; z-index: 1; }
.fx > .badge { z-index: 2; }  /* absolutely positioned corner badges keep their place while pressed */
.fx .ink { position: absolute; z-index: 0; left: 0; top: 0; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--ink, rgba(255, 255, 255, .28)) 0, var(--ink, rgba(255, 255, 255, .28)) 40%, transparent 70%);
  transform: translate(-50%, -50%) scale(0); animation: ink .6s var(--ease) forwards; }
@keyframes ink { 60% { opacity: .9; } to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
/* white / accent buttons: violet light instead of grey */
.btn:not(.ghost):not(.danger), .chip.filter.solid, .search .round { --spot: rgba(125, 92, 255, .2); --ink: rgba(125, 92, 255, .2); }
.btn.accent { --spot: rgba(255, 255, 255, .35); --ink: rgba(255, 255, 255, .5); }
.btn.danger { --spot: rgba(255, 107, 94, .2); --ink: rgba(255, 107, 94, .35); }
.card.glow.fx, .card.link.fx { --spot: rgba(255, 255, 255, .1); --ink: rgba(255, 255, 255, .16); }
.card.glow.fx > *:not(.spot):not(.ink):not(.badge) { z-index: 1; }

/* segmented controls: one pill that slides between options */
.seg { position: relative; }
.seg .on { background: transparent; box-shadow: none; }
.seg-pill { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 99px; background: var(--s3); box-shadow: var(--lift);
  transition: transform .45s var(--ease), width .45s var(--ease); pointer-events: none; z-index: 0; }
.seg a, .seg button { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) { .fx .ink { display: none; } .fx.pressing { transform: none; } }
.scale label > span.fx { overflow: hidden; }

/* notifications: unread marker at the title line, long bodies clamped */
.item.notif { align-items: flex-start; padding-left: 28px; position: relative; }
.item.notif.unread::after { content: ""; position: absolute; left: 12px; top: 22px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.item .meta.clamp, .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }

/* tappable elements are always the positioning context, so pressing never changes the layout of their content */
.btn, .round, .chip, .item, .card.link, .action-list button, .switch-row, .scale label > span { position: relative; }
