/* FocusBell Personal — minimal, high-contrast dark UI */
:root {
  --bg: #0b1020;
  --bg-2: #121833;
  --card: #161d3a;
  --card-2: #1c2447;
  --text: #e7ecff;
  --muted: #97a1c4;
  --border: #2a335e;
  --primary: #f59e0b;
  --primary-2: #fbbf24;
  --danger: #ef4444;
  --ok: #22c55e;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --tap: 48px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 20% -10%, #1b2350 0%, var(--bg) 60%) fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-2); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h1, h2, h3 { margin: 0 0 8px; letter-spacing: 0.2px; }
h3 { font-size: 16px; color: #cfd6ff; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(180deg, var(--primary-2), var(--primary));
  color: #1b1300; font-weight: 800; display: grid; place-items: center;
  box-shadow: var(--shadow);
}
.brand-mark.sm { width: 26px; height: 26px; font-size: 12px; border-radius: 6px; }
.brand h1 { font-size: 20px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; backdrop-filter: blur(6px);
  background: rgba(11, 16, 32, 0.85); z-index: 10;
}
.topnav { display: flex; gap: 8px; align-items: center; }
.navlink { padding: 6px 10px; border-radius: 8px; color: var(--muted); }
.navlink.active { color: var(--text); background: var(--card-2); }

.container {
  max-width: 880px; margin: 0 auto; padding: 16px; display: grid; gap: 16px;
}

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 10px; }

.session-card { display: grid; gap: 14px; }

.status-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px;
  background: var(--card-2); border: 1px solid var(--border); color: var(--text);
}
.chip.idle { background: #2a335e; }
.chip.running { background: rgba(34, 197, 94, 0.18); border-color: rgba(34, 197, 94, 0.5); color: #bbf7d0; }
.chip.paused { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.5); color: #fde68a; }
.chip.ended  { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.5); color: #fecaca; }
.chip.ghost { opacity: 0.7; }
.chip[data-on="true"] { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.5); color: #fde68a; opacity: 1; }
.chips { display: inline-flex; gap: 6px; }

.countdown { text-align: center; padding: 8px 0 2px; }
.countdown-value { font-size: 56px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.countdown-label { color: var(--muted); font-size: 13px; }

.progress { display: grid; gap: 6px; }
.bar { height: 8px; background: #0f1530; border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.bar .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width 0.4s ease; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.form { display: grid; gap: 12px; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--muted); }
.field.inline { grid-template-columns: auto auto; align-items: center; gap: 8px; }
.field input, .field select, .form input, .form select {
  height: 44px; padding: 0 12px; border-radius: 10px;
  background: #0e1430; color: var(--text); border: 1px solid var(--border);
  font-size: 15px; outline: none;
}
.field input:focus, .field select:focus, .form input:focus, .form select:focus { border-color: var(--primary); }

.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }

.presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.presets .chip { cursor: pointer; }
.presets .chip:hover { background: #2a335e; }

.toggles { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { width: 38px; height: 22px; appearance: none; background: #2a335e; border-radius: 999px; position: relative; transition: 0.2s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { left: 18px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--tap); padding: 0 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card-2); color: var(--text); font-weight: 600; font-size: 15px;
  cursor: pointer; transition: 0.15s;
}
.btn:hover { background: #232c58; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, var(--primary-2), var(--primary)); color: #1b1300; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.5); color: #fecaca; }
.btn.ghost { background: transparent; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }

.auth-body { display: grid; place-items: center; min-height: 100%; }
.auth-wrap { width: min(420px, 92vw); padding: 20px; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.auth-card h1 { font-size: 22px; }
.error { color: #fecaca; min-height: 1.2em; font-size: 13.5px; }

.logout-banner {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #bbf7d0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  margin: 0;
}

.auth-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.auth-banner strong { color: #fff7e6; }
.auth-banner .btn { white-space: nowrap; }

.splash { display: grid; place-items: center; min-height: 100%; }
.splash-card { text-align: center; color: var(--muted); }
.logo { font-size: 28px; font-weight: 800; letter-spacing: 0.5px; color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stat { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

.message-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.message-list li { display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 8px; background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.message-list input[type="text"] { height: 36px; }
.message-list select { height: 36px; padding: 0 8px; background: #0e1430; color: var(--text); border: 1px solid var(--border); border-radius: 8px; }
.message-list .x { background: transparent; color: #fca5a5; border: none; cursor: pointer; font-size: 16px; }

.add-msg { grid-template-columns: 1fr auto auto; }
.add-msg input { height: 40px; }
.add-msg select { height: 40px; padding: 0 8px; background: #0e1430; color: var(--text); border: 1px solid var(--border); border-radius: 8px; }

.overlay {
  position: fixed; inset: 0; display: none; place-items: center;
  background: rgba(2, 6, 23, 0.75); backdrop-filter: blur(4px); z-index: 50;
}
.overlay[data-show="true"] { display: grid; }
.overlay-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; min-width: 280px; text-align: center; box-shadow: var(--shadow); }
.overlay-title { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.overlay-sub { color: var(--muted); margin-bottom: 14px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--card-2); color: var(--text); border: 1px solid var(--border);
  padding: 10px 14px; border-radius: 10px; font-size: 13.5px; opacity: 0;
  transition: 0.25s; z-index: 60; max-width: 80vw;
}
.toast[data-show="true"] { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
  .countdown-value { font-size: 44px; }
  .topbar { padding: 10px 12px; }
  .topnav { gap: 4px; }
  .navlink { padding: 6px 8px; font-size: 13px; }
}
