/* scam.smilestory.ai (ScamGuard) — site theme overlay. Written 2026-10-28 (family56 bundle B).
   ORIGINAL look = DARK (templates/layout.php inline <style>, :root tokens --bg #0a0a0f …). Nothing in layout.php is changed;
   every rule below is scoped to html[data-theme="light"], so dark renders exactly as before (0px diff when nothing is saved).
   Load position: <link rel="stylesheet" href="/site-theme.css?v=20261028"> right before </head> in templates/layout.php
   (= after the inline <style> that ends at layout.php line ~236). The engine (site-theme.js) goes in <head> before that <style>.
   The site CSS sets its tokens on :root; html[data-theme="light"]{--x} wins on specificity, so most of the page follows the
   token table alone. Explicit rules below are only for places where layout.php hard-codes a colour (header rgba, logo/hero
   gradients, rgba badge tints, #dc2626 danger hover, focus rings) or where a lighter tint reads better on white.

   Light palette (contrast on #fff unless noted)
   ┌───────────────┬──────────┬───────────────────────────────────────────────┐
   │ --bg (page)   │ #f7f8fb  │                                               │
   │ --bg2 (card)  │ #ffffff  │ header / cards / panels / footer              │
   │ --bg3 (inset) │ #f1f3f8  │ detail-item, table th, hover rows, tab hover  │
   │ --bg4 (chip)  │ #e6e9f1  │ .category-tag                                 │
   │ --text        │ #0f172a  │ 17.9:1                                        │
   │ --text2       │ #475569  │ 7.6:1 (6.8:1 on --bg3)                        │
   │ --text3       │ #5b6678  │ 5.8:1 (5.2:1 on --bg3) — .75rem uppercase labels, so not #64748b (4.3:1 on --bg3) │
   │ --primary     │ #4f46e5  │ 6.3:1 as text; white on it 6.3:1 (buttons, active tab, current page) │
   │ --primary-hov │ #4338ca  │ 7.9:1                                         │
   │ --danger      │ #b91c1c  │ 5.9:1 on #fef2f2 badge; white on it 6.5:1     │
   │ --warning     │ #b45309  │ 4.8:1 on #fffbeb badge                        │
   │ --success     │ #15803d  │ 4.8:1 on #f0fdf4 badge                        │
   │ --border      │ #e2e8f0  │ card/section lines; form controls use #cbd5e1 │
   └───────────────┴──────────┴───────────────────────────────────────────────┘
   #6366f1 (original indigo) is only 4.5:1 on white → text/links use #4f46e5. No !important needed anywhere: every inline
   style="…" in the templates (about/404/detail pages, JS-rendered results) uses var(--text|--text2|--text3|--primary|--danger),
   which the token block re-colours. color-scheme is set by the engine on <html>, not here. */

/* ===== tokens ===== */
html[data-theme="light"] {
  --bg: #f7f8fb; --bg2: #ffffff; --bg3: #f1f3f8; --bg4: #e6e9f1;
  --text: #0f172a; --text2: #475569; --text3: #5b6678;
  --primary: #4f46e5; --primary-hover: #4338ca;
  --danger: #b91c1c; --warning: #b45309; --success: #15803d;
  --border: #e2e8f0;
}
html[data-theme="light"] body { background: #f7f8fb; color: #0f172a; }
html[data-theme="light"] ::selection { background: rgba(79,70,229,.18); }

/* ===== header (layout.php: .header sets background twice — the 2nd, rgba(18,18,26,.9), is hard-coded) ===== */
html[data-theme="light"] .header { background: rgba(255,255,255,.88); border-bottom-color: #e2e8f0; }
html[data-theme="light"] .logo { color: #0f172a; }
/* logo wordmark gradient was var(--primary)→#a78bfa; #a78bfa is 2.5:1 on white → deeper violet */
html[data-theme="light"] .logo span {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
html[data-theme="light"] .nav-links a { color: #334155; }
html[data-theme="light"] .nav-links a:hover { color: #4f46e5; }
html[data-theme="light"] .lang-select { background: #fff; color: #0f172a; border-color: #cbd5e1; }
html[data-theme="light"] .lang-select:focus { border-color: #4f46e5; }

/* ===== hero + stats (home) ===== */
html[data-theme="light"] .hero { background: linear-gradient(180deg, #ffffff 0%, #f7f8fb 100%); }
/* h1 gradient was #fff→#a0a0d0 (invisible on white) */
html[data-theme="light"] .hero h1 {
  background: linear-gradient(135deg, #0f172a 0%, #312e81 60%, #4f46e5 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
html[data-theme="light"] .hero p { color: #475569; }
html[data-theme="light"] .stat-badge { background: #fff; border-color: #e2e8f0; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
html[data-theme="light"] .stat-badge .num { color: #4f46e5; }
html[data-theme="light"] .stat-badge .label { color: #5b6678; }

/* ===== search tabs + panels (home) ===== */
html[data-theme="light"] .tabs { background: #fff; border-color: #e2e8f0; }
html[data-theme="light"] .tab { color: #475569; }
html[data-theme="light"] .tab:hover { color: #0f172a; background: #f1f3f8; }
html[data-theme="light"] .tab.active { background: #4f46e5; color: #fff; }
html[data-theme="light"] .tab.active:hover { background: #4338ca; }
html[data-theme="light"] .search-panel { background: #fff; border-color: #e2e8f0; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
html[data-theme="light"] .search-hint { color: #5b6678; }

/* ===== form controls (search row, report form) — white field + #cbd5e1 line, indigo focus ring ===== */
html[data-theme="light"] .search-row select,
html[data-theme="light"] .search-row input,
html[data-theme="light"] .form-group select,
html[data-theme="light"] .form-group input,
html[data-theme="light"] .form-group textarea { background: #fff; color: #0f172a; border-color: #7b879c; }  /* 2026-10-28 리뷰: 입력창 테두리 3:1(#cbd5e1 1.5:1 → #7b879c 3.6:1) */
html[data-theme="light"] .search-row select:focus,
html[data-theme="light"] .search-row input:focus,
html[data-theme="light"] .form-group select:focus,
html[data-theme="light"] .form-group input:focus,
html[data-theme="light"] .form-group textarea:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.18); }
html[data-theme="light"] .search-row input::placeholder,
html[data-theme="light"] .form-group input::placeholder,
html[data-theme="light"] .form-group textarea::placeholder { color: #64748b; }
html[data-theme="light"] .form-group label { color: #334155; }

/* ===== buttons ===== */
html[data-theme="light"] .btn-primary { background: #4f46e5; color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.22); }
html[data-theme="light"] .btn-primary:hover { background: #4338ca; }
html[data-theme="light"] .btn-danger { background: #b91c1c; color: #fff; }
html[data-theme="light"] .btn-danger:hover { background: #991b1b; }   /* original hover is hard-coded #dc2626 */

/* ===== cards / results / sections ===== */
html[data-theme="light"] .result-card,
html[data-theme="light"] .report-section,
html[data-theme="light"] .detail-card,
html[data-theme="light"] .recent-item { background: #fff; border-color: #e2e8f0; }
html[data-theme="light"] .result-card,
html[data-theme="light"] .report-section,
html[data-theme="light"] .detail-card { box-shadow: 0 1px 3px rgba(15,23,42,.06); }
html[data-theme="light"] .result-card:hover { border-color: #4f46e5; }
html[data-theme="light"] .result-target { color: #0f172a; }
html[data-theme="light"] .result-target:hover { color: #4f46e5; }
html[data-theme="light"] .result-meta,
html[data-theme="light"] .result-desc { color: #475569; }
html[data-theme="light"] .category-tag { background: #e6e9f1; color: #0f172a; }
html[data-theme="light"] .no-results { color: #5b6678; }
html[data-theme="light"] .no-results h3 { color: #0f172a; }
html[data-theme="light"] .ad-space { background: #fff; border-color: #cbd5e1; color: #5b6678; }
html[data-theme="light"] .spinner { border-color: #e2e8f0; border-top-color: #4f46e5; }

/* risk badges: original rgba(…,.15) tints read as dirty grey on white → flat pastel + darkened text */
html[data-theme="light"] .risk-high   { background: #fef2f2; color: #b91c1c; border-color: rgba(185,28,28,.35); }
html[data-theme="light"] .risk-medium { background: #fffbeb; color: #b45309; border-color: rgba(180,83,9,.35); }
html[data-theme="light"] .risk-low    { background: #f0fdf4; color: #15803d; border-color: rgba(21,128,61,.35); }

/* recent reports (home) */
html[data-theme="light"] .recent-type.phone   { background: #eef2ff; color: #4f46e5; }
html[data-theme="light"] .recent-type.account { background: #fffbeb; color: #b45309; }
html[data-theme="light"] .recent-type.crypto  { background: #fef2f2; color: #b91c1c; }
html[data-theme="light"] .recent-target { color: #0f172a; }
html[data-theme="light"] .recent-cat,
html[data-theme="light"] .recent-time { color: #5b6678; }

/* alerts */
html[data-theme="light"] .alert-success { background: #f0fdf4; border-color: rgba(21,128,61,.35); color: #15803d; }
html[data-theme="light"] .alert-error   { background: #fef2f2; border-color: rgba(185,28,28,.35); color: #b91c1c; }

/* ===== detail / country / policy / about pages (shared shell) ===== */
html[data-theme="light"] .detail-item { background: #f1f3f8; }
html[data-theme="light"] .detail-item .detail-label { color: #5b6678; }
html[data-theme="light"] .detail-item .detail-value { color: #0f172a; }
html[data-theme="light"] .breadcrumb { color: #5b6678; }
html[data-theme="light"] .breadcrumb a { color: #475569; }
html[data-theme="light"] .breadcrumb a:hover { color: #4f46e5; }
html[data-theme="light"] .breadcrumb span.sep { color: #94a3b8; }
html[data-theme="light"] .pagination a,
html[data-theme="light"] .pagination span { background: #fff; border-color: #e2e8f0; color: #475569; }
html[data-theme="light"] .pagination a:hover { border-color: #4f46e5; color: #0f172a; }
html[data-theme="light"] .pagination span.current { background: #4f46e5; border-color: #4f46e5; color: #fff; }
html[data-theme="light"] .explorer-links a { background: #f1f3f8; border-color: #e2e8f0; color: #475569; }
html[data-theme="light"] .explorer-links a:hover { border-color: #4f46e5; color: #4f46e5; }
html[data-theme="light"] .phone-list th { background: #f1f3f8; color: #5b6678; border-bottom-color: #e2e8f0; }
html[data-theme="light"] .phone-list td { border-bottom-color: #e2e8f0; color: #0f172a; }
html[data-theme="light"] .phone-list tr:hover { background: #f1f3f8; }
html[data-theme="light"] .policy-page h2 { color: #4f46e5; border-bottom-color: #e2e8f0; }
html[data-theme="light"] .policy-page p,
html[data-theme="light"] .policy-page ul { color: #334155; }
html[data-theme="light"] .policy-update { color: #5b6678; }
html[data-theme="light"] .policy-contact { background: #f1f3f8; }

/* ===== footer ===== */
html[data-theme="light"] .footer { background: #fff; border-top-color: #e2e8f0; color: #5b6678; }
html[data-theme="light"] .footer-links a { color: #4f46e5; }
html[data-theme="light"] .footer-links a:hover { color: #4338ca; }

/* ===== site-theme button (engine injects .wst-wrap before #langSelect; its own CFG.btnCss/menuCss use the tokens above,
   so it re-colours with the theme — only the hover line is needed here) ===== */
html[data-theme="light"] .header .wst-btn { background: #fff; border-color: #cbd5e1; color: #0f172a; }
html[data-theme="light"] .header .wst-btn:hover { border-color: #4f46e5; background: #eef2ff; }
html[data-theme="light"] .header .wst-menu { background: #fff; border-color: #e2e8f0; color: #0f172a; box-shadow: 0 12px 32px rgba(15,23,42,.16); }
html[data-theme="light"] .header .wst-menu button:hover,
html[data-theme="light"] .header .wst-menu button:focus-visible { background: #eef2ff; }
