:root {
  --ink: #182026;
  --muted: #637078;
  --line: #dce3e6;
  --surface: #ffffff;
  --soft: #f2f6f5;
  --accent: #0d6b5a;
  --accent-dark: #074b40;
  --warm: #e8a23a;
  --shadow: 0 14px 40px rgba(21, 45, 49, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f7f9f8;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
.shell { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.site-header { background: #123b38; color: white; border-bottom: 4px solid var(--warm); }
.header-content { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 13px; text-decoration: none; }
.brand-logo { display: block; width: 48px; height: 48px; flex: 0 0 auto; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .12)); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.03rem; }
.brand small { color: #c4d4d1; margin-top: 2px; }
.account-nav { display: flex; align-items: center; gap: 13px; font-size: .86rem; }
.account-nav a, .nav-button { color: white; font: inherit; font-weight: 700; text-decoration: none; }
.account-nav form { margin: 0; }
.nav-button { padding: 0; border: 0; background: transparent; cursor: pointer; }
.nav-signup { padding: 8px 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; }
.nav-admin { padding: 8px 12px; border-radius: 8px; background: var(--warm); color: #17312f !important; }
.plan-badge { padding: 4px 8px; border-radius: 999px; background: var(--warm); color: #17312f; font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.verification-badge { padding: 4px 8px; border-radius: 999px; background: #fff0d8; color: #5f3b04; font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.flash-stack { display: grid; gap: 8px; padding-top: 18px; }
.flash { padding: 12px 15px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: .88rem; }
.flash-success { border-color: #9acabb; background: #eaf7f2; color: #075346; }
.flash-warning { border-color: #e8c98f; background: #fff7e8; color: #70470a; }
.flash-error { border-color: #e4aaa5; background: #fff0ef; color: #8a2c24; }
.hero { padding: 58px 0 30px; }
.hero h1 { margin: 5px 0 10px; max-width: 760px; font-family: Georgia, serif; font-size: clamp(2.2rem, 5vw, 4.1rem); line-height: 1.02; letter-spacing: -0.035em; }
.hero > p:last-child { color: var(--muted); font-size: 1.08rem; }
.hero .account-summary { width: fit-content; margin-top: 18px; padding: 10px 13px; border-radius: 9px; background: #e8f2ef; color: var(--accent-dark); font-size: .88rem; }
.account-summary a { font-weight: 800; }
.inline-form { display: inline; }
.link-button { padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.eyebrow { margin: 0; color: var(--accent); font-size: .74rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.filters-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.filters-toggle { display: flex; align-items: center; gap: 13px; padding: 17px 20px; cursor: pointer; list-style: none; user-select: none; }
.filters-toggle::-webkit-details-marker { display: none; }
.filters-toggle:focus-visible { outline: 3px solid rgba(13, 107, 90, .18); outline-offset: -3px; }
.filters-toggle-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px; background: #e8f2ef; color: var(--accent-dark); font-size: 1rem; }
.filters-toggle-copy { display: grid; gap: 2px; flex: 1; }
.filters-toggle-copy strong { font-size: .95rem; }
.filters-toggle-copy small { color: var(--muted); font-size: .78rem; }
.filters-count { padding: 5px 9px; border-radius: 999px; background: #fff0d8; color: #70470a; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.filters-chevron { color: var(--muted); font-size: 1.25rem; transition: transform .18s ease; }
.filters-panel[open] .filters-toggle { border-bottom: 1px solid var(--line); }
.filters-panel[open] .filters-chevron { transform: rotate(180deg); }
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 22px; }
.field { min-width: 0; }
.field-search { grid-column: span 2; }
.field label { display: block; margin-bottom: 7px; color: #3e4b50; font-size: .79rem; font-weight: 750; }
input, select { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #cbd5d8; border-radius: 9px; background: white; color: var(--ink); font: inherit; }
input:focus, select:focus { outline: 3px solid rgba(13, 107, 90, .14); border-color: var(--accent); }
.filter-actions { display: flex; align-items: end; gap: 9px; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 10px 16px; border: 0; border-radius: 9px; text-decoration: none; font: inherit; font-size: .88rem; font-weight: 750; cursor: pointer; }
.button-primary { background: var(--accent); color: white; }
.button-primary:hover { background: var(--accent-dark); }
.button-ghost { border: 1px solid var(--line); background: white; color: var(--ink); }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 32px 0 18px; }
.results-heading h2 { margin: 5px 0 0; font-family: Georgia, serif; font-size: 1.65rem; }
.page-status { color: var(--muted); font-size: .88rem; }
.exam-list { display: grid; gap: 14px; }
.exam-card { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 26px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 5px 20px rgba(30, 52, 56, .04); }
.exam-card h3 { margin: 11px 0 15px; font-family: Georgia, serif; font-size: 1.3rem; line-height: 1.25; }
.exam-title-link { text-decoration-color: transparent; text-underline-offset: 3px; transition: color .15s ease, text-decoration-color .15s ease; }
.exam-title-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; }
.badge { padding: 5px 9px; border-radius: 999px; background: #dcefe9; color: #075346; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.badge-muted { background: #edf0f1; color: #4d5a60; }
.badge-location { background: #fff0d8; color: #825308; }
.metadata { display: flex; flex-wrap: wrap; gap: 12px 26px; margin: 0; }
.metadata div { min-width: 130px; }
.metadata dt { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.metadata dd { margin: 3px 0 0; font-size: .88rem; }
.downloads { display: flex; flex-direction: column; justify-content: center; gap: 9px; border-left: 1px solid var(--line); padding-left: 24px; }
.button-download { background: var(--accent); color: white; }
.button-secondary { background: #eef5f3; color: var(--accent-dark); border: 1px solid #c9dcd7; }
.button-disabled { background: #f0f2f2; color: #929c9f; cursor: not-allowed; }
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px; padding: 32px 0 60px; }
.pagination a, .pagination .current { display: grid; place-items: center; min-width: 39px; height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: white; text-decoration: none; font-size: .86rem; }
.pagination .current { border-color: var(--accent); background: var(--accent); color: white; font-weight: 800; }
.ellipsis { padding: 0 5px; color: var(--muted); }
.empty-state { margin: 30px 0 70px; padding: 60px 24px; text-align: center; border: 1px dashed #b9c7c9; border-radius: 18px; background: white; }
.empty-state h1, .empty-state h2 { font-family: Georgia, serif; }
.empty-state .button { margin-top: 12px; }
.error-state { margin-top: 60px; }
.error-state form { margin-top: 18px; }
.verification-back { display: block; margin-top: 18px; color: var(--accent); font-weight: 750; }
.auth-card { width: min(480px, 100%); margin: 58px auto 80px; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: var(--shadow); }
.auth-card h1 { margin: 7px 0 8px; font-family: Georgia, serif; font-size: 2rem; }
.auth-card > p:not(.eyebrow) { color: var(--muted); }
.auth-card form { display: grid; gap: 17px; margin-top: 24px; }
.auth-card form .button { margin-top: 4px; }
.forgot-link { justify-self: end; margin-top: -8px; color: var(--accent); font-size: .8rem; font-weight: 750; }
.auth-card .field small { display: block; margin-top: 6px; color: var(--muted); font-size: .75rem; }
.auth-alternative { margin: 22px 0 0; font-size: .88rem; text-align: center; }
.auth-alternative a { color: var(--accent); font-weight: 800; }
.auth-dialog { width: min(480px, calc(100% - 24px)); padding: 0; border: 0; border-radius: 20px; background: white; color: var(--ink); box-shadow: 0 24px 80px rgba(9, 32, 34, .28); }
.auth-dialog::backdrop { background: rgba(9, 32, 34, .64); backdrop-filter: blur(3px); }
.auth-dialog-content { position: relative; padding: 32px; text-align: center; }
.dialog-close { position: absolute; top: 13px; right: 13px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: #edf2f1; color: #4d5a60; font-size: 1.25rem; cursor: pointer; }
.dialog-close:hover { background: #e0e8e6; color: var(--ink); }
.auth-dialog-icon { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 17px; border-radius: 50%; background: #e8f2ef; color: var(--accent-dark); font-size: 1.35rem; }
.auth-dialog h2 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 1.8rem; }
.auth-dialog p { margin: 0; color: var(--muted); line-height: 1.55; }
.auth-dialog-actions { display: grid; gap: 10px; margin: 24px 0 15px; }
.auth-dialog-actions .button { width: 100%; }
.auth-dialog-note { display: block; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.admin-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 46px 0 22px; }
.admin-heading h1 { margin: 5px 0 0; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.2rem); }
.admin-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.admin-tabs a { padding: 10px 14px; border-radius: 8px; color: var(--muted); font-size: .84rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.admin-tabs a:hover { background: var(--soft); color: var(--ink); }
.admin-tabs a[aria-current="page"] { background: var(--accent); color: white; }
.admin-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 28px 0; }
.admin-stats a { display: grid; gap: 6px; min-height: 130px; align-content: center; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: white; text-decoration: none; box-shadow: 0 5px 20px rgba(30, 52, 56, .04); }
.admin-stats a:hover { border-color: #9acabb; transform: translateY(-1px); }
.admin-stats strong { color: var(--accent-dark); font-family: Georgia, serif; font-size: 2rem; }
.admin-stats span { color: var(--muted); font-size: .8rem; font-weight: 700; }
.admin-notice { margin-bottom: 70px; padding: 24px; border-left: 4px solid var(--warm); border-radius: 0 12px 12px 0; background: #fff7e8; }
.admin-notice h2 { margin: 0 0 7px; font-family: Georgia, serif; }
.admin-notice p { margin: 0; color: #5f4a29; line-height: 1.55; }
.admin-search { display: flex; align-items: end; gap: 9px; padding: 26px 0 18px; }
.admin-search .field { width: min(520px, 100%); }
.admin-search .field > span { display: block; margin-bottom: 7px; color: #3e4b50; font-size: .79rem; font-weight: 750; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }
.admin-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .84rem; }
.admin-table th { padding: 12px 15px; background: var(--soft); color: #4d5a60; text-align: left; font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; }
.admin-table td { padding: 14px 15px; border-top: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:hover { background: #fbfcfc; }
.admin-table td strong, .admin-table td small { display: block; }
.admin-table td small { max-width: 420px; margin-top: 3px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.admin-table td a { text-decoration: none; }
.table-action { color: var(--accent); font-weight: 800; }
.status-chip { display: inline-flex; margin: 2px; padding: 4px 7px; border-radius: 999px; background: #e8f2ef; color: var(--accent-dark); font-size: .66rem; font-weight: 850; white-space: nowrap; }
.status-admin { background: #fff0d8; color: #70470a; }
.status-error { background: #fff0ef; color: #8a2c24; }
.status-warning { background: #fff7e8; color: #70470a; }
.admin-pagination { padding-bottom: 45px; }
.admin-form-card { width: min(720px, 100%); margin: 26px 0 70px; padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow); }
.admin-form-wide { width: 100%; }
.admin-record-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.admin-record-meta span { padding: 5px 8px; border-radius: 7px; background: var(--soft); color: var(--muted); font-size: .72rem; font-weight: 750; }
.admin-form { display: grid; gap: 17px; }
.admin-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-span-2 { grid-column: span 2; }
textarea { width: 100%; padding: 11px 12px; resize: vertical; border: 1px solid #cbd5d8; border-radius: 9px; background: white; color: var(--ink); font: inherit; }
textarea:focus { outline: 3px solid rgba(13, 107, 90, .14); border-color: var(--accent); }
.check-field { display: flex; align-items: center; gap: 10px; width: fit-content; color: #3e4b50; font-size: .86rem; font-weight: 750; cursor: pointer; }
.check-field input { width: 19px; height: 19px; margin: 0; accent-color: var(--accent); }
.admin-form-actions { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 5px; }
.admin-related { margin: -40px 0 70px; }
.admin-related h2 { font-family: Georgia, serif; }
.path-cell { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumbs { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 30px 0 0; color: var(--muted); font-size: .78rem; }
.breadcrumbs a { color: var(--accent); font-weight: 750; }
.breadcrumbs span[aria-current="page"] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exam-detail { margin: 24px 0 30px; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); }
.exam-detail-header { padding: 38px 40px 30px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fff 35%, #edf6f3); }
.exam-detail-header h1 { max-width: 900px; margin: 8px 0 13px; font-family: Georgia, serif; font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.08; letter-spacing: -.025em; }
.exam-detail-header > p:last-child { max-width: 700px; margin-bottom: 0; color: var(--muted); line-height: 1.55; }
.exam-detail-metadata { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 28px 40px; gap: 22px; }
.exam-detail-metadata div { min-width: 0; }
.exam-detail-metadata dt { color: var(--muted); font-size: .69rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.exam-detail-metadata dd { margin: 5px 0 0; font-size: .95rem; }
.exam-detail-downloads { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 28px; margin: 0 40px 38px; padding: 25px; border-radius: 14px; background: var(--soft); }
.exam-detail-downloads h2 { margin: 5px 0 7px; font-family: Georgia, serif; }
.exam-detail-downloads p:last-child { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.exam-detail-actions { display: flex; gap: 9px; }
.exam-detail-back { margin-bottom: 65px; }
.exam-detail-back a { color: var(--accent); font-weight: 800; }
.site-footer { padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }

@media (max-width: 850px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-card { grid-template-columns: 1fr; }
  .downloads { flex-direction: row; justify-content: flex-start; border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-detail-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exam-detail-downloads { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 1180px); }
  .hero { padding: 34px 0 22px; }
  .filters-toggle { padding: 14px 15px; }
  .filters-toggle-copy small { display: none; }
  .filters { grid-template-columns: 1fr; padding: 16px; }
  .field-search { grid-column: auto; }
  .filter-actions, .downloads { flex-direction: column; align-items: stretch; }
  .results-heading { align-items: flex-start; flex-direction: column; padding-top: 26px; }
  .exam-card { padding: 18px; }
  .header-content { align-items: flex-start; flex-direction: column; gap: 14px; padding-block: 17px; }
  .account-nav { width: 100%; flex-wrap: wrap; }
  .auth-card { margin-top: 30px; padding: 22px 18px; }
  .auth-dialog-content { padding: 30px 20px 24px; }
  .admin-heading { align-items: flex-start; flex-direction: column; padding-top: 32px; }
  .admin-tabs { margin-inline: -10px; border-right: 0; border-left: 0; border-radius: 0; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-stats a { min-height: 105px; padding: 16px; }
  .admin-search { align-items: stretch; flex-direction: column; }
  .admin-search .button { width: 100%; }
  .admin-form-card { padding: 20px 16px; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-span-2 { grid-column: auto; }
  .breadcrumbs { padding-top: 22px; }
  .exam-detail { margin-top: 18px; }
  .exam-detail-header { padding: 28px 20px 23px; }
  .exam-detail-metadata { grid-template-columns: 1fr; padding: 23px 20px; }
  .exam-detail-downloads { margin: 0 14px 20px; padding: 20px; }
  .exam-detail-actions { flex-direction: column; }
}
