:root {
  color-scheme: light;
  --page: #f5f5f7;
  --surface: #ffffff;
  --surface-raised: #fbfbfd;
  --ink: #1d1d1f;
  --forest: #0071e3;
  --forest-deep: #005bb5;
  --button-bg: #0071e3;
  --button-text: #ffffff;
  --moss: #6e6e73;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --gold: #0071e3;
  --gold-light: #0a84ff;
  --walnut: #1d1d1f;
  --error: #d70015;
  --row-odd: #ffffff;
  --row-even: #f1f5f9;
  --frame-edge: #b8bbc2;
  --frame-highlight: #ffffff;
  --frame-shadow: #a6a9b0;
  --art-bg: #e9e9ed;
  --art-line: #6e6e73;
  --footer-bg: #e9e9ed;
  --footer-text: #1d1d1f;
  --footer-muted: #6e6e73;
}

body.dark {
  color-scheme: dark;
  --page: #000000;
  --surface: #1c1c1e;
  --surface-raised: #252527;
  --ink: #f5f5f7;
  --forest: #0a84ff;
  --forest-deep: #0066cc;
  --button-bg: #0066cc;
  --button-text: #ffffff;
  --moss: #a1a1a6;
  --muted: #a1a1a6;
  --line: #38383a;
  --gold: #0a84ff;
  --gold-light: #64aaff;
  --walnut: #f5f5f7;
  --error: #ff453a;
  --row-odd: #1c1c1e;
  --row-even: #252527;
  --frame-edge: #54545a;
  --frame-highlight: #77777e;
  --frame-shadow: #303034;
  --art-bg: #1c1c1e;
  --art-line: #d2d2d7;
  --footer-bg: #1c1c1e;
  --footer-text: #f5f5f7;
  --footer-muted: #a1a1a6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  color: var(--ink);
  background: var(--page);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; }
.enrollment-page { max-width: 720px; margin: 32px auto; padding: 0 24px; }
.enrollment-page .request-panel { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.enrollment-page .request-consent { margin: 24px 0; }
.enrollment-page .text-action { display: inline-block; margin: 24px 16px 0 0; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 72%, white);
  outline-offset: 3px;
}
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 30px;
  width: min(1440px, calc(100% - 64px));
  min-height: 104px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.logo-frame {
  display: grid;
  place-items: center;
  width: 164px;
  height: 76px;
  padding: 4px 7px;
  overflow: hidden;
  border: 3px solid var(--frame-edge);
  border-radius: 12px;
  background: transparent;
  box-shadow: inset 0 1px 0 var(--frame-highlight),
    inset 0 -1px 0 var(--frame-shadow), 0 3px 12px rgb(0 0 0 / .09);
}
.logo-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand-copy strong, .brand-copy small { display: block; }
.brand-copy strong { font: 600 18px/1.25 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; letter-spacing: -.02em; }
.brand-copy small { max-width: 195px; margin-top: 5px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .12em; line-height: 1.4; }
.main-nav { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 38px); margin-left: auto; }
.main-nav a { color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; transition: color .18s ease; }
.main-nav a:hover { color: var(--forest); }
.session-actions { display: flex; align-items: center; gap: 9px; }
.state-button, .theme-button {
  min-width: 75px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .035em;
}
.state-button:disabled { opacity: .52; cursor: not-allowed; }
#logout:not(:disabled) { border-color: var(--button-bg); color: var(--button-text); background: var(--button-bg); }
.theme-button { min-width: 66px; color: var(--muted); }

.shell { width: min(1320px, calc(100% - 64px)); margin: 0 auto; }
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .93fr) minmax(0, 1.07fr);
  align-items: center;
  gap: clamp(26px, 4vw, 58px);
  min-height: 615px;
  padding: 58px clamp(30px, 5.2vw, 76px) 52px;
  margin-top: 26px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--gold) 27%, var(--line));
  border-radius: 18px;
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface) 90%, var(--page)));
  box-shadow: 0 22px 70px rgb(0 0 0 / .07);
}
.hero::before, .hero::after { position: absolute; z-index: 0; content: ""; pointer-events: none; }
.hero::before { inset: 13px; border: 1px solid color-mix(in srgb, var(--line) 65%, transparent); border-radius: 12px; }
.hero::after {
  right: -140px;
  bottom: -230px;
  width: 600px;
  height: 600px;
  border: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  border-radius: 50%;
}
.hero-copy, .hero-art { position: relative; z-index: 1; }
.hero-copy { max-width: 570px; padding: 12px 0 20px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--moss); font-size: 10px; font-weight: 800; letter-spacing: .19em; line-height: 1.5; }
.eyebrow-rule { display: inline-block; width: 28px; height: 1px; background: var(--gold); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; font-weight: 600; }
h1 { margin: 25px 0 20px; font-size: clamp(42px, 5vw, 68px); letter-spacing: -.048em; line-height: 1.045; }
h1 em, h2 em { color: var(--walnut); font-weight: 400; }
body.dark h1 em, body.dark h2 em { color: var(--gold-light); }
.hero-lead { max-width: 490px; margin-bottom: 30px; color: var(--muted); font-size: clamp(15px, 1.4vw, 17px); line-height: 1.75; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 21px; }
.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  min-height: 52px;
  padding: 0 21px;
  border: 1px solid var(--forest);
  border-radius: 999px;
  color: var(--button-text);
  background: var(--button-bg);
  box-shadow: 0 8px 20px rgb(0 113 227 / .17);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .025em;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.action-icon { display: inline-grid; place-items: center; width: 18px; height: 18px; color: var(--gold-light); }
.action-icon svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.primary-action:hover:not(:disabled) { transform: translateY(-2px); background: var(--forest-deep); box-shadow: 0 12px 24px rgb(0 113 227 / .24); }
.primary-action:disabled { opacity: .55; cursor: not-allowed; }
.secondary-action, .request-close-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-raised);
  font-weight: 600;
}
.login-panel > .secondary-action { width: 100%; margin-top: 16px; }
.secondary-action:disabled { opacity: .55; cursor: not-allowed; }
.primary-action .action-icon { color: inherit; }
.text-action { color: var(--walnut); font-size: 12px; font-weight: 700; text-decoration: none; }
body.dark .text-action { color: var(--gold-light); }
.text-action span { margin-left: 7px; color: var(--gold); }
.hero-note { display: flex; align-items: center; gap: 9px; margin: 28px 0 0; color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #6c8b64; box-shadow: 0 0 0 4px rgb(108 139 100 / .13); }

.hero-art {
  display: grid;
  place-items: center;
  min-height: 452px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--art-bg);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 16px 40px rgb(0 0 0 / .12);
}
.hero-art::before { position: absolute; inset: 12px; border: 1px solid color-mix(in srgb, var(--art-line) 35%, transparent); border-radius: 10px; content: ""; pointer-events: none; }
.hero-art::after { position: absolute; inset: 20px; border: 1px solid color-mix(in srgb, var(--art-line) 16%, transparent); border-radius: 7px; content: ""; pointer-events: none; }
.sideboard { position: relative; z-index: 1; display: block; width: min(100%, 620px); margin: 27px 0 6px; filter: saturate(.9); }
.art-caption { position: absolute; z-index: 2; top: 29px; right: 34px; left: 34px; display: flex; justify-content: space-between; color: var(--art-line); font-size: 9px; font-weight: 700; letter-spacing: .17em; }
.art-orbit { position: absolute; border: 1px solid color-mix(in srgb, var(--art-line) 17%, transparent); border-radius: 50%; }
.orbit-one { width: 365px; height: 365px; }
.orbit-two { width: 455px; height: 455px; }
.art-seal { position: absolute; z-index: 2; right: 27px; bottom: 25px; display: flex; align-items: center; gap: 10px; color: var(--art-line); font: 600 10px/1.45 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; letter-spacing: .08em; }
.seal-rosette { display: block; width: 25px; height: 25px; fill: none; stroke: var(--gold-light); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.2; }

.craft-section { padding: 92px 5.2vw 96px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.section-heading h2, .site-footer h2 { margin: 14px 0 0; font-size: clamp(30px, 3.3vw, 44px); letter-spacing: -.035em; line-height: 1.12; }
.craft-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.craft-card { position: relative; min-height: 190px; padding: 24px 25px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.card-index { color: var(--gold); font: 12px Georgia, "Times New Roman", serif; letter-spacing: .12em; }
.craft-card h3 { margin: 24px 0 8px; color: var(--ink); font-size: 22px; }
.craft-card p { max-width: 340px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.site-footer { position: relative; display: grid; grid-template-columns: 1.2fr 1fr; align-items: end; gap: 34px; padding: 48px clamp(28px, 5.2vw, 70px) 76px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px 16px 0 0; color: var(--footer-text); background: var(--footer-bg); }
.site-footer::after { position: absolute; right: -85px; bottom: -190px; width: 440px; height: 440px; border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent); border-radius: 50%; box-shadow: 0 0 0 28px color-mix(in srgb, var(--gold) 4%, transparent), 0 0 0 58px color-mix(in srgb, var(--gold) 3%, transparent); content: ""; }
.site-footer .eyebrow, .footer-mark { color: var(--footer-muted); }
.site-footer h2 em { color: var(--gold-light); }
.site-footer address { position: relative; z-index: 1; justify-self: end; color: var(--footer-text); font-size: 14px; font-style: normal; line-height: 1.8; }
.footer-mark { position: absolute; z-index: 1; right: clamp(28px, 5.2vw, 70px); bottom: 23px; font-size: 8px; font-weight: 700; letter-spacing: .18em; }
.footer-mark b { padding: 0 7px; color: var(--gold-light); }

.login-dialog, #aboutDialog { width: min(500px, calc(100% - 32px)); max-height: min(88vh, 760px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: 0 30px 100px rgb(10 22 16 / .35); }
.request-dialog { width: min(620px, calc(100% - 32px)); max-height: min(88vh, 820px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: 0 30px 100px rgb(10 22 16 / .35); }
.login-dialog::backdrop, #aboutDialog::backdrop, .request-dialog::backdrop { background: rgb(14 25 20 / .64); backdrop-filter: blur(4px); }
.login-panel { padding: clamp(24px, 6vw, 42px); }
.request-panel { padding: clamp(20px, 5vw, 36px); }
.request-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.request-grid label { min-width: 0; }
.request-grid label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
.request-grid input, .request-grid select { width: 100%; min-width: 0; height: 48px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface-raised); font: inherit; }
.request-grid input[readonly] { opacity: .8; }
.request-grid b { color: var(--error); }
.request-privacy { margin: 16px 0; color: var(--muted); font-size: 12px; }
.request-consent { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 12px; }
.request-consent input { margin-top: 4px; accent-color: var(--forest); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.dialog-heading h2 { margin: 11px 0 0; font-size: 29px; letter-spacing: -.025em; }
.dialog-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; font-size: 22px; line-height: 1; }
.dialog-intro { margin: 14px 0 25px; color: var(--muted); font-size: 13px; }
.login-panel label { display: block; margin-top: 17px; }
.login-panel label > span:first-child { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.login-panel input { width: 100%; height: 47px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface-raised); }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 52px; }
.password-field button { position: absolute; top: 6px; right: 7px; display: grid; place-items: center; width: 36px; height: 35px; padding: 0; border: 0; border-radius: 4px; background: transparent; }
.password-field button img { display: block; width: 19px; height: 19px; filter: opacity(.62); }
body.dark .password-field button img { filter: brightness(0) invert(1); }
body.dark .nav-button img { filter: brightness(1.5); }
.login-submit { width: 100%; margin-top: 24px; }
.request-actions { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.request-actions .login-submit { flex: 1 1 auto; width: auto; min-width: 0; margin-top: 0; }
.request-close-action { flex: 0 0 auto; min-height: 46px; margin: 0; white-space: nowrap; }
.hint { min-height: 24px; margin: 15px 0 0; color: var(--error); font-size: 12px; }
.log-hint { margin: 9px 0 0; color: var(--muted); font-size: 10px; }
.log-download { margin-top: 7px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 11px; text-decoration: underline; }

.app-stage { min-height: 72vh; padding: 34px 0 80px; }
.app-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.app-toolbar h2 { margin: 8px 0 0; font-size: 27px; }
.user-tools { color: var(--muted); font-size: 13px; }
.user-tools { display: flex; align-items: center; gap: 12px; }
.admin-toggle { min-height: 38px; padding: 0 15px; white-space: nowrap; }
.certificate-admin-panel { margin-top: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.settings-panel { margin-top: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.settings-tabs { display: flex; gap: 8px; margin: 14px 0; border-bottom: 1px solid var(--line); }
.settings-tab { padding: 9px 14px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; cursor: pointer; }
.settings-tab.active { border-bottom-color: var(--gold); color: var(--ink); }
.settings-category { padding: 12px 0; }
.settings-category label { display: grid; gap: 7px; max-width: 480px; margin: 12px 0; }
.settings-category input { min-height: 40px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); }
.certificate-status-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.certificate-status-list div { padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.certificate-status-list dt { color: var(--muted); font-size: 11px; }
.certificate-status-list dd { margin: 7px 0 0; color: var(--ink); font-size: 13px; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.admin-heading h2 { margin: 8px 0 0; font-size: 25px; }
.admin-description { max-width: 880px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.admin-table-wrap { max-height: min(58vh, 600px); }
#certificateRequestTable { min-width: 880px; }
#certificateRequestTable td { white-space: normal; }
.admin-empty { padding: 24px; color: var(--muted); text-align: center; }
.admin-status { min-height: 20px; margin-bottom: 0; }
.request-status { display: inline-flex; align-items: center; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-raised); font: 700 10px/1.2 -apple-system, BlinkMacSystemFont, Arial, sans-serif; letter-spacing: .05em; }
.status-pending { color: #735018; border-color: color-mix(in srgb, var(--gold) 42%, var(--line)); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.status-sent, .status-approved { color: #315c3d; border-color: #7da27f; background: #e7f0e5; }
body.dark .status-pending { color: #e8c98b; background: #3c3323; }
body.dark .status-sent, body.dark .status-approved { color: #bad7b7; border-color: #527755; background: #243729; }
.certificate-send { min-height: 36px; padding: 0 15px; border-radius: 999px; font-size: 11px; box-shadow: none; white-space: nowrap; }
.certificate-send:disabled { opacity: .58; cursor: not-allowed; }
#sessionStatus { padding: 12px 16px; border-left: 3px solid var(--gold); color: var(--muted); background: var(--surface); }
.data-panel { min-height: 400px; margin-top: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.panel-head { margin-bottom: 15px; }
.panel-head h2 { margin: 0; font-size: 21px; }
.table-wrap { max-height: min(60vh, 560px); overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; min-width: 700px; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: nowrap; }
tbody tr:nth-child(odd) { background: var(--row-odd); }
tbody tr:nth-child(even) { background: var(--row-even); }
th { position: sticky; top: 0; z-index: 1; color: var(--moss); background: var(--surface-raised); font-size: 12px; }
td { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 15px; }
.pagination-top { margin: 0 0 13px; }
.pagination span { min-width: 120px; color: var(--muted); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.nav-button { display: grid; place-items: center; width: 38px; height: 36px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-raised); }
.nav-button img { width: 17px; height: 17px; }
.nav-button:disabled { opacity: .45; cursor: not-allowed; }
#aboutDialog { padding: 26px; }
.about-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.about-head h2 { margin: 0; font-size: 22px; }
.about-close { padding: 8px 13px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); background: transparent; }
#aboutProperties { display: grid; grid-template-columns: minmax(95px, .8fr) minmax(0, 1.6fr); gap: 9px 14px; margin: 22px 0 0; font-size: 12px; }
#aboutProperties dt { color: var(--muted); }
#aboutProperties dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 980px) {
  .topbar { width: calc(100% - 36px); min-height: 90px; gap: 18px; }
  .logo-frame { width: 132px; height: 62px; }
  .brand { gap: 10px; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy small { max-width: 156px; font-size: 7px; }
  .main-nav { gap: 17px; }
  .main-nav a { font-size: 12px; }
  .session-actions { gap: 6px; }
  .state-button, .theme-button { min-width: 60px; padding: 7px 9px; }
  .shell { width: calc(100% - 36px); }
  .hero { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); min-height: 540px; padding: 44px 34px; }
  .hero-art { min-height: 385px; }
  .craft-section { padding: 72px 24px; }
}
@media (max-width: 720px) {
  .topbar { display: grid; grid-template-columns: 1fr auto; gap: 12px; width: calc(100% - 28px); padding: 12px 0; }
  .brand { gap: 8px; }
  .logo-frame { width: 112px; height: 54px; padding: 3px 5px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy small { max-width: 126px; font-size: 6px; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; justify-content: center; gap: 27px; margin: 1px 0 3px; }
  .session-actions { grid-column: 2; grid-row: 1; }
  .state-button, .theme-button { min-width: 48px; min-height: 34px; padding: 6px 8px; font-size: 10px; }
  .theme-button { min-width: 44px; }
  .shell { width: calc(100% - 24px); }
  .hero { grid-template-columns: 1fr; gap: 26px; min-height: auto; padding: 43px 26px 25px; margin-top: 14px; }
  .hero::before { inset: 8px; }
  .hero-copy { padding: 4px 0 0; }
  h1 { margin: 21px 0 15px; font-size: clamp(38px, 10vw, 54px); }
  .hero-lead { margin-bottom: 22px; font-size: 14px; }
  .hero-actions { gap: 16px; }
  .primary-action { min-height: 48px; }
  .hero-note { margin-top: 19px; }
  .hero-art { min-height: 300px; }
  .sideboard { width: min(100%, 500px); margin-top: 30px; }
  .art-caption { top: 22px; right: 24px; left: 24px; font-size: 8px; }
  .art-seal { right: 20px; bottom: 16px; font-size: 8px; }
  .orbit-one { width: 250px; height: 250px; }
  .orbit-two { width: 320px; height: 320px; }
  .craft-section { padding: 60px 8px 65px; }
  .section-heading { display: block; margin-bottom: 22px; }
  .section-heading h2, .site-footer h2 { font-size: 32px; }
  .craft-grid { grid-template-columns: 1fr; gap: 10px; }
  .craft-card { min-height: 0; padding: 19px 21px; }
  .craft-card h3 { margin: 15px 0 6px; font-size: 20px; }
  .site-footer { grid-template-columns: 1fr; gap: 24px; padding: 36px 25px 76px; }
  .site-footer address { justify-self: start; font-size: 13px; }
  .footer-mark { right: 25px; bottom: 20px; font-size: 7px; }
  .app-stage { padding-top: 18px; }
  .app-toolbar { align-items: flex-start; flex-direction: column; padding: 20px; }
  .user-tools { align-items: flex-start; flex-direction: column; width: 100%; }
  .data-panel { padding: 15px; }
  .certificate-admin-panel { padding: 16px; }
  .settings-panel { padding: 16px; }
  .certificate-status-list { grid-template-columns: 1fr; }
  .admin-heading { align-items: flex-start; }
}
@media (max-width: 390px) {
  .session-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 154px; }
  .state-button, .theme-button { min-width: 44px; min-height: 34px; padding: 6px 7px; font-size: 10px; }
  .topbar { width: calc(100% - 20px); }
  .logo-frame { width: 92px; height: 46px; }
  .brand-copy small { display: none; }
  .main-nav { gap: 21px; }
  .session-actions { gap: 4px; }
  .state-button { min-width: 44px; padding-inline: 6px; }
  .theme-button { display: inline-flex; align-items: center; justify-content: center; }
  .shell { width: calc(100% - 18px); }
  .hero { padding-inline: 20px; }
  .hero-art { min-height: 270px; }
}

@media (max-width: 560px) {
  .request-grid { grid-template-columns: 1fr; gap: 11px; }
  .request-panel .dialog-heading h2 { font-size: 24px; }
  .request-panel .dialog-intro { margin-bottom: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}




.pima-menu {position:relative;color:#163f39;z-index:40}
.pima-menu > summary {display:flex;align-items:center;gap:.7rem;border-radius:999px;padding:.65rem 1.2rem;background:#174c46;color:white;font-weight:650}
.pima-menu summary {cursor:pointer}
.pima-menu nav {position:absolute;right:0;top:calc(100% + .5rem);min-width:15rem;max-height:72dvh;overflow:auto;padding:.6rem;background:#fffdf8;border:1px solid #cddad4;border-radius:1rem;box-shadow:0 12px 40px #122e3029}
.pima-menu nav button,.pima-menu nav summary {display:block;width:100%;padding:.65rem .9rem;background:none;border:0;border-radius:.5rem;font:inherit;text-align:left;color:inherit;cursor:pointer}
.pima-menu nav summary::after {content:"⌄";float:right}
.pima-menu nav details button {padding-left:1.7rem}
.pima-menu nav button:hover,.pima-menu nav summary:hover {background:#e6f1e9}
.pima-menu nav button:disabled {opacity:.5;cursor:default}
.pima-menu button[hidden],#loginState[hidden] {display:none}
body.dark .pima-menu {color:#e6f2eb}
body.dark .pima-menu nav {background:#162e2b;border-color:#3c554d}
body.dark .pima-menu nav :is(button,summary):hover {background:#26443c}
@media(max-width:600px){.topbar{flex-wrap:wrap}.pima-menu nav{min-width:min(16rem,85vw)}}
@media(max-width:760px){.pima-menu{grid-column:2;grid-row:1;justify-self:end}}
