@font-face {
  font-family: "RobotoCondensed";
  src: url("/public/fonts/RobotoCondensed-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "RobotoCondensed";
  src: url("/public/fonts/bigshoulderstext-medium.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "BebasDaka";
  src: url("/public/fonts/BebasDaka.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "RobotoCondensed";
  src: url("/public/fonts/RobotoCondensed-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "RobotoCondensed";
  src: url("/public/fonts/RobotoCondensed-Medium.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   NEWFACE — Studio Mono design system
   Warm off-white surfaces, high-contrast ink type,
   a single restrained Moss accent. No glassmorphism,
   no neon glow — just crisp 1px borders and tinted shadows.
   ============================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== DESIGN TOKENS — LIGHT (default) =====
   Legacy variable names are kept as aliases so any inline
   style or injected markup that references them keeps working;
   their VALUES are remapped to the new palette. */
:root {
  /* Brand */
  --ink: #1a1a17;          /* near-black, warm */
  --ink-soft: #3f3d38;
  --paper: #faf9f6;        /* warm cream page */
  --paper-raised: #ffffff; /* cards / surfaces */
  --paper-sunken: #f3f1ea;
  --line: #e7e3d9;         /* hairline borders */
  --line-strong: #d8d3c6;
  --moss: #2f5d43;         /* the one accent */
  --moss-600: #274d37;
  --moss-50: #eef3ee;
  --moss-ink: #1f3d2c;
  --terracotta: #b4532a;   /* sparing use: warnings/lock */
  --ok: #2f7d52;
  --danger: #b4341f;
  --shadow-sm: 0 1px 2px rgba(26, 26, 23, 0.04), 0 1px 1px rgba(26, 26, 23, 0.03);
  --shadow-md: 0 6px 20px -8px rgba(26, 26, 23, 0.12), 0 2px 4px -2px rgba(26, 26, 23, 0.05);
  --shadow-lg: 0 24px 48px -16px rgba(26, 26, 23, 0.18), 0 8px 16px -8px rgba(26, 26, 23, 0.08);
  --radius: 12px;
  --radius-lg: 18px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* ---- Aliases (legacy contract) ---- */
  --gold: var(--moss);
  --gold-glow: rgba(47, 93, 67, 0.18);
  --primary-gradient: linear-gradient(135deg, var(--moss-600), var(--moss));
  --glass-bg: var(--paper-raised);
  --glass-bg-strong: var(--paper-raised);
  --glass-border: var(--line);
  --glass-border-bright: var(--line-strong);
  --glass-shadow: var(--shadow-md);
  --glass-shadow-btn: var(--shadow-sm);
  --glass-blur: blur(0);      /* no glass */
  --glass-blur-sm: blur(0);
  --bg-page: var(--paper);
  --bg-page-grad1: transparent;
  --bg-page-grad2: transparent;
  --bg-overlay: rgba(26, 26, 23, 0.45);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-soft);
  --text-muted: #8c887c;
  --header-bg: var(--paper-raised);
  --header-shadow: var(--shadow-sm);
  --input-bg: var(--paper-raised);
  --input-color: var(--ink);
  --note-head-bg: var(--paper-sunken);
  --note-input-bg: var(--paper-raised);
  --modal-bg: var(--paper-raised);
  --modal-shadow: var(--shadow-lg);
  --sheet-bg: var(--paper-raised);
  --overlay-bg: rgba(26, 26, 23, 0.5);
  --keybar-bg: var(--moss-50);
  --toggle-off-bg: var(--line);
  --tab-bg: transparent;
  --tab-color: var(--ink-soft);
  --btn-outline-color: var(--ink);
  --btn-outline-bg: var(--paper-raised);
  --btn-skip-bg: var(--paper-sunken);
  --processing-bar-bg: var(--paper-sunken);
  --lock-overlay-bg: rgba(250, 249, 246, 0.92);
  --install-card-bg: var(--paper-raised);
  --install-steps-bg: var(--paper-sunken);
  --step-title-color: var(--ink);
  --step-li-color: var(--ink-soft);
  --step-li-b-color: var(--ink);
  --buy-btn-bg: var(--paper-sunken);
  --buy-btn-color: var(--ink-soft);
  --hint-bg: var(--moss-50);
  --hint-color: var(--moss);
  --empty-color: var(--text-muted);
  --logo-img-border: var(--line-strong);
  --notify-sec-bg: var(--paper-sunken);
  --notify-sec-color: var(--ink-soft);
  --gps-btn-bg: var(--paper-sunken);
}

/* ===== DARK — warm charcoal, not blue/purple ===== */
body.dark {
  --ink: #f3f1ea;
  --ink-soft: #c9c5b8;
  --paper: #15140f;         /* warm near-black */
  --paper-raised: #1e1d18;
  --paper-sunken: #25231d;
  --line: #34322b;
  --line-strong: #45423a;
  --moss: #7bbf93;          /* lighter moss for contrast */
  --moss-600: #69b383;
  --moss-50: #1f2a22;
  --moss-ink: #0e1c14;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 56px -16px rgba(0, 0, 0, 0.7), 0 8px 16px rgba(0, 0, 0, 0.45);
  --gold-glow: rgba(123, 191, 147, 0.2);
  --bg-overlay: rgba(0, 0, 0, 0.6);
  --text-muted: #8b877b;
  --bg-page: var(--paper);
  --keybar-bg: #1c241e;
  --hint-bg: #1c241e;
  --hint-color: var(--moss);
  --lock-overlay-bg: rgba(21, 20, 15, 0.94);
  --overlay-bg: rgba(0, 0, 0, 0.6);
}

/* ===== BASE ===== */
html, body { height: 100%; }
body {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
::selection { background: var(--moss); color: #fff; }

/* Headings use the display face */
h1, h2, h3, h4, .ht, .auth-brand h2, .welcome-box h2,
.admin-login-brand h1, .admin-topbar h1 {
  font-family: "Sora", sans-serif;
  letter-spacing: -0.02em;
}

/* ===== ICONS ===== */
.nf-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  stroke-linecap: round; stroke-linejoin: round;
}
.nf-icon-sm { width: 16px; height: 16px; }

/* ============================================================
   HEADER
   ============================================================ */
header,
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: background 0.3s var(--ease);
}
.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}
.hl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-mark {
  width: 34px; height: 34px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}
body.dark .logo-mark { background: var(--moss); color: #0e1c14; }
.ht { font-size: 15px; font-weight: 700; line-height: 1.1; }
.hs { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.header-btns { display: flex; gap: 8px; align-items: center; }

/* Theme toggle — legacy class kept; restyled */
.btn-theme,
#btn-theme {
  background: var(--paper-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  color: var(--ink);
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.1s var(--ease);
}
.btn-theme:hover, #btn-theme:hover { border-color: var(--line-strong); }
.btn-theme:active, #btn-theme:active { transform: scale(0.97); }
.theme-icon { display: flex; align-items: center; justify-content: center; width: 18px; height: 18px; }
.theme-icon .icon-moon { display: none; }
body.dark .theme-icon .icon-sun { display: none; }
body.dark .theme-icon .icon-moon { display: block; }

/* Download buttons */
.btn-header-dl,
#btn-dl, #btn-dl-video, #btn-dl-all {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 6px;
  transition: background 0.18s var(--ease), transform 0.1s var(--ease), opacity 0.18s;
}
.btn-header-dl:hover, #btn-dl:hover, #btn-dl-video:hover, #btn-dl-all:hover {
  background: var(--moss-600);
  border-color: var(--moss-600);
  transform: translateY(-1px);
}
.btn-header-dl:active, #btn-dl:active, #btn-dl-video:active, #btn-dl-all:active { transform: scale(0.98); }
body.dark #btn-dl, body.dark #btn-dl-video, body.dark #btn-dl-all,
body.dark .btn-header-dl { background: var(--moss); color: #0e1c14; border-color: var(--moss); }
#btn-dl-video:disabled {
  background: var(--paper-sunken);
  border-color: var(--line);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}
#btn-install {
  background: var(--paper-sunken);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: none;
  transition: border-color 0.2s var(--ease);
}
#btn-install:hover { border-color: var(--line-strong); }

/* ============================================================
   WALLET BAR — directly under header, sits in the same container
   ============================================================ */
.wallet-bar {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
}
.wallet-guest, .wallet-logged {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
  justify-content: space-between;
}
.wallet-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.wallet-msg strong { color: var(--moss); font-weight: 700; }
.wallet-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.wallet-profile { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wallet-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--paper);
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
body.dark .wallet-avatar { background: var(--moss); color: #0e1c14; }
.wallet-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wallet-name {
  font-size: 14px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wallet-hint { font-size: 11px; color: var(--text-muted); }
.wallet-balance-pill {
  display: flex; flex-direction: column; gap: 1px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  background: var(--moss-50);
  border: 1px solid transparent;
}
.wallet-balance-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--moss); font-weight: 700;
}
.wallet-balance-value {
  font-family: "Sora", sans-serif;
  font-size: 16px; font-weight: 700; color: var(--moss-600);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   BUTTON PRIMITIVES
   ============================================================ */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease), transform 0.1s var(--ease);
}
.btn-ghost:hover { border-color: var(--line-strong); color: var(--ink); background: var(--paper-sunken); }
.btn-ghost:active { transform: scale(0.98); }

.btn-accent-sm {
  background: var(--moss);
  color: #fff;
  border: 1px solid var(--moss);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s var(--ease), transform 0.1s var(--ease);
}
body.dark .btn-accent-sm { background: var(--moss); color: #0e1c14; border-color: var(--moss); }
.btn-accent-sm:hover { background: var(--moss-600); transform: translateY(-1px); }
body.dark .btn-accent-sm:hover { background: #8ccfa0; }
.btn-accent-sm:active { transform: scale(0.98); }

.btn-primary {
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.1s var(--ease);
}
.btn-primary:hover { background: var(--moss-600); border-color: var(--moss-600); transform: translateY(-1px); }
.btn-primary:active { transform: scale(0.99); }
body.dark .btn-primary { background: var(--moss); color: #0e1c14; border-color: var(--moss); }
body.dark .btn-primary:hover { background: #8ccfa0; border-color: #8ccfa0; }

.btn-secondary {
  width: 100%;
  background: var(--paper-raised);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), transform 0.1s var(--ease);
}
.btn-secondary:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn-secondary:active { transform: scale(0.99); }

.btn-outline {
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), transform 0.1s var(--ease);
}
.btn-outline:hover { border-color: var(--ink); }
.btn-outline:active { transform: scale(0.98); }

.btn-red {
  background: var(--paper-raised);
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.18s var(--ease), transform 0.1s var(--ease);
}
.btn-red:hover { background: rgba(180, 52, 31, 0.08); }
.btn-red:active { transform: scale(0.98); }

/* ============================================================
   KEY / INSTALL / MARQUEE STRIPS
   ============================================================ */
.key-bar {
  background: var(--keybar-bg);
  border-bottom: 1px solid var(--line);
  padding: 8px 20px;
  max-width: 1320px;
  margin: 0 auto;
  font-size: 12px;
  color: var(--moss);
  display: flex;
  align-items: center;
  gap: 8px;
}
.key-bar.warning {
  background: #fbf2e6;
  color: var(--terracotta);
}
body.dark .key-bar.warning { background: #2a2018; }
.key-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--moss);
  flex-shrink: 0;
}
.key-bar.warning .key-dot { background: var(--terracotta); }

.install-hint {
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
  line-height: 1;
  padding: 9px 0;
  font-size: 12px;
  color: var(--text-muted);
}
.marquee-text {
  display: inline-block;
  min-width: 100%;
  animation: marquee-rtl 22s linear infinite;
}
@keyframes marquee-rtl {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
}

/* ============================================================
   PREVIEW
   ============================================================ */
.preview-box {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
#canvas,
#video-preview,
#video-render-canvas {
  max-width: 100%;
  max-height: calc(100vh - 200px);
  width: auto; height: auto;
  border-radius: var(--radius);
  display: none;
  margin: auto;
}
#canvas,
#video-preview,
#video-render-canvas {
  box-shadow: var(--shadow-md);
}
.video-hint {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  display: none;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px;
  cursor: pointer;
  text-align: center;
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
  width: 100%;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.empty-state:hover { border-color: var(--ink); background: var(--paper-sunken); }
.empty-icon {
  width: 64px; height: 64px;
  background: var(--paper-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  color: var(--ink-soft);
}
.empty-state:hover .empty-icon { background: var(--paper-raised); }
.empty-title {
  font-family: "Sora", sans-serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
}
.empty-sub { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   CONTROLS PANEL
   ============================================================ */
.controls {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 80px);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 16px;
}
.controls::-webkit-scrollbar { width: 8px; }
.controls::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.controls h2 {
  font-family: "Sora", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.field { margin-bottom: 16px; }
label.lbl {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 6px;
}

/* Form controls */
input[type="text"],
input[type="datetime-local"],
textarea {
  width: 100%;
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
input[type="text"]::placeholder,
textarea::placeholder { color: var(--text-muted); }
textarea { min-height: 64px; line-height: 1.4; resize: vertical; }
input[type="text"]:focus,
input[type="datetime-local"]:focus,
textarea:focus {
  border-color: var(--moss);
  box-shadow: 0 0 0 3px var(--gold-glow);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--moss);
  margin-top: 4px;
  height: 4px;
}

/* Layout helpers used in markup */
.row { display: flex; gap: 8px; align-items: center; }
.row .btn-outline { flex: 1; }
.media-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gps-row { display: flex; gap: 6px; align-items: flex-start; }
.gps-row input, .gps-row textarea { flex: 1; min-width: 0; }
.gps-btn {
  background: var(--paper-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s var(--ease);
}
.gps-btn:hover { border-color: var(--ink); }
.gps-status { font-size: 11px; margin-top: 6px; }
.gps-idle { color: var(--text-muted); }
.gps-loading { color: #3b82c4; }
.gps-ok { color: var(--ok); }
.gps-err { color: var(--danger); }

/* ============================================================
   TEMPLATE TABS
   ============================================================ */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab {
  flex: 1;
  padding: 9px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), color 0.16s var(--ease), transform 0.1s var(--ease);
}
.tab:hover { border-color: var(--ink); color: var(--ink); }
.tab:active { transform: scale(0.98); }
.tab.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
body.dark .tab.active { background: var(--moss); color: #0e1c14; border-color: var(--moss); }

/* ============================================================
   TOGGLES
   ============================================================ */
.toggle-row { display: flex; align-items: center; justify-content: space-between; }
.toggle { position: relative; width: 38px; height: 22px; cursor: pointer; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider-t {
  position: absolute; inset: 0;
  background: var(--line-strong);
  border-radius: 11px;
  transition: background 0.2s var(--ease);
}
.slider-t:before {
  content: ""; position: absolute;
  width: 16px; height: 16px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 0.2s var(--ease);
}
input:checked + .slider-t { background: var(--moss); }
input:checked + .slider-t:before { transform: translateX(16px); }

/* ============================================================
   NOTE TABLE (the key/value editor used by templates)
   ============================================================ */
.note-table {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.note-head {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  background: var(--paper-sunken);
  padding: 7px 10px;
}
.note-head span { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.note-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  border-top: 1px solid var(--line);
}
.note-row input {
  background: var(--paper-raised);
  border: none;
  padding: 9px 10px;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.note-row input:first-child { border-right: 1px solid var(--line); }
.note-row input:focus { box-shadow: inset 0 0 0 2px var(--gold-glow); }

/* Logo preview chip */
.logo-prev { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.logo-prev img {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--line-strong);
}

/* ============================================================
   BATCH STRIP + VIDEO PROCESSING
   ============================================================ */
.processing-bar {
  background: var(--paper-sunken);
  border-radius: 6px;
  height: 6px;
  overflow: hidden;
  margin-top: 6px;
  display: none;
}
.processing-bar-inner {
  height: 100%;
  background: var(--moss);
  border-radius: 6px;
  animation: progress-pulse 1.5s ease-in-out infinite;
}
@keyframes progress-pulse {
  0%, 100% { opacity: 0.6; width: 30%; }
  50% { opacity: 1; width: 80%; }
}

/* ============================================================
   MODALS — auth / deposit / charge / notify
   ============================================================ */
.auth-modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.auth-backdrop {
  position: absolute; inset: 0;
  background: var(--overlay-bg);
}
.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: auth-in 0.35s var(--ease);
}
@keyframes auth-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth-brand .logo-mark { width: 40px; height: 40px; font-size: 14px; }
.auth-brand h2 { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.auth-sub { color: var(--text-muted); font-size: 13px; line-height: 1.45; }
.auth-close {
  position: absolute; right: 14px; top: 14px;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  border-radius: var(--radius-sm);
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.auth-close:hover { color: var(--ink); border-color: var(--line-strong); }
.auth-tabs {
  display: flex; gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  background: var(--paper-sunken);
  border-radius: var(--radius);
}
.auth-tab-btn {
  flex: 1;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.auth-tab-btn.active { background: var(--paper-raised); color: var(--ink); box-shadow: var(--shadow-sm); }

.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-field label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.form-hint { font-size: 11px; color: var(--text-muted); }
.auth-box form .btn-primary { margin-top: 4px; }
.auth-box input[type="text"],
.auth-box input[type="password"],
.auth-box input[type="email"],
.auth-box input[type="number"] {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.auth-box input:focus { border-color: var(--moss); box-shadow: 0 0 0 3px var(--gold-glow); }
.auth-error {
  color: var(--danger); font-size: 13px;
  min-height: 18px; margin-bottom: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: rgba(180, 52, 31, 0.08);
  border: 1px solid rgba(180, 52, 31, 0.2);
}
.auth-error:empty { display: none; padding: 0; margin: 0; border: none; background: none; }
.auth-msg { font-size: 13px; min-height: 18px; margin-top: 12px; padding: 8px 12px; border-radius: var(--radius-sm); }
.auth-msg:empty { display: none; }
.auth-msg.success { color: var(--ok); background: rgba(47, 125, 82, 0.1); border: 1px solid rgba(47, 125, 82, 0.25); }
.auth-msg.error { color: var(--danger); background: rgba(180, 52, 31, 0.08); border: 1px solid rgba(180, 52, 31, 0.2); }

/* Notify modal */
#notify-modal {
  position: fixed; inset: 0;
  background: var(--overlay-bg);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9998;
  padding: 20px;
}
.notify-box {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%; max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: auth-in 0.35s var(--ease);
}
.notify-icon { font-size: 40px; margin-bottom: 12px; }
.notify-box h3 { font-family: "Sora", sans-serif; font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--ink); }
.notify-box p { font-size: 13px; color: var(--ink-soft); white-space: pre-line; line-height: 1.6; margin-bottom: 20px; }
.notify-actions { display: flex; gap: 8px; flex-direction: column; }
.notify-btn-primary {
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 11px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background 0.18s var(--ease);
}
.notify-btn-primary:hover { background: var(--moss-600); border-color: var(--moss-600); }
body.dark .notify-btn-primary { background: var(--moss); color: #0e1c14; border-color: var(--moss); }
.notify-btn-secondary {
  background: var(--paper-sunken); color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.notify-btn-secondary:hover { border-color: var(--line-strong); color: var(--ink); }

/* ============================================================
   LOCK OVERLAY — key activation gate (dynamically injected)
   ============================================================ */
#lock-overlay {
  position: fixed; inset: 0;
  background: var(--lock-overlay-bg);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.lock-box {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  width: 100%; max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.lock-icon { font-size: 44px; margin-bottom: 14px; }
.lock-box h2 { font-family: "Sora", sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.lock-box p { font-size: 13px; color: var(--ink-soft); margin-bottom: 24px; line-height: 1.5; }
.key-input {
  width: 100%;
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--ink);
  font-size: 15px;
  font-family: "Sora", sans-serif;
  outline: none;
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 12px;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.key-input:focus { border-color: var(--moss); box-shadow: 0 0 0 3px var(--gold-glow); }
.key-input::placeholder { letter-spacing: 0; color: var(--text-muted); }
.btn-activate {
  width: 100%;
  background: var(--moss); color: #fff;
  border: 1px solid var(--moss);
  border-radius: var(--radius);
  padding: 13px; font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background 0.18s var(--ease), transform 0.1s var(--ease);
  margin-bottom: 10px;
}
body.dark .btn-activate { background: var(--moss); color: #0e1c14; }
.btn-activate:hover { background: var(--moss-600); transform: translateY(-1px); }
body.dark .btn-activate:hover { background: #8ccfa0; }
.btn-activate:disabled { background: var(--paper-sunken); color: var(--text-muted); border-color: var(--line); cursor: not-allowed; transform: none; }
.btn-buy {
  width: 100%;
  background: var(--paper-sunken);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.btn-buy:hover { border-color: var(--line-strong); color: var(--ink); }
.lock-note { font-size: 11px; color: var(--text-muted); margin-top: 14px; line-height: 1.4; }
.lock-error {
  background: rgba(180, 52, 31, 0.08);
  border: 1px solid rgba(180, 52, 31, 0.25);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 12px;
  display: none;
  line-height: 1.4;
}

/* ============================================================
   WELCOME / INSTALL (dynamically injected)
   ============================================================ */
#welcome-overlay {
  position: fixed; inset: 0;
  background: var(--overlay-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  padding: 20px;
}
.welcome-box {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  width: 100%; max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: wSlideUp 0.4s var(--ease);
}
@keyframes wSlideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.welcome-logo {
  width: 64px; height: 64px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: "Sora", sans-serif;
  font-size: 26px; font-weight: 700;
  margin: 0 auto 18px;
}
body.dark .welcome-logo { background: var(--moss); color: #0e1c14; }
.welcome-box h2 { font-family: "Sora", sans-serif; font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.welcome-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 20px; line-height: 1.5; }
.welcome-badge {
  display: inline-block;
  background: var(--moss-50);
  color: var(--moss);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.pwa-already {
  background: rgba(47, 125, 82, 0.1);
  border: 1px solid rgba(47, 125, 82, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--ok);
  display: none;
  line-height: 1.5;
}
.install-cards { display: flex; gap: 10px; margin-bottom: 16px; }
.install-card {
  flex: 1;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 14px 8px;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), transform 0.12s var(--ease);
  background: var(--paper-raised);
}
.install-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.install-card.active { border-color: var(--ink); box-shadow: var(--shadow-md); }
body.dark .install-card.active, body.dark .install-card:hover { border-color: var(--moss); }
.ic-icon { font-size: 26px; margin-bottom: 5px; }
.ic-title { font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.ic-sub { font-size: 10px; color: var(--text-muted); line-height: 1.4; }
.install-steps {
  background: var(--paper-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  text-align: left;
  display: none;
}
.install-steps.show { display: block; }
.install-steps .step-title { font-family: "Sora", sans-serif; font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.install-steps ol { padding-left: 18px; }
.install-steps li { font-size: 12px; color: var(--ink-soft); margin-bottom: 5px; line-height: 1.5; }
.install-steps li b { color: var(--ink); }
.btn-welcome-main {
  width: 100%; padding: 14px; font-size: 15px; font-weight: 700;
  background: var(--moss); color: #fff;
  border: 1px solid var(--moss);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.18s var(--ease), transform 0.1s var(--ease);
  margin-bottom: 8px;
  font-family: inherit;
}
body.dark .btn-welcome-main { color: #0e1c14; }
.btn-welcome-main:hover { background: var(--moss-600); transform: translateY(-1px); }
body.dark .btn-welcome-main:hover { background: #8ccfa0; }
.btn-welcome-skip {
  width: 100%;
  background: var(--paper-raised);
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.btn-welcome-skip:hover { border-color: var(--line-strong); color: var(--ink); }

/* ============================================================
   CONFETTI
   ============================================================ */
.confetti-piece {
  position: fixed; top: -10px;
  font-size: 20px;
  z-index: 99999;
  animation: fall 4s linear forwards;
}
@keyframes fall {
  to { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* Media-choice sheet (legacy class, kept for compat) */
.media-choice-modal {
  position: fixed; inset: 0;
  background: var(--overlay-bg);
  display: none;
  align-items: flex-start; justify-content: center;
  z-index: 9997;
  padding: 16px;
}
.media-choice-sheet {
  width: 100%; max-width: 420px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-lg);
}
.media-choice-title { font-family: "Sora", sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.media-choice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.media-choice-cancel { margin-top: 8px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .main { grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; padding: 16px; }
  .controls { position: static; max-height: none; }
}
@media (max-width: 860px) {
  .main { display: block; padding: 14px; }
  .preview-box { min-height: 360px; margin-bottom: 16px; padding: 14px; }
  .controls { padding: 16px; }
  #canvas, #video-preview, #video-render-canvas { max-height: 52vh; }
  .empty-state { padding: 40px 14px; }
}
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; padding: 10px 14px; }
  .header-btns { width: 100%; justify-content: flex-end; }
  .wallet-bar { padding: 12px 14px; }
  .wallet-guest, .wallet-logged { flex-direction: column; align-items: stretch; }
  .wallet-actions { justify-content: stretch; }
  .wallet-actions .btn-ghost,
  .wallet-actions .btn-accent-sm { flex: 1; text-align: center; }
  .wallet-balance-pill { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; }
  /* tap targets stay comfortable on mobile */
  .controls input[type="text"],
  .controls input[type="datetime-local"],
  .controls textarea,
  .controls input[type="range"],
  .controls button { font-size: 16px; }
}

/* ============================================================
   Auth refresh - wallet, auth, deposit and charge dialogs
   ============================================================ */
.wallet-bar {
  padding: 10px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.wallet-guest,
.wallet-logged {
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow: var(--shadow-sm);
}

.wallet-msg {
  min-width: 0;
  gap: 10px;
  color: var(--ink-soft);
  font-weight: 650;
}

.wallet-msg .nf-icon {
  width: 18px;
  height: 18px;
  color: var(--moss);
}

.wallet-msg strong {
  display: inline-flex;
  margin-left: 7px;
  padding: 3px 8px;
  border: 1px solid rgba(47, 93, 67, 0.2);
  border-radius: 999px;
  background: var(--moss-50);
  color: var(--moss);
  font-family: "Sora", sans-serif;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.wallet-avatar {
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.wallet-balance-pill {
  border: 1px solid rgba(47, 93, 67, 0.2);
  border-radius: 12px;
}

.auth-modal {
  padding: 18px;
  backdrop-filter: blur(2px);
}

.auth-backdrop {
  background: var(--overlay-bg);
}

.auth-box {
  max-width: 430px;
  padding: 24px;
  border-color: var(--line-strong);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}

.auth-box-auth,
.auth-box-deposit,
.auth-box-charge {
  overflow: hidden;
}

.auth-box::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

body.dark .auth-box::before {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-brand {
  align-items: flex-start;
  margin-bottom: 20px;
  padding-right: 34px;
}

.auth-brand .logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.auth-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--moss);
  font-family: "Sora", sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.auth-brand h2 {
  margin: 0 0 5px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.05;
}

.auth-sub {
  max-width: 34ch;
  color: var(--text-muted);
}

.auth-close {
  right: 16px;
  top: 16px;
  border-radius: 10px;
  background: var(--paper-sunken);
}

.auth-tabs {
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-sunken);
}

.auth-tab-btn {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 800;
}

.auth-tab-btn.active {
  background: var(--paper-raised);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.form-field {
  gap: 7px;
  margin-bottom: 15px;
}

.form-field label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

.form-hint {
  color: var(--text-muted);
  font-size: 11px;
}

.auth-box input[type="text"],
.auth-box input[type="password"],
.auth-box input[type="email"],
.auth-box input[type="number"] {
  min-height: 43px;
  border-radius: 8px;
  background: var(--paper);
  font-weight: 650;
}

.auth-box input:focus {
  border-color: var(--moss);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.auth-error,
.auth-msg {
  border-radius: 8px;
}

.auth-box form .btn-primary {
  margin-top: 6px;
}

.charge-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-sunken);
}

.charge-summary span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.charge-summary strong {
  color: var(--moss);
  font-family: "Sora", sans-serif;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.charge-actions {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  gap: 10px;
}

.charge-actions .btn-primary,
.charge-actions .btn-ghost {
  width: 100%;
}

.notify-box {
  max-width: 390px;
  border-color: var(--line-strong);
  border-radius: 14px;
  text-align: left;
}

.notify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border: 1px solid rgba(47, 93, 67, 0.22);
  border-radius: 12px;
  background: var(--moss-50);
  color: var(--moss);
}

.notify-icon .nf-icon {
  width: 22px;
  height: 22px;
}

@media (max-width: 640px) {
  .wallet-msg {
    align-items: flex-start;
  }

  .wallet-msg strong {
    margin-left: 0;
    margin-top: 6px;
  }

  .auth-box {
    padding: 20px;
  }
}

.wallet-admin-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


/* ===== NEWFACE PREMIUM REDESIGN OVERRIDES ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Be+Vietnam+Pro:wght@500;700;800&display=swap');

:root, body.dark {
  --ink: #f8fafc;
  --ink-soft: #cbd5e1;
  --paper: #020617; /* Deep space dark */
  --paper-raised: rgba(30, 41, 59, 0.6);
  --paper-sunken: rgba(15, 23, 42, 0.5);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --moss: #8b5cf6; /* Vibrant Violet */
  --moss-600: #a78bfa;
  --moss-50: rgba(139, 92, 246, 0.15);
  --moss-ink: #f5f3ff;
  --ok: #10b981;
  --danger: #ef4444;
  --terracotta: #ef4444;
  
  --shadow-sm: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -2px rgba(0,0,0,0.3);
  --shadow-lg: 0 25px 50px -12px rgba(0,0,0,0.7);
  --glass-shadow: 0 8px 32px 0 rgba(0,0,0,0.4);
  --gold-glow: rgba(139, 92, 246, 0.4);
  --primary-gradient: linear-gradient(135deg, #7c3aed, #3b82f6);
  --glass-bg: rgba(30, 41, 59, 0.5);
  --glass-bg-strong: rgba(30, 41, 59, 0.75);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(20px);
  --bg-page: #020617;
  --bg-overlay: rgba(2, 6, 23, 0.8);
  --input-bg: rgba(255, 255, 255, 0.03);
  --modal-bg: rgba(15, 23, 42, 0.75);
  --overlay-bg: rgba(2, 6, 23, 0.85);
  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 10px;
}

/* Global Typography & Background */
body {
  font-family: 'Inter', system-ui, sans-serif !important;
  background-color: var(--paper) !important;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(124, 58, 237, 0.12), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(59, 130, 246, 0.12), transparent 25%) !important;
  background-attachment: fixed !important;
  color: var(--ink) !important;
}
h1, h2, h3, h4, .ht, .auth-brand h2, .admin-login-brand h1, .admin-topbar h1 {
  font-family: 'Be Vietnam Pro', sans-serif !important;
  font-weight: 700 !important;
}

/* Glassmorphism Classes */
header, .app-header, .wallet-bar, .preview-box, .controls, .auth-box, 
.panel, .admin-login-form, .admin-sidebar, .admin-table-wrap, .auth-brand-icon,
.admin-stats > div, .admin-gate-card {
  background: var(--paper-raised) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--glass-shadow) !important;
}

/* Specific component tweaks */
.preview-box {
  background: linear-gradient(145deg, rgba(30,41,59,0.4), rgba(15,23,42,0.6)) !important;
}
header, .app-header, .wallet-bar {
  background: rgba(15, 23, 42, 0.6) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}
.controls {
  background: rgba(30, 41, 59, 0.4) !important;
}

/* Buttons with Glow */
.btn-primary, .btn-accent-sm {
  background: var(--primary-gradient) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3) !important;
  transition: all 0.3s ease !important;
  color: #fff !important;
}
.btn-primary:hover, .btn-accent-sm:hover {
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5) !important;
  transform: translateY(-2px) scale(1.02) !important;
}
.btn-ghost, .btn-outline, .btn-secondary, .gps-btn, .tab {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--ink) !important;
}
.btn-ghost:hover, .btn-outline:hover, .btn-secondary:hover, .gps-btn:hover, .tab:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--moss) !important;
  transform: translateY(-1px) !important;
}
.tab.active {
  background: var(--primary-gradient) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 4px 10px rgba(124, 58, 237, 0.3) !important;
}

/* Inputs */
input[type="text"], input[type="datetime-local"], textarea, input[type="password"], input[type="number"], input[type="email"] {
  background: rgba(0, 0, 0, 0.2) !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--ink) !important;
  backdrop-filter: blur(4px) !important;
  transition: all 0.3s ease !important;
}
input:focus, textarea:focus {
  border-color: var(--moss) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2) !important;
  background: rgba(0, 0, 0, 0.4) !important;
}

/* Empty State */
.empty-state {
  border: 2px dashed rgba(255,255,255,0.1) !important;
  background: rgba(0,0,0,0.2) !important;
}
.empty-state:hover {
  border-color: var(--moss) !important;
  background: rgba(139,92,246,0.05) !important;
}

/* Auth Modal Specifics */
.auth-box, .auth-box-auth {
  background: linear-gradient(135deg, rgba(30,41,59,0.8), rgba(15,23,42,0.9)) !important;
  border: 1px solid rgba(255,255,255,0.15) !important;
}
.auth-brand-icon {
  background: linear-gradient(135deg, #7c3aed, #3b82f6) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4) !important;
}

/* Logo Mark */
.logo-mark {
  background: linear-gradient(135deg, #7c3aed, #3b82f6) !important;
  color: #fff !important;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.4) !important;
  border: none !important;
}

/* Admin Specifics */
.admin-sidebar {
  border-right: 1px solid var(--line) !important;
}
.admin-nav-item.active {
  background: var(--moss-50) !important;
  border-left: 3px solid var(--moss) !important;
  color: var(--moss-600) !important;
}
.admin-table-wrap {
  border-radius: var(--radius-lg) !important;
  overflow: hidden !important;
}
table th {
  background: rgba(0,0,0,0.3) !important;
  color: var(--ink-soft) !important;
}
table tr {
  border-bottom: 1px solid var(--line) !important;
  transition: background 0.2s !important;
}
table tr:hover {
  background: rgba(255,255,255,0.03) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

