/* VPN Club — Telegram-native dashboard.
   Colours come from the Telegram theme (--tg-theme-*, set by the SDK or the
   inline boot script); the fallbacks are iOS light/dark system colours. */

:root {
  --bg: var(--tg-theme-secondary-bg-color, #efeff4);
  --section: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --text: var(--tg-theme-text-color, #000000);
  --hint: var(--tg-theme-hint-color, #6d6d72);
  --subtle: var(--tg-theme-subtitle-text-color, var(--hint));
  --link: var(--tg-theme-link-color, #1f72b8);
  --accent: var(--tg-theme-button-color, #2481cc);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --section-header: var(--tg-theme-section-header-text-color, var(--hint));
  --separator: var(--tg-theme-section-separator-color, rgba(60, 60, 67, 0.18));
  --destructive: var(--tg-theme-destructive-text-color, #d93025);
  --positive: #248a3d;
  --negative: #c4321f;
  --fill: rgba(118, 118, 128, 0.12);
  --fill-strong: rgba(118, 118, 128, 0.2);
  --chevron: rgba(60, 60, 67, 0.3);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  --bar: rgba(255, 255, 255, 0.72);
  --chart-grid: rgba(60, 60, 67, 0.1);
  --chart-muted: rgba(0, 122, 255, 0.28);
  --skeleton: rgba(118, 118, 128, 0.12);

  --radius: 12px;
  --gutter: 16px;
  --safe-top: max(env(safe-area-inset-top, 0px), var(--tg-content-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --tabbar-h: 62px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
}

:root[data-scheme="dark"] {
  --bg: var(--tg-theme-secondary-bg-color, #000000);
  --section: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #1c1c1e));
  --text: var(--tg-theme-text-color, #ffffff);
  --hint: var(--tg-theme-hint-color, #98989e);
  --link: var(--tg-theme-link-color, #3e9bff);
  --accent: var(--tg-theme-button-color, #3e88f7);
  --separator: var(--tg-theme-section-separator-color, rgba(84, 84, 88, 0.6));
  --positive: #30d158;
  --negative: #ff6961;
  --fill: rgba(118, 118, 128, 0.24);
  --fill-strong: rgba(118, 118, 128, 0.36);
  --chevron: rgba(235, 235, 245, 0.3);
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  --bar: rgba(36, 36, 40, 0.68);
  --chart-grid: rgba(235, 235, 245, 0.1);
  --chart-muted: rgba(62, 136, 247, 0.35);
  --skeleton: rgba(118, 118, 128, 0.2);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-scheme]) {
    --bg: #000000;
    --section: #1c1c1e;
    --text: #ffffff;
    --hint: #98989e;
    --link: #3e9bff;
    --accent: #3e88f7;
    --separator: rgba(84, 84, 88, 0.6);
    --positive: #30d158;
    --negative: #ff6961;
    --fill: rgba(118, 118, 128, 0.24);
    --fill-strong: rgba(118, 118, 128, 0.36);
    --chevron: rgba(235, 235, 245, 0.3);
    --bar: rgba(36, 36, 40, 0.68);
    --chart-grid: rgba(235, 235, 245, 0.1);
    --chart-muted: rgba(62, 136, 247, 0.35);
    --skeleton: rgba(118, 118, 128, 0.2);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.3 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body { overflow: hidden; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-decoration: none; }
svg { display: block; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.num { font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.app {
  position: fixed;
  inset: 0;
  height: var(--tg-viewport-stable-height, 100dvh);
  overflow: hidden;
}

/* ---------------------------------------------------------------- launch */
.launch {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 32px; text-align: center;
}
.launch__spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--fill-strong); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
.launch__text { margin: 0; max-width: 300px; color: var(--hint); font-size: 15px; line-height: 1.4; }
.launch--error .launch__spinner { display: none; }
.launch--error .launch__text { color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------- pager */
.pager { position: absolute; inset: 0; overflow: hidden; }
.pager__track {
  display: flex; height: 100%;
  will-change: transform;
  transform: translate3d(calc(var(--page, 0) * -100%), 0, 0);
}
.pager__track.is-animating { transition: transform 0.34s var(--ease); }

.pane {
  flex: 0 0 100%; width: 100%; height: 100%;
  overflow-x: hidden; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding: calc(var(--safe-top) + 8px) var(--gutter) calc(var(--tabbar-h) + var(--safe-bottom) + 34px);
}
.pane__inner { max-width: 640px; margin: 0 auto; }

/* nested pages (balance, source detail) slide over the pager */
.stack { position: absolute; inset: 0; pointer-events: none; }
.page {
  position: absolute; inset: 0;
  background: var(--bg);
  pointer-events: auto;
  transform: translate3d(100%, 0, 0);
  transition: transform 0.34s var(--ease);
  box-shadow: -12px 0 24px rgba(0, 0, 0, 0.08);
  z-index: 5;
}
.page.is-open { transform: translate3d(0, 0, 0); }
.page.is-dragging { transition: none; }
.page .pane { padding-bottom: calc(var(--safe-bottom) + 28px); }

/* ---------------------------------------------------------------- header */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 6px 4px 14px; }
.head__text { min-width: 0; }
.head__title {
  margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.12;
  overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.head__sub { display: block; margin-top: 3px; font-size: 15px; color: var(--hint); }
.head__link {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 3px; padding: 0; border: 0; background: none;
  font-size: 15px; color: var(--link);
}
.head__link svg { width: 12px; height: 12px; }
.head__action {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; margin-bottom: 2px; border: 0; border-radius: 50%;
  background: var(--fill); color: var(--link);
}
.head__action svg { width: 18px; height: 18px; }
.head__action.is-spinning svg { animation: spin 0.8s linear infinite; }

/* ----------------------------------------------------------------- flags */
.flag {
  position: relative; flex: none; display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.flag svg { width: 100%; height: 100%; }
.flag::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.flag--emoji { background: var(--fill); font-size: 18px; line-height: 1; }
.row[hidden] { display: none !important; }

/* -------------------------------------------------------------- bot card */
.botcard {
  display: flex; align-items: center; gap: 14px;
  width: 100%; margin: 6px 0 22px; padding: 14px 14px 14px 16px;
  border: 0; border-radius: var(--radius); background: var(--section);
  color: var(--text); text-align: left;
}
button.botcard:active { background: var(--fill); }
.botcard__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.botcard__title {
  font-size: 22px; font-weight: 700; letter-spacing: -0.4px; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.botcard__sub { font-size: 14px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.botcard__switch {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%; background: var(--fill); color: var(--hint);
}
.botcard__switch svg { width: 18px; height: 18px; }

.avatar {
  position: relative; flex: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #ffffff; font-weight: 700;
}
.avatar--sm { width: 30px; height: 30px; font-size: 13px; }
.avatar--lg { width: 56px; height: 56px; font-size: 24px; }
.avatar__img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  background: var(--section); opacity: 0; transition: opacity 0.2s;
}
.avatar__img.is-loaded { opacity: 1; }
.linkbtn { padding: 0; border: 0; background: none; color: var(--link); font-size: inherit; }

/* -------------------------------------------------------------- sections */
.section { margin: 0 0 22px; }
.section__title {
  margin: 0; padding: 0 16px 7px;
  font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.2px;
  color: var(--section-header);
}
.section__foot { margin: 0; padding: 7px 16px 0; font-size: 13px; line-height: 1.38; color: var(--hint); }
.group { background: var(--section); border-radius: var(--radius); overflow: hidden; }

.row {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 46px; padding: 0 14px 0 16px;
  border: 0; background: none; text-align: left; color: var(--text);
}
.row--icon { padding-left: 14px; }
.row + .row::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px;
  height: 1px; transform: scaleY(0.5); transform-origin: top; background: var(--separator);
}
.row--icon + .row::before, .row--icon + .row--icon::before { left: 56px; }
a.row:active, button.row:active { background: var(--fill); }
.row__body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 11px 0; }
.row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row__label { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__sub { margin-top: 2px; font-size: 13px; color: var(--hint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__value { flex: none; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.row__main { font-size: 16px; color: var(--hint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.row__main--strong { color: var(--text); font-weight: 600; }
.row__note { margin-top: 1px; font-size: 12px; color: var(--hint); white-space: nowrap; }
.row__chevron { flex: none; width: 8px; height: 13px; color: var(--chevron); }
.row__check { flex: none; width: 18px; height: 18px; color: var(--link); }

.tile {
  flex: none; width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #ffffff;
}
.tile svg { width: 18px; height: 18px; }
.tile--green { background: #34c759; }
.tile--orange { background: #ff9500; }
.tile--blue { background: #007aff; }
.tile--indigo { background: #5856d6; }
.tile--teal { background: #30b0c7; }
.tile--purple { background: #af52de; }
.tile--pink { background: #ff2d55; }
.tile--gray { background: #8e8e93; }
.tile--red { background: #ff3b30; }
.tile--text { font-size: 11px; font-weight: 700; letter-spacing: 0.2px; }

.spark { flex: none; width: 56px; height: 22px; color: var(--positive); }

.up { color: var(--positive) !important; }
.down { color: var(--negative) !important; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #34c759; }
.dot--stale { background: #ff9500; }
.dot--live { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(52, 199, 89, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); } }

/* ------------------------------------------------------------- hero card */
.card { background: var(--section); border-radius: var(--radius); padding: 14px 16px 12px; margin-bottom: 22px; }
.card__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.card__label { font-size: 13px; color: var(--hint); }
.card__value {
  display: block; margin-top: 1px;
  font-size: 30px; font-weight: 700; letter-spacing: -0.6px; line-height: 1.15;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.card__value small { font-size: 0.6em; font-weight: 600; color: var(--hint); letter-spacing: 0; }
.card__aside { text-align: right; font-size: 13px; color: var(--hint); line-height: 1.4; }
.card__aside b { display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.badge {
  display: inline-block; padding: 2px 7px; border-radius: 6px;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--fill); color: var(--hint);
}
.badge.up { background: rgba(52, 199, 89, 0.14); }
.badge.down { background: rgba(255, 59, 48, 0.12); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; color: var(--hint); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }

/* ----------------------------------------------------------------- chart */
.chart { position: relative; margin-top: 10px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart__axis { fill: var(--hint); font-size: 11px; font-family: var(--font); }
.chart__grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart__line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart__area { fill: var(--accent); opacity: 0.12; }
.chart__bar { fill: var(--chart-muted); transition: fill 0.15s; }
.chart__bar.is-last { fill: var(--accent); }
.chart__bar.is-hot, .chart__seg.is-hot { fill: var(--accent); opacity: 1; }
.chart__base { fill: var(--section); }
.chart__cursor { stroke: var(--hint); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart__dot { fill: var(--section); stroke: var(--accent); stroke-width: 2.4; opacity: 0; }
.chart.is-scrubbing .chart__cursor, .chart.is-scrubbing .chart__dot { opacity: 1; }
.chart__tip {
  position: absolute; top: -6px; left: 0;
  transform: translate(-50%, -100%);
  padding: 5px 9px; border-radius: 8px;
  background: var(--text); color: var(--section);
  font-size: 12px; line-height: 1.3; white-space: nowrap; text-align: center;
  pointer-events: none; opacity: 0; transition: opacity 0.12s;
  font-variant-numeric: tabular-nums;
}
.chart__tip b { font-weight: 600; }
.chart.is-scrubbing .chart__tip { opacity: 1; }
.chart__empty { display: flex; align-items: center; justify-content: center; height: 120px; color: var(--hint); font-size: 14px; }

.meter { height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.split { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden; margin-top: 12px; }
.split i { min-width: 3px; }
.split-row { padding: 14px 16px 10px; }
.split-row .split { margin: 0; }
.swatch { display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 3px; vertical-align: 0; }
.pane.is-loading .pane__inner > :not(.head):not(.periods):not(.periods__range) { opacity: 0.5; transition: opacity 0.2s; }

/* ------------------------------------------------------------- segmented */
.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  flex: 1; padding: 2px; border-radius: 9px; background: var(--fill);
}
.segmented button {
  height: 30px; border: 0; border-radius: 7px; background: none;
  font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap;
}
.segmented button[aria-pressed="true"] { background: var(--section); box-shadow: var(--shadow); font-weight: 600; }
:root[data-scheme="dark"] .segmented button[aria-pressed="true"] { background: #636366; }
.periods { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.periods__custom {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 0; border-radius: 9px; background: var(--fill); color: var(--link);
}
.periods__custom[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.periods__custom svg { width: 17px; height: 17px; }
.periods__range {
  display: inline-flex; align-items: center; gap: 4px;
  margin: -6px 4px 14px; padding: 0; border: 0; background: none;
  font-size: 14px; color: var(--link);
}
.periods__range svg { width: 13px; height: 13px; }

/* ---------------------------------------------------------------- tabbar */
/* Floating, translucent, fully rounded bar; content scrolls underneath it. */
.tabbar {
  --pill: rgba(36, 129, 204, 0.14);
  position: absolute; z-index: 4;
  left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--safe-bottom) + 10px);
  max-width: 520px; margin: 0 auto;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px;
  height: var(--tabbar-h); padding: 5px;
  border-radius: 999px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 0 0 0.5px var(--separator), 0 8px 28px rgba(0, 0, 0, 0.14);
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .tabbar { --pill: color-mix(in srgb, var(--accent) 15%, transparent); }
}
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 0; border: 0; border-radius: 999px; background: none; padding: 0;
  font-size: 10px; font-weight: 600; letter-spacing: 0.1px; color: var(--hint);
  transition: background-color 0.2s, color 0.2s;
}
.tabbar__item svg { width: 24px; height: 24px; }
.tabbar__item[aria-current="page"] { color: var(--accent); background: var(--pill); }
.tabbar__item:active { transform: scale(0.94); }
.tabbar__item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----------------------------------------------------------------- sheet */
.sheets { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.sheet-backdrop {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4);
  opacity: 0; transition: opacity 0.3s; pointer-events: auto;
}
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 86%; overflow-y: auto; overscroll-behavior: contain;
  padding: 8px var(--gutter) calc(var(--safe-bottom) + 20px);
  border-radius: 14px 14px 0 0; background: var(--bg);
  transform: translateY(100%); transition: transform 0.34s var(--ease);
  pointer-events: auto;
}
.sheets.is-open .sheet-backdrop { opacity: 1; }
.sheets.is-open .sheet { transform: none; }
.sheet__grip { width: 36px; height: 5px; border-radius: 3px; margin: 0 auto 10px; background: var(--fill-strong); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 14px; }
.sheet__title { margin: 0; font-size: 20px; font-weight: 700; }
.sheet__close { border: 0; background: none; color: var(--link); font-size: 16px; padding: 6px 4px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.field input {
  min-width: 0; padding: 6px 10px; border: 0; border-radius: 8px;
  background: var(--fill); font-variant-numeric: tabular-nums;
}
.search {
  width: 100%; height: 36px; margin: 0 0 12px; padding: 0 12px; border: 0; border-radius: 10px;
  background: var(--fill); font-size: 16px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border: 0; border-radius: 12px;
  font-size: 16px; font-weight: 600;
}
.btn--primary { background: var(--accent); color: var(--accent-text); }
.btn--plain { background: var(--section); color: var(--link); }
.btn--block { width: 100%; }

/* -------------------------------------------------------------- calendar */
.cal-summary { margin: -6px 4px 12px; font-size: 15px; font-weight: 600; min-height: 20px; }
.cal-presets { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.cal-presets::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 32px; padding: 0 14px; border: 0; border-radius: 16px;
  background: var(--section); color: var(--text); font-size: 14px; font-weight: 500; white-space: nowrap;
}
.chip:active { background: var(--fill); }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-week { padding: 0 0 6px; font-size: 12px; color: var(--hint); text-align: center; border-bottom: 1px solid var(--separator); }
.cal-scroll {
  max-height: min(48vh, 420px); overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -4px; padding: 0 4px;
}
.cal-month__title { margin: 14px 4px 6px; font-size: 16px; font-weight: 600; }
.cal-day {
  --band: rgba(36, 129, 204, 0.16);
  position: relative; height: 42px; padding: 0; border: 0; background: none;
  color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums;
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .cal-day { --band: color-mix(in srgb, var(--accent) 18%, transparent); }
}
.cal-day span {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
}
.cal-day:disabled { color: var(--hint); opacity: 0.4; }
.cal-day.is-today span { color: var(--accent); font-weight: 700; }
.cal-day.is-in { background: var(--band); }
.cal-day.is-start, .cal-day.is-end { background: linear-gradient(90deg, transparent 50%, var(--band) 50%); }
.cal-day.is-end { background: linear-gradient(90deg, var(--band) 50%, transparent 50%); }
.cal-day.is-start.is-end, .cal-day.is-start:not(.has-end) { background: none; }
.cal-day.is-start span, .cal-day.is-end span { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.cal-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 14px; }
.cal-actions .btn:disabled { opacity: 0.5; }

/* ---------------------------------------------------------------- states */
.state { padding: 36px 24px; text-align: center; color: var(--hint); font-size: 15px; line-height: 1.4; }
.state__title { margin: 0 0 6px; font-size: 17px; font-weight: 600; color: var(--text); }
.state .btn { margin-top: 16px; }
.notice {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--section); font-size: 14px; color: var(--hint);
}
.notice svg { flex: none; width: 18px; height: 18px; color: #ff9500; }
.notice button { margin-left: auto; border: 0; background: none; color: var(--link); font-size: 14px; font-weight: 600; }

.sk {
  display: block; border-radius: 6px; background: var(--skeleton);
  animation: shimmer 1.2s ease-in-out infinite;
}
@keyframes shimmer { 50% { opacity: 0.5; } }
.sk--title { width: 55%; height: 30px; margin: 10px 4px 18px; }
.sk--card { height: 190px; border-radius: var(--radius); margin-bottom: 22px; }
.sk--group { height: 140px; border-radius: var(--radius); margin-bottom: 22px; }

.toast {
  position: absolute; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 22px); z-index: 20;
  transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px;
  background: var(--text); color: var(--section);
  font-size: 14px; box-shadow: var(--shadow);
}

.updated { margin: -8px 0 0; text-align: center; font-size: 12px; color: var(--hint); }
.noscript { padding: 24px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
