:root {
  --bg: #0A0A0B;
  --surface: #121214;
  --surface-2: #1A1A1D;
  --surface-3: #232327;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #F3F1EC;
  --muted: #8E8B84;
  --faint: #56544F;
  --accent: #D8BC8D;
  --accent-soft: rgba(216, 188, 141, 0.12);
  --accent-ink: #19140B;
  --danger: #E07A6C;
  --danger-soft: rgba(224, 122, 108, 0.12);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --glass: rgba(18, 18, 20, 0.72);
  --r: 20px;
  --r-sm: 14px;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --safe-b: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
}

[data-theme="light"] {
  --bg: #F4F2ED;
  --surface: #FFFFFF;
  --surface-2: #F0EDE7;
  --surface-3: #E6E2DA;
  --line: rgba(24, 20, 12, 0.07);
  --line-2: rgba(24, 20, 12, 0.13);
  --text: #15130F;
  --muted: #7B776F;
  --faint: #B1ACA2;
  --accent: #9C7A43;
  --accent-soft: rgba(156, 122, 67, 0.11);
  --accent-ink: #FFFFFF;
  --danger: #C2554A;
  --danger-soft: rgba(194, 85, 74, 0.1);
  --shadow: 0 20px 50px -24px rgba(40, 30, 10, 0.28);
  --glass: rgba(255, 255, 255, 0.78);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  font-feature-settings: "ss01", "tnum";
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Icons ---------- */
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic .ac { fill: var(--accent); stroke: none; }
.ic .fill { fill: currentColor; stroke: none; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 28px; height: 28px; }

/* ---------- Layout ---------- */
.view {
  padding: calc(var(--safe-t) + 22px) 20px calc(var(--safe-b) + 130px);
  min-height: 100vh;
  animation: fade .35s var(--ease);
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.eyebrow { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.title { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1; letter-spacing: -.01em; margin: 8px 0 0; }
.title em { font-style: italic; color: var(--accent); }

.section-h { display: flex; align-items: center; justify-content: space-between; margin: 28px 2px 12px; }
.section-h h3 { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.link { color: var(--accent); font-size: 13px; font-weight: 600; }

/* ---------- Progress ring ---------- */
.ring { position: relative; width: 58px; height: 58px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: var(--line-2); }
.ring .bar { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 600; }

/* ---------- Day strip ---------- */
.strip-wrap { display: flex; gap: 8px; align-items: stretch; margin: 0 -20px; padding: 0 20px; }
.strip { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; flex: 1; padding: 2px 0; mask-image: linear-gradient(90deg, #000 85%, transparent); }
.strip::-webkit-scrollbar { display: none; }
.day {
  flex: none; width: 50px; padding: 10px 0 9px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  scroll-snap-align: start; transition: background .25s, border-color .25s, transform .2s;
}
.day:active { transform: scale(.96); }
.day .dw { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.day .dn { font-size: 18px; font-weight: 600; }
.day .dot { width: 4px; height: 4px; border-radius: 50%; background: transparent; }
.day .dot.has { background: var(--faint); }
.day .dot.all { background: var(--accent); }
.day.today .dn { color: var(--accent); }
.day.sel { background: var(--text); border-color: var(--text); }
.day.sel .dw { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.day.sel .dn { color: var(--bg); }
.day.sel .dot.has { background: color-mix(in srgb, var(--bg) 40%, transparent); }
.cal-btn { flex: none; width: 50px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); position: relative; }
.cal-btn input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 14px; padding: 15px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: opacity .3s, transform .2s var(--ease);
  animation: fade .35s var(--ease) both;
}
.item:active { transform: scale(.985); }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 500; overflow-wrap: anywhere; }
.item .meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.item .meta .ic { width: 13px; height: 13px; }
.item.done .t { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--faint); }
.item.done { background: transparent; }
.item .meta.late { color: var(--danger); }

.chk {
  flex: none; width: 26px; height: 26px; border-radius: 9px; border: 1.5px solid var(--line-2);
  display: grid; place-items: center; color: transparent; transition: all .25s var(--ease);
}
.chk .ic { width: 16px; height: 16px; stroke-width: 2; }
.chk.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.empty { text-align: center; padding: 46px 20px 30px; color: var(--muted); }
.empty .ic { width: 40px; height: 40px; stroke-width: 1.1; color: var(--faint); margin-bottom: 12px; }
.empty b { display: block; color: var(--text); font-family: var(--serif); font-weight: 400; font-size: 24px; margin-bottom: 4px; }
.empty p { margin: 0; font-size: 13.5px; }

/* ---------- Rules ---------- */
.rule { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px; border-radius: var(--r); }
.rule .row { display: flex; align-items: flex-start; gap: 12px; }
.rule .t { font-size: 16px; }
.rule .n { font-size: 13px; color: var(--muted); margin-top: 3px; }
.rule .foot { display: flex; align-items: center; justify-content: space-between; }
.week { display: flex; gap: 5px; }
.week i { width: 16px; height: 5px; border-radius: 3px; background: var(--surface-3); }
.week i.k { background: var(--accent); }
.week i.b { background: var(--danger); opacity: .75; }
.streak { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.streak b { color: var(--text); font-weight: 600; }
.streak .ic { width: 15px; height: 15px; }
.verdict { display: flex; gap: 6px; flex: none; }
.vbtn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); transition: all .25s var(--ease); }
.vbtn .ic { width: 18px; height: 18px; stroke-width: 1.8; }
.vbtn.yes.on { background: var(--accent); color: var(--accent-ink); }
.vbtn.no.on { background: var(--danger-soft); color: var(--danger); }
.rule.kept { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

.summary { display: flex; gap: 10px; }
.stat { flex: 1; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.stat .k { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat .v { font-family: var(--serif); font-size: 30px; line-height: 1.1; margin-top: 6px; }
.stat .v small { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-left: 3px; }

/* ---------- O'zim (daftar) ---------- */
.note-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); letter-spacing: .02em; padding: 0 2px 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.note {
  display: block; width: 100%; min-height: 55vh; padding: 0 2px; border: 0; outline: none; resize: none; overflow: hidden;
  background: transparent; color: var(--text); font-size: 17px; line-height: 1.75; caret-color: var(--accent);
}
.note::placeholder { color: var(--faint); font-family: var(--serif); font-style: italic; font-size: 21px; }
.note::selection { background: var(--accent-soft); }
.done-btn { visibility: hidden; padding: 8px 0; }
.writing .done-btn { visibility: visible; }
.writing .tabbar, .writing .runbar { display: none; }
.writing .view { padding-bottom: 40vh; }

/* ---------- Focus ---------- */
.hero { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.hero .big { font-family: var(--serif); font-size: 52px; line-height: 1; margin-top: 8px; }
.hero .big small { font-family: var(--sans); font-size: 15px; color: var(--muted); margin: 0 10px 0 4px; }
.bars { display: flex; gap: 8px; align-items: flex-end; height: 92px; margin-top: 22px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bars .col { width: 100%; border-radius: 6px; background: var(--surface-3); min-height: 4px; transition: height .6s var(--ease); }
.bars .b.now .col { background: var(--accent); }
.bars .lbl { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.bars .b.now .lbl { color: var(--text); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tcard {
  position: relative; aspect-ratio: 1 / .86; padding: 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
  transition: transform .2s var(--ease), border-color .3s; animation: fade .35s var(--ease) both;
}
.tcard:active { transform: scale(.97); }
.tcard .m { font-family: var(--serif); font-size: 46px; line-height: .9; }
.tcard .m small { font-family: var(--sans); font-size: 13px; color: var(--muted); margin-left: 4px; }
.tcard .nm { font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard .go { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.tcard .go .ic { width: 13px; height: 13px; margin-left: 2px; }
.tcard.active { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.tcard.active .go { background: var(--accent); color: var(--accent-ink); }
.tcard .arc { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); }
.tcard.add { align-items: center; justify-content: center; gap: 8px; color: var(--muted); border-style: dashed; border-color: var(--line-2); background: transparent; font-size: 13px; font-weight: 500; }
.tcard .del { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); animation: pop .25s var(--ease); }
.tcard .del .ic { width: 17px; height: 17px; }
.editing .tcard:not(.add) { animation: wiggle .5s ease-in-out infinite alternate; }
@keyframes wiggle { from { transform: rotate(-.6deg); } to { transform: rotate(.6deg); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.sess { display: flex; align-items: center; justify-content: space-between; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.sess:last-child { border-bottom: 0; }
.sess .l { display: flex; align-items: center; gap: 10px; }
.sess .l i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.sess .l i.c { background: var(--accent); }
.sess .r { color: var(--muted); font-size: 13px; }

/* ---------- Focus overlay ---------- */
.focus {
  position: fixed; inset: 0; z-index: 40; background: var(--bg);
  display: flex; flex-direction: column; align-items: center;
  padding: calc(var(--safe-t) + 18px) 24px calc(var(--safe-b) + 34px);
  animation: rise .45s var(--ease);
}
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.focus.out { animation: sink .3s var(--ease) forwards; }
@keyframes sink { to { transform: translateY(30px); opacity: 0; } }
.focus .bar { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.focus .state { font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.focus .state i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.focus .state.live i { background: var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.dial { position: relative; width: min(78vw, 330px); aspect-ratio: 1; margin: auto 0; display: grid; place-items: center; }
.dial svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.dial circle { fill: none; }
.dial .track { stroke: var(--line-2); stroke-width: 1.2; }
.dial .ticks { stroke: var(--faint); stroke-width: 6; stroke-dasharray: .6 7.22; opacity: .6; }
.dial .prog { stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.dial .center { text-align: center; }
.dial .time { font-family: var(--sans); font-weight: 300; font-size: clamp(54px, 17vw, 76px); letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1; }
.dial .sub { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted); margin-top: 10px; }
.controls { display: flex; align-items: center; gap: 26px; }
.ctrl { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: transform .2s; }
.ctrl:active { transform: scale(.92); }
.ctrl .ic { width: 20px; height: 20px; }
.ctrl.main { width: 84px; height: 84px; background: var(--accent); color: var(--accent-ink); border: 0; box-shadow: 0 16px 40px -14px color-mix(in srgb, var(--accent) 70%, transparent); }
.ctrl.main .ic { width: 28px; height: 28px; }
.ctrl.ghost { visibility: hidden; }
.focus .today-line { margin-top: 26px; font-size: 13px; color: var(--muted); }
.focus .today-line b { color: var(--text); font-weight: 600; }

/* ---------- Runbar ---------- */
.runbar {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 86px); z-index: 20;
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
  background: var(--glass); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); animation: rise .4s var(--ease);
}
.runbar .l { flex: 1; min-width: 0; }
.runbar .l small { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.runbar .l span { font-weight: 600; font-size: 14px; }
.runbar .tm { font-variant-numeric: tabular-nums; font-weight: 500; font-size: 17px; }
.runbar .pp { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.runbar .pp .ic { width: 15px; height: 15px; }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 16px); z-index: 30;
  display: flex; padding: 6px; gap: 2px; width: min(calc(100% - 24px), 420px);
  background: var(--glass); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--line-2); border-radius: 22px; box-shadow: var(--shadow);
}
.tab { position: relative; z-index: 1; flex: 1; height: 50px; border-radius: 17px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .05em; transition: color .3s; }
.tab .ic { width: 21px; height: 21px; }
.tab.on { color: var(--text); }
.tab-glider { position: absolute; top: 0; left: 0; border-radius: 17px; background: var(--surface-3); transition: transform .45s var(--ease), width .3s, height .3s; }
.brand { display: none; }

/* ---------- FAB ---------- */
.fab {
  position: fixed; right: 20px; bottom: calc(var(--safe-b) + 92px); z-index: 25;
  width: 56px; height: 56px; border-radius: 19px; display: grid; place-items: center;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow); transition: transform .2s var(--ease);
}
.fab:active { transform: scale(.92); }
.fab .ic { stroke-width: 1.8; }
.has-run .fab { bottom: calc(var(--safe-b) + 156px); }

/* ---------- Sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .5); animation: fadein .3s; backdrop-filter: blur(2px); }
@keyframes fadein { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-top-left-radius: 28px; border-top-right-radius: 28px;
  border: 1px solid var(--line-2); border-bottom: 0;
  padding: 10px 20px calc(var(--safe-b) + 20px); animation: up .42s var(--ease);
}
@keyframes up { from { transform: translateY(100%); } }
.sheet.out { animation: down .28s var(--ease) forwards; }
.scrim.out { animation: fadeout .28s forwards; }
@keyframes down { to { transform: translateY(100%); } }
@keyframes fadeout { to { opacity: 0; } }
.grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 0 auto 18px; }
.sheet h2 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 0 0 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 2px 8px; }
.input {
  width: 100%; padding: 15px 16px; border-radius: var(--r-sm); background: var(--surface-2);
  border: 1px solid transparent; outline: none; font-size: 16px; transition: border-color .2s; resize: none;
}
.input:focus { border-color: var(--line-2); }
.input::placeholder { color: var(--faint); }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 10px 15px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; position: relative; transition: all .2s; }
.chip .ic { width: 16px; height: 16px; }
.chip.on { background: var(--text); color: var(--bg); }
.chip.on .ic .ac { fill: var(--accent); }
.chip input { position: absolute; inset: 0; opacity: 0; width: 100%; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--surface-2); }
.toggle-row .l { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.toggle-row .l .ic { width: 19px; height: 19px; color: var(--muted); }
.switch { width: 46px; height: 28px; border-radius: 14px; background: var(--surface-3); position: relative; transition: background .25s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform .3s var(--ease); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(18px); background: var(--accent-ink); }
.time-in { margin-top: 8px; text-align: center; font-size: 34px; font-weight: 300; letter-spacing: -.02em; padding: 10px; }
.time-in::-webkit-calendar-picker-indicator { display: none; }
.hint { font-size: 12.5px; color: var(--muted); margin: 8px 2px 0; }
.hint.warn { color: var(--danger); }
.actions { display: flex; gap: 10px; margin-top: 22px; }
.btn { flex: 1; height: 54px; border-radius: 16px; font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.danger { flex: none; width: 54px; background: var(--danger-soft); color: var(--danger); }
.btn:disabled { opacity: .35; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.presets .chip { justify-content: center; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); z-index: 70; transform: translate(-50%, -140%);
  padding: 11px 18px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow); transition: transform .45s var(--ease), opacity .3s; opacity: 0; pointer-events: none; white-space: nowrap; max-width: 90vw; overflow: hidden; text-overflow: ellipsis;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.skeleton { height: 64px; border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin-bottom: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* =====================================================================
   DESKTOP — keng ekran: yon menyu, markazlashgan kontent, modal oynalar
   ===================================================================== */
@media (hover: hover) {
  .item:hover, .tcard:not(.add):hover, .day:not(.sel):hover, .stat:hover { border-color: var(--line-2); }
  .tcard.add:hover { color: var(--text); border-color: var(--muted); }
  .chip:not(.on):hover, .vbtn:not(.on):hover, .icon-btn:hover { color: var(--text); background: var(--surface-3); }
  .tab:not(.on):hover { color: var(--text); }
  .fab:hover { transform: translateY(-2px); }
  .btn.primary:hover:not(:disabled) { opacity: .9; }
  .ctrl:not(.main):hover { background: var(--surface-2); }
}

@media (min-width: 900px) {
  :root { --side: 248px; }
  body { font-size: 15.5px; }

  /* Yon menyu */
  .tabbar {
    left: 0; top: 0; bottom: 0; transform: none; width: var(--side);
    flex-direction: column; gap: 4px; padding: calc(var(--safe-t) + 30px) 16px 24px;
    border-radius: 0; border: 0; border-right: 1px solid var(--line); box-shadow: none;
    background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  .brand {
    display: flex; align-items: center; gap: 10px; padding: 0 12px; margin-bottom: 30px;
    font-family: var(--serif); font-size: 26px; line-height: 1;
  }
  .brand-mark { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); transform: rotate(45deg); }
  .tab { flex: none; height: 46px; flex-direction: row; justify-content: flex-start; gap: 13px; padding: 0 14px; font-size: 14.5px; letter-spacing: 0; border-radius: 13px; }
  .tab .ic { width: 20px; height: 20px; }
  .tab-glider { border-radius: 13px; }

  /* Kontent */
  .view {
    margin-left: var(--side);
    padding: calc(var(--safe-t) + 52px) clamp(32px, 5vw, 72px) 120px;
    max-width: calc(var(--side) + 920px);
  }
  .title { font-size: 58px; }
  .head { margin-bottom: 30px; }
  .ring { width: 66px; height: 66px; }

  .strip-wrap { margin: 0; padding: 0; }
  .day { width: 58px; padding: 12px 0 10px; }
  .cal-btn { width: 58px; }

  .item { padding: 17px 20px; }
  .list:has(.rule) { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
  .list:has(.rule) > .empty { grid-column: 1 / -1; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
  .hero { padding: 28px; }
  .hero .big { font-size: 64px; }
  .bars { height: 130px; }
  .note { font-size: 18px; min-height: 65vh; max-width: 760px; }

  /* FAB — kontent ustida, o'ng pastda */
  .fab, .has-run .fab { right: 40px; bottom: 36px; }

  /* Faol taymer paneli — yon menyuning pastida */
  .runbar {
    left: 16px; right: auto; width: calc(var(--side) - 32px); bottom: 20px;
    flex-wrap: wrap; padding: 14px; gap: 10px; cursor: pointer; z-index: 31;
  }
  .runbar .l { flex: 1 1 100%; }
  .runbar .tm { flex: 1; font-size: 22px; }

  /* Sheet → markaziy modal */
  .scrim { backdrop-filter: blur(6px); background: rgba(0, 0, 0, .45); }
  .sheet {
    left: 50%; right: auto; top: 50%; bottom: auto; width: min(520px, calc(100vw - 48px));
    max-height: 86vh; border-radius: 26px; border: 1px solid var(--line-2);
    padding: 30px 30px 26px; box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .6);
    transform: translate(-50%, -50%); animation: modalIn .32s var(--ease);
  }
  .sheet.out { animation: modalOut .2s var(--ease) forwards; }
  .grip { display: none; }
  .sheet h2 { font-size: 34px; }

  /* Fokus oynasi */
  .focus { padding: calc(var(--safe-t) + 32px) 40px 48px; }
  .dial { width: min(56vh, 460px); }
  .dial .time { font-size: clamp(64px, 9vh, 96px); }
  .ctrl.main { width: 92px; height: 92px; }

  .toast { top: calc(var(--safe-t) + 24px); }
}
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
@keyframes modalOut { to { opacity: 0; transform: translate(-50%, -48%) scale(.98); } }

@media (min-width: 1280px) {
  .view { padding-left: 88px; padding-right: 88px; }
}
