:root {
  --bg-body: #010a1f;
  --text-primary: #e2e8f0;
  --text-muted: #94a3b8;
  --panel-bg: rgba(15, 23, 42, 0.85);
  --panel-border: rgba(148, 163, 184, 0.15);
  --panel-shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
  --accent: #0ea5e9;
  --accent-strong: #0284c7;
  --input-bg: rgba(15, 23, 42, 0.65);
  --input-border: rgba(148, 163, 184, 0.15);
  --overlay-bg: rgba(2, 6, 23, 0.85);
  --spin-button-bg: rgba(15, 23, 42, 0.45);
  --spin-button-hover-bg: rgba(14, 165, 233, 0.18);
  --spin-button-border: rgba(148, 163, 184, 0.25);
  --spin-arrow-color: #f8fafc;
  --base-font-size: 16px;
}

html {
  font-size: var(--base-font-size, 12px);
}

body.theme-light {
  --bg-body: #e8f6ff;
  --text-primary: #083b4c;
  --text-muted: #4b6d7d;
  --panel-bg: rgba(255, 255, 255, 0.94);
  --panel-border: rgba(10, 102, 132, 0.16);
  --panel-shadow: 0 24px 50px rgba(8, 58, 82, 0.15);
  --accent: #23b6d8;
  --accent-strong: #0891b2;
  --input-bg: rgba(221, 244, 250, 0.95);
  --input-border: rgba(8, 124, 149, 0.25);
  --overlay-bg: rgba(6, 66, 94, 0.45);
  --spin-button-bg: rgba(216, 239, 247, 0.95);
  --spin-button-hover-bg: rgba(35, 182, 216, 0.22);
  --spin-button-border: rgba(9, 83, 110, 0.22);
  --spin-arrow-color: #083b4c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  transition: background 0.4s ease, color 0.4s ease;
  font-size: 1rem;
  line-height: 1.4;
}

body.intro-modal-open {
  overflow: hidden;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

.app-shell {
  width: min(100%, 1200px);
  max-width: 100%;
  margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 22px;
  backdrop-filter: blur(18px);
  box-shadow: var(--panel-shadow);
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
  position: relative;
  z-index: 3500;
}

.top-brand {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  row-gap: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
}

.top-settings {
  display: flex;
  align-items: center;
  justify-self: end;
  position: relative;
  z-index: 2000;
  gap: 8px;
}

.btn-icon {
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.refresh-btn {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-primary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.refresh-btn:hover {
  background: rgba(14, 165, 233, 0.2);
  color: var(--accent);
  transform: rotate(12deg);
}

.brand-logo {
  width: 35px;
  height: 35px;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.brand-indicator {
  position: relative;
  width: 0.8px;
  height: 25px;
  border-radius: 999px;
  background: linear-gradient(180deg, #7dd3fc 0%, var(--accent) 50%, #082f49 100%);
  background-size: 100% 220%;
  animation: beamFlow 2.6s ease-in-out infinite;
  box-shadow:
    0 0 12px rgba(14, 165, 233, 0.6),
    0 0 26px rgba(14, 165, 233, 0.45),
    0 0 38px rgba(125, 211, 252, 0.4);
}

.brand-indicator::before {
  content: '';
  position: absolute;
  inset: -6px -3px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.55), transparent 65%);
  filter: blur(3px);
  opacity: 0.85;
  animation: beamPulse 3.2s ease-in-out infinite;
  pointer-events: none;
}

.brand-indicator::after {
  content: '';
  position: absolute;
  inset: -14px -10px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.35) 0%, rgba(14, 165, 233, 0.1) 55%, transparent 75%);
  filter: blur(14px);
  opacity: 0.7;
  animation: beamAura 4.6s ease-in-out infinite;
  pointer-events: none;
}

.brand-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1rem;
  line-height: 1.3;
  text-shadow: 0 0 16px rgba(14, 165, 233, 0.18);
  white-space: normal;
}

@media (max-width: 480px) {
  .brand-text {
    font-size: 0.85rem;
  }
}

.top-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.top-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.share-btn.hidden {
  display: none !important;
}

.top-bar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  cursor: pointer;
}

.top-control__label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.top-control--legal a {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px dashed var(--accent);
  transition: background 0.2s, color 0.2s, border 0.2s;
}

.top-control--legal a:hover {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-strong);
  border-color: var(--accent-strong);
}

.settings-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: clamp(240px, 40vw, 360px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 16px;
  box-shadow:
    0 8px 16px rgba(2, 6, 23, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 3000;
}

.settings-panel__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-panel__label {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-panel__control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-panel__control input[type='range'] {
  flex: 1;
  accent-color: var(--accent);
}

.settings-panel__control input[type='range'] {
  -webkit-appearance: none;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.settings-panel__control input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.settings-panel__control input[type='range']::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}

.settings-panel__value {
  min-width: 48px;
  text-align: right;
  font-weight: 600;
  font-size: 0.95rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.toggle-switch {
  position: relative;
  width: 60px;
  height: 28px;
  display: inline-block;
}

.toggle-switch input {
  display: none;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  transition: background 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6px;
}

.toggle-switch .slider::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.toggle-switch .icon {
  font-size: 0.7rem;
}

.toggle-switch input:not(:checked) ~ .slider::after {
  transform: translateX(32px);
}

.toggle-switch.mini {
  width: 52px;
  height: 24px;
}

.toggle-switch.mini .slider::after {
  width: 18px;
  height: 18px;
  top: 3px;
  left: 3px;
}

.toggle-switch.mini input:not(:checked) ~ .slider::after {
  transform: translateX(26px);
}

.language-toggle {
  display: inline-flex;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  overflow: hidden;
}

.language-toggle button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 6px 18px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}

.language-toggle button.is-active {
  background: var(--accent);
  color: white;
}

.language-toggle.compact button {
  padding: 4px 12px;
  font-size: 0.75rem;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mood-log-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.panel-head__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mood-log-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.panel--timers {
  padding: 12px;
}

.panel--timers .panel-head {
  margin-bottom: 4px;
}

.eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin: 0 0 2px;
}

.panel-title {
  margin: 0;
  font-size: 1.65rem;
}

.tab-list {
  display: inline-flex;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 999px;
  padding: 4px;
}

.tab-list .tab {
  white-space: nowrap;
}

.tab {
  border: none;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tab.is-active {
  background: var(--accent);
  color: white;
}

.timer-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.timer-card {
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(2, 6, 23, 0.6));
  height: 100%;
}

body.theme-light .timer-card {
  background: linear-gradient(135deg, rgba(35, 182, 216, 0.2), rgba(255, 255, 255, 0.96));
}

.timer-card.hidden {
  display: none;
}

.timer-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.timer-card__desc {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.timer-row .timer-display {
  margin: 0;
}

.timer-row .timer-actions {
  justify-content: flex-end;
}

.timer-row .stopwatch-actions {
  width: 100%;
}

.timer-actions.stopwatch-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  grid-template-areas:
    'primary reset'
    'lap share';
  gap: 8px;
  width: 100%;
}

.timer-actions.stopwatch-actions .btn {
  width: 100%;
}

.timer-actions.stopwatch-actions [data-stopwatch-start],
.timer-actions.stopwatch-actions [data-stopwatch-pause] {
  grid-area: primary;
}

.timer-actions.stopwatch-actions [data-stopwatch-reset] {
  grid-area: reset;
}

.timer-actions.stopwatch-actions [data-stopwatch-lap] {
  grid-area: lap;
}

.timer-actions.stopwatch-actions [data-stopwatch-share] {
  grid-area: share;
}

.timer-display {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 0 6px;
}

.timer-display p {
  font-family: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: clamp(5rem, 8vw, 4.1rem);
  font-weight: 700;
  margin: 0;
}

.timer-display span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  border: none;
  border-radius: 999px;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 10px 22px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-muted {
  background: rgba(15, 23, 42, 0.4);
  color: var(--text-primary);
}

body.theme-light .btn-muted {
  background: rgba(206, 240, 247, 0.85);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
}

.lap-list {
  margin-top: 12px;
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.lap-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lap-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.5);
}

.lap-times {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.lap-times strong {
  font-size: 1rem;
}

.lap-times small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

body.theme-light .lap-item {
  background: rgba(221, 244, 250, 0.82);
}

.input-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 10px rgba(148, 163, 184, 0.5);
}

.status-dot.running {
  background: #0ea5e9;
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.8);
}

.status-dot.done {
  background: #f43f5e;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.7);
}

body.theme-light .status-pill {
  background: rgba(35, 182, 216, 0.12);
}

body.theme-light .status-dot {
  background: #6edff6;
  box-shadow: 0 0 12px rgba(110, 223, 246, 0.7);
}

body.theme-light .status-dot.running {
  background: #23b6d8;
  box-shadow: 0 0 14px rgba(35, 182, 216, 0.75);
}

body.theme-light .status-dot.done {
  background: #f27d92;
  box-shadow: 0 0 14px rgba(242, 125, 146, 0.7);
}

.status-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.countdown-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}

.countdown-col {
  flex: 1 1 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.countdown-col--actions {
  width: 100%;
}

.countdown-col--time .timer-display {
  margin: 0;
}

.timer-actions.vertical {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 6px;
}

.timer-actions.vertical .btn {
  width: 100%;
}

.countdown-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
  align-items: stretch;
  width: 100%;
}

.countdown-actions .btn {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .countdown-actions {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (min-width: 1200px) {
  .countdown-actions {
    grid-template-columns: 1fr;
  }
}

.time-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-picker__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}

.time-picker-grid {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}

.time-field {
  flex: 1 1 58px;
  min-width: 58px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.time-field span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.time-field__control {
  position: relative;
}

.time-field input {
  width: 100%;
  font-size: 0.95rem;
  padding: 6px 36px 6px 6px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
  text-align: center;
  appearance: textfield;
}

.time-field input[type='number']::-webkit-inner-spin-button,
.time-field input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.time-field input[type='number'] {
  -moz-appearance: textfield;
}

.time-field__spin {
  position: absolute;
  top: 4px;
  bottom: 4px;
  right: 4px;
  width: 30px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-field__spin-btn {
  flex: 1;
  border: 1px solid var(--spin-button-border);
  border-left-width: 1px;
  border-radius: 10px;
  background: var(--spin-button-bg);
  color: var(--spin-arrow-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  padding: 0;
}

.time-field__spin-btn svg {
  width: 12px;
  height: 6px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.time-field__spin-btn--up {
  border-radius: 10px 10px 4px 4px;
}

.time-field__spin-btn--down {
  border-radius: 4px 4px 10px 10px;
}

.time-field__spin-btn:hover {
  background: var(--spin-button-hover-bg);
  border-color: var(--accent);
  color: var(--accent);
}

.time-field input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.quick-select {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.quick-select__label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.quick-select-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  align-items: center;
  overflow-x: auto;
}

.quick-select-buttons button {
  border: 1px solid var(--panel-border);
  background: var(--input-bg);
  color: var(--text-primary);
  border-radius: 999px;
  font-size: 0.85rem;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.quick-select-buttons button:hover {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent);
}

body.theme-light .quick-select-buttons button:hover {
  background: rgba(35, 182, 216, 0.18);
  color: var(--text-primary);
  border-color: rgba(35, 182, 216, 0.4);
}

.pomodoro-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.pomodoro-col {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pomodoro-cycle {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pomodoro-history {
  margin-top: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed var(--panel-border);
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.theme-light .pomodoro-history {
  background: rgba(214, 240, 247, 0.8);
}

.pomodoro-history__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.pomodoro-history__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pomodoro-history__clear {
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease;
}

.pomodoro-history__clear:hover {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent-strong);
}

.pomodoro-history__title {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pomodoro-history__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.pomodoro-history__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.25);
}

body.theme-light .pomodoro-history__item {
  background: rgba(255, 255, 255, 0.7);
}

.pomodoro-history__item strong {
  font-size: 0.95rem;
}

.pomodoro-history__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pomodoro-history__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pomodoro-history__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.pomodoro-history__mood {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.pomodoro-history__mood.is-empty {
  opacity: 0.7;
}

.pomodoro-history__link {
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.15);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pomodoro-history__link:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.pomodoro-history__link[aria-disabled='true'] {
  opacity: 0.5;
  pointer-events: none;
}

.pomodoro-history__link-missing {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pomodoro-history__link-status {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.pomodoro-history__link-status.is-invalid {
  color: #f87171;
}

.pomodoro-history__link-status.is-missing {
  color: var(--text-muted);
}

.pomodoro-history__empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.pomodoro-mood {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-end;
}

.pomodoro-mood__label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pomodoro-mood__state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: rgba(15, 23, 42, 0.2);
  transition: opacity 0.2s ease;
}

.pomodoro-mood__state.is-empty {
  opacity: 0.65;
}

body.theme-light .pomodoro-mood__state {
  background: rgba(255, 255, 255, 0.7);
}

.pomodoro-mood__emoji {
  font-size: 1.2rem;
}

.pomodoro-mood__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.pomodoro-mood__meta strong {
  font-size: 0.85rem;
}

.pomodoro-mood__meta small {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.pomodoro-music {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pomodoro-focus-summary,
.pomodoro-rest-music {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pomodoro-music__hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pomodoro-rest-music strong {
  font-size: 1rem;
}

.pomodoro-actions .btn {
  width: 100%;
}

.pomodoro-message {
  margin-top: 12px;
  text-align: left;
}

.pomodoro-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pomodoro-focus-block,
.pomodoro-rest-block {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  flex: 1;
  min-height: 170px;
  padding: 14px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.25);
}

body.theme-light .pomodoro-focus-block,
body.theme-light .pomodoro-rest-block {
  background: rgba(214, 240, 247, 0.75);
}

.mood-log-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mood-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.mood-log-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.mood-log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.2);
  border: 1px solid var(--panel-border);
}

body.theme-light .mood-log-item {
  background: rgba(214, 240, 247, 0.85);
}

.mood-log-item .emoji {
  font-size: 1.5rem;
}

.mood-log-item .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.85rem;
}

.mood-log-item strong {
  font-weight: 600;
}

.mood-log-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.mood-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10030;
}

.mood-modal__card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 24px;
  width: min(90vw, 420px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.mood-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
}

.mood-options button {
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  background: transparent;
  color: var(--text-primary);
  padding: 12px 10px;
  font-size: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border 0.2s, transform 0.2s;
}

.mood-options button span {
  font-size: 0.8rem;
}

.mood-options button:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.mood-log-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10015;
}

.mood-log-modal__card {
  width: min(90vw, 420px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mood-log-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mood-log-close {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
}

.mood-log-modal__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.breathing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10010;
}

body.theme-light .mood-modal,
body.theme-light .mood-log-modal,
body.theme-light .breathing-overlay,
body.theme-light .intro-modal {
  background: rgba(7, 70, 97, 0.35);
}

.breathing-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  padding: 28px;
  width: min(90vw, 360px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

.breathing-circle {
  width: 140px;
  height: 140px;
  margin: 0 auto;
  border-radius: 50%;
  background: rgba(14, 165, 233, 0.2);
  border: 2px solid rgba(14, 165, 233, 0.5);
  animation: breathe 8s ease-in-out infinite;
}

@keyframes breathe {
  0% {
    transform: scale(0.8);
  }
  50% {
    transform: scale(1);
  }
  100% {
    transform: scale(0.8);
  }
}

@keyframes beamFlow {
  0% {
    background-position: 0 0;
  }
  50% {
    background-position: 0 80%;
  }
  100% {
    background-position: 0 0;
  }
}

@keyframes beamPulse {
  0%,
  100% {
    opacity: 0.65;
    transform: scaleY(0.9);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.05);
  }
}

@keyframes beamAura {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.breathing-instruction {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.breathing-timer {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.intro-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10030;
}

.intro-card {
  width: clamp(320px, 70vw, 640px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}

.intro-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
}

.intro-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 1.5;
}

.intro-license {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  padding-top: 12px;
}

.intro-license img {
  width: 110px;
  height: auto;
}

.intro-license a {
  color: var(--accent);
}

.intro-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.intro-actions .btn {
  border-radius: 999px;
  padding: 10px 18px;
}

.quick-reset {
  border: 1px dashed var(--panel-border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 5px 12px;
  width: fit-content;
  transition: color 0.2s, border 0.2s;
}

.quick-reset:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.countdown-alert {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.alert-icon {
  font-size: 1.3rem;
}

.alert-title {
  margin: 0;
  font-weight: 600;
}

.alert-text {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.video-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .video-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}

.video-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.video-section {
  padding: 16px;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--panel-border);
}

body.theme-light .video-section {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.97), rgba(188, 233, 248, 0.65));
  border-color: rgba(35, 182, 216, 0.22);
}

.section-desc {
  margin: 6px 0 16px;
  color: var(--text-muted);
}

.video-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-field {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--input-bg);
  border-radius: 999px;
  border: 1px solid var(--input-border);
  padding: 6px 8px 6px 14px;
}

.search-icon {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.search-field input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
}

.search-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.suggestions-block {
  margin-top: 10px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-list button {
  border: 1px dashed var(--panel-border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary);
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border 0.2s, color 0.2s, background 0.2s;
}

.chip-list button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(14, 165, 233, 0.08);
}

body.theme-light .chip-list button:hover {
  border-color: rgba(35, 182, 216, 0.6);
  color: var(--text-primary);
  background: rgba(35, 182, 216, 0.15);
}

.player-card,
.results-card {
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.45);
}

body.theme-light .player-card,
body.theme-light .results-card {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.95), rgba(201, 239, 252, 0.72));
  border-color: rgba(35, 182, 216, 0.22);
}

.player-head,
.results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.player-head span:last-child,
.results-head span:last-child {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
}

.player-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  background: black;
  aspect-ratio: 16 / 9;
}

.player-embed,
.player-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.player-placeholder {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  background: rgba(2, 6, 23, 0.6);
}

body.theme-light .player-placeholder {
  background: rgba(35, 182, 216, 0.12);
  color: var(--text-muted);
}

.alert.info {
  font-size: 0.8rem;
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.12);
  border-radius: 14px;
  padding: 10px 14px;
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.results-list {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}

.results-list li {
  display: flex;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 8px;
  cursor: pointer;
  transition: border 0.2s, background 0.2s;
}

.results-list li:hover {
  border-color: var(--panel-border);
  background: rgba(148, 163, 184, 0.08);
}

.results-list li.active {
  border-color: var(--accent);
  background: rgba(14, 165, 233, 0.1);
}

body.theme-light .results-list li.active {
  background: rgba(35, 182, 216, 0.18);
}

.results-list li img {
  width: 120px;
  height: 70px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.results-list li .result-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.results-list li h4 {
  margin: 0;
  font-size: 0.95rem;
}

.results-list li p {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.results-list .badge {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  align-self: flex-start;
}

.results-empty {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 20px 12px;
  border-radius: 16px;
  border: 1px dashed var(--panel-border);
}

.app-footer {
  text-align: center;
  padding: 12px;
}

.countdown-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: white;
  text-align: center;
  z-index: 9999;
  pointer-events: none;
}

.countdown-overlay > div {
  font-size: clamp(4rem, 15vw, 6rem);
  font-weight: 700;
}

.timeup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10000;
}

body.theme-light .timeup-overlay {
  background: rgba(7, 70, 97, 0.55);
}

.timeup-overlay__card {
  position: relative;
  max-width: 420px;
  width: 100%;
  text-align: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  padding: 32px 28px;
  box-shadow: 0 40px 60px rgba(0, 0, 0, 0.35);
}

.timeup-overlay__title {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.1em;
}

.timeup-overlay__hint {
  margin: 16px 0 0;
  color: var(--text-muted);
}

.timeup-overlay__close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  border-radius: 999px;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.2);
  color: var(--text-primary);
  transition: background 0.2s ease, transform 0.2s ease;
}

body.theme-light .timeup-overlay__close {
  background: rgba(221, 244, 250, 0.85);
  color: var(--text-primary);
}

.timeup-overlay__close:hover {
  background: var(--accent);
  color: #fff;
  transform: scale(1.05);
}

.pomodoro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10010;
  transition: background 0.3s ease;
}

body.theme-light .pomodoro-overlay {
  background: rgba(7, 70, 97, 0.45);
}

.pomodoro-overlay__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  color: var(--text-primary);
  pointer-events: auto;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px;
  padding: 32px 28px;
  width: min(90vw, 420px);
  box-shadow: 0 25px 60px rgba(2, 6, 23, 0.45);
}

body.theme-light .pomodoro-overlay__content {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(35, 182, 216, 0.22);
  box-shadow: 0 30px 60px rgba(8, 58, 82, 0.2);
}

.pomodoro-overlay__phase {
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

body.theme-light .pomodoro-overlay__phase {
  color: rgba(8, 59, 76, 0.7);
}

.pomodoro-overlay__time {
  font-size: clamp(4rem, 12vw, 6rem);
  font-weight: 800;
}

.pomodoro-overlay__cycle {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
}

body.theme-light .pomodoro-overlay__cycle {
  color: rgba(8, 59, 76, 0.7);
}

.pomodoro-overlay__actions {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.pomodoro-overlay__pause {
  flex: 0 1 auto;
  min-width: 130px;
  max-width: 220px;
  padding: 10px 18px;
  font-size: 1.1rem;
}

.pomodoro-overlay__fullscreen {
  flex: 0 1 auto;
  min-width: 120px;
  max-width: 200px;
  padding: 10px 18px;
  border-radius: 999px;
}

.pomodoro-overlay__close {
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: transparent;
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

body.theme-light .pomodoro-overlay__close {
  color: var(--text-primary);
  border-color: rgba(35, 182, 216, 0.45);
}

.pomodoro-overlay__close:hover {
  background: rgba(14, 165, 233, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.pomodoro-overlay__close.is-armed {
  background: rgba(14, 165, 233, 0.2);
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 560px) {
  .pomodoro-overlay__content {
    width: 100%;
    max-width: 380px;
    padding: 24px 20px;
  }

  .pomodoro-overlay__actions {
    flex-direction: column;
  }

  .pomodoro-overlay__pause,
  .pomodoro-overlay__fullscreen {
    width: 100%;
    min-width: auto;
    max-width: none;
  }

  .pomodoro-overlay__close {
    width: 54px;
    height: 54px;
    font-size: 1.8rem;
  }
}

.pomodoro-confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10020;
}

body.theme-light .pomodoro-confirm-modal {
  background: rgba(7, 70, 97, 0.4);
}

.pomodoro-break-modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10025;
}

body.theme-light .pomodoro-break-modal {
  background: rgba(7, 70, 97, 0.35);
}

.pomodoro-break-card {
  width: min(90vw, 360px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 30px 60px rgba(2, 6, 23, 0.45);
}

.pomodoro-break-card h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.pomodoro-break-card .btn {
  width: 100%;
}

.pomodoro-confirm-modal__card {
  width: min(90vw, 360px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 30px 60px rgba(2, 6, 23, 0.45);
}

.pomodoro-confirm-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.custom-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  .panel {
    padding: 16px;
  }

  .timer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .player-head,
  .results-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-field {
    flex-direction: column;
    align-items: stretch;
  }

  .search-field button {
    width: 100%;
  }
}

@media (max-width: 1200px) {
  .app-shell {
    padding: 20px 14px 28px;
  }

  .video-grid {
    gap: 12px;
  }
}

@media (max-width: 1024px) {
  .top-bar {
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  .top-brand {
    width: 100%;
  }

  .top-controls {
    flex: 1 1 100%;
    justify-content: flex-end;
    gap: 10px;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    justify-content: center;
  }

  .timer-panels {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 900px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .top-controls {
    flex-wrap: wrap;
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

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

  .video-column {
    width: 100%;
  }
}

@media (max-width: 820px) {
  .panel--timers .pomodoro-grid {
    flex-direction: column;
    gap: 8px;
  }

  .top-control {
    width: calc(50% - 8px);
  }

  .language-toggle {
    width: 100%;
    justify-content: space-between;
  }

  .timer-display {
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .countdown-grid {
    flex-direction: column;
  }

  .countdown-col {
    flex: 1 1 100%;
    min-width: 0;
  }

  .time-picker-grid {
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .time-field {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .top-bar {
    gap: 4px;
  }

  .top-brand {
    width: 100%;
    column-gap: 8px;
    row-gap: 4px;
  }

  .top-bar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
  }

  .top-controls {
    flex-direction: column;
    width: 100%;
  }

  .top-settings {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }

  .settings-panel {
    left: 0;
    right: 0;
    width: auto;
  }

  .top-control {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
  }

  .top-control .btn {
    flex: 1;
  }

  .top-controls.is-collapsed {
    display: none;
  }

  .panel--videos .video-section,
  .player-card,
  .results-card {
    padding: 14px;
  }

  .panel-head__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .panel-head__actions .tab-list {
    width: 100%;
    justify-content: space-between;
  }

  .panel-head__actions .tab-list .tab {
    flex: 1;
    text-align: center;
  }

  .pomodoro-focus-block,
  .pomodoro-rest-block {
    padding: 10px;
  }

  .pomodoro-overlay__content {
    width: min(94vw, 360px);
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding: 14px 8px 20px;
  }

  .top-brand {
    width: 100%;
    column-gap: 6px;
    row-gap: 4px;
  }

  .timer-display p {
    font-size: clamp(2.6rem, 12vw, 3.4rem);
  }

  .player-card .player-embed {
    min-height: 200px;
  }

  .top-controls {
    border-top: 1px solid var(--panel-border);
    padding-top: 6px;
    gap: 6px;
  }
}
.intro-card h2 {
  font-size: 1.2rem;
  margin: 0;
}
