:root {
  --ink: #162033;
  --muted: #718096;
  --line: #e8edf2;
  --paper: #f8faf9;
  --card: #ffffff;
  --mint: #c8f3d8;
  --mint-deep: #2b9566;
  --coral: #f27661;
  --yellow: #f8c95b;
  --night: #111827;
  --night-soft: #1e293b;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(43, 149, 102, 0.28);
  outline-offset: 2px;
}

.app-shell {
  width: min(1220px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.topbar,
.brand-lockup,
.topbar-meta,
.panel-heading,
.progress-label,
.voice-note,
.music-note,
.drawer-heading,
.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar {
  margin-bottom: 28px;
}

.brand-lockup {
  justify-content: flex-start;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--night);
  background: var(--mint);
  font-weight: 850;
  letter-spacing: -1px;
}

.brand-kicker,
.section-label,
.form-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.2px;
}

h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.8px;
}

.topbar-meta {
  gap: 18px;
}

.pro-pill {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid #38516e;
  border-radius: 999px;
  color: #9ecbff;
  background: #17283b;
  font-size: 12px;
  font-weight: 850;
}

.pro-pill.is-pro {
  color: #07101b;
  border-color: var(--mint);
  background: var(--mint);
}

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mint-deep);
  font-size: 13px;
  font-weight: 750;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint-deep);
  box-shadow: 0 0 0 4px rgba(43, 149, 102, 0.12);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--card);
  font-size: 17px;
}

.icon-button:hover {
  color: var(--ink);
  border-color: #cad5df;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.timer-panel,
.plan-panel,
.settings-drawer {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
}

.timer-panel {
  min-height: 650px;
  padding: 28px 38px 24px;
}

.plan-panel {
  min-height: 650px;
  padding: 28px 26px 24px;
}

.panel-heading {
  align-items: flex-start;
}

.panel-heading.compact {
  gap: 16px;
}

.step-counter {
  color: var(--ink);
  font-size: 20px;
  font-weight: 850;
}

.step-counter span:first-child {
  color: var(--coral);
}

.step-slash {
  padding: 0 3px;
  color: #c9d2d9;
}

.timer-stage {
  display: grid;
  justify-items: center;
  padding: 45px 0 34px;
}

.timer-ring {
  display: grid;
  place-items: center;
  width: min(370px, 68vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--coral) var(--progress, 100%), #edf2f0 0);
  transition: background 0.35s ease;
}

.timer-ring.resting {
  background: conic-gradient(var(--yellow) var(--progress, 100%), #edf2f0 0);
}

.timer-ring-inner {
  display: grid;
  align-content: center;
  justify-items: center;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  border-radius: 50%;
  background: var(--card);
  text-align: center;
}

.phase-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 28px;
  padding: 0 13px;
  border-radius: 99px;
  color: #9f422f;
  background: #fff0ec;
  font-size: 12px;
  font-weight: 850;
}

.resting .phase-label {
  color: #946a12;
  background: #fff7dd;
}

#timeDisplay {
  margin: 9px 0 2px;
  color: var(--night);
  font-size: clamp(62px, 10vw, 104px);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -5px;
  line-height: 0.98;
}

.timer-caption {
  color: var(--muted);
  font-size: 13px;
}

.ring-legend {
  display: flex;
  gap: 24px;
  margin-top: 23px;
  color: var(--muted);
  font-size: 12px;
}

.ring-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ring-legend b {
  color: var(--ink);
  font-weight: 800;
}

.legend-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-swatch.work {
  background: var(--coral);
}

.legend-swatch.rest {
  background: var(--yellow);
}

.action-progress {
  max-width: 580px;
  margin: 0 auto;
}

.progress-label {
  color: var(--muted);
  font-size: 12px;
}

.progress-label strong {
  color: var(--ink);
  font-size: 13px;
}

.action-bars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.action-bar {
  height: 7px;
  border-radius: 9px;
  background: #edf1f1;
}

.action-bar.current {
  background: var(--coral);
}

.action-bar.done {
  background: var(--mint-deep);
}

.timer-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
}

.control-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  font-weight: 800;
}

.control-button.secondary {
  width: 45px;
  height: 45px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--card);
  font-size: 19px;
}

.control-button.secondary:hover {
  color: var(--ink);
  background: #f5f8f7;
}

.control-button.primary,
.save-button {
  min-height: 48px;
  padding: 0 25px;
  border-radius: 12px;
  color: var(--white);
  background: var(--night);
  font-size: 14px;
}

.control-button.primary {
  min-width: 155px;
  gap: 10px;
}

.control-button.primary:hover,
.save-button:hover {
  background: #27354b;
}

.keyboard-hint {
  margin: 15px 0 0;
  color: #a1adb7;
  text-align: center;
  font-size: 11px;
}

.total-duration {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.exercise-list {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.plan-header-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.exercise-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 9px 12px 9px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #f7f9f8;
}

.exercise-row.current {
  border-color: #f5c7bd;
  background: #fff6f2;
}

.exercise-row.done {
  background: #f0faf4;
}

.exercise-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--white);
  font-size: 12px;
  font-weight: 850;
}

.current .exercise-index {
  color: #b34a37;
  background: #ffdcd4;
}

.done .exercise-index {
  color: #18734d;
  background: var(--mint);
}

.exercise-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
}

.exercise-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.exercise-check {
  color: var(--mint-deep);
  font-size: 16px;
  font-weight: 850;
}

.voice-note {
  justify-content: flex-start;
  gap: 11px;
  margin-top: 23px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
}

.voice-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #765f15;
  background: #fff5d5;
  font-size: 19px;
}

.voice-note strong {
  display: block;
  font-size: 12px;
}

.voice-note p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.music-note {
  justify-content: flex-start;
  gap: 11px;
  margin-top: 17px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.music-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #416b9c;
  background: #e8f1fb;
  font-size: 19px;
  font-weight: 850;
}

.music-copy {
  min-width: 0;
}

.music-copy strong {
  display: block;
  font-size: 12px;
}

.music-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.music-select {
  max-width: 128px;
  margin-top: 7px;
  padding: 3px 20px 3px 5px;
  border: 1px solid #d9e4ee;
  border-radius: 6px;
  color: #416b9c;
  background: #f8fbfe;
  font-size: 10px;
}

.music-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.music-preview {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #cbd9e8;
  border-radius: 8px;
  color: #416b9c;
  background: #f5f9fd;
  font-size: 10px;
}

.music-upload {
  min-height: 26px;
  padding: 0 8px;
  border: 1px solid #38516e;
  border-radius: 8px;
  color: #9ecbff;
  background: #17283b;
  font-size: 10px;
  font-weight: 850;
}

.music-upload:hover {
  color: #e0efff;
  border-color: #6b91ba;
  background: #23415f;
}

.commerce-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}

.stats-panel {
  position: relative;
  min-height: 250px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  overflow: hidden;
}

.plan-subscribe {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #3f5a39;
  border-radius: 10px;
  color: #cbed8a;
  background: #172818;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.plan-subscribe:hover {
  color: #07101b;
  border-color: var(--mint);
  background: var(--mint);
}

.record-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.record-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid #26364b;
  border-radius: 12px;
  background: #172333;
}

.record-row strong,
.record-row b {
  color: var(--ink);
  font-size: 13px;
}

.record-row span {
  display: block;
  margin-top: 4px;
  color: #8291a4;
  font-size: 11px;
}

.empty-record {
  padding: 18px 14px;
  border: 1px dashed #34465d;
  border-radius: 12px;
  color: #8291a4;
  font-size: 12px;
  text-align: center;
}

.stats-tabs {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #2d3b50;
  border-radius: 10px;
  background: #101926;
}

.stats-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stats-tab {
  min-width: 38px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  color: #8291a4;
  background: transparent;
  font-size: 11px;
  font-weight: 850;
}

.stats-tab.is-active {
  color: #07101b;
  background: var(--mint);
}

.stats-chart {
  min-height: 170px;
  margin-top: 20px;
  border: 1px solid #26364b;
  border-radius: 14px;
  background: #101926;
}

.stats-chart svg {
  display: block;
  width: 100%;
  height: 150px;
}

.today-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.today-stats div {
  min-height: 92px;
  padding: 14px 10px;
  border: 1px solid #29394d;
  border-radius: 12px;
  background: #172333;
}

.today-stats span {
  display: block;
  color: #8291a4;
  font-size: 11px;
}

.today-stats strong {
  display: block;
  margin-top: 12px;
  color: var(--mint);
  font-size: 32px;
  line-height: 1;
}

.chart-line {
  fill: none;
  stroke: var(--mint);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--coral);
}

.chart-summary {
  display: flex;
  justify-content: space-between;
  padding: 0 14px 13px;
  color: #8291a4;
  font-size: 12px;
}

.chart-summary strong {
  color: var(--ink);
}

.paywall-cover {
  position: absolute;
  inset: 83px 26px 24px;
  display: grid;
  place-content: center;
  gap: 7px;
  border: 1px solid #5a4631;
  border-radius: 14px;
  color: #ffd879;
  background: rgba(16, 25, 38, 0.86);
  backdrop-filter: blur(8px);
  text-align: center;
}

.paywall-cover strong {
  font-size: 16px;
}

.paywall-cover span {
  color: #aab5c2;
  font-size: 12px;
}

.paywall-modal {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 9, 15, 0.72);
}

.paywall-card {
  position: relative;
  width: min(430px, 100%);
  padding: 34px 30px 28px;
  border: 1px solid #3f5268;
  border-radius: 18px;
  color: var(--ink);
  background: #131d2b;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
}

.paywall-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.paywall-card h2 {
  margin-bottom: 10px;
  font-size: 32px;
}

.paywall-card p:not(.section-label) {
  margin-bottom: 18px;
  color: #aab5c2;
  font-size: 13px;
  line-height: 1.6;
}

.paywall-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 22px;
}

.paywall-benefits span {
  min-height: 38px;
  padding: 10px;
  border: 1px solid #29394d;
  border-radius: 10px;
  color: #d9e5ef;
  background: #101926;
  font-size: 12px;
  font-weight: 750;
}

.paywall-card .save-button {
  width: 100%;
}

.paywall-card .text-button {
  width: 100%;
  margin-top: 12px;
}

.settings-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(5, 9, 15, 0.74);
  backdrop-filter: blur(5px);
}

.settings-language-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 14px;
  border: 1px solid #29394d;
  border-radius: 12px;
  background: #101926;
}

.settings-language-row span {
  color: #8291a4;
  font-size: 12px;
}

.music-preview:hover {
  color: #284d77;
  border-color: #94b2d1;
  background: #e8f1fb;
}

.volume-slider {
  width: 72px;
  accent-color: #416b9c;
  cursor: pointer;
}

.toggle {
  width: 36px;
  height: 22px;
  margin-left: auto;
  padding: 3px;
  border: 0;
  border-radius: 99px;
  background: #cbd5dc;
}

.toggle span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s ease;
}

.toggle.is-on {
  background: var(--mint-deep);
}

.toggle.is-on span {
  transform: translateX(14px);
}

.settings-drawer {
  margin-top: 18px;
  padding: 25px 28px 26px;
}

.drawer-heading {
  align-items: flex-start;
  margin-bottom: 25px;
}

.number-settings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.number-settings label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.number-settings label span {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="number"],
input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fbfcfc;
}

.number-settings input {
  width: 78px;
}

.name-settings {
  margin-top: 22px;
}

.name-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.name-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.drawer-actions {
  margin-top: 23px;
}

.text-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.text-button:hover {
  color: var(--ink);
}

.save-button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  font-size: 12px;
}

.finish-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.48);
}

.finish-card {
  width: min(390px, 100%);
  padding: 38px 30px 32px;
  border-radius: 16px;
  background: var(--white);
  text-align: center;
  box-shadow: 0 20px 70px rgba(17, 24, 39, 0.2);
}

.finish-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 20px;
  border-radius: 50%;
  color: #18734d;
  background: var(--mint);
  font-size: 28px;
  font-weight: 850;
}

.finish-card h2 {
  margin-bottom: 10px;
  font-size: 31px;
}

.finish-card > p:not(.section-label) {
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 13px;
}

.finish-card .save-button {
  width: 100%;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 5;
  padding: 11px 15px;
  border-radius: 9px;
  color: white;
  background: var(--night);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 28px, 620px);
    padding-top: 18px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .timer-panel {
    min-height: auto;
    padding: 24px 20px 22px;
  }

  .plan-panel {
    min-height: auto;
    padding: 24px 20px 22px;
  }

  .timer-stage {
    padding: 32px 0 28px;
  }

  .exercise-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-drawer {
    padding: 23px 20px;
  }
}

@media (max-width: 520px) {
  .topbar {
    margin-bottom: 17px;
  }

  .topbar-meta .session-chip {
    display: none;
  }

  h2 {
    font-size: 22px;
  }

  .timer-ring {
    width: min(300px, 76vw);
  }

  #timeDisplay {
    font-size: clamp(57px, 18vw, 82px);
  }

  .number-settings,
  .name-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .number-settings label:last-child {
    grid-column: 1 / -1;
  }

  .music-controls {
    gap: 8px;
  }

  .volume-slider {
    width: 58px;
  }
}

/* Training mode visual layer */
:root {
  --ink: #edf4f8;
  --muted: #8291a4;
  --line: #2b3933;
  --paper: #090d0b;
  --card: #121815;
  --mint: #b8ef54;
  --mint-deep: #8dcc34;
  --coral: #ff705f;
  --yellow: #ffc857;
  --night: #050806;
  --night-soft: #1d2722;
  --white: #f7fafc;
}

body {
  background:
    linear-gradient(180deg, #111811 0%, #090d0b 46%, #0b1119 100%);
}

.brand-kicker,
.section-label,
.form-label {
  color: #718197;
}

.brand-mark {
  color: #0a1118;
  background: var(--mint);
}

.session-chip {
  color: var(--mint);
}

.status-dot {
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(184, 239, 84, 0.12);
}

.icon-button,
.timer-panel,
.plan-panel,
.settings-drawer {
  border-color: var(--line);
  background: var(--card);
}

.timer-panel,
.plan-panel,
.stats-panel {
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.22);
}

.icon-button {
  color: #91a0b0;
}

.icon-button:hover,
.control-button.secondary:hover {
  color: var(--ink);
  border-color: #496079;
  background: #1b293b;
}

.step-counter {
  color: var(--ink);
}

.step-slash {
  color: #46566b;
}

.timer-ring {
  background: conic-gradient(var(--coral) var(--progress, 100%), #253246 0);
  box-shadow: 0 0 0 1px rgba(255, 112, 95, 0.08), 0 18px 60px rgba(0, 0, 0, 0.25);
}

.timer-ring.resting {
  background: conic-gradient(var(--yellow) var(--progress, 100%), #253246 0);
}

.timer-ring-inner {
  background: #101926;
}

.phase-label {
  color: #ff9b8e;
  background: #3a2025;
}

.resting .phase-label {
  color: #ffd879;
  background: #3b321e;
}

#timeDisplay {
  color: var(--white);
}

.timer-caption,
.ring-legend,
.progress-label,
.total-duration,
.keyboard-hint {
  color: #8291a4;
}

.ring-legend b,
.progress-label strong {
  color: var(--ink);
}

.action-bar {
  background: #273448;
}

.action-bar.done {
  background: var(--mint-deep);
}

.action-bar.current {
  background: var(--coral);
}

.control-button.secondary {
  border-color: var(--line);
  color: #91a0b0;
  background: #172333;
}

.control-button.primary,
.save-button {
  color: #07101b;
  background: var(--mint);
}

.control-button.primary:hover,
.save-button:hover {
  color: #07101b;
  background: #d0ff75;
}

.exercise-row {
  background: #192536;
}

.exercise-row.current {
  border-color: #75433d;
  background: #2d2028;
}

.exercise-row.done {
  background: #1b2b28;
}

.exercise-index {
  color: #91a0b0;
  background: #243247;
}

.current .exercise-index {
  color: #ff9b8e;
  background: #553036;
}

.done .exercise-index {
  color: var(--mint);
  background: #29452d;
}

.exercise-meta,
.voice-note p,
.music-copy p {
  color: #8291a4;
}

.voice-note,
.music-note {
  border-color: var(--line);
}

.voice-icon {
  color: #ffd879;
  background: #3b321e;
}

.music-icon {
  color: #9ecbff;
  background: #20344b;
}

.music-select {
  border-color: #38516e;
  color: #b7d7fb;
  background: #17283b;
}

.music-preview {
  border-color: #38516e;
  color: #9ecbff;
  background: #17283b;
}

.music-preview:hover {
  color: #e0efff;
  border-color: #6b91ba;
  background: #23415f;
}

.toggle {
  background: #3a4a5d;
}

.toggle.is-on {
  background: var(--mint-deep);
}

input[type="number"],
input[type="text"] {
  border-color: var(--line);
  color: var(--ink);
  background: #101926;
}

.text-button {
  color: #8291a4;
}

.text-button:hover {
  color: var(--ink);
}

.current-stack h2 {
  font-size: clamp(27px, 4vw, 42px);
  letter-spacing: -1.5px;
}

.current-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
  color: #8291a4;
  font-size: 12px;
}

.current-metrics span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid #2d3b50;
  border-radius: 7px;
  background: #172333;
}

.current-metrics span:first-child {
  color: #ffd3cb;
  border-color: #75433d;
  background: #33232a;
  font-weight: 800;
}

.current-metrics b {
  margin-left: 3px;
  color: var(--ink);
}

.group-dots {
  display: flex;
  gap: 7px;
  margin: 15px 0 11px;
}

.group-dot {
  width: 10px;
  height: 10px;
  border: 2px solid #43546a;
  border-radius: 50%;
  background: transparent;
}

.group-dot.current {
  border-color: var(--coral);
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(255, 112, 95, 0.12);
}

.group-dot.done {
  border-color: var(--mint);
  background: var(--mint);
}

.row-group-dots {
  display: flex;
  gap: 4px;
  margin-top: 7px;
}

.row-group-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3b4b60;
}

.row-group-dot.current {
  background: var(--coral);
}

.row-group-dot.done {
  background: var(--mint);
}

.timer-ring.countdown {
  animation: countdown-pulse 0.42s ease-in-out infinite alternate;
}

.timer-ring.countdown #timeDisplay {
  color: #ff8b7b;
}

.countdown-mode .timer-panel {
  border-color: #8b4238;
}

@keyframes countdown-pulse {
  from {
    transform: scale(1);
    filter: brightness(1);
  }
  to {
    transform: scale(1.025);
    filter: brightness(1.18);
  }
}

.finish-card {
  color: var(--ink);
  background: var(--card);
}

.finish-card > p:not(.section-label) {
  color: #8291a4;
}

@media (max-width: 520px) {
  .current-stack h2 {
    font-size: 28px;
  }

  .current-metrics {
    gap: 5px;
    font-size: 10px;
  }

  .current-metrics span {
    padding: 0 7px;
  }

  .stats-panel {
    padding: 22px 18px;
  }

  .plan-header-actions,
  .stats-actions {
    align-items: flex-end;
  }

  .paywall-cover {
    inset: 84px 18px 22px;
  }

  .paywall-benefits {
    grid-template-columns: 1fr;
  }
}

.language-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid #2d3b50;
  border-radius: 10px;
  background: #101926;
}

.language-switch button {
  min-width: 32px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  color: #8291a4;
  background: transparent;
  font-size: 11px;
  font-weight: 850;
}

.language-switch button.is-active {
  color: #07101b;
  background: var(--mint);
}

.settings-drawer {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 9;
  width: min(680px, calc(100vw - 28px));
  max-height: min(88dvh, 720px);
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translate(-50%, -50%);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  animation: modal-rise 0.18s ease-out;
}

.settings-drawer::before {
  display: none;
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 520px);
    padding-top: 14px;
    padding-bottom: 30px;
  }

  .topbar {
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
  }

  .brand-lockup {
    gap: 9px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    font-size: 13px;
  }

  .brand-kicker {
    margin-bottom: 3px;
    font-size: 9px;
    letter-spacing: 1px;
  }

  h1 {
    font-size: 18px;
  }

  .topbar-meta {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }

  .pro-pill,
  .icon-button {
    min-height: 38px;
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .topbar-meta .session-chip {
    display: none;
  }

  .timer-panel,
  .plan-panel,
  .stats-panel {
    border-radius: 12px;
  }

  .timer-panel {
    padding: 20px 16px 18px;
  }

  .timer-stage {
    padding: 28px 0 24px;
  }

  .timer-controls {
    gap: 10px;
    margin-top: 28px;
  }

  .control-button.secondary {
    width: 44px;
    height: 44px;
  }

  .control-button.primary {
    min-width: 148px;
  }

  .plan-panel {
    padding: 20px 16px 18px;
  }

  .exercise-list {
    margin-top: 18px;
  }

  .exercise-row {
    min-height: 58px;
    border-radius: 10px;
  }

  .voice-note,
  .music-note {
    margin-top: 16px;
    padding-top: 16px;
  }

  .music-note {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .music-controls {
    grid-column: 1 / -1;
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: 34px auto 42px minmax(90px, 1fr);
    gap: 10px;
  }

  .music-preview,
  .music-upload,
  .music-controls .toggle {
    min-height: 34px;
  }

  .music-preview {
    width: 34px;
    height: 34px;
  }

  .music-controls .toggle {
    justify-self: start;
    margin-left: 0;
  }

  .volume-slider {
    width: 100%;
    align-self: center;
  }

  .settings-drawer {
    width: min(100vw - 20px, 520px);
    padding: 20px 16px 16px;
  }

  .drawer-heading {
    margin-bottom: 18px;
  }

  .settings-language-row {
    margin-bottom: 16px;
    padding: 12px;
  }

  .number-settings,
  .name-grid {
    grid-template-columns: 1fr;
  }

  .panel-heading.compact,
  .stats-actions {
    display: grid;
    justify-items: start;
  }

  .stats-actions .total-duration {
    order: 2;
  }

  .stats-tabs {
    order: 1;
  }

  .today-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .today-stats div {
    min-height: 76px;
    padding: 12px 8px;
  }

  .today-stats strong {
    margin-top: 10px;
    font-size: 26px;
  }

  .chart-summary,
  .record-row {
    gap: 10px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .drawer-actions {
    position: sticky;
    bottom: -16px;
    margin: 18px -16px -16px;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--line);
    background: rgba(18, 24, 21, 0.94);
    backdrop-filter: blur(10px);
  }
}

@keyframes modal-rise {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 16px)) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
