/* Modern minimal UI with light/dark themes (CSS variables) */

:root {
    --bg: #f6f7fb;
    --bg2: #ffffff;
    --card: rgba(255, 255, 255, 0.75);
    --text: #0f172a;
    --muted: #64748b;
    --border: rgba(15, 23, 42, 0.10);
    --shadow: 0 20px 45px rgba(2, 6, 23, 0.10);
    --accent: #5b6cff;
    --accent2: #22c55e;
    --danger: #ef4444;
    --warn: #f59e0b;
    --ring: rgba(91, 108, 255, 0.25);
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

html[data-theme="dark"] {
    --bg: #0b1020;
    --bg2: #0f172a;
    --card: rgba(15, 23, 42, 0.72);
    --text: #e5e7eb;
    --muted: #94a3b8;
    --border: rgba(226, 232, 240, 0.10);
    --shadow: 0 25px 70px rgba(0, 0, 0, 0.55);
    --accent: #8b5cf6;
    --accent2: #22c55e;
    --danger: #fb7185;
    --warn: #fbbf24;
    --ring: rgba(139, 92, 246, 0.25);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: radial-gradient(1200px 600px at 10% -10%, rgba(91,108,255,0.22), transparent 60%),
                radial-gradient(1000px 600px at 90% 10%, rgba(34,197,94,0.16), transparent 55%),
                linear-gradient(180deg, var(--bg), var(--bg2));
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: var(--mono);
    font-size: 0.95em;
    padding: 0.10em 0.35em;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.03);
    border-radius: 8px;
}
html[data-theme="dark"] code { background: rgba(255,255,255,0.06); }


/* Allow long hashes/URLs to wrap without overflowing */
code.break {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    word-break: break-all;
    overflow-wrap: anywhere;
}


.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.55);
}
html[data-theme="dark"] .topbar { background: rgba(2,6,23,0.40); }

.topbar-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(135deg, var(--accent), rgba(34,197,94,0.9));
    box-shadow: 0 10px 25px rgba(91,108,255,0.25);
}
.brand-name { font-size: 16px; }

.theme-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px;
    gap: 4px;
    background: rgba(255,255,255,0.55);
}
html[data-theme="dark"] .theme-toggle { background: rgba(15,23,42,0.55); }

.chip {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 13px;
    transition: transform 120ms ease, background 120ms ease, color 120ms ease;
}
.chip:hover { transform: translateY(-1px); }
.chip[aria-pressed="true"] {
    background: rgba(91,108,255,0.14);
    color: var(--text);
}

.theme-locked {
    font-size: 13px;
    color: var(--muted);
    padding: 8px 10px;
    border: 1px dashed var(--border);
    border-radius: 12px;
}

.container {
    max-width: 980px;
    width: 100%;
    margin: 0 auto;
    padding: 26px 18px 36px;
}

.hero { padding-top: 10px; }
.hero-card { display: grid; gap: 14px; }
.hero h1 {
    margin: 0;
    font-size: clamp(28px, 3.4vw, 40px);
    letter-spacing: -0.03em;
}
.accent { color: var(--accent); }
.lead { margin: 0; color: var(--muted); line-height: 1.55; }

.card {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.card.danger { border-color: rgba(239,68,68,0.25); }

.stack { display: grid; gap: 16px; }

.field { display: grid; gap: 8px; }
.label { font-weight: 600; font-size: 14px; }
.hint { font-size: 12.5px; color: var(--muted); }

.input, .file {
    width: 100%;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.65);
    color: var(--text);
    outline: none;
}
html[data-theme="dark"] .input, html[data-theme="dark"] .file {
    background: rgba(2, 6, 23, 0.35);
}

.input:focus, .file:focus {
    border-color: rgba(91,108,255,0.55);
    box-shadow: 0 0 0 6px var(--ring);
}

.mono { font-family: var(--mono); font-size: 13px; }

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 740px) {
    .grid { grid-template-columns: 1fr; }
}

.switch {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,0.45);
}
html[data-theme="dark"] .switch { background: rgba(2,6,23,0.25); }
.switch input { display: none; }

.switch-ui {
    width: 42px; height: 26px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.06);
    position: relative;
    transition: background 160ms ease, border 160ms ease;
}
.switch-ui::after {
    content: "";
    width: 20px; height: 20px;
    border-radius: 999px;
    position: absolute;
    top: 50%;
    left: 3px;
    transform: translateY(-50%);
    background: white;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    transition: transform 180ms ease;
}
html[data-theme="dark"] .switch-ui::after { background: rgba(226,232,240,0.92); }

.switch input:checked + .switch-ui {
    background: rgba(91,108,255,0.22);
    border-color: rgba(91,108,255,0.45);
}
.switch input:checked + .switch-ui::after {
    transform: translate(16px, -50%);
}

.switch-text .label { font-size: 13.5px; }
.switch-text .hint { margin-top: 2px; }

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 6px;
}

.btn {
    border: 0;
    cursor: pointer;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 650;
    background: linear-gradient(135deg, var(--accent), rgba(34,197,94,0.92));
    color: white;
    transition: transform 120ms ease, filter 120ms ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); text-decoration: none; }
.btn:active { transform: translateY(0px); }

.btn.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn.ghost:hover { background: rgba(91,108,255,0.10); }

.btn.danger {
    background: linear-gradient(135deg, var(--danger), rgba(251,113,133,0.9));
}
.btn.danger:hover { filter: brightness(1.02); }

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

.features {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
@media (max-width: 900px) { .features { grid-template-columns: 1fr; } }

.feature {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    background: rgba(255,255,255,0.40);
    display: flex;
    gap: 12px;
}
html[data-theme="dark"] .feature { background: rgba(2,6,23,0.22); }
.feature h3 { margin: 0 0 4px; font-size: 14px; }
.feature p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.icon { font-size: 20px; }

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12.5px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.45);
}
html[data-theme="dark"] .badge { background: rgba(2,6,23,0.25); }

.badge.ok { border-color: rgba(34,197,94,0.35); }
.badge.info { border-color: rgba(91,108,255,0.35); }
.badge.warn { border-color: rgba(245,158,11,0.35); }

.meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.meta > div { min-width: 0; }

@media (max-width: 900px) { .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .meta { grid-template-columns: 1fr; } }

.copy-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}
@media (max-width: 640px) { .copy-row { grid-template-columns: 1fr; } }

.callout {
    margin-top: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    background: rgba(255,255,255,0.35);
}
html[data-theme="dark"] .callout { background: rgba(2,6,23,0.22); }
.callout-title { font-weight: 700; font-size: 13.5px; margin-bottom: 6px; }
.callout-body { color: var(--muted); font-size: 13px; line-height: 1.5; }

.footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.40);
}
html[data-theme="dark"] .footer { background: rgba(2,6,23,0.30); }
.footer-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12.5px;
    flex-wrap: wrap;
}


.error-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text);
    line-height: 1.5;
}
.error-list li { margin: 6px 0; overflow-wrap: anywhere; }

.file-title {
    margin: 0 0 10px;
    font-size: 16px;
    letter-spacing: -0.01em;
    overflow-wrap: anywhere;
}



.callout.danger { border-color: rgba(239,68,68,0.25); }

