/* ============================================================
   June Design System — shared across all tools, guides, pages
   by Soulless Systems · myjune.click
   Dark theme · amber accent · advertiser-ready layout
   ============================================================ */

:root {
  --bg: #0a0a0b;
  --bg-card: #131316;
  --bg-hover: #1a1a1f;
  --bg-elevated: #17171c;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #1e1e24;
  --border-hover: #334155;
  --accent: #f59e0b;
  --accent-strong: #fbbf24;
  --accent-bg: rgba(245,158,11,0.1);
  --accent-glow: rgba(245,158,11,0.15);
  --danger: #ef4444;
  --danger-bg: rgba(239,68,68,0.1);
  --success: #10b981;
  --success-bg: rgba(16,185,129,0.1);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 720px;
  --transition: all 0.15s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px;
  position: relative;
  z-index: 1;
}

/* Wide container for landing / hub pages */
.container-wide {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

::selection { background: var(--accent); color: #0a0a0b; }

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

img { max-width: 100%; height: auto; }

/* ============================================================
   Header
   ============================================================ */
.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  position: sticky;
  top: 0;
  background: rgba(10,10,11,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10;
}

.tool-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-brand .icon { font-size: 24px; }
.tool-brand .name { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.tool-brand .parent {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-left: 4px;
}
.tool-brand .parent a { color: var(--text-muted); text-decoration: none; }
.tool-brand .parent a:hover { color: var(--accent); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text);
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover { background: var(--bg-hover); border-color: var(--border-hover); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #0a0a0b;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { box-shadow: 0 0 20px var(--accent-glow); background: var(--accent-strong); }

.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }

.btn-ghost { border: none; background: transparent; color: var(--text-secondary); padding: 4px 8px; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: var(--radius); }
.btn-icon { padding: 6px; min-width: 32px; justify-content: center; }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 8px;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); }
.card.active { border-color: var(--accent); box-shadow: 0 0 16px var(--accent-glow); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.card-title { font-size: 14px; font-weight: 600; }
.card-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.card-body { font-size: 13px; color: var(--text-secondary); }

/* Tool link card (landing + hub grids) */
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  text-decoration: none;
}
.tool-card .icn { font-size: 26px; line-height: 1; }
.tool-card .nm { font-size: 14px; font-weight: 600; color: var(--text); }
.tool-card .ds { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.tool-card .go { position: absolute; top: 10px; right: 12px; font-size: 12px; color: var(--text-muted); opacity: 0; transition: var(--transition); }
.tool-card:hover .go { opacity: 1; color: var(--accent); }

/* ============================================================
   Color Swatch
   ============================================================ */
.swatch {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.swatch:hover { transform: scale(1.2); }
.swatch-lg { width: 40px; height: 40px; }

/* ============================================================
   Forms
   ============================================================ */
input, textarea, select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group { margin-bottom: 12px; }
.form-row { display: flex; gap: 8px; }
.form-row > * { flex: 1; }

input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 2px;
  border-radius: 50%;
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border-radius: 50%; border: 1px solid var(--border); }

/* Search input (landing / hub) */
.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.search-wrap { position: relative; }
.search-wrap::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
  z-index: 1;
}

/* ============================================================
   Stats
   ============================================================ */
.stats-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.stat-card {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.stat-value { font-size: 22px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* ============================================================
   Empty state
   ============================================================ */
.empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 4px; }
.empty p { font-size: 13px; }

/* ============================================================
   Tags / badges
   ============================================================ */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.tag-accent { background: var(--accent-bg); color: var(--accent); }
.tag-success { background: var(--success-bg); color: var(--success); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  background: var(--text);
  color: var(--bg);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 440px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal h2 { font-size: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* Actions bar */
.actions-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Search bar */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.search-bar input { flex: 1; }

/* Section */
.section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin: 24px 0 12px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ============================================================
   Ads — labeled, collapse when empty
   ============================================================ */
.june-ad {
  text-align: center;
  margin: 16px auto;
  max-width: 728px;
  min-height: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px 0;
  transition: min-height 0.3s ease;
}
.june-ad.footer-ad {
  max-width: 100%;
  min-height: 60px;
  margin: 16px 0 0 0;
}
.june-ad.ad-collapsed {
  min-height: 0 !important;
  border-color: transparent;
  background: transparent;
  padding: 0;
  margin: 4px auto;
}
.june-ad.ad-collapsed .ad-label,
.june-ad.ad-collapsed ins { display: none; }
.ad-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.june-ad ins.adsbygoogle { display: block; width: 100%; }

/* ============================================================
   Landing / Hub page
   ============================================================ */
.hero {
  text-align: center;
  padding: 40px 0 24px;
  position: relative;
}
.hero::after {
  content: '';
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse at center, rgba(245,158,11,0.12), transparent 65%);
  pointer-events: none;
  z-index: -1;
}
.hero .eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hero .eyebrow a { color: var(--text-muted); }
.hero .eyebrow a:hover { color: var(--accent); }
.hero h1 {
  font-size: clamp(30px, 6vw, 46px);
  font-weight: 800;
  letter-spacing: -1px;
  margin: 10px 0 6px;
  line-height: 1.15;
}
.hero h1 .sun { display: inline-block; }
.hero .sub {
  color: var(--text-secondary);
  font-size: clamp(13px, 2.5vw, 15px);
  max-width: 560px;
  margin: 0 auto 6px;
}
.hero .sub a { color: var(--accent); }
.hero .hero-stats {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.hero .hstat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 18px;
  text-align: center;
}
.hero .hstat .v { font-size: 20px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.hero .hstat .l { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; margin-top: 2px; }

/* Category chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 16px 0 4px; }
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #0a0a0b; font-weight: 600; }

/* Tool grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

/* Section header with count */
.cat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.cat-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.cat-count { font-size: 11px; color: var(--text-muted); font-weight: 400; }

/* ============================================================
   Guide / Article pages
   ============================================================ */
.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.5; }

.guide {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 24px;
}
.guide h1 {
  font-size: clamp(24px, 4.5vw, 34px);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin-bottom: 12px;
}
.guide .guide-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.guide h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text);
  letter-spacing: -0.3px;
}
.guide h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text);
}
.guide p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.75;
}
.guide ul, .guide ol {
  margin: 0 0 14px 22px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
}
.guide li { margin-bottom: 6px; }
.guide strong { color: var(--text); }
.guide blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 16px;
  margin: 16px 0;
  color: var(--text-secondary);
  font-style: italic;
  background: var(--accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.guide code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
}
.guide pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.6;
}
.guide pre code { background: none; border: none; padding: 0; }
.guide img { border-radius: var(--radius); border: 1px solid var(--border); }
.guide hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

/* Root-level guide articles (/guides/*.html) */
.article-content {
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.8;
  font-size: 15px;
}
.article-content h1 { font-size: clamp(24px, 4.5vw, 30px); font-weight: 800; letter-spacing: -0.5px; margin: 20px 0 12px; line-height: 1.2; }
.article-content h2 { font-size: 20px; margin: 28px 0 10px; color: var(--accent); font-weight: 700; }
.article-content h3 { font-size: 16px; margin: 20px 0 8px; }
.article-content p { margin: 12px 0; color: var(--text-secondary); }
.article-content ul, .article-content ol { margin: 12px 0; padding-left: 24px; color: var(--text-secondary); }
.article-content li { margin: 6px 0; }
.article-content strong { color: var(--text); }
.article-content .intro { font-size: 17px; color: var(--text); border-left: 3px solid var(--accent); padding-left: 16px; margin: 20px 0; }
.article-content .tip { background: var(--accent-bg); border: 1px solid var(--accent); border-left: 3px solid var(--accent); padding: 14px 18px; border-radius: 8px; margin: 16px 0; font-size: 14px; color: var(--text-secondary); }
.ad-inline { margin: 28px auto; text-align: center; }

/* CTA box inside guides: link back to the tool */
.guide-cta {
  margin: 28px 0 8px;
  padding: 18px 20px;
  background: var(--accent-bg);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.guide-cta .ic { font-size: 28px; }
.guide-cta strong { color: var(--text); }
.guide-cta .btn { margin-left: auto; }

/* Related guides */
.related {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.related h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.related-card {
  display: block;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.related-card:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.related-card .mt { display: block; font-size: 10px; color: var(--text-muted); font-weight: 400; margin-top: 4px; }

/* Guide listing cards (hub + tool guide indexes) */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.article-card {
  text-decoration: none;
  color: inherit;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: block;
  transition: var(--transition);
}
.article-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,0.35); text-decoration: none; }
.article-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; line-height: 1.35; color: var(--text); }
.article-card .mt { font-size: 11px; color: var(--text-muted); margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.article-card .mt .src { color: var(--accent); font-weight: 500; }

/* Tool chips (hub) */
.tool-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tool-chips a {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.tool-chips a:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   Static pages (privacy, terms, about, media kit)
   ============================================================ */
.static-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 0 48px;
}
.static-page h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.static-page .date { color: var(--text-muted); font-size: 13px; margin-bottom: 28px; }
.static-page h2 { font-size: 18px; margin: 28px 0 12px; color: var(--accent); }
.static-page h3 { font-size: 15px; margin: 18px 0 8px; color: var(--text); }
.static-page p, .static-page li { color: var(--text-secondary); font-size: 14px; margin-bottom: 8px; line-height: 1.7; }
.static-page ul, .static-page ol { padding-left: 20px; margin-bottom: 12px; }
.static-page a { color: var(--accent); }
.static-page .card { margin-bottom: 12px; }
.static-page table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.static-page th { text-align: left; padding: 8px 10px; border-bottom: 2px solid var(--border); color: var(--text); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.static-page td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  text-align: center;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  font-size: 12px;
  color: var(--text-muted);
}
.site-footer .links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.site-footer .links a { color: var(--text-secondary); text-decoration: none; }
.site-footer .links a:hover { color: var(--accent); }
.site-footer .fine { font-size: 11px; opacity: 0.8; }
.site-footer .fine a { color: var(--text-muted); }

.guide-footer {
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  margin-top: 24px;
  font-size: 11px;
  color: var(--text-muted);
}
.guide-footer a { color: var(--text-secondary); }

/* ============================================================
   404
   ============================================================ */
.error-page { text-align: center; padding: 80px 20px; }
.error-page .code { font-size: 72px; font-weight: 800; color: var(--accent); line-height: 1; }
.error-page h1 { font-size: 20px; margin: 12px 0 6px; }
.error-page p { color: var(--text-secondary); font-size: 14px; margin-bottom: 20px; }

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 480px) {
  .form-row { flex-direction: column; }
  .stats-row { flex-wrap: wrap; }
  .stat-card { min-width: calc(50% - 4px); }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .guide-cta .btn { margin-left: 0; }
}


/* ============================================================
   June — rebuilt site shell
   Appended after base.css. Adds the global bar, command palette,
   guide layout, data manager, and small fixes.
   ============================================================ */

/* ---------- global top bar ---------- */
.topbar {
  position: relative;
  z-index: 30;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 11, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.3px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.topbar .brand .sun { font-size: 19px; line-height: 1; }
.topbar .brand:hover { color: var(--accent); text-decoration: none; }
.topbar nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  flex: 1;
}
.topbar nav a {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 6px 9px;
  border-radius: 7px;
  text-decoration: none;
  white-space: nowrap;
}
.topbar nav a:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.topbar nav a.active { color: var(--accent); background: var(--accent-bg); }
.palette-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.palette-open:hover { border-color: var(--border-hover); color: var(--text-secondary); }
.palette-open kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  border: 1px solid var(--border-hover);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 4px;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .topbar nav a.hide-sm { display: none; }
  .palette-open kbd { display: none; }
  .topbar-inner { gap: 8px; padding: 8px 14px; }
  .topbar nav { margin-left: 0; gap: 0; }
  .topbar nav a { padding: 6px; font-size: 12px; }
}

/* tool header is sticky; keep it below the top of the viewport */
.tool-header { top: 0; }

/* ---------- command palette ---------- */
.palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.palette-backdrop[hidden] { display: none; }
.palette {
  width: 100%;
  max-width: 620px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.palette input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  padding: 16px 18px;
  outline: none;
}
.palette input::placeholder { color: var(--text-muted); }
.palette-results { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette-group {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
}
.palette-item .ic { width: 22px; text-align: center; flex-shrink: 0; }
.palette-item .nm { color: var(--text); font-size: 14px; font-weight: 600; }
.palette-item .ds {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.palette-item .pill {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 7px;
  flex-shrink: 0;
}
.palette-item.sel { background: var(--accent-bg); text-decoration: none; }
.palette-item.sel .nm { color: var(--accent); }
.palette-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.palette-hint {
  display: flex;
  gap: 14px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
}

/* ---------- footer ---------- */
footer.site-footer {
  text-align: center;
  padding: 32px 16px 40px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  font-size: 12px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}
footer.site-footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  justify-content: center;
  margin-bottom: 10px;
}
footer.site-footer a { color: var(--text-secondary); text-decoration: none; }
footer.site-footer a:hover { color: var(--accent); }
footer.site-footer .fine { font-size: 11px; color: var(--text-muted); }

/* ---------- home ---------- */
.hero { padding: 44px 0 8px; }
.hero h1 { font-size: clamp(34px, 6vw, 54px); letter-spacing: -1.5px; line-height: 1.1; }
.hero .sub { max-width: 640px; margin: 12px auto 0; color: var(--text-secondary); font-size: 16px; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 10px; color: var(--text-muted); margin-bottom: 10px; }
.hero .eyebrow a { color: var(--text-muted); }
.recent-section { margin: 8px 0 4px; }
.recent-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
}
.recent-chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.section { margin: 30px 0; }
.section > h2, .section-head {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 600;
}
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  position: relative;
  transition: border-color 0.15s, transform 0.15s;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-1px); text-decoration: none; }
.tool-card .icn { font-size: 20px; line-height: 1.3; flex-shrink: 0; }
.tool-card .nm { display: block; font-size: 13px; font-weight: 650; }
.tool-card .ds { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.tool-card .go { position: absolute; right: 10px; top: 10px; color: var(--text-muted); font-size: 12px; opacity: 0; }
.tool-card:hover .go { opacity: 1; color: var(--accent); }
.empty-search { text-align: center; padding: 50px 20px; color: var(--text-muted); display: none; }

.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--text-secondary);
  font-size: 13px;
  margin: 20px 0;
}
.notice strong { color: var(--text); }

/* ---------- guide hub / article cards ---------- */
.guide-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 18px; }
.guide-tools a {
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  color: var(--text-secondary);
  text-decoration: none;
  background: var(--bg-card);
}
.guide-tools a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.article-card {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
}
.article-card:hover { border-color: var(--accent); text-decoration: none; }
.article-card h3 { font-size: 13px; font-weight: 600; line-height: 1.4; margin-bottom: 5px; }
.article-card .mt { font-size: 10px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }
.article-card .src { color: var(--accent); }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.cat-title { font-size: 17px; font-weight: 700; letter-spacing: -0.2px; }
.cat-count { font-size: 11px; color: var(--text-muted); }

/* ---------- article page ---------- */
.prose-page { max-width: 760px; }
.breadcrumbs { font-size: 12px; color: var(--text-muted); margin: 18px 0 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumbs a { color: var(--text-secondary); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { opacity: 0.5; }
.prose-page h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.2; letter-spacing: -0.6px; margin-bottom: 10px; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--text-muted);
  font-size: 11px;
  padding-bottom: 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.article-meta .dot { opacity: 0.4; }
.prose {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.prose h2 { font-size: 21px; line-height: 1.3; color: var(--text); margin: 34px 0 10px; letter-spacing: -0.3px; }
.prose h3 { font-size: 17px; color: var(--text); margin: 24px 0 8px; }
.prose p { margin: 14px 0; }
.prose ul, .prose ol { margin: 14px 0 14px 22px; }
.prose li { margin: 6px 0; }
.prose blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 16px; margin: 18px 0; color: var(--text); font-style: italic; }
.prose img { border-radius: 8px; margin: 16px 0; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--text); }
.prose .lead { font-size: 17px; color: var(--text); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }
.toc {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 22px 0;
  font-size: 13px;
}
.toc strong { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px; }
.toc ol { margin: 0 0 0 18px; }
.toc li { margin: 3px 0; }
.toc a { color: var(--text-secondary); text-decoration: none; }
.toc a:hover { color: var(--accent); }

.cta-box {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg-card));
  border-radius: 12px;
  padding: 16px 18px;
  margin: 32px 0 10px;
}
.cta-box .ic { font-size: 28px; }
.cta-box .cta-txt { flex: 1; min-width: 200px; font-size: 13px; color: var(--text-secondary); }
.cta-box .cta-txt strong { color: var(--text); }
.prevnext { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0; }
.prevnext a {
  flex: 1;
  min-width: 240px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 14px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 12px;
  background: var(--bg-card);
}
.prevnext a:hover { border-color: var(--accent); text-decoration: none; }
.prevnext .dir { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 3px; }

/* ---------- static pages ---------- */
.static-page { max-width: 720px; margin: 0 auto; padding: 8px 0 20px; }
.static-page h1 { font-size: 32px; letter-spacing: -0.6px; margin: 18px 0 10px; }
.static-page h2 { font-size: 19px; margin: 26px 0 8px; color: var(--text); }
.static-page p, .static-page li { color: var(--text-secondary); font-size: 15px; line-height: 1.75; margin: 10px 0; }
.static-page ul { margin-left: 22px; }
.static-page a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- data manager ---------- */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 16px 0; }
.data-table th, .data-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.data-table th { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; }
.data-table td.num { font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.data-table .tool { color: var(--text); font-weight: 600; }
.data-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.data-empty { color: var(--text-muted); padding: 28px 0; text-align: center; }
.danger-link { color: var(--danger) !important; }

/* ---------- generic entry app (rebuilt tools) ---------- */
.entry-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 12px 0; }
.entry-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 13px 14px;
  position: relative;
}
.entry-card:hover { border-color: var(--border-hover); }
.entry-card .en { font-size: 14px; font-weight: 650; padding-right: 52px; }
.entry-card .etags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.entry-card .etag {
  font-size: 10px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 10px;
  padding: 1px 7px;
}
.entry-card .emeta { font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.entry-card .eacts { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity 0.15s; }
.entry-card:hover .eacts, .entry-card:focus-within .eacts { opacity: 1; }
.entry-card .eacts button {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 4px;
  font: inherit;
  font-size: 10px;
  padding: 2px 6px;
  cursor: pointer;
}
.entry-card .eacts button:hover { border-color: var(--accent); color: var(--accent); }
@media (hover: none) { .entry-card .eacts { opacity: 1; } }

/* ---------- misc ---------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 8px;
  top: -50px;
  background: var(--accent);
  color: #000;
  padding: 8px 12px;
  border-radius: 6px;
  z-index: 999;
  font-size: 13px;
  font-weight: 600;
}
.skip-link:focus { top: 8px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .topbar, footer.site-footer, .palette-backdrop, .cta-box, .prevnext, .related, .guide-tools { display: none !important; }
  body { background: #fff; color: #111; }
  body::before { display: none; }
  .prose, .prose p, .static-page p { color: #222; }
}
