:root {
    color-scheme: light;
    --ink: #132238;
    --ink-soft: #33445a;
    --muted: #6b7a90;
    --line: #dce5ef;
    --line-strong: #c9d5e2;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --background: #f2f6fb;
    --accent: #e34a3b;
    --accent-dark: #b93127;
    --accent-soft: #fff1ee;
    --blue: #2f6fed;
    --blue-soft: #edf4ff;
    --success: #16805b;
    --success-soft: #edfaf4;
    --warning: #fff7dc;
    --warning-line: #f1d78b;
    --error: #b4232d;
    --error-soft: #fff1f2;
    --shadow-sm: 0 1px 2px rgb(19 34 56 / 4%), 0 8px 22px rgb(19 34 56 / 4%);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--background); }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: radial-gradient(circle at 8% 0%, rgb(227 74 59 / 7%), transparent 25rem), var(--background);
    font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.site-header { position: relative; overflow: hidden; padding: 68px max(24px, calc((100vw - 1120px) / 2)) 92px; color: #fff; background: linear-gradient(120deg, #101d31 0%, #182b47 58%, #253f61 100%); }
.site-header::before, .site-header::after { position: absolute; border-radius: 999px; content: ""; pointer-events: none; }
.site-header::before { top: -180px; right: -80px; width: 500px; height: 500px; background: radial-gradient(circle, rgb(227 74 59 / 27%), rgb(227 74 59 / 0%) 68%); }
.site-header::after { right: 28%; bottom: -260px; width: 470px; height: 470px; border: 1px solid rgb(255 255 255 / 8%); box-shadow: 0 0 0 28px rgb(255 255 255 / 3%), 0 0 0 56px rgb(255 255 255 / 2%); }
.site-header > div { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: .7rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
.site-header .eyebrow { color: #ffb6ad; }
h1, h2, h3 { margin-top: 0; line-height: 1.15; letter-spacing: -.025em; }
h1 { max-width: 760px; margin-bottom: 12px; font-size: clamp(2.3rem, 5vw, 4.2rem); font-weight: 800; }
h2 { margin-bottom: 20px; font-size: clamp(1.35rem, 2vw, 1.7rem); }
h3 { margin-bottom: 12px; font-size: 1rem; }
.intro { max-width: 630px; margin: 0; color: #d9e4f0; font-size: 1.02rem; }

.page-shell { position: relative; z-index: 2; max-width: 1120px; margin: -42px auto 0; padding: 0 24px 64px; }
.panel { margin-bottom: 24px; padding: 28px; border: 1px solid rgb(201 213 226 / 80%); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading > div { min-width: 0; }
.panel-heading .eyebrow { margin-bottom: 7px; }
.status { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: .76rem; font-weight: 750; white-space: nowrap; }
.status.valid { border-color: #b9e5d2; color: var(--success); background: var(--success-soft); }
.status.invalid { border-color: #f0c3c8; color: var(--error); background: var(--error-soft); }

.provider-grid, .two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.provider-panel { margin-bottom: 0; }
.provider-panel > .eyebrow { margin-bottom: 8px; }
.provider-help { margin: -8px 0 18px; color: var(--muted); font-size: .87rem; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 14px; }
.slot-card { position: relative; display: flex; min-height: 164px; flex-direction: column; justify-content: space-between; gap: 14px; overflow: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #fff 0%, #f8fbfe 100%); box-shadow: 0 2px 8px rgb(19 34 56 / 3%); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.slot-card::before { position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(180deg, var(--accent), #ff9b78); content: ""; }
.slot-card:hover { border-color: #b9cbe0; box-shadow: 0 12px 24px rgb(19 34 56 / 9%); transform: translateY(-2px); }
.slot-card h3 { margin: 0; color: var(--ink); font-size: .98rem; }
.slot-url { display: block; overflow-wrap: anywhere; color: var(--muted); font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .73rem; line-height: 1.45; }
.slot-actions, .provider-output-actions, .result-actions { display: flex; align-items: center; gap: 9px; }
.slot-actions button { min-width: 88px; }
.slot-card a, .provider-output-actions a { color: var(--accent-dark); font-size: .82rem; font-weight: 800; text-decoration: none; }
.slot-card a:hover, .slot-card a:focus-visible, .provider-output-actions a:hover, .provider-output-actions a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.copy-status { min-height: 1.25em; color: var(--success); font-size: .76rem; font-weight: 700; }

.form-stack { display: grid; gap: 10px; }
label { color: var(--ink-soft); font-size: .8rem; font-weight: 800; letter-spacing: .01em; }
input, textarea, select, button { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; font: inherit; }
input, textarea, select { padding: 12px 13px; color: var(--ink); background: #fff; outline: 0; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
input::placeholder, textarea::placeholder { color: #9aaabd; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgb(47 111 237 / 13%); }
textarea { min-height: 96px; resize: vertical; }
button { padding: 11px 14px; color: #fff; background: linear-gradient(135deg, var(--accent) 0%, #f1604d 100%); box-shadow: 0 5px 12px rgb(227 74 59 / 18%); cursor: pointer; font-weight: 800; transition: background .16s ease, box-shadow .16s ease, transform .16s ease; }
button:hover:not(:disabled), button:focus-visible:not(:disabled) { background: linear-gradient(135deg, var(--accent-dark) 0%, #d94738 100%); box-shadow: 0 8px 18px rgb(227 74 59 / 24%); transform: translateY(-1px); }
button:focus-visible, a:focus-visible { outline: 3px solid rgb(47 111 237 / 28%); outline-offset: 2px; }
button:disabled { box-shadow: none; cursor: not-allowed; opacity: .45; }
.slot-actions button, .provider-output-actions button, .result-actions button:last-child { border-color: var(--line-strong); color: var(--ink-soft); background: #fff; box-shadow: none; }
.slot-actions button:hover:not(:disabled), .provider-output-actions button:hover:not(:disabled), .result-actions button:last-child:hover:not(:disabled) { color: var(--ink); background: var(--blue-soft); box-shadow: none; }

.provider-output { display: grid; gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.provider-output-heading, .widget-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.provider-output-heading strong { font-size: .87rem; }
.provider-output .result-value { min-height: 0; padding: 12px; font-size: .76rem; }
.provider-output-actions { flex-wrap: wrap; }
.provider-output-actions button, .provider-output-actions a { width: auto; padding: 8px 12px; border-radius: 9px; font-size: .8rem; }
.result-value { display: block; min-height: 74px; overflow-wrap: anywhere; padding: 16px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink-soft); background: #f7f9fc; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .79rem; line-height: 1.55; white-space: pre-wrap; }
.result-actions { max-width: 390px; margin-top: 15px; }
.warning { margin: 0 0 14px; padding: 13px 15px; border: 1px solid var(--warning-line); border-radius: 11px; color: #735b19; background: var(--warning); font-size: .86rem; }
.form-message { min-height: 24px; margin-bottom: 0; color: var(--success); font-size: .86rem; font-weight: 700; }
.form-message.error { color: var(--error); }
.output-validation { display: grid; grid-template-columns: 26px 1fr; gap: 5px 10px; margin-bottom: 14px; padding: 14px 15px; border: 1px solid #bde5d2; border-radius: 12px; color: var(--success); background: var(--success-soft); font-size: .84rem; }
.output-validation > :not(.validation-icon) { grid-column: 2; }
.output-validation strong { font-size: .9rem; }
.output-validation.invalid { border-color: #f0c3c8; color: var(--error); background: var(--error-soft); }
.validation-icon { grid-row: span 4; width: 26px; height: 26px; fill: currentColor; }
.provider-validation { margin-top: 18px; }
.provider-validation .result-value { min-height: 0; margin-top: 8px; }

.widget-preview, .provider-preview { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #f8fbff, #fff); }
.widget-preview-heading { margin-bottom: 13px; }
.widget-preview-heading h3 { margin-bottom: 0; font-size: .92rem; }
.widget-preview-frame { display: block; width: 100%; min-height: 360px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: inset 0 1px 2px rgb(19 34 56 / 4%); }
.validator-result { min-height: 48px; margin: 18px 0 0; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: #f7f9fc; font-size: .86rem; }
.validator-result.valid { border-color: #bde5d2; color: var(--success); background: var(--success-soft); }
.validator-result.invalid { border-color: #f0c3c8; color: var(--error); background: var(--error-soft); }

@media (max-width: 820px) {
    .site-header { padding-top: 54px; padding-bottom: 78px; }
    .page-shell { margin-top: -30px; }
    .provider-grid, .two-column { gap: 18px; }
    .panel { padding: 22px; }
}

@media (max-width: 640px) {
    .site-header { padding: 42px 20px 66px; }
    .page-shell { padding: 0 14px 40px; }
    .panel { margin-bottom: 16px; padding: 19px; border-radius: 15px; }
    .provider-grid, .two-column { grid-template-columns: 1fr; gap: 0; }
    .provider-panel { margin-bottom: 16px; }
    .panel-heading { gap: 10px; }
    .panel-heading .status { max-width: 48%; overflow: hidden; text-overflow: ellipsis; }
    .slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .slot-card { min-height: 150px; padding: 15px; }
    .slot-actions { align-items: stretch; flex-direction: column; }
    .slot-actions button { width: 100%; }
    .result-actions { max-width: none; }
}

@media (max-width: 420px) {
    h1 { font-size: 2.25rem; }
    .slot-grid { grid-template-columns: 1fr; }
    .provider-output-heading, .widget-preview-heading { align-items: flex-start; flex-direction: column; }
    .result-actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
