@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/golos-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/golos-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/golos-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/golos-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --bg: #000000;
  --card: #3a3a3c;
  --field: #2a2a2c;
  --ink: #f5f5f7;
  --muted: #c8c8ce;
  --line: #85858b;
  --chip: #4a4a4e;
  --accent: #3e5c86;
  --on-accent: #f5f7fb;
  --sand: #d9c7a4;
  --sand-ink: #2c2416;
  --sand-text: #f6edd9;
  --sand-label: #e4d3ae;
  --ghost-line: #6e6e74;
  --task-ring: #8fbf7a;
  --close-line: var(--sand);
  --close-ink: var(--sand-text);
  --overdue: var(--sand-label);
  --scrim: rgba(0, 0, 0, 0.5);
  --time-bg: #d9c7a4;
  --time-ink: #2c2416;
  --time-line: #d9c7a4;
  --cal-icon: #d9c7a4;
  --cal-ring: #8fbf7a;
  --cal-week: #9a9aa0;
  --cal-week-line: #5c5c62;
  --cal-cancel-bg: #141416;
  --cal-cancel-ink: #b4b4ba;
  --cal-cancel-line: #5c5c62;
  --cal-past: #6e6e74;
  --word: var(--sand);
  --quiet: var(--muted);
  --telegram: #2aabee;
  --on-telegram: #ffffff;
  --font: "Geist", "Golos Text", sans-serif;
}

html[data-theme="lilac"] {
  color-scheme: light;
  --bg: #b2aaa2;
  --card: #f3ebe4;
  --field: #ebe0d6;
  --ink: #3a2428;
  --muted: #6a5248;
  --line: #9a7a60;
  --chip: #e2d4c8;
  --accent: #7a3040;
  --on-accent: #f7ece8;
  --sand: #d9c7a4;
  --sand-ink: #2c2416;
  --sand-text: #f6edd9;
  --sand-label: #7a3040;
  --ghost-line: #6a5248;
  --task-ring: #7a3040;
  --close-line: #7a3040;
  --close-ink: #3a2428;
  --overdue: #6b2a38;
  --scrim: rgba(0, 0, 0, 0.5);
  --time-bg: #e8d5b0;
  --time-ink: #3a2428;
  --time-line: #93733f;
  --cal-icon: #7a3040;
  --cal-ring: #93733f;
  --cal-week: #6a5248;
  --cal-week-line: #9a7a60;
  --cal-cancel-bg: #f6edd9;
  --cal-cancel-ink: #3a2428;
  --cal-cancel-line: #7a3040;
  --cal-past: #a89890;
  --word: var(--accent);
  --quiet: #4a322e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 22px;
  -webkit-text-size-adjust: 100%;
}

button, input { font: inherit; color: inherit; }

button {
  cursor: pointer;
  border: 0;
  background: transparent;
}

h1, p { margin: 0; }

::selection {
  background: var(--sand);
  color: var(--sand-ink);
}

.stage {
  width: min(390px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 24px 24px calc(48px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lead {
  color: var(--word);
  font-size: 22px;
  line-height: 28px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-align: center;
}

.lead span { display: block; }

.quiet {
  margin-top: 6px;
  color: var(--quiet);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  text-align: center;
}

.telegram, .retry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(100%, 320px);
  height: 52px;
  margin-top: 40px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.telegram {
  background: var(--telegram);
  color: var(--on-telegram);
}

.retry, .save {
  background: var(--sand);
  color: var(--sand-ink);
}

.register {
  width: 100%;
  margin-top: 36px;
}

.field { margin-top: 12px; }

.field:first-child { margin-top: 0; }

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.field input {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field);
  color: var(--ink);
  font-size: 16px;
  line-height: 22px;
  caret-color: var(--sand);
}

.telegram-id {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}

.save {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  margin-top: 28px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
}

.note {
  width: min(100%, 320px);
  margin-top: 16px;
  color: var(--ink);
  font-size: 16px;
  line-height: 22px;
  text-align: center;
}

button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--sand);
  outline-offset: 2px;
}

.day {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
}

.day-head, .day-scroll, .day-dock {
  padding-left: 16px;
  padding-right: 16px;
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 32px;
  padding-bottom: 8px;
}

.day-date {
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
}

.weekday {
  font-size: 15px;
  line-height: 20px;
  color: var(--muted);
}

html[data-theme="lilac"] .weekday { color: var(--ink); }

.more, .chip, .theme, .ghost, .stop, .text-action, .time-done {
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}

.more, .theme, .chip.cal {
  border-radius: 999px;
}

.more, .theme, .chip.outline, .ghost {
  border: 1.5px solid var(--ink);
}

.chip {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}

.chip.on, .theme.on, .stop, .send, .time-done {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
}

.chip.cal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--cal-icon);
}

.chip.cal span { color: var(--ink); }

.chip.cal.on, .chip.cal.on span { color: var(--on-accent); }

.day-scroll {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
  padding-bottom: 16px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overdue h2 {
  margin: 0 0 8px;
  color: var(--overdue);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}

.task-card {
  padding: 4px 8px 4px 14px;
  background: var(--card);
  border-radius: 18px;
}

.task {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 44px;
  column-gap: 8px;
  align-items: center;
  min-height: 60px;
  border-top: 1px solid var(--line);
}

.task.first { border-top: 0; }

.time {
  width: 64px;
  height: 32px;
  box-sizing: border-box;
  border: 1px solid var(--time-line);
  border-radius: 8px;
  background: var(--time-bg);
  color: var(--time-ink);
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.task-title {
  margin: 0;
  font-family: "Golos Text", Geist, sans-serif;
  font-size: 16px;
  line-height: 22px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.task-date {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 16px;
}

.close {
  width: 44px;
  height: 44px;
  justify-self: end;
  box-sizing: border-box;
  border: 1.5px solid var(--close-line);
  border-radius: 999px;
  color: var(--close-ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-dock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: env(safe-area-inset-bottom);
}

.added {
  margin: 0;
  padding: 10px 14px;
  background: var(--card);
  border-radius: 18px;
  color: var(--ink);
  font-size: 15px;
  line-height: 20px;
}

.undo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card);
  border-radius: 18px;
}

.undo p {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}

.undo-back {
  color: var(--close-ink);
  font-size: 14px;
  font-weight: 600;
}

html[data-theme="lilac"] .undo-back { color: var(--accent); }

.composer, .sheet {
  background: var(--card);
  border-radius: 18px;
  padding: 12px;
}

.sheet { padding: 16px; }

.composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day .note, .sheet .note, .draft {
  width: auto;
  margin: 0;
  text-align: left;
}

.draft {
  color: var(--muted);
  font-size: 15px;
  line-height: 20px;
}

.tabs {
  display: flex;
  gap: 2px;
  width: fit-content;
  height: 36px;
  box-sizing: border-box;
  padding: 2px;
  background: var(--field);
  border-radius: 10px;
}

.tab {
  height: 100%;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}

.tab[aria-selected="true"] {
  background: var(--chip);
  color: var(--ink);
}

.entry, .listen, .text-entry, .when, .sheet-body, .remind {
  display: flex;
  gap: 8px;
}

.text-entry, .when, .sheet-body {
  flex-direction: column;
}

.entry, .listen { align-items: flex-end; }

.listen { align-items: center; }

.grow {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 110px;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field);
  color: var(--ink);
  font-size: 16px;
  line-height: 22px;
  resize: none;
  overflow: auto;
}

.mic, .send, .close {
  flex: 0 0 auto;
}

.mic, .send {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic {
  border-radius: 999px;
  background: var(--sand);
  color: var(--sand-ink);
}

.send {
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
}

.send:disabled { opacity: 0.35; }

.listen-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--sand);
}

.ghost, .stop { border-radius: 14px; }

.stop { flex: 1; }

.when-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  font-size: 15px;
  line-height: 20px;
  text-align: left;
}

.when-extra, .when-side { color: var(--muted); }

.time-sheet {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 8px 12px;
  border-radius: 18px;
  background: var(--field);
}

html[data-theme="lilac"] .time-sheet { background: var(--card); }

.time-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.time-sheet-head h2 {
  margin: 0;
  padding-left: 6px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
}

.time-x {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.drums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 6px;
}

.drum {
  position: relative;
  height: 132px;
  overflow: hidden;
}

.drum-window {
  position: absolute;
  left: 0;
  right: 0;
  top: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--card);
  pointer-events: none;
}

html[data-theme="lilac"] .drum-window { background: var(--field); }

.drum-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  touch-action: pan-y;
  overscroll-behavior: none;
}

.drum-scroll::-webkit-scrollbar { display: none; }

.drum-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  scroll-snap-align: center;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.drum-item.on {
  color: var(--ink);
  font-size: 22px;
}

.time-done {
  width: calc(100% - 12px);
  margin: 0 6px;
  border-radius: 14px;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  background: var(--scrim);
}

.sheet { width: 100%; }

.more-sheet { touch-action: none; }

.sheet-head, .remind {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.sheet-head h2, .remind-title {
  margin: 0;
  flex: 1;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
}

.text-action {
  padding: 0;
  color: var(--muted);
  font-size: 15px;
}

.remind-line {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 16px;
}

.theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}

.theme-label {
  flex: none;
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
}

.themes {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 44px;
  padding: 3px;
  gap: 0;
  border-radius: 999px;
  background: var(--chip);
}

.themes .theme {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  appearance: none;
}

.themes .theme.on {
  border: 0;
  background: var(--accent);
  color: var(--on-accent);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: var(--line);
}

.account-exit {
  align-self: center;
  height: 44px;
  margin-top: 8px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--ink);
  background: var(--field);
  color: var(--ink);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}

.rule {
  height: 1px;
  background: var(--line);
}

.switch {
  position: relative;
  width: 46px;
  height: 28px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field);
}

.switch span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}

.switch.on {
  border-color: transparent;
  background: var(--accent);
}

.switch.on span {
  left: 21px;
  border: 0;
  background: var(--on-accent);
}

.switch:disabled { opacity: 0.45; }

.day .retry {
  width: auto;
  height: 44px;
  margin-top: 0;
  padding: 0 14px;
}

.month-panel {
  width: 100%;
  background: var(--field);
  color: var(--ink);
  border-radius: 18px;
  padding: 8px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

html[data-theme="lilac"] .month-panel { background: var(--card); }

.cal-question {
  min-height: 32px;
  margin: 0;
  display: flex;
  align-items: center;
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
  color: var(--cal-week);
}

.cal-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 44px;
}

.cal-title {
  margin: 0;
  text-align: center;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}

.cal-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 22px;
  line-height: 22px;
  color: var(--ink);
}

.cal-arrow:disabled { opacity: 0.4; }

.cal-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cal-weeks, .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-weeks span {
  text-align: center;
  font-size: 11px;
  line-height: 16px;
  color: var(--cal-week);
}

.cal-line {
  height: 1px;
  background: var(--cal-week-line);
}

.cal-cell {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-ring {
  width: 34px;
  height: 34px;
  box-sizing: border-box;
  border: 2px solid transparent;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-ring.on { border-color: var(--cal-ring); }

.cal-day {
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  line-height: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day.on {
  background: var(--accent);
  color: var(--on-accent);
}

.cal-day.past { color: var(--cal-past); }

.cal-day.out {
  color: var(--cal-past);
  opacity: 0.45;
}

.cal-cancel {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.cal-cancel-btn {
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--cal-cancel-line);
  background: var(--cal-cancel-bg);
  color: var(--cal-cancel-ink);
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}
