/* Petaly
   Yerlesim: telefonda tek sutun ve alt sekme cubugu; masaustunde sol kenar cubugu,
   solda ozet ve bugun kartlari, sagda buyuk takvim. Apple duzeni, pastel gul ve lavanta. */
:root {
  --bg: #F7F4F8;
  --surface: #FFFFFF;
  --surface-2: #F1EDF3;
  --line: rgba(58, 36, 70, 0.10);
  --fg: #1E1A22;
  --fg-2: #6F6878;
  --fg-3: #A29BAA;
  --primary: #C9506F;
  --on-primary: #FFFFFF;
  --rose-ink: #8A2E47;
  --flow-1: #F8DEE5;
  --flow-2: #F2B5C4;
  --flow-3: #E48AA1;
  --flow-4: #C9506F;
  --on-flow-strong: #FFFFFF;
  --predict: #E48AA1;
  --predict-bg: #FCEEF2;
  --fertile-bg: #E4E8FB;
  --fertile-ink: #4554A0;
  --pain: #9A7BD0;
  --danger: #C8353F;
  --shadow: 0 1px 2px rgba(40, 20, 50, 0.04), 0 8px 24px rgba(40, 20, 50, 0.06);
  --sheet-shadow: 0 -8px 40px rgba(20, 10, 30, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --r-card: 20px;
  --r-ctl: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121015; --surface: #1C1920; --surface-2: #28232D; --line: rgba(255, 255, 255, 0.08);
    --fg: #F3EEF5; --fg-2: #A9A1B1; --fg-3: #6F6877;
    --primary: #EB86A0; --on-primary: #2B0F19; --rose-ink: #F4B3C3;
    --flow-1: #3A2631; --flow-2: #683447; --flow-3: #A7506B; --flow-4: #E27896; --on-flow-strong: #2B0F19;
    --predict: #C7637F; --predict-bg: #2A1C23;
    --fertile-bg: #252B48; --fertile-ink: #B3BDF2; --pain: #B9A0E6; --danger: #F0717A;
    --shadow: none; --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121015; --surface: #1C1920; --surface-2: #28232D; --line: rgba(255, 255, 255, 0.08);
  --fg: #F3EEF5; --fg-2: #A9A1B1; --fg-3: #6F6877;
  --primary: #EB86A0; --on-primary: #2B0F19; --rose-ink: #F4B3C3;
  --flow-1: #3A2631; --flow-2: #683447; --flow-3: #A7506B; --flow-4: #E27896; --on-flow-strong: #2B0F19;
  --predict: #C7637F; --predict-bg: #2A1C23;
  --fertile-bg: #252B48; --fertile-ink: #B3BDF2; --pain: #B9A0E6; --danger: #F0717A;
  --shadow: none; --sheet-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.muted { color: var(--fg-2); }

/* Dugmeler */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-ctl);
  font-weight: 600; font-size: 15px; transition: transform .12s ease, background-color .15s ease, opacity .15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-soft { background: var(--surface-2); color: var(--fg); }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: default; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--fg);
}
.icon-btn svg { width: 20px; height: 20px; }

/* Bolumlu secici */
.seg { display: flex; padding: 3px; gap: 2px; background: var(--surface-2); border-radius: 11px; }
.seg-btn {
  flex: 1; border: 0; background: transparent; border-radius: 9px; min-height: 36px; padding: 0 12px;
  font-size: 14px; font-weight: 500; color: var(--fg-2);
}
.seg-btn.is-on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg-sm .seg-btn { min-height: 30px; font-size: 13px; padding: 0 10px; }

/* Giris */
.auth {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface); border-radius: 28px; padding: 36px 28px 28px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 20px;
}
.auth-title { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: -0.03em; color: var(--primary); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--fg-2); }
.field input, .date-input {
  height: 48px; border: 1px solid transparent; border-radius: var(--r-ctl); padding: 0 14px;
  background: var(--surface-2); color: var(--fg); font: inherit; font-size: 16px;
}
.field input:focus, .date-input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.form-error { color: var(--danger); font-size: 14px; }

/* Uygulama iskeleti */
.app { min-height: 100vh; }
.sidebar { display: none; }
.main {
  max-width: 1180px; margin: 0 auto;
  padding-top: 20px; padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.topbar-date { font-size: 13px; font-weight: 600; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.04em; }
.hello { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; overflow-wrap: anywhere; }
.hello span { color: var(--primary); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tab-btn {
  flex: 1; max-width: 120px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; font-size: 11px; font-weight: 500; color: var(--fg-3);
}
.tab-btn svg { width: 25px; height: 25px; }
.tab-btn.is-on { color: var(--primary); }

.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); }

.cal-layout { display: grid; gap: 14px; }
.col-side { display: contents; }
.summary { order: 1; }
.cal-card { order: 2; }
.today-card { order: 3; }

/* Ozet karti */
.summary { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.sum-label { font-size: 13px; font-weight: 600; color: var(--fg-2); }
.sum-big { font-family: var(--font-display); font-size: 34px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.sum-big em { font-style: normal; color: var(--primary); }
.sum-note { font-size: 14px; color: var(--fg-2); }
.range-bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.range-bar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--flow-2); }
.range-bar b { position: absolute; top: -3px; width: 4px; height: 14px; border-radius: 2px; background: var(--primary); }
.range-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.sum-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sum-actions .btn { flex: 1 1 auto; white-space: nowrap; }
.pill {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; background: var(--predict-bg); color: var(--rose-ink);
}
.pill.blue { background: var(--fertile-bg); color: var(--fertile-ink); }

/* Bugun karti */
.today-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.today-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.today-head h2 { font-size: 17px; font-weight: 600; }
.today-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--fg); }
.tag.flow { background: var(--flow-1); color: var(--rose-ink); }
.empty-note { font-size: 14px; color: var(--fg-2); }

/* Takvim */
.cal-card { padding: 16px 12px 16px; min-width: 0; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 10px; }
.cal-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekdays span { text-align: center; font-size: 12px; font-weight: 600; color: var(--fg-3); padding: 4px 0 8px; }
.cal-grid { row-gap: 4px; }
.day {
  position: relative; border: 0; background: none; padding: 0; aspect-ratio: 1 / 1; max-width: 100%;
  display: grid; place-items: center;
}
.day-n {
  position: relative; z-index: 1; width: 86%; aspect-ratio: 1 / 1; max-width: 52px; border-radius: 50%; display: grid; place-items: center;
  font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; transition: transform .1s;
}
.day:active .day-n { transform: scale(0.92); }
.day.out .day-n { color: var(--fg-3); opacity: .45; }
.day.future .day-n { color: var(--fg-2); }
.day.f1 .day-n { background: var(--flow-1); color: var(--rose-ink); }
.day.f2 .day-n { background: var(--flow-2); color: var(--rose-ink); }
.day.f3 .day-n { background: var(--flow-3); color: var(--on-flow-strong); font-weight: 600; }
.day.f4 .day-n { background: var(--flow-4); color: var(--on-flow-strong); font-weight: 700; }
.day.pred .day-n { box-shadow: inset 0 0 0 1.5px var(--predict); background: var(--predict-bg); color: var(--rose-ink); }
.day.pred:not(.likely) .day-n { box-shadow: none; background: var(--predict-bg); }
.day.pred.likely .day-n { box-shadow: inset 0 0 0 1.5px var(--predict); }
.day.fert .day-n { background: var(--fertile-bg); color: var(--fertile-ink); }
.cal-grid .day.today .day-n { box-shadow: inset 0 0 0 2px var(--fg); font-weight: 700; }
.cal-grid .day.today.f3 .day-n, .cal-grid .day.today.f4 .day-n { box-shadow: inset 0 0 0 2px var(--fg), inset 0 0 0 4px var(--surface); }
.day.sel .day-n { outline: 2px solid var(--primary); outline-offset: 2px; }
.dots { position: absolute; bottom: 2%; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; z-index: 2; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--fg-3); }
.dots i.p { background: var(--pain); }
.dots i.o { background: var(--fertile-ink); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 14px 6px 4px; font-size: 12px; color: var(--fg-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.cal-actions { display: flex; gap: 8px; padding: 12px 4px 0; flex-wrap: wrap; }
.cal-actions .btn { flex: 1 1 auto; white-space: nowrap; padding: 0 14px; }

/* Alt panel (gun kaydi) */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 8, 20, 0.36); animation: fade .2s ease; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 26px 26px 0 0; box-shadow: var(--sheet-shadow);
  padding: 8px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  animation: rise .26s cubic-bezier(.2, .8, .2, 1);
}
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 2px auto 10px; }
.sheet-head {
  position: sticky; top: -8px; z-index: 2; background: var(--surface);
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 4px 0 12px;
}
.sheet-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.sheet-sub { font-size: 14px; color: var(--fg-2); }
.sheet-body { display: flex; flex-direction: column; gap: 20px; }
.block { display: flex; flex-direction: column; gap: 10px; }
.block h3 { font-size: 13px; font-weight: 600; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.04em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid transparent;
  background: var(--surface-2); color: var(--fg); font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px; transition: background-color .12s, border-color .12s, transform .1s;
}
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--predict-bg); border-color: var(--primary); color: var(--rose-ink); }
.chip.pain[aria-pressed="true"] { background: color-mix(in srgb, var(--pain) 16%, var(--surface)); border-color: var(--pain); color: var(--fg); }
.chip .lvl { display: inline-flex; gap: 2px; align-items: flex-end; }
.chip .lvl b { width: 4px; border-radius: 2px; background: var(--fg-3); opacity: .35; }
.chip .lvl b.on { background: var(--primary); opacity: 1; }
.chip.pain .lvl b.on { background: var(--pain); }
.flow-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.flow-opt {
  border: 1.5px solid transparent; border-radius: 16px; background: var(--surface-2); padding: 10px 2px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; min-width: 0;
  letter-spacing: -0.01em; overflow-wrap: anywhere; text-align: center;
}
@media (max-width: 400px) { .flow-opt { font-size: 11px; } .flow-grid { gap: 4px; } }
.flow-opt .sw { width: 26px; height: 26px; border-radius: 50%; border: 1.5px dashed var(--fg-3); }
.flow-opt[data-v="1"] .sw { background: var(--flow-1); border: 0; }
.flow-opt[data-v="2"] .sw { background: var(--flow-2); border: 0; }
.flow-opt[data-v="3"] .sw { background: var(--flow-3); border: 0; }
.flow-opt[data-v="4"] .sw { background: var(--flow-4); border: 0; }
.flow-opt[aria-pressed="true"] { border-color: var(--primary); background: var(--predict-bg); color: var(--rose-ink); }
.note-toggle { align-self: flex-start; }
.note-input {
  width: 100%; min-height: 80px; resize: vertical; border: 1px solid transparent; border-radius: var(--r-ctl);
  background: var(--surface-2); color: var(--fg); font: inherit; font-size: 16px; padding: 12px 14px;
}
.note-input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.saved-hint { min-height: 20px; padding-top: 10px; font-size: 13px; color: var(--fg-2); text-align: center; }
.hint { font-size: 13px; color: var(--fg-2); }
.danger-link { align-self: center; background: none; border: 0; color: var(--danger); font-size: 14px; font-weight: 500; padding: 8px; }

.stepper { display: flex; align-items: center; gap: 16px; }
.step-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface-2); font-size: 24px; line-height: 1; }
.stepper output { min-width: 48px; text-align: center; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }

@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Istatistik */
.stats { display: grid; gap: 14px; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.tile-l { font-size: 13px; color: var(--fg-2); font-weight: 500; }
.tile-v { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile-v small { font-size: 15px; font-weight: 500; color: var(--fg-2); margin-left: 3px; }
.tile-s { font-size: 12px; color: var(--fg-2); }
.tile-word { display: block; font-size: 20px; line-height: 1.2; padding-block: 5px 3px; }
.panel { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel h2 { font-size: 17px; font-weight: 600; }
.panel-sub { font-size: 13px; color: var(--fg-2); margin-top: -10px; }
.insight-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.insight-list li { display: flex; gap: 12px; align-items: center; }
.insight-list .ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--predict-bg); color: var(--primary); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.insight-list .ic.p { background: color-mix(in srgb, var(--pain) 16%, var(--surface)); color: var(--pain); }
.chart-wrap { overflow-x: auto; }
.chart { width: 100%; max-width: 640px; min-width: 280px; height: auto; display: block; }
.chart text { fill: var(--fg-2); stroke: none; font-size: 12px; font-family: var(--font); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--flow-3); stroke: none; }
.chart .pain-line { stroke: var(--pain); stroke-width: 2.5; }
.chart .pain-dot { fill: var(--surface); stroke: var(--pain); stroke-width: 2; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--fg-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.bars-h { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 28px; gap: 10px; align-items: center; font-size: 14px; }
.bar-row .track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--flow-2); border-radius: 4px; }
.bar-row .n { text-align: right; color: var(--fg-2); font-variant-numeric: tabular-nums; font-size: 13px; }
.cycle-list { display: flex; flex-direction: column; }
.cycle-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: 15px; font-variant-numeric: tabular-nums; }
.cycle-row:first-child { border-top: 0; }
.cycle-row .c-len { color: var(--fg-2); font-size: 14px; }
.cycle-row .c-tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--fg-2); }
.empty-state { padding: 36px 24px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty-state h2 { font-size: 20px; }
.empty-state p { color: var(--fg-2); max-width: 36ch; }

/* Ayarlar */
.settings { max-width: 640px; display: flex; flex-direction: column; }
.group-title { font-size: 13px; font-weight: 600; color: var(--fg-2); text-transform: uppercase; letter-spacing: 0.04em; padding: 18px 16px 8px; }
.group-title:first-child { padding-top: 0; }
.group { overflow: hidden; }
.row {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; min-height: 52px; border: 0; background: none; text-align: left; font-size: 16px;
}
.row + .row { border-top: 1px solid var(--line); }
.row small { display: block; font-size: 13px; color: var(--fg-2); margin-top: 3px; line-height: 1.4; max-width: 52ch; }
.row-toggle { cursor: pointer; }
.row-btn.danger { color: var(--danger); justify-content: center; font-weight: 500; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; width: 51px; height: 31px; border-radius: 16px; margin: 0;
  background: var(--surface-2); position: relative; cursor: pointer; transition: background-color .2s;
  box-shadow: inset 0 0 0 1px var(--line);
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s cubic-bezier(.2,.8,.2,1);
}
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(20px); }

.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500;
  max-width: calc(100% - 32px); animation: rise .2s ease;
}

/* Masaustu */
@media (min-width: 760px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .stat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { border-radius: 26px; max-height: 86vh; }
  .sheet-grip { display: none; }
}
@media (min-width: 980px) {
  .tabbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px; position: fixed; top: 0; bottom: 0; left: 0; width: 232px;
    padding: calc(24px + env(safe-area-inset-top, 0px)) 14px 24px max(14px, env(safe-area-inset-left, 0px));
    border-right: 1px solid var(--line); background: var(--bg);
  }
  .brand { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; color: var(--primary); padding: 0 12px 20px; }
  .nav-btn {
    display: flex; align-items: center; gap: 12px; border: 0; background: none; border-radius: 10px;
    padding: 10px 12px; font-size: 15px; font-weight: 500; color: var(--fg-2); text-align: left;
  }
  .nav-btn svg { width: 22px; height: 22px; }
  .nav-btn:hover { background: var(--surface-2); color: var(--fg); }
  .nav-btn.is-on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
  .app { padding-left: 232px; }
  .main { padding-top: 36px; padding-bottom: 48px; padding-left: 40px; padding-right: max(40px, env(safe-area-inset-right, 0px)); }
  .hello { font-size: 36px; }
  .topbar { margin-bottom: 26px; }
  .cal-layout { grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
  .col-side { display: grid; gap: 20px; align-content: start; min-width: 0; }
  .cal-card { padding: 22px 22px 20px; }
  .cal-grid { row-gap: 8px; }
  .day { aspect-ratio: auto; height: clamp(52px, 7.2vh, 72px); }
  .day-n { width: auto; height: 86%; max-width: none; font-size: 17px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
  .dots { bottom: -4px; }
  .stats .stat-tiles, .stats .wide { grid-column: 1 / -1; }
  .toast { bottom: 32px; left: calc(50% + 116px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
