:root {
  --bg-deep: #070b12;
  --bg-surface: rgba(17, 25, 40, 0.72);
  --bg-surface-elevated: rgba(28, 39, 60, 0.78);
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-glow: rgba(94, 234, 212, 0.35);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-teal: #2dd4bf;
  --accent-cyan: #38bdf8;
  --accent-indigo: #818cf8;
  --accent-amber: #fbbf24;
  --status-green: #10b981;

  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-pill: 9999px;

  --font-sans: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
}

/* พื้นหลังแสงออร่าเคลื่อนไหวช้าๆ */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, #0f172a 0%, #070b12 75%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  animation: floatOrb 22s infinite ease-in-out alternate;
}

.orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #14b8a6, transparent 70%);
  top: -120px;
  left: -100px;
}

.orb-2 {
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  bottom: -150px;
  right: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.16;
  animation-delay: -13s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(30px, 40px) scale(1.12); }
}

/* โครงสร้างหลัก */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 0 auto;
  padding: 20px 18px 48px;
}

.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

/* ส่วนหัวเว็บ */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.18), rgba(56, 189, 248, 0.12));
  border: 1px solid rgba(45, 212, 191, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-teal);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 26px;
  height: 26px;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-sub {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--accent-teal);
  opacity: 0.9;
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

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

/* ปุ่มแสดงสถานะ Wake Lock */
.wakelock-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.wakelock-pill:hover {
  border-color: var(--border-glow);
  background: rgba(30, 41, 59, 0.9);
}

.wakelock-pill.active {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.45);
  color: #a7f3d0;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
  transition: background 0.25s ease;
}

.pulse-dot.active {
  background: var(--status-green);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

/* แถบอธิบายระบบป้องกันสแตนบาย */
.wakelock-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 16px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(45, 212, 191, 0.22);
  font-size: 0.83rem;
  color: #cbd5e1;
  flex-wrap: wrap;
}

.banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-icon {
  color: var(--accent-teal);
  flex-shrink: 0;
}

.always-awake-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--accent-teal);
  font-weight: 500;
  user-select: none;
}

.always-awake-toggle input {
  accent-color: var(--accent-teal);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Grid หลัก */
.main-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* การ์ดจับเวลาด้านซ้าย */
.timer-card {
  padding: 24px 22px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mode-tabs {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.75);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.mode-tab {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-tab.active {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.22), rgba(56, 189, 248, 0.22));
  color: var(--text-primary);
  border: 1px solid rgba(45, 212, 191, 0.35);
}

/* วงแหวนจับเวลา & ลมหายใจ */
.timer-visual-wrapper {
  position: relative;
  width: 310px;
  height: 310px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0 18px;
}

.breath-aura {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.22) 0%, rgba(56, 189, 248, 0.08) 55%, transparent 75%);
  transform: scale(0.88);
  transition: transform 1s ease-in-out, opacity 1s ease-in-out;
  pointer-events: none;
}

.breath-aura.inhale {
  transform: scale(1.25);
  opacity: 0.95;
}

.breath-aura.hold {
  transform: scale(1.25);
  opacity: 0.75;
}

.breath-aura.exhale {
  transform: scale(0.78);
  opacity: 0.4;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-ring-track {
  stroke: rgba(148, 163, 184, 0.12);
}

.progress-ring-bar {
  stroke-dasharray: 867.08; /* 2 * PI * 138 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.35s linear;
  filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.35));
}

.timer-center-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.phase-badge {
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  background: rgba(45, 212, 191, 0.12);
  color: var(--accent-teal);
  border: 1px solid rgba(45, 212, 191, 0.25);
  margin-bottom: 8px;
}

.time-adjust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.time-display {
  font-family: var(--font-mono);
  font-size: 3.4rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 24px rgba(45, 212, 191, 0.2);
}

.step-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.step-btn:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--accent-teal);
  background: rgba(45, 212, 191, 0.15);
}

.step-btn:disabled {
  opacity: 0.2;
  cursor: default;
}

.breath-guide-text {
  margin-top: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: #a5f3fc;
  min-height: 1.4em;
  transition: opacity 0.3s ease;
}

.timer-sub-info {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ปุ่มเลือกเวลาด่วน */
.preset-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
  max-width: 440px;
}

.preset-chip {
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-chip:hover {
  border-color: rgba(45, 212, 191, 0.4);
  color: var(--text-primary);
}

.preset-chip.active {
  background: rgba(45, 212, 191, 0.18);
  border-color: var(--accent-teal);
  color: #5eead4;
  font-weight: 500;
}

.preset-chip.custom-chip {
  border-style: dashed;
  border-color: rgba(56, 189, 248, 0.45);
  color: #bae6fd;
}

.preset-chip.custom-chip.active {
  border-style: solid;
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--accent-cyan);
  color: #e0f2fe;
}

.clickable-time {
  cursor: pointer;
  border-radius: var(--radius-md);
  padding: 2px 8px;
  transition: background 0.2s ease;
}

.clickable-time:hover {
  background: rgba(45, 212, 191, 0.08);
}

/* แผงกำหนดเวลาเอง */
.custom-time-panel {
  width: 100%;
  max-width: 430px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 20px;
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.custom-time-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.close-mini-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 6px;
}

.close-mini-btn:hover {
  color: var(--text-primary);
}

.custom-time-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.time-input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.time-input-group input {
  width: 68px;
  padding: 8px 6px;
  text-align: center;
  border-radius: var(--radius-md);
  background: rgba(7, 11, 18, 0.9);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 600;
  outline: none;
}

.time-input-group input:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.2);
}

.time-input-group label {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.time-colon {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.apply-custom-btn {
  padding: 9px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(45, 212, 191, 0.4);
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.25), rgba(2, 132, 199, 0.25));
  color: #5eead4;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.apply-custom-btn:hover {
  background: linear-gradient(135deg, #14b8a6, #0284c7);
  color: #ffffff;
}

/* ปุ่มควบคุมหลัก */
.primary-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 430px;
}

.control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: var(--radius-lg);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s ease;
  border: 1px solid transparent;
}

.control-btn.primary {
  flex: 1.5;
  background: linear-gradient(135deg, #14b8a6, #0284c7);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(20, 184, 166, 0.3);
}

.control-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(20, 184, 166, 0.42);
}

.control-btn.primary.running {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.28);
}

.control-btn.secondary {
  flex: 0.9;
  background: rgba(15, 23, 42, 0.75);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

.control-btn.secondary:hover:not(:disabled) {
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.85);
}

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

.full-width {
  width: 100%;
}

/* คอลัมน์ด้านขวา */
.side-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-card,
.stats-card {
  padding: 20px 20px 22px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-title svg {
  color: var(--accent-teal);
}

.text-action-btn {
  border: 1px solid rgba(45, 212, 191, 0.3);
  background: rgba(45, 212, 191, 0.1);
  color: var(--accent-teal);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.text-action-btn:hover {
  background: rgba(45, 212, 191, 0.22);
}

.text-action-btn.muted {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}

.text-action-btn.muted:hover {
  color: #f87171;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 540px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.setting-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.setting-field label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.zen-select {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.83rem;
  outline: none;
  cursor: pointer;
}

.zen-select:focus {
  border-color: var(--accent-teal);
}

/* ส่วนเสียงบรรยากาศธรรมชาติ */
.ambient-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.ambient-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.ambient-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
}

.volume-control input[type="range"] {
  width: 85px;
  accent-color: var(--accent-teal);
  cursor: pointer;
}

.ambient-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.ambient-chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ambient-chip:hover {
  color: var(--text-primary);
  border-color: rgba(56, 189, 248, 0.4);
}

.ambient-chip.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--accent-cyan);
  color: #bae6fd;
  font-weight: 500;
}

/* สถิติการปฏิบัติ */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-box {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--accent-teal);
}

.stat-label {
  font-size: 0.73rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.history-title {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.history-list {
  list-style: none;
  max-height: 175px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 0.8rem;
}

.history-item-left {
  display: flex;
  flex-direction: column;
}

.history-note {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.history-badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #5eead4;
  background: rgba(45, 212, 191, 0.12);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.history-empty {
  text-align: center;
  padding: 18px 10px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* โหมดหรี่แสงหน้าจอประหยัดแบต (OLED Dimmer) */
.dim-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

.dim-content {
  opacity: 0.38;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px;
}

.dim-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.dim-time {
  font-family: var(--font-mono);
  font-size: 4rem;
  font-weight: 500;
  color: #cbd5e1;
}

.dim-breath {
  font-size: 1rem;
  color: #5eead4;
}

.dim-hint {
  margin-top: 24px;
  font-size: 0.78rem;
  color: #475569;
}

/* Modal สรุปผล */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(3, 7, 18, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  max-width: 420px;
  width: 100%;
  padding: 28px 24px;
  text-align: center;
}

.modal-icon {
  font-size: 2.6rem;
  margin-bottom: 8px;
  display: inline-block;
}

.modal-icon.ringing {
  animation: bellShake 0.7s infinite ease-in-out alternate;
}

@keyframes bellShake {
  0% { transform: rotate(-14deg) scale(1.05); }
  50% { transform: rotate(14deg) scale(1.12); }
  100% { transform: rotate(-10deg) scale(1.05); }
}

.header-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.text-action-btn.highlight {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
}

.text-action-btn.highlight:hover {
  background: rgba(251, 191, 36, 0.24);
}

/* กล่องแสดงสถานะเสียงเตือนไล่ระดับความดังและความถี่ */
.alarm-status-box {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-lg);
  padding: 14px 14px;
  margin-bottom: 18px;
  text-align: center;
  transition: all 0.25s ease;
}

.alarm-status-box.stopped {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.alarm-status-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #fde68a;
  margin-bottom: 10px;
}

.alarm-status-box.stopped .alarm-status-header {
  color: #6ee7b7;
}

.alarm-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
  animation: pulseAmber 1s infinite;
}

.alarm-status-box.stopped .alarm-live-dot {
  background: #10b981;
  animation: none;
  box-shadow: none;
}

@keyframes pulseAmber {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.75); }
  70% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.alarm-meter-bar {
  width: 100%;
  height: 8px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 8px;
}

.alarm-intensity-fill {
  height: 100%;
  background: linear-gradient(90deg, #2dd4bf, #f59e0b, #ef4444);
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}

.alarm-metrics-text {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #cbd5e1;
  margin-bottom: 12px;
}

.stop-alarm-btn {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(248, 113, 113, 0.5);
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
  transition: all 0.2s ease;
}

.stop-alarm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.5);
}

.stop-alarm-btn.hidden {
  display: none;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.modal-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.reflection-box {
  text-align: left;
  margin-bottom: 18px;
}

.reflection-box label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.reflection-box input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  outline: none;
}

.reflection-box input:focus {
  border-color: var(--accent-teal);
}

.hidden {
  display: none !important;
}
