@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,300&family=DM+Mono:wght@400;500&display=swap');

/* ─────────────────────────────────────────
   CSS VARIABLES
───────────────────────────────────────── */
:root {
  --bg:           #0d0d0d;
  --surface:      #141414;
  --surface2:     #1c1c1c;
  --border:       rgba(255,255,255,0.07);
  --border-strong:rgba(255,255,255,0.14);

  --txt:          #f0ece4;
  --txt2:         #8a8480;
  --txt3:         #4a4642;

  --amber:        #f5a623;
  --amber-dim:    rgba(245,166,35,0.15);
  --amber-glow:   rgba(245,166,35,0.35);

  --mode-focus:   #f5a623;
  --mode-short:   #3ecfcf;
  --mode-long:    #c084fc;

  --accent:       var(--mode-focus);
  --accent-dim:   var(--amber-dim);
  --accent-glow:  var(--amber-glow);

  --font-display: 'Bebas Neue', sans-serif;
  --font-ui:      'DM Sans', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:  cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:     cubic-bezier(0, 0, 0.2, 1);
}

body[data-mode="short-break"] {
  --accent:      #3ecfcf;
  --accent-dim:  rgba(62,207,207,0.12);
  --accent-glow: rgba(62,207,207,0.3);
}
body[data-mode="long-break"] {
  --accent:      #c084fc;
  --accent-dim:  rgba(192,132,252,0.12);
  --accent-glow: rgba(192,132,252,0.3);
}

/* ─────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow-x: hidden; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  cursor: default;
  transition: background 0.6s var(--ease-smooth);
}

button { font-family: var(--font-ui); cursor: pointer; border: none; outline: none; }
input  { font-family: var(--font-ui); outline: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

/* ─────────────────────────────────────────
   NOISE OVERLAY
───────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  z-index: 0;
}

/* ─────────────────────────────────────────
   LAYOUT — SPLIT PANEL
───────────────────────────────────────── */
.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 420px;
  grid-template-rows: auto 1fr;
}

/* ─────────────────────────────────────────
   TOP BAR
───────────────────────────────────────── */
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(13,13,13,0.8);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: 0.12em;
  color: var(--txt);
  line-height: 1;
}

.brand-version {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  transition: color 0.4s, border-color 0.4s;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--txt2);
  padding: 9px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: all 0.2s var(--ease-smooth);
  display: flex;
  align-items: center;
  gap: 7px;
}

.topbar-btn:hover { border-color: var(--border-strong); color: var(--txt); background: var(--surface2); }
.topbar-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.topbar-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px 6px 8px;
}

.user-avatar {
  width: 26px; height: 26px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 700;
  transition: background 0.4s, border-color 0.4s, color 0.4s;
}

.user-email-text {
  font-size: 0.78rem;
  color: var(--txt2);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─────────────────────────────────────────
   LEFT PANEL — IMMERSIVE TIMER
───────────────────────────────────────── */
.timer-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  min-height: calc(100vh - 65px);
  overflow: hidden;
}

/* Animated background gradient */
.timer-panel::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 60%, var(--accent-glow), transparent 70%);
  transition: background 0.8s var(--ease-smooth);
  pointer-events: none;
  z-index: 0;
}

/* Particle canvas */
#particleCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s;
}
#particleCanvas.burst { opacity: 1; }

/* Mode tabs */
.mode-tabs {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 48px;
}

.mode-tab {
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 9px 22px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--txt3);
  transition: all 0.25s var(--ease-smooth);
}

.mode-tab:hover { color: var(--txt2); }

.mode-tab.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ─── LIQUID TIMER ─── */
.liquid-timer-wrap {
  position: relative;
  z-index: 2;
  width: 280px;
  height: 280px;
  margin-bottom: 40px;
}

.liquid-container {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border-strong);
  box-shadow:
    0 0 0 8px var(--accent-dim),
    0 0 60px var(--accent-glow),
    inset 0 0 40px rgba(0,0,0,0.5);
  transition: box-shadow 0.6s var(--ease-smooth);
}

.liquid-bg {
  position: absolute; inset: 0;
  background: var(--surface);
}

.liquid-fill {
  position: absolute;
  left: -20%;
  width: 140%;
  bottom: 0;
  background: linear-gradient(180deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 60%, #000) 100%);
  transition: height 1s linear, background 0.6s;
  opacity: 0.35;
}

.liquid-wave {
  position: absolute;
  top: -20px;
  left: -20%;
  width: 140%;
  height: 40px;
  background: linear-gradient(180deg, transparent 0%, var(--accent) 100%);
  animation: waveMove 3s ease-in-out infinite;
}

.liquid-wave2 {
  animation-delay: -1.5s;
  opacity: 0.5;
}

@keyframes waveMove {
  0%,100% { transform: translateX(0) scaleY(1); }
  50%      { transform: translateX(-10%) scaleY(1.2); }
}

/* Timer text overlay */
.timer-text-wrap {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.timer-digits {
  font-family: var(--font-display);
  font-size: 5.5rem;
  line-height: 1;
  letter-spacing: 0.05em;
  color: var(--txt);
  text-shadow: 0 2px 20px rgba(0,0,0,0.8);
  transition: color 0.4s;
}

.timer-label-text {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--txt2);
  margin-top: 6px;
  font-weight: 500;
}

/* Timer controls */
.timer-controls {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

.ctrl-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  color: var(--txt2);
  transition: all 0.2s var(--ease-smooth);
}

.ctrl-btn svg { width: 20px; height: 20px; }
.ctrl-btn:hover { border-color: var(--border-strong); color: var(--txt); transform: scale(1.05); }
.ctrl-btn:active { transform: scale(0.95); }

.play-btn {
  width: 72px; height: 72px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: #000;
  box-shadow: 0 0 30px var(--accent-glow), 0 4px 16px rgba(0,0,0,0.4);
  transition: all 0.25s var(--ease-smooth);
}

.play-btn svg { width: 28px; height: 28px; }
.play-btn:hover { transform: scale(1.08); box-shadow: 0 0 50px var(--accent-glow), 0 6px 20px rgba(0,0,0,0.5); }
.play-btn:active { transform: scale(0.96); }
.play-btn .pause-icon { display: none; }
.play-btn.playing .play-icon { display: none; }
.play-btn.playing .pause-icon { display: block; }

/* Focus stats strip */
.focus-strip {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 32px;
  align-items: center;
}

.focus-stat {
  text-align: center;
}

.focus-stat-val {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
  transition: color 0.4s;
}

.focus-stat-lbl {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--txt3);
  margin-top: 4px;
}

.focus-strip-div {
  width: 1px;
  height: 32px;
  background: var(--border);
}

/* ─────────────────────────────────────────
   RIGHT PANEL — CONTROL CENTER
───────────────────────────────────────── */
.control-panel {
  border-left: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  height: calc(100vh - 65px);
  position: sticky;
  top: 65px;
  display: flex;
  flex-direction: column;
}

/* Panel tabs nav */
.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 16px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--txt3);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.panel-tab svg { width: 14px; height: 14px; }
.panel-tab:hover { color: var(--txt2); }
.panel-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Panel sections */
.panel-view { display: none; flex: 1; flex-direction: column; }
.panel-view.active { display: flex; }

/* Section blocks */
.panel-block {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

.panel-block:last-child { border-bottom: none; }

.block-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--txt3);
  margin-bottom: 16px;
}

/* ─── AMBIENT SOUNDS ─── */
.ambient-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.amb-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--txt3);
  transition: all 0.2s var(--ease-smooth);
  cursor: pointer;
}

.amb-btn:hover { border-color: var(--border-strong); color: var(--txt2); transform: translateY(-2px); }

.amb-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.amb-btn .icon { font-size: 1.3rem; }
.amb-btn .lbl { font-size: 0.58rem; letter-spacing: 0.04em; font-weight: 500; line-height: 1; }

.amb-btn.active .icon { animation: pulseIcon 1.5s ease-in-out infinite; }
@keyframes pulseIcon {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.vol-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vol-icon { font-size: 0.9rem; color: var(--txt3); }

.vol-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  transition: background 0.4s;
}

/* ─── SETTINGS ─── */
.setting-row {
  margin-bottom: 18px;
}

.setting-row:last-child { margin-bottom: 0; }

.setting-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--txt2);
  margin-bottom: 10px;
}

.setting-val {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
  transition: color 0.4s;
}

.setting-val::after { content: ' min'; color: var(--txt3); font-size: 0.72rem; }

input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  height: 5px;
  background: var(--border-strong);
  border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.15s, background 0.4s, box-shadow 0.4s;
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.2); }

/* Toggle */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--txt2);
}

.toggle-row:last-child { border-bottom: none; }

.toggle {
  position: relative;
  width: 44px; height: 24px;
}

.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.toggle-track {
  position: absolute; inset: 0;
  background: var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.25s;
}

.toggle-track::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: transform 0.25s var(--ease-spring);
}

.toggle input:checked + .toggle-track {
  background: var(--accent);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* ─── TASKS ─── */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  transition: all 0.2s;
  animation: taskIn 0.3s var(--ease-spring);
}

@keyframes taskIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.task-item:hover { background: rgba(255,255,255,0.04); border-color: var(--border-strong); }

.task-check {
  width: 20px; height: 20px;
  border: 2px solid var(--txt3);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.7rem;
  color: transparent;
}

.task-item.done .task-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.task-txt {
  flex: 1;
  font-size: 0.86rem;
  color: var(--txt2);
  line-height: 1.3;
}

.task-item.done .task-txt {
  text-decoration: line-through;
  color: var(--txt3);
}

.task-del {
  background: none;
  border: none;
  color: var(--txt3);
  font-size: 1rem;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s;
  padding: 2px;
  line-height: 1;
}

.task-item:hover .task-del { opacity: 1; }
.task-del:hover { color: #f87171; }

.task-add-btn {
  margin-top: 10px;
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 11px;
  color: var(--txt3);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.task-add-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }

.task-input-box {
  margin-top: 10px;
  display: none;
}

.task-input-box.open { display: block; animation: taskIn 0.25s var(--ease-spring); }

.task-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--txt);
  font-size: 0.86rem;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.task-input:focus { border-color: var(--accent); }
.task-input::placeholder { color: var(--txt3); }

.task-input-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.task-inp-btn {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--txt2);
  transition: all 0.15s;
}

.task-inp-btn.save {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.task-inp-btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* ─── ANALYTICS ─── */
.week-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 100px;
  margin-bottom: 10px;
}

.day-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  gap: 4px;
}

.day-bar-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.day-bar {
  width: 100%;
  background: var(--accent-dim);
  border: 1px solid transparent;
  border-radius: 5px 5px 0 0;
  min-height: 0;
  transition: height 0.7s var(--ease-spring), background 0.4s, border-color 0.4s;
  position: relative;
}

.day-col.is-today .day-bar {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.day-lbl {
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--txt3);
  text-transform: uppercase;
}

.day-col.is-today .day-lbl { color: var(--accent); font-weight: 700; }

.analytics-totals {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--txt3);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.analytics-totals strong { color: var(--txt2); }

/* Heatmap */
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: 12px;
}

.heat-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--surface2);
  transition: all 0.3s;
}

.heat-cell[data-level="1"] { background: var(--accent-dim); }
.heat-cell[data-level="2"] { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.heat-cell[data-level="3"] { background: color-mix(in srgb, var(--accent) 65%, transparent); }
.heat-cell[data-level="4"] { background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }

/* ─── ACHIEVEMENTS ─── */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.badge {
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  transition: all 0.25s var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.badge.earned {
  border-color: rgba(245,166,35,0.35);
  background: rgba(245,166,35,0.06);
}

.badge.earned:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(245,166,35,0.15); }

.badge.locked { opacity: 0.35; filter: grayscale(1); }

.badge-icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.badge-name { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.06em; color: var(--txt2); }

/* Progress bar */
.achieve-progress {
  margin-bottom: 16px;
}

.achieve-progress-bar {
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}

.achieve-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber), #feca57);
  border-radius: 2px;
  transition: width 0.6s var(--ease-spring);
}

.achieve-count {
  font-size: 0.72rem;
  color: var(--txt3);
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}

.achieve-count span:last-child { color: var(--amber); font-weight: 600; }

/* ─── ACHIEVEMENT TOAST ─── */
.ach-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #1a1a1a;
  border: 1px solid rgba(245,166,35,0.5);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 9999;
  transform: translateY(120px);
  opacity: 0;
  transition: transform 0.5s var(--ease-spring), opacity 0.3s;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  max-width: 300px;
  pointer-events: none;
}

.ach-toast.show { transform: translateY(0); opacity: 1; }
.ach-toast-icon { font-size: 2rem; }
.ach-toast-tag { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--amber); font-weight: 700; }
.ach-toast-title { font-size: 1rem; font-weight: 700; margin: 2px 0; }
.ach-toast-desc { font-size: 0.75rem; color: var(--txt2); }

/* ─────────────────────────────────────────
   AUTH MODAL
───────────────────────────────────────── */
.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(12px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  width: 90%;
  max-width: 440px;
  overflow: hidden;
  animation: modalIn 0.4s var(--ease-spring);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head {
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-head h2 { font-size: 1.25rem; font-weight: 700; }

.modal-close {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px; height: 34px;
  color: var(--txt2);
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}

.modal-close:hover { color: var(--txt); background: var(--border-strong); }

.modal-body { padding: 24px 28px; }

.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 9px;
  padding: 9px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--txt3);
  transition: all 0.2s;
}

.auth-tab.active { background: var(--surface); color: var(--txt); }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 0.78rem; color: var(--txt2); margin-bottom: 7px; font-weight: 500; }

.form-field input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--txt);
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.form-field input:focus { border-color: var(--accent); }

.auth-submit {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  padding: 14px;
  color: #000;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 6px;
  transition: all 0.2s;
}

.auth-submit:hover { opacity: 0.88; transform: translateY(-1px); }

.auth-divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
  color: var(--txt3);
  font-size: 0.8rem;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 42%;
  height: 1px;
  background: var(--border);
}

.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.google-btn {
  width: 100%;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px;
  color: #333;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: all 0.2s;
}

.google-btn:hover { background: #f5f5f5; transform: translateY(-1px); }

.auth-error {
  color: #f87171;
  font-size: 0.8rem;
  margin-top: 10px;
  text-align: center;
  min-height: 16px;
}

/* ─────────────────────────────────────────
   SYNC STATUS
───────────────────────────────────────── */
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.72rem;
  color: var(--txt3);
  transition: all 0.3s;
}

.sync-pill.syncing { color: var(--mode-short); border-color: rgba(62,207,207,0.3); }
.sync-pill.error   { color: #f87171; border-color: rgba(248,113,113,0.3); }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sync-pill.syncing .sync-dot { animation: blink 1s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

/* ─────────────────────────────────────────
   PARTICLES
───────────────────────────────────────── */
.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: particleFly 1.2s ease-out forwards;
}

@keyframes particleFly {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; }
}

/* ─────────────────────────────────────────
   FOCUS MODE
───────────────────────────────────────── */
body.focus-only .control-panel,
body.focus-only .topbar-btn:not(.focus-mode-btn) {
  display: none;
}

body.focus-only .app-shell {
  grid-template-columns: 1fr;
}

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }

  .control-panel {
    position: static;
    height: auto;
    border-left: none;
    border-top: 1px solid var(--border);
    overflow: visible;
  }

  .timer-panel {
    min-height: 70vh;
    padding: 36px 20px;
  }
}

@media (max-width: 480px) {
  .topbar { padding: 14px 16px; }
  .brand-name { font-size: 1.4rem; }
  .timer-digits { font-size: 4.5rem; }
  .liquid-timer-wrap { width: 240px; height: 240px; }
  .liquid-container { width: 240px; height: 240px; }
  .topbar-btn span { display: none; }
  .mode-tab { padding: 8px 14px; font-size: 0.72rem; }
  .focus-strip { gap: 20px; }
}

/* ─── Animations / Utilities ─── */
.hidden { display: none !important; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.5s var(--ease-spring) both; }

.no-tasks-msg {
  text-align: center;
  padding: 24px 16px;
  color: var(--txt3);
  font-size: 0.82rem;
  font-style: italic;
}

/* Page load stagger */
.timer-panel > * { animation: fadeUp 0.6s var(--ease-spring) both; }
.timer-panel > *:nth-child(1) { animation-delay: 0.05s; }
.timer-panel > *:nth-child(2) { animation-delay: 0.12s; }
.timer-panel > *:nth-child(3) { animation-delay: 0.19s; }
.timer-panel > *:nth-child(4) { animation-delay: 0.26s; }
.timer-panel > *:nth-child(5) { animation-delay: 0.33s; }