:root {
  color-scheme: light;
  --bg: #e7edf4;
  --surface: rgba(236, 242, 249, 0.72);
  --surface-strong: #edf3f9;
  --text: #354458;
  --muted: #6e7c8f;
  --faint: #9aa8b8;
  --line: rgba(162, 177, 196, 0.28);
  --violet: #6e62f6;
  --violet-deep: #574bf0;
  --teal: #148f86;
  --brass: #b68b4a;
  --danger: #bd5f67;
  --shadow-light: -8px -8px 18px rgba(255, 255, 255, 0.76);
  --shadow-dark: 10px 10px 22px rgba(157, 170, 188, 0.31);
  --shadow-inset: inset 4px 4px 10px rgba(164, 177, 194, 0.24), inset -4px -4px 10px rgba(255, 255, 255, 0.68);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: "DM Sans", system-ui, sans-serif; font-size: 16px; line-height: 1.45; }
button, input { font: inherit; }
button { border: 0; }
button, input[type="range"] { touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 3px solid rgba(110, 98, 246, .36); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100; top: 12px; left: 16px; visibility: hidden; transform: translateY(-150%); padding: 10px 14px; border-radius: 8px; background: var(--text); color: white; transition: transform 180ms var(--ease), visibility 180ms var(--ease); }
.skip-link:focus-visible { visibility: visible; transform: translateY(0); }

.app-shell { width: min(100%, 1260px); margin: 0 auto; padding: 18px 28px 56px; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: var(--text); text-decoration: none; }
.brand-mark, .icon-button, .avatar, .streak-icon, .note-icon { display: inline-grid; place-items: center; }
.brand-mark { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.5); border-radius: 12px; color: var(--violet); background: rgba(239,244,250,.6); box-shadow: var(--shadow-light), var(--shadow-dark); }
.brand-mark svg { width: 18px; height: 18px; stroke-width: 1.8; }
.brand-name { font-family: Manrope, sans-serif; font-size: 21px; font-weight: 800; letter-spacing: -.03em; }
.brand-name span { color: var(--violet); }
.view-switcher { display: inline-flex; align-items: center; justify-self: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 15px; background: rgba(226, 234, 243, .56); box-shadow: var(--shadow-inset); }
.nav-tab, .mode-button, .sound-button { min-height: 38px; padding: 0 18px; color: var(--muted); border-radius: 11px; background: transparent; font-size: 13px; font-weight: 700; cursor: pointer; transition: color 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease); }
.nav-tab.is-active, .mode-button.is-active, .sound-button.is-active { color: var(--violet-deep); background: rgba(242, 246, 251, .86); box-shadow: 4px 4px 10px rgba(164, 176, 194, .24), -4px -4px 10px rgba(255,255,255,.7); }
.top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.icon-button { position: relative; width: 42px; height: 42px; padding: 0; border: 1px solid rgba(255,255,255,.42); border-radius: 12px; background: rgba(231, 238, 246, .62); color: var(--text); box-shadow: var(--shadow-light), var(--shadow-dark); cursor: pointer; transition: transform 180ms var(--ease), color 180ms var(--ease), box-shadow 180ms var(--ease); }
.icon-button:hover { transform: translateY(-1px); color: var(--violet-deep); }
.icon-button:active { transform: translateY(1px); box-shadow: var(--shadow-inset); }
.icon-button svg { width: 18px; height: 18px; stroke-width: 1.9; }
.icon-button.has-dot::after { content: ""; position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: #e58e9a; box-shadow: 0 0 0 3px var(--bg); }
.avatar { width: 42px; height: 42px; border-radius: 50%; color: white; background: var(--violet); box-shadow: 5px 5px 12px rgba(110, 98, 246, .27), -4px -4px 9px rgba(255,255,255,.65); font-size: 12px; font-weight: 800; letter-spacing: .04em; cursor: pointer; transition: transform 180ms var(--ease); }
.avatar:hover { transform: translateY(-1px); }
.utility-row { position: relative; display: flex; justify-content: flex-end; align-items: center; min-height: 52px; }
.search-field { display: flex; align-items: center; gap: 8px; width: min(100%, 320px); padding: 0 12px; min-height: 42px; border: 1px solid var(--line); border-radius: 11px; background: rgba(243,247,251,.78); box-shadow: var(--shadow-inset); }
.search-field svg { width: 16px; color: var(--muted); }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); }
.search-field kbd { color: var(--faint); font-size: 11px; }
.notification-popover, .profile-popover { position: absolute; z-index: 10; top: 8px; right: 54px; display: flex; align-items: center; gap: 8px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(242,247,252,.95); box-shadow: 8px 8px 18px rgba(157,170,188,.24); color: var(--muted); font-size: 13px; }
.notification-popover svg { width: 16px; color: var(--teal); }
.profile-popover { right: 0; flex-direction: column; align-items: flex-start; min-width: 170px; color: var(--text); }
.profile-popover span { color: var(--muted); font-size: 12px; }

.dashboard { padding-top: 24px; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin: 28px 0 30px; }
.eyebrow { margin: 0 0 7px; color: var(--violet); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-family: Manrope, sans-serif; letter-spacing: -.035em; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; }
h2 { margin-bottom: 0; font-size: 21px; line-height: 1.14; }
.intro-copy { margin: 0; color: var(--muted); font-size: 15px; }
.streak-chip { display: flex; align-items: center; gap: 10px; min-width: 148px; padding: 10px 14px 10px 10px; border: 1px solid rgba(255,255,255,.46); border-radius: 15px; background: rgba(233,240,247,.66); box-shadow: var(--shadow-light), var(--shadow-dark); }
.streak-icon { width: 38px; height: 38px; border-radius: 12px; color: var(--teal); background: rgba(227,239,243,.82); box-shadow: var(--shadow-inset); }
.streak-icon svg { width: 17px; }
.streak-chip strong, .streak-chip small { display: block; }
.streak-chip strong { font-size: 13px; }
.streak-chip small { color: var(--muted); font-size: 11px; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(320px, .92fr); gap: 22px; }
.panel { min-width: 0; padding: 26px 28px; border: 1px solid rgba(255,255,255,.5); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-light), var(--shadow-dark); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.panel-heading.compact { align-items: center; }
.mode-picker, .sound-picker { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: rgba(226,234,243,.54); box-shadow: var(--shadow-inset); }
.mode-button { min-width: 36px; padding: 0 10px; min-height: 35px; font-size: 12px; }
.timer-wrap { display: grid; place-items: center; padding: 30px 0 23px; }
.timer-ring { position: relative; --progress: 0deg; display: grid; place-items: center; width: min(250px, 68vw); aspect-ratio: 1; border-radius: 50%; background: conic-gradient(from -90deg, var(--violet) var(--progress), rgba(185,196,210,.52) var(--progress)); box-shadow: 11px 11px 22px rgba(157,170,188,.28), -11px -11px 22px rgba(255,255,255,.76); transition: background 280ms var(--ease); }
.timer-ring::before { content: ""; position: absolute; width: min(224px, calc(68vw - 26px)); aspect-ratio: 1; border-radius: 50%; background: var(--surface-strong); box-shadow: var(--shadow-inset); }
.timer-face { position: relative; z-index: 1; display: grid; justify-items: center; gap: 3px; }
.timer-status { color: var(--violet); font-size: 10px; font-weight: 800; }
.timer-value { font-family: Manrope, sans-serif; font-size: clamp(42px, 7vw, 60px); line-height: 1; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.timer-session { color: var(--muted); font-size: 12px; }
.timer-controls { display: flex; justify-content: center; align-items: center; gap: 14px; }
.icon-button.soft { width: 40px; height: 40px; background: rgba(229,237,245,.7); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border-radius: 11px; color: white; background: var(--violet); box-shadow: 7px 7px 13px rgba(110,98,246,.28), -4px -4px 8px rgba(255,255,255,.62); font-size: 14px; font-weight: 800; cursor: pointer; transition: transform 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease); }
.primary-button:hover { transform: translateY(-1px); background: var(--violet-deep); }
.primary-button:active { transform: translateY(1px); box-shadow: var(--shadow-inset); }
.primary-button svg { width: 16px; fill: currentColor; }
.progress-block { margin-top: 26px; }
.progress-labels { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; }
.progress-labels strong { display: block; margin-top: 3px; color: var(--text); font-size: 12px; }
.progress-labels span:last-child { text-align: right; }
.progress-track { height: 6px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: rgba(172,187,203,.32); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--teal); transition: width 280ms var(--ease); }

.sound-panel { display: flex; flex-direction: column; gap: 16px; }
.sound-visual { position: relative; min-height: 220px; overflow: hidden; border-radius: 17px; background-image: linear-gradient(180deg, rgba(8,38,32,.12), rgba(8,38,32,.52)), url("https://images.unsplash.com/photo-1511497584788-876760111969?auto=format&fit=crop&w=1000&q=82"); background-position: center; background-size: cover; }
.ready-pill { position: absolute; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 9px; color: #dcefe5; background: rgba(8,36,29,.7); font-size: 10px; font-weight: 800; letter-spacing: .03em; }
.ready-pill span { width: 6px; height: 6px; border-radius: 50%; background: #89d5a8; }
.sound-play { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 52px; height: 52px; transform: translate(-50%, -50%); border-radius: 50%; color: var(--text); background: rgba(234,242,246,.88); box-shadow: 5px 7px 12px rgba(6,34,25,.24); cursor: pointer; transition: transform 180ms var(--ease), background 180ms var(--ease); }
.sound-play:hover { transform: translate(-50%, -50%) scale(1.04); background: white; }
.sound-play svg { width: 20px; fill: currentColor; }
.sound-copy .eyebrow { margin-bottom: 4px; }
.sound-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sound-title-row > span { color: var(--muted); font-size: 11px; }
.sound-copy p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.sound-picker { align-self: stretch; display: grid; grid-template-columns: repeat(3, 1fr); }
.sound-button { min-height: 37px; padding: 0 8px; font-size: 12px; }
.volume-row { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.volume-row svg { width: 15px; flex: 0 0 auto; }
.volume-row input { width: 100%; accent-color: var(--violet); cursor: pointer; }

.essentials-panel, .rhythm-panel { min-height: 300px; }
.completion, .weekly-total { color: var(--text); font-size: 12px; text-align: right; }
.completion strong, .weekly-total strong { font-family: Manrope, sans-serif; font-size: 18px; }
.completion small, .weekly-total small { display: block; color: var(--muted); font-size: 10px; }
.task-list { display: grid; gap: 4px; margin-top: 20px; }
.task-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 11px; min-height: 54px; padding: 6px 4px; border-bottom: 1px solid rgba(170,182,198,.18); }
.task-check { position: relative; width: 22px; height: 22px; margin: 0; appearance: none; border: 1px solid rgba(179,191,207,.56); border-radius: 7px; background: rgba(235,241,247,.72); box-shadow: var(--shadow-inset); cursor: pointer; transition: background 180ms var(--ease), border-color 180ms var(--ease); }
.task-check:checked { border-color: var(--violet); background: var(--violet); box-shadow: none; }
.task-check:checked::after { content: ""; position: absolute; top: 4px; left: 7px; width: 5px; height: 9px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.task-text { min-width: 0; }
.task-name { display: block; overflow: hidden; color: var(--text); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.task-row.is-done .task-name { color: var(--muted); text-decoration: line-through; }
.task-time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.add-task { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.add-task input { min-width: 0; flex: 1; min-height: 40px; padding: 0 12px; border: 1px solid transparent; border-radius: 10px; outline: 0; background: rgba(227,235,243,.54); color: var(--text); box-shadow: var(--shadow-inset); }
.add-task input:focus { border-color: rgba(110,98,246,.42); }
.add-task .icon-button { width: 38px; height: 38px; }
.rhythm-panel { display: flex; flex-direction: column; }
.weekly-total small { display: flex; align-items: center; justify-content: flex-end; gap: 4px; color: var(--teal); font-weight: 700; }
.weekly-total svg { width: 12px; }
.rhythm-chart { display: flex; align-items: end; justify-content: space-between; gap: 10px; height: 148px; margin-top: 24px; padding: 0 3px; }
.bar-column { display: grid; justify-items: center; gap: 8px; height: 100%; flex: 1; }
.bar-shell { display: flex; align-items: end; width: min(40px, 100%); height: 116px; overflow: hidden; border-radius: 22px; background: rgba(198,209,222,.33); box-shadow: var(--shadow-inset); }
.bar-fill { display: block; width: 100%; border-radius: inherit; background: rgba(142,159,179,.62); transition: height 300ms var(--ease), background 180ms var(--ease); }
.bar-column.is-today .bar-fill { background: var(--violet); }
.bar-column small { color: var(--muted); font-size: 10px; font-weight: 700; }
.rhythm-note { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 11px 12px; border-radius: 12px; background: rgba(228,236,244,.52); box-shadow: var(--shadow-inset); }
.note-icon { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; color: var(--brass); background: rgba(238,233,220,.58); }
.note-icon svg { width: 15px; }
.rhythm-note p { margin: 0; color: var(--muted); font-size: 11px; }
.rhythm-note strong { color: var(--text); }
.rhythm-note small { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; }
.toast { position: fixed; z-index: 30; right: 24px; bottom: 22px; max-width: min(320px, calc(100vw - 48px)); padding: 11px 14px; border: 1px solid rgba(255,255,255,.52); border-radius: 10px; color: var(--text); background: rgba(242,247,252,.96); box-shadow: var(--shadow-light), var(--shadow-dark); font-size: 13px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 180ms var(--ease), transform 180ms var(--ease); }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 800px) {
  .app-shell { padding: 14px 18px 42px; }
  .topbar { grid-template-columns: 1fr auto; gap: 14px; }
  .view-switcher { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; justify-content: center; }
  .nav-tab { flex: 1; }
  .top-actions { gap: 7px; }
  .intro { align-items: flex-start; flex-direction: column; margin-top: 24px; }
  .streak-chip { align-self: stretch; width: fit-content; }
  .workspace-grid { grid-template-columns: 1fr; }
  .panel { padding: 22px 20px; border-radius: 18px; }
  .sound-visual { min-height: 200px; }
}

@media (max-width: 430px) {
  .app-shell { padding-inline: 12px; }
  .brand-name { font-size: 19px; }
  .icon-button, .avatar { width: 40px; height: 40px; }
  h1 { font-size: 31px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .panel-heading.compact { align-items: center; flex-direction: row; }
  .mode-picker { align-self: stretch; }
  .mode-button { flex: 1; }
  .timer-wrap { padding-top: 22px; }
  .timer-ring { width: min(224px, 74vw); }
  .timer-ring::before { width: min(198px, calc(74vw - 26px)); }
  .primary-button { padding-inline: 18px; }
  .sound-title-row { align-items: flex-start; flex-direction: column; gap: 4px; }
  .rhythm-chart { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
