:root {
    color-scheme: light;
    --ink: #101114;
    --muted: #69707d;
    --line: #e5e7eb;
    --panel: #ffffff;
    --canvas: #f4f5f7;
    --accent: #111111;
    --blue: #1d9bf0;
    --success: #087a4b;
    --danger: #b42318;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, textarea { font: inherit; }
a { color: inherit; }
.topbar { min-height: 68px; padding: 12px max(20px, calc((100vw - 1160px) / 2)); display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { width: 48px; height: 48px; display: inline-grid; place-items: center; border-radius: 14px; background: #0f1012; color: #fff; font-size: 23px; font-weight: 800; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
.admin-shell { width: min(1160px, calc(100% - 32px)); margin: 34px auto 64px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr); gap: 22px; align-items: stretch; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: clamp(22px, 3vw, 36px); box-shadow: 0 16px 50px rgba(16, 24, 40, .055); }
.panel h1, .panel h2 { margin: 4px 0 10px; letter-spacing: -.035em; }
.panel h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.04; }
.panel h2 { font-size: 27px; }
.eyebrow { margin: 0 0 7px; color: var(--blue); font-size: 12px; font-weight: 850; letter-spacing: .13em; }
.muted { color: var(--muted); line-height: 1.6; }
.field-title { display: block; margin: 16px 0 8px; font-size: 13px; font-weight: 750; color: #414651; }
.current-preview { margin-top: 26px; }
.current-preview img, .empty-preview { width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; border-radius: 15px; border: 1px solid var(--line); background: #eef0f3; }
.empty-preview, .empty-result { display: grid; place-items: center; color: var(--muted); min-height: 180px; }
.upload-form { margin-top: 18px; display: grid; gap: 12px; }
.file-picker { position: relative; min-height: 76px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; border: 1.5px dashed #aab0ba; border-radius: 14px; background: #fafafa; cursor: pointer; transition: .2s ease; }
.file-picker:hover { border-color: var(--blue); background: #f4faff; }
.file-picker span { font-size: 13px; font-weight: 850; }
.file-picker small { color: var(--muted); max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.button { min-height: 43px; padding: 0 18px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 850; letter-spacing: .035em; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.secondary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button.ghost { background: transparent; }
.button.full { width: 100%; min-height: 52px; }
.button.copied { color: var(--success); border-color: #79c7a6; background: #ecfdf3; }
.small-button { min-height: 36px; }
.result-panel { background: #0f1012; color: #fff; border-color: #0f1012; }
.result-panel .eyebrow { color: #70c4ff; }
.result-panel .field-title, .result-panel .text-link { color: #c7ccd4; }
.result-image { margin: 24px 0 16px; overflow: hidden; border-radius: 15px; background: #25272b; }
.result-image img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.copy-row input { min-width: 0; color: #fff; background: #25272b; border-color: #383b40; }
.copy-row .button { border-color: #fff; }
.text-link { display: inline-block; margin-top: 14px; font-size: 13px; }
input, textarea { width: 100%; min-height: 46px; padding: 11px 13px; color: var(--ink); background: #fff; border: 1px solid #d5d8de; border-radius: 10px; outline: none; }
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(29, 155, 240, .12); }
.settings-panel, .history-panel { margin-top: 22px; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 20px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { margin: 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.settings-grid label { display: grid; gap: 7px; color: #343943; font-size: 13px; font-weight: 750; }
.settings-grid label:nth-of-type(4) { grid-row: span 2; }
.history-list { display: grid; gap: 8px; }
.history-row { min-width: 0; display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 13px; }
.history-row img { width: 72px; aspect-ratio: 1.91 / 1; object-fit: cover; border-radius: 8px; background: #eee; }
.history-info { min-width: 0; display: grid; gap: 4px; }
.history-info strong { overflow: hidden; text-overflow: ellipsis; }
.history-info small { color: var(--muted); }
.alert { margin: 0 0 18px; padding: 13px 16px; border-radius: 11px; border: 1px solid; font-size: 14px; }
.alert.success { color: #067647; background: #ecfdf3; border-color: #abefc6; }
.alert.error { color: var(--danger); background: #fef3f2; border-color: #fecdca; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0, #e5f4ff 0, transparent 38%), var(--canvas); }
.auth-card { width: min(440px, 100%); padding: 34px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 20px 70px rgba(16, 24, 40, .1); }
.auth-card h1 { margin: 8px 0; font-size: 32px; letter-spacing: -.04em; }
.stack-form { display: grid; gap: 15px; margin-top: 24px; }
.stack-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 750; }
.share-page { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: #090a0c; color: #fff; }
.share-card { width: min(880px, 100%); overflow: hidden; border: 1px solid #292c31; border-radius: 24px; background: #131519; box-shadow: 0 26px 100px rgba(0, 0, 0, .4); }
.share-image { display: block; background: #22252a; }
.share-image img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; }
.share-content { padding: clamp(24px, 5vw, 42px); }
.share-content h1 { margin: 0; font-size: clamp(28px, 5vw, 44px); line-height: 1.08; letter-spacing: -.04em; }
.share-content p { margin: 13px 0 0; color: #b8bec8; line-height: 1.65; }
.continue-button { margin-top: 25px; min-width: 180px; background: #fff !important; color: #090a0c !important; }
.empty-share { padding: 42px; text-align: center; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

@media (max-width: 780px) {
    .hero-grid, .settings-grid { grid-template-columns: 1fr; }
    .section-heading { display: block; }
    .copy-row { grid-template-columns: 1fr; }
    .history-row { grid-template-columns: 58px 1fr auto; }
    .history-row img { width: 58px; }
    .admin-shell { width: min(100% - 20px, 1160px); margin-top: 18px; }
    .panel { border-radius: 16px; }
}
