/* ===== Design tokens ===== */
:root {
  color-scheme: light;
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --ink: #0f172a;
  --ink-2: #475569;
  --muted: #8a94a6;
  --line: #e5e9f2;
  --grid: #edf0f6;
  --baseline: #c9d0de;
  --accent: #2a78d6;
  --accent-strong: #1f63c2;
  --accent-soft: rgba(42, 120, 214, 0.10);
  --violet: #6250d6;
  --danger-ink: #c23434;
  --good-ink: #0a7a0a;
  --warn-ink: #935a00;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --series-1: #2a78d6;
  --series-1-hover: #5598e7;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.04);
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.10);
  --radius: 16px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  interpolate-size: allow-keywords;
  font: 15px/1.55 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b1020;
    --surface: #121a2b;
    --surface-2: #172135;
    --ink: #e8ecf4;
    --ink-2: #a9b3c6;
    --muted: #6f7a90;
    --line: #222c42;
    --grid: #1e283b;
    --baseline: #34405a;
    --accent: #5a9cec;
    --accent-strong: #2f6fd0;
    --accent-soft: rgba(90, 156, 236, 0.14);
    --danger-ink: #ff8f8f;
    --good-ink: #4fd34f;
    --warn-ink: #f2b544;
    --series-1: #3987e5;
    --series-1-hover: #6da7ec;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  }
}

/* ===== Base ===== */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -0.01em; }
h1 { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: 16px; font-weight: 650; margin: 0; }
h3 { font-size: 15px; font-weight: 650; margin: 0 0 4px; }
p { margin: 0 0 12px; }
code { font-size: 0.92em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.profile .status { margin-left: auto; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.center { text-align: center; }
[id] { scroll-margin-top: 20px; }  /* anchors (#crypto, #history) never land under a sticky header */

/* ===== Shell: sidebar + content ===== */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px 16px; background: var(--surface); border-right: 1px solid var(--line);
}
.brand { order: 0; display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand b { display: block; font-size: 15px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px; letter-spacing: 0.02em;
  background: linear-gradient(135deg, #1b4f9c 0%, #2a78d6 55%, #6250d6 100%);
  box-shadow: 0 8px 18px rgba(42, 120, 214, 0.35);
}
.nav { order: 1; display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--ink-2); font-weight: 550;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.badge {
  margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--accent-strong); color: #fff; font-size: 12px; font-weight: 700;
}
.sidebar-foot { order: 2; margin-top: auto; display: grid; gap: 8px; padding: 14px 10px 6px; border-top: 1px solid var(--line); }
.conn { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); }
.dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--good); box-shadow: 0 0 0 3px rgba(12, 163, 12, 0.15); }
.dot.warn { background: var(--warning); box-shadow: 0 0 0 3px rgba(250, 178, 25, 0.18); }
.dot.off { background: var(--critical); box-shadow: 0 0 0 3px rgba(208, 59, 59, 0.15); }
a.conn { margin: -4px -8px; padding: 4px 8px; border-radius: 8px; color: var(--ink-2); }
a.conn:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.logout { order: 3; margin: 6px 0 0; }
.logout button {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 10px;
  background: none; color: var(--ink-2); font: inherit; font-weight: 550; cursor: pointer; text-align: left;
}
.logout button:hover { background: var(--surface-2); color: var(--ink); }
.content { min-width: 0; width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 32px 56px; }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    z-index: 10; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    padding: 10px 14px 8px; border-right: 0; border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  }
  .brand { flex: 1; padding: 0; }
  .logo { width: 34px; height: 34px; border-radius: 10px; font-size: 13px; }
  .logout { order: 1; margin: 0; }
  .logout button { width: auto; padding: 8px; }
  .logout .label { display: none; }
  .nav { order: 2; flex-basis: 100%; flex-direction: row; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 2px 4px; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; padding: 7px 12px; gap: 8px; font-size: 14px; }
  .nav .icon { width: 18px; height: 18px; }
  .nav .badge { margin-left: 2px; }
  .sidebar-foot { display: none; }
  .content { padding: 18px 16px 40px; }
  [id] { scroll-margin-top: 124px; }
}

/* ===== Page header, notices ===== */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; color: var(--ink-2); font-size: 13px; font-weight: 550; }
.notice {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.notice .icon { margin-top: 2px; }
.notice > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notice .notice-action { flex: none; align-self: center; margin: -4px -6px -4px 4px; }
.notice.compact { margin: 10px 0 0; padding: 10px 12px; box-shadow: none; font-size: 13.5px; }
.notice.compact .icon { width: 18px; height: 18px; }
@media (max-width: 560px) {
  .notice { flex-wrap: wrap; }
  .notice .notice-action { margin: 2px 0 0 30px; }
}
.notice.ok { border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
.notice.ok .icon { color: var(--good); }
.notice.error { border-color: color-mix(in srgb, var(--critical) 40%, var(--line)); }
.notice.error .icon { color: var(--critical); }
.notice.warn { border-color: color-mix(in srgb, var(--warning) 50%, var(--line)); }
.notice.warn .icon { color: #c98500; }
.errors { margin: 0 0 16px; padding: 12px 16px 12px 36px; border-radius: 12px; background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--critical) 40%, var(--line)); }

/* ===== Cards & grids ===== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title { display: flex; align-items: center; gap: 12px; }
.card-title p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.icon-badge { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.icon-badge.violet { background: rgba(98, 80, 214, 0.12); color: var(--violet); }
.icon-badge.green { background: rgba(12, 163, 12, 0.12); color: #0a8a0a; }
.icon-badge.orange { background: rgba(236, 131, 90, 0.16); color: #c45a2b; }
@media (prefers-color-scheme: dark) {
  .icon-badge.violet { color: #a49af0; } .icon-badge.green { color: #3fcf3f; } .icon-badge.orange { color: #f2a07f; }
}
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); margin-bottom: 16px; }
.grid > .card, .split > .card { margin-bottom: 0; }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); margin-bottom: 16px; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } }
.card.narrow { max-width: 860px; }

/* ===== Overview: hero + KPI tiles ===== */
.kpis { display: grid; gap: 16px; grid-template-columns: 1.6fr 1fr 1fr; margin-bottom: 16px; }
.hero {
  grid-row: span 2; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  padding: 24px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, #17468c 0%, #2a78d6 58%, #6250d6 100%);
  box-shadow: 0 18px 40px rgba(42, 120, 214, 0.28);
}
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.hero::before { right: -70px; top: -90px; width: 260px; height: 260px; background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 70%); }
.hero::after { left: 40%; bottom: -120px; width: 280px; height: 280px; background: radial-gradient(circle, rgba(255, 255, 255, 0.10), transparent 70%); }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; }
.hero .label { display: flex; align-items: center; gap: 10px; font-weight: 600; opacity: 0.92; }
.hero .label .icon-badge { background: rgba(255, 255, 255, 0.16); color: #fff; }
.hero .value { position: relative; font-size: 46px; font-weight: 750; line-height: 1.05; letter-spacing: -0.03em; }
.hero-foot { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: 14px; opacity: 0.95; }
.pill-glass { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-weight: 650; font-size: 13px; }
.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 18px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
a.tile:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tile .icon-badge { margin-bottom: 8px; }
.tile .value { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.tile .label { color: var(--ink-2); font-size: 13px; font-weight: 550; }
.tile .note { color: var(--muted); font-size: 12.5px; }
.kpis.kpis-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.actions.center { justify-content: center; }
@media (max-width: 960px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .hero { grid-column: 1 / -1; grid-row: auto; }
  .hero .value { font-size: 38px; }
}

/* ===== Lists: new applications, upcoming consultations ===== */
.todo, .agenda { list-style: none; margin: 0; padding: 0; }
.todo li, .agenda li { display: flex; align-items: center; gap: 12px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.todo li { flex-wrap: wrap; }
.todo li:last-child, .agenda li:last-child { border-bottom: 0; padding-bottom: 0; }
.todo li:first-child, .agenda li:first-child { padding-top: 0; }
.todo-main { flex: 1; min-width: 180px; display: flex; flex-direction: column; color: var(--ink); }
.todo-main:hover { text-decoration: none; }
.todo-main:hover strong { color: var(--accent); }
.todo-main span { color: var(--ink-2); font-size: 13px; }
.when { flex: none; width: 54px; text-align: center; border-radius: 12px; padding: 6px 0; background: var(--surface-2); border: 1px solid var(--line); }
.when b { display: block; font-size: 17px; line-height: 1.1; }
.when small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.agenda .todo-main { min-width: 0; }
.link-ok { color: #0a8a0a; } .link-missing { color: #b26f00; }
@media (prefers-color-scheme: dark) { .link-ok { color: #3fcf3f; } .link-missing { color: #f2b544; } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 12px; text-align: center; color: var(--ink-2); }
.empty .icon-badge { width: 48px; height: 48px; border-radius: 14px; }

/* ===== Avatars ===== */
.avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
}
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }
.av-0 { background: linear-gradient(135deg, #1f5fb8, #2a78d6); }
.av-1 { background: linear-gradient(135deg, #4b3bb8, #6250d6); }
.av-2 { background: linear-gradient(135deg, #0b7a55, #13996a); }
.av-3 { background: linear-gradient(135deg, #b24718, #d15a26); }
.av-4 { background: linear-gradient(135deg, #a8366a, #c84a83); }
.av-5 { background: linear-gradient(135deg, #2b6b2b, #2f8a2f); }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who a { font-weight: 600; color: var(--ink); }
.who a:hover { color: var(--accent); text-decoration: none; }

/* ===== Status chips: a coloured dot + a label (the colour never carries meaning alone) ===== */
.status {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 9px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.st-pending::before { background: var(--warning); }
.st-awaiting_payment::before { background: var(--serious); }
.st-paid::before { background: var(--good); }
.st-rejected::before { background: var(--critical); }
.st-cancelled::before { background: var(--critical); }
/* money transfers and checks */
.st-done::before, .st-activated::before { background: var(--good); }
.st-active::before { background: var(--warning); }
.st-failed::before { background: var(--critical); }
.st-unknown::before { background: var(--serious); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.chip .icon { width: 14px; height: 14px; }
button.chip { font-family: inherit; line-height: inherit; cursor: pointer; }
a.chip:hover, button.chip:hover { text-decoration: none; color: var(--ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.chip.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.chip.good { color: var(--good-ink); background: color-mix(in srgb, var(--good) 11%, var(--surface)); border-color: transparent; }
.chip.warn { color: var(--warn-ink); background: color-mix(in srgb, var(--warning) 17%, var(--surface)); border-color: transparent; }
.chip .count { min-width: 20px; padding: 0 6px; border-radius: 999px; text-align: center; font-size: 11.5px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--line); }
.chip.zero { opacity: 0.45; }

/* ===== Tabs ===== */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; margin-bottom: 16px; width: fit-content; max-width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.tabs a:hover { text-decoration: none; background: var(--surface-2); color: var(--ink); }
.tabs a.active { background: var(--accent-soft); color: var(--accent); }
.tabs .count { font-size: 12px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.tabs a.active .count { background: var(--accent-strong); color: #fff; }
.tabs .dot { margin-left: 2px; }
@media (max-width: 720px) {
  .settings-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .settings-tabs a { justify-content: center; }
}

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { text-align: left; padding: 10px 12px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); }
td { text-align: left; padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
@media (max-width: 720px) {
  .hide-sm { display: none; }
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.stack-sm tr:last-child { border-bottom: 0; }
  table.stack-sm td { border: 0; padding: 3px 0; }
  table.stack-sm tbody tr:hover td { background: none; }
  table.stack-sm td.hide-sm { display: none; }
  table.stack-sm td.num { text-align: left; }
  table.stack-sm td.num:empty { display: none; }
  .row-actions { justify-content: flex-start; flex-wrap: wrap; }
}

/* ===== Buttons ===== */
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent; background: var(--accent-strong); color: #fff;
  font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn:hover { background: color-mix(in srgb, var(--accent-strong) 86%, #000); text-decoration: none; color: #fff; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn.secondary:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--surface); color: var(--danger-ink); border-color: color-mix(in srgb, var(--critical) 35%, var(--line)); box-shadow: var(--shadow-sm); }
.btn.danger:hover { background: color-mix(in srgb, var(--critical) 8%, var(--surface)); color: var(--danger-ink); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn.square { width: 34px; padding: 0; }
.btn.xs { height: 28px; padding: 0 10px; gap: 6px; border-radius: 8px; font-size: 12.5px; font-weight: 600; }
.btn .icon { width: 18px; height: 18px; }
.btn.xs .icon { width: 14px; height: 14px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn.copied { color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.actions .push { margin-left: auto; }
form.inline { display: inline; }

/* ===== Forms ===== */
.form-section { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px 32px; padding: 24px 0; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section:not(.form-section + .form-section) { padding-top: 4px; }  /* also when a notice was put above it */
.form-section:last-child { padding-bottom: 2px; }
.section-info { display: flex; gap: 12px; align-items: flex-start; }
.section-info p { margin: 0; font-size: 13px; color: var(--ink-2); }
@media (max-width: 880px) { .form-section { grid-template-columns: 1fr; gap: 14px; } }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
input[type=text], input[type=number], input[type=password], input[type=url], input[type=time], input[type=search], textarea, select {
  width: 100%; min-height: 42px; padding: 9px 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--baseline); border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input.mono, textarea.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", monospace; font-size: 13.5px; }
input[readonly] { background: var(--surface-2); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
fieldset:disabled .segmented, fieldset:disabled .check-chip, fieldset:disabled .switch { opacity: 0.6; cursor: not-allowed; }
input.short-input { max-width: 160px; }
input[type=file] { width: 100%; padding: 10px; border: 1px dashed var(--baseline); border-radius: 10px; background: var(--surface-2); font: inherit; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.switch input {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 40px; height: 24px; margin: 0;
  border-radius: 999px; background: var(--baseline); cursor: pointer; transition: background 0.2s;
}
.switch input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s var(--ease-out);
}
.switch input:checked { background: var(--accent-strong); }
.switch input:checked::after { transform: translateX(16px); }
.switch input:focus-visible, .segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 9px; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.segmented input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
details.optional { margin: 4px 0 16px; padding: 12px 16px; border: 1px dashed var(--baseline); border-radius: 12px; }
details.optional summary { cursor: pointer; color: var(--ink-2); font-weight: 600; }
details.optional[open] summary { margin-bottom: 14px; }
details.optional > :last-child { margin-bottom: 0; }
details summary { cursor: pointer; }
@media (max-width: 480px) {
  .segmented { display: flex; width: 100%; }
  .segmented label { flex: 1 1 auto; }
  .segmented span { width: 100%; justify-content: center; padding: 8px 10px; }
}
.switch-list { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.row.tight { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.top-gap { margin-top: 22px; }
.input-group { display: flex; gap: 8px; }
.input-group > input, .input-group > select { flex: 1; min-width: 0; }
.input-group > .btn { flex: none; height: auto; min-height: 42px; }
.input-group > .btn.square { width: 42px; }

/* checkboxes that look like chips (platforms, coins) */
.check-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { position: relative; }
.check-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.check-chip span {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 14px 7px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--baseline); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 14px;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.check-chip span::before {
  content: ""; flex: none; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--baseline);
  background: var(--surface) no-repeat center / 12px; transition: background-color 0.15s, border-color 0.15s;
}
.check-chip input:checked + span { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--accent-soft); }
.check-chip input:checked + span::before {
  border-color: var(--accent-strong); background-color: var(--accent-strong);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-6.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.check-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* RU / EN side by side */
.lang-cols { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.lang-cols.single { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 720px) { .lang-cols { grid-template-columns: minmax(0, 1fr); } }
.lang-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 11px; font-weight: 750; letter-spacing: 0.05em;
}
.lang-input { display: grid; gap: 6px; min-width: 0; }
.lang-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.counter { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.counter.near { color: var(--warn-ink); font-weight: 650; }

/* numbered "how to get it" steps */
.how { margin: 0; padding: 0 0 0 20px; color: var(--ink-2); font-size: 13.5px; }
.how li { margin: 4px 0; padding-left: 2px; }
.how b { color: var(--ink); font-weight: 600; }
.field .how, .subform .how { margin: 10px 0 12px; }
.bullets { margin: 0 0 16px; padding: 0 0 0 18px; color: var(--ink-2); font-size: 13.5px; }
.bullets li { margin: 4px 0; }

/* weekly schedule editor */
.schedule { display: grid; gap: 4px; }
.day-row { display: grid; grid-template-columns: 158px 120px 14px 120px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.day-row:hover { background: var(--surface-2); }
.day-row .slots-note { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-row input[type=time] { min-height: 38px; padding: 6px 10px; }
@media (max-width: 640px) {
  .day-row { grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr); padding: 8px 4px; }
  .day-row .switch { grid-column: 1 / -1; }
  .day-row .slots-note { grid-column: 1 / -1; }
}

/* ===== Facts (key/value) ===== */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; }
dl.facts dt { color: var(--muted); display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.profile { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 18px; }
.profile > div { min-width: 0; overflow-wrap: anywhere; }
.profile h2 { font-size: 20px; }

/* ===== Lessons grid ===== */
.lesson-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.lesson { display: flex; flex-direction: column; overflow: hidden; padding: 0; margin: 0; }
.lesson-cover {
  position: relative; height: 112px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #17468c 0%, #2a78d6 58%, #6250d6 100%);
}
.lesson-cover.off { background: linear-gradient(135deg, #59647a, #7d889c); }
.lesson-cover .play { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(4px); }
.lesson-cover .chip { position: absolute; top: 12px; left: 12px; background: rgba(255, 255, 255, 0.18); border-color: transparent; color: #fff; }
.lesson-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; flex: 1; }
.lesson-body h3 { margin: 0; font-size: 16px; }
.lesson-body h3 a { color: var(--ink); }
.lesson-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: 13px; }
.lesson-stats b { color: var(--ink); }
.lesson .actions { margin-top: auto; }

/* ===== Bot preview (phone) ===== */
.phone { max-width: 340px; margin: 0 auto; padding: 14px; border-radius: 28px; background: var(--surface-2); border: 1px solid var(--line); }
.phone-bar { display: flex; align-items: center; gap: 10px; padding: 4px 4px 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.phone-bar .logo { width: 32px; height: 32px; border-radius: 50%; font-size: 12px; box-shadow: none; }
.phone-bar b { display: block; font-size: 14px; } .phone-bar small { color: var(--muted); font-size: 12px; }
.bubble { width: fit-content; max-width: 90%; padding: 9px 13px; border-radius: 16px 16px 16px 4px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 8px; font-size: 14px; }
.menu-preview { display: grid; gap: 6px; }
.menu-preview span { display: block; text-align: center; padding: 9px; border-radius: 10px; font-size: 14px; font-weight: 550;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--ink); }
.menu-preview span.off { opacity: 0.4; text-decoration: line-through; }
.menu-preview a.more { display: block; text-align: center; padding: 8px; border-radius: 10px; font-size: 13px; color: var(--ink-2); border: 1px dashed var(--baseline); }
.menu-preview a.more:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.bubble { overflow-wrap: anywhere; }
.menu-layout { display: grid; gap: 24px 32px; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; margin-bottom: 18px; }
@media (max-width: 1100px) { .menu-layout { grid-template-columns: minmax(0, 1fr); } }
.preview { margin: 0; }
.preview figcaption { margin-top: 8px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ===== Settings pages: section links, setup steps, connection state ===== */
.jump { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.jump .chip { padding: 5px 12px; }
.jump.after-steps { margin: 16px 0 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.steps a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); }
.steps a:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.steps .num {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  color: var(--ink-2); background: var(--surface); border: 1.5px dashed var(--baseline);
}
.steps .done .num { color: #fff; background: var(--good); border: 0; }
.steps .done .num .icon { stroke-width: 2.6; }
.steps b { display: block; font-size: 14.5px; }
.steps small { display: block; color: var(--danger-ink); font-size: 12.5px; }
.steps .done small { color: var(--good-ink); }
.state {
  display: flex; align-items: flex-start; gap: 11px; padding: 11px 14px; margin-bottom: 18px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; overflow-wrap: anywhere;
}
.state > .dot { margin-top: 8px; }
.state small { display: block; margin-top: 1px; font-weight: 400; font-size: 13px; color: var(--ink-2); }
.state.on { border-color: color-mix(in srgb, var(--good) 35%, var(--line)); background: color-mix(in srgb, var(--good) 5%, var(--surface-2)); }
.state.off { border-color: color-mix(in srgb, var(--critical) 35%, var(--line)); background: color-mix(in srgb, var(--critical) 4%, var(--surface-2)); }
.state.warn { border-color: color-mix(in srgb, var(--warning) 50%, var(--line)); background: color-mix(in srgb, var(--warning) 7%, var(--surface-2)); }
.conn-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.conn-grid .conn { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13.5px; }
.conn-grid .conn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.people { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.people li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.people .icon-badge { width: 34px; height: 34px; border-radius: 50%; }
.person { flex: 1; min-width: 110px; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.person small { color: var(--muted); font-size: 12.5px; }
.subform { padding-top: 18px; border-top: 1px dashed var(--line); }
.subform h4 { margin: 0 0 4px; font-size: 14.5px; }
.icon-badge.result { width: 52px; height: 52px; border-radius: 16px; margin-bottom: 16px; }
.icon-badge.result .icon { width: 26px; height: 26px; }
.icon-badge.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-ink); }
.icon-badge.bad { background: color-mix(in srgb, var(--critical) 12%, transparent); color: var(--danger-ink); }

/* ===== Bot texts editor ===== */
.text-toolbar { display: grid; gap: 14px; }
.text-toolbar .jump, .text-toolbar .hint { margin: 0; }
.text-toolbar .hint code { font-size: 12px; white-space: nowrap; }
.toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }
.search { position: relative; display: block; flex: 1 1 280px; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 42px; }
.text-group > .card-head { margin-bottom: 0; padding-bottom: 14px; }
.text-item { padding: 18px 0; border-top: 1px solid var(--line); }
.text-item:last-child { padding-bottom: 2px; }
.text-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 10px; }
.text-item-head h3 { margin: 0; font-size: 14.5px; }
.text-field { min-width: 0; }
.text-field-head { display: flex; align-items: center; gap: 8px; min-height: 28px; margin-bottom: 6px; }
.text-field-head label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.text-field-head .btn, .text-field-head .counter { margin-left: auto; }
.text-field-head .counter + .btn { margin-left: 0; }
.check-row { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 550; }
.check-row input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent-strong); cursor: pointer; }
.text-field textarea { min-height: 0; }
.text-field.dirty :is(textarea, input) { border-color: color-mix(in srgb, var(--accent) 70%, var(--baseline)); background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.text-field.has-error :is(textarea, input) { border-color: var(--critical); }
.field-error { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; color: var(--danger-ink); font-size: 13px; font-weight: 550; }
.field-error .icon { margin-top: 2px; }
.placeholders { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.placeholders code { padding: 0; border: 0; background: none; color: var(--accent); font-size: 12px; }
.save-bar {
  position: sticky; bottom: 16px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  padding: 12px 12px 12px 18px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
}
.save-state { flex: 1 1 200px; display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 600; }
.save-state::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.save-bar.dirty { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.save-bar.dirty .save-state { color: var(--ink); }
.save-bar.dirty .save-state::before { background: var(--warning); box-shadow: 0 0 0 3px rgba(250, 178, 25, 0.22); }
@media (max-width: 720px) {
  .save-bar { bottom: 8px; gap: 8px; padding: 8px 8px 8px 14px; }
  .save-state { flex: 1 1 120px; font-size: 13.5px; }
}

/* ===== Money ===== */
.total { text-align: right; line-height: 1.25; }
.total small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; }
.total b { font-size: 20px; font-weight: 750; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.coins { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.coin { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.coin-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.coin-mark {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 800; background: var(--accent-strong);
}
.c-usdt { background: #1a8f6b; } .c-ton { background: #0a7fc4; } .c-btc { background: #d97b0d; } .c-eth { background: #5468d4; }
.c-ltc { background: #345d9d; } .c-bnb { background: #b8860b; } .c-trx { background: #c8102e; } .c-usdc { background: #2470c2; }
.c-sol { background: #7a3fe0; } .c-doge { background: #9c7f22; }
.coin .value { font-size: 24px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.coin .note { color: var(--ink-2); font-size: 13px; }
.check-link { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 13px; }
.check-link a { display: inline-flex; align-items: center; gap: 4px; }

/* ===== Charts ===== */
.chart { margin: 0; position: relative; outline: none; }
.chart:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 12px; }
.chart-body { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--baseline); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .peak { fill: var(--ink-2); font-size: 12px; font-weight: 650; }
.chart .bars path { fill: var(--series-1); }
.chart .bars path.active { fill: var(--series-1-hover); }
.chart .hits rect { fill: transparent; cursor: crosshair; }
.chart .empty { fill: var(--muted); font-size: 13px; }
@media (max-width: 720px) {
  .chart .tick, .chart .peak { font-size: 20px; }
  .chart .empty { font-size: 22px; }
}
.tooltip {
  position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; white-space: nowrap; z-index: 2;
  display: flex; flex-direction: column; padding: 7px 11px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px;
}
.tooltip strong { font-size: 14px; }
.tooltip span { color: var(--ink-2); }
.chart-total { color: var(--ink-2); font-size: 13px; font-weight: 600; }
progress { width: 100%; height: 8px; accent-color: var(--series-1); }

/* ===== Login ===== */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(42, 120, 214, 0.22), transparent 60%),
              radial-gradient(900px 500px at 110% 110%, rgba(98, 80, 214, 0.20), transparent 60%), var(--bg); }
.login { width: 100%; max-width: 400px; }
.login .card { padding: 30px; box-shadow: var(--shadow); border-radius: 22px; }
.login .logo { width: 52px; height: 52px; border-radius: 16px; font-size: 18px; margin-bottom: 18px; }
.login h1 { font-size: 24px; margin-bottom: 4px; }
.login .btn { width: 100%; height: 44px; margin-top: 6px; }
.login .notice code { overflow-wrap: anywhere; }

/* ===== Motion: short and purposeful; off when the OS asks for reduced motion ===== */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 4px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.content > * { animation: rise 0.32s var(--ease-out) backwards; }
.content > :nth-child(2) { animation-delay: 0.04s; }
.content > :nth-child(3) { animation-delay: 0.08s; }
.content > :nth-child(4) { animation-delay: 0.12s; }
.content > :nth-child(5) { animation-delay: 0.16s; }
.content > :nth-child(n+6) { animation-delay: 0.2s; }
.kpis > *, .todo li, .agenda li, .lesson-grid > *, .coins > *, .steps li { animation: rise 0.32s var(--ease-out) backwards; }
.kpis > :nth-child(2), .todo li:nth-child(2), .agenda li:nth-child(2), .lesson-grid > :nth-child(2), .coins > :nth-child(2), .steps li:nth-child(2) { animation-delay: 0.05s; }
.kpis > :nth-child(3), .todo li:nth-child(3), .agenda li:nth-child(3), .lesson-grid > :nth-child(3), .coins > :nth-child(3), .steps li:nth-child(3) { animation-delay: 0.1s; }
.kpis > :nth-child(n+4), .todo li:nth-child(n+4), .agenda li:nth-child(n+4), .lesson-grid > :nth-child(n+4), .coins > :nth-child(n+4), .steps li:nth-child(n+4) { animation-delay: 0.15s; }
/* the section a link or a redirect pointed at (#crypto, #history) flashes a ring once */
@keyframes ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-sm); }
                  to { box-shadow: 0 0 0 12px transparent, var(--shadow-sm); } }
.card:target { animation: ring 1.1s var(--ease-out) 0.1s; }
.login .card { animation: rise 0.35s var(--ease-out) backwards; }
.notice { animation: drop 0.25s var(--ease-out) backwards; transition: opacity 0.3s, transform 0.3s; }
.notice.hiding { opacity: 0; transform: translateY(-6px); }
.btn, .tile, .tabs a, .nav a, .logout button, .lesson, .chip, .steps a, .conn {
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.2s, transform 0.2s var(--ease-out), opacity 0.15s;
}
a.tile:hover, .lesson:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: scale(0.97); }
.btn.busy { pointer-events: none; opacity: 0.85; }
.btn.busy::before {
  content: ""; display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.todo li.leaving { opacity: 0; transform: translateX(16px); transition: opacity 0.2s, transform 0.2s var(--ease-out); }
.chart .bars path { transform-box: fill-box; transform-origin: bottom; animation: grow 0.5s var(--ease-out) backwards; transition: fill 0.12s; }
.chart .peak { animation: fade 0.3s ease 0.5s backwards; }
.tooltip:not([hidden]) { animation: pop 0.12s ease-out backwards; }
details.optional::details-content { height: 0; overflow: clip; transition: height 0.25s var(--ease-out), content-visibility 0.25s allow-discrete; }
details.optional[open]::details-content { height: auto; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
.retry-form { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.retry-form input[type=password] { width: 150px; min-height: 34px; padding: 5px 10px; }
.cancel-app { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.side-stack > .card { margin-bottom: 0; }
.share-body { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.share-body .qr { flex: none; width: 148px; height: 148px; padding: 6px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.share-info { flex: 1; min-width: 180px; display: grid; gap: 10px; }
.share-link { font-weight: 650; font-size: 15px; overflow-wrap: anywhere; }
.share-info .hint { margin: 0; }
