/* ===== RESET & BASE ===== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth}
body{font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.6;color:#1e293b;background:#f8fafc;transition:background 0.3s,color 0.3s}
body.dark{color:#e2e8f0;background:#0f172a}
img,svg{display:block;max-width:100%}
a{color:inherit;text-decoration:none}
ul{list-style:none}

/* ===== SKIP LINK ===== */
.skip-link{position:absolute;top:-100px;left:0;background:#4f46e5;color:#fff;padding:0.5rem 1rem;z-index:1000;border-radius:0 0 6px 0;font-weight:600}
.skip-link:focus{top:0}

/* ===== CONTAINER ===== */
.container{width:min(100% - 2rem,1100px);margin-inline:auto}

/* ===== HEADER ===== */
.site-header{background:#fff;border-bottom:1px solid #e2e8f0;position:sticky;top:0;z-index:100;backdrop-filter:blur(8px);background:rgba(255,255,255,0.85)}
body.dark .site-header{background:rgba(15,23,42,0.85);border-color:#334155}
.header-inner{display:flex;align-items:center;justify-content:space-between;padding-block:0.75rem;flex-wrap:wrap;gap:0.75rem}
.logo{display:flex;align-items:center;gap:0.5rem;font-weight:700;font-size:1.25rem;color:#0f172a}
body.dark .logo{color:#f1f5f9}
.nav-list{display:flex;gap:1.5rem;font-weight:500;font-size:0.95rem}
.nav-list a:hover,.nav-list a:focus-visible{color:#4f46e5;text-decoration:underline}
.theme-toggle{background:none;border:1px solid #cbd5e1;border-radius:8px;padding:0.4rem;cursor:pointer;color:#475569;display:flex;align-items:center;transition:border-color 0.2s}
body.dark .theme-toggle{border-color:#475569;color:#cbd5e1}
.theme-toggle:hover{border-color:#4f46e5}
.sun-icon,.moon-icon{transition:opacity 0.2s}
body:not(.dark) .moon-icon,body.dark .sun-icon{display:none}

/* ===== HERO ===== */
.hero{padding:3rem 0 1.5rem;text-align:center}
.hero h1{font-size:clamp(2rem,5vw,2.8rem);font-weight:800;letter-spacing:-0.02em;color:#0f172a;margin-bottom:0.75rem}
body.dark .hero h1{color:#f8fafc}
.hero-sub{max-width:640px;margin:0 auto;font-size:1.125rem;color:#475569}
body.dark .hero-sub{color:#94a3b8}

/* ===== TOOL SECTION ===== */
.tool-section{padding:1.5rem 0 3rem}
.tool-grid{display:grid;grid-template-columns:1fr 1fr;gap:1.5rem;align-items:start}
@media(max-width:700px){.tool-grid{grid-template-columns:1fr}}
.tool-panel{background:#fff;border-radius:16px;border:1px solid #e2e8f0;box-shadow:0 4px 12px rgba(0,0,0,0.03);overflow:hidden;display:flex;flex-direction:column}
body.dark .tool-panel{background:#1e293b;border-color:#334155}
.panel-header{display:flex;align-items:center;justify-content:space-between;padding:0.75rem 1rem;border-bottom:1px solid #e2e8f0;background:#f1f5f9}
body.dark .panel-header{background:#0f172a;border-color:#334155}
.panel-title{font-weight:700;font-size:0.9rem;text-transform:uppercase;letter-spacing:0.04em;color:#475569}
body.dark .panel-title{color:#cbd5e1}
.mode-switch{display:flex;gap:0.25rem;background:#e2e8f0;padding:0.2rem;border-radius:10px}
body.dark .mode-switch{background:#334155}
.mode-btn{border:none;background:transparent;padding:0.3rem 0.9rem;border-radius:8px;font-weight:600;font-size:0.85rem;cursor:pointer;color:#475569;transition:all 0.2s}
.mode-btn.active{background:#fff;color:#0f172a;box-shadow:0 1px 4px rgba(0,0,0,0.08)}
body.dark .mode-btn.active{background:#0f172a;color:#e2e8f0;box-shadow:0 1px 6px rgba(0,0,0,0.4)}
.mode-label{font-size:0.8rem;font-weight:600;color:#4f46e5;background:#ede9fe;padding:0.15rem 0.7rem;border-radius:20px}
body.dark .mode-label{background:#312e81;color:#c7d2fe}
.code-area{width:100%;min-height:200px;padding:1rem;border:none;resize:vertical;font-family:'Fira Code','Cascadia Code',Consolas,monospace;font-size:0.95rem;line-height:1.6;background:#fff;color:#0f172a;outline:none}
body.dark .code-area{background:#1e293b;color:#e2e8f0}
.code-area::placeholder{color:#94a3b8}
.panel-actions{display:flex;align-items:center;gap:0.75rem;padding:0.75rem 1rem;border-top:1px solid #e2e8f0;flex-wrap:wrap}
body.dark .panel-actions{border-color:#334155}

/* ===== BUTTONS ===== */
.btn{border:none;padding:0.5rem 1.2rem;border-radius:10px;font-weight:600;font-size:0.9rem;cursor:pointer;display:inline-flex;align-items:center;gap:0.4rem;transition:background 0.2s,transform 0.1s,box-shadow 0.2s}
.btn:active{transform:scale(0.97)}
.btn-primary{background:#4f46e5;color:#fff}
.btn-primary:hover{background:#4338ca;box-shadow:0 4px 10px rgba(79,70,229,0.35)}
.btn-secondary{background:#f1f5f9;color:#1e293b;border:1px solid #cbd5e1}
body.dark .btn-secondary{background:#1e293b;color:#e2e8f0;border-color:#475569}
.btn-secondary:hover{background:#e2e8f0}
body.dark .btn-secondary:hover{background:#334155}
.copy-feedback{font-size:0.85rem;color:#16a34a;font-weight:600}

/* ===== REFERENCE TABLE ===== */
.reference{padding:2rem 0 3rem}
.reference h2{font-size:1.8rem;font-weight:700;margin-bottom:0.25rem;color:#0f172a}
body.dark .reference h2{color:#f1f5f9}
.ref-sub{color:#475569;margin-bottom:1.5rem}
body.dark .ref-sub{color:#94a3b8}
.table-scroll{overflow-x:auto;border-radius:12px;border:1px solid #e2e8f0}
body.dark .table-scroll{border-color:#334155}
.entity-table{width:100%;border-collapse:collapse;background:#fff;text-align:left}
body.dark .entity-table{background:#1e293b}
.entity-table th,.entity-table td{padding:0.75rem 1rem;border-bottom:1px solid #e2e8f0}
body.dark .entity-table th,body.dark .entity-table td{border-color:#334155}
.entity-table th{background:#f8fafc;font-weight:700;font-size:0.85rem;text-transform:uppercase;letter-spacing:0.03em;color:#475569}
body.dark .entity-table th{background:#0f172a;color:#cbd5e1}
.entity-table td:first-child{font-weight:700;font-size:1.2rem}
.entity-table td:nth-child(2),.entity-table td:nth-child(3){font-family:monospace;font-size:0.9rem}

/* ===== WHY SECTION ===== */
.why{padding:2rem 0 4rem}
.why h2{font-size:1.8rem;font-weight:700;margin-bottom:1.5rem;color:#0f172a}
body.dark .why h2{color:#f1f5f9}
.why-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:1.5rem}
.why-card{background:#fff;border-radius:14px;padding:1.5rem;border:1px solid #e2e8f0;box-shadow:0 2px 8px rgba(0,0,0,0.02)}
body.dark .why-card{background:#1e293b;border-color:#334155}
.why-card h3{font-size:1.15rem;font-weight:700;margin-bottom:0.5rem;color:#0f172a}
body.dark .why-card h3{color:#f1f5f9}
.why-card p{color:#475569;font-size:0.95rem}
body.dark .why-card p{color:#cbd5e1}
.why-card code{background:#f1f5f9;padding:0.1rem 0.4rem;border-radius:4px;font-size:0.85em}
body.dark .why-card code{background:#334155;color:#facc15}

/* ===== FOOTER ===== */
.site-footer{border-top:1px solid #e2e8f0;padding:1.5rem 0;background:#fff}
body.dark .site-footer{background:#0f172a;border-color:#334155}
.footer-inner{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem;font-size:0.9rem;color:#475569}
body.dark .footer-inner{color:#94a3b8}
.footer-nav{display:flex;gap:1.5rem}
.footer-nav a:hover{text-decoration:underline}

/* ===== ABOUT / LEGAL PAGES ===== */
.page-content{padding:3rem 0;max-width:720px}
.page-content h1{font-size:2.2rem;font-weight:800;margin-bottom:1.5rem}
.page-content p,.page-content li{color:#334155;margin-bottom:1rem}
body.dark .page-content p,body.dark .page-content li{color:#cbd5e1}
.page-content a{color:#4f46e5;text-decoration:underline}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
