/* Тёмное бохо: тёплый тёмно-коричневый фон, шалфей, песок, мягкая терракота. Спокойно, без агрессии. */
@font-face { font-family: "Cormorant"; font-weight: 500 700; font-style: normal; font-display: swap; src: url("cormorant-cyr.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant"; font-weight: 500 700; font-style: normal; font-display: swap; src: url("cormorant-lat.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: "Cormorant"; font-weight: 500; font-style: italic; font-display: swap; src: url("cormorant-i-cyr.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant"; font-weight: 500; font-style: italic; font-display: swap; src: url("cormorant-i-lat.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: "Manrope"; font-weight: 400 700; font-display: swap; src: url("manrope-cyr.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-weight: 400 700; font-display: swap; src: url("manrope-lat.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 {
  --bg: #1b1814; --panel: #24201b; --fg: #ede4d3; --muted: #a3957f; --line: #3a332b;
  --accent: #9fb08a;  /* шалфей — прогресс, отмеченные дни */
  --sand: #d8c3a0;    /* песок — плашки, линии */
  --clay: #c98d6a;    /* мягкая терракота — просрочено, низкие оценки */
  --grid: #322c25; --sick: #5e5348;
  --bad: #c98d6a; --ok: #9fb08a;
  --serif: "Cormorant", "Georgia", "Times New Roman", serif;
  --sans: "Manrope", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--sans); font-size: 15px; line-height: 1.5; font-variant-numeric: tabular-nums lining-nums; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { overflow-x: hidden; }
main { max-width: 1100px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 16px calc(88px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 20px; }

/* Плашки */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-family: var(--sans); font-weight: 600; font-size: 12px; line-height: 1; padding: 6px 12px; border-radius: 999px; background: rgba(159, 176, 138, .18); color: var(--accent); white-space: nowrap; }
.tag.w { background: transparent; color: var(--sand); box-shadow: inset 0 0 0 1px rgba(216, 195, 160, .45); }
.tag.late { background: rgba(201, 141, 106, .18); color: var(--clay); }

/* Шапка */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 18px; color: var(--sand); }
.title { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 9vw, 48px); line-height: 1.05; margin: 0; }
.sub { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(18px, 5vw, 22px); color: var(--muted); margin: 2px 0 0; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; line-height: 1.2; margin: 0; }
.note { color: var(--muted); font-size: 13px; margin: 0; }
.tab { display: flex; flex-direction: column; gap: 20px; }

/* Герой главной */
.hero { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.big { font-variant-numeric: lining-nums proportional-nums; font-family: var(--serif); font-weight: 600; font-size: clamp(52px, 15vw, 80px); line-height: .95; }
.big small { font-style: italic; font-weight: 500; font-size: .38em; color: var(--muted); margin-left: .35em; }
.weeks { display: grid; grid-template-columns: repeat(12, 1fr); gap: 5px; }
.weeks i { height: 6px; border-radius: 3px; background: var(--grid); }
.weeks i.done { background: var(--sand); opacity: .7; }
.weeks i.now { background: var(--accent); }
/* Тонкая волна вместо резкой диагонали */
.slash { height: 18px; margin: 2px 0; opacity: .55; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='18' viewBox='0 0 60 18'%3E%3Cpath d='M0 9 Q15 2 30 9 T60 9' fill='none' stroke='%23d8c3a0' stroke-width='1.4'/%3E%3C/svg%3E") repeat-x center / 60px 18px; }
.specs { margin: 0; display: grid; gap: 14px; }
.specs div { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.specs b { display: block; font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 6.5vw, 30px); line-height: 1.15; color: var(--fg); }
.specs .note { display: block; margin-top: 2px; }

/* Карточки */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; overflow-wrap: anywhere; }
.bar { height: 6px; border-radius: 3px; background: var(--grid); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent); }

/* Цели */
.goal { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.goal:first-child { border-top: 0; padding-top: 0; }
.goal-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.goal-name { font-family: var(--serif); font-weight: 600; font-size: 20px; }
.goal-pct { font-family: var(--serif); font-weight: 600; font-size: 26px; color: var(--accent); }
.kr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 13px; }
.kr .val { font-weight: 600; text-align: right; white-space: nowrap; }
.kr .val.none { color: var(--muted); font-weight: 400; font-style: italic; }
.kr .bar { grid-column: 1 / -1; height: 4px; }
.kr .note { grid-column: 1 / -1; font-size: 12px; }

/* Списки дел */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list li { overflow-wrap: anywhere; padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .t { font-weight: 600; }
.list .meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.list .meta .tag { font-size: 11px; padding: 4px 10px; }
.list .next { font-size: 13px; color: #cbbfab; }
.list details summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); font-size: 13px; font-style: italic; }

/* Графики и таблицы */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--sans); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.scroll { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { white-space: nowrap; text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.low { color: var(--clay); font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 12px; font-weight: 600; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--fg); padding: 5px 12px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* Принципы */
.princ { margin: 0; padding: 0; list-style: none; counter-reset: p; display: flex; flex-direction: column; gap: 14px; }
.princ li { counter-increment: p; display: grid; grid-template-columns: 2em 1fr; gap: 0 8px; }
.princ li::before { content: counter(p); font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--sand); font-size: 24px; line-height: 1; }
.princ b { font-family: var(--serif); font-weight: 600; font-size: 20px; line-height: 1.2; display: block; }
.princ span { color: #cbbfab; font-size: 14px; }

.tip { position: fixed; pointer-events: none; z-index: 10; background: #ede4d3; color: #1b1814; border-radius: 10px; padding: 6px 10px; font-size: 13px; max-width: 16rem; }
.tip div:first-child { font-weight: 700; }

/* Нижнее меню */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center; background: rgba(27, 24, 20, .96); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav button { flex: 1; min-width: 0; max-width: 140px; font: inherit; font-size: 11px; font-weight: 500; background: none; border: 0; color: var(--muted); padding: 8px 2px 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; }
.nav button span { font-size: 18px; line-height: 1; }
.nav button[aria-current="page"] { color: var(--fg); }
.nav button[aria-current="page"] span { color: var(--accent); }

/* Вход */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 12px; }
.login-box input { font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--fg); }
.login-box input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.btn { font: inherit; font-weight: 600; font-size: 15px; padding: 12px; border: 0; border-radius: 12px; background: var(--accent); color: var(--bg); cursor: pointer; }
.err { color: var(--clay); font-size: 13px; min-height: 1.2em; margin: 0; }
.chip:focus-visible, .nav button:focus-visible, .btn:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; }

@media (max-width: 560px) { .wide { display: none; } }
@media (min-width: 900px) {
  .tab[data-tab="home"] { display: grid; grid-template-columns: 1fr 1fr; align-items: start; column-gap: 20px; }
  .tab[data-tab="home"] .hero, .tab[data-tab="home"] .slash, .tab[data-tab="home"] .specs, .tab[data-tab="home"] #weekly-card { grid-column: 1 / -1; }
  .specs { grid-template-columns: repeat(3, 1fr); }
}
