:root {
    color-scheme: light;
    --brand-orange: #f67600;
    --brand-green: #89a004;
    --brand-olive: #3b502a;
    --brand-yellow: #f4d237;
    --brand-blue: #1818e8;
    --brand-green-ink: #5d7000;
    --ink: #1c241b;
    --muted: #4f5b4b;
    --paper: #ffffff;
    --canvas: #e9ece5;
    --line: #cbd2c5;
    --error: #a82c22;
    --font-interface: "Avenir Next", Avenir, "Helvetica Neue", Arial, ui-sans-serif, system-ui, sans-serif;
    --font-display: "Nunito", "Avenir Next", Avenir, ui-sans-serif, system-ui, sans-serif;
    font-family: var(--font-interface);
    font-size: 16px;
    font-weight: 400;
    color: var(--ink);
    background: var(--canvas);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { font-weight: 650; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; }

.site-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 92px;
    padding: 18px clamp(22px, 5vw, 76px) 22px;
    color: white;
    background: var(--brand-olive);
}

.site-header::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 5px;
    content: "";
    background: linear-gradient(90deg, var(--brand-orange) 0 28%, var(--brand-yellow) 28% 52%, var(--brand-green) 52% 88%, var(--brand-blue) 88%);
}

.brand-lockup { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; }
.brand-logo-frame { display: grid; width: 190px; height: 58px; place-items: center start; overflow: hidden; }
.brand-logo-frame img { display: block; max-width: 100%; max-height: 58px; object-fit: contain; }
.brand-logo-placeholder { display: grid; width: 54px; height: 54px; place-items: center; border: 2px solid #ffffffaa; border-radius: 50%; color: white; font-size: 1.2rem; font-weight: 750; text-transform: uppercase; }
.brand-product { padding-left: 16px; border-left: 1px solid #ffffff66; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.brand-product small { display: block; margin-top: 3px; color: var(--brand-yellow); font-size: .62rem; letter-spacing: .14em; }
.header-action { padding: 9px 15px; border: 1px solid #ffffff99; border-radius: 4px; color: white; background: transparent; cursor: pointer; }
.header-action:hover { color: var(--brand-olive); background: var(--brand-yellow); border-color: var(--brand-yellow); }
.header-nav { display: flex; align-items: center; gap: 10px; }
.header-nav form { margin: 0; }
.header-nav a { text-decoration: none; }

.app-page { min-width: 320px; }
.app-topbar { position: sticky; z-index: 60; top: 0; min-height: 78px; padding: 10px clamp(18px, 3vw, 38px) 14px; box-shadow: 0 7px 24px #16201126; }
.app-topbar .brand-logo-frame { width: 74px; height: 52px; place-items: center; }
.app-topbar .brand-logo-frame img { max-height: 52px; }
.app-topbar .brand-product { font-size: .82rem; }
.app-account { display: flex; align-items: center; gap: 16px; }
.app-account form { margin: 0; }
.app-account-copy { display: grid; padding-right: 16px; border-right: 1px solid #ffffff3d; text-align: right; }
.app-account-copy small { color: #dce4d6; font-size: .62rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.app-account-copy strong { color: white; font-size: .84rem; }
.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - 78px); }
.app-sidebar { position: sticky; z-index: 40; top: 78px; display: flex; height: calc(100vh - 78px); flex-direction: column; justify-content: space-between; padding: 26px 16px 20px; overflow-y: auto; border-right: 1px solid #c6cec0; background: #f3f5f0; }
.app-nav { display: grid; gap: 8px; }
.app-nav a { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 11px; min-height: 62px; padding: 10px 12px; border: 1px solid transparent; border-radius: 8px; color: #394436; text-decoration: none; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
.app-nav a:hover { border-color: #c2cbbd; background: #fff; transform: translateX(2px); }
.app-nav a.is-active { border-color: #b9c4b2; color: var(--brand-olive); background: var(--paper); box-shadow: 0 9px 24px #26321d12; }
.app-nav a.is-active::before { position: absolute; width: 4px; height: 32px; margin-left: -13px; border-radius: 0 4px 4px 0; content: ""; background: var(--brand-yellow); }
.app-nav a > span:last-child { display: grid; gap: 2px; min-width: 0; font-size: .86rem; }
.app-nav a small { overflow: hidden; color: #6b7567; font-size: .68rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.app-nav-marker { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 8px; color: var(--brand-olive); background: #e1e6dc; font-size: .65rem; font-weight: 750; letter-spacing: .04em; }
.app-nav a.is-active .app-nav-marker { color: #192013; background: var(--brand-yellow); }
.app-nav a:focus-visible, .app-topbar a:focus-visible, .app-topbar button:focus-visible { outline: 3px solid var(--brand-yellow); outline-offset: 2px; }
.app-nav .app-nav-admin { margin-top: 12px; border-top: 1px solid #cbd2c5; border-radius: 0 0 8px 8px; }
.app-sidebar-meta { display: grid; gap: 3px; padding: 15px; border-radius: 8px; color: #eaf0e6; background: var(--brand-olive); }
.app-sidebar-meta span { color: var(--brand-yellow); font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; }
.app-sidebar-meta strong { overflow: hidden; font-size: .86rem; text-overflow: ellipsis; white-space: nowrap; }
.app-sidebar-meta small { color: #d7dfd2; font-size: .68rem; font-weight: 400; }
.app-main { width: 100%; min-width: 0; margin: 0 auto; padding: 40px clamp(20px, 3vw, 46px) 78px; }

.site-main { max-width: 1320px; margin: auto; padding: 46px 24px 78px; }
.site-main.app-main { width: 100%; min-width: 0; margin: 0 auto; padding: 40px clamp(20px, 3vw, 46px) 78px; }
.page-intro { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr); gap: 40px; align-items: end; margin-bottom: 32px; }
.page-intro h1 { max-width: 780px; margin: 0; color: var(--brand-olive); font-size: clamp(2.2rem, 5vw, 4rem); line-height: 1.02; font-weight: 750; }
.page-intro > p { margin-bottom: 4px; padding-left: 18px; border-left: 4px solid var(--brand-orange); color: var(--muted); font-size: 1.03rem; line-height: 1.55; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); gap: 24px; align-items: start; }
.panel, .results { position: relative; background: var(--paper); border: 1px solid #bdc6b6; padding: 30px; box-shadow: 0 14px 38px #26321d14; }
.form-panel { padding: 0; overflow: hidden; border: 0; box-shadow: 0 28px 70px #14200f26; }
.form-panel-header { position: relative; min-height: 190px; padding: 34px 34px 42px; color: white; background: var(--brand-olive); overflow: hidden; }
.form-panel-header::after { position: absolute; width: 230px; height: 230px; right: -120px; top: -150px; border: 45px solid #ffffff0d; border-radius: 50%; content: ""; }
.form-panel-header > *:not(.brand-ribbon) { position: relative; z-index: 1; }
.panel .form-panel-header h2 { margin-bottom: 10px; color: white; font-size: 2.15rem; font-weight: 700; }
.form-panel-header .intro { max-width: 650px; margin-bottom: 0; color: #eef1e9; font-size: 1rem; line-height: 1.6; }
.form-panel-header .eyebrow-light { color: var(--brand-yellow); }
.form-panel > .form-grid { padding: 32px 34px 36px; }
.status-panel { position: sticky; top: 102px; max-height: calc(100vh - 126px); overflow-y: auto; border-top: 6px solid var(--brand-green); }
.panel h2, .results h2 { margin-bottom: 22px; color: var(--brand-olive); }
.eyebrow { margin-bottom: 8px; color: var(--brand-green-ink); text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; }
.intro, .form-intro { color: var(--muted); margin-bottom: 25px; line-height: 1.5; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.span-2, .span-all { grid-column: 1 / -1; }
label { display: grid; gap: 7px; font-size: .88rem; font-weight: 500; }
input, select, textarea { width: 100%; border: 1px solid #98a590; border-radius: 5px; padding: 13px 14px; color: var(--ink); background: #fff; font-weight: 400; }
input::placeholder, textarea::placeholder { color: #747d70; opacity: 1; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 3px solid #1818e822; border-color: var(--brand-blue); }
input[type="file"] { padding: 8px; background: #fff; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 9px 12px; border: 0; border-radius: 3px; color: white; background: var(--brand-olive); font: inherit; font-weight: 600; cursor: pointer; }
textarea { resize: vertical; }
small { color: var(--error); font-weight: 600; }
.field-hint { color: var(--muted); font-size: .78rem; font-weight: 400; line-height: 1.4; }
.form-section { min-width: 0; margin: 0; padding: 20px; border: 1px solid #d0d6ca; background: #f6f8f3; }
.form-section + .form-section { padding-top: 20px; }
.form-section legend { display: flex; width: auto; max-width: calc(100% - 24px); align-items: center; gap: 12px; margin: 0 0 0 -6px; padding: 0 10px 0 0; color: var(--brand-olive); background: var(--paper); }
.form-section legend > span:last-child { display: grid; gap: 2px; }
.form-section legend strong { font-size: 1rem; font-weight: 700; }
.form-section legend small { color: var(--muted); font-family: var(--font-interface); font-size: .78rem; font-weight: 400; }
.section-number { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: white; background: var(--brand-olive); font-size: .82rem; font-weight: 700; }
.section-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-field { align-content: start; gap: 8px; font-size: .88rem; }
.field-label { color: #20291e; line-height: 1.3; font-weight: 600; }
.field-error { color: var(--error); font-size: .78rem; line-height: 1.35; font-weight: 600; }
.optional { margin-left: 5px; color: var(--muted); font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.money-input { display: grid; grid-template-columns: 42px 1fr; align-items: center; overflow: hidden; border: 1px solid #98a590; border-radius: 5px; background: #e8ede4; }
.money-input > span { color: var(--brand-olive); text-align: center; font-size: 1.05rem; font-weight: 700; }
.money-input input { border: 0; border-left: 1px solid #d5dbcf; border-radius: 0; }
.money-input input:focus { outline: 0; border-color: #d5dbcf; }
.money-input:focus-within { outline: 3px solid #1818e822; border-color: var(--brand-blue); }
.checkbox-field { display: flex; align-items: flex-start; gap: 11px; padding: 14px; border: 1px solid #cbd2c5; background: #fff; cursor: pointer; }
.checkbox-field input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand-green); }
.checkbox-field > span { display: grid; gap: 3px; }
.checkbox-field strong { color: var(--ink); font-weight: 600; }
.checkbox-field small { color: var(--muted); font-size: .78rem; font-weight: 400; line-height: 1.4; }
.checkbox-field.is-disabled { color: #6f786b; background: #ecefe8; cursor: not-allowed; }
.upload-status { display: flex; align-items: center; gap: 7px; color: var(--brand-olive); font-size: .78rem; font-weight: 600; }
.inline-spinner { width: 14px; height: 14px; border: 2px solid #d8ddcf; border-top-color: var(--brand-green); border-radius: 50%; animation: spin .8s linear infinite; }
.product-preview { display: flex; align-items: center; gap: 16px; padding: 13px; background: #f2f3ec; border: 1px solid var(--line); }
.product-preview img { width: 104px; height: 104px; object-fit: contain; background: white; }
.product-preview p { margin: 0; color: var(--muted); font-size: .82rem; font-weight: 500; }
button:disabled { opacity: .62; cursor: wait; }
.primary, .secondary { border: 0; border-radius: 4px; padding: 14px 18px; cursor: pointer; }
.primary { color: #161c0e; background: var(--brand-yellow); box-shadow: inset 0 -3px 0 #d2b21b; }
.primary:hover { background: #ffe151; }
.secondary { width: 100%; color: white; background: var(--brand-olive); }
.secondary:hover { background: #283a1d; }
.submit-area { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 18px; background: #eef1e9; border: 1px solid #d0d6ca; border-left: 4px solid var(--brand-yellow); }
.submit-area p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.submit-area .primary { min-width: 260px; }
.credit-required-action { display: block; min-width: 260px; text-align: center; text-decoration: none; }
.credit-warning { color: var(--error) !important; font-weight: 650; }
.generation-limit-warning { padding: 8px 10px; color: #6b3d00 !important; background: #fff1c7; border-left: 3px solid var(--brand-orange); font-weight: 650; }
.generation-price-summary { display: grid; gap: 2px; }
.generation-price-summary > span { color: var(--muted); font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; }
.generation-price-summary > strong { color: var(--brand-olive); font-size: 1.35rem; }
.generation-price-summary > small { margin-bottom: 6px; color: var(--brand-green-ink); font-size: .75rem; }

.status-grid { display: grid; gap: 14px; margin: 0 0 24px; }
.status-grid div { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; color: #364300; background: #edf1cf; }
.badge-completed { color: #244c20; background: #ddf1d8; }
.badge-failed { color: #8b221a; background: #ffe1dc; }
.progress { height: 9px; background: #e7eadf; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-green), var(--brand-yellow)); transition: width .3s; }
.progress-label { margin: 5px 0 18px; color: var(--muted); text-align: right; }
.empty { padding: 32px 18px; color: var(--muted); text-align: center; background: #f2f3ec; border: 1px dashed #cbd1c5; }
.alert { margin-top: 18px; padding: 12px; color: var(--error); background: #fff0e9; border-left: 4px solid var(--brand-orange); }
.error-code { display: block; margin-top: 5px; font-size: .72rem; }
.generation-actions { display: grid; gap: 10px; margin-top: 16px; }
.generation-actions p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.warning-action { width: 100%; padding: 12px 16px; color: #4e2b00; background: #ffe7be; border: 1px solid var(--brand-orange); border-radius: 3px; cursor: pointer; }

.result-panel { padding: 22px; border-top-color: var(--brand-yellow); scrollbar-width: thin; }
.result-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.result-heading h2 { margin: 0; font-size: 1.7rem; }
.result-heading .badge { flex: 0 0 auto; }
.result-panel .review-notice { margin: 16px 0; font-size: .76rem; line-height: 1.4; }
.result-format-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 13px; padding: 5px; background: #e7ebe2; border: 1px solid #cbd2c5; }
.result-format-switch button { display: grid; gap: 2px; padding: 10px 8px; border: 1px solid transparent; border-radius: 3px; color: var(--muted); background: transparent; cursor: pointer; }
.result-format-switch button.is-active { color: var(--brand-olive); background: white; border-color: #b9c3b2; box-shadow: 0 3px 9px #26321d12; }
.result-format-switch strong { font-size: .78rem; }
.result-format-switch span { font-size: .66rem; }
.result-slider { display: grid; gap: 12px; }
.result-preview { margin: 0; overflow: hidden; border: 1px solid var(--line); background: #f4f6f1; }
.result-preview > button { display: block; width: 100%; padding: 0; border: 0; background: var(--brand-olive); cursor: zoom-in; }
.result-preview img { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }
.result-preview-feed img { aspect-ratio: 4 / 5; }
.result-preview figcaption { display: grid; gap: 3px; padding: 12px 13px; }
.result-preview figcaption strong { color: var(--brand-olive); font-size: .88rem; }
.result-preview figcaption span { color: var(--muted); font-size: .7rem; }
.slider-controls { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; gap: 10px; }
.slider-arrow { display: grid; width: 42px; height: 38px; place-items: center; border: 1px solid #aeb9a8; border-radius: 4px; color: var(--brand-olive); background: #f2f4ee; cursor: pointer; }
.slider-arrow:hover { border-color: var(--brand-green); background: #e6ebdf; }
.slider-dots { display: flex; align-items: center; justify-content: center; gap: 8px; }
.slider-dots button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50%; background: #b8c0b2; cursor: pointer; }
.slider-dots button.is-active { width: 26px; border-radius: 10px; background: var(--brand-green); }
.slider-arrow:focus-visible, .slider-dots button:focus-visible, .result-download:focus-visible { outline: 3px solid #1818e833; outline-offset: 2px; }
.result-download { display: block; margin-top: 14px; text-align: center; text-decoration: none; }

.results { margin-top: 0; border-top: 6px solid var(--brand-yellow); }
.review-notice { margin-top: 10px; padding: 10px 12px; color: #5c3600; background: #fff1c7; border-left: 4px solid var(--brand-orange); }
.cards { display: grid; gap: 18px; }
.cards-1 { grid-template-columns: minmax(260px, 380px); }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flyer-card { overflow: hidden; border: 1px solid var(--line); background: #fafbf5; }
.flyer-card img { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: var(--brand-olive); }
.flyer-card div { padding: 16px; }
.flyer-card h3 { margin-bottom: 5px; color: var(--brand-olive); }
.flyer-card p { color: var(--muted); font-size: .8rem; }
.flyer-card a { color: var(--brand-blue); text-underline-offset: 3px; }

.processing-overlay { position: fixed; z-index: 1000; inset: 0; align-items: center; justify-content: center; padding: 24px; background: #172018bf; backdrop-filter: blur(5px); }
.processing-dialog { width: min(100%, 520px); padding: 38px; color: var(--ink); text-align: center; background: var(--paper); border-top: 7px solid var(--brand-yellow); box-shadow: 0 28px 90px #00000055; }
.processing-dialog .eyebrow { margin: 18px 0 8px; }
.processing-dialog h2 { margin-bottom: 12px; color: var(--brand-olive); font-size: clamp(1.55rem, 4vw, 2.1rem); }
.processing-dialog > p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.processing-spinner { display: block; width: 58px; height: 58px; margin: auto; border: 6px solid #e2e6db; border-top-color: var(--brand-orange); border-right-color: var(--brand-yellow); border-radius: 50%; animation: spin .85s linear infinite; }
.processing-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 24px 0 18px; }
.processing-steps span { padding: 8px 5px; color: var(--brand-olive); background: #edf1e5; font-size: .69rem; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.processing-note { margin-bottom: 0; font-size: .78rem; }

@keyframes spin { to { transform: rotate(360deg); } }

.login-page { display: grid; place-items: center; padding: 28px; background: var(--brand-olive); }
.login-shell { display: grid; grid-template-columns: 1.05fr .95fr; width: min(100%, 980px); min-height: 580px; background: var(--paper); box-shadow: 0 35px 90px #14200f66; }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 7vw, 72px); color: white; background: var(--brand-olive); overflow: hidden; }
.login-brand::after { position: absolute; width: 280px; height: 280px; right: -160px; top: -130px; border: 55px solid #ffffff0d; border-radius: 50%; content: ""; }
.eyebrow-light { color: var(--brand-yellow); }
.login-logo { display: block; width: min(100%, 310px); height: 245px; margin: -28px 0 -24px; object-fit: contain; }
.login-platform-logo { display: block; width: min(100%, 260px); height: auto; max-height: 230px; margin: 18px 0 22px; object-fit: contain; }
.login-brand h1 { margin-bottom: 16px; font-size: 1.2rem; text-transform: uppercase; letter-spacing: .18em; }
.login-brand > p:last-of-type { max-width: 390px; color: #eef1e9; line-height: 1.65; }
.brand-ribbon { position: absolute; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: 2fr 1fr 1.4fr 1.2fr .35fr; height: 9px; }
.brand-ribbon span:nth-child(1) { background: var(--brand-orange); }
.brand-ribbon span:nth-child(2) { background: var(--brand-yellow); }
.brand-ribbon span:nth-child(3) { background: var(--brand-green); }
.brand-ribbon span:nth-child(4) { background: white; }
.brand-ribbon span:nth-child(5) { background: var(--brand-blue); }
.login-form-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 6vw, 68px); }
.login-form-panel h2 { margin-bottom: 8px; color: var(--brand-olive); font-size: 2rem; }
.login-form { display: grid; gap: 18px; margin-top: 8px; }
.password-input-wrap { position: relative; display: block; }
.password-input-wrap input { padding-right: 82px; }
.password-toggle { position: absolute; top: 50%; right: 10px; padding: 6px 8px; border: 0; color: var(--brand-blue); background: transparent; font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; transform: translateY(-50%); }
.password-toggle:hover, .password-toggle:focus-visible { color: var(--brand-olive); text-decoration: underline; text-underline-offset: 3px; }
.auth-switch { margin: 24px 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
.auth-switch a { color: var(--brand-blue); text-underline-offset: 3px; }
.registration-shell { width: min(100%, 1120px); min-height: 720px; }
.registration-brand { padding: clamp(34px, 6vw, 68px); }
.registration-form-panel { padding: clamp(30px, 5vw, 58px); }
.registration-form { display: grid; gap: 20px; }
.registration-progress { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 4px; }
.registration-progress > span { display: flex; align-items: center; gap: 7px; color: #707a6c; font-size: .75rem; font-weight: 700; }
.registration-progress > span { min-width: 28px; }
.registration-progress > span small { color: inherit; font-size: .68rem; font-weight: 600; }
.registration-progress > span.is-active { color: var(--brand-olive); }
.registration-progress > i { height: 2px; background: #d6dcd1; }
.registration-progress > span.is-active + i { background: var(--brand-yellow); }
.registration-fields { gap: 14px; }
.registration-passwords { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.otp-form { gap: 16px; }
.otp-input { min-height: 68px; color: var(--brand-olive); font-size: 2rem; font-weight: 700; letter-spacing: .28em; text-align: center; }
.registration-actions { display: flex; justify-content: center; gap: 10px; }
.registration-actions button { padding: 9px 11px; border: 0; color: var(--brand-olive); background: transparent; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.registration-actions button:hover { color: var(--brand-blue); }
.remember { display: flex; align-items: center; grid-template-columns: auto 1fr; }
.remember input { width: auto; accent-color: var(--brand-green); }
.mfa-secondary-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; margin-top: 20px; }
.mfa-secondary-actions form { margin: 0; }
.mfa-secondary-actions button, .text-button { padding: 4px; border: 0; color: var(--brand-blue); background: transparent; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.security-settings { display: grid; gap: 24px; }
.security-heading h1 { margin: 0 0 8px; color: var(--brand-olive); font-size: clamp(2rem, 4vw, 3.2rem); }
.security-heading p:last-child { margin: 0; color: var(--muted); }
.security-grid { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); gap: 24px; align-items: start; }
.security-status-card, .security-setup-card, .recovery-codes-card { display: grid; gap: 18px; border-top: 6px solid var(--brand-yellow); }
.security-status-card h2, .security-setup-card h2, .recovery-codes-card h2 { margin: 0; color: var(--brand-olive); }
.security-status-card > p:not(.eyebrow), .security-setup-card > p:not(.eyebrow), .recovery-codes-card > p:not(.eyebrow) { margin: 0; color: var(--muted); line-height: 1.55; }
.security-status-card .badge { width: fit-content; }
.security-inline-form, .security-confirm-form, .security-method-form { display: grid; gap: 15px; padding-top: 17px; border-top: 1px solid var(--line); }
.security-inline-form .secondary { width: auto; }
.danger-button { padding: 12px 16px; border: 1px solid #bb7269; color: #802e25; background: #fff3f1; font-weight: 700; cursor: pointer; }
.security-method-option { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 12px; padding: 16px; border: 1px solid var(--line); background: #f7f8f4; cursor: pointer; }
.security-method-option:has(input:checked) { border-color: var(--brand-green); box-shadow: inset 4px 0 var(--brand-yellow); }
.security-method-option input { width: auto; margin-top: 4px; accent-color: var(--brand-green); }
.security-method-option span { display: grid; gap: 5px; }
.security-method-option strong { color: var(--brand-olive); }
.security-method-option small { color: var(--muted); font-weight: 500; line-height: 1.45; }
.setup-steps { display: grid; gap: 9px; margin: 0; padding-left: 22px; color: var(--muted); line-height: 1.5; }
.totp-qr-code { display: grid; justify-items: center; gap: 10px; padding: 18px; border: 1px solid var(--line); background: #fff; }
.totp-qr-code img { display: block; width: min(100%, 320px); height: auto; aspect-ratio: 1; }
.totp-qr-code small { color: var(--muted); font-weight: 500; text-align: center; }
.manual-totp-setup summary, .provisioning-uri summary { color: var(--brand-blue); cursor: pointer; }
.manual-totp-setup > p { color: var(--muted); font-size: .82rem; line-height: 1.5; }
.manual-totp-setup .totp-secret { margin-top: 12px; }
.totp-secret { display: grid; gap: 7px; padding: 15px; border-left: 4px solid var(--brand-yellow); background: #eef1e9; }
.totp-secret span { color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.totp-secret code { overflow-wrap: anywhere; color: var(--brand-olive); font-size: 1.1rem; font-weight: 750; letter-spacing: .12em; }
.provisioning-uri code { display: block; margin-top: 10px; overflow-wrap: anywhere; padding: 12px; background: #f4f6f1; font-size: .72rem; }
.recovery-codes-card { border-top-color: var(--brand-orange); }
.recovery-codes-card ul { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.recovery-codes-card li { padding: 10px; color: var(--brand-olive); background: #eef1e9; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; }

.brand-settings-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .6fr); gap: 24px; align-items: start; }
.brand-settings-form { display: grid; gap: 24px; }
.brand-settings-form h1 { margin-bottom: 8px; color: var(--brand-olive); font-size: clamp(2rem, 4vw, 3.2rem); }
.color-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.color-field > span { display: grid; grid-template-columns: 54px 1fr; gap: 8px; }
.color-field input[type="color"] { height: 48px; padding: 3px; cursor: pointer; }
.brand-assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 18px; }
.brand-assets-grid article { display: grid; gap: 7px; padding: 10px; border: 1px solid var(--line); background: white; }
.brand-assets-grid img { width: 100%; height: 90px; object-fit: contain; }
.brand-assets-grid span { color: var(--muted); font-size: .72rem; text-transform: capitalize; }
.brand-settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.success-message { padding: 13px; color: #234c20; background: #e3f3df; border-left: 4px solid var(--brand-green); }
.brand-help { position: sticky; top: 24px; border-top: 6px solid var(--brand-yellow); }
.brand-help p { color: var(--muted); line-height: 1.55; }
.canva-connection-status { display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: center; padding: 18px; border: 1px solid #cbd2c5; background: #f5f7f2; }
.canva-connection-status > span { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; color: white; background: #7c8790; font-weight: 800; }
.canva-connection-status > div { display: grid; gap: 4px; }
.canva-connection-status strong { color: var(--brand-olive); }
.canva-connection-status small { color: var(--muted); font-weight: 500; }
.canva-connection-status.is-connected { border-color: #a8c5a1; background: #edf6e9; }
.canva-connection-status.is-connected > span { background: var(--brand-green); }
.canva-connect-button { display: block; width: fit-content; text-decoration: none; }
.canva-connect-button.is-disabled { opacity: .55; cursor: not-allowed; }

.reference-styles-layout { display: grid; grid-template-columns: minmax(320px, .72fr) minmax(0, 1.28fr); gap: 24px; align-items: start; }
.reference-style-form { position: sticky; top: 24px; display: grid; gap: 22px; border-top: 6px solid var(--brand-yellow); }
.reference-style-form h1 { margin-bottom: 8px; color: var(--brand-olive); font-size: clamp(2rem, 4vw, 3.2rem); }
.selected-reference-count { padding: 10px 12px; color: var(--brand-olive); background: #eef1e9; border-left: 4px solid var(--brand-green); font-size: .82rem; }
.reference-style-library { display: grid; gap: 18px; }
.library-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; padding: 8px 0; }
.library-heading h2 { margin-bottom: 0; color: var(--brand-olive); font-size: 2rem; }
.library-heading > span { color: var(--muted); font-size: .82rem; }
.reference-style-card { display: grid; grid-template-columns: minmax(180px, .62fr) minmax(0, 1.38fr); background: var(--paper); border: 1px solid #bdc6b6; box-shadow: 0 14px 38px #26321d14; }
.reference-style-thumbnails { position: relative; display: grid; grid-template-columns: repeat(2, 1fr); min-height: 230px; background: var(--brand-olive); }
.reference-style-thumbnails img { width: 100%; height: 100%; min-height: 115px; object-fit: cover; border: 1px solid #ffffff22; }
.reference-style-thumbnails > span { position: absolute; right: 10px; bottom: 10px; padding: 5px 8px; color: white; background: #000b; font-size: .75rem; }
.reference-style-content { display: grid; align-content: start; gap: 14px; padding: 24px; }
.reference-style-content h3, .reference-style-content p { margin: 0; }
.reference-style-content > p { color: var(--muted); line-height: 1.5; }
.reference-style-content > small { color: var(--muted); font-weight: 500; }
.reference-style-title { display: flex; justify-content: space-between; gap: 14px; align-items: start; }
.reference-style-title > div { display: grid; gap: 7px; }
.reference-style-title .badge { width: fit-content; }
.reference-style-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.edit-style { padding: 7px 9px; color: var(--brand-olive); background: #eef1e9; border: 1px solid #aeb9a7; cursor: pointer; }
.delete-style { padding: 7px 9px; color: var(--error); background: transparent; border: 1px solid #d8aaa5; cursor: pointer; }
.reference-style-content details { color: var(--brand-olive); font-size: .82rem; }
.reference-style-content summary { cursor: pointer; font-weight: 650; }
.reference-style-content details p { margin-top: 10px; padding: 12px; color: var(--muted); background: #f4f6f1; line-height: 1.5; white-space: pre-wrap; }
.reference-style-editor { display: grid; gap: 16px; padding-top: 17px; border-top: 1px solid #cbd2c5; }
.reference-style-editor label { display: grid; gap: 7px; color: var(--brand-olive); font-size: .78rem; font-weight: 650; }
.reference-style-editor textarea { resize: vertical; }
.reference-style-editor-heading { display: grid; gap: 4px; }
.reference-style-editor-heading strong { color: var(--brand-olive); }
.reference-style-editor-heading small { color: var(--muted); font-weight: 500; }
.reference-style-editor-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.company-assignment-list { display: grid; max-height: 230px; overflow-y: auto; gap: 8px; padding: 14px; border: 1px solid var(--line); background: #f7f8f4; }
.company-assignment-list legend { padding: 0 7px; color: var(--brand-olive); font-size: .78rem; font-weight: 700; }
.company-assignment-list label { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: .82rem; font-weight: 500; }
.company-assignment-list input { width: auto; }
.badge-active { color: #244c20; background: #ddf1d8; }
.badge-analyzing { color: #5c4600; background: #fff1c7; }
.badge-inactive { color: #6b2720; background: #f5ded9; }

.admin-header { min-height: 82px; }
.admin-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100vh - 82px); }
.admin-nav { display: flex; flex-direction: column; gap: 6px; padding: 28px 18px; color: white; background: #26351f; }
.admin-nav a { padding: 12px 14px; border-left: 4px solid transparent; color: #edf1e9; text-decoration: none; font-size: .86rem; }
.admin-nav a:hover, .admin-nav a.is-active { border-left-color: var(--brand-yellow); color: white; background: #ffffff12; }
.admin-main { min-width: 0; padding: 38px clamp(20px, 4vw, 58px) 70px; }
.admin-resource, .admin-company-detail { display: grid; gap: 24px; }
.admin-page-heading h1, .company-detail-heading h1 { margin-bottom: 7px; color: var(--brand-olive); font-size: clamp(2.1rem, 4vw, 3.5rem); }
.admin-page-heading p:last-child, .company-detail-heading p:last-child { margin: 0; color: var(--muted); }
.admin-resource-grid { display: grid; grid-template-columns: minmax(280px, .42fr) minmax(0, 1.58fr); gap: 22px; align-items: start; }
.admin-form-card { position: sticky; top: 20px; border-top: 6px solid var(--brand-yellow); }
.admin-form-card h2 { margin-bottom: 20px; }
.admin-form { display: grid; gap: 15px; }
.admin-form-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.admin-form-actions .secondary { width: auto; }
.admin-form-card .success-message, .admin-form-card .alert { margin: 16px 0 0; }
.admin-table-card { min-width: 0; padding: 24px; border: 1px solid #bdc6b6; background: var(--paper); box-shadow: 0 14px 38px #26321d14; }
.admin-table-heading, .admin-detail-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.admin-table-heading h2, .admin-detail-heading h2 { margin: 0; color: var(--brand-olive); }
.admin-table-heading span { color: var(--muted); font-size: .8rem; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-table th { padding: 10px; color: var(--muted); border-bottom: 2px solid var(--line); font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
.admin-table td { padding: 13px 10px; border-bottom: 1px solid var(--line); font-size: .83rem; vertical-align: top; }
.admin-table td > strong, .admin-table td > small { display: block; }
.admin-table td > small { margin-top: 3px; color: var(--muted); font-weight: 400; }
.admin-table a { color: var(--brand-blue); }
.admin-marker { display: inline-block; margin-top: 5px; padding: 2px 6px; color: #5c4600; background: #fff1c7; font-size: .65rem; text-transform: uppercase; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.table-actions button { padding: 0; border: 0; color: var(--brand-blue); background: transparent; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.table-actions .danger-link { color: var(--error); }
.cost-admin-grid { display: grid; gap: 12px; }
.cost-admin-grid > article { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px; border: 1px solid var(--line); background: #f7f8f4; }
.cost-variant { display: grid; width: 54px; height: 54px; place-items: center; border-radius: 50%; color: white; background: var(--brand-olive); font-size: 1.35rem; font-weight: 750; }
.cost-admin-grid h3, .cost-admin-grid p { margin: 0 0 5px; }
.company-detail-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.balance-card { display: grid; min-width: 260px; gap: 5px; padding: 18px 20px; border-left: 5px solid var(--brand-yellow); background: var(--paper); box-shadow: 0 12px 28px #26321d14; }
.balance-card > span:first-child { color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.balance-card strong { color: var(--brand-olive); font-size: 1.7rem; }
.balance-card .badge { width: fit-content; }
.admin-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.admin-summary-grid article { display: grid; padding: 18px; border-top: 4px solid var(--brand-green); background: var(--paper); }
.admin-summary-grid strong { color: var(--brand-olive); font-size: 1.8rem; }
.admin-summary-grid span { color: var(--muted); font-size: .78rem; }
.admin-detail-section { display: grid; gap: 20px; }
.company-users-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.company-users-grid article { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); background: #f7f8f4; }
.company-users-grid span, .company-users-grid small { color: var(--muted); font-weight: 400; }
.palette-preview { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.palette-preview div { display: grid; gap: 4px; min-width: 0; }
.palette-preview div > span { height: 54px; border: 1px solid var(--line); }
.palette-preview strong, .palette-preview small { overflow: hidden; font-size: .7rem; text-overflow: ellipsis; }
.palette-preview small { color: var(--muted); font-weight: 400; }
.brand-copy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.brand-copy-grid article { padding: 16px; background: #f4f6f1; }
.brand-copy-grid h3 { margin-bottom: 8px; color: var(--brand-olive); }
.brand-copy-grid p { margin: 0; color: var(--muted); line-height: 1.5; white-space: pre-wrap; }
.admin-brand-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.admin-brand-assets article { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); }
.admin-brand-assets img { width: 100%; height: 130px; object-fit: contain; background: #f1f2ed; }
.admin-brand-assets strong { text-transform: capitalize; }
.admin-brand-assets small { color: var(--muted); font-weight: 400; }
.admin-reference-list { display: grid; gap: 16px; }
.admin-reference-card { display: grid; grid-template-columns: minmax(220px, .55fr) minmax(0, 1.45fr); overflow: hidden; border: 1px solid #bdc6b6; background: var(--paper); box-shadow: 0 12px 30px #26321d10; }
.admin-reference-images { display: grid; grid-template-columns: repeat(2, 1fr); min-height: 260px; background: var(--brand-olive); }
.admin-reference-images img { width: 100%; height: 100%; min-height: 130px; object-fit: cover; }
.admin-reference-card > div:last-child { padding: 22px; }
.admin-reference-card h3 { margin: 0; color: var(--brand-olive); }
.admin-reference-card p { color: var(--muted); line-height: 1.5; }
.admin-reference-card dl { display: grid; gap: 12px; }
.admin-reference-card dl div { padding: 12px; background: #f4f6f1; }
.admin-reference-card dd { white-space: pre-wrap; }
.token-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.token-summary-grid article { display: grid; gap: 3px; padding: 15px; border-left: 4px solid var(--brand-yellow); background: #f4f6f1; }
.token-summary-grid strong { color: var(--brand-olive); font-size: 1.35rem; }
.token-summary-grid span, .token-usage-note { color: var(--muted); font-size: .76rem; }
.token-usage-table td:nth-child(n+3) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.token-usage-note { margin: 0; line-height: 1.5; }

.generation-history { display: grid; gap: 24px; }
.history-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.history-heading h1 { margin: 0; color: var(--brand-olive); font-size: clamp(2rem, 4vw, 3.5rem); }
.history-new { display: inline-block; padding: 13px 18px; border-radius: 4px; text-decoration: none; white-space: nowrap; }
.history-search { display: flex; align-items: end; gap: 14px; padding: 18px 20px; border: 1px solid #bdc6b6; border-left: 5px solid var(--brand-yellow); background: var(--paper); box-shadow: 0 10px 28px #26321d0f; }
.history-search label { flex: 1; }
.history-search-control { position: relative; display: block; }
.history-search-control input { padding-right: 46px; }
.history-search-control .inline-spinner { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); }
.history-clear { flex: 0 0 auto; margin-bottom: 22px; padding: 11px 13px; border: 1px solid var(--line); color: var(--brand-olive); background: #f2f3ec; cursor: pointer; }
.history-clear:hover { border-color: var(--brand-green); background: #e7ecdf; }
.history-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
.history-card { display: grid; gap: 18px; overflow: hidden; border: 1px solid #bdc6b6; border-top: 6px solid var(--brand-green); background: var(--paper); box-shadow: 0 14px 38px #26321d14; }
.history-card-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding: 22px 22px 0; }
.history-card-header h2 { margin-bottom: 5px; color: var(--brand-olive); font-size: 1.35rem; }
.history-card-header p:last-child { margin: 0; color: var(--muted); line-height: 1.4; }
.history-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding: 0 22px; }
.history-meta div { min-width: 0; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.history-meta dd { font-size: .86rem; }
.history-variants { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 0 22px; }
.history-variants-1 { grid-template-columns: 1fr; }
.history-variants-2 { grid-template-columns: repeat(2, 1fr); }
.history-variants button { display: block; width: 100%; min-width: 0; padding: 0; border: 0; background: var(--brand-olive); cursor: zoom-in; }
.history-variants img { display: block; width: 100%; aspect-ratio: 9 / 16; object-fit: cover; }
.history-error, .history-pending { margin: 0 22px; padding: 12px; color: var(--muted); background: #f2f3ec; font-size: .82rem; line-height: 1.45; }
.history-error { color: var(--error); background: #fff0e9; }
.history-card-footer { display: grid; gap: 9px; padding: 16px 22px; background: #f2f3ec; }
.history-card-footer span { overflow-wrap: anywhere; color: var(--muted); font-size: .68rem; }
.history-card-footer a { color: var(--brand-blue); text-underline-offset: 3px; }
.history-pagination { display: flex; align-items: center; justify-content: center; gap: 18px; }
.history-pagination .secondary { width: auto; }
.history-pagination span { color: var(--muted); font-size: .85rem; }

.credits-page { display: grid; gap: 28px; }
.credits-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; }
.credits-heading h1 { margin-bottom: 10px; color: var(--brand-olive); font-size: clamp(2.2rem, 4vw, 3.7rem); }
.credits-heading > div > p:last-child { max-width: 700px; margin: 0; color: var(--muted); line-height: 1.55; }
.credits-balance { display: grid; min-width: 280px; gap: 4px; padding: 22px 24px; border-top: 6px solid var(--brand-yellow); color: white; background: var(--brand-olive); box-shadow: 0 15px 36px #26321d22; }
.credits-balance span { color: #dce5d7; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.credits-balance strong { color: white; font-family: var(--font-display); font-size: 2rem; }
.credits-balance small { color: var(--brand-yellow); font-size: .7rem; font-weight: 500; }
.payment-notice { padding: 16px 18px; border: 1px solid #b9c9ae; border-left: 5px solid var(--brand-green); color: #304025; background: #eef5e9; line-height: 1.5; }
.credits-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 24px; align-items: start; }
.top-up-panel { border-top: 6px solid var(--brand-yellow); }
.top-up-title { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.top-up-title h2, .payment-help h2, .top-up-history h2 { margin-bottom: 0; color: var(--brand-olive); }
.gateway-status { padding: 6px 10px; border-radius: 999px; color: #7a3b00; background: #ffe4c8; font-size: .68rem; font-weight: 700; white-space: nowrap; }
.gateway-status.is-ready { color: #244c20; background: #ddf1d8; }
.top-up-form { display: grid; gap: 20px; margin-top: 26px; }
.top-up-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.top-up-presets button { padding: 13px 10px; border: 1px solid #abb6a5; border-radius: 4px; color: var(--brand-olive); background: #f1f4ee; cursor: pointer; }
.top-up-presets button:hover { border-color: var(--brand-green); background: #e4eadf; }
.payment-button { min-height: 52px; font-size: .95rem; }
.payment-security { margin: -7px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.payment-help { position: sticky; top: 102px; border-top: 6px solid var(--brand-green); }
.payment-help ol { display: grid; gap: 14px; margin: 22px 0; padding: 0; list-style: none; }
.payment-help li { display: grid; grid-template-columns: 32px 1fr; gap: 11px; align-items: start; }
.payment-help li > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #18200f; background: var(--brand-yellow); font-size: .78rem; font-weight: 750; }
.payment-help li p { margin: 3px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.top-up-history { display: grid; gap: 18px; padding: 26px; border: 1px solid #bdc6b6; background: var(--paper); box-shadow: 0 14px 38px #26321d14; }
.top-up-list { display: grid; gap: 8px; }
.top-up-list article { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 17px; border: 1px solid #d2d8ce; background: #f6f8f3; }
.top-up-list article > div { display: grid; gap: 3px; }
.top-up-list article > div:last-child { justify-items: end; }
.top-up-list article strong { color: var(--brand-olive); font-size: 1.08rem; }
.top-up-list article span:not(.badge), .top-up-list article small { color: var(--muted); font-size: .72rem; font-weight: 400; }
.movement-history-copy { margin: 7px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.movement-list { display: grid; gap: 9px; }
.movement-item { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 17px 18px; border: 1px solid #d2d8ce; border-left: 5px solid var(--brand-orange); background: #f6f8f3; }
.movement-item.movement-credit { border-left-color: var(--brand-green); }
.movement-main { display: flex; min-width: 0; align-items: center; gap: 14px; }
.movement-main > div, .movement-values { display: grid; gap: 3px; }
.movement-sign { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; color: white; background: var(--brand-orange); font-size: 1.15rem; font-weight: 800; }
.movement-credit .movement-sign { color: #18200f; background: var(--brand-yellow); }
.movement-main strong { color: var(--brand-olive); font-size: .94rem; }
.movement-main span, .movement-main small, .movement-values span, .movement-values small { overflow-wrap: anywhere; color: var(--muted); font-size: .72rem; font-weight: 400; }
.movement-values { flex: 0 0 205px; justify-items: end; text-align: right; }
.movement-values strong { color: #a74224; font-size: 1.02rem; }
.movement-credit .movement-values strong { color: var(--brand-green); }
.badge-pending { color: #655300; background: #fff2b5; }
.badge-rejected, .badge-cancelled, .badge-refunded, .badge-charged_back { color: #7d261e; background: #ffe1dc; }

.generation-preview-backdrop { position: fixed; z-index: 1100; inset: 0; display: grid; place-items: center; padding: 24px; overflow-y: auto; background: #172018e6; backdrop-filter: blur(6px); }
.generation-preview-modal { display: grid; width: min(100%, 920px); max-height: calc(100vh - 48px); grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; background: var(--paper); border-top: 7px solid var(--brand-yellow); box-shadow: 0 30px 100px #00000070; }
.generation-preview-modal > header { display: flex; align-items: start; justify-content: space-between; gap: 24px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.generation-preview-modal > header .eyebrow { margin: 0 0 3px; }
.generation-preview-modal > header h2 { margin: 0; color: var(--brand-olive); font-size: clamp(1.2rem, 3vw, 1.75rem); }
.generation-preview-close { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid #aeb9a8; border-radius: 4px; color: var(--brand-olive); background: #f2f4ee; font-size: 1.7rem; line-height: 1; cursor: pointer; }
.generation-preview-close:hover { border-color: var(--brand-green); background: #e6ebdf; }
.generation-preview-image { display: grid; min-height: 0; place-items: center; padding: 18px; overflow: auto; background: #172018; }
.generation-preview-image img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(100vh - 245px); object-fit: contain; }
.generation-preview-modal > footer { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); }
.generation-preview-modal > footer .primary { text-align: center; text-decoration: none; }
.generation-preview-modal > footer .secondary { width: auto; min-width: 130px; }

@media (max-width: 840px) {
    .page-intro, .workspace, .login-shell, .brand-settings-layout, .reference-styles-layout, .credits-layout { grid-template-columns: 1fr; }
    .page-intro { gap: 22px; }
    .status-panel { position: static; max-height: none; overflow-y: visible; }
    .result-panel { width: min(100%, 440px); justify-self: center; }
    .cards, .cards-1, .cards-2, .cards-3 { grid-template-columns: 1fr; }
    .login-brand { min-height: 310px; }
    .brand-help { position: static; }
    .reference-style-form { position: static; }
    .history-list { grid-template-columns: 1fr; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-nav { flex-direction: row; overflow-x: auto; padding: 10px; }
    .admin-nav a { white-space: nowrap; }
    .admin-resource-grid, .admin-reference-card { grid-template-columns: 1fr; }
    .admin-form-card { position: static; }
    .admin-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .company-detail-heading { align-items: stretch; flex-direction: column; }
    .balance-card { min-width: 0; }
    .payment-help { position: static; }
}

@media (max-width: 1180px) and (min-width: 901px) {
    .history-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1040px) and (min-width: 841px) {
    .workspace { grid-template-columns: 1fr; }
    .status-panel { position: static; max-height: none; overflow-y: visible; }
    .result-panel { width: min(100%, 440px); justify-self: center; }
}

@media (max-width: 900px) {
    .app-topbar { min-height: 72px; }
    .app-shell { display: block; min-height: calc(100vh - 72px); }
    .app-sidebar { top: 72px; height: auto; padding: 8px 12px; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid #c6cec0; box-shadow: 0 7px 18px #26321d10; }
    .app-nav { display: flex; gap: 7px; min-width: max-content; }
    .app-nav a { grid-template-columns: 25px auto; min-width: 138px; min-height: 48px; padding: 7px 10px; border-radius: 7px; }
    .app-nav a:hover { transform: none; }
    .app-nav a.is-active::before { width: 28px; height: 3px; margin: 46px 0 0 0; border-radius: 3px 3px 0 0; }
    .app-nav a small { display: none; }
    .app-nav-marker { width: 25px; height: 25px; border-radius: 6px; }
    .app-nav .app-nav-admin { margin: 0 0 0 5px; border-top: 1px solid transparent; border-left: 1px solid #cbd2c5; border-radius: 0 7px 7px 0; }
    .app-sidebar-meta { display: none; }
    .site-main.app-main { padding: 30px 18px 66px; }
    .security-grid { grid-template-columns: 1fr; }
    .recovery-codes-card ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .site-header { align-items: center; gap: 10px; }
    .brand-lockup { gap: 8px; }
    .brand-logo-frame { width: 110px; height: 48px; }
    .brand-logo-frame img { max-height: 46px; }
    .brand-product { padding: 0; border: 0; font-size: .68rem; }
    .brand-product small { max-width: 72px; font-size: .48rem; }
    .header-action { padding: 7px 9px; font-size: .72rem; }
    .header-nav { gap: 5px; }
    .form-grid, .section-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .panel, .results { padding: 21px; }
    .form-panel { padding: 0; }
    .form-panel-header { min-height: 170px; padding: 27px 24px 36px; }
    .form-panel > .form-grid { padding: 24px; }
    .form-section + .form-section { padding-top: 20px; }
    .submit-area { grid-template-columns: 1fr; }
    .submit-area .primary { width: 100%; min-width: 0; }
    .credit-required-action { width: 100%; min-width: 0; }
    .processing-dialog { padding: 30px 22px; }
    .login-page { padding: 0; }
    .login-shell { min-height: 100vh; }
    .registration-passwords { grid-template-columns: 1fr; }
    .registration-progress > span small { display: none; }
    .registration-form-panel { padding: 28px 22px 36px; }
    .recovery-codes-card ul { grid-template-columns: 1fr; }
    .color-grid, .brand-settings-actions { grid-template-columns: 1fr; }
    .reference-style-card { grid-template-columns: 1fr; }
    .reference-style-title { align-items: stretch; flex-direction: column; }
    .reference-style-actions { justify-content: flex-start; }
    .reference-style-editor-actions { grid-template-columns: 1fr; }
    .history-heading { align-items: start; flex-direction: column; }
    .history-new { width: 100%; text-align: center; }
    .history-search { align-items: stretch; flex-direction: column; }
    .history-clear { width: 100%; margin-bottom: 0; }
    .admin-main { padding: 26px 16px 55px; }
    .admin-summary-grid, .palette-preview, .brand-copy-grid, .token-summary-grid { grid-template-columns: 1fr 1fr; }
    .cost-admin-grid > article { grid-template-columns: 48px 1fr; }
    .cost-admin-grid > article > .table-actions { grid-column: 1 / -1; }
    .app-topbar { gap: 8px; padding: 8px 12px 12px; }
    .app-topbar .brand-lockup { min-width: 0; }
    .app-topbar .brand-logo-frame { width: 47px; height: 44px; }
    .app-topbar .brand-logo-frame img { max-height: 43px; }
    .app-topbar .brand-product { overflow: hidden; max-width: 140px; font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
    .app-topbar .brand-product small { max-width: 132px; }
    .app-account-copy { display: none; }
    .app-account { gap: 0; }
    .app-topbar .header-action { white-space: nowrap; }
    .site-main.app-main { padding: 24px 14px 58px; }
    .credits-heading, .top-up-title { align-items: stretch; flex-direction: column; }
    .credits-balance { min-width: 0; }
    .top-up-presets { grid-template-columns: 1fr; }
    .top-up-list article { align-items: start; flex-direction: column; }
    .top-up-list article > div:last-child { justify-items: start; }
    .movement-item { align-items: start; flex-direction: column; }
    .movement-values { width: 100%; flex-basis: auto; justify-items: start; text-align: left; }
    .generation-preview-backdrop { padding: 12px; }
    .generation-preview-modal { max-height: calc(100vh - 24px); }
    .generation-preview-modal > header { padding: 14px 16px; }
    .generation-preview-image { padding: 10px; }
    .generation-preview-image img { max-height: calc(100vh - 245px); }
    .generation-preview-modal > footer { grid-template-columns: 1fr; padding: 13px 16px; }
    .generation-preview-modal > footer .secondary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .processing-spinner, .inline-spinner { animation-duration: 1.8s; }
    .app-nav a { transition: none; }
}
