
:root {
  color-scheme: light;
  --bg: #eef4ff;
  --bg2: #f8fafc;
  --text: #0f172a;
  --muted: #475569;
  --soft: #eff6ff;
  --soft2: #dbeafe;
  --card: rgba(255,255,255,.92);
  --line: rgba(148,163,184,.30);
  --primary: #2563eb;
  --primary2: #1d4ed8;
  --danger: #991b1b;
  --danger-bg: #fee2e2;
  --shadow: 0 10px 30px rgba(15, 23, 42, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.dark {
  color-scheme: dark;
  --bg: #020617;
  --bg2: #0f172a;
  --text: #e5e7eb;
  --muted: #cbd5e1;
  --soft: #172554;
  --soft2: #1e3a8a;
  --card: rgba(15, 23, 42, .93);
  --line: rgba(148,163,184,.28);
  --primary: #60a5fa;
  --primary2: #93c5fd;
  --danger: #fecaca;
  --danger-bg: #7f1d1d;
  --shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--soft2), transparent 32rem),
    linear-gradient(180deg, var(--bg2), var(--bg));
}
button, input, select, textarea { font: inherit; }
button {
  border: 0;
  border-radius: 16px;
  padding: .85rem 1rem;
  background: #e2e8f0;
  color: #0f172a;
  font-weight: 780;
  cursor: pointer;
}
body.dark button { background: #334155; color: var(--text); }
button.primary { background: var(--primary); color: white; }
body.dark button.primary { color: #020617; }
button.danger { background: var(--danger-bg); color: var(--danger); }
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
button.small-btn { padding: .55rem .75rem; border-radius: 12px; font-size: .86rem; }
.app { max-width: 980px; margin: 0 auto; padding: 1rem 1rem 7.4rem; }
.hero {
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  margin: 1rem 0; padding: 1.2rem; border-radius: 28px; color: white;
  background: linear-gradient(135deg, #1d4ed8, #2563eb, #38bdf8);
  box-shadow: 0 20px 45px rgba(37, 99, 235, .22);
}
body.dark .hero { background: linear-gradient(135deg, #0f172a, #1e3a8a, #075985); }
.hero h1 { margin: .1rem 0; font-size: clamp(2rem, 8vw, 3.1rem); line-height: 1; }
.hero p { margin: .2rem 0; opacity: .95; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 850; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.card, .panel, .exercise, .entry, .toolbar {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 1rem; box-shadow: var(--shadow);
}
.card-title, .row, .entry-actions, .toggle-row { display: flex; align-items: center; gap: .75rem; }
.row { flex-wrap: wrap; }
.entry-actions { flex-direction: column; align-items: stretch; min-width: 92px; }
.card-title h2, .panel h2 { margin: 0; }
.icon {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 12px;
  background: var(--soft2); color: var(--primary2); flex: none; font-weight: 900;
}
.card p, .exercise p, .entry p, .small, .hint { color: var(--muted); }
blockquote { margin: 0; padding-left: 1rem; border-left: 4px solid var(--primary); font-weight: 780; }
.panel { margin-top: 1rem; }
.breath-box { display: grid; place-items: center; gap: 1rem; padding: 1rem 0; }
.circle {
  width: 184px; height: 184px; border-radius: 999px; display: grid; place-items: center;
  background: var(--soft2); border: 8px solid var(--soft); transition: transform .8s ease;
}
.circle strong { font-size: 1.7rem; }
.circle span { font-size: 2.2rem; font-weight: 920; color: var(--primary2); }
.circle.pulse { animation: breathe 10s infinite ease-in-out; }
@keyframes breathe { 0%,100% { transform: scale(.88); } 40% { transform: scale(1.08); } }
.exercise-header { display: flex; justify-content: space-between; gap: .75rem; align-items: start; }
.exercise-header h3 { margin: 0; }
.exercise-header span { color: var(--primary2); font-weight: 850; font-size: .85rem; }
.compact { box-shadow: none; }
.chips, .list, .form { display: grid; gap: .75rem; }
.chips { grid-template-columns: repeat(auto-fit, minmax(142px, 1fr)); }
.chip { background: #e0f2fe; }
body.dark .chip { background: #1e293b; }
.chip.active { background: var(--primary); color: white; }
body.dark .chip.active { color: #020617; }
label { display: grid; gap: .45rem; font-weight: 820; }
input[type="range"] { width: 100%; }
input[type="date"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: .85rem;
  background: rgba(255,255,255,.92); color: #0f172a;
}
body.dark input, body.dark select, body.dark textarea { background: #0f172a; color: var(--text); }
textarea { min-height: 86px; resize: vertical; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.stats.big { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { padding: .9rem; border-radius: 18px; background: var(--soft); overflow-wrap: anywhere; }
.stat strong { display: block; font-size: 1.55rem; color: var(--primary2); }
.stat span { color: var(--muted); font-weight: 750; font-size: .85rem; }
.entry { display: flex; justify-content: space-between; gap: 1rem; }
.entry.checkin { border-left: 6px solid #14b8a6; }
.entry.episode { border-left: 6px solid var(--primary); }
.toolbar { display: grid; gap: .75rem; margin-bottom: 1rem; }
.toolbar-grid { display: grid; grid-template-columns: repeaat(4, minmax(0, 1fr)); gap: .75rem; }
.chart { width: 100%; min-height: 230px; border-radius: 20px; background: var(--soft); padding: 1rem; overflow: hidden; }
.chart svg { width: 100%; height: 240px; display: block; }
.chart text { fill: var(--muted); font-size: 12px; }
.chart .line-before { fill: none; stroke: #2563eb; stroke-width: 3; }
.chart .line-after { fill: none; stroke: #14b8a6; stroke-width: 3; }
.chart .grid-line { stroke: rgba(148,163,184,.45); stroke-width: 1; }
.chart .bar { fill: #60a5fa; }
.notice { padding: .9rem; border-radius: 18px; background: #fef3c7; color: #78350f; border: 1px solid #fde68a; }
body.dark .notice { background: #422006; color: #fde68a; border-color: #713f12; }
.lock-screen { max-width: 520px; margin: 3rem auto 0; }
.bottom {
  position: fixed; left: 50%; bottom: .75rem; transform: translateX(-50%);
  width: min(980px, calc(100% - 1rem)); display: grid; grid-template-columns: repeat(6, 1fr);
  gap: .35rem; padding: .45rem; border-radius: 24px; background: rgba(255,255,255,.88);
  border: 1px solid var(--line); backdrop-filter: blur(16px); box-shadow: 0 14px 40px rgba(15,23,42,.16); z-index: 10;
}
body.dark .bottom { background: rgba(15, 23, 42, .88); }
.nav { display: grid; place-items: center; gap: .2rem; padding: .52rem .1rem; border-radius: 18px; background: transparent; color: var(--muted); font-size: .68rem; }
.nav.active { background: var(--soft2); color: var(--primary2); }
.hidden-file { display:none; }
@media (max-width: 760px) {
  .grid, .toolbar-grid { grid-template-columns: 1fr; }
  .hero { align-items: flex-start; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .entry { flex-direction: column; }
  .entry-actions { flex-direction: row; }
  .app { padding-bottom: 7.8rem; }
  .bottom { grid-template-columns: repeat(6, 1fr); }
}
