/* ═══════════════════════════════════════════════════════════════
   PDF Cowboy — Shared Stylesheet
   Used by index.html and all tool pages.
═══════════════════════════════════════════════════════════════ */

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

/* ─── Variables ─────────────────────────────────────────────── */
:root {
  /* Brand colours */
  --orange:        #E8541A;
  --orange-light:  #F5762E;
  --mesa:          #8B2500;
  --gold:          #F5A623;
  --dark:          #1A0A00;
  --cream:         #FFF8F0;
  --cream-dim:     rgba(255,248,240,0.85);
  --card-bg:       rgba(255,252,248,0.97);
  --shadow:        0 4px 24px rgba(26,10,0,0.18);
  --radius:        12px;
  --radius-lg:     16px;

  /* Tool page UI */
  --bg:            #120700;
  --panel:         #1e0d04;
  --surface:       #2a1208;
  --border:        rgba(245,166,35,0.15);
  --text:          #FFF8F0;
  --muted:         rgba(255,248,240,0.75);
  --accent:        #E8541A;
  --accent2:       #F5A623;
  --success:       #4CAF50;

  /* Typography */
  --font-display:  'Playfair Display', serif;
  --font-ui:       'Inter', sans-serif;
  --font-mono:     'Courier New', Courier, monospace;

  /* ── App backdrop (tool pages) ────────────────────────────
     The landing-page hero, reused behind every tool.
     Dial the two scrim values to taste:
       higher number = darker = less photo showing.
     Set --app-bg-image to none to switch the whole thing off. */
  --app-bg-image:     url('../img/hero.webp');
  --app-bg-position:  center 40%;
  --app-bg-scrim:      0.90;  /* while working — photo sits back */
  --app-bg-scrim-idle: 0.82;  /* empty state  — photo comes forward */
  --app-bg-tint:       10, 4, 0;   /* rgb of --bg-deep */

  /* ── Text size scale ──────────────────────────────────────── */
  --text-2xs:      9px;   /* tiny labels, badges, uppercase caps */
  --text-xs:       10px;  /* meta info, secondary labels, hints  */
  --text-sm:       11px;  /* sidebar content, tool buttons, rows */
  --text-base:     12px;  /* primary UI text, dropzone copy      */
  --text-md:       13px;  /* form inputs, dialog body            */
  --text-lg:       14px;  /* icon buttons, small headings        */
  --text-xl:       15px;  /* dialog headings, result labels      */
  --text-2xl:      16px;  /* toolbar icons, section labels       */
  --text-3xl:      18px;  /* stat values, prominent numbers      */
  --text-4xl:      22px;  /* panel headings                      */
  --text-5xl:      28px;  /* signature display                   */
  --text-icon:     44px;  /* drop zone icons (utilities)         */
  --text-drop:     56px;  /* drop zone icons (standard)          */

  /* ── Border radius scale ─────────────────────────────────── */
  --radius-xs:     3px;   /* scrollbar thumb, tags, tiny chips   */
  --radius-sm:     4px;   /* small buttons, inline inputs        */
  --radius-md:     5px;   /* tool buttons, standard controls     */
  --radius-lg:     6px;   /* cards, panels, dialogs inputs       */
  --radius-xl:     8px;   /* toolbars, larger cards              */
  --radius-2xl:    10px;  /* dialogs, modals                     */
  --radius-full:   50%;   /* circular elements                   */

  /* ── Spacing scale ───────────────────────────────────────── */
  --space-1:       2px;
  --space-2:       4px;
  --space-3:       6px;
  --space-4:       8px;
  --space-5:       10px;
  --space-6:       12px;
  --space-7:       14px;
  --space-8:       16px;
  --space-9:       20px;
  --space-10:      24px;

  /* ── Colour aliases (semantic) ───────────────────────────── */
  --overlay-dark:        rgba(0,0,0,0.5);
  --overlay-darker:      rgba(0,0,0,0.7);
  --overlay-light:       rgba(255,255,255,0.3);
  --overlay-dim:         rgba(0,0,0,0.4);
  --overlay-mid:         rgba(0,0,0,0.6);
  --overlay-modal:       rgba(0,0,0,0.65);
  --gold-subtle:         rgba(245,166,35,0.08);
  --gold-faint:          rgba(245,166,35,0.04);
  --gold-glow:           rgba(245,166,35,0.2);
  --accent-subtle:       rgba(232,84,26,0.08);
  --accent-glow:         rgba(232,84,26,0.3);
  --white:               #ffffff;
  --black:               #000000;
  --bg-deep:             #0a0400;
  --bg-dark:             #1a0800;
}

/* ─── Base ──────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

a { color: var(--accent2); text-decoration: none; }

.site-tile-name,
.site-tile-name:visited { text-decoration: none; color: var(--cream); }
.site-tile-name:hover { text-decoration: none; color: var(--gold); }

/* ─── Suite shell layout ────────────────────────────────────── */
.suite-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 48px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  flex-shrink: 0;
  z-index: 10;
}

.suite-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: var(--cream);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.suite-logo em {
  color: var(--gold);
  font-style: italic;
}

.tool-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(245,166,35,0.12);
  border: 1px solid rgba(245,166,35,0.25);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

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

.suite-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.suite-nav a,
.suite-nav span {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 9px;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.suite-nav a:hover { background: var(--surface); color: var(--text); }
.suite-nav .current { color: var(--gold); font-weight: 600; }

.spacer { flex: 1; }

.suite-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ─── Header buttons ────────────────────────────────────────── */
.hdr-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.hdr-btn:hover { background: var(--panel); border-color: var(--accent2); }
.hdr-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.hdr-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.hdr-btn.primary:hover { background: var(--orange-light); border-color: var(--orange-light); }
.hdr-btn.primary:disabled { background: var(--surface); border-color: var(--border); color: var(--muted); }

.hdr-btn.save { background: rgba(245,166,35,0.15); border-color: rgba(245,166,35,0.3); color: var(--gold); }
.hdr-btn.save:hover { background: rgba(245,166,35,0.25); }

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: 264px;
  min-width: 264px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-section {
  padding: 10px 13px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

/* ─── Form fields ───────────────────────────────────────────── */
.field {
  margin-bottom: 8px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
}

.field input,
.field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 8px;
  border-radius: 5px;
  font-size: 12px;
  font-family: var(--font-ui);
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent2);
}

/* ─── General button ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover { background: var(--panel); border-color: var(--accent2); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--orange-light); }

.btn-ok {
  background: var(--accent2);
  border: none;
  color: #000;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-ui);
}

.btn-cancel {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font-ui);
}

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

/* ─── Dialogs ───────────────────────────────────────────────── */
.dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

.dialog-overlay.open {
  display: flex;
}

.dialog-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  width: 420px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,0.7);
}

.dialog-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* ─── Dialogs ───────────────────────────────────────────────── */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.dialog-overlay.open {
  display: flex;
}

.dialog {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  width: 360px;
  max-width: 95vw;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
  position: relative;
}

.dialog h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.dialog p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 12px;
}

.dialog label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 4px;
  margin-top: 10px;
}

.dialog input[type="text"],
.dialog input[type="number"],
.dialog select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-ui);
  outline: none;
  margin-bottom: 4px;
}

.dialog input:focus,
.dialog select:focus {
  border-color: var(--accent2);
}

.dialog-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* tool-btn used by measure page toolbar */
.tool-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-family: var(--font-ui);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
}

.tool-btn:hover { background: var(--panel); border-color: var(--accent2); }
.tool-btn.active { background: rgba(245,166,35,0.15); border-color: var(--accent2); color: var(--accent2); font-weight: 600; }
.tool-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.status-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  height: 26px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.status-item { display: flex; align-items: center; gap: 5px; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.dot.green  { background: var(--success); }
.dot.orange { background: var(--accent2); }
.dot.red    { background: var(--accent); }

/* ─── Info card ─────────────────────────────────────────────── */
.info-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 11px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
}

.info-row .key { color: var(--muted); }
.info-row .val { font-family: var(--font-mono); font-weight: 600; color: var(--text); }
.info-row .val.accent { color: var(--accent2); }

/* ─── Tier notice ───────────────────────────────────────────── */
.tier-notice {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  background: rgba(245,166,35,0.07);
  border: 1px solid rgba(245,166,35,0.2);
  border-radius: 6px;
  padding: 7px 9px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.tier-notice a { color: var(--gold); }

/* ─── Progress bar ──────────────────────────────────────────── */
.progress-wrap {
  background: var(--surface);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 4px;
  transition: width 0.3s;
}

/* ─── Spinner ───────────────────────────────────────────────── */
.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Utility classes ───────────────────────────────────────── */
.text-sm   { font-size: 11px; }
.text-muted { color: var(--muted); }
.mt-6      { margin-top: 6px; }

/* ─── Scrollbars ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(245,166,35,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(245,166,35,0.4); }

/* ─── Focus ─────────────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ─── Reduced motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE styles (index.html only)
   These override the tool-page body/html rules for the hero.
═══════════════════════════════════════════════════════════════ */

/* Hero */
.hero {
  position: relative;
  height: 100svh;
  max-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding-top: 44px;
}

.hero-bg {
  position: fixed;
  inset: 0;
  background-image: url('../img/hero.webp');
  background-size: cover;
  background-position: center 40%;
  background-color: #8B2500;
  z-index: 0;
}

.hero-overlay {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(26,10,0,0.50) 0%,
      rgba(26,10,0,0.05) 25%,
      rgba(26,10,0,0.40) 55%,
      rgba(26,10,0,0.75) 100%
    );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  margin-top: clamp(1rem, 4vh, 3rem);
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 1.0;
  letter-spacing: -0.01em;
  color: var(--cream);
  margin-bottom: 0.6rem;
}

.hero-title em { font-style: italic; color: var(--gold); }

.hero-tagline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 700;
  color: var(--cream-dim);
  letter-spacing: 0.02em;
}

/* ═══════════════════════════════════════════════════════════════
   SHARED SITE HEADER
   Used on every page — landing and all tool pages.
   HTML structure:
   <header class="site-header">
     <a class="site-logo" href="/"><em>PDF</em> Cowboy</a>
     <nav class="site-nav">
       <div class="site-tile">
         <span class="site-tile-name">PDF <span>Edit</span></span>
         <ul class="site-tile-tools">
           <li><a href="/merge/">Merge</a></li> ...
         </ul>
       </div>
       ... (6 tiles total)
     </nav>
   </header>
═══════════════════════════════════════════════════════════════ */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: stretch;
  background: rgba(12, 4, 0, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(245,166,35,0.2);
  height: 44px;
  overflow: visible;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  padding: 0 0.9rem;
  text-decoration: none;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 0.9rem;
  color: var(--cream);
  white-space: nowrap;
  border-right: 1px solid rgba(245,166,35,0.15);
  flex-shrink: 0;
}

.site-logo em {
  color: var(--gold);
  font-style: italic;
  margin-right: 0.2rem;
}

/* Nav — fills remaining width */
.site-nav {
  display: flex;
  flex: 1;
  align-items: stretch;
  overflow: visible;
  min-width: 0;
}

/* Each category tile */
.site-tile {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border-right: 1px solid rgba(245,166,35,0.12);
  transition: background 0.2s;
}

.site-tile:last-child { border-right: none; }

.site-tile:hover {
  background: rgba(30, 10, 0, 0.98);
}

/* Gold underline on hover */
.site-tile::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  opacity: 0;
  transition: opacity 0.2s;
}

.site-tile:hover::after { opacity: 1; }

/* Category name — always visible, centred in bar */
.site-tile-name {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(0.7rem, 1.1vw, 0.95rem);
  white-space: nowrap;
  color: var(--cream);
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transition: color 0.15s;
}

.site-tile-name:hover { color: var(--gold); }
.site-tile-name span { color: var(--gold); }

/* Dropdown — position:absolute so it doesn't affect header height */
.site-tile-tools {
  list-style: none;
  position: absolute;
  top: 44px;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 160px;
  padding: 0.6rem 0;
  background: rgba(12, 4, 0, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(245,166,35,0.25);
  border-top: none;
  border-radius: 0 0 8px 8px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
  z-index: 999;
  white-space: nowrap;
}

.site-tile:hover .site-tile-tools {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.site-tile-tools li {
  font-family: 'Playfair Display', serif;
  font-size: 0.8rem;
  color: rgba(255,248,240,0.7);
  line-height: 1;
}

.site-tile-tools li a {
  color: inherit;
  text-decoration: none;
  display: block;
  padding: 0.4rem 1rem;
  transition: color 0.15s, background 0.15s;
}

.site-tile-tools li a:visited { color: inherit; }
.site-tile-tools li a:hover {
  color: var(--gold);
  background: rgba(245,166,35,0.07);
}

/* Push page content below fixed header */
.site-header + * { margin-top: 44px; }

/* ─── Tile nav bar (landing page legacy — kept for compatibility) */
.hero-tiles {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  padding: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.tile {
  flex: 1;
  pointer-events: all;
  position: relative;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(12, 4, 0, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(245,166,35,0.12);
  border-bottom: 1px solid rgba(245,166,35,0.12);
  padding: 0.7rem 0.9rem;
  overflow: hidden;
  max-height: 58px;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.22s,
              border-color 0.22s;
}

.tile:last-child { border-right: none; }

.tile::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--orange), var(--gold));
  opacity: 0;
  transition: opacity 0.22s;
}

.tile:hover {
  max-height: 400px;
  background: rgba(20, 7, 0, 0.96);
  border-color: rgba(245,166,35,0.3);
}

.tile:hover::after { opacity: 1; }

.tile-name {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(1rem, 1.5vw, 1.3rem);
  line-height: 1.1;
  white-space: nowrap;
  color: var(--cream);
  flex-shrink: 0;
  text-align: center;
  width: 100%;
}

.tile-name span { color: var(--gold); }

.tile-tools {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 100%;
  margin-top: 0.6rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s 0.1s, transform 0.2s 0.1s;
  text-align: center;
}

.tile:hover .tile-tools { opacity: 1; transform: translateY(0); }

.tile-tools li {
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.7rem, 0.85vw, 0.82rem);
  color: rgba(255,248,240,0.65);
  line-height: 1.4;
  white-space: nowrap;
}

.tile-tools li a {
  color: inherit;
  text-decoration: none;
  display: block;
  width: 100%;
  transition: color 0.15s;
}

.tile-tools li a:visited { color: inherit; }
.tile-tools li a:hover { color: var(--gold); }

/* Footer */
.site-footer {
  position: fixed;
  bottom: 4px;
  left: 0; right: 0;
  z-index: 20;
  text-align: center;
  font-size: 0.72rem;
  color: rgba(255,248,240,0.35);
  letter-spacing: 0.04em;
  pointer-events: none;
}

.site-footer a {
  color: rgba(245,166,35,0.5);
  text-decoration: none;
  pointer-events: all;
}


/* ═══════════════════════════════════════════════════════════════
   APP BACKDROP — tool pages
   One rule drives the work surface on every tool. The containers
   below are the six tools' main canvas areas; they no longer set
   their own background, so everything is controlled from here.
   background-attachment:fixed pins the image to the viewport, so
   all tools show the same crop and the idle layer lines up exactly
   with the layer beneath it.
═══════════════════════════════════════════════════════════════ */

.work-area,      /* edit, content, sign, convert */
.canvas-wrap,    /* measure                      */
.util-main {     /* utilities                    */
  background-color: var(--bg-deep);
  background-image:
    linear-gradient(
      rgba(var(--app-bg-tint), var(--app-bg-scrim)),
      rgba(var(--app-bg-tint), var(--app-bg-scrim))
    ),
    var(--app-bg-image);
  background-size: cover;
  background-position: var(--app-bg-position);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Empty state — lighter scrim so the photo reads, plus a soft
   vignette behind the centred text to keep it legible. */
#dropZone,
.drop-zone,
.drop-overlay {
  background-color: transparent;
  background-image:
    radial-gradient(ellipse 62% 54% at 50% 50%,
      rgba(var(--app-bg-tint), 0.58),
      rgba(var(--app-bg-tint), 0) 72%),
    linear-gradient(
      rgba(var(--app-bg-tint), var(--app-bg-scrim-idle)),
      rgba(var(--app-bg-tint), var(--app-bg-scrim-idle))
    ),
    var(--app-bg-image);
  background-size: cover;
  background-position: var(--app-bg-position);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* Utilities centres an opaque card instead of filling the area,
   so lift it off the backdrop rather than flattening onto it. */
.util-card {
  box-shadow: 0 18px 60px rgba(0,0,0,0.55);
}


/* ═══════════════════════════════════════════════════════════════
   SEGMENTED CONTROLS — "which mode am I in?"
   Buttons that pick a mode and STAY picked, as opposed to one-shot
   action buttons. Both kinds share a .sel-actions row, and until now
   they shared its styling too, so the chosen mode looked identical
   to the ones you hadn't chosen.

   Add .seg-btn to any new mode-picking button and it inherits this.
   One-shot buttons (All / None / Invert) never carry .active, so
   they are untouched by the rule below.

   Specificity note: the tool pages style `.sel-actions button`,
   which outranks a bare `.split-mode-btn`. Hence the element
   qualifier here — without it, this rule silently loses.
═══════════════════════════════════════════════════════════════ */

.sel-actions button.split-mode-btn,
.sel-actions button.size-orient,
.sel-actions button.seg-btn {
  transition: background 0.13s, border-color 0.13s, color 0.13s;
}

.sel-actions button.split-mode-btn.active,
.sel-actions button.size-orient.active,
.sel-actions button.seg-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  font-weight: 600;
}

/* Hover must not impersonate the selected state — the tool pages set
   .sel-actions button:hover to gold, which on a mode button reads as
   "this one is on". Keep the active button looking active on hover. */
.sel-actions button.split-mode-btn.active:hover,
.sel-actions button.size-orient.active:hover,
.sel-actions button.seg-btn.active:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

/* Disabled one-shot buttons: visibly dead rather than silently inert. */
.sel-actions button:disabled,
.sel-actions button:disabled:hover {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: var(--border);
  color: var(--muted);
  background: none;
}
