:root,
[data-theme="dark"] {
  --bg: #0b0f1a;
  --bg-elev: #131a2a;
  --bg-card: #161d2f;
  --bg-input: #0d1322;
  --border: #232c44;
  --border-strong: #2f3a58;
  --text: #e8edf7;
  --text-dim: #95a0b8;
  --text-faint: #6b7596;
  --accent: #10b981;
  --accent-2: #34d399;
  --accent-hover: #059669;
  --accent-soft: rgba(16, 185, 129, 0.14);
  --accent-glow: rgba(16, 185, 129, 0.32);
  --gradient-a: rgba(16, 185, 129, 0.18);
  --gradient-b: rgba(124, 92, 255, 0.14);
  --headline-from: #ffffff;
  --headline-to: #a7f3d0;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --nav-bg: rgba(11, 15, 26, 0.78);
  --radius: 14px;
  --radius-lg: 20px;
}

[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --border: #e6ebf2;
  --border-strong: #cdd5e1;
  --text: #0f172a;
  --text-dim: #475569;
  --text-faint: #94a3b8;
  --accent: #059669;
  --accent-2: #10b981;
  --accent-hover: #047857;
  --accent-soft: rgba(5, 150, 105, 0.10);
  --accent-glow: rgba(5, 150, 105, 0.20);
  --gradient-a: rgba(5, 150, 105, 0.10);
  --gradient-b: rgba(124, 92, 255, 0.08);
  --headline-from: #0f172a;
  --headline-to: #059669;
  --shadow-lg: 0 24px 50px rgba(15, 23, 42, 0.10);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --nav-bg: rgba(255, 255, 255, 0.82);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(1100px 600px at 80% -10%, var(--gradient-a), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, var(--gradient-b), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color 0.25s, color 0.25s;
}

/* ===== Nav ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.25s, border-color 0.25s;
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #34d399 60%, #7c5cff);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: white;
  box-shadow: 0 6px 16px var(--accent-glow);
}
.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 4px 12px var(--accent-glow));
}
.brand-name { font-size: 17px; letter-spacing: -0.2px; }
.brand-ai { color: var(--accent); margin-left: 2px; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav-links {
  display: flex;
  gap: 24px;
}
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

/* Theme dropdown */
.theme-toggle { position: relative; }
.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.theme-btn:hover { border-color: var(--accent); }
.theme-icon { font-size: 15px; line-height: 1; }
.theme-caret {
  width: 10px;
  height: 10px;
  border-right: 1.5px solid var(--text-dim);
  border-bottom: 1.5px solid var(--text-dim);
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform 0.2s;
}
.theme-toggle.open .theme-caret { transform: rotate(-135deg); margin-top: 3px; }
.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 60;
}
.theme-toggle.open .theme-menu { display: block; }
.theme-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text);
  border: none;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}
.theme-option:hover { background: var(--accent-soft); color: var(--accent); }
.theme-option.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.theme-option .check { margin-left: auto; opacity: 0; }
.theme-option.active .check { opacity: 1; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 22px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-primary:disabled {
  background: var(--border-strong);
  color: var(--text-faint);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-elev); border-color: var(--accent); }
.btn-sm { padding: 9px 14px; font-size: 13px; }
.btn-block { width: 100%; padding: 14px 20px; font-size: 15px; }

/* ===== Hero ===== */
.hero { padding: 80px 24px 60px; }
.hero-inner { max-width: 880px; margin: 0 auto; text-align: center; }
.eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 22px;
}
h1 {
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -1.2px;
  margin: 0 0 18px;
  font-weight: 800;
  background: linear-gradient(180deg, var(--headline-from) 0%, var(--headline-to) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 680px;
  margin: 0 auto 30px;
}
.hero-ctas { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.trust { font-size: 13px; color: var(--text-faint); margin: 0; }

/* ===== Sections ===== */
.section-inner { max-width: 1180px; margin: 0 auto; padding: 64px 24px; }
.section-title {
  font-size: clamp(28px, 3.5vw, 38px);
  letter-spacing: -0.6px;
  margin: 0 0 10px;
  text-align: center;
  font-weight: 700;
  color: var(--text);
}
.section-sub { text-align: center; color: var(--text-dim); font-size: 16px; margin: 0 0 44px; }

/* ===== Features ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  transition: transform 0.2s, border-color 0.2s, background 0.25s;
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.feature-icon { font-size: 28px; margin-bottom: 14px; }
.feature-card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; color: var(--text); }
.feature-card p { margin: 0; font-size: 14px; color: var(--text-dim); }

/* ===== Tool ===== */
.tool { padding-top: 0; }
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 980px) { .tool-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  transition: background 0.25s, border-color 0.25s;
}
.card-head { margin-bottom: 20px; }
.card-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -0.3px; color: var(--text); }
.card-sub { margin: 0; font-size: 14px; color: var(--text-dim); }

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.2px;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.25s;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2395a0b8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
textarea { min-height: 160px; resize: vertical; line-height: 1.55; }

.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.helper { margin: 6px 0 0; font-size: 12.5px; color: var(--text-faint); }
.hidden { display: none; }

#mode, #promptMode { margin-bottom: 22px; }

/* ===== Output ===== */
.output-card { display: flex; flex-direction: column; }
.output-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.output {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  min-height: 320px;
  font-size: 14.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overflow-x: auto;
  transition: background 0.25s, border-color 0.25s;
}
.output.empty {
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.disclaimer {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
}
.disclaimer p { margin: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.disclaimer p + p { margin-top: 6px; }

/* ===== Pricing ===== */
.pricing { padding-top: 0; }
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}
.price-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.25s, border-color 0.25s;
}
.price-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-lg);
  transform: translateY(-4px);
}
.badge-pop {
  position: absolute;
  top: -12px;
  right: 22px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 5px 11px;
  border-radius: 999px;
  margin: 0;
  text-transform: uppercase;
}
.price-tag {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.price {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  color: var(--text);
}
.dollar { font-size: 24px; vertical-align: top; color: var(--text-dim); margin-right: 2px; }
.per { font-size: 16px; font-weight: 500; color: var(--text-dim); }
.price-features { list-style: none; padding: 0; margin: 4px 0 18px; flex: 1; }
.price-features li {
  padding: 7px 0;
  font-size: 14px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  position: relative;
  padding-left: 22px;
}
.price-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 13px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='none' stroke='%2310b981' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M2 5l2 2 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.price-features li:last-child { border-bottom: none; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); background: var(--nav-bg); margin-top: 40px; transition: background 0.25s, border-color 0.25s; }
.footer-inner { padding: 36px 24px; text-align: center; }
.footer-brand { margin: 0 0 6px; font-size: 17px; font-weight: 700; color: var(--text); }
.footer-text { margin: 0 0 10px; color: var(--text-dim); font-size: 14px; }
.footer-fine { margin: 0; font-size: 12px; color: var(--text-faint); }

/* ===== Mobile ===== */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-inner { gap: 10px; }
}
@media (max-width: 720px) {
  .hero { padding: 56px 20px 40px; }
  .section-inner { padding: 44px 20px; }
  .card { padding: 22px; }
  .price-card.featured { transform: none; }
}

/* ===== Tier badge & lock overlay ===== */
.tier-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 10px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.tier-badge.tier-officer { background: rgba(148,163,184,0.18); color: var(--text-dim); border: 1px solid rgba(148,163,184,0.3); }
.tier-badge.tier-supervisor { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); }
.tier-badge.tier-company { background: var(--accent); color: white; border: 1px solid var(--accent); }

.prompt-lib-wrap { position: relative; }
.prompt-lib-wrap.locked > .card {
  filter: blur(4px) grayscale(0.4);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}
.prompt-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  padding: 24px;
}
.prompt-lock.hidden { display: none; }
.prompt-lock-inner {
  max-width: 520px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), 0 0 0 1px var(--accent-soft);
}
.prompt-lock-inner h3 {
  margin: 12px 0 10px;
  font-size: 22px;
  color: var(--text);
}
.prompt-lock-inner p {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 22px;
}
.lock-icon { font-size: 44px; line-height: 1; }
.feature-disabled { color: var(--text-dim); opacity: 0.85; }
.price-features li.feature-disabled::before {
  background: rgba(239, 68, 68, 0.15);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='none' stroke='%23ef4444' stroke-width='1.8' stroke-linecap='round' d='M2 2l6 6M8 2l-6 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
[data-set-tier].tier-active {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.prompt-usage {
  font-size: 13px;
  color: var(--accent);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  border-radius: 6px;
  margin: 0 0 14px !important;
  font-weight: 700;
}
.prompt-usage em { font-style: normal; font-weight: 700; }

/* ===== Gold border on Report Generator + Preview cards ===== */
#tool .tool-grid > .card {
  border: 1.5px solid #d4af37;
  box-shadow:
    0 0 0 1px rgba(212, 175, 55, 0.25),
    0 0 24px rgba(212, 175, 55, 0.18),
    0 12px 32px rgba(0, 0, 0, 0.35);
  position: relative;
}
#tool .tool-grid > .card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, #f4d97a 0%, #d4af37 45%, #b8860b 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  opacity: 0.9;
}

/* ===== Per-option prompt locking ===== */
#promptMode option:disabled { color: var(--text-dim); opacity: 0.65; }
.prompt-lock-notice {
  margin: 10px 0 0;
  padding: 10px 14px;
  font-size: 13.5px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: var(--text);
  border-radius: 8px;
}
.prompt-lock-notice.hidden { display: none; }
.prompt-lock-notice a { color: var(--accent); font-weight: 700; text-decoration: underline; }
/* Officer no longer fully locked out — remove blur from prompt library */
.prompt-lib-wrap.locked > .card { filter: none; opacity: 1; pointer-events: auto; user-select: auto; }

/* ===== Cleaned AI output formatting (used by both Report + Prompt outputs) ===== */
.output .out-doc { display: flex; flex-direction: column; gap: 2px; }
.output .out-section {
  margin-top: 14px;
  padding-bottom: 4px;
}
.output .out-doc > .out-section:first-child { margin-top: 0; }
.output .out-label {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-right: 6px;
}
.output .out-val { color: var(--text); }
.output .out-bullet {
  padding-left: 12px;
  margin: 2px 0;
}
.output .out-line { margin: 2px 0; }
.output .out-gap { height: 10px; }

/* ===== Detail Checker ===== */
.detail-checker {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
}
.detail-checker.hidden { display: none; }
.dc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.dc-title { font-weight: 700; color: var(--text); font-size: 14px; letter-spacing: 0.3px; }
.dc-badge {
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.dc-badge.ok   { background: rgba(16,185,129,0.15);  color: var(--accent); border: 1px solid rgba(16,185,129,0.45); }
.dc-badge.warn { background: rgba(212,175,55,0.18);  color: #d4af37;       border: 1px solid rgba(212,175,55,0.55); }
.dc-badge.bad  { background: rgba(239,68,68,0.15);   color: #ef4444;       border: 1px solid rgba(239,68,68,0.5); }
.dc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; }
.dc-item { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; }
.dc-item.ok   { color: var(--text-dim); }
.dc-item.miss { color: var(--text); font-weight: 600; }
.dc-mark { width: 18px; text-align: center; font-weight: 800; flex-shrink: 0; }
.dc-item.ok   .dc-mark { color: var(--accent); }
.dc-item.miss .dc-mark { color: #d4af37; }
.dc-hint { margin: 12px 0 0; font-size: 12px; color: var(--text-faint); line-height: 1.5; }

/* ===== Reference File Report Generator ===== */
.optional { color: var(--text-faint); font-weight: 400; font-size: 11.5px; }
.output-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.file-drop {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: var(--bg-input);
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.file-drop:hover { border-color: var(--accent); }
.file-drop.dragging { border-color: var(--accent); background: var(--accent-soft); }
.file-drop.has-file { border-style: solid; border-color: var(--accent); }
.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-drop-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.file-drop-icon { font-size: 26px; }
.file-drop-text { font-size: 14px; font-weight: 600; color: var(--text); word-break: break-all; }
.file-drop-types { font-size: 12px; color: var(--text-faint); }

/* ===== Print / Save / Share toolbar ===== */
.output-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.menu-wrap { position: relative; }
.action-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50;
  min-width: 190px; padding: 6px;
  background: var(--surface, #14181f); border: 1px solid var(--border, #2a3140);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  display: flex; flex-direction: column; gap: 2px;
}
.action-menu.hidden { display: none; }
.action-menu button {
  all: unset; cursor: pointer; padding: 8px 10px; border-radius: 7px;
  font-size: 0.85rem; color: var(--text, #e8ecf3); display: block; width: calc(100% - 20px);
}
.action-menu button:hover { background: rgba(255, 255, 255, 0.07); }
@media (max-width: 640px) {
  .output-head-row { flex-wrap: wrap; gap: 8px; }
  .action-menu { right: auto; left: 0; }
}

/* ===== Auth + free trial ===== */
.auth-area { display: flex; align-items: center; gap: 8px; }
.auth-email { font-size: 0.8rem; color: var(--text-faint, #9aa4b5); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trial-banner {
  margin: 0 0 18px; padding: 10px 16px; border-radius: 10px;
  font-size: 0.9rem; text-align: center;
  background: rgba(46, 204, 113, 0.12); border: 1px solid rgba(46, 204, 113, 0.35);
  color: var(--text, #e8ecf3);
}
.trial-banner.trial-warning { background: rgba(241, 196, 15, 0.12); border-color: rgba(241, 196, 15, 0.4); }
.trial-banner.trial-expired { background: rgba(231, 76, 60, 0.12); border-color: rgba(231, 76, 60, 0.4); }
.trial-banner.hidden { display: none; }

/* ===== Training Academy ===== */
.nav-academy { white-space: nowrap; }
.nav-academy.active { color: var(--accent); }
.academy-card { display: block; text-decoration: none; color: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.academy-card:hover { transform: translateY(-3px); }
.academy-cta { text-align: center; margin-top: 32px; }

/* ===== Prompt Library lock ===== */
.prompt-locked-panel {
  max-width: 560px; margin: 0 auto; padding: 48px 32px; text-align: center;
  border: 1px dashed rgba(148, 163, 184, 0.4); border-radius: 16px;
  background: rgba(148, 163, 184, 0.06);
}
.prompt-locked-panel .lock-icon { font-size: 2.4rem; margin-bottom: 12px; }
.prompt-locked-panel h3 { margin: 0 0 10px; }
.prompt-locked-panel p { margin: 0 0 22px; color: var(--text-faint, #9aa4b5); }
.prompt-locked-panel.hidden, .prompt-lib-wrap.hidden, .prompt-lib-extra.hidden { display: none; }

/* ===== Nav dropdown ===== */
.nav-dropdown { position: relative; display: inline-flex; }
.nav-dropdown-btn {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--text-dim);
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}
.nav-dropdown-btn:hover, .nav-dropdown.open .nav-dropdown-btn { color: var(--text); }
.nav-caret { font-size: 0.7em; transition: transform 0.15s ease; }
.nav-dropdown.open .nav-caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  display: none;
  flex-direction: column;
  z-index: 60;
}
.nav-dropdown.open .nav-dropdown-menu { display: flex; }
.nav-dropdown-menu a {
  padding: 9px 12px;
  border-radius: 7px;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: rgba(128,128,128,0.12); }

/* ===== About & Contact ===== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.about-card h3 { margin: 0 0 10px; }
.about-card p { color: var(--text-dim); margin: 0; line-height: 1.6; }
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-top: 24px;
  text-align: center;
}
.contact-card p { margin: 6px 0; color: var(--text-dim); }
.contact-card a { color: var(--accent); }
.about-story {
  max-width: 760px;
  margin: 28px auto 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}
.about-story p { color: var(--text-dim); line-height: 1.7; margin: 0 0 18px; }
.about-story p:last-child { margin-bottom: 0; }


/* ===== Announcement bar ===== */
.announce-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 44px;
  background: linear-gradient(90deg, var(--accent-hover), var(--accent));
  color: #fff;
  text-align: center;
  font-size: 14px;
}
.announce-bar p { margin: 0; }
.announce-bar a { color: #fff; font-weight: 700; text-decoration: underline; }
.announce-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 8px;
}
.announce-close:hover { color: #fff; }
.announce-bar.hidden { display: none; }

/* ===== Cancel subscription flow ===== */
.cancel-sub-row {
  text-align: center;
  margin-top: 22px;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.cancel-sub-row a { color: var(--text-dim); text-decoration: underline; }
.cancel-sub-row a:hover { color: var(--text); }
.rr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 18, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.rr-modal-overlay.hidden { display: none; }
.rr-modal {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 460px;
  width: 100%;
  padding: 28px 26px 24px;
  box-shadow: var(--shadow-lg);
  text-align: left;
}
.rr-modal h3 { margin: 0 0 6px; font-size: 1.25rem; color: var(--text); }
.rr-modal-sub { margin: 0 0 16px; color: var(--text-dim); font-size: 0.95rem; }
.rr-modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-faint);
  cursor: pointer;
}
.rr-modal-close:hover { color: var(--text); }
.cancel-reasons { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.cancel-reason {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-input);
  text-align: left;
}
.cancel-reason:hover { border-color: var(--border-strong); }
.cancel-reason input { accent-color: var(--accent); margin: 0; flex: 0 0 auto; }
.cancel-details-label { display: block; font-size: 0.9rem; color: var(--text-dim); margin-bottom: 6px; }
#cancelDetails {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.95rem;
  resize: vertical;
  box-sizing: border-box;
  min-height: 70px;
}
.cancel-error { color: #f87171; font-size: 0.88rem; margin: 8px 0 0; }
.rr-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* ===== Spell check ===== */
.spellcheck-wrap { margin-top: 8px; }
.spellcheck-btn { font-size: 13px; }
.spellcheck-panel { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--card-bg, var(--bg-soft, transparent)); }
.spellcheck-panel.hidden { display: none; }
.spellcheck-msg { margin: 0; font-size: 13px; color: var(--text-faint); }
.spellcheck-ok { color: var(--accent, #16a34a); }
.spellcheck-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.spellcheck-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; flex-wrap: wrap; }
.spellcheck-word { color: #ef4444; text-decoration: underline wavy #ef4444; text-underline-offset: 3px; }
.spellcheck-suggestion { color: var(--accent, #16a34a); font-weight: 600; }
.spellcheck-arrow { color: var(--text-faint); }
.spellcheck-actions { display: flex; gap: 6px; margin-left: auto; }
.btn-xs { padding: 3px 10px; font-size: 12px; border-radius: 8px; }
.spellcheck-done .spellcheck-word, .spellcheck-done .spellcheck-suggestion { opacity: 0.55; }
.spellcheck-note { font-size: 12px; color: var(--text-faint); }
