/* Тема задаётся двумя вещами: оттенком фона (--h, --s) и акцентным цветом (--acc). Меняются в профиле. */
:root {
  --h: 135; --s: 34%;
  --acc: #e8bd5a; --acc-ink: #251a02;
  --acc-soft: color-mix(in srgb, var(--acc) 17%, transparent);
  --bg: hsl(var(--h) var(--s) 5%);
  --card: hsl(var(--h) calc(var(--s) * .85) 12% / .8);
  --card2: hsl(var(--h) calc(var(--s) * .7) 19% / .75);
  --sheet: hsl(var(--h) var(--s) 8%);
  --line: hsl(var(--h) 25% 75% / .12);
  --text: #f4f6f2; --muted: hsl(var(--h) 10% 70%); --dim: hsl(var(--h) 9% 46%);
  --green: #6fd99a; --amber: #f2b84b; --red: #ff7a7a;
  --r: 28px; --nav-h: 68px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text); font: 400 15.500px/1.45 'Google Sans', Geologica, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; overflow-x: hidden;
  background:
    radial-gradient(900px 620px at 85% -8%, hsl(var(--h) var(--s) 19% / .9), transparent 62%),
    radial-gradient(760px 620px at -12% 55%, hsl(var(--h) var(--s) 14% / .85), transparent 60%),
    repeating-linear-gradient(128deg, hsl(var(--h) var(--s) 8%) 0 13px, hsl(var(--h) var(--s) 5%) 13px 29px);
  background-attachment: fixed; background-color: var(--bg);
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 30px; font-weight: 500; letter-spacing: -.015em; line-height: 1.15; }
h2 { font-size: 21px; font-weight: 500; letter-spacing: -.01em; }
h3 { font-size: 16px; font-weight: 500; }
b { font-weight: 600; }
.ic { flex: none; display: block; }
.muted { color: var(--muted); } .small { font-size: 13.500px; } .tiny { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; } .grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; } .center { text-align: center; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { font-variant-numeric: tabular-nums; }

#shell { min-height: 100vh; }
#view { max-width: 580px; margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) 16px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
#nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: hsl(var(--h) var(--s) 6% / .88); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); display: flex; justify-content: space-around; align-items: center; }
#nav .brand { display: none; }
.nav-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 68px; color: var(--dim); font-size: 11.500px; font-weight: 500; transition: color .15s; }
.nav-btn.on { color: var(--acc); }
.nav-add { width: 54px; height: 54px; border-radius: 20px; background: var(--acc); color: var(--acc-ink); display: grid; place-items: center; margin-top: -20px; box-shadow: 0 8px 26px color-mix(in srgb, var(--acc) 35%, transparent); transition: transform .12s; }
.nav-add:active { transform: scale(.92); } .nav-add span { display: none; }

@media (min-width: 900px) {
  #shell { display: grid; grid-template-columns: 236px 1fr; }
  #nav { position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; padding: 28px 14px; border-top: 0; border-right: 1px solid var(--line); }
  #nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 22px; padding: 0 10px 24px; }
  .nav-btn { flex-direction: row; width: auto; gap: 12px; font-size: 15px; padding: 12px; border-radius: 16px; }
  .nav-btn.on { background: var(--card2); }
  .nav-add { order: 9; width: auto; height: 50px; border-radius: 16px; margin: 14px 0 0; display: flex; gap: 8px; justify-content: center; font-weight: 600; }
  .nav-add span { display: inline; }
  #view { max-width: 880px; padding: 32px 28px 60px; }
  .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  #sheet { max-width: 600px; left: 50% !important; right: auto !important; width: 100%; transform: translateX(-50%); bottom: 4vh !important; border-radius: 30px !important; max-height: 90vh !important; border: 1px solid var(--line); }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}

.card { background: linear-gradient(165deg, hsl(var(--h) calc(var(--s) * .8) 16% / .8), hsl(var(--h) calc(var(--s) * .9) 9% / .84)); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.card.line { background: none; }
.card.tap { cursor: pointer; transition: transform .12s; } .card.tap:active { transform: scale(.985); }
.panel { padding: 18px 14px 14px; } .panel > .row { padding: 0 6px 12px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; overflow: hidden; border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(170deg, hsl(var(--h) calc(var(--s) * .7) 19% / .6), hsl(var(--h) var(--s) 8% / .6)); padding: 14px 14px 0; min-height: 168px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile .t-l { color: var(--muted); font-size: 14.500px; } .tile .ic { color: var(--text); opacity: .85; }
.big { font-size: 31px; font-weight: 400; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; } .big small { font-size: 15px; color: var(--muted); margin-left: 3px; }
.tile .chart { margin: auto -14px 0; display: block; width: calc(100% + 28px); } .tile .chart.pad { width: 100%; }
svg.chart { display: block; } .tile .chart.pad { margin: auto 0 10px; }
.dots { background-image: radial-gradient(hsl(var(--h) 20% 80% / .16) 1px, transparent 1.300px); background-size: 14px 12px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 99px; background: var(--acc-soft); color: var(--acc); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); font-weight: 500; font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: var(--card2); color: var(--muted); font-weight: 500; font-size: 14px; border: 1px solid var(--line); transition: all .15s; }
.chip.on { color: var(--acc); border-color: var(--acc); background: var(--acc-soft); }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 22px; border-radius: 18px; font-weight: 500; background: var(--card2); border: 1px solid var(--line); transition: transform .12s, opacity .15s; }
.btn:active { transform: scale(.97); } .btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary, .btn.amber { background: var(--acc); color: var(--acc-ink); border-color: transparent; font-weight: 600; }
.btn.danger { color: var(--red); } .btn.sm { height: 40px; padding: 0 15px; border-radius: 14px; font-size: 14px; } .btn.full { width: 100%; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text); flex: none; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 11px; } .icon-btn.plain { background: none; border-color: transparent; color: var(--muted); }
.icon-btn.acc { color: var(--acc); }

.ring { position: relative; flex: none; } .ring svg { display: block; } .ring circle { transition: stroke-dashoffset .6s cubic-bezier(.3, .8, .3, 1); }
.ring-in { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge { position: relative; width: 100%; max-width: 190px; margin: auto auto 6px; } .gauge svg { display: block; width: 100%; height: auto; } .gauge path { transition: stroke-dashoffset .6s cubic-bezier(.3, .8, .3, 1); }
.gauge-in { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; line-height: 1.1; }
.bar { height: 8px; border-radius: 99px; background: hsl(var(--h) 20% 80% / .13); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--acc); transition: width .5s cubic-bezier(.3, .8, .3, 1); }
.bar.cyan > i { background: var(--green); }

.task { display: flex; align-items: center; gap: 12px; padding: 14px 15px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; transition: opacity .2s; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.task + .task { margin-top: 8px; }
.task.done { opacity: .5; } .task.done .t-title { text-decoration: line-through; }
.task.frog { border-color: color-mix(in srgb, var(--green) 45%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--green) 11%, transparent), var(--card) 60%); }
.cb { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--c, var(--acc)); display: grid; place-items: center; flex: none; color: transparent; transition: all .18s; }
.cb:active { transform: scale(.85); } .cb.on { background: var(--c, var(--acc)); color: #0b130d; }
.t-title { font-weight: 500; line-height: 1.3; } .t-meta { font-size: 12.500px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; flex: none; }
.xp { color: var(--acc); font-weight: 500; }

.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 20px; background: color-mix(in srgb, var(--amber) 11%, var(--bg)); border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent); color: color-mix(in srgb, var(--amber) 55%, white); cursor: pointer; }
.banner.red { background: color-mix(in srgb, var(--red) 10%, var(--bg)); border-color: color-mix(in srgb, var(--red) 35%, transparent); color: color-mix(in srgb, var(--red) 50%, white); }
.banner.cyan { background: color-mix(in srgb, var(--acc) 9%, var(--bg)); border-color: color-mix(in srgb, var(--acc) 30%, transparent); color: color-mix(in srgb, var(--acc) 45%, white); cursor: default; }
.banner.ok { background: color-mix(in srgb, var(--green) 10%, var(--bg)); border-color: color-mix(in srgb, var(--green) 38%, transparent); color: color-mix(in srgb, var(--green) 45%, white); cursor: default; }

.goal-card { display: flex; gap: 14px; align-items: center; }
.goal-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.status { font-size: 12.500px; font-weight: 500; } .status.ok { color: var(--green); } .status.risk { color: var(--amber); } .status.late { color: var(--red); }

.path { position: relative; padding-left: 38px; }
.path::before { content: ''; position: absolute; left: 14px; top: 16px; bottom: 16px; width: 2px; border-radius: 2px; background: var(--line); }
.node { position: relative; margin-bottom: 12px; }
.node > .bullet { position: absolute; left: -38px; top: 8px; width: 31px; height: 31px; border-radius: 50%; display: grid; place-items: center; background: hsl(var(--h) var(--s) 16%); color: var(--dim); border: 1px solid var(--line); }
.node.done > .bullet { background: var(--green); color: #0b130d; }
.node.cur > .bullet { background: var(--c); color: #0b130d; box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent); }
.node-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; cursor: pointer; }
.node-body { margin-top: 8px; } .node-body .task { padding: 11px 13px; border-radius: 16px; }

.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.heat i { aspect-ratio: 1; border-radius: 6px; background: hsl(var(--h) 20% 80% / .08); display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 500; color: var(--dim); }
.heat i.x { background: none; } .heat i.h { color: #0b130d; }
.stat { display: flex; flex-direction: column; gap: 3px; } .stat b { font-size: 25px; font-weight: 400; letter-spacing: -.02em; }
.stats4, .heat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .stats4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .heat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.ach { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 13px 6px; border-radius: 18px; background: hsl(var(--h) 20% 80% / .06); border: 1px solid var(--line); font-size: 12px; font-weight: 500; line-height: 1.25; }
.ach .medal { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; }
.ach.off { opacity: .38; } .ach.off .medal { background: var(--line) !important; color: var(--dim) !important; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.sw { width: 40px; height: 40px; border-radius: 14px; border: 2px solid transparent; outline: 1px solid var(--line); display: grid; place-items: center; color: transparent; transition: transform .12s; }
.sw:active { transform: scale(.9); } .sw.on { border-color: var(--text); color: #fff; }

label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13.500px; font-weight: 500; color: var(--muted); }
.inp { width: 100%; background: hsl(var(--h) 20% 80% / .07); border: 1px solid var(--line); border-radius: 16px; padding: 13px 15px; color: var(--text); font-weight: 400; outline: none; transition: border-color .15s; }
.inp:focus { border-color: var(--acc); } textarea.inp { resize: vertical; min-height: 64px; } .inp::placeholder { color: var(--dim); }
input[type=date].inp { color-scheme: dark; }
.inp.mini { padding: 8px 11px; border-radius: 12px; font-size: 14px; } .inp.est { width: 66px; text-align: center; flex: none; }
.stepper { display: flex; align-items: center; gap: 8px; }

#sheet-wrap { position: fixed; inset: 0; z-index: 40; }
#sheet-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, .66); animation: fade .2s; }
#sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 94vh; overflow-y: auto; background: var(--sheet); border-radius: 30px 30px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; animation: up .28s cubic-bezier(.2, .9, .3, 1); border-top: 1px solid var(--line); }
.steps { display: flex; gap: 6px; } .steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); } .steps i.on { background: var(--acc); }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 15px; border-radius: 20px; background: hsl(var(--h) 20% 80% / .06); border: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; }
.opt.on { border-color: var(--acc); background: var(--acc-soft); }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--dim); flex: none; margin-top: 2px; } .opt.on .radio { border: 6px solid var(--acc); }
.plan-ms { background: hsl(var(--h) 20% 80% / .05); border: 1px solid var(--line); border-radius: 20px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
#sheet .card { backdrop-filter: none; background: hsl(var(--h) 20% 80% / .05); }

#celebrate { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .8); display: grid; place-items: center; padding: 24px; animation: fade .2s; }
#celebrate[hidden], #sheet-wrap[hidden] { display: none; }
.cele { max-width: 340px; width: 100%; background: var(--sheet); border-radius: 32px; padding: 32px 22px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; animation: pop .4s cubic-bezier(.2, 1.4, .4, 1); border: 1px solid var(--line); }
.cele .medal { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; animation: glow 2s infinite alternate; }
#toasts { position: fixed; z-index: 70; left: 0; right: 0; top: calc(14px + env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 14px; }
.toast { max-width: 440px; width: 100%; background: hsl(var(--h) var(--s) 13%); border: 1px solid color-mix(in srgb, var(--acc) 40%, transparent); border-radius: 20px; padding: 13px 15px; display: flex; gap: 12px; align-items: center; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); animation: drop .35s cubic-bezier(.2, 1.2, .4, 1); line-height: 1.35; }
.toast.out { opacity: 0; transform: translateY(-12px); transition: all .3s; }
.toast .xpb { background: var(--acc); color: var(--acc-ink); font-weight: 600; border-radius: 12px; padding: 6px 10px; font-size: 13.500px; white-space: nowrap; flex: none; }
#confetti { position: fixed; inset: 0; z-index: 80; pointer-events: none; width: 100%; height: 100%; }
.timer-num { font-size: 46px; font-weight: 400; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 34px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty .big { width: 84px; height: 84px; border-radius: 50%; background: var(--acc-soft); display: grid; place-items: center; color: var(--acc); }
.sec { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; padding: 0 4px; }
.quote { border-left: 2px solid var(--acc); padding: 2px 0 2px 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
@keyframes drop { from { transform: translateY(-30px); opacity: 0; } }
@keyframes glow { to { box-shadow: 0 0 44px 6px color-mix(in srgb, var(--acc) 30%, transparent); } }
@media (min-width: 900px) { @keyframes up { from { transform: translate(-50%, 40px); opacity: 0; } } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
