/* ===== Memory Palace Tracker — dark theme ===== */

:root {
  --bg: #0d0f16;
  --surface: #151823;
  --surface-2: #1c2130;
  --surface-3: #232941;
  --border: #262c3f;
  --border-strong: #343b55;
  --text: #e9ebf5;
  --muted: #8b91a7;
  --accent: #8b7cf6;
  --accent-strong: #a598ff;
  --accent-soft: rgba(139, 124, 246, 0.14);
  --gold: #f0b45a;
  --gold-soft: rgba(240, 180, 90, 0.12);
  --danger: #e5646c;
  --danger-soft: rgba(229, 100, 108, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(139, 124, 246, 0.09), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(240, 180, 90, 0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(13, 15, 22, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 6px;
  flex-wrap: wrap;
}

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

.brand-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 14px rgba(139, 124, 246, 0.55));
}

.brand h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.tagline {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.tabs { display: flex; gap: 8px; }

.tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tab:hover { color: var(--text); border-color: var(--border-strong); }

.tab.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.progress-area { padding-bottom: 12px; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 4px 0 8px;
}

.stats b { color: var(--text); font-weight: 600; }

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

.goal-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}

.goal-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width 0.6s ease;
}

.goal-label {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.goal-label b { color: var(--gold); font-weight: 600; }

/* ===== Main ===== */

main { padding: 26px 20px 80px; }

.view-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.view-head h2 { margin: 0; font-size: 1.35rem; }

.view-sub { color: var(--muted); font-size: 0.85rem; margin: 2px 0 18px; }

/* Breadcrumbs */

.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.crumbs button {
  appearance: none;
  background: none;
  border: none;
  padding: 2px 4px;
  font: inherit;
  color: var(--accent-strong);
  cursor: pointer;
  border-radius: 6px;
}

.crumbs button:hover { background: var(--accent-soft); }

.crumbs .sep { opacity: 0.5; }
.crumbs .here { color: var(--text); font-weight: 600; }

/* ===== Forms ===== */

.add-form {
  display: flex;
  gap: 10px;
  margin: 4px 0 22px;
}

.add-form input,
.add-form textarea,
.modal input,
.modal textarea,
.search-box input {
  flex: 1;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.add-form input:focus,
.add-form textarea:focus,
.modal input:focus,
.modal textarea:focus,
.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.add-form textarea { resize: vertical; min-height: 96px; }

.add-form.stacked { flex-direction: column; }
.add-form.stacked .btn { align-self: flex-end; }

::placeholder { color: #5b6178; }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.btn:hover { border-color: var(--border-strong); background: var(--surface-3); }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #14101f;
}

.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #1a0d0e;
}

.btn.ghost { background: transparent; }

/* ===== Cards & rows ===== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.book-card { border-left: 4px solid var(--accent); }

.card-main { min-width: 0; }

.book-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.card-meta { margin: 0; font-size: 0.78rem; color: var(--muted); }

.row-list { display: flex; flex-direction: column; gap: 10px; }

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.row:hover { border-color: var(--accent); background: var(--surface-2); }

.row-main { min-width: 0; display: flex; align-items: baseline; gap: 10px; }

.row-num {
  flex: none;
  font-size: 0.75rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 700;
}

.row-title { font-weight: 600; overflow-wrap: anywhere; }

.row-meta { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.card-actions, .row-actions { display: flex; gap: 4px; flex: none; }

.icon-btn {
  appearance: none;
  background: none;
  border: none;
  font-size: 0.95rem;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.55;
  transition: all 0.15s ease;
}

.icon-btn:hover { opacity: 1; background: var(--surface-3); }
.icon-btn.danger:hover { background: var(--danger-soft); }

/* ===== Sentences ===== */

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  margin: 0 0 16px;
}

.hint .mapped-demo {
  border-bottom: 2px solid var(--accent);
  color: var(--text);
}

.coverage { color: var(--gold); font-weight: 600; }

.sentence-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sentence {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.s-num {
  flex: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  margin-top: 4px;
}

.s-text {
  flex: 1;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.s-actions { display: flex; gap: 2px; flex: none; }

/* Words inside sentences */

.word {
  border-radius: 4px;
  padding: 1px 2px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.word.mapped {
  border-bottom: 2px solid var(--accent);
}

.word.mapped:hover, .word.mapped.tt-open {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.word.unmapped {
  border-bottom: 1px dashed #454c66;
}

.word.unmapped:hover, .word.unmapped.tt-open {
  background: var(--surface-3);
}

/* ===== Tooltip ===== */

.tooltip {
  position: fixed;
  z-index: 100;
  max-width: 260px;
  background: #1d2136;
  border: 1px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  font-size: 0.9rem;
}

.tooltip .t-word { color: var(--muted); }

.tooltip .t-arrow { color: var(--muted); opacity: 0.7; }

.tooltip .t-image {
  color: var(--gold);
  font-size: 1.15rem;
  font-weight: 700;
}

.tooltip .t-none { color: var(--muted); font-size: 0.8rem; font-style: italic; }

/* ===== Word Images tab ===== */

.word-form { display: flex; gap: 10px; margin-bottom: 14px; }
.word-form input { flex: 1; min-width: 0; }

.word-arrow {
  align-self: center;
  color: var(--muted);
  font-size: 1.1rem;
  flex: none;
}

.search-box { margin-bottom: 18px; }

.word-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.word-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color 0.15s ease;
}

.word-chip:hover { border-color: var(--border-strong); }

.chip-pair { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }

.chip-pair .w { font-weight: 600; }
.chip-pair .a { color: var(--muted); opacity: 0.7; flex: none; }
.chip-pair .i {
  color: var(--gold);
  font-weight: 700;
  background: var(--gold-soft);
  padding: 1px 8px;
  border-radius: 6px;
}

/* ===== Empty state ===== */

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
}

.empty-icon { font-size: 2.6rem; margin-bottom: 10px; }

.empty-state p { margin: 4px 0; }

.empty-state a.btn { text-decoration: none; display: inline-block; margin: 8px 4px; }
.empty-state .btn + .btn { margin-left: 4px; }

.err-detail {
  color: var(--danger);
  font-family: Consolas, Menlo, monospace;
  font-size: 0.85rem;
  max-width: 640px;
  margin: 10px auto;
  overflow-wrap: anywhere;
}

.err-checklist {
  max-width: 560px;
  margin: 14px auto 0;
  text-align: left;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.err-checklist code {
  background: var(--surface-3);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.8rem;
}

/* ===== Modal ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(5, 6, 10, 0.7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.modal h3 { margin: 0 0 14px; font-size: 1.1rem; }

.modal label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 12px 0 5px;
}

.modal textarea { resize: vertical; min-height: 90px; }

.modal .modal-text { color: var(--muted); font-size: 0.92rem; margin: 0; overflow-wrap: anywhere; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ===== Toast ===== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 110;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 40px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.error { border-color: var(--danger); color: #ffd7da; }

.hidden { display: none !important; }

/* ===== Mobile ===== */

@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  main { padding: 20px 14px 70px; }

  .header-top { justify-content: center; text-align: center; }
  .brand { justify-content: center; }
  .tabs { width: 100%; }
  .tab { flex: 1; text-align: center; }

  .goal-label { font-size: 0.7rem; }

  .add-form { flex-direction: column; }
  .add-form .btn { width: 100%; }
  .add-form.stacked .btn { align-self: stretch; }

  .word-form { flex-wrap: wrap; }
  .word-form input { flex: 1 1 100%; }
  .word-arrow { display: none; }
  .word-form .btn { width: 100%; }

  .card-grid, .word-grid { grid-template-columns: 1fr; }

  .sentence { flex-wrap: wrap; }
  .s-actions { margin-left: auto; }

  .row-meta { display: none; }
}

/* ===== Auth: boot, login, user chip ===== */

.boot-loading { padding-top: 40px; }

.app-screen { display: block; }

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.user-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn { padding: 7px 12px; font-size: 0.82rem; }

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  text-align: center;
}

.login-icon {
  font-size: 2.4rem;
  filter: drop-shadow(0 0 16px rgba(139, 124, 246, 0.5));
  margin-bottom: 8px;
}

.login-card h1 { margin: 0 0 4px; font-size: 1.4rem; }

.login-sub { margin: 0 0 20px; color: var(--muted); font-size: 0.85rem; }

.login-card label {
  display: block;
  text-align: left;
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 5px;
}

.login-card input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-btn { width: 100%; margin-top: 6px; padding: 12px; }
.login-btn:disabled { opacity: 0.6; cursor: default; }

.login-error {
  color: #ffd7da;
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 0.82rem;
  text-align: left;
  margin: 0 0 12px;
}

/* Shared header behaviour on small screens */

@media (max-width: 640px) {
  .header-right { width: 100%; justify-content: center; }
  .user-chip { justify-content: center; }
}

/* ===== File Vault ===== */

#files-app .brand-icon { filter: drop-shadow(0 0 14px rgba(240, 180, 90, 0.5)); }

.fv-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}

.fv-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  padding: 20px;
  margin-bottom: 20px;
  cursor: pointer;
  font-size: 0.88rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.fv-drop:hover { border-color: var(--accent); color: var(--text); }
.fv-drop u { text-decoration: underline; }
.fv-drop-icon { font-size: 1.3rem; }

/* Highlight the drop zone while dragging anywhere over the file area */
#fv-main.dragging .fv-drop {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.fv-list { display: flex; flex-direction: column; gap: 8px; }

.fv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.fv-row:hover { border-color: var(--border-strong); }

.fv-dir { cursor: pointer; }
.fv-dir:hover { border-color: var(--gold); background: var(--surface-2); }

.fv-icon { flex: none; font-size: 1.25rem; line-height: 1; }

.fv-name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fv-meta {
  flex: none;
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

.fv-actions { flex: none; display: flex; gap: 2px; align-items: center; }
.fv-actions a.icon-btn { text-decoration: none; }

@media (max-width: 640px) {
  #fv-stats { justify-content: center; }
  .fv-toolbar .btn { flex: 1; }
  .fv-meta { display: none; }
  .fv-drop { padding: 16px; font-size: 0.82rem; }
}


/* ===== Hub (main menu) ===== */

.hub-card { max-width: 440px; }

.hub-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 20px;
}

.hub-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 15px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: all 0.15s ease;
}

.hub-option:hover {
  border-color: var(--accent);
  background: var(--surface-3);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.hub-icon { font-size: 1.5rem; flex: none; }

.hub-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.hub-text b { font-size: 0.95rem; }
.hub-text small { color: var(--muted); font-size: 0.76rem; }

.hub-arrow {
  color: var(--muted);
  flex: none;
  transition: transform 0.15s ease, color 0.15s ease;
}

.hub-option:hover .hub-arrow { color: var(--accent-strong); transform: translateX(3px); }

.home-btn { padding: 7px 12px; font-size: 0.82rem; }

/* ===== Goal Tracker ===== */

.goal-card { border-left: 4px solid #6ddf9c; }

.gt-progress {
  height: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 10px;
}

.gt-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #6ddf9c);
  border-radius: 999px;
}

.hz {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.hz-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }

.hz-icon { font-size: 1.05rem; }

.hz-head h3 {
  margin: 0;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hz-count {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

.hz-yearly    { border-left-color: var(--gold); }
.hz-quarterly { border-left-color: var(--accent); }
.hz-monthly   { border-left-color: #6ddf9c; }
.hz-weekly    { border-left-color: #5cc8ff; }
.hz-daily     { border-left-color: #ff9e6e; }

.ms-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ms {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
}

.ms label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.ms input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  margin: 3px 0 0;
  flex: none;
  cursor: pointer;
}

.ms-text { overflow-wrap: anywhere; line-height: 1.5; }

.ms.done .ms-text { text-decoration: line-through; color: var(--muted); }

.ms-actions { display: flex; gap: 2px; flex: none; }

.ms-empty {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 10px;
}

.ms-add { display: flex; gap: 8px; }

.ms-add input {
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ms-add input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ms-add .btn { padding: 8px 14px; }

/* ===== Daily planner ===== */

.planner-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0;
}

.planner-bar .btn { padding: 8px 13px; }

.planner-bar input[type="date"] {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  outline: none;
  color-scheme: dark;
}

.planner-bar input[type="date"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.planner-day { color: var(--muted); font-size: 0.85rem; margin: 6px 0 14px; }
.planner-day b { color: var(--gold); }

.planner-grid {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px 10px;
}

.slot {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px dashed var(--border);
  padding: 2px 0;
}

.slot.hour-start { border-top: 1px solid var(--border-strong); }

.planner-grid .slot:first-child { border-top: none; }

.slot-time {
  flex: none;
  width: 50px;
  font-size: 0.74rem;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.slot.hour-start .slot-time { color: var(--text); font-weight: 600; }

.slot-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 6px 10px;
  outline: none;
}

.slot-input:hover { background: var(--surface-2); }

.slot-input:focus { background: var(--surface-2); box-shadow: 0 0 0 2px var(--accent-soft); }

.slot.filled .slot-input { background: var(--accent-soft); }

.slot.now { background: var(--gold-soft); border-radius: 8px; }
.slot.now .slot-time { color: var(--gold); }

@media (max-width: 640px) {
  #gt-stats { justify-content: center; }
  .hub-card { padding: 26px 20px; }
  .planner-bar { justify-content: center; }
  .slot-time { width: 44px; }
}