/* ═══════════════════════════════════════════════════════════════
   HAVEN — Design System
   ═══════════════════════════════════════════════════════════════ */

/* ── Dark Mode Tokens (default) ─────────────────────────────── */
:root {
  --bg:            #0a0a14;
  --bg-card:       rgba(255,255,255,0.06);
  --bg-topbar:     rgba(10,10,20,0.85);
  --accent:        #818cf8;
  --accent-2:      #a78bfa;
  --text-primary:  #e8e8f4;
  --text-secondary:#a0a0bc;
  --text-tertiary: #60607a;
  --border:        rgba(255,255,255,0.08);
  --shadow:        0 4px 24px rgba(0,0,0,0.45);
  --radius-card:   12px;
  --radius-sm:     8px;
  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Light Mode Tokens ───────────────────────────────────────── */
[data-theme="light"] {
  --bg:            #f0eff5;
  --bg-card:       rgba(255,255,255,0.85);
  --bg-topbar:     rgba(240,239,245,0.90);
  --accent:        #4f46e5;
  --accent-2:      #7c3aed;
  --text-primary:  #12112a;
  --text-secondary:#4a4a6a;
  --text-tertiary: #8080a0;
  --border:        rgba(0,0,0,0.08);
  --shadow:        0 4px 24px rgba(0,0,0,0.12);
}

/* ── Auto mode: resolve via prefers-color-scheme ─────────────── */
[data-theme="auto"] {
  /* dark is default above, apply light overrides when OS is light */
}
@media (prefers-color-scheme: light) {
  [data-theme="auto"] {
    --bg:            #f0eff5;
    --bg-card:       rgba(255,255,255,0.85);
    --bg-topbar:     rgba(240,239,245,0.90);
    --accent:        #4f46e5;
    --accent-2:      #7c3aed;
    --text-primary:  #12112a;
    --text-secondary:#4a4a6a;
    --text-tertiary: #8080a0;
    --border:        rgba(0,0,0,0.08);
    --shadow:        0 4px 24px rgba(0,0,0,0.12);
  }
}

/* ── Base Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
  padding-bottom: 52px;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, select { font: inherit; }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  height: 52px;
  background: var(--bg-topbar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

/* ── Brand ───────────────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
}

/* ── Quote Area ──────────────────────────────────────────────── */
.quote-area {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.quote-text {
  font-size: 12px;
  font-style: italic;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
  cursor: default;
  transition: max-width 0.3s ease;
}

.quote-text:hover {
  max-width: 700px;
  white-space: normal;
  overflow: visible;
  z-index: 10;
  background: var(--bg-topbar);
  padding: 4px 8px;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.quote-author {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ── Greeting (absolute center) ─────────────────────────────── */
.greeting {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  pointer-events: none;
}

.greeting-name {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

/* ── Topbar Right ────────────────────────────────────────────── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Stats ───────────────────────────────────────────────────── */
.stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.stat-item {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.stat-num {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
}

.stat-label {
  font-size: 11px;
}

.stat-div {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.sep {
  width: 1px;
  height: 20px;
  background: var(--border);
}

/* ── Search ──────────────────────────────────────────────────── */
.search-field {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  width: 210px;
  transition: width 0.25s ease, border-color 0.2s;
}

.search-field:focus-within {
  width: 280px;
  border-color: var(--accent);
}

.search-field input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
}

.search-field input::placeholder {
  color: var(--text-tertiary);
}

.search-icon {
  color: var(--text-tertiary);
  font-size: 13px;
  flex-shrink: 0;
}

/* ── Settings + Edit Mode + Help Buttons ─────────────────────── */
.settings-btn,
.edit-mode-btn,
.help-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 16px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.settings-btn:hover,
.edit-mode-btn:hover,
.help-btn:hover {
  background: var(--border);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.edit-mode-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── Edit Mode — category drag handles ───────────────────────── */
body.edit-mode .cat-label {
  cursor: grab;
}

body.edit-mode .cat-label::before {
  content: '⠿';
  margin-right: 8px;
  opacity: 0.45;
  font-size: 13px;
}

body.edit-mode .category {
  outline: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: 6px;
  border-radius: var(--radius-sm);
}

/* ── Hero Section (sticky) ───────────────────────────────────── */
.hero-section {
  position: sticky;
  top: 52px;
  z-index: 50;
  background: var(--bg);
  display: flex;
  justify-content: center;
  padding: 24px 48px 20px;
}

.hero-section--expanded {
  justify-content: flex-start;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Quick Notes Panel ───────────────────────────────────────── */
.quick-notes-panel {
  flex: 1;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-notes-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  flex-shrink: 0;
}

.quick-notes-textarea {
  flex: 1;
  min-height: 72px;
  resize: none;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.6;
  padding: 8px 10px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

.quick-notes-textarea:focus {
  border-color: var(--accent);
}

.quick-notes-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ── Categories Content Area ─────────────────────────────────── */
.content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 48px 32px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── Hero Card ───────────────────────────────────────────────── */
.hero-card {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px 32px;
  width: fit-content;
  align-self: center;
  box-shadow: var(--shadow);
}

/* ── Clock Section ───────────────────────────────────────────── */
.section-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-right: 32px;
}

.clock-time {
  font-size: 54px;
  font-weight: 200;
  letter-spacing: -2px;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.clock-date {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ── Vertical Divider ────────────────────────────────────────── */
.vdivider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 0 32px;
  flex-shrink: 0;
}

/* ── Weather Section ─────────────────────────────────────────── */
.section-weather {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 0;
  min-width: 220px;
}

.weather-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.w-icon { font-size: 28px; line-height: 1; }
.w-temp { font-size: 28px; font-weight: 300; color: var(--text-primary); }
.w-city { font-size: 14px; color: var(--text-secondary); }
.w-desc { font-size: 13px; color: var(--text-tertiary); }

/* ── Forecast Pills ──────────────────────────────────────────── */
.fc-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.fc-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
}

.fc-day  { color: var(--text-tertiary); font-weight: 500; }
.fc-icon { font-size: 14px; }
.fc-temp { color: var(--text-primary); font-weight: 500; }
.fc-low  { color: var(--text-tertiary); }

/* ── Category ────────────────────────────────────────────────── */
.category {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 65%, transparent);
}

/* ── Links Row / Grid ────────────────────────────────────────── */
.links-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  min-height: 52px;
}

/* ── Link Card ───────────────────────────────────────────────── */
.link-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 10px 12px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.link-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: var(--shadow);
}

.favicon-wrapper {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.favicon-img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
  object-fit: contain;
}

.avatar-letter {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}

.link-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.link-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Modal Overlay ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: min(900px, calc(100vw - 48px));
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 0;
  flex-shrink: 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Tab Bar ─────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}

.tab-btn {
  padding: 6px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

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

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ── Tab Panels ──────────────────────────────────────────────── */
.tab-panel {
  padding: 24px 28px 28px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tab-panel--hidden {
  display: none;
}

.tab-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
}

.tab-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  flex: 1;
}

.tab-links-left,
.tab-links-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.modal-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
  flex-shrink: 0;
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.modal-hint {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Selector Groups (theme / lang / target) ─────────────────── */
.theme-selector,
.lang-selector,
.target-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-opt,
.lang-opt,
.target-opt {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 13px;
  color: var(--text-secondary);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.theme-opt:hover,
.lang-opt:hover,
.target-opt:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.theme-opt.active,
.lang-opt.active,
.target-opt.active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-weight: 600;
}

/* ── Custom Theme Color Pickers ──────────────────────────────── */
.custom-theme-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.color-row input[type="color"] {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 2px;
  cursor: pointer;
  background: var(--bg-card);
}

/* ── Location Row ───────────────────────────────────────────── */
.location-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.location-city {
  font-size: 13px;
  color: var(--text-primary);
  flex: 1;
}

.detect-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.detect-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Toggle Row ─────────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Modal Inputs ────────────────────────────────────────────── */
.modal-input {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}

.modal-input:focus {
  border-color: var(--accent);
}

.modal-input::placeholder {
  color: var(--text-tertiary);
}

/* ── Add Form ────────────────────────────────────────────────── */
.add-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.add-btn,
.save-btn {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: opacity 0.15s;
  width: fit-content;
}

.add-btn:hover,
.save-btn:hover {
  opacity: 0.85;
}

/* ── Manage Links List ───────────────────────────────────────── */
#manage-links-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
}

.manage-cat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.manage-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: color-mix(in srgb, var(--accent) 65%, transparent);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 4px 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.delete-btn {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(220,38,38,0.3);
  color: #f87171;
  font-size: 11px;
  background: rgba(220,38,38,0.06);
  transition: background 0.15s;
}

.delete-btn:hover {
  background: rgba(220,38,38,0.15);
}

/* ── Data Buttons ────────────────────────────────────────────── */
.data-buttons {
  display: flex;
  gap: 10px;
}

.data-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  transition: border-color 0.15s, color 0.15s;
}

.data-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Scrollbar (subtle) ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ── Drag & Drop ─────────────────────────────────────────────── */

.category.dragging   { opacity: 0.35; }
.link-card.dragging  { opacity: 0.35; }

.category.drag-over-cat {
  outline: 2px dashed var(--accent);
  outline-offset: 6px;
  border-radius: var(--radius-card);
}

.link-card.drag-over {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.links-row.drag-over-row {
  outline: 2px dashed var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
  min-height: 52px;
}

/* ── Add-link card (edit mode) ───────────────────────────────── */
.add-link-card {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: transparent;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--radius-card);
  padding: 10px 12px;
  font-size: 20px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.add-link-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

body.edit-mode .add-link-card { display: flex; }

/* ── Add-category section (edit mode) ────────────────────────── */
.add-cat-section {
  display: none;
  align-items: center;
  gap: 8px;
}

body.edit-mode .add-cat-section { display: flex; }

.add-cat-btn {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  background: transparent;
  color: var(--text-tertiary);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.add-cat-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.add-cat-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-cat-input {
  width: 200px;
}

.add-cat-confirm,
.add-cat-cancel {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.add-cat-confirm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.add-cat-cancel:hover {
  border-color: rgba(220,38,38,0.4);
  color: #f87171;
}

/* ── Edit / Cancel Buttons ───────────────────────────────────── */
.edit-btn {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  background: var(--bg-card);
  transition: border-color 0.15s, color 0.15s;
}

.edit-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cancel-btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  transition: border-color 0.15s, color 0.15s;
}

.cancel-btn:hover {
  border-color: var(--text-tertiary);
  color: var(--text-primary);
}

.link-btn-group {
  display: flex;
  gap: 6px;
  align-items: center;
}

.form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Help Modal ──────────────────────────────────────────────── */
.help-modal {
  width: min(780px, calc(100vw - 48px));
  max-height: 88vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.help-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.help-close-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 13px;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.help-close-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.help-body {
  overflow-y: auto;
  padding: 24px 28px 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 32px;
  align-content: start;
}

.help-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}

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

.help-list dt {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.help-list dd {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-left: 0;
  padding-left: 10px;
  border-left: 2px solid var(--border);
}

/* ── Footer ──────────────────────────────────────────────────── */
.page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 48px 12px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-privacy {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.7;
}

.footer-privacy a {
  color: var(--accent);
  opacity: 0.7;
  text-decoration: none;
}

.footer-privacy a:hover {
  opacity: 1;
}

.footer-repo {
  font-size: 11px;
  color: var(--accent);
  opacity: 0.7;
  text-decoration: none;
}

.footer-repo:hover {
  opacity: 1;
}
