:root {
  color-scheme: dark;
  --bg: #0a111b;
  --bg-soft: #0f1826;
  --panel: rgba(13, 22, 34, 0.82);
  --panel-strong: rgba(15, 25, 39, 0.96);
  --panel-soft: rgba(20, 32, 49, 0.82);
  --text: #edf3fb;
  --muted: #9aa8bc;
  --line: rgba(155, 184, 216, 0.14);
  --line-strong: rgba(155, 184, 216, 0.24);
  --primary: #7dd8ff;
  --primary-strong: #41c0ff;
  --accent: #ffb35c;
  --success: #8ee8b4;
  --warning: #ffd36d;
  --danger: #ff8a8a;
  --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.22);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-head: "Space Grotesk", sans-serif;
  --font-body: "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
}


body[data-theme="ocean"] {
  --bg: #071320;
  --bg-soft: #0b1b2d;
  --panel: rgba(8, 24, 38, 0.84);
  --panel-strong: rgba(9, 28, 43, 0.96);
  --panel-soft: rgba(17, 44, 67, 0.82);
  --text: #eef7ff;
  --muted: #98b8cf;
  --line: rgba(117, 196, 255, 0.16);
  --line-strong: rgba(117, 196, 255, 0.28);
  --primary: #78d7ff;
  --primary-strong: #2fb8f7;
  --accent: #65e0c7;
}

body[data-theme="latte"] {
  color-scheme: light;
  --bg: #f4efe7;
  --bg-soft: #f8f3ec;
  --panel: rgba(255, 250, 245, 0.9);
  --panel-strong: rgba(255, 250, 245, 0.97);
  --panel-soft: rgba(248, 241, 233, 0.95);
  --text: #1c2736;
  --muted: #6f7c8e;
  --line: rgba(89, 112, 138, 0.14);
  --line-strong: rgba(89, 112, 138, 0.24);
  --primary: #3aa6ff;
  --primary-strong: #1583db;
  --accent: #ff9b55;
  --success: #2ca86c;
  --warning: #d49c11;
  --danger: #d35f5f;
  --shadow-lg: 0 20px 60px rgba(86, 72, 56, 0.12);
  --shadow-md: 0 12px 30px rgba(86, 72, 56, 0.08);
}

body[data-theme="latte"] {
  background:
    radial-gradient(circle at top left, rgba(58, 166, 255, 0.12), transparent 24%),
    radial-gradient(circle at right 12% top 14%, rgba(255, 155, 85, 0.12), transparent 18%),
    linear-gradient(180deg, #f4efe7 0%, #efe8de 100%);
}

body[data-theme="latte"] .primary-btn {
  color: white;
}


body {
  position: relative;
  transition: background 0.25s ease, color 0.25s ease;
  overflow-x: hidden;
  padding: 18px;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at top left, rgba(125, 216, 255, 0.12), transparent 24%),
    radial-gradient(circle at right 12% top 14%, rgba(255, 179, 92, 0.12), transparent 18%),
    linear-gradient(180deg, #09111c 0%, #0b1420 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(151, 178, 210, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(151, 178, 210, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.66), transparent 90%);
  pointer-events: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.backdrop-glow {
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(34px);
  opacity: 0.22;
  pointer-events: none;
}

.backdrop-glow-a {
  top: -120px;
  left: -70px;
  background: rgba(125, 216, 255, 0.22);
}

.backdrop-glow-b {
  right: -80px;
  bottom: 8%;
  background: rgba(255, 179, 92, 0.2);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 18px;
  max-width: 1450px;
  margin: 0 auto;
}

.sidebar,
.hero-panel,
.panel,
.compact-card,
.desk-card,
.sound-card,
.progress-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(22px);
}

.sidebar::before,
.hero-panel::before,
.panel::before,
.compact-card::before,
.desk-card::before,
.sound-card::before,
.progress-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 44%);
  pointer-events: none;
}

.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 18px;
  padding: 18px;
}

.sidebar-brand,
.tool-nav,
.sidebar-summary,
.hero-copy,
.hero-meta,
.panel-head,
.sub-head,
.focus-grid,
.focus-builder,
.desk-grid,
.sound-grid,
.progress-grid,
.history-table {
  position: relative;
  z-index: 1;
}

.brand-kicker,
.eyebrow,
.mission-preview span {
  display: block;
  color: var(--primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.sidebar-brand strong,
.hero-copy h1,
.panel-head h2,
.sub-head h3 {
  font-family: var(--font-head);
  letter-spacing: -0.04em;
}

.sidebar-brand strong {
  display: block;
  margin-top: 8px;
  font-size: 1.56rem;
}

.sidebar-brand small,
.hero-text,
.sub-head p,
.helper-text,
.side-stat span,
.side-stat strong,
.mini-metric span,
.status-tile span,
.field-card span,
.switch-row small,
.item-meta,
.history-row small,
.report-stat span,
.empty-player span,
.notes-foot span,
.timer-subtitle {
  color: var(--muted);
}

.sidebar-brand small {
  display: block;
  margin-top: 10px;
  line-height: 1.65;
}

.tool-nav {
  display: grid;
  gap: 10px;
  align-content: start;
}

.tool-btn {
  display: grid;
  gap: 4px;
  padding: 14px 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.tool-btn span {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tool-btn strong {
  font-size: 0.98rem;
}

.tool-btn small {
  color: var(--muted);
  line-height: 1.55;
}

.tool-btn.active,
.tool-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 216, 255, 0.3);
  background:
    radial-gradient(circle at top left, rgba(125, 216, 255, 0.12), transparent 58%),
    rgba(255, 255, 255, 0.04);
}

.sidebar-summary {
  display: grid;
  gap: 10px;
}

.side-stat {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.side-stat strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.page-shell {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  padding: 20px;
}

.hero-copy h1 {
  margin: 0;
  max-width: 10ch;
  font-size: clamp(2.3rem, 4.6vw, 4.1rem);
  line-height: 0.95;
}

.hero-text {
  margin: 14px 0 0;
  max-width: 58ch;
  line-height: 1.72;
}

.hero-actions,
.inline-actions,
.chip-row,
.notes-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-actions {
  margin-top: 22px;
}

.hero-meta {
  display: grid;
  gap: 12px;
}

.hero-stat {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(19, 31, 47, 0.96), rgba(11, 18, 28, 0.86));
}

.hero-stat-accent {
  background:
    radial-gradient(circle at top left, rgba(125, 216, 255, 0.14), transparent 50%),
    linear-gradient(180deg, rgba(19, 31, 47, 0.96), rgba(11, 18, 28, 0.86));
}

.hero-stat strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-head);
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  letter-spacing: -0.05em;
}

.hero-stat small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.primary-btn,
.ghost-btn {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 15px;
  font-weight: 800;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    opacity 0.2s ease;
}

.primary-btn {
  color: #05131d;
  background: linear-gradient(135deg, var(--primary) 0%, #acf0ff 100%);
  box-shadow: 0 14px 30px rgba(65, 192, 255, 0.22);
}

.ghost-btn {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.subtle-btn {
  min-height: 40px;
}

.primary-btn:hover,
.ghost-btn:hover,
.chip-btn:hover,
.mode-card:hover,
.planner-item:hover,
.sequence-item:hover,
.history-row:hover {
  transform: translateY(-1px);
}

.primary-btn:disabled,
.ghost-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.workspace {
  display: grid;
  gap: 18px;
}

.panel {
  padding: 18px;
}

.section-panel {
  display: none;
}

.section-panel.is-active {
  display: block;
  animation: fade-up 0.26s ease both;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-head-compact {
  margin-bottom: 16px;
}

.panel-head h2,
.sub-head h3 {
  margin: 0;
}

.panel-head h2 {
  font-size: clamp(1.45rem, 2.8vw, 2rem);
}

.sub-head p {
  margin: 8px 0 0;
  line-height: 1.65;
}

.status-badge,
.timer-phase-pill,
.checkbox-inline,
.chip-btn,
.priority-pill,
.type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.status-badge {
  min-height: 40px;
  padding: 0 16px;
  background: rgba(125, 216, 255, 0.12);
  color: var(--primary);
  border: 1px solid rgba(125, 216, 255, 0.18);
}

.status-badge.running {
  background: rgba(142, 232, 180, 0.14);
  color: var(--success);
}

.status-badge.paused {
  background: rgba(255, 211, 109, 0.14);
  color: var(--warning);
}

.status-badge.completed {
  background: rgba(255, 179, 92, 0.14);
  color: var(--accent);
}

.focus-grid,
.desk-grid,
.sound-grid,
.progress-grid {
  display: grid;
  gap: 16px;
}

.focus-grid {
  grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
}

.focus-main,
.focus-side,
.flow-side,
.desk-card,
.sound-card,
.progress-card {
  display: grid;
  gap: 14px;
}

.compact-card,
.desk-card,
.sound-card,
.progress-card {
  padding: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-md);
}

.timer-orb {
  --progress: 1;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 18px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 28%, rgba(125, 216, 255, 0.16), transparent 44%),
    conic-gradient(
      from 220deg,
      rgba(125, 216, 255, 0.12) 0turn,
      rgba(125, 216, 255, 0.12) calc((1 - var(--progress)) * 1turn),
      var(--primary) calc((1 - var(--progress)) * 1turn),
      var(--primary) 1turn
    );
  isolation: isolate;
}

.timer-orb::before {
  content: "";
  position: absolute;
  inset: 16px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.05), transparent 52%),
    linear-gradient(180deg, rgba(8, 17, 27, 0.96), rgba(13, 23, 36, 0.96));
  border: 1px solid rgba(125, 216, 255, 0.12);
}

.timer-orb[data-phase="break"] {
  background:
    radial-gradient(circle at 50% 28%, rgba(255, 179, 92, 0.16), transparent 44%),
    conic-gradient(
      from 220deg,
      rgba(255, 179, 92, 0.12) 0turn,
      rgba(255, 179, 92, 0.12) calc((1 - var(--progress)) * 1turn),
      var(--accent) calc((1 - var(--progress)) * 1turn),
      var(--accent) 1turn
    );
}

.timer-orb[data-phase="review"] {
  background:
    radial-gradient(circle at 50% 28%, rgba(142, 232, 180, 0.16), transparent 44%),
    conic-gradient(
      from 220deg,
      rgba(142, 232, 180, 0.12) 0turn,
      rgba(142, 232, 180, 0.12) calc((1 - var(--progress)) * 1turn),
      var(--success) calc((1 - var(--progress)) * 1turn),
      var(--success) 1turn
    );
}

.timer-orb > * {
  position: relative;
  z-index: 1;
}

.timer-phase-pill {
  padding: 9px 15px;
  background: rgba(125, 216, 255, 0.12);
  color: var(--primary);
  border: 1px solid rgba(125, 216, 255, 0.18);
}

#timer-display {
  margin-top: 12px;
  font-family: var(--font-head);
  font-size: clamp(3.2rem, 6vw, 4.9rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
}

.timer-subtitle {
  margin-top: 8px;
  text-align: center;
}

.timer-actions,
.mini-metrics,
.mode-grid,
.settings-grid,
.status-strip,
.reward-stats,
.report-stats {
  display: grid;
  gap: 10px;
}

.timer-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-metric,
.status-tile,
.report-stat,
.mission-preview,
.recall-prompt,
.quest-item {
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.mini-metric strong,
.status-tile strong,
.report-stat strong,
.mission-preview strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  line-height: 1.45;
}

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

.mode-card {
  padding: 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(21, 35, 53, 0.94), rgba(12, 20, 31, 0.86));
  color: var(--text);
}

.mode-card span,
.mode-card small {
  display: block;
}

.mode-card span {
  color: var(--primary);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-card strong {
  display: block;
  margin-top: 7px;
  font-family: var(--font-head);
}

.mode-card small {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.mode-card.active {
  border-color: rgba(125, 216, 255, 0.34);
  box-shadow: 0 14px 26px rgba(65, 192, 255, 0.12);
}

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

.switch-row,
.field-card {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.switch-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.switch-row strong,
.field-card span {
  display: block;
  font-size: 0.94rem;
  font-weight: 700;
}

.switch-row small {
  display: block;
  margin-top: 6px;
  line-height: 1.55;
}

.field-card input,
.field-card select,
.planner-form input,
.planner-form select,
.stack-form input,
.stack-form select,
#notes-input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(6, 12, 20, 0.9);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-card input:focus,
.field-card select:focus,
.planner-form input:focus,
.planner-form select:focus,
.stack-form input:focus,
.stack-form select:focus,
#notes-input:focus {
  border-color: rgba(125, 216, 255, 0.32);
  box-shadow: 0 0 0 4px rgba(125, 216, 255, 0.08);
}

.status-strip {
  grid-template-columns: 180px minmax(0, 1fr);
}

.status-wide {
  grid-column: auto;
}

.focus-builder,
.inline-grid {
  display: grid;
  gap: 12px;
}

.focus-builder {
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.1fr);
}

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

.stack-form,
.planner-form {
  display: grid;
  gap: 12px;
}

.chip-btn,
.checkbox-inline {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.checkbox-inline input {
  accent-color: var(--primary-strong);
}

.sequence-list,
.planner-list,
.history-table,
.quest-list {
  display: grid;
  gap: 10px;
}

.sequence-item,
.planner-item,
.history-row,
.quest-item {
  display: grid;
  gap: 10px;
}

.sequence-item {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.sequence-index,
.quest-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(125, 216, 255, 0.14);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
}

.type-pill {
  min-height: 34px;
  padding: 0 12px;
  background: rgba(125, 216, 255, 0.12);
  color: var(--primary);
}

.type-pill.break {
  background: rgba(255, 179, 92, 0.14);
  color: var(--accent);
}

.type-pill.review {
  background: rgba(142, 232, 180, 0.14);
  color: var(--success);
}

.tiny-action {
  min-width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.desk-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.planner-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.planner-item.done {
  opacity: 0.66;
}

.planner-item.done .item-title {
  text-decoration: line-through;
}

.planner-time {
  min-width: 88px;
  padding: 9px 11px;
  border-radius: 13px;
  background: rgba(125, 216, 255, 0.12);
  color: var(--primary);
  font-weight: 800;
  text-align: center;
}

.item-title {
  display: block;
  font-weight: 800;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.priority-pill {
  min-height: 34px;
  padding: 0 12px;
}

.priority-pill.high {
  background: rgba(255, 138, 138, 0.14);
  color: var(--danger);
}

.priority-pill.medium {
  background: rgba(255, 211, 109, 0.14);
  color: var(--warning);
}

.priority-pill.low {
  background: rgba(142, 232, 180, 0.14);
  color: var(--success);
}

#notes-input {
  min-height: 320px;
  padding: 14px;
  resize: vertical;
  line-height: 1.7;
}

.notes-foot {
  justify-content: space-between;
}

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

.youtube-embed {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(125, 216, 255, 0.12), transparent 44%),
    linear-gradient(180deg, rgba(18, 31, 49, 0.96), rgba(8, 15, 24, 0.98));
}

.youtube-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.youtube-embed.empty {
  display: grid;
  place-items: center;
}

.empty-player {
  padding: 24px;
  text-align: center;
}

.empty-player strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-head);
  font-size: 1.2rem;
}

.reward-stats,
.report-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.xp-track {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.xp-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.sub-head-inline {
  margin-top: 8px;
}

.mission-preview strong {
  line-height: 1.6;
}

.recall-prompt {
  color: var(--text);
  line-height: 1.7;
  font-weight: 700;
}

.quest-item {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.quest-item.done {
  border-color: rgba(142, 232, 180, 0.28);
  background: rgba(142, 232, 180, 0.08);
}

.quest-item.done .quest-mark {
  background: rgba(142, 232, 180, 0.16);
  color: var(--success);
}

.chart-card {
  min-height: 290px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.025);
}

.chart-card canvas {
  width: 100% !important;
  height: 240px !important;
}

.history-table {
  min-height: 120px;
}

.history-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(140px, 0.8fr) minmax(170px, 1fr) minmax(170px, 1fr) auto;
  align-items: center;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.history-row strong {
  display: block;
  font-weight: 800;
}

.history-head {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  line-height: 1.65;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto auto;
  }

  .tool-nav {
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    overflow-x: auto;
  }

  .hero-panel,
  .focus-grid,
  .sound-grid,
  .progress-grid,
  .desk-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  body {
    padding: 12px;
  }

  .hero-panel,
  .panel,
  .sidebar,
  .compact-card,
  .desk-card,
  .sound-card,
  .progress-card {
    padding: 16px;
  }

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

  .mini-metrics,
  .timer-actions,
  .mode-grid,
  .settings-grid,
  .reward-stats,
  .report-stats,
  .focus-builder,
  .inline-grid,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .planner-item,
  .sequence-item,
  .history-row {
    grid-template-columns: 1fr;
  }

  #timer-display {
    font-size: clamp(3rem, 14vw, 4.4rem);
  }
}

@media (max-width: 640px) {
  .tool-nav {
    grid-template-columns: 1fr;
  }

  .panel-head,
  .notes-foot {
    flex-direction: column;
    align-items: start;
  }

  .hero-copy h1 {
    max-width: 12ch;
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .timer-orb {
    min-height: 290px;
  }
}


/* refined compact UI */
:root {
  color-scheme: dark;
  --panel: rgba(10, 19, 30, 0.86);
  --panel-strong: rgba(12, 21, 34, 0.96);
  --muted: #93a3b8;
  --line: rgba(155, 184, 216, 0.12);
  --line-strong: rgba(155, 184, 216, 0.2);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 10px 26px rgba(0, 0, 0, 0.2);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 16px;
}

body {
  padding: 14px;
  background:
    radial-gradient(circle at top left, rgba(125, 216, 255, 0.1), transparent 22%),
    radial-gradient(circle at right 8% top 10%, rgba(255, 179, 92, 0.08), transparent 18%),
    linear-gradient(180deg, #08111a 0%, #0a131f 100%);
}

.app-shell {
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  max-width: 1360px;
}

.sidebar,
.hero-panel,
.panel,
.compact-card,
.desk-card,
.sound-card,
.progress-card {
  backdrop-filter: blur(18px);
}

.sidebar {
  gap: 14px;
  padding: 16px;
}

.sidebar-brand small {
  line-height: 1.55;
}

.tool-btn {
  padding: 12px 13px;
  gap: 3px;
}

.tool-btn small {
  display: none;
}

.side-stat,
.hero-stat,
.mini-metric,
.status-tile,
.report-stat,
.mission-preview,
.recall-prompt,
.quest-item,
.sequence-item,
.planner-item,
.history-row {
  background: rgba(255, 255, 255, 0.022);
}

.hero-panel {
  gap: 14px;
  padding: 18px;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
}

.hero-copy h1 {
  max-width: 12ch;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
}

.hero-text {
  max-width: 60ch;
  margin-top: 12px;
  line-height: 1.62;
}

.hero-actions {
  margin-top: 18px;
}

.workspace,
.page-shell,
.focus-grid,
.desk-grid,
.sound-grid,
.progress-grid {
  gap: 14px;
}

.panel,
.compact-card,
.desk-card,
.sound-card,
.progress-card {
  padding: 16px;
}

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

.overview-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(12, 21, 33, 0.85);
  box-shadow: var(--shadow-md);
}

.overview-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.overview-card strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-head);
  font-size: 1.08rem;
  line-height: 1.2;
}

.overview-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.overview-card-accent {
  background:
    radial-gradient(circle at top left, rgba(125, 216, 255, 0.14), transparent 56%),
    rgba(12, 21, 33, 0.92);
}

.timer-orb {
  min-height: 292px;
}

.timer-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mode-card,
.field-card,
.switch-row,
.hero-stat,
.side-stat {
  border-radius: 16px;
}

.mode-card small {
  line-height: 1.5;
}

.status-strip {
  grid-template-columns: 160px minmax(0, 1fr);
}

.desk-grid {
  grid-template-columns: 1fr 1fr 1.05fr;
}

.task-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-filter-group {
  gap: 8px;
}

.task-filter-group .chip-btn.active {
  border-color: rgba(125, 216, 255, 0.28);
  background: rgba(125, 216, 255, 0.12);
  color: var(--primary);
}

.compact-card .panel-head-compact h2 {
  font-size: 1.35rem;
}

.helper-text,
.item-meta,
.notes-foot span,
.timer-subtitle,
.sub-head p {
  line-height: 1.55;
}

.chart-card {
  min-height: 260px;
}

.chart-card canvas {
  height: 220px !important;
}

@media (max-width: 1240px) {
  .overview-strip,
  .hero-panel,
  .focus-grid,
  .sound-grid,
  .progress-grid,
  .desk-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 920px) {
  .overview-strip {
    grid-template-columns: 1fr;
  }

  .tool-btn small {
    display: block;
  }
}


.embed-note {
  margin: 14px auto 0;
  max-width: 40ch;
  color: var(--muted);
  line-height: 1.7;
}

.embed-note code {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.embed-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 16px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.embed-open-link:hover {
  transform: translateY(-1px);
}


.control-strip {
  position: sticky;
  top: 10px;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(8, 14, 24, 0.68);
  backdrop-filter: blur(18px);
}

body[data-theme="latte"] .control-strip {
  background: rgba(255, 252, 247, 0.82);
}

.control-chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.control-chip span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.control-chip-wide {
  min-width: 220px;
}

.utility-select,
.task-search-input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(6, 12, 20, 0.9);
  outline: none;
}

body[data-theme="latte"] .utility-select,
body[data-theme="latte"] .task-search-input {
  background: rgba(255, 255, 255, 0.8);
}

.desk-command-center {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin-bottom: 16px;
}

.command-card,
.insight-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-md);
}

.smart-suggestion {
  display: grid;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.smart-suggestion strong {
  font-size: 1.05rem;
}

.smart-suggestion span,
.smart-suggestion small,
.empty-mini {
  color: var(--muted);
  line-height: 1.6;
}

.auto-plan-preview {
  display: grid;
  gap: 8px;
}

.auto-plan-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.auto-plan-item strong {
  color: var(--primary);
}

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

.quick-metric {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.quick-metric span,
.weekly-insight span {
  color: var(--muted);
}

.quick-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
}

.task-toolbar {
  display: grid;
  gap: 12px;
}

.task-search-input {
  min-height: 46px;
}

.planner-textarea {
  width: 100%;
  min-height: 112px;
  padding: 12px 13px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(6, 12, 20, 0.9);
  outline: none;
  resize: vertical;
  line-height: 1.65;
}

.planner-textarea:focus {
  border-color: rgba(125, 216, 255, 0.32);
  box-shadow: 0 0 0 4px rgba(125, 216, 255, 0.08);
}

body[data-theme="latte"] .planner-textarea {
  background: rgba(255, 255, 255, 0.84);
}

.task-form-note {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.task-form-note strong {
  font-size: 0.92rem;
}

.task-form-note span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.task-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.task-main {
  display: grid;
  gap: 8px;
}

.task-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.repeat-pill,
.subtask-progress {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 800;
}

.repeat-pill.daily {
  color: var(--primary);
  background: rgba(125, 216, 255, 0.12);
}

.repeat-pill.weekly {
  color: var(--success);
  background: rgba(142, 232, 180, 0.12);
}

.subtask-progress {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.subtask-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.subtask-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
}

.subtask-chip.done {
  opacity: 0.76;
  background: rgba(142, 232, 180, 0.08);
  border-color: rgba(142, 232, 180, 0.22);
}

.subtask-chip.done .subtask-label {
  text-decoration: line-through;
}

.subtask-dot {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(125, 216, 255, 0.14);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
}

.subtask-label {
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.planner-item-task {
  align-items: start;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.planner-item-task {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.task-pill-stack {
  display: flex;
  align-items: center;
  gap: 8px;
}

.due-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 800;
}

.due-pill.overdue {
  color: var(--danger);
  background: rgba(255, 138, 138, 0.14);
}

.due-pill.today {
  color: var(--warning);
  background: rgba(255, 211, 109, 0.14);
}

.due-pill.soon {
  color: var(--primary);
  background: rgba(125, 216, 255, 0.12);
}

.due-pill.later {
  color: var(--muted);
}

.weekly-insight {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.insight-pill {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.insight-pill strong {
  display: block;
  margin-bottom: 6px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.heat-cell {
  padding: 12px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.heat-cell span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.heat-cell strong {
  display: block;
  margin-top: 6px;
}

.heat-cell.level-1 { background: rgba(125, 216, 255, 0.10); }
.heat-cell.level-2 { background: rgba(125, 216, 255, 0.18); }
.heat-cell.level-3 { background: rgba(125, 216, 255, 0.28); }
.heat-cell.level-4 { background: linear-gradient(135deg, rgba(125, 216, 255, 0.3), rgba(255, 179, 92, 0.24)); }

.embed-note {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.embed-open-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.zen-overlay,
.modal-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(16px);
}

.zen-shell,
.modal-card {
  width: min(720px, 100%);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel-strong);
  box-shadow: var(--shadow-lg);
}

.zen-body {
  display: grid;
  gap: 16px;
  justify-items: center;
  padding: 24px 12px 12px;
  text-align: center;
}

.zen-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#zen-display {
  font-family: var(--font-head);
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.08em;
}

.zen-subtitle {
  margin: 0;
  color: var(--muted);
}

.zen-mission {
  padding: 16px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.zen-mission span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.shortcut-list {
  display: grid;
  gap: 10px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

kbd {
  min-width: 48px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 800;
  text-align: center;
}

body.zen-active {
  overflow: hidden;
}

@media (max-width: 1240px) {
  .desk-command-center {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .control-strip,
  .weekly-insight,
  .heatmap-grid,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .control-strip {
    display: grid;
  }

  .planner-item-task {
    grid-template-columns: 1fr;
  }
}


.command-card::before,
.insight-card::before,
.overview-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 44%);
  pointer-events: none;
}

.command-card > *,
.insight-card > *,
.overview-card > * {
  position: relative;
  z-index: 1;
}

.inline-grid-2 {
  grid-template-columns: 1fr minmax(220px, 0.9fr);
}

.inline-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body[data-theme="latte"] .overview-card {
  background: rgba(255, 250, 245, 0.92);
}

body[data-theme="latte"] .planner-item-task {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.5));
}

@media (max-width: 920px) {
  .inline-grid-2,
  .inline-grid-3 {
    grid-template-columns: 1fr;
  }

  .task-title-row {
    flex-direction: column;
    align-items: start;
  }

  .subtask-chip {
    width: 100%;
    justify-content: flex-start;
  }
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(125, 216, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}
