/* =============================================================
   MANTRINOL · BACKUP AGENT
   Letterpress-instrument design system.
   Aligned with the Old Forge family identity (oldforge.tech).
   Typeset in Fraunces (display) and JetBrains Mono (body).
   ============================================================= */

/* ---------- TOKENS · NIGHT (default) ---------------------- */
:root {
  /* Surfaces — inverted Old Forge ink palette */
  --bg:          #0A0805;
  --bg-2:        #14110D;
  --bg-3:        #1E1A14;
  --line:        #2A251D;
  --line-hot:    #3a3327;

  /* Ink (text) */
  --ink:         #F0E7D2;
  --ink-dim:     #B9A77C;
  --ink-faint:   #988B73;  /* bumped for WCAG AA (~4.5:1 on --bg) */

  /* Ember accent — brighter for legibility on dark */
  --ember:       #E85D2B;
  --ember-deep:  #C8441C;
  --ember-glow:  rgba(232, 93, 43, 0.30);

  /* Status hues */
  --green:       #6FB57E;
  --red:         #E07360;
  --warn:        #D9A23A;
  --blue:        #6CA8C7;

  /* Atmosphere */
  --grid-line:   rgba(232, 93, 43, 0.04);
  --vignette:    radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.55) 100%);
  --led-glow:    0 0 10px var(--green), 0 0 2px var(--green);

  /* Type */
  --serif:       "Fraunces", Georgia, "Times New Roman", serif;
  --mono:        "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- TOKENS · DAY (toggle adds .light-theme) ------- */
body.light-theme {
  --bg:          #F0E7D2;
  --bg-2:        #EADEC0;
  --bg-3:        #DCCFA8;
  --line:        #B9A77C;
  --line-hot:    #8B7F66;

  --ink:         #181511;
  --ink-dim:     #5B5140;
  --ink-faint:   #6E634E;  /* bumped for WCAG AA on cream surfaces */

  --ember:       #C8441C;
  --ember-deep:  #8C2E12;
  --ember-glow:  rgba(200, 68, 28, 0.28);

  --green:       #4F7A3A;
  --red:         #A8261B;
  --warn:        #9A6E0F;
  --blue:        #1F4E7A;

  --grid-line:   rgba(20, 17, 13, 0.04);
  --vignette:    radial-gradient(ellipse at center, transparent 70%, rgba(120, 95, 30, 0.10) 100%);
  --led-glow:    0 0 4px rgba(79, 122, 58, 0.45);
}

/* ---------- RESET --------------------------------------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
*:focus { outline: none; }
*:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

/* CRT-style faint grid backdrop */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Vignette / atmosphere */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--vignette);
  pointer-events: none;
  z-index: 1;
}

::selection { background: var(--ember); color: var(--bg); }

/* ---------- CONTAINER --------------------------------- */
.container {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 32px 64px;
}

/* ---------- HEADER (was .glass-header) ----------------- */
.glass-header {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 16px 0 18px;
  margin-bottom: 0;
}

.header-content {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 0;
}

.logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  opacity: 0.9;
  filter: var(--logo-filter, none);
}
body.light-theme .logo { filter: none; opacity: 1; }

.header-text { display: flex; align-items: baseline; gap: 14px; }

.header-text h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  font-variation-settings: "opsz" 144, "SOFT" 100, "wght" 380;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--ember);
  margin: 0;
}

.tagline {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  margin: 0;
  padding-left: 14px;
  border-left: 1px solid var(--line-hot);
}

/* ---------- THEME TOGGLE (preserve #themeToggle / .theme-icon) ----- */
.theme-toggle {
  position: fixed;
  top: 22px;
  right: 32px;
  z-index: 10001;
  width: auto;
  min-width: 90px;
  height: auto;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--bg-2);
  cursor: pointer;
  font-family: var(--mono);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover { border-color: var(--ember); color: var(--ember); }
.theme-icon {
  font-size: 11px;
  font-style: normal;
  letter-spacing: 0.2em;
}
body.light-theme .theme-toggle { background: var(--bg-2); border-color: var(--line); }
body.light-theme .theme-toggle:hover { border-color: var(--ember); color: var(--ember); }

/* ---------- TABS (.tabs / .tab / .tab.active / .tab-content) ------- */
.tabs {
  display: flex;
  gap: 0;
  margin: 22px 0 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
body.light-theme .tabs { background: transparent; border-color: var(--line); }

.tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 12px 22px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.tab:hover { background: transparent; color: var(--ink); }
.tab.active {
  background: transparent;
  color: var(--ember);
  border-bottom-color: var(--ember);
}
.tab-num {
  color: var(--ink-faint);
  margin-right: 8px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-num { color: var(--ember-deep); }
body.light-theme .tab.active .tab-num { color: var(--ember); opacity: 0.55; }
body.light-theme .tab { color: var(--ink-dim); }
body.light-theme .tab:hover { background: transparent; color: var(--ink); }
body.light-theme .tab.active { background: transparent; color: var(--ember); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------- SECTION HEADERS / H2 / H3 ------------------- */
h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 80;
  font-size: 26px;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 18px;
}
body.light-theme h2 { color: var(--ink); }

h3 {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  margin-bottom: 12px;
}
body.light-theme h3 { color: var(--ink-dim); }

.section {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 22px;
  margin-bottom: 16px;
}
body.light-theme .section { background: var(--bg-2); border-color: var(--line); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* ---------- STATUS BAR (.glass-status) ------------------ */
.glass-status {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}
body.light-theme .glass-status { background: transparent; border-color: var(--line); }

/* ---------- STAT CARDS (.stats-grid / .stat-card) ------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 24px;
}

.stat-card, .glass-card {
  background: var(--bg-2);
  border: none;
  border-radius: 0;
  padding: 20px 22px;
  position: relative;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
body.light-theme .stat-card,
body.light-theme .glass-card { background: var(--bg-2); border-color: transparent; }

.stat-card h3 {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  margin-bottom: 14px;
}
body.light-theme .stat-card h3 { color: var(--ink-dim); }

.stat-value {
  font-family: var(--mono);
  font-size: 42px;
  font-weight: 300;
  color: var(--ember);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
body.light-theme .stat-value { color: var(--ember); }

/* ---------- BUTTONS (.btn / variants) ------------------- */
.btn {
  background: transparent;
  border: 1px solid var(--line-hot);
  border-radius: 0;
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  transition: border-color .15s, color .15s, background .15s;
}
.btn:hover { border-color: var(--ink); }

.btn-primary {
  background: var(--ember);
  border-color: var(--ember);
  color: var(--bg);
}
.btn-primary:hover { background: var(--ember-deep); border-color: var(--ember-deep); color: var(--bg); }
body.light-theme .btn-primary { color: #F0E7D2; }
body.light-theme .btn-primary:hover { color: #F0E7D2; }

.btn-secondary {
  background: transparent;
  border-color: var(--line-hot);
  color: var(--ink-dim);
}
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); background: transparent; }

.btn-success {
  background: transparent;
  border-color: var(--green);
  color: var(--green);
}
.btn-success:hover { background: var(--green); color: var(--bg); }

.btn-danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}
.btn-danger:hover { background: var(--red); color: var(--bg); }

.btn-warning {
  background: transparent;
  border-color: var(--warn);
  color: var(--warn);
}
.btn-warning:hover { background: var(--warn); color: var(--bg); }

.btn-info {
  background: transparent;
  border-color: var(--blue);
  color: var(--blue);
}
.btn-info:hover { background: var(--blue); color: var(--bg); }

.btn-sm { padding: 5px 11px; font-size: 10px; letter-spacing: 0.15em; }

/* ---------- CARDS (job/repo/history/snapshot) ----------- */
.job-card, .repo-card, .history-card, .snapshot-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-hot);
  border-radius: 0;
  padding: 18px 20px;
  margin-bottom: 8px;
  transition: border-left-color .15s, background .15s;
}
.job-card:hover, .repo-card:hover, .history-card:hover, .snapshot-card:hover {
  border-left-color: var(--ember);
  background: var(--bg-3);
}
body.light-theme .job-card,
body.light-theme .repo-card,
body.light-theme .history-card,
body.light-theme .snapshot-card { background: var(--bg-2); border-color: var(--line); }
body.light-theme .job-card:hover,
body.light-theme .repo-card:hover,
body.light-theme .history-card:hover,
body.light-theme .snapshot-card:hover { background: var(--bg-3); }

.job-header, .repo-header, .snapshot-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.job-title-row { display: flex; align-items: center; gap: 12px; }

.job-title, .repo-title, .snapshot-title {
  font-family: var(--serif);
  font-style: italic;
  font-variation-settings: "opsz" 60, "SOFT" 50, "wght" 500;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.1;
}
body.light-theme .job-title,
body.light-theme .repo-title,
body.light-theme .snapshot-title { color: var(--ink); }

.job-actions, .repo-actions, .snapshot-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.job-info, .repo-info, .snapshot-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 24px;
  color: var(--ink-dim);
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
body.light-theme .job-info,
body.light-theme .repo-info { color: var(--ink-dim); }

.info-item { display: flex; flex-direction: column; }

.info-label {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
  letter-spacing: 0.18em;
}
body.light-theme .info-label { color: var(--ink-faint); }

.info-value {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
body.light-theme .info-value { color: var(--ink); }

/* ---------- BADGES -------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid currentColor;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  background: transparent;
}
.badge-success { color: var(--green); border-color: var(--green); }
.badge-danger  { color: var(--red);   border-color: var(--red); }
.badge-warning { color: var(--warn);  border-color: var(--warn); }
.badge-info    { color: var(--blue);  border-color: var(--blue); }

/* ---------- ACTIVITY LIST (recentActivity) -------------- */
.activity-list {
  font-family: var(--mono);
  font-size: 12px;
}
.activity-list > * + * { border-top: 1px solid var(--line); }
.activity-list p {
  padding: 10px 4px;
  display: flex;
  gap: 14px;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
}

/* ---------- TOAST NOTIFICATIONS ------------------------- */
#toast-container {
  position: fixed;
  top: 70px;
  right: 32px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ember);
  border-radius: 0;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 300px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  font-family: var(--mono);
}
body.light-theme .toast { background: var(--bg-2); box-shadow: 0 4px 16px rgba(20,17,13,0.12); }

.toast.success { border-left-color: var(--green); background: var(--bg-2); }
.toast.error   { border-left-color: var(--red);   background: var(--bg-2); }
.toast.warning { border-left-color: var(--warn);  background: var(--bg-2); }
.toast.info    { border-left-color: var(--blue);  background: var(--bg-2); }
body.light-theme .toast.success,
body.light-theme .toast.error,
body.light-theme .toast.warning,
body.light-theme .toast.info { background: var(--bg-2); }

.toast-icon {
  font-family: var(--mono);
  font-size: 14px;
  flex-shrink: 0;
  line-height: 1.4;
}
.toast.success .toast-icon { color: var(--green); }
.toast.error   .toast-icon { color: var(--red); }
.toast.warning .toast-icon { color: var(--warn); }
.toast.info    .toast-icon { color: var(--blue); }

.toast-content { flex: 1; }
.toast-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink);
  margin-bottom: 4px;
}
body.light-theme .toast-title { color: var(--ink); }
.toast-message {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-dim);
  line-height: 1.5;
}
body.light-theme .toast-message { color: var(--ink-dim); }

.toast-close {
  background: none;
  border: none;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast-close:hover { color: var(--ember); }
body.light-theme .toast-close:hover { color: var(--ember); }

/* ---------- MODALS -------------------------------------- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(2px);
}
body.light-theme .modal { background: rgba(20, 17, 13, 0.55); }

.modal-content {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ember);
  border-radius: 0;
  margin: 5% auto;
  padding: 28px 32px;
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  position: relative;
}
.modal-content.modal-large { max-width: 680px; width: 92%; }
body.light-theme .modal-content { background: var(--bg-2); box-shadow: 0 20px 60px rgba(20,17,13,0.25); }

.modal-content h2 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  margin-bottom: 22px;
  color: var(--ink);
  padding-right: 24px;
}
body.light-theme .modal-content h2 { color: var(--ink); }

.modal-content h3 {
  color: var(--ember);
  margin-top: 12px;
}
body.light-theme .modal-content h3 { color: var(--ember); }

.modal-header {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.modal-header h2 { color: var(--ink); margin-bottom: 0; }
body.light-theme .modal-header h2 { color: var(--ink); }

.modal-body { color: var(--ink); }
body.light-theme .modal-body { color: var(--ink); }

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

#confirmModal { background: rgba(0, 0, 0, 0.78); }
body.light-theme #confirmModal { background: rgba(20, 17, 13, 0.55); }
#confirmModal .modal-header h2 { color: var(--ink); font-size: 22px; }
body.light-theme #confirmModal .modal-header h2 { color: var(--ink); }

.close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  color: var(--ink-faint);
  line-height: 1;
  font-family: var(--serif);
  background: none;
  border: none;
  float: none;
}
.close:hover { color: var(--ember); }

/* ---------- FORMS --------------------------------------- */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-dim);
}
body.light-theme .form-group label { color: var(--ink-dim); }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line-hot);
  border-radius: 0;
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg);
  color: var(--ink);
  transition: border-color .15s;
}
body.light-theme .form-group input,
body.light-theme .form-group select,
body.light-theme .form-group textarea {
  background: var(--bg);
  border-color: var(--line);
  color: var(--ink);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 1px var(--ember-glow);
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 11px;
  font-family: var(--mono);
}
body.light-theme .form-group small { color: var(--ink-faint); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  cursor: pointer;
  accent-color: var(--ember);
}

/* ---------- LOADING / EMPTY / ERROR / SUCCESS ----------- */
.loading {
  text-align: center;
  color: var(--ink-faint);
  padding: 36px 20px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}
body.light-theme .loading { color: var(--ink-faint); }

.empty-state {
  text-align: center;
  color: var(--ink-dim);
  padding: 40px 24px;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-2);
  border: 1px dashed var(--line-hot);
  border-radius: 0;
}
body.light-theme .empty-state { background: var(--bg-2); border-color: var(--line-hot); color: var(--ink-dim); }

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

.empty-state a {
  color: var(--ember);
  text-decoration: none;
  border-bottom: 1px solid var(--ember);
}
.empty-state a:hover { color: var(--ember-deep); border-color: var(--ember-deep); }
body.light-theme .empty-state a { color: var(--ember); border-color: var(--ember); }

.error {
  background: var(--bg-2);
  color: var(--red);
  border: 1px solid var(--red);
  border-left-width: 3px;
  border-radius: 0;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 12px;
}
body.light-theme .error { background: var(--bg-2); color: var(--red); }

.success {
  background: var(--bg-2);
  color: var(--green);
  border: 1px solid var(--green);
  border-left-width: 3px;
  border-radius: 0;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-family: var(--mono);
  font-size: 12px;
}
body.light-theme .success { background: var(--bg-2); color: var(--green); }

/* ---------- FILTERS ------------------------------------- */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.filters select {
  padding: 7px 12px;
  border: 1px solid var(--line-hot);
  border-radius: 0;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}
body.light-theme .filters select { background: var(--bg-2); border-color: var(--line); color: var(--ink); }

/* ---------- EXCLUDE PRESETS ----------------------------- */
.exclude-presets { display: flex; flex-direction: column; gap: 6px; }
.exclude-presets label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 9px 12px;
  border: 1px solid var(--line-hot);
  border-radius: 0;
  cursor: pointer;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  background: transparent;
  transition: border-color .15s, background .15s;
}
.exclude-presets label:hover { border-color: var(--ember); background: var(--bg-3); }
.exclude-presets input[type=checkbox] { margin-top: 3px; flex-shrink: 0; }
.exclude-presets .preset-name {
  font-weight: 600;
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.exclude-presets .preset-desc {
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.4;
  font-family: var(--mono);
  text-transform: none;
  letter-spacing: 0;
}
body.light-theme .exclude-presets .preset-name { color: var(--ink); }
body.light-theme .exclude-presets .preset-desc { color: var(--ink-faint); }

/* ---------- STORAGE FIELDS ------------------------------ */
.storage-fields {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 0;
}
body.light-theme .storage-fields { background: var(--bg); border-color: var(--line); }

.storage-info {
  background: transparent;
  border: 1px solid var(--line-hot);
  border-left: 3px solid var(--ember);
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 0;
}
.storage-info strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ember);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
body.light-theme .storage-info strong { color: var(--ember); }

.storage-info p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-dim);
  font-family: var(--mono);
}
body.light-theme .storage-info p { color: var(--ink-dim); }

.storage-hint {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: var(--ink-faint);
  font-family: var(--mono);
}
body.light-theme .storage-hint { color: var(--ink-faint); }

/* ---------- SCHEDULE SUMMARY ---------------------------- */
#scheduleSummary,
#editScheduleSummary,
#createScheduleSummary {
  background: transparent !important;
  padding: 12px 14px !important;
  border-radius: 0 !important;
  border: 1px solid var(--line-hot) !important;
  border-left: 3px solid var(--ember) !important;
  color: var(--ink) !important;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 13px;
}
#createScheduleSummaryText,
#editScheduleSummaryText {
  color: var(--ink) !important;
  font-family: var(--mono);
  font-size: 12px;
}
body.light-theme #createScheduleSummaryText,
body.light-theme #editScheduleSummaryText { color: var(--ink) !important; }

/* ---------- BROWSE / FILES ------------------------------ */
.browse-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.browse-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.browse-controls input[type="text"] {
  padding: 8px 12px;
  border: 1px solid var(--line-hot);
  border-radius: 0;
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}
.browse-controls input[type="text"]:focus { border-color: var(--ember); outline: none; }

.files-list {
  max-height: 500px;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 6px;
}
.files-list-main {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 6px;
  max-height: calc(100vh - 350px);
  overflow-y: auto;
}
body.light-theme .files-list,
body.light-theme .files-list-main { background: var(--bg-2); border-color: var(--line); }

.file-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 0;
  margin: 12px 0;
  font-family: var(--mono);
  font-size: 12px;
}
body.light-theme .file-breadcrumb { background: var(--bg-2); border-color: var(--line); }

.breadcrumb-item {
  cursor: pointer;
  color: var(--ember);
  padding: 3px 8px;
  border-radius: 0;
  transition: background .15s;
}
.breadcrumb-item:hover { background: var(--ember-glow); color: var(--ember); }

.breadcrumb-separator {
  color: var(--ink-faint);
  margin: 0 2px;
}

.file-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: transparent;
  border-radius: 0;
  margin-bottom: 2px;
  cursor: pointer;
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  font-family: var(--mono);
  transition: background .1s;
}
body.light-theme .file-item { background: transparent; }

.file-item:hover { background: var(--bg-3); }
.file-item.selected { background: var(--bg-3); border-left-color: var(--ember); }

.file-item.folder-item { border-left-color: var(--ember-glow); }
.file-item.folder-item .file-name { color: var(--ember); }
body.light-theme .file-item.folder-item .file-name { color: var(--ember); }

.file-item input[type="checkbox"] { cursor: pointer; width: 14px; height: 14px; }

.file-icon { font-size: 13px; color: var(--ink-dim); }
.file-name {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 12px;
  color: var(--ink);
}
body.light-theme .file-name { color: var(--ink); }

.file-size {
  color: var(--ink-faint);
  font-size: 11px;
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ---------- RESTORE ------------------------------------- */
.restore-dest-fields { margin-top: 16px; }
.restore-dest-fields .storage-info {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid var(--line-hot);
  border-left: 3px solid var(--ember);
  border-radius: 0;
}
.restore-dest-fields .storage-info strong { font-size: 11px; color: var(--ember); }
.restore-dest-fields .storage-info p { font-size: 12px; margin: 5px 0 0 0; color: var(--ink-dim); }
body.light-theme .restore-dest-fields .storage-info { background: transparent; }
body.light-theme .restore-dest-fields .storage-info p { color: var(--ink-dim); }

/* ---------- WEEKDAY CHECKBOX PILLS ---------------------- */
.weekday-pill {
  cursor: pointer;
  padding: 6px 11px;
  border: 1px solid var(--line-hot);
  border-radius: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
  transition: border-color .15s, color .15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.weekday-pill:hover { border-color: var(--ember); color: var(--ink); }
.weekday-pill input[type="checkbox"] { margin: 0; }
.weekday-pill:has(input:checked) { border-color: var(--ember); color: var(--ember); }

/* ---------- LINK BASE ----------------------------------- */
a { color: var(--ember); text-decoration: none; }
a:hover { color: var(--ember-deep); }
body.light-theme a { color: var(--ember); }
body.light-theme a:hover { color: var(--ember-deep); }

/* ---------- VERIFICATION HISTORY (G1-1) ----------------- */
.verify-history { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 6px; }
.verify-history th {
  text-align: left; font-weight: 600; color: var(--ink-faint);
  padding: 4px 8px; border-bottom: 1px solid var(--line-hot);
  text-transform: uppercase; letter-spacing: 0.04em; font-size: 10px;
}
.verify-history td { padding: 5px 8px; border-bottom: 1px solid var(--line-hot); vertical-align: top; }
.verify-history tr:last-child td { border-bottom: none; }
.verify-history .verify-detail { color: var(--red); word-break: break-word; max-width: 280px; }

/* ---------- RPO / backup-freshness indicator (G1-2) ----- */
.rpo { font-weight: 600; }
.rpo-ok   { color: var(--green); }
.rpo-warn { color: var(--warn); }
.rpo-bad  { color: var(--red); }
.rpo-none { color: var(--ink-faint); font-style: italic; }

/* ---------- SCROLLBAR ----------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line-hot); border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
