/* ========== Theme Definitions ========== */

/* 1. Light Theme (Default/Fall-back) */
:root, [data-theme="light"] {
  --bg: #faf7f2;
  --bg-alt: #f2ede3;
  --surface: #ffffff;
  --ink: #0f0f0f;
  --ink-soft: #3a3a3a;
  --muted: #6b6b6b;
  --line: #e6e1d6;
  --accent: #ff4d3d;
  --accent-ink: #ffffff;
  --accent-soft: #ffe8e5;
  
  /* Added Missing Variables */
  --maxw: 1200px;
  --font-display: 'Fraunces', serif;
  --font-body: 'Geist', sans-serif;
  --font-mono: 'Geist Mono', monospace;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

/* 2. Dark Theme */
[data-theme="dark"] {
  --bg: #0e0d0b;
  --bg-alt: #18161f;
  --surface: #16141a;
  --ink: #f5f1ea;
  --ink-soft: #d6d0c4;
  --muted: #9a958b;
  --line: #2a2730;
  --accent: #ff6a5c;
  --accent-ink: #120404;
  --accent-soft: #3a1b17;
}

/* 3. Cyber Mode (Neon/High Contrast) */
[data-theme="cyber"] {
  --bg: #050505;
  --bg-alt: #0a0a0f;
  --surface: #000000;
  --ink: #00ffcc; /* Neon Cyan */
  --ink-soft: #00ccaa;
  --muted: #006655;
  --line: #00ffcc44;
  --accent: #bc00ff; /* Neon Purple */
  --accent-ink: #ffffff;
  --accent-soft: #bc00ff22;
  --shadow-lg: 0 0 20px rgba(0, 255, 204, 0.2);
  --font-body: 'Geist Mono', monospace; /* Force mono for cyber feel */
}

/* 4. Device/System Mode Logic */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    /* Copy variables from [data-theme="dark"] here to auto-switch */
    --bg: #0e0d0b;
    --bg-alt: #18161f;
    --surface: #16141a;
    --ink: #f5f1ea;
    --ink-soft: #d6d0c4;
    --muted: #9a958b;
    --line: #2a2730;
    --accent: #ff6a5c;
    --accent-ink: #120404;
    --accent-soft: #3a1b17;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent); color: var(--accent-ink); }

a { color: var(--ink); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--accent); }

img, svg { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 28px; }

/* ========== Header ========== */
.site-header {
  position: sticky; 
  top: 0; 
  z-index: 50;
  background: rgba(255, 255, 255, 0.88); 
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px); 
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 24px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.logo-mark {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--ink); color: var(--bg);
  font-family: var(--font-mono); font-weight: 700; font-size: 14px;
  letter-spacing: -.02em;
  transform: rotate(-4deg);
}
.logo:hover .logo-mark { background: var(--accent); color: var(--accent-ink); transform: rotate(4deg); }

.main-nav { display: flex; gap: 28px; }
.main-nav a { font-weight: 500; font-size: 15px; color: var(--ink-soft); position: relative; }
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--accent); transition: width .22s ease;
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  display: inline-grid; place-items: center; transition: all .18s ease;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

.menu-toggle { display: none; }

@media (max-width: 860px) {
  .main-nav { display: none; position: absolute; top: 72px; left: 0; right: 0; background: var(--surface); flex-direction: column; padding: 20px 28px; border-bottom: 1px solid var(--line); }
  .main-nav.open { display: flex; }
  .menu-toggle { display: inline-grid; }
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px;
  padding: 14px 24px; font-family: inherit; font-weight: 600; font-size: 15px;
  cursor: pointer; transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
  text-decoration: none;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--ink); color: var(--bg); }
.btn-lg { padding: 18px 32px; font-size: 16px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ========== Hero ========== */
.hero {
  padding: 96px 0 72px;
  position: relative; overflow: hidden;
}
.hero-grid {
  display: grid; grid-template-columns: 1.3fr .9fr; gap: 72px; align-items: end;
}
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
}
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(42px, 7vw, 86px);
  line-height: .98;
  letter-spacing: -.03em;
  margin: 24px 0 28px;
  font-variation-settings: "SOFT" 40, "WONK" 0;
}
.hero h1 em {
  font-style: italic; color: var(--accent);
  font-variation-settings: "SOFT" 100, "WONK" 1;
}
.hero-lede { font-size: 19px; color: var(--ink-soft); max-width: 56ch; margin-bottom: 36px; }

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-meta {
  display: flex; flex-wrap: wrap; gap: 28px;
  margin-top: 56px; padding-top: 28px; border-top: 1px dashed var(--line);
}
.hero-meta-item .n { font-family: var(--font-display); font-size: 32px; letter-spacing: -.02em; }
.hero-meta-item .l { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.hero-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-md);
  transform: rotate(1.2deg);
  position: relative;
}
.hero-card::before {
  content: ""; position: absolute; inset: -14px; border-radius: calc(var(--radius-lg) + 14px);
  background: repeating-linear-gradient(45deg, transparent 0 7px, var(--line) 7px 8px);
  z-index: -1; transform: rotate(-2.4deg);
}
.hero-card h3 { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.hero-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.hero-card li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-soft); padding: 10px 12px; border-radius: 10px; background: var(--bg); }
.hero-card li strong { color: var(--ink); font-weight: 600; }
.hero-card li .tag { margin-left: auto; font-family: var(--font-mono); font-size: 10px; padding: 3px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }

/* ========== Sections ========== */
.section { padding: 96px 0; }
.section-head { margin-bottom: 56px; max-width: 760px; }
.section-eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.section-head h2 { font-family: var(--font-display); font-size: clamp(32px, 4.5vw, 52px); line-height: 1.02; letter-spacing: -.025em; font-weight: 500; margin: 0 0 16px; }
.section-head p { font-size: 18px; color: var(--ink-soft); max-width: 60ch; }

/* ========== Search ========== */
.search-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--surface); box-shadow: var(--shadow-sm);
  max-width: 520px;
}
.search-wrap:focus-within { border-color: var(--ink); }
.search-wrap input {
  flex: 1; border: none; outline: none; background: transparent; color: var(--ink);
  font-family: inherit; font-size: 15px;
}
.search-wrap .kbd {
  font-family: var(--font-mono); font-size: 11px; padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 6px; color: var(--muted);
}

/* ========== Tool grid ========== */
.tools-filter {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px;
}
.chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit; color: var(--ink-soft);
  transition: all .18s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px;
}
.tool-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 14px; min-height: 180px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  overflow: hidden;
}
.tool-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px circle at var(--x,50%) var(--y,50%), var(--accent-soft), transparent 40%);
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.tool-card:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: var(--shadow-md); }
.tool-card:hover::after { opacity: 1; }
.tool-card .icon {
  width: 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--bg-alt); color: var(--ink);
}
.tool-card .icon svg { width: 22px; height: 22px; }
.tool-card h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -.01em; margin: 0; }
.tool-card p { font-size: 14px; color: var(--muted); margin: 0; flex: 1; }
.tool-card .meta {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.tool-card .meta .arrow { transition: transform .2s ease; }
.tool-card:hover .meta .arrow { transform: translateX(4px); color: var(--accent); }

/* ========== Feature strip ========== */
.feat-strip {
  background: var(--ink); color: var(--bg);
  border-radius: var(--radius-lg); padding: 56px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 40px;
}
[data-theme="dark"] .feat-strip { background: var(--accent); color: var(--accent-ink); }
.feat-strip .item .n {
  font-family: var(--font-display); font-size: 56px; line-height: 1; letter-spacing: -.03em;
  font-weight: 400;
}
.feat-strip .item .n em { color: var(--accent); font-style: normal; }
[data-theme="dark"] .feat-strip .item .n em { color: var(--ink); }
.feat-strip .item h4 { font-size: 17px; font-weight: 600; margin: 14px 0 6px; }
.feat-strip .item p { font-size: 14px; opacity: .75; margin: 0; }

/* ========== How it works ========== */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; min-height: 200px;
}
.step .num {
  font-family: var(--font-display); font-size: 72px; line-height: 1;
  color: var(--accent); opacity: .22; position: absolute; top: 12px; right: 20px; letter-spacing: -.03em;
}
.step h4 { font-family: var(--font-display); font-size: 22px; font-weight: 500; margin: 0 0 12px; }
.step p { color: var(--muted); font-size: 15px; margin: 0; }

/* ========== FAQ ========== */
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: 22px 26px;
  font-weight: 600; font-size: 17px; display: flex; justify-content: space-between; gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-mono); color: var(--accent); font-size: 22px; }
.faq-item[open] summary::after { content: "−"; }
.faq-item > div { padding: 0 26px 22px; color: var(--ink-soft); font-size: 15px; }

/* ========== Footer ========== */
.site-footer {
  background: var(--bg-alt); border-top: 2px solid var(--line);
  padding: 34px 0 32px; margin-top: 80px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand p { color: var(--muted); font-size: 14px; max-width: 34ch; margin: 16px 0 0; }
.footer-col h5 { font-family: var(--font-mono); font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14px; color: var(--ink-soft); }
/* 1. The Main Bottom Bar Layout (Using Grid for perfect centering) */
.footer-bottom {
  margin-top: 25px; 
  padding-top: 24px; 
  border-top: 2px solid var(--line, #e0dbcd);
  display: grid; 
  grid-template-columns: 1fr auto 1fr; /* 1fr sides, auto center */
  align-items: center; 
  gap: 16px; 
  font-size: 13px; 
  color: var(--muted, #888);
}

.footer-bottom a { 
  color: var(--muted, #888); 
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-bottom a:hover {
  color: #1a1a1a;
}

/* 2. Positioning the 3 columns */
.footer-copyright {
  justify-self: start; /* Pushes to far left */
}

.footer-social {
  justify-self: center; /* Locks dead center */
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0;
  margin: 0;
}

.footer-designer {
  justify-self: end; /* Pushes to far right */
}

/* 3. The Social Icons */
.footer-bottom .social-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 36px; 
  height: 36px;
  background-color: transparent;
  border: 1px solid var(--line, #e0dbcd);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.footer-bottom .social-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  opacity: 0.7; 
  transition: opacity 0.3s ease;
}

/* 4. Social Hover Effects */
.footer-bottom .social-icon:hover {
  transform: translateY(-3px); 
  background-color: rgba(0, 0, 0, 0.03); 
}

.footer-bottom .social-icon:hover img {
  opacity: 1; 
}

/* 5. Mobile Responsiveness */
@media (max-width: 768px) {
  .footer-bottom {
    grid-template-columns: 1fr; /* Stacks into a single column */
    text-align: center;
    gap: 20px;
    padding-bottom: 20px; }

  .footer-copyright, 
  .footer-social, 
  .footer-designer {
    justify-self: center; /* Centers everything on mobile */
  }
}



/* ========== Page headers ========== */
.page-header {
  padding: 72px 0 36px; border-bottom: 1px solid var(--line); background: var(--bg-alt);
}
.page-header h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(36px, 5.5vw, 64px); line-height: 1; letter-spacing: -.025em;
  margin: 0 0 16px;
}
.page-header p { font-size: 18px; color: var(--ink-soft); max-width: 62ch; margin: 0; }

/* ========== Prose / legal ========== */
.prose { max-width: 780px; margin: 56px auto; padding: 0 28px; font-size: 16px; color: var(--ink-soft); }
.prose h2 { font-family: var(--font-display); font-weight: 500; font-size: 30px; letter-spacing: -.02em; margin: 48px 0 16px; color: var(--ink); }
.prose h3 { font-family: var(--font-display); font-weight: 500; font-size: 22px; margin: 32px 0 12px; color: var(--ink); }
.prose p { margin: 0 0 16px; line-height: 1.75; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 8px; line-height: 1.7; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ========== Tool pages ========== */
.tool-shell { padding: 48px 0 96px; }
.tool-shell .layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 40px;
}
@media (max-width: 980px) { .tool-shell .layout { grid-template-columns: 1fr; } }

.tool-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px;
}
.tool-panel h2 { font-family: var(--font-display); font-weight: 500; font-size: 26px; margin: 0 0 8px; }
.tool-panel .hint { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.dropzone { display: block; width: 100%; border: 2px dashed var(--line);  border-radius: var(--radius); padding: 48px 24px;  text-align: center;  cursor: pointer;  background: var(--bg-alt); transition: all .18s ease;}
.dropzone:hover, .dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone strong { display: block; font-family: var(--font-display); font-size: 22px; margin-bottom: 8px; }
.dropzone span { color: var(--muted); font-size: 14px; }
.dropzone input { display: none; }

.file-list { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.file-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg);
}
.file-item .fi-name { flex: 1; font-size: 14px; font-weight: 500; word-break: break-all; }
.file-item .fi-size { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.file-item button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; padding: 4px 8px; }
.file-item button:hover { color: var(--accent); }
.file-item.draggable { cursor: grab; }
.file-item.draggable:active { cursor: grabbing; }

.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--ink-soft); }
.form-row input[type="text"], .form-row input[type="number"], .form-row input[type="email"], .form-row textarea, .form-row select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink); font-family: inherit; font-size: 15px; outline: none;
  transition: border-color .15s ease;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--ink); }
.form-row textarea { resize: vertical; min-height: 160px; font-family: var(--font-mono); font-size: 14px; }
.form-row .help { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 620px) { .form-row-2 { grid-template-columns: 1fr; } }

.actions-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }

.result-box {
  margin-top: 24px; padding: 24px; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--accent);
  display: none;
}
.result-box.show { display: block; }
.result-box.error { background: #ffe9e9; border-color: #d63030; color: #6a0f0f; }
[data-theme="dark"] .result-box.error { background: #3a1515; color: #ffb3b3; }

.tool-sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px;
}
.sidebar-card h4 { font-family: var(--font-display); font-size: 18px; margin: 0 0 10px; }
.sidebar-card p { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.sidebar-card ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sidebar-card li a { font-size: 14px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.sidebar-card li a::before { content: "↗"; color: var(--accent); font-family: var(--font-mono); }
.ad-slot {
  display: grid; place-items: center; min-height: 260px;
  border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; padding: 20px; text-align: center; background: var(--bg-alt);
}

/* ========== Animations ========== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp .6s ease both; }
.stagger > * { animation: fadeUp .6s ease both; }
.stagger > *:nth-child(1) { animation-delay: .03s; }
.stagger > *:nth-child(2) { animation-delay: .08s; }
.stagger > *:nth-child(3) { animation-delay: .13s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .23s; }
.stagger > *:nth-child(6) { animation-delay: .28s; }
.stagger > *:nth-child(7) { animation-delay: .33s; }
.stagger > *:nth-child(8) { animation-delay: .38s; }

/* ========== Toast ========== */
.toast-host { position: fixed; bottom: 24px; right: 24px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px;
  box-shadow: var(--shadow-md); font-size: 14px; animation: fadeUp .3s ease;
}
.toast.error { background: #b01c1c; color: #fff; }

/* ========== Misc ========== */

/* Fixed: Hide mobile logic now ensures element is hidden on mobile while remaining visible on desktop */
@media (max-width: 720px) { 
  .hide-mobile { display: none !important; } 
}

.progress { height: 6px; border-radius: 999px; background: var(--bg-alt); overflow: hidden; margin-top: 14px; display: none; }
.progress.show { display: block; }
.progress .bar { height: 100%; width: 0%; background: var(--accent); transition: width .2s ease; }

.output-preview {
  margin-top: 18px; padding: 20px; background: var(--bg-alt); border-radius: 12px; border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 13px; white-space: pre-wrap; word-break: break-all; color: var(--ink-soft);
  max-height: 340px; overflow: auto;
}

#qr-output canvas, #qr-output img { margin: 24px auto 0; display: block; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; }

.image-preview { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 620px) { .image-preview { grid-template-columns: 1fr; } }
.image-preview figure { margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--bg-alt); }
.image-preview figcaption { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.image-preview img { max-width: 100%; border-radius: 8px; }


/* Styling for when the ad is actually populated */
.ad-slot.active-ad {
  padding: 0; 
  border: none; /* Removes the placeholder dashed line */
  overflow: hidden; /* Forces the video to respect the border-radius */
  display: block; 
  background: transparent;
}

.ad-slot.active-ad video,
.ad-slot.active-ad img {
  width: 100%;
  height: 100%;
  max-height: 600px; /* Optional: enforces the 300x600 ratio */
  object-fit: cover; /* Crops the video to fit perfectly without stretching */
  display: block;
  transition: opacity 0.2s ease;
}

/* Slight dim on hover to indicate it's a clickable link */
.ad-slot.active-ad:hover video,
.ad-slot.active-ad:hover img {
  opacity: 0.85;
}
