/* ═══════════════════════════════════════════════════
   TIMER AREA
   ═══════════════════════════════════════════════════ */
.timer-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: 16px 12px;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: clip;
}

.current-segment-title {
  font-family: 'Abhaya Libre', serif;
  font-weight: 600;
  margin-bottom: 2px;
  text-align: center;
  letter-spacing: 0.01em;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default;
  text-decoration: none;
  /* font-size set dynamically by JS based on text length */
}
.current-segment-title.editable {
  cursor: text;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s;
}
.current-segment-title.editable:hover {
  text-decoration-color: var(--text-muted);
}

.timer-digits {
  font-family: 'DM Mono', monospace;
  font-size: clamp(40px, 18vw, 120px);
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
  margin-bottom: 6px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.timer-digits.editable {
  cursor: text;
}

/* Progress bar — width matches digits */
.timer-progress-bar {
  height: 6px;
  background: var(--ring-track);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: clamp(10px, 2vh, 20px);
  /* width set dynamically by JS to match digits */
}
.timer-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.5s linear;
}

/* Controls — small and subtle */
.timer-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  opacity: 0.45;
  transition: opacity 0.25s ease;
}
.timer-controls:hover { opacity: 1; }
@media (hover: none) { .timer-controls { opacity: 1; } }

.ctrl-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background 0.15s, transform 0.1s, opacity 0.2s;
  background: var(--btn-bg);
  border: 1px solid var(--border);
}
.ctrl-btn:hover, .ctrl-btn:active { background: var(--btn-hover); }
.ctrl-btn:active { transform: scale(0.95); }

.ctrl-btn.primary {
  width: 34px;
  height: 34px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 13px;
}
.ctrl-btn.primary:hover, .ctrl-btn.primary:active { background: #e8884f; }

/* ── CSS icons for timer controls (flat, cross-platform) ── */
.icon-play {
  display: block;
  width: 0; height: 0;
  border-style: solid;
  border-width: 5px 0 5px 9px;
  border-color: transparent transparent transparent currentColor;
  margin-left: 2px; /* optical center */
}
.icon-pause {
  display: flex;
  gap: 2.5px;
  width: 10px; height: 10px;
}
.icon-pause::before,
.icon-pause::after {
  content: '';
  flex: 1;
  background: currentColor;
  border-radius: 1px;
}
.icon-reset {
  display: block;
  width: 10px; height: 10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  position: relative;
}
.icon-reset::after {
  content: '';
  position: absolute;
  top: -2px; right: -1px;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 4px 4px 0;
  border-color: transparent currentColor transparent transparent;
}
.icon-skip {
  display: flex;
  align-items: center;
  gap: 1px;
}
.icon-skip::before {
  content: '';
  width: 0; height: 0;
  border-style: solid;
  border-width: 4.5px 0 4.5px 7px;
  border-color: transparent transparent transparent currentColor;
}
.icon-skip::after {
  content: '';
  width: 2px; height: 9px;
  background: currentColor;
  border-radius: 0.5px;
}

/* Small segment-list icons */
.icon-play-sm {
  display: block;
  width: 0; height: 0;
  border-style: solid;
  border-width: 3.5px 0 3.5px 6px;
  border-color: transparent transparent transparent currentColor;
  margin-left: 1px;
}
.icon-pause-sm {
  display: flex;
  gap: 2px;
  width: 7px; height: 8px;
}
.icon-pause-sm::before,
.icon-pause-sm::after {
  content: '';
  flex: 1;
  background: currentColor;
  border-radius: 0.5px;
}

/* ── Sound icon (inline SVG) ── */
.sound-icon {
  display: block;
  transition: opacity 0.2s;
}
.header-btn.muted .sound-icon { opacity: 0.5; }
.header-btn.muted .sound-wave { display: none; }

/* Bigger touch targets on touch devices */
@media (hover: none) {
  .ctrl-btn { width: 40px; height: 40px; font-size: 14px; }
  .ctrl-btn.primary { width: 46px; height: 46px; font-size: 15px; }
  .ctrl-btn.primary .icon-play {
    border-width: 7px 0 7px 12px;
  }
  .ctrl-btn.primary .icon-pause {
    width: 13px; height: 13px;
  }
  .timer-controls { gap: 12px; }
}

/* ── Main timer HH:MM:SS editor ── */
.timer-edit-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.timer-edit-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.timer-edit-input {
  font-family: 'DM Mono', monospace;
  /* Match .timer-digits font-size exactly so layout doesn't shift */
  font-size: inherit;
  font-weight: 500;
  letter-spacing: 0.04em;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent);
  color: inherit;
  outline: none;
  text-align: center;
  padding: 0;
  line-height: 1;
  width: 1.4em;
  caret-color: var(--accent);
}
.timer-edit-input:focus {
  background: rgba(241, 151, 102, 0.06);
  border-radius: 4px 4px 0 0;
}
/* Chevrons float above/below input without affecting layout height */
.timer-edit-chevron {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  color: inherit;
  opacity: 0.3;
  cursor: pointer;
  font-size: clamp(10px, 2.5vw, 16px);
  padding: 2px 12px;
  line-height: 1;
  transition: opacity 0.1s;
  user-select: none;
  z-index: 1;
}
.timer-edit-chevron.up { bottom: 100%; margin-bottom: -2px; }
.timer-edit-chevron.down { top: 100%; margin-top: 0; }
.timer-edit-chevron:hover { opacity: 0.7; }
.timer-edit-chevron:active { opacity: 1; }
.timer-edit-sep {
  font-family: 'DM Mono', monospace;
  font-size: inherit;
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.35;
  padding: 0 2px;
  line-height: 1;
  align-self: center;
}
.timer-digits.editing {
  cursor: default;
}

/* ── Main title inline edit ── */
.main-title-edit-input {
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent);
  color: inherit;
  outline: none;
  text-align: center;
  padding: 0 4px;
  /* Size to content: use ch units based on value length, set by JS */
  min-width: 8ch;
  max-width: 90vw;
  box-sizing: content-box;
}

/* ═══════════════════════════════════════════════════
   SESSION COMPLETE
   ═══════════════════════════════════════════════════ */
.complete-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 5;
}
.complete-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.complete-icon {
  font-size: 36px;
  color: var(--completed);
  animation: completeBounce 0.5s ease-out;
}
@keyframes completeBounce {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.3); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}
.complete-title {
  font-family: 'Abhaya Libre', serif;
  font-weight: 600;
  font-size: 22px;
}
.complete-stats {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--completed);
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.complete-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.complete-restart-btn { margin-top: 16px; padding: 10px 28px; font-size: 14px; }

/* ═══════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
}
.empty-state-icon { font-size: 32px; opacity: 0.5; }
.empty-state-text { font-size: 14px; }
.empty-state-btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
}
.empty-state-btn:hover, .empty-state-btn:active { background: #e8884f; }
.empty-state.compact { padding: 20px; }

