:root { --kit-bg: #14171c; }

body { background: var(--kit-bg); }

.navbar { background: #1b1f26; }
.card { background: #1f232b; border-color: #2c313b; transition: border-color .12s, background .12s; }
a.card:hover { border-color: #4c6ef5; background: #242933; }

.qr-badge {
  width: 44px; height: 44px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 8px; font-weight: 700; font-size: 15px;
  color: #fff; background: linear-gradient(180deg, #818cf8, #4f46e5);
}

.qr-stage {
  background: #0f1216; border: 1px solid #2c313b; border-radius: 12px; min-height: 320px;
}
#q-canvas { max-width: 100%; height: auto; background: #fff; border-radius: 8px; }

.form-control, .form-select { background: #171b21; border-color: #2c313b; color: #e7ebf1; }
.form-control:focus, .form-select:focus { background: #171b21; border-color: #4c6ef5; color: #e7ebf1; box-shadow: none; }
code { color: #9ab6ff; }

/* ---- theme builder: live browser mockup ---- */
/* keep the live preview pinned in view while the (taller) controls column scrolls;
   only in the two-column lg+ layout -- on stacked mobile it stays in normal flow */
@media (min-width: 992px) {
  .tb-preview-sticky { position: sticky; top: 1rem; }
}
.tb-window {
  border: 1px solid #2a2f3a;
  border-radius: 10px;
  overflow: hidden;
  font-size: 13px;
  user-select: none;
}
.tb-frame { background: var(--tb-frame, #001028); padding: 8px 8px 0; }
.tb-tabstrip { display: flex; align-items: flex-end; gap: 4px; }
.tb-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: 8px 8px 0 0;
  color: var(--tb-tab-bg-text, #8a9ab4);
  max-width: 190px; white-space: nowrap; overflow: hidden;
}
.tb-tab-active { background: var(--tb-toolbar, #0a1834); color: var(--tb-tab-text, #f8f8f8); }
.tb-tab-title { overflow: hidden; text-overflow: ellipsis; }
.tb-favicon { width: 14px; height: 14px; border-radius: 4px; background: var(--tb-ntp-link, #0858f8); flex: 0 0 14px; }
.tb-favicon.alt { background: #e0533d; }
.tb-favicon.alt2 { background: #35b46b; }
.tb-newtab { color: var(--tb-tab-bg-text, #8a9ab4); padding: 6px 10px; }
.tb-toolbar {
  background: var(--tb-toolbar, #0a1834);
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  color: var(--tb-icon, #c6d4ea);
}
.tb-btn { opacity: .9; }
.tb-omnibox {
  flex: 1; background: var(--tb-omni, #061228); color: var(--tb-omni-text, #f2f6fc);
  border-radius: 999px; padding: 6px 14px; font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tb-bookmarks {
  background: var(--tb-toolbar, #0a1834);
  color: var(--tb-bookmark, #dbe3ee);
  display: flex; gap: 16px; padding: 6px 14px 9px; font-size: 12px;
  border-bottom: 1px solid rgba(0,0,0,.25);
}
.tb-ntp {
  background: var(--tb-ntp, #001028); color: var(--tb-ntp-text, #f8f8f8);
  padding: 34px 16px 40px; text-align: center;
}
.tb-ntp-logo { font-size: 30px; font-weight: 700; letter-spacing: -.5px; margin-bottom: 16px; }
.tb-ntp-search {
  background: var(--tb-omni, #061228); color: var(--tb-omni-text, #f2f6fc);
  border-radius: 999px; padding: 9px 18px; max-width: 380px; margin: 0 auto 16px;
  font-size: 12.5px; opacity: .95;
}
.tb-ntp-links { font-size: 12px; }
.tb-ntp-links span { color: var(--tb-ntp-link, #0858f8); }
.tb-thumb { width: 54px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid #2a2f3a; }
.tb-thumb-sm { width: 24px; height: 24px; }
.tb-frame { background-image: var(--tb-frame-img, none); background-repeat: repeat-x; background-position: top left; background-size: auto 100%; }
.tb-ntp { background-image: var(--tb-ntp-img, none); background-size: cover; background-position: var(--tb-ntp-pos, center); }

/* ---- brand wordmark: match the logo ----
   The mark's lettering is a heavy, tightly-tracked lowercase sans in off-white,
   sitting above three rounded dashes that fade blue -> slate -> grey. The text
   beside it now uses the same weight/tracking/colour, and the dashes are echoed
   as an underline in the logo's own sampled colours (#0757f3 / #4d65b8 / #7486a2). */
.brand-word {
  position: relative;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.05;
  color: #f2f5fa;
  padding-bottom: 8px;
}
.brand-word .brand-tld { color: #7f93b4; font-weight: 700; }
.brand-word::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(to right,
    #0757f3 0 30%,
    transparent 30% 35%,
    #4d65b8 35% 64%,
    transparent 64% 69%,
    #7486a2 69% 98%,
    transparent 98% 100%);
}
.navbar-brand:hover .brand-word { color: #ffffff; }
.navbar-brand:hover .brand-word .brand-tld { color: #9db2d4; }
/* inactive tabs can carry an alpha image that lets the frame show through */
.tb-tab:not(.tb-tab-active) {
  background-image: var(--tb-tab-img, none);
  background-size: cover; background-position: center;
}

/* ---- Thunderbird theme builder: mock mail window ----
   The chrome (frame / tabs / toolbar / folder pane / search) is driven by the
   theme CSS vars. The message list + reading pane are drawn on a fixed neutral
   "content" surface, because a Thunderbird theme does NOT recolour those -- they
   follow Thunderbird's own light/dark content setting. */
.tbx-window {
  border: 1px solid #2a2f3a; border-radius: 10px; overflow: hidden;
  font-size: 12.5px; user-select: none; background: var(--tbx-frame, #1c2130);
}
.tbx-header {
  display: flex; align-items: center; gap: 12px; padding: 5px 10px;
  font-size: 11px; color: var(--tbx-toolbar-text, #e6eaf2);
  background-color: var(--tbx-frame, #1c2130);
  background-image: var(--tbx-frame-img, none);
  background-size: auto 100%; background-repeat: repeat-x; background-position: top center;
}
.tbx-menu { opacity: .85; }
.tbx-winbtns { opacity: .6; letter-spacing: 1px; }
.tbx-tabs {
  display: flex; align-items: flex-end; gap: 3px; padding: 6px 8px 0;
  background-color: var(--tbx-frame, #1c2130);
  background-image: var(--tbx-frame-img, none);
  background-size: auto 100%; background-repeat: repeat-x; background-position: top center;
}
.tbx-tab {
  padding: 5px 12px; border-radius: 7px 7px 0 0; font-size: 11.5px;
  color: var(--tbx-tab-bg-text, #9aa6bf); display: flex; align-items: center; gap: 5px;
}
.tbx-tab-active {
  background: var(--tbx-tab-sel, #2f3750); color: var(--tbx-tab-text, #fff);
  box-shadow: inset 0 2px 0 var(--tbx-tab-line, #5b9dff);
}
.tbx-newtab { color: var(--tbx-tab-bg-text, #9aa6bf); padding: 4px 6px; font-size: 14px; }
.tbx-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--tbx-toolbar, #252b3b); color: var(--tbx-toolbar-text, #e6eaf2);
}
.tbx-btn { font-size: 11.5px; opacity: .95; white-space: nowrap; }
.tbx-flex { flex: 1; }
.tbx-search {
  min-width: 150px; padding: 4px 9px; border-radius: 6px; font-size: 11px;
  background: var(--tbx-field, #1a1f2c); color: var(--tbx-field-text, #e6eaf2);
  border: 1px solid var(--tbx-field-border, #3a4155); opacity: .95;
}
.tbx-body { display: flex; min-height: 300px; }
.tbx-folders {
  flex: 0 0 158px; padding: 8px 6px;
  background-color: var(--tbx-sidebar, #1e2431);
  background-image: var(--tbx-sidebar-img, none);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  color: var(--tbx-sidebar-text, #cdd6e6); border-right: 1px solid var(--tbx-sidebar-border, #2b3345);
}
.tbx-account { font-size: 10.5px; opacity: .7; padding: 3px 8px 6px; text-transform: none; }
.tbx-folder {
  display: flex; align-items: center; justify-content: flex-start; gap: 6px;
  padding: 5px 8px; border-radius: 6px; margin-bottom: 1px; font-size: 12px;
}
.tbx-folder-sel {
  background: var(--tbx-sidebar-hl, #3b82f6); color: var(--tbx-sidebar-hl-text, #fff);
}
.tbx-ficon { display: inline-block; width: 1.05em; text-align: center; }
.tbx-ficon-img {
  width: 1.15em; height: 1.15em; background-size: contain; background-repeat: no-repeat;
  background-position: center; color: transparent; vertical-align: -0.2em;
}
.tbx-count {
  font-size: 10px; opacity: .85; background: rgba(255,255,255,.18);
  border-radius: 9px; padding: 0 6px; margin-left: auto;
}
/* content surface -- deliberately NOT themed */
.tbx-main { flex: 1; display: flex; flex-direction: column; background: #ffffff; color: #1b1f24; min-width: 0; }
.tbx-list { border-bottom: 1px solid #e3e6ea; }
.tbx-list-head, .tbx-msg {
  display: grid; grid-template-columns: 1fr 110px 66px; gap: 8px;
  padding: 5px 10px; font-size: 11.5px;
}
.tbx-list-head { color: #6b7280; border-bottom: 1px solid #e3e6ea; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.tbx-msg span:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbx-msg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbx-msg-sel { background: #dbeafe; }
.tbx-reading { flex: 1; padding: 12px 14px; }
.tbx-read-subject { font-size: 14px; font-weight: 700; }
.tbx-read-meta { font-size: 11px; color: #6b7280; margin-top: 2px; }
.tbx-read-body { margin-top: 10px; font-size: 12.5px; line-height: 1.5; color: #333a44; }
.tbx-read-body p { margin: 0 0 8px; }

/* preset gallery -- each swatch is a tiny themed-window preview */
.tbx-preset {
  display: flex; flex-direction: column; align-items: stretch; gap: 4px;
  width: 92px; padding: 0 0 4px; background: transparent;
  border: 1px solid #2a2f3a; border-radius: 8px; cursor: pointer;
}
.tbx-preset:hover { border-color: #4b5566; }
.tbx-preset:focus-visible { outline: 2px solid #5b9dff; outline-offset: 1px; }
.tbx-preset-mock { position: relative; display: block; height: 52px; border-radius: 7px 7px 0 0; overflow: hidden; }
.tbx-preset-bar { position: absolute; top: 0; left: 0; right: 0; height: 12px; }
.tbx-preset-line { position: absolute; top: 12px; left: 0; right: 0; height: 2px; }
.tbx-preset-side { position: absolute; top: 14px; bottom: 0; left: 0; width: 34%; }
.tbx-preset-hl { position: absolute; top: 7px; left: 4px; right: 4px; height: 8px; border-radius: 2px; }
.tbx-preset-name { font-size: 11px; color: #aab2c0; text-align: center; }

/* ---- XFCE theme builder: GTK window mock preview ---- */
.xfx-window {
  border: 1px solid var(--xfx-border, #16241d); border-radius: 8px; overflow: hidden;
  background: var(--xfx-bg, #263a2e); color: var(--xfx-fg, #e8f0ea);
  font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.xfx-titlebar { display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--xfx-titlebar, #2b4033); border-bottom: 1px solid var(--xfx-border, #16241d); }
.xfx-wtitle { font-weight: 600; }
.xfx-flex { flex: 1; }
.xfx-wbtns { display: flex; gap: 6px; }
.xfx-wbtn { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px; font-size: 11px; background: rgba(127,127,127,.18); }
.xfx-menubar { display: flex; gap: 14px; padding: 5px 12px; background: var(--xfx-bg);
  border-bottom: 1px solid var(--xfx-border); color: var(--xfx-muted); font-size: 12px; }
.xfx-body { display: flex; min-height: 220px; }
.xfx-sidebar { width: 150px; background: var(--xfx-base); border-right: 1px solid var(--xfx-border); padding: 8px 6px; }
.xfx-side-head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--xfx-muted); padding: 4px 8px; }
.xfx-side-row { padding: 5px 8px; border-radius: 6px; margin-bottom: 1px; }
.xfx-side-sel { background: var(--xfx-accent); color: var(--xfx-accent-fg); }
.xfx-content { flex: 1; padding: 14px 16px; background: var(--xfx-bg); }
.xfx-h { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.xfx-p { color: var(--xfx-muted); font-size: 12px; margin-bottom: 12px; }
.xfx-label { display: block; font-size: 12px; color: var(--xfx-muted); margin-bottom: 4px; }
.xfx-entry { width: 100%; padding: 6px 9px; border-radius: 6px; border: 1px solid var(--xfx-border);
  background: var(--xfx-base); color: var(--xfx-fg); margin-bottom: 12px; }
.xfx-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; }
.xfx-box { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--xfx-border);
  background: var(--xfx-base); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: transparent; }
.xfx-box-on { background: var(--xfx-accent); border-color: var(--xfx-accent); color: var(--xfx-accent-fg); }
.xfx-btnrow { display: flex; gap: 8px; margin-top: 14px; }
.xfx-btn { padding: 6px 14px; border-radius: 6px; border: 1px solid var(--xfx-border);
  background: var(--xfx-titlebar); color: var(--xfx-fg); font-size: 12px; cursor: default; }
.xfx-btn-accent { background: var(--xfx-accent); border-color: var(--xfx-accent); color: var(--xfx-accent-fg); }
.xfx-panel { display: flex; align-items: center; gap: 10px; padding: 5px 10px;
  background: var(--xfx-titlebar); border-top: 1px solid var(--xfx-border); font-size: 12px; color: var(--xfx-muted); }
.xfx-panel-item { padding: 2px 6px; border-radius: 4px; }
.xfx-panel-active { background: var(--xfx-accent); color: var(--xfx-accent-fg); }
.xfx-preset { display: inline-flex; width: 54px; height: 30px; padding: 0; border: 1px solid #2a2f3a;
  border-radius: 6px; overflow: hidden; cursor: pointer; }
.xfx-preset span { flex: 1; }
