/* Rendered Digital · boltkey.app — Dark mode default, mobile-first */

/* === Fonts === */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fraunces';
  src: url('/fonts/fraunces-latin.woff2') format('woff2');
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* === Design Tokens === */

:root {
  --bg: #0a1628;
  --surface: #122240;
  --surface-2: #162a4a;
  --border: #2a4a6a;
  --text: #f0f6ff;
  --muted: #9cb4d0;
  --accent: #4d9fff;
  --accent-glow: rgba(77, 159, 255, 0.35);
  --accent-dim: rgba(77, 159, 255, 0.15);

  /* Character type colors */
  --char-upper: #6bb3ff;
  --char-lower: #b0c4de;
  --char-digit: #a0d4ff;
  --char-symbol: #d4a0ff;

  /* Strength colors — storm intensity scale */
  --strength-weak: #e06060;
  --strength-fair: #d4944d;
  --strength-good: #4d9fff;
  --strength-strong: #70b8ff;
  --strength-excellent: #e0f0ff;

  --radius: 8px;
  --radius-sm: 6px;
  --radius-pill: 100px;
  --font-body: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
}

/* === Reset === */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; touch-action: manipulation; }
html { font-size: 16px; overscroll-behavior: none; }
body { overscroll-behavior: none; -webkit-overflow-scrolling: auto; }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 30% 20%, rgba(77, 159, 255, 0.10) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 80%, rgba(77, 159, 255, 0.07) 0%, transparent 50%),
    url('/images/storm-bg.jpg');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Blue-tinted overlay — lets the storm photo show as subtle texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 22, 40, 0.92) 0%,
    rgba(15, 32, 64, 0.88) 40%,
    rgba(20, 42, 82, 0.90) 100%
  );
  pointer-events: none;
  z-index: -1;
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url('/images/noise.svg') repeat;
  opacity: 0.04;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

/* === App Layout === */

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

/* === Header === */

.app-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffffff;
  font-style: normal;
  text-transform: none;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 30px rgba(77, 159, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.wordmark-logo {
  width: 2.2rem;
  height: 2.2rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.app-icon-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.app-icon-header h1 { margin: 0; }
.app-icon {
  width: 96px;
  height: 96px;
  border-radius: 22%;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.app-subtitle { color: var(--muted); margin: 0.25rem 0 0; font-size: 0.875rem; }
.app-version { color: var(--muted); font-size: 0.75rem; margin: 0.25rem 0 0; font-family: var(--font-mono); }

.tagline {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 0.25rem;
  opacity: 0.7;
}

.hero-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(77, 159, 255, 0.3);
  margin-top: 0.75rem;
}

.hero-claim {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--text);
  text-align: center;
  margin-top: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.01em;
  margin-bottom: 0.15rem;
}

.hero-cycle-line {
  text-align: center;
  min-height: 1.6em;
}

.hero-cycle {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  font-size: clamp(1.1rem, 3vw, 1.3rem);
}

.hero-cycle-name {
  display: inline-block;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-cycle-name.fading {
  opacity: 0;
  transform: translateY(-4px);
}

.hero-count {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.25rem;
  letter-spacing: 0.04em;
  opacity: 0.7;
}

/* === Lightning Flash (one-time page load animation) === */

.lightning-flash {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%,
    rgba(180, 210, 255, 0.25) 0%,
    rgba(77, 159, 255, 0.08) 40%,
    transparent 70%);
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  animation: lightning-flash 1.5s ease-out 0.3s 1;
}

/* Triggered on each generate — backlit flash */
.lightning-flash.flash {
  animation: lightning-strike 0.6s ease-out 1;
}

@keyframes lightning-flash {
  0%   { opacity: 0; }
  5%   { opacity: 1; }
  8%   { opacity: 0.1; }
  12%  { opacity: 0.7; }
  15%  { opacity: 0; }
  100% { opacity: 0; }
}

@keyframes lightning-strike {
  0%   { opacity: 0; }
  8%   { opacity: 1; }
  20%  { opacity: 0.15; }
  30%  { opacity: 0.6; }
  100% { opacity: 0; }
}

/* === Generating-for Indicator === */

.generating-for {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.generating-for-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  border-bottom: 1px dotted var(--accent);
  transition: color 0.2s;
}

.generating-for-btn:hover {
  color: var(--text);
}

/* === Sticky Output Wrapper === */

.output-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 22, 40, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(77, 159, 255, 0.10);
  border-radius: var(--radius);
  padding: 0.75rem 0.75rem 0.5rem;
  margin: 0 -0.75rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.3);
}

/* === Password Display === */

.output-section {
  margin-bottom: 0.75rem;
}

.password-display {
  background: linear-gradient(180deg, #060b14 0%, #0a1220 100%);
  border: 1px solid rgba(77, 159, 255, 0.12);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  min-height: 3.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-family: var(--font-mono);
  font-size: clamp(1.15rem, 3.5vw, 1.4rem);
  line-height: 1.6;
  letter-spacing: 0.08em;
  word-break: break-all;
  box-shadow:
    inset 0 2px 12px rgba(0, 0, 0, 0.7),
    0 1px 0 rgba(255, 255, 255, 0.03);
  transition: box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
}

.password-display.just-generated {
  box-shadow: 0 0 30px var(--accent-glow), inset 0 0 30px var(--accent-dim);
}

.password-display.obscured {
  filter: blur(8px);
  cursor: pointer;
  transition: filter 0.3s ease, box-shadow 0.4s ease;
  user-select: none;
  -webkit-user-select: none;
}

/* Reveal overlay (sibling, outside blur) */

.output-section {
  position: relative;
}

.reveal-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  z-index: 10;
  transition: color 0.15s ease;
}

.reveal-overlay:hover {
  color: var(--accent);
}

.reveal-overlay svg {
  opacity: 0.7;
}

.reveal-overlay.hidden {
  display: none;
}

/* Character spans */
.char {
  display: inline-block;
  opacity: 0;
  transform: translateY(6px);
  animation: char-lock 0.3s ease forwards;
}

.char-upper { color: var(--char-upper); }
.char-lower { color: var(--char-lower); }
.char-digit { color: var(--char-digit); }
.char-symbol { color: var(--char-symbol); }
.char-scramble { color: var(--muted); opacity: 0.4; }

@keyframes char-lock {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === Strength Indicator === */

.strength-section {
  margin-bottom: 1rem;
}

.strength-bar {
  height: 4px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 0.4s ease, background 0.4s ease, box-shadow 0.4s ease;
  box-shadow: 0 0 8px currentColor;
}

.strength-weak    { background: var(--strength-weak); }
.strength-fair    { background: var(--strength-fair); }
.strength-good    { background: var(--strength-good); }
.strength-strong  { background: var(--strength-strong); }
.strength-excellent { background: var(--strength-excellent); }

.strength-narrative {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  text-align: center;
  transition: color 0.3s ease;
  line-height: 1.4;
}

.strength-narrative.color-weak { color: var(--strength-weak); }
.strength-narrative.color-fair { color: var(--strength-fair); }
.strength-narrative.color-good { color: var(--strength-good); }
.strength-narrative.color-strong { color: var(--strength-strong); }
.strength-narrative.color-excellent { color: var(--strength-excellent); }

/* === Output Actions === */

.output-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* New button (secondary) */
.btn-new {
  background: linear-gradient(180deg, #1e2d42 0%, var(--surface) 100%);
  color: var(--text);
  border: 1px solid var(--border);
  flex: 0.6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-new:hover {
  background: linear-gradient(180deg, #253a54 0%, var(--surface-2) 100%);
  border-color: rgba(77, 159, 255, 0.3);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-new:active {
  transform: translateY(0);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.4),
    0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Copy button (primary) */
.btn-copy {
  background: linear-gradient(180deg, #5eaaff 0%, #3578d8 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--bg);
  flex: 1;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 2px 8px rgba(77, 159, 255, 0.3),
    0 0 20px rgba(77, 159, 255, 0.1);
}

.btn-copy:hover {
  background: linear-gradient(180deg, #5eaaff 0%, #4a8be5 100%);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 4px 16px rgba(77, 159, 255, 0.4);
}

.btn-copy:active {
  transform: translateY(0);
  background: linear-gradient(180deg, #3578d8 0%, #2a65b8 100%);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.3),
    0 1px 4px rgba(77, 159, 255, 0.2);
}

.btn-copy.copied {
  background: var(--surface-2);
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.btn-copy.copied:hover {
  background: var(--accent-dim);
  box-shadow: none;
}

.copy-ring {
  flex-shrink: 0;
}

/* === Trust Line === */

.trust-line {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
  text-align: center;
  line-height: 1.5;
}

.trust-line svg {
  color: var(--border);
  flex-shrink: 0;
}

.trust-dot {
  color: var(--border);
  margin: 0 0.15rem;
}

/* === Security Tip === */

.security-tip {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
  padding: 0 1rem;
  line-height: 1.4;
  font-style: italic;
}

.bolt-note {
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.7;
  margin-bottom: 1.25rem;
  padding: 0 1.5rem;
  line-height: 1.5;
  font-style: italic;
}

/* === Customize Drawer === */

.customize-drawer {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(10, 22, 40, 0.95) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 4px 16px rgba(0, 0, 0, 0.3);
}

.drawer-handle {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: color 0.2s;
}

.drawer-handle::-webkit-details-marker { display: none; }

.drawer-handle::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s;
  margin-top: -2px;
}

.customize-drawer[open] .drawer-handle::after {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.drawer-handle:hover {
  color: var(--text);
}

.drawer-content {
  padding: 0 1rem 1rem;
}

/* === Mode Tabs (inside drawer) === */

.mode-tabs {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-pill);
  padding: 3px;
  margin-bottom: 1rem;
}

.mode-tab {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.mode-tab:hover {
  color: var(--text);
}

.mode-tab.active {
  background: var(--border);
  color: var(--text);
}

.mode-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* === Controls Panel === */

.control-group {
  margin-bottom: 1rem;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.control-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
  background: var(--surface-2);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

/* Select */
select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: rgba(15, 32, 64, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem; /* >= 16px prevents iOS zoom on focus */
  cursor: pointer;
  appearance: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b6b80' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

select optgroup {
  font-weight: 600;
  color: var(--muted);
}

/* Range Slider */
input[type="range"] {
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 2px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #4d9fff 0%, #3578d8 100%);
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #4d9fff 0%, #3578d8 100%);
  cursor: pointer;
  border: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.4);
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Checkboxes / Toggles */
.toggles {
  border: none;
  padding: 0;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  background: rgba(15, 32, 64, 0.4);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.toggle-label input[type="checkbox"]:checked {
  background: linear-gradient(180deg, #4d9fff 0%, #3578d8 100%);
  border-color: rgba(77, 159, 255, 0.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 6px rgba(77, 159, 255, 0.3);
}

.toggle-label input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.toggle-label input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toggle-label input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toggle-hint {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
}

/* Smart Input */
.smart-input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem; /* >= 16px prevents iOS zoom on focus */
  outline: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.smart-input::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.smart-input:focus {
  border-color: rgba(77, 159, 255, 0.5);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.4),
    0 0 8px rgba(77, 159, 255, 0.2),
    0 0 20px rgba(77, 159, 255, 0.08);
}

/* === Service Selector (promoted from drawer) === */

.service-selector {
  margin: 1.25rem 0;
  transition: opacity 0.3s ease;
}

.service-selector.dimmed {
  opacity: 0.3;
  pointer-events: none;
}

.service-headline {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.service-selector .smart-input {
  margin-bottom: 0.75rem;
}

/* Service Tiles */
.tile-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.tile {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}

.tile:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tile.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 12px rgba(77, 159, 255, 0.15);
}

.tile.matched {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}

.tile-show-all {
  display: block;
  width: 100%;
  padding: 0.35rem 0;
  margin-bottom: 1rem;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.7rem;
  cursor: pointer;
  transition: color 0.15s;
}

.tile-show-all:hover {
  color: var(--text);
}

.rules-link-home {
  text-align: center;
  font-size: 0.75rem;
  margin: 0.25rem 0 0.75rem;
}

.rules-link-home a {
  color: var(--muted);
}

.rules-link-home a:hover {
  color: var(--text);
}

/* Preset Note */
.preset-note {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--accent);
  line-height: 1.4;
}

.preset-note-warning {
  background: rgba(245, 166, 35, 0.12);
  border-left-color: #f5a623;
  color: #f5a623;
}

/* === Details Panel (Layer 2) === */

.details-panel {
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent 0%, var(--border) 20%, var(--accent) 50%, var(--border) 80%, transparent 100%) 1;
  margin-top: 1rem;
}

.details-panel summary {
  padding: 0.75rem 0;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.details-panel summary::-webkit-details-marker { display: none; }

.details-panel summary::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}

.details-panel[open] summary::before {
  transform: rotate(45deg);
}

.details-panel summary:hover {
  color: var(--text);
}

.details-content {
  padding-bottom: 0.5rem;
}

.details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.8rem;
}

.details-label {
  color: var(--muted);
}

.details-value {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text);
  text-align: right;
  overflow-wrap: break-word;
  word-break: break-word;
}

.details-note {
  justify-content: flex-end;
  font-size: 0.7rem;
  color: var(--muted);
  font-style: italic;
}

/* === Dictation Panel (inside Details) === */

.dictation-panel {
  border-top: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent 0%, var(--border) 20%, var(--accent) 50%, var(--border) 80%, transparent 100%) 1;
  margin-top: 0.5rem;
}

.dictation-panel summary {
  padding: 0.75rem 0;
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.dictation-panel summary::-webkit-details-marker { display: none; }

.dictation-panel summary::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}

.dictation-panel[open] summary::before {
  transform: rotate(45deg);
}

.dictation-panel summary:hover {
  color: var(--text);
}

.alphabet-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0 0 0.75rem;
  flex-wrap: wrap;
}

.alphabet-tab {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.7rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}

.alphabet-tab:hover {
  color: var(--text);
  border-color: var(--muted);
}

.alphabet-tab.active {
  color: var(--accent);
  border-color: var(--accent);
}

.dictation-content {
  padding: 0 0 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.75rem;
}

.dictation-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.15rem 0;
  font-size: 0.8rem;
  white-space: nowrap;
}

.dictation-char {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.dictation-desc {
  color: var(--muted);
  font-size: 0.72rem;
}

/* === Reset Button === */

.btn-reset {
  display: block;
  margin: 1rem auto 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

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

/* === Log Page === */

.log-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  overflow-x: hidden;
}

.log-hero {
  margin: 0.5rem 0 2rem;
}
.log-hero-img {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid rgba(77, 159, 255, 0.1);
}

.log-page h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.log-page .back-link {
  display: inline-block;
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.log-page .back-link:hover {
  color: var(--text);
  text-decoration: none;
}

.log-intro {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.log-timeline {
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
}

.log-entry {
  margin-bottom: 2rem;
  position: relative;
}

.log-entry::before {
  content: '';
  position: absolute;
  left: -1.56rem;
  top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.log-date {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.log-headline {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.log-body p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

/* Version tooltips (shared pattern with BOOM) */

.log-version {
  display: inline-block;
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent);
  opacity: 0.5;
  cursor: help;
  border-bottom: 1px dotted var(--accent);
  transition: opacity 0.2s;
}

.log-version:hover {
  opacity: 1;
}

.log-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-family: var(--font-body);
  white-space: normal;
  max-width: min(280px, calc(100vw - 2rem));
  color: var(--muted);
  line-height: 1.6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s;
}

.log-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 1rem;
  border: 5px solid transparent;
  border-top-color: var(--border);
}

.log-tip strong {
  color: var(--text);
  font-weight: 600;
}

.log-tip code {
  color: var(--accent);
  font-size: 0.6rem;
}

/* Desktop: hover */
.log-version:hover .log-tip,
.log-version:focus .log-tip {
  opacity: 1;
  visibility: visible;
}

/* Mobile: tap to toggle */
.log-version.tooltip-open .log-tip {
  opacity: 1;
  visibility: visible;
}

/* Flip below when near top of viewport */
.log-version.tooltip-below .log-tip {
  bottom: auto;
  top: calc(100% + 6px);
}

.log-version.tooltip-below .log-tip::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--border);
}

/* Anchor right when near right edge */
.log-version.tooltip-right .log-tip {
  left: auto;
  right: 0;
}

.log-version.tooltip-right .log-tip::after {
  left: auto;
  right: 1rem;
}

/* === About Page === */

.about-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  overflow-x: hidden;
}

.about-page h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.about-page .version {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  margin-bottom: 2rem;
}

.about-page .back-link {
  display: inline-block;
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.about-page .back-link:hover {
  color: var(--text);
  text-decoration: none;
}

.about-page section {
  margin-bottom: 2rem;
}

.about-page h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.about-page p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.about-page code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: var(--accent);
}

.about-page ul {
  list-style: none;
  padding: 0;
}

.about-page li {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  padding-left: 1.25rem;
  position: relative;
}

.about-page li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
}

.about-aside {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.75rem;
}

.log-callout {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.about-credit {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}
.credit-sub {
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 0.25rem;
}

/* === Error Page === */

.error-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 4rem 1.25rem;
  text-align: center;
}

.error-page h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.error-page p {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* === Spread the Word === */

.spread-the-word {
  max-width: 640px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.spread-label {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.share-app-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.share-app-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.install-app-btn {
  border-color: var(--accent);
  color: var(--accent);
  margin-bottom: 1rem;
}

.install-app-btn[hidden] {
  display: none;
}

/* === Footer === */

.site-footer {
  text-align: center;
  padding: 2rem 1rem calc(4rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.site-footer a { color: var(--muted); margin: 0 0.25rem; }
.site-footer a:hover { color: var(--text); }
.site-footer p { margin-top: 0.5rem; }

.footer-trust {
  font-size: 0.7rem;
  color: var(--muted);
}

.footer-legal {
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.footer-credit {
  font-size: 0.75rem;
  color: var(--muted);
  opacity: 0.5;
  margin: 0.5rem 0 0;
}
.footer-credit a { color: var(--muted); }
.footer-credit a:hover { color: var(--accent); }
.rendered-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  text-decoration: none;
  color: inherit;
}
.rendered-lockup:hover { text-decoration: none; color: var(--accent); }
.rendered-prism {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  vertical-align: middle;
}
.rendered-verb {
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}
.rendered-wordmark {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.85em;
}

/* === Focus & Accessibility === */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* === Responsive === */

@media (max-width: 360px) {
  .app {
    padding: 1.5rem 1rem 2rem;
  }

  .password-display {
    font-size: 1rem;
    padding: 1rem 0.75rem;
  }

  .mode-tab {
    font-size: 0.75rem;
    padding: 0.45rem 0.5rem;
  }

  .trust-line {
    font-size: 0.65rem;
  }
}

@media (max-width: 320px) {
  .app {
    padding: 1rem 0.75rem 1.5rem;
  }

  .password-display {
    font-size: 0.95rem;
    padding: 0.75rem 0.5rem;
  }

  .strength-narrative {
    font-size: 0.7rem;
  }

  .tile {
    font-size: 0.7rem;
    padding: 0.45rem 0.75rem;
  }
}

/* === Rules Pages === */

.rules-page {
  max-width: 600px;
}

.rules-intro {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.rules-page .smart-input {
  margin-bottom: 1.5rem;
}

.rules-category-heading {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.rules-tile {
  text-decoration: none;
}

.rules-tile:hover {
  text-decoration: none;
}

.rules-no-results {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 2rem 0;
}

.rules-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 1.25rem;
}

.rules-breadcrumb a {
  color: var(--muted);
}

.rules-breadcrumb a:hover {
  color: var(--text);
}

.rules-breadcrumb span:not(:last-child) {
  opacity: 0.5;
}

.rules-breadcrumb span:last-child {
  color: var(--text);
}

.rules-req-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 1.25rem;
}

@media (min-width: 480px) {
  .rules-req-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.rules-req {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.rules-req-label {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rules-req-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.rules-req-required .rules-req-value {
  color: #5eaaff;
}

.rules-req-optional .rules-req-value {
  color: var(--muted);
}

.rules-req-restricted .rules-req-value {
  color: #f5a623;
}

.rules-req-warning .rules-req-value {
  color: #f5a623;
}

.rules-symbols {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  color: var(--text);
}

.rules-cta {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  background: linear-gradient(180deg, #5eaaff 0%, #3578d8 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 2px 8px rgba(77, 159, 255, 0.3),
    0 0 20px rgba(77, 159, 255, 0.1);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}

.rules-cta:hover {
  background: linear-gradient(180deg, #5eaaff 0%, #4a8be5 100%);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 4px 16px rgba(77, 159, 255, 0.4);
  text-decoration: none;
  color: var(--bg);
}

.rules-cta:active {
  transform: translateY(0);
  background: linear-gradient(180deg, #3578d8 0%, #2a65b8 100%);
}

.rules-prose {
  margin-top: 1.5rem;
}

.rules-prose h2,
.rules-faq h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.6rem;
}

.rules-prose p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.7;
}

.rules-faq {
  margin-top: 1.5rem;
}

.rules-faq-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.rules-faq-item summary {
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rules-faq-item summary::-webkit-details-marker {
  display: none;
}

.rules-faq-item summary::after {
  content: '+';
  font-size: 1.1rem;
  color: var(--muted);
  flex-shrink: 0;
  margin-left: 0.5rem;
  transition: transform 0.2s;
}

.rules-faq-item[open] summary::after {
  content: '−';
}

.rules-faq-item p {
  padding: 0 0.9rem 0.7rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.rules-related {
  margin-top: 2rem;
}

.rules-browse-all {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 1.5rem;
}

/* === Skip Link === */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.85rem;
  z-index: 9999;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* === Reduced Motion === */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .lightning-flash {
    display: none;
  }
}
