:root {
    --bg-1: #f5eee5;
    --bg-2: #edf5ff;
    --ink: #0d1b2a;
    --muted: #607086;
    --line: rgba(16, 31, 53, 0.12);
    --panel: rgba(255, 255, 255, 0.78);
    --panel-strong: rgba(255, 255, 255, 0.92);
    --brand: #2563eb;
    --brand-dark: #133c8b;
    --soft: #eff6ff;
    --sand: #f6efe5;
    --ok: #dff8ea;
    --warn: #fff0d8;
    --danger: #fff0ee;
    --shadow-lg: 0 24px 70px rgba(16, 31, 53, 0.12);
    --shadow-sm: 0 10px 30px rgba(16, 31, 53, 0.08);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.75), transparent 28%),
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 24%),
        linear-gradient(180deg, var(--bg-1), var(--bg-2) 45%, #dde9f7 100%);
    min-height: 100vh;
}
.page-shell { padding: 20px; }
.page-width { max-width: 1320px; margin: 0 auto; }
.glass-panel {
    background: var(--panel);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
}
.hero-shell { overflow: hidden; border-radius: 34px; }
.hero-main { padding: 32px; }
.hero-side {
    background:
        linear-gradient(150deg, rgba(37, 99, 235, 0.20), rgba(19, 60, 139, 0.92)),
        linear-gradient(180deg, #10203a, #17345b);
    color: #fff;
    padding: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.brand-chip, .section-chip, .pill-note {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    font-weight: 800;
}
.brand-chip {
    color: var(--brand);
    background: rgba(37, 99, 235, 0.10);
    border: 1px solid rgba(37, 99, 235, 0.14);
}
.section-chip {
    color: #f8fbff;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.pill-note {
    color: var(--brand-dark);
    background: var(--sand);
    letter-spacing: 0.18em;
}
.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: var(--shadow-sm);
}
.hero-title, .panel-title {
    font-family: "DM Serif Display", serif;
    line-height: 1.02;
    letter-spacing: -0.02em;
}
.hero-title { font-size: clamp(2.5rem, 6vw, 4.7rem); margin: 22px 0 0; }
.hero-text, .support-text { color: var(--muted); line-height: 1.75; font-size: 1rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.btn-strong, .btn-soft {
    border-radius: 999px;
    padding: 14px 24px;
    font-weight: 800;
    font-size: 0.95rem;
    border: 1px solid transparent;
    text-decoration: none;
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.btn-strong { background: var(--ink); color: #fff; }
.btn-strong:hover { transform: translateY(-1px); background: var(--brand); color: #fff; }
.btn-soft { background: transparent; color: var(--ink); border-color: rgba(13, 27, 42, 0.18); }
.btn-soft:hover { transform: translateY(-1px); background: var(--ink); color: #fff; }
.hero-metrics, .result-metrics { display: grid; gap: 14px; }
.hero-metrics { margin-top: 22px; }
.metric-card, .summary-card { border-radius: 22px; padding: 18px; }
.metric-card {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.metric-label, .mini-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
}
.metric-label { color: rgba(255, 255, 255, 0.72); }
.metric-title { margin-top: 10px; font-weight: 700; font-size: 0.98rem; }
.banner-card, .workspace-card { border-radius: 30px; }
.banner-card { padding: 18px; margin-top: 22px; }
.banner-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.ad-slot {
    margin-top: 16px;
    min-height: 130px;
    border-radius: 24px;
    border: 1px dashed rgba(16, 31, 53, 0.18);
    background: var(--soft);
    padding: 20px;
    color: var(--muted);
    line-height: 1.7;
}
.workspace-grid { display: grid; gap: 22px; margin-top: 22px; }
.workspace-card { padding: 28px; }
.panel-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}
.panel-title { font-size: 2.15rem; margin: 10px 0 0; }
.input-card { margin-top: 28px; }
.field-grid { display: grid; gap: 18px; }
.field-label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #334155;
}
.form-control, .form-control:focus {
    border-radius: 18px;
    padding: 15px 16px;
    border-color: rgba(100, 116, 139, 0.22);
    box-shadow: none;
}
.form-control:focus {
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}
.upload-shell {
    border-radius: 24px;
    border: 1px dashed rgba(100, 116, 139, 0.25);
    background: var(--soft);
    padding: 18px;
}
.btn-submit {
    border: none;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    padding: 16px 28px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.btn-submit:hover { background: var(--brand); transform: translateY(-1px); }
.tip-card, .empty-card, .inline-ad-card {
    border-radius: 24px;
    padding: 18px;
    line-height: 1.7;
}
.tip-card { background: var(--sand); color: var(--muted); }
.empty-card {
    background: var(--soft);
    border: 1px dashed rgba(100, 116, 139, 0.18);
    color: var(--muted);
    margin-top: 26px;
}
.score-badge {
    border-radius: 999px;
    padding: 10px 16px;
    background: rgba(37, 99, 235, 0.10);
    color: var(--brand);
    font-weight: 800;
}
.summary-card { background: var(--soft); }
.mini-label { color: #64748b; }
.summary-value { margin-top: 10px; font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.code-card {
    margin-top: 20px;
    border-radius: 24px;
    background: #08111d;
    color: #dbe8ff;
    padding: 18px;
}
.code-card pre { margin: 14px 0 0; white-space: pre-wrap; word-break: break-word; }
.breakdown-list { margin-top: 14px; display: grid; gap: 10px; }
.breakdown-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    border-radius: 18px;
    border: 1px solid rgba(100, 116, 139, 0.16);
    background: var(--panel-strong);
    padding: 14px 16px;
}
.breakdown-question { font-weight: 800; color: var(--ink); }
.breakdown-detail { color: var(--muted); font-size: 0.92rem; }
.status-badge {
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.status-ok { background: var(--ok); color: #0e8b4c; }
.status-review { background: var(--warn); color: #8c5a00; }
.inline-ad-card {
    margin-top: 20px;
    border: 1px dashed rgba(100, 116, 139, 0.22);
    background: var(--soft);
    color: var(--muted);
}
.error-box {
    display: none;
    margin-top: 12px;
    border-radius: 18px;
    background: var(--danger);
    border: 1px solid rgba(220, 38, 38, 0.10);
    color: #b42318;
    padding: 14px 16px;
}

/* Responsive Ad Slots */
.ad-panel-wrap { padding: 10px 16px; margin-bottom: 22px; overflow: hidden; }
.ad-slot-wrap { position: relative; height: 90px; padding: 0; margin: 0; border: none; background: rgba(37, 99, 235, 0.04); overflow: hidden; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.ad-slot-wrap ins { display: inline-block; width: 100%; height: 90px !important; position: relative; z-index: 1; }
.ad-label { position: absolute; color: #94a3b8; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; z-index: 0; }

@media (max-width: 575.98px) {
    .ad-panel-wrap { padding: 8px 12px; margin-bottom: 16px; }
    .ad-slot-wrap { height: 60px; }
    .ad-slot-wrap ins { height: 60px !important; }
    .ad-label { font-size: 0.65rem; }
    .ad-slot { padding: 16px; min-height: 100px; }
}

/* Navbar Styles */
.navbar-shell {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(16, 31, 53, 0.10);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(16, 31, 53, 0.08);
}

.navbar-width {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.brand-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
}

.brand-mark-nav {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
}

.brand-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--ink);
}

.brand-tagline {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 2px;
    align-items: center;
}

.nav-link {
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.88rem;
    text-decoration: none;
    color: var(--muted);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--ink);
    background: rgba(37, 99, 235, 0.08);
}

.nav-link.active {
    color: var(--brand);
    background: rgba(37, 99, 235, 0.10);
}

/* Selection Hero */
.selection-hero {
    padding: 0;
}

.hero-layout-single {
    padding: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-center {
    max-width: 700px;
}

.hero-brand-row {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.selection-notice {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 32px;
    padding: 20px;
    background: var(--soft);
    border-radius: 22px;
    border: 1px solid rgba(37, 99, 235, 0.16);
}

.notice-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.notice-text {
    flex: 1;
    text-align: left;
    color: var(--muted);
    line-height: 1.6;
}

.notice-link {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin-left: 8px;
}

.notice-link:hover {
    color: var(--brand-dark);
}

/* Selection Workspace */
.selection-workspace {
    display: grid;
    gap: 28px;
    margin-top: 28px;
}

.selection-card {
    padding: 40px;
}

.selection-form {
    margin-top: 32px;
}

.form-section {
    margin-bottom: 32px;
}

.section-label {
    margin-bottom: 24px;
    text-align: left;
}

.section-label h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ink);
}

.section-label p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.section-divider {
    height: 1px;
    background: rgba(16, 31, 53, 0.12);
    margin: 32px 0;
}

.selection-grid {
    display: grid;
    gap: 12px;
}

.class-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
}

.subject-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.selection-button {
    background: white;
    border: 2px solid rgba(37, 99, 235, 0.16);
    color: var(--ink);
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.selection-button:hover {
    border-color: rgba(37, 99, 235, 0.32);
    background: var(--soft);
    transform: translateY(-2px);
}

.selection-button.active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.selection-notice-bottom {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 32px 0;
    padding: 18px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.02));
    border-radius: 20px;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.notice-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.notice-text {
    color: var(--muted);
    line-height: 1.6;
}

.btn-large {
    padding: 16px 36px;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.action-row {
    display: flex;
    width: 100%;
    gap: 14px;
    margin-top: 28px;
}

.action-row .btn-submit {
    margin: 0;
}

/* Info Card */
.info-card {
    padding: 28px;
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.compact-head {
    align-items: flex-start;
}

.small-title {
    font-size: 1.6rem;
}

.workflow-list {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.workflow-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 999px;
    background: var(--brand);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

.step-content {
    flex: 1;
}

.step-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--ink);
}

.step-text {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 4px 0 0;
    line-height: 1.5;
}

@media (min-width: 992px) {
    .hero-side { border-left: 1px solid rgba(255, 255, 255, 0.12); border-top: 0; }
    .workspace-grid { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); }
    .field-grid { grid-template-columns: 1fr 1fr; }
    .action-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 16px;
        align-items: center;
    }
    .result-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .selection-workspace { grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr); }
    .class-grid { grid-template-columns: repeat(4, 1fr); }
    .subject-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991.98px) {
    .hero-main, .hero-side, .workspace-card { padding: 24px; }
    .selection-card { padding: 28px; }
    .panel-title { font-size: 1.9rem; }
    .class-grid { grid-template-columns: repeat(3, 1fr); }
    .subject-grid { grid-template-columns: repeat(2, 1fr); }
    .selection-workspace { grid-template-columns: 1fr; }
}
@media (max-width: 575.98px) {
    .page-shell { padding: 14px; }
    .navbar-layout { height: 60px; }
    .hero-main, .hero-side, .workspace-card { padding: 20px; }
    .selection-card { padding: 20px; }
    .hero-layout-single { padding: 28px 20px; }
    .banner-head, .panel-head, .breakdown-row { flex-direction: column; align-items: flex-start; }
    .btn-strong, .btn-soft, .btn-submit { width: 100%; justify-content: center; }
    .btn-large { width: 100%; }
    .class-grid { grid-template-columns: repeat(2, 1fr); }
    .subject-grid { grid-template-columns: 1fr; }
    .selection-notice, .selection-notice-bottom { flex-direction: column; }
}
