/* Aperture panel — citron on slate, the palette of the bot's emoji tiles
   (scripts/generate_bot_emoji.py). Dark-first on purpose: the identity should
   survive a client set to the light theme, so nothing here reads
   prefers-color-scheme. Figures use tabular numerals so columns line up like
   an instrument panel, the same rule the digest cards follow. */
:root {
  --ground: #0f1113;
  --card: #1a1e21;
  --card-2: #22272b;
  --card-hi: #2a3035;
  --keyline: rgba(205, 255, 74, 0.26);
  --hairline: rgba(255, 255, 255, 0.07);
  --hairline-2: rgba(255, 255, 255, 0.12);
  --accent: #cdff4a;
  --accent-ink: #11140a;
  --accent-soft: rgba(205, 255, 74, 0.1);
  --amber: #ffbe46;
  --red: #ff6b6b;
  --green: #5ee08e;
  --blue: #6cb8ff;
  --text: #e9eeec;
  --dim: #8e9996;
  --faint: #5d6664;
  --radius: 18px;
  --radius-s: 13px;
  --bar-h: 64px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--ground); }
body {
  margin: 0;
  padding: 0 14px calc(var(--bar-h) + 26px + env(safe-area-inset-bottom));
  min-height: 100vh;
  background: var(--ground);
  color: var(--text);
  font: 15px/1.45 -apple-system, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-appearance: none; appearance: none; }
.num, .mono { font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }
.up { color: var(--green); }
.down { color: var(--red); }
.accent { color: var(--accent); }
.ic { flex: none; display: block; }

/* ── Head ──────────────────────────────────────────────────────────── */
.head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -14px 6px; padding: 14px 16px 10px;
  background: linear-gradient(180deg, var(--ground) 70%, rgba(15, 17, 19, 0));
}
.head .brand { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.head .mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--keyline);
}
.head h1 {
  margin: 0; font-size: 13px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
  white-space: nowrap;
}
.head .sub {
  color: var(--dim); font-size: 12.5px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icon-btn {
  width: 36px; height: 36px; flex: none; border-radius: 11px;
  display: grid; place-items: center; cursor: pointer;
  background: var(--card); border: 1px solid var(--hairline); color: var(--dim);
}
.icon-btn:active { background: var(--card-hi); color: var(--text); }
.icon-btn.spin .ic { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.screen { animation: rise .22s ease both; }
.screen.still { animation: none; }
/* Movement only, no fade: a WebView that throttles animations (a hidden
   Telegram Desktop panel does) would otherwise hold the screen at opacity 0. */
@keyframes rise { from { transform: translateY(6px); } to { transform: none; } }

h2.title {
  margin: 4px 2px 12px; font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em;
}
.section-label {
  margin: 22px 4px 9px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
  display: flex; align-items: center; gap: 8px;
}
.section-label .more { margin-left: auto; letter-spacing: 0; text-transform: none; color: var(--dim); font-weight: 500; cursor: pointer; }

/* ── Surfaces ──────────────────────────────────────────────────────── */
.panel {
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 60%), var(--card);
}
.panel.pad { padding: 16px; }
.panel.keyed { border-color: var(--keyline); }

/* Status hero on home */
.hero { padding: 16px; display: flex; gap: 14px; align-items: center; }
.hero .lamp {
  width: 44px; height: 44px; border-radius: 14px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.hero.warn .lamp { background: rgba(255, 190, 70, .12); color: var(--amber); }
.hero.bad .lamp { background: rgba(255, 107, 107, .12); color: var(--red); }
.hero .h { font-weight: 650; font-size: 16px; }
.hero .s { color: var(--dim); font-size: 13px; }

.progress { height: 4px; border-radius: 4px; background: var(--card-hi); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s ease; }

/* Tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile {
  position: relative; min-height: 104px; padding: 14px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, 0) 62%), var(--card);
  cursor: pointer; transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.tile:active { transform: scale(.98); background: var(--card-hi); }
.tile .ico { color: var(--accent); }
.tile .lbl { font-weight: 600; font-size: 14.5px; }
.tile .val { font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .val small { font-size: 12.5px; font-weight: 500; color: var(--dim); margin-left: 4px; }
.tile .top { display: flex; align-items: center; justify-content: space-between; }
.tile .corner { position: absolute; top: 14px; right: 14px; display: flex; align-items: center; }
.tile.wide { grid-column: span 2; min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; gap: 14px; }
.tile.wide > div:last-child { flex: 1; min-width: 0; display: flex; flex-direction: column-reverse; }
.tile .val:empty, .tile .val.none { display: none; }
.tile .note { font-size: 12.5px; color: var(--dim); }
.tile.hot { border-color: var(--keyline); }

/* Ticker strip */
.ticker { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.tick { padding: 10px 12px; border-radius: var(--radius-s); background: var(--card); border: 1px solid var(--hairline); min-width: 0; }
.tick .c { font-size: 11px; letter-spacing: .1em; color: var(--dim); font-weight: 600; }
.tick .p { font-weight: 650; font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tick .u { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Lists */
.list { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--hairline); background: var(--card); }
.item {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; min-height: 56px;
  cursor: pointer; transition: background .12s ease; position: relative;
}
.item + .item::before { content: ""; position: absolute; top: 0; left: 50px; right: 0; height: 1px; background: var(--hairline); }
.item:active { background: var(--card-hi); }
.item.static { cursor: default; }
.item.static:active { background: transparent; }
.item .lead {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--card-2); color: var(--dim);
}
.item .lead.on { background: var(--accent-soft); color: var(--accent); }
.item .lead.warn { background: rgba(255, 190, 70, .12); color: var(--amber); }
.item .lead.bad { background: rgba(255, 107, 107, .12); color: var(--red); }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .d { font-size: 12.5px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .d.wrap { white-space: normal; }
.item .end { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.item .end .d { text-align: right; }
.item .chev { color: var(--faint); }
.gw-end { display: flex; align-items: center; gap: 10px; }
.gw-x { width: 32px; height: 32px; border-radius: 10px; margin-right: -4px; }
.item.selected { background: var(--accent-soft); }
.item.selected .lead { background: var(--accent); color: var(--accent-ink); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); flex: none; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(94, 224, 142, .15); }
.dot.warn { background: var(--amber); }
.dot.bad { background: var(--red); }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: 6px; font-size: 11px; font-weight: 650; letter-spacing: .02em;
  background: var(--card-hi); color: var(--dim); white-space: nowrap;
}
.badge.on { background: var(--accent-soft); color: var(--accent); }
.badge.warn { background: rgba(255, 190, 70, .13); color: var(--amber); }
.badge.bad { background: rgba(255, 107, 107, .13); color: var(--red); }
.badge.good { background: rgba(94, 224, 142, .12); color: var(--green); }

/* Segmented + chips */
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--card); border: 1px solid var(--hairline); gap: 2px; }
.seg button {
  flex: 1; height: 34px; border: 0; border-radius: 9px; background: transparent;
  color: var(--dim); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.seg button.on { background: var(--card-hi); color: var(--text); box-shadow: inset 0 0 0 1px var(--hairline-2); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 12px -14px; padding: 0 14px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 13px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--hairline); background: var(--card); color: var(--dim);
  font-size: 13.5px; font-weight: 550; white-space: nowrap;
}
.chip.on { border-color: var(--keyline); color: var(--accent); background: var(--accent-soft); }
.chip:active { background: var(--card-hi); }

/* Buttons */
.btn {
  height: 50px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--hairline-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--card-2); color: var(--text); font-weight: 650; font-size: 15px;
  cursor: pointer; transition: transform .12s ease, opacity .12s ease; width: 100%;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; }
.btn.small { height: 40px; font-size: 14px; border-radius: 12px; width: auto; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .ic { opacity: .9; }
.btn-row { display: flex; gap: 8px; }
.btn-row > .btn { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.link { color: var(--accent); background: none; border: 0; padding: 8px 0; cursor: pointer; font-weight: 550; }
.link[disabled] { color: var(--faint); pointer-events: none; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--dim); margin-left: 4px; }
.input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--hairline-2); background: var(--card); color: var(--text);
  font-size: 17px; outline: none; transition: border-color .12s ease;
}
.input:focus { border-color: var(--keyline); }
.input.code { text-align: center; letter-spacing: .5em; font-size: 26px; font-weight: 700; font-family: var(--mono); height: 64px; }
.hint { font-size: 12.5px; color: var(--dim); margin: 0 4px; }
.toggle { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--hairline); cursor: pointer; }
.switch { width: 44px; height: 26px; border-radius: 13px; background: var(--card-hi); position: relative; transition: background .15s ease; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--dim); transition: transform .15s ease, background .15s ease; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); background: var(--accent-ink); }

/* ── Converter ─────────────────────────────────────────────────────── */
.conv { position: relative; display: flex; flex-direction: column; gap: 6px; }
.leg {
  display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px;
  border-radius: var(--radius); background: var(--card); border: 1px solid var(--hairline);
  transition: border-color .12s ease;
}
.leg.focus { border-color: var(--keyline); }
.leg .amount {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font-size: 30px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums;
  padding: 6px 0;
}
.leg .amount::placeholder { color: var(--faint); }
.leg .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cur {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 10px 0 8px;
  border-radius: 12px; border: 1px solid var(--hairline-2); background: var(--card-2);
  font-weight: 700; letter-spacing: .03em; cursor: pointer; white-space: nowrap;
}
.cur .flag { font-size: 20px; line-height: 1; }
.cur .chev { color: var(--faint); }
.leg .usd { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.swap-btn {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); border: 4px solid var(--ground); cursor: pointer;
  transition: transform .18s ease;
}
.swap-btn:active { transform: translate(-50%, -50%) rotate(180deg) scale(.95); }
.rate-line {
  display: flex; align-items: center; gap: 8px; margin: 10px 4px 0;
  font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums;
}
.rate-line .star { margin-left: auto; color: var(--faint); cursor: pointer; padding: 4px; }
.rate-line .star.on { color: var(--accent); }
.rate-line .star.on path { fill: currentColor; }
.ask { display: flex; gap: 8px; margin-top: 12px; }
.ask .input { height: 46px; font-size: 15px; }
.ask .icon-btn { width: 46px; height: 46px; }

/* ── Sheet ─────────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 40; animation: fade .18s ease both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 82vh;
  display: flex; flex-direction: column;
  background: #15181b; border-top: 1px solid var(--hairline-2);
  border-radius: 22px 22px 0 0; padding: 8px 14px calc(16px + env(safe-area-inset-bottom));
  animation: up .24s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes up { from { transform: translateY(100%); } }
.sheet .grab { width: 38px; height: 4px; border-radius: 2px; background: var(--hairline-2); margin: 2px auto 12px; }
.sheet .sheet-title { font-weight: 700; font-size: 17px; margin: 0 4px 12px; }
.sheet .scroll { overflow-y: auto; margin: 0 -14px; padding: 0 14px; }

/* ── Bar ───────────────────────────────────────────────────────────── */
.bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; gap: 6px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(15, 17, 19, .86);
  border-top: 1px solid var(--hairline);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.tab {
  flex: 1; height: 50px; border-radius: 14px; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 11px; font-weight: 600;
  transition: color .12s ease, background .12s ease;
}
.tab.on { color: var(--accent); background: var(--accent-soft); }
.tab:active { transform: scale(.97); }

/* ── States ────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 42px 20px; color: var(--dim); }
.empty .ic { margin: 0 auto 12px; color: var(--faint); }
.empty .h { color: var(--text); font-weight: 650; margin-bottom: 4px; }
.skel { border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 0%, var(--card-2) 50%, var(--card) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.err-box { padding: 16px; border-radius: var(--radius); border: 1px solid rgba(255, 107, 107, .3); background: rgba(255, 107, 107, .06); color: var(--text); }
.err-box .h { color: var(--red); font-weight: 650; margin-bottom: 4px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + 22px + env(safe-area-inset-bottom)); z-index: 60;
  transform: translateX(-50%); max-width: calc(100vw - 40px);
  padding: 11px 16px; border-radius: 14px; background: #2b3136; color: var(--text);
  border: 1px solid var(--hairline-2); font-size: 14px; font-weight: 550;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4); animation: toast .2s ease both;
}
.toast.bad { border-color: rgba(255, 107, 107, .4); }
.toast.with-act { display: flex; align-items: center; gap: 16px; }
.toast-act {
  flex: none; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--accent); font: inherit; font-weight: 650;
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }

.text-block {
  padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--hairline); background: var(--card);
  white-space: pre-wrap; word-break: break-word; line-height: 1.5; font-size: 14.5px;
}
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv .cell { padding: 12px 14px; border-radius: var(--radius-s); background: var(--card); border: 1px solid var(--hairline); }
.kv .k { font-size: 11.5px; color: var(--dim); letter-spacing: .02em; }
.kv .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kv .v.sm { font-size: 15px; }

.month-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.month-nav .m { flex: 1; text-align: center; font-weight: 650; text-transform: capitalize; }

.bars { display: flex; flex-direction: column; gap: 9px; }
.barline .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.barline .track { height: 6px; border-radius: 3px; background: var(--card-hi); overflow: hidden; }
.barline .track i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.action-dock {
  position: fixed; left: 10px; right: 10px; z-index: 25;
  bottom: calc(var(--bar-h) + 14px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; padding: 8px; border-radius: 18px;
  background: rgba(34, 39, 43, .96); border: 1px solid var(--hairline-2);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .45); animation: dock .2s ease both;
}
@keyframes dock { from { opacity: 0; transform: translateY(10px); } }
.action-dock .btn { height: 46px; }

/* ── Guest home: the member's own card ─────────────────────────────── */
.profile { padding: 16px; }
.profile-top { display: flex; align-items: center; gap: 12px; }
.profile .avatar {
  width: 46px; height: 46px; border-radius: 15px; flex: none;
  display: grid; place-items: center; font-size: 20px; font-weight: 750;
  background: var(--accent); color: var(--accent-ink);
}
.profile .who { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.profile .who .h { font-weight: 700; font-size: 17px; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile .facts { margin-top: 14px; border-top: 1px solid var(--hairline); }
.fact { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 0; font-size: 13.5px; }
.fact .k { display: inline-flex; align-items: center; gap: 7px; color: var(--dim); flex: none; }
.fact .k .ic { color: var(--faint); }
.fact .v { font-weight: 600; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted-line {
  margin-top: 14px; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600;
  color: var(--amber); background: rgba(255, 190, 70, .08); border: 1px solid rgba(255, 190, 70, .22);
}
.muted-line .go { margin-left: auto; font-weight: 650; }
.kv .v small.of { display: block; font-size: 11.5px; font-weight: 500; color: var(--faint); margin-top: 1px; }

/* ── Feed ──────────────────────────────────────────────────────────── */
.search { position: relative; display: flex; gap: 8px; }
.search .input { height: 46px; font-size: 15px; padding-left: 42px; }
.search > .ic { position: absolute; left: 14px; top: 14px; color: var(--faint); pointer-events: none; }
.search .icon-btn { width: 46px; height: 46px; }
.search-note { display: flex; align-items: center; gap: 8px; margin: 10px 4px 0; font-size: 13px; color: var(--dim); }
.search-note b { color: var(--text); font-weight: 600; }
.search-note .link { margin-left: auto; padding: 0; font-size: 13px; }
.item .d.two { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item .end .kind { margin-top: 4px; display: flex; justify-content: flex-end; }
.item.gone .t { color: var(--dim); text-decoration: line-through; text-decoration-color: var(--faint); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.note-block { padding: 12px 14px; border-radius: var(--radius-s); border: 1px dashed var(--hairline-2); color: var(--dim); font-size: 14px; white-space: pre-wrap; word-break: break-word; }

/* ── Notifications ─────────────────────────────────────────────────── */
.pref { display: flex; align-items: center; gap: 12px; padding: 13px 14px; cursor: pointer; position: relative; min-height: 60px; }
.pref + .pref::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--hairline); }
.pref:active { background: var(--card-hi); }
.pref .body { flex: 1; min-width: 0; }
.pref .t { font-weight: 600; }
.pref .d { font-size: 12.5px; color: var(--dim); }
.pref.off .t { color: var(--dim); }
.pref.master { background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0)); }
.list.dimmed .pref:not(.master) { opacity: .45; }
.slider { padding: 14px; }
.slider .top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.slider .top .val { font-size: 22px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--accent); }
.slider .scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 6px; font-variant-numeric: tabular-nums; }
input.range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; }
input.range:focus { outline: none; }
input.range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 0%), var(--card-hi) var(--fill, 0%));
}
input.range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--card-hi); }
input.range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
input.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; margin-top: -9px;
  background: var(--text); border: 4px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
input.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 4px solid var(--accent); }
.locked { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--card); border: 1px solid var(--hairline); font-size: 13px; color: var(--dim); }
.locked .ic { color: var(--faint); margin-top: 1px; }

/* ── Statistics ────────────────────────────────────────────────────── */
.cols { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; align-items: end; height: 120px; }
.cols .col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.cols .col i { display: block; width: 100%; border-radius: 4px 4px 2px 2px; background: var(--card-hi); min-height: 2px; }
.cols .col i.win { background: var(--accent); border-radius: 2px; margin-top: 2px; }
.cols .col.today i:not(.win) { background: #3a4248; }
.cols-axis { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; margin-top: 6px; font-size: 10px; color: var(--faint); text-align: center; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--dim); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--card-hi); }
.legend i.win { background: var(--accent); }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; }
.hours i { display: block; height: 30px; border-radius: 4px; background: var(--accent); }
.hours-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.scope-line { display: flex; align-items: center; gap: 8px; margin: 2px 4px 12px; font-size: 13px; color: var(--dim); }
.scope-line .ic { color: var(--accent); }

.step-dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 18px; }
.step-dots i { width: 22px; height: 4px; border-radius: 2px; background: var(--card-hi); }
.step-dots i.on { background: var(--accent); }
.big-ok { width: 72px; height: 72px; border-radius: 22px; margin: 18px auto 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }

/* ── Notice: session running out, an action to repeat, offline snapshot ── */
.notice {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 9px 12px;
  border-radius: var(--radius-s); border: 1px solid rgba(255, 190, 70, .28);
  background: rgba(255, 190, 70, .07); color: var(--text); font-size: 13px;
}
.notice[hidden] { display: none; }
.notice .ic { color: var(--amber); }
.notice span { flex: 1; min-width: 0; }
.notice .link { padding: 0 2px; font-size: 13px; font-weight: 650; color: var(--accent); white-space: nowrap; }
.notice .icon-btn { width: 44px; height: 44px; margin: -10px -10px -10px 0; background: none; border: 0; }

/* ── Разбор: one card at a time ─────────────────────────────────────── */
.tri-progress { display: flex; align-items: center; gap: 10px; margin: 2px 2px 12px; font-size: 12.5px; color: var(--dim); }
.tri-progress .progress { flex: 1; margin: 0; }
.tri-kind { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.tri-kind .badge .ic { margin-right: 4px; }
.tri-title { font-size: 18px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.tri-meta { margin-top: 4px; color: var(--dim); font-size: 14px; }
.tri-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0 12px; font-size: 13px; color: var(--dim); }
.tri-facts span { display: inline-flex; align-items: center; gap: 5px; }
.tri-card .text-block { margin-top: 2px; }
.action-dock.tri { flex-direction: column; }
.action-dock.tri .btn-row .btn { height: 42px; font-size: 14px; padding: 0 8px; }
.action-dock.tri .btn.primary { height: 50px; font-size: 16px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Pulse: something new since the list was loaded ─────────────────── */
.tab { position: relative; }
.tab.fresh::after {
  content: ""; position: absolute; top: 8px; right: calc(50% - 17px);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--ground);
}
.pulse-pill {
  display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  margin: 0 0 10px; padding: 10px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--keyline); background: var(--accent-soft); color: var(--accent);
  font-size: 13.5px; font-weight: 650;
}
.profile .key-more { display: block; margin: 6px 0 -6px; font-size: 13px; }
.fact .v.warn { color: var(--amber); }

/* ── Feed, owner side ─────────────────────────────────────────────────── */
.item.unread .t { font-weight: 750; }
.item.unread .t::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px;
  border-radius: 50%; background: var(--accent); vertical-align: middle; }
.note-input { height: auto; min-height: 84px; padding: 12px 14px; line-height: 1.45; resize: vertical; font-size: 14.5px; }
.section-label .more { display: inline-flex; align-items: center; gap: 4px; }
.search.plain .input { padding-left: 14px; }

/* ── Converter: the pair's line ───────────────────────────────────────── */
.spark-box { padding: 12px 14px; margin-top: 10px; }
.spark-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.spark-top .seg { width: auto; }
.spark-top .seg button { padding: 0 12px; height: 30px; font-size: 12.5px; }
.spark { display: block; width: 100%; height: 64px; margin-top: 10px; }
.spark polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark.up polyline { stroke: var(--green); }
.spark.down polyline { stroke: var(--red); }
.spark.up polygon { fill: rgba(94, 224, 142, .10); }
.spark.down polygon { fill: rgba(255, 107, 107, .10); }
.spark-foot { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--dim); }

/* ── Proofs: profile screenshots, full width ──────────────────────────── */
/* The box takes the picture's own shape before the bytes arrive (the server
   sends width/height), so the page does not jump; the shimmer moves, it never
   fades — a throttled WebView would hold a fade at zero. */
.proof { margin: 0 0 16px; }
.proof .shot { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--hairline); background: var(--card); }
.proof .shot img { display: block; width: 100%; height: 100%; object-fit: contain; }
.proof .shot img:not([src]) { visibility: hidden; }
.proof .shot.broken { display: grid; place-items: center; padding: 16px; text-align: center; font-size: 13px; color: var(--dim); }
.proof .shot.broken .ic { margin: 0 auto 6px; color: var(--amber); }
.proof figcaption { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 4px 4px 0; font-size: 12.5px; color: var(--dim); }
.proof figcaption > span { display: inline-flex; align-items: center; gap: 6px; }
.proof figcaption .link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.link.danger { color: var(--red); }
.btn.busy { pointer-events: none; }
.btn.busy .ic { animation: spin .8s linear infinite; }
/* Opened by its <label>: transparent rather than display:none, which some
   WebViews refuse to open a picker for. */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

/* Offline: a snapshot is for reading — nothing that writes can be pressed. */
body.offline .action-dock, body.offline .gw-x, body.offline .tri-card ~ .action-dock { display: none; }
