/* Vaqt — светлый «карточный» стиль: белые карточки на сером фоне, зелёный акцент, цветные значки у дел.
   Светлая тема по умолчанию, тёмная — переключателем в Me (или «Auto» по системе). */
:root {
  --bg: #F2F3F5;
  --surface: #FFFFFF;
  --surface-2: #F1F3F5;
  --line: #ECEEF1;
  --border: #E3E6EA;
  --text: #111827;
  --muted: #6B7280;
  --faint: #9CA3AF;
  --accent: #2E9E5B;          /* зелёный: сделано, главное действие */
  --accent-soft: #E5F4EA;
  --accent-text: #23874B;
  --blue: #3B82F6; --blue-soft: #E8F0FE;
  --red: #E5484D; --red-soft: #FDECEC;
  --orange: #C8790E; --orange-soft: #FDF1DC;
  --purple: #7C5CE0; --purple-soft: #EFEAFD;
  --indigo: #4F63D2; --indigo-soft: #EAEDFB;
  --yellow: #B98900; --yellow-soft: #FBF3D5;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 6px 20px rgba(17, 24, 39, .05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --radius: 22px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F1115; --surface: #181B21; --surface-2: #22262D; --line: #262A31; --border: #2E333B;
  --text: #F3F4F6; --muted: #9CA3AF; --faint: #6B7280;
  --accent: #37C46F; --accent-soft: rgba(55, 196, 111, .14); --accent-text: #4FD083;
  --blue: #5B9BFA; --blue-soft: rgba(91, 155, 250, .15); --red: #F06A6E; --red-soft: rgba(240, 106, 110, .14);
  --orange: #F0A23C; --orange-soft: rgba(240, 162, 60, .14); --purple: #A68BFA; --purple-soft: rgba(166, 139, 250, .15);
  --indigo: #8394F5; --indigo-soft: rgba(131, 148, 245, .15); --yellow: #E8C14E; --yellow-soft: rgba(232, 193, 78, .14);
  --shadow: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #0F1115; --surface: #181B21; --surface-2: #22262D; --line: #262A31; --border: #2E333B;
    --text: #F3F4F6; --muted: #9CA3AF; --faint: #6B7280;
    --accent: #37C46F; --accent-soft: rgba(55, 196, 111, .14); --accent-text: #4FD083;
    --blue: #5B9BFA; --blue-soft: rgba(91, 155, 250, .15); --red: #F06A6E; --red-soft: rgba(240, 106, 110, .14);
    --orange: #F0A23C; --orange-soft: rgba(240, 162, 60, .14); --purple: #A68BFA; --purple-soft: rgba(166, 139, 250, .15);
    --indigo: #8394F5; --indigo-soft: rgba(131, 148, 245, .15); --yellow: #E8C14E; --yellow-soft: rgba(232, 193, 78, .14);
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 16px/1.4 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; overscroll-behavior-y: none; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num, time { font-variant-numeric: tabular-nums; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.app {
  max-width: 560px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) max(16px, env(safe-area-inset-right, 0px))
           calc(env(safe-area-inset-bottom, 0px) + 100px) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 14px;
}
.boot { height: 70vh; display: grid; place-items: center; }
.boot-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); opacity: .7; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.8); opacity: .35; } }

/* ---------- заголовки ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 2px 4px 2px; }
.eyebrow { font-size: 14px; color: var(--muted); }
h1 { font-size: 28px; line-height: 1.15; margin: 2px 0 0; letter-spacing: -.02em; font-weight: 750; text-wrap: balance; }
h2 { font-size: 18px; margin: 0; letter-spacing: -.01em; font-weight: 700; }
.ru { display: block; font-size: 12.5px; color: var(--faint); font-weight: 400; margin-top: 1px; letter-spacing: 0; }
.day-nav { display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border);
  display: grid; place-items: center; color: var(--muted); flex: none; }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.card { background: var(--surface); border-radius: var(--radius); padding: 18px 18px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pill { font-size: 13px; font-weight: 650; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.good { background: var(--accent-soft); color: var(--accent-text); }
.pill.warn { background: var(--orange-soft); color: var(--orange); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.accent { color: var(--accent-text); font-weight: 700; }

/* ---------- кнопки ---------- */
.btn { min-height: 46px; padding: 0 16px; border-radius: 14px; background: var(--surface-2); font-weight: 650; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.good { background: var(--accent-soft); color: var(--accent-text); }
.btn.outline, .btn.ghost { background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.btn.pillbtn { border-radius: 999px; min-height: 38px; padding: 0 16px; font-size: 14.5px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.btn.danger { color: var(--red); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- намаз ---------- */
.next-line { font-size: 15px; color: var(--muted); }
.next-line b { color: var(--accent-text); }
.prayers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prayer { background: var(--surface-2); border-radius: 14px; padding: 11px 10px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.prayer > span:last-child { min-width: 0; }
.prayer .n { white-space: nowrap; }
.prayer .radio { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1.8px var(--faint); flex: none; display: grid; place-items: center; }
.prayer .n { font-size: 15px; font-weight: 650; display: block; }
.prayer .t { font-size: 13px; color: var(--muted); display: block; }
.prayer.done { background: var(--accent-soft); }
.prayer.done .radio { box-shadow: inset 0 0 0 1.8px var(--accent); }
.prayer.done .radio::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.prayer.done .n, .prayer.done .t { color: var(--accent-text); }
.prayer.extra .n { font-style: italic; font-weight: 600; color: var(--muted); }
.prayer.next { background: var(--surface); box-shadow: inset 0 0 0 1.8px var(--accent); }
@media (max-width: 400px) { .prayer .radio { display: none; } .prayer { padding: 10px 12px; } }
.notes { display: flex; flex-direction: column; gap: 6px; }
.note { font-size: 14px; background: var(--orange-soft); color: var(--text); border-radius: 14px; padding: 11px 14px; }

/* ---------- сейчас ---------- */
.focus .label { font-size: 12.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.focus .title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.focus .detail { color: var(--muted); font-size: 14.5px; }

/* ---------- план дня ---------- */
.timeline { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.row + .row { border-top: 1px solid var(--line); }
.tick { width: 26px; height: 26px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1.6px var(--border);
  background-image: radial-gradient(circle, transparent 60%, transparent 61%); display: grid; place-items: center; }
.tick.dash { box-shadow: none; border: 1.6px dashed var(--border); }
.row.done .tick, .row.mini .tick { background: var(--accent); box-shadow: none; border: 0; }
.row.mini .tick { background: var(--blue); }
.row.done .tick::after, .row.mini .tick::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.4px 2.4px;
  transform: rotate(-45deg) translate(1px, -1px); }
.row.skipped .tick, .row.moved .tick { background: var(--surface-2); box-shadow: none; }
.row-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }
.tile { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--muted); }
.t-blue { background: var(--blue-soft); color: var(--blue); }
.t-red { background: var(--red-soft); color: var(--red); }
.t-green { background: var(--accent-soft); color: var(--accent); }
.t-purple { background: var(--purple-soft); color: var(--purple); }
.t-orange { background: var(--orange-soft); color: var(--orange); }
.t-indigo { background: var(--indigo-soft); color: var(--indigo); }
.t-yellow { background: var(--yellow-soft); color: var(--yellow); }
.row .body { flex: 1; min-width: 0; }
.row .body > span { display: block; }
.row .t { font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.row .sub { font-size: 13px; color: var(--faint); }
.row .warn { font-size: 13px; color: var(--orange); }
.row time { font-size: 15px; font-weight: 700; flex: none; }
.row.closed .t { color: var(--muted); }
.row.skipped .t { text-decoration: line-through; }
.row.now { background: var(--accent-soft); border-radius: 16px; margin: 0 -10px; padding: 10px; border-top-color: transparent; }
.row.now + .row { border-top-color: transparent; }
.row.now time { color: var(--accent-text); }
.row.work-span .t { color: var(--muted); font-weight: 600; }

.quick { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.quick::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 38px; padding: 0 15px; border-radius: 999px; background: var(--surface); font-size: 14.5px; font-weight: 650;
  display: inline-flex; align-items: center; gap: 6px; box-shadow: inset 0 0 0 1px var(--border); }
.chip.on { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
.card .quick, .sheet .quick { margin: 0; padding: 0; flex-wrap: wrap; overflow: visible; }

/* ---------- привычки и чтение ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.challenge { display: flex; flex-direction: column; gap: 12px; }
.challenge-head { display: flex; align-items: center; gap: 12px; }
.challenge-head .grow { flex: 1; min-width: 0; }
.challenge-head b { font-size: 17px; display: block; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar.blue i { background: var(--blue); }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.steps .btn { padding: 0 6px; min-height: 46px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; }
.stat b { font-size: 24px; display: block; letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--muted); }
.streaks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.streak { text-align: center; background: var(--surface-2); border-radius: 14px; padding: 10px 4px; }
.streak b { display: block; font-size: 20px; }
.streak span { font-size: 12px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 14px; padding: 9px 0; width: 100%; text-align: left; }
.check + .check, .check + .hrow, .hrow + .hrow, .hrow + .check { border-top: 1px solid var(--line); }
.box { width: 26px; height: 26px; border-radius: 8px; box-shadow: inset 0 0 0 1.6px var(--border); flex: none; display: grid; place-items: center; }
.check.on .box { background: var(--accent); box-shadow: none; }
.check.on .box::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.4px 2.4px; transform: rotate(-45deg) translate(1px, -1px); }
.check .grow { flex: 1; min-width: 0; }
.check.on .grow { color: var(--muted); }
.hrow { display: flex; align-items: center; }
.hrow .check { flex: 1; }
.x { width: 32px; height: 32px; display: grid; place-items: center; color: var(--faint); font-size: 18px; flex: none; }
.add-row { display: flex; align-items: center; gap: 14px; padding: 9px 0; color: var(--muted); width: 100%; border-top: 1px solid var(--line); }
.add-row .plus { width: 26px; height: 26px; border-radius: 50%; border: 1.6px dashed var(--border); display: grid; place-items: center; font-size: 16px; }

/* ---------- слова ---------- */
.wotd .w { font-size: 28px; font-weight: 750; letter-spacing: -.02em; }
.review { min-height: 62vh; display: flex; flex-direction: column; gap: 14px; }
.flash { flex: 1; background: var(--surface); box-shadow: var(--shadow); border-radius: 26px; padding: 26px 20px; display: flex; flex-direction: column;
  gap: 12px; justify-content: center; text-align: center; min-height: 300px; }
.flash .front { font-size: 30px; font-weight: 750; letter-spacing: -.02em; overflow-wrap: anywhere; }
.flash .front.long { font-size: 21px; }
.flash .kind { font-size: 12.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.flash .back { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.flash .mean { font-size: 19px; font-weight: 650; }
.flash .coll { color: var(--accent-text); font-size: 15px; }
.uz { color: var(--indigo); font-size: 15px; }
.flash .uz { font-size: 16.5px; font-weight: 550; }
.wordrow .uz { font-size: 13.5px; }
.flash .ex { color: var(--muted); font-size: 15px; font-style: italic; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grades .btn { flex-direction: column; gap: 0; min-height: 56px; font-size: 14.5px; background: var(--surface); box-shadow: var(--shadow), inset 0 0 0 1px var(--border); }
.grades .btn small { font-weight: 500; font-size: 11.5px; color: var(--muted); }
.g0 { color: var(--red); } .g1 { color: var(--orange); } .g2 { color: var(--accent-text); } .g3 { color: var(--blue); }
.progress { height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.progress i { display: block; height: 100%; background: var(--accent); }
.wordrow { display: flex; flex-direction: column; gap: 2px; padding: 11px 0; text-align: left; width: 100%; }
.wordrow + .wordrow { border-top: 1px solid var(--line); }
.wordrow b { font-size: 16px; }

/* ---------- формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13.5px; color: var(--muted); font-weight: 500; }
input[type=text], input[type=time], input[type=number], input[type=password], input[type=search], textarea, select {
  width: 100%; min-height: 48px; border-radius: 14px; border: 0; background: var(--surface-2); padding: 10px 14px; font-size: 16px; outline: none; }
textarea { min-height: 88px; resize: vertical; }
input:focus, textarea:focus, select:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline > * { min-width: 0; }
.seg { display: flex; background: var(--surface-2); border-radius: 14px; padding: 3px; gap: 3px; }
.seg button { flex: 1; min-height: 40px; border-radius: 11px; font-size: 14.5px; font-weight: 650; color: var(--muted); text-align: center; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.days button { min-height: 40px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; font-weight: 650; color: var(--muted); text-align: center; }
.days button.on { background: var(--accent); color: #fff; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); padding: 3px 7px;
  border-radius: 7px; overflow-wrap: anywhere; }
ol.how { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; font-size: 14.5px; }
.tagdot { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }

/* ---------- вход ---------- */
.login { min-height: 80vh; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.logo { width: 68px; height: 68px; border-radius: 18px; box-shadow: var(--shadow); }
.code-input { font-size: 28px !important; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- нижняя панель ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 6px) max(8px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--faint); font-size: 11.5px; font-weight: 650; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--accent-text); }

/* ---------- шторка ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, .35); z-index: 30; animation: fade .18s ease; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 88vh; overflow-y: auto; background: var(--surface);
  border-radius: 26px 26px 0 0; padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 18px) max(18px, env(safe-area-inset-left, 0px));
  display: flex; flex-direction: column; gap: 14px; animation: up .22s cubic-bezier(.2, .8, .2, 1); max-width: 560px; margin: 0 auto; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: var(--border); align-self: center; }
.sheet .sheet-title { font-size: 21px; font-weight: 750; letter-spacing: -.01em; }
.sheet .grid-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet .chip { background: var(--surface-2); box-shadow: none; }
.sheet .chip.on { background: var(--accent-soft); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 86px); z-index: 40;
  background: var(--text); color: var(--surface); padding: 11px 16px; border-radius: 14px; font-size: 14.5px; font-weight: 650;
  max-width: calc(100% - 32px); }
.empty { text-align: center; color: var(--muted); padding: 22px 8px; font-size: 15px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
