:root {
  color-scheme: dark;
  --bg: #0F1013; --s1: #1A1C21; --s2: #23262D; --ln: #2E323A; --ln2: #3A3E47;
  --ink: #F4F5F7; --soft: #C4C8D0; --mut: #A3A8B3; --dim: #8C919C;
  --y: #E4FF3C; --b: #5AB8FF; --bad: #FF8A7A;
}
* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 Inter, system-ui, sans-serif; overflow-x: clip;
}
h1, h2, h3 { font-family: "Space Grotesk", Inter, sans-serif; letter-spacing: -0.02em; line-height: 1.08; margin: 0; }
h1 { font-size: 32px; }
h2 { font-size: 22px; }
p { margin: 0; }
a { color: var(--y); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--b); outline-offset: 2px; }

.view {
  max-width: 520px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 28px) 20px calc(env(safe-area-inset-bottom) + 110px);
  display: flex; flex-direction: column; gap: 16px;
}
.loading { color: var(--mut); padding: 40px 0; text-align: center; }
.muted { color: var(--mut); font-size: 14px; }
.small { font-size: 13px; color: var(--dim); }
.y { color: var(--y); } .b { color: var(--b); }

.logo { display: flex; align-items: center; gap: 10px; font: 700 20px "Space Grotesk", sans-serif; }

.card { background: var(--s1); border: 1px solid var(--ln); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card h2 { font-size: 20px; }
.label { font-size: 13px; font-weight: 600; color: var(--mut); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: 14px; border: 0;
  background: var(--y); color: #0F1013; font-weight: 700; font-size: 16px;
  text-decoration: none; cursor: pointer; width: 100%;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--ln2); }
.btn.dark { background: var(--s2); color: var(--ink); }
.btn.sm { min-height: 44px; width: auto; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.blue { background: var(--b); color: #0F1013; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid #5a3a36; }
.btn:disabled { opacity: .55; cursor: default; }

form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--mut); }
input, select, textarea {
  width: 100%; min-height: 48px; border-radius: 12px; border: 1px solid var(--ln);
  background: var(--s2); padding: 10px 12px; font-size: 16px;
}
textarea { min-height: 80px; resize: vertical; }
.time { display: flex; align-items: center; gap: 8px; }
.time input { width: 80px; }
.err { color: var(--bad); font-size: 14px; }

.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; background: var(--s1); border: 1px solid var(--ln); border-radius: 14px; padding: 4px; }
.seg button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--s2); }

.dot { width: 10px; height: 10px; border-radius: 5px; display: inline-block; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; border-radius: 10px; padding: 3px 9px; align-self: flex-start; }

.big { font: 700 34px/1.05 "Space Grotesk", sans-serif; }

.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.week div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--dim); }
.week .today { color: var(--ink); }
.wd { width: 12px; height: 12px; border-radius: 6px; border: 2px solid #3A3E47; }

.feed { display: flex; flex-direction: column; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--ln); }
.item:first-child { border-top: 0; }
.av { width: 36px; height: 36px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #0F1013; flex: none; }
.item .txt { flex: 1; display: flex; flex-direction: column; }
.item .t { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }

.st { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; }
.st .top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; align-items: baseline; flex-wrap: wrap; }
.st .nm { font-weight: 600; }
.st .w { color: var(--dim); font-weight: 500; }
.ctl { display: flex; align-items: center; gap: 8px; }
.arrow { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--ln); background: var(--s1); display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; padding: 0; }
.arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.bar { flex: 1; display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: var(--s2); }
.bar i { display: block; background: var(--y); }
.bar u { display: block; flex: 1; background: var(--b); }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-size: 12px; color: var(--mut); font-weight: 600; padding: 0 0 8px; }
td { padding: 10px 0; border-top: 1px solid var(--ln); vertical-align: middle; }
td.n, th.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td .w { display: block; font-size: 12px; color: var(--dim); }

.code { font: 700 26px "Space Grotesk", sans-serif; letter-spacing: .04em; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: #15171B; border-top: 1px solid #2A2D34;
  display: flex; justify-content: space-around;
  padding: 8px 8px calc(env(safe-area-inset-bottom) + 8px);
}
.tabs a { width: 64px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--mut); font-size: 12px; font-weight: 600; }
.tabs a[aria-current="page"] { color: var(--y); }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 96px); z-index: 20;
  background: var(--ink); color: #0F1013; font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 12px; max-width: calc(100% - 40px);
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.small a { color: var(--mut); }
