:root {
    --ink: #102033;
    --navy: #16324f;
    --navy-deep: #0c1b2c;
    --gold: #c4a35a;
    --gold-deep: #9d7d32;
    --paper: #f4efe4;
    --card: #fffdf8;
    --line: #d8d0c0;
    --muted: #5d6b7a;
    --success: #1d6b45;
    --success-soft: #e5f4ec;
    --danger: #9b2c2c;
    --shadow: 0 18px 50px rgba(16, 32, 51, 0.12);
    --body-bg: #f3efe6;
    --banner-text: #e8d7a8;
}

* { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
}

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "DM Sans", sans-serif;
    color: var(--ink);
    background: var(--body-bg);
    line-height: 1.65;
}

h1, h2, h3 {
    font-family: "Source Serif 4", Georgia, serif;
    margin: 0 0 0.4em;
    letter-spacing: -0.02em;
}

p { margin: 0 0 1rem; }

a { color: var(--navy); }

img { max-width: 100%; display: block; }

.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header,
.site-footer {
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
}

.service-banner {
    margin: 0;
    padding: 8px 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    text-align: center;
    background: var(--navy-deep);
    color: var(--banner-text);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.banner-short { display: none; }

.site-header {
    padding: 0;
    margin-bottom: 28px;
    border-bottom: 2px solid var(--navy-deep);
}

.site-main {
    width: min(880px, calc(100% - 32px));
    margin: 0 auto 48px;
    flex: 1;
}

.site-main:has(.identity-page),
.site-main:has(.notice),
.site-main:has(.registry-home) {
    width: min(1000px, calc(100% - 32px));
}

.site-footer {
    padding: 28px 0 40px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.6;
    border-top: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--navy-deep);
    color: var(--gold);
}

.brand-mark svg { width: 24px; height: 24px; }

.masthead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 14px 0;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 14px;
}

.site-nav a {
    text-decoration: none;
    color: var(--navy);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-verify {
    background: var(--navy-deep);
    border: 1px solid var(--navy-deep);
    color: var(--gold);
    padding: 10px 16px;
}

.nav-verify.is-active,
.nav-verify:hover {
    background: var(--navy);
    color: var(--gold);
}

.nav-access {
    padding: 10px 0;
}

.nav-access.is-active {
    color: var(--gold-deep);
}

.nav-compact { display: none; }

.registry-home {
    background: #fffdf8;
    border: 1px solid var(--navy-deep);
    box-shadow: inset 0 0 0 3px #fffdf8, inset 0 0 0 4px var(--gold);
    padding: 36px 40px 42px;
}

.registry-title {
    border-bottom: 2px solid var(--navy-deep);
    padding-bottom: 22px;
    margin-bottom: 28px;
}

.registry-title h1 {
    font-size: clamp(2rem, 4.4vw, 2.85rem);
    max-width: 18ch;
    color: var(--navy-deep);
}

.doc-kicker {
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold-deep);
    margin-bottom: 8px;
}

.doc-ref {
    color: var(--muted);
    font-size: 1.02rem;
    max-width: 62ch;
}

.statement {
    margin-bottom: 28px;
}

.statement h2,
.request-box h2 {
    font-size: 1.35rem;
    color: var(--navy-deep);
    margin-bottom: 10px;
}

.statement p,
.request-box > p,
.channel-grid p {
    max-width: 72ch;
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    margin-top: 16px;
}

.channel-grid h3 {
    font-size: 1.05rem;
    color: var(--gold-deep);
    border-top: 2px solid var(--gold);
    padding-top: 10px;
}

.procedure {
    margin: 0;
    padding-left: 1.2rem;
    max-width: 72ch;
}

.procedure li {
    margin-bottom: 10px;
}

.request-box {
    background: var(--navy-deep);
    color: #f4ead4;
    padding: 26px 26px 22px;
    margin: 8px 0 32px;
}

.request-box h2,
.request-box p {
    color: #f4ead4;
}

.request-box .form-note,
.request-box label {
    color: #d5c7a6;
}

.request-box .form-note {
    margin: 12px 0 0;
    font-size: 0.88rem;
}

.statement.notice {
    border-left: 3px solid var(--gold);
    padding-left: 18px;
}

.hero {
    background: var(--navy-deep);
    color: #f7f1e4;
    padding: 42px 36px;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.hero-compact {
    padding: 28px 28px 24px;
}

.hero-compact h1 {
    max-width: none;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.1rem);
    max-width: 14ch;
    color: #fff;
}

.lede, .eyebrow { color: #d5c7a6; }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.verify-form label,
.field label {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.verify-row {
    display: flex;
    gap: 10px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="file"],
input[type="url"],
input[type="color"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    color: inherit;
}

.hero input {
    background: #102033;
    border-color: #314860;
    color: #fff;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-gold { background: var(--gold); color: #1a1406; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn-block { width: 100%; }

.result-card,
.match-list,
.empty-state,
.panel,
.auth-card,
.table-wrap {
    background: var(--card);
    border: 1px solid rgba(216, 208, 192, 0.8);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.result-card,
.match-list,
.empty-state {
    margin-top: 22px;
    padding: 24px;
}

.result-status {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.pill {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 700;
}

.pill-success {
    background: var(--success-soft);
    color: var(--success);
}

.result-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
}

.result-photo img,
.preview,
.thumb {
    border-radius: 16px;
    object-fit: cover;
    background: #ece6d8;
}

.result-photo img {
    width: 100%;
    aspect-ratio: 4 / 5;
}

.category {
    color: var(--gold-deep);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

.meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 18px 0;
}

.meta dt {
    color: var(--muted);
    font-size: 0.78rem;
}

.meta dd {
    margin: 4px 0 0;
    font-weight: 600;
}

.bio {
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.match-list ul {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}

.match-list li + li { margin-top: 10px; }

.match-list a {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.match-list img,
.thumb {
    width: 52px;
    height: 52px;
}

.muted { color: var(--muted); }

.auth-body,
.admin-body {
    background: var(--navy-deep);
}

.auth-card {
    width: min(440px, calc(100% - 32px));
    margin: 8vh auto;
    padding: 32px;
}

.stack-form { display: grid; gap: 14px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 0.92rem; }
.error { color: var(--danger); font-size: 0.86rem; margin: 6px 0 0; }

.admin-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.admin-side {
    background: #0a1624;
    color: #efe7d4;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.admin-side .brand { color: #fff; }
.admin-nav { display: grid; gap: 8px; }

.admin-nav a {
    color: #d8cba8;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
}

.admin-nav a.is-active,
.admin-nav a:hover {
    background: #16324f;
    color: #fff;
}

.admin-user {
    margin-top: auto;
    font-size: 0.92rem;
}

.admin-content {
    padding: 28px;
    background:
        radial-gradient(circle at top right, rgba(196, 163, 90, 0.12), transparent 30%),
        #f4efe4;
}

.page-head,
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.toolbar input { max-width: 320px; }

.table-wrap { overflow: auto; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.data-table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.actions,
.actions form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--navy);
    cursor: pointer;
}

.link-button.danger,
.danger { color: var(--danger); }

.empty-cell {
    text-align: center;
    color: var(--muted);
    padding: 36px 16px;
}

.panel { padding: 24px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}

.field-full { grid-column: 1 / -1; }

.preview {
    width: 120px;
    height: 150px;
    margin-top: 12px;
}

.flash {
    background: var(--success-soft);
    color: var(--success);
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 600;
}

.pagination {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 18px;
}

.pagination .is-disabled { color: var(--muted); }

.bio-import-hint { margin-top: 8px; }

.bio-import-status {
    margin: 10px 0 0;
    font-weight: 600;
    color: var(--success);
}

.bio-import-status.is-error { color: var(--danger); }

.bio-topics {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.bio-topics-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.bio-topics-head h3 {
    font-size: 1.1rem;
    margin: 0;
}

.bio-topic-list {
    display: grid;
    gap: 10px;
}

.bio-topic {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: #f8f4eb;
}

.bio-topic.is-selected {
    border-color: var(--gold);
    background: #fffdf6;
    box-shadow: inset 3px 0 0 var(--gold);
}

.bio-topic-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.bio-topic-title {
    color: var(--navy-deep);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.05rem;
}

.bio-topic p {
    margin: 8px 0 0 28px;
    color: var(--muted);
    font-size: 0.92rem;
}

.bio-menu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 6px 0 0;
    border-right: 1px solid var(--line);
}

.bio-menu-item {
    text-decoration: none;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 0;
    padding: 9px 14px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--navy);
    background: transparent;
}

.bio-menu-item.is-active {
    background: #f7f1e6;
    border-left-color: var(--gold);
    color: var(--navy-deep);
}

.bio-topic-panel { display: none; }

.bio-topic-panel.is-active { display: block; }

.bio-topic-panel h3 {
    color: var(--navy-deep);
    font-size: 1.45rem;
    margin: 0 0 14px;
}

.bio-topic-body {
    max-width: 68ch;
}

.bio-topic-body p {
    margin: 0 0 1rem;
    color: var(--ink);
    line-height: 1.7;
}

.bio-topic-body p:last-child { margin-bottom: 0; }

.notice {
    background: #fffdf8;
    border: 1px solid var(--navy-deep);
    box-shadow: inset 0 0 0 3px #fffdf8, inset 0 0 0 4px var(--gold);
    padding: 0;
}

.notice-mast {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px 36px 20px;
    background: var(--navy-deep);
    color: #f4ead4;
    border-bottom: 4px solid var(--gold);
}

.notice-kicker {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.66rem;
    font-weight: 700;
    color: var(--gold);
}

.notice-status {
    margin: 0;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(1.55rem, 3vw, 2rem);
    color: #fff;
    font-weight: 600;
}

.verify-seal {
    display: block;
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    overflow: visible;
}

.verify-seal .seal-arc {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2.4px;
}

.notice-mast .verify-seal {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.notice-identity {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    grid-template-areas:
        "photo particulars"
        "meta meta"
        "colophon colophon";
    column-gap: 22px;
    row-gap: 0;
    padding: 28px 36px 26px;
    align-items: start;
}

.notice-portrait { grid-area: photo; }
.notice-particulars {
    grid-area: particulars;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0;
    min-width: 0;
    padding-top: 2px;
}
.notice-meta { grid-area: meta; }
.notice-colophon { grid-area: colophon; }

.notice-portrait {
    margin: 0;
    padding: 3px;
    background: #fffdf8;
    border: 1px solid var(--gold);
    border-radius: 4px;
    box-shadow: inset 0 0 0 2px #fffdf8;
}

.notice-portrait img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: top center;
    background: #ece6d8;
    border-radius: 2px;
}

.notice-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
}

.notice-tags .category {
    padding: 3px 8px;
    border: 1px solid var(--gold);
    border-radius: 3px;
    background: #fffdf8;
    color: var(--gold);
    letter-spacing: 0.1em;
    font-size: 0.68rem;
}

.verified-chip {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 3px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notice-name {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
}

.name-tick {
    display: inline-flex;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    line-height: 0;
    border-radius: 50%;
}

.name-tick-mark,
.name-tick svg {
    display: block;
    width: 22px;
    height: 22px;
}

.notice-particulars h1 {
    font-size: clamp(1.85rem, 3.4vw, 2.35rem);
    color: var(--navy-deep);
    margin: 0;
    line-height: 1.15;
}

.notice-role {
    margin: 0;
    color: var(--gold);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
}

.notice-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 24px;
    margin: 22px 0 0;
    padding: 20px 0;
    border-top: 1px solid #e4ddd0;
}

.notice-meta[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
.notice-meta[data-count="2"],
.notice-meta[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.notice-meta dt {
    margin: 0 0 6px;
    color: var(--navy);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.notice-meta dd {
    margin: 0;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--navy-deep);
}

.notice-colophon {
    padding-top: 20px;
    border-top: 1px solid #e4ddd0;
}

.notice-auth {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    padding: 12px 12px 10px;
    background:
        linear-gradient(#d8d0c0, #d8d0c0) top / 100% 1px no-repeat,
        linear-gradient(#efe8d8, #f7f3ea);
    border: 1px solid #d8d0c0;
}

.notice-auth-copy {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    column-gap: 12px;
    min-width: 0;
}

.notice-auth-mark {
    display: block;
    width: 34px;
    margin-top: 1px;
}

.notice-auth-shield {
    display: block;
    width: 34px;
    height: auto;
}

.notice-auth-text {
    min-width: 0;
}

.notice-auth-copy p {
    margin: 0;
    color: #5d564a;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1.5;
}

.notice-auth-kicker {
    margin-bottom: 6px !important;
    color: var(--gold-deep) !important;
    letter-spacing: 0.16em !important;
}

.notice-auth-ctrl {
    margin-top: 8px !important;
    color: #3d3830 !important;
}

.notice-barcode {
    margin: 0;
    flex: 0 0 168px;
    width: 168px;
    padding: 6px 8px 5px;
    background: #fffdf8;
    border: 1px solid #cfc6b4;
    box-shadow: inset 0 0 0 2px #fffdf8;
}

.notice-barcode svg {
    display: block;
    width: 100%;
    height: 46px;
}

.notice-barcode figcaption {
    margin: 4px 0 0;
    color: var(--navy-deep);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.notice-account {
    padding: 8px 32px 32px;
    border-top: 1px solid var(--line);
}

.notice-account-head {
    margin-bottom: 18px;
}

.notice-account-head h2 {
    margin: 0 0 4px;
    font-size: 1.35rem;
    color: var(--navy-deep);
}

.notice-account-head p,
.notice-issued {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.notice-account-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

.bio-menu {
    position: sticky;
    top: 16px;
}

.notice-summary {
    max-width: 72ch;
}

.notice-endorsement {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 32px 22px;
    border-top: 2px solid var(--navy-deep);
    background: #f7f1e6;
}

.notice-endorsement p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--muted);
    max-width: 52ch;
}

.notice-issued {
    margin-top: 4px;
}

.back-link {
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.results-form {
    margin-bottom: 28px;
}

.results-page .match-list,
.results-page .empty-state {
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
}

.empty-state .btn { margin-top: 8px; }

.bio-topic-panel p { white-space: pre-wrap; }

.identity-cards {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

.identity-card {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 8px 12px;
    padding: 14px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.identity-card + .identity-card { margin-top: 10px; }

.identity-card .thumb {
    width: 56px;
    height: 70px;
    border-radius: 10px;
}

.identity-card-body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.identity-card-body strong {
    color: var(--navy-deep);
    font-size: 1.02rem;
}

.identity-card-body small {
    color: var(--muted);
    font-size: 0.82rem;
}

.identity-card .actions {
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.identity-card.is-empty {
    display: block;
    text-align: center;
    color: var(--muted);
    padding: 28px 16px;
}

@media (max-width: 860px) {
    .admin-shell { grid-template-columns: 1fr; }
    .result-grid,
    .identity-hero,
    .form-grid,
    .meta,
    .verify-row,
    .page-head,
    .toolbar { grid-template-columns: 1fr; display: grid; }
    .channel-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    body {
        line-height: 1.6;
    }

    .site-header,
    .site-footer,
    .site-main,
    .site-main:has(.identity-page),
    .site-main:has(.notice),
    .site-main:has(.registry-home) {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .site-header {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: 0;
    }

    .site-main {
        margin-bottom: 0;
        padding: 0;
    }

    .banner-full { display: none; }
    .banner-short { display: inline; }

    .service-banner {
        letter-spacing: 0.08em;
        font-size: 0.66rem;
        padding-top: max(8px, env(safe-area-inset-top));
    }

    .masthead {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 16px 14px;
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        background: #fffdf8;
        border-bottom: 2px solid var(--navy-deep);
    }

    .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .brand strong { font-size: 1.05rem; }

    .brand small {
        font-size: 0.7rem;
        max-width: 28ch;
    }

    .site-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .site-nav a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        min-height: 44px;
        padding: 10px 8px;
        text-align: center;
        letter-spacing: 0.08em;
        font-size: 0.72rem;
        border: 1px solid var(--navy-deep);
    }

    .nav-full { display: none; }
    .nav-compact { display: inline; }

    .nav-access {
        background: #fff;
        color: var(--navy-deep);
    }

    .registry-home {
        padding: 22px 16px 26px;
        border-left: 0;
        border-right: 0;
        box-shadow: inset 0 3px 0 var(--gold), inset 0 -3px 0 var(--gold);
    }

    .registry-home:not(.results-page) {
        display: flex;
        flex-direction: column;
    }

    .registry-title {
        padding-bottom: 16px;
        margin-bottom: 16px;
    }

    .registry-home:not(.results-page) .registry-title { order: 1; }
    .registry-home:not(.results-page) .request-box { order: 2; }
    .registry-home:not(.results-page) > .statement { order: 3; }

    .registry-title h1 {
        font-size: 1.7rem;
        max-width: none;
        line-height: 1.15;
    }

    .doc-ref {
        font-size: 0.95rem;
        margin-bottom: 0;
    }

    .request-box {
        padding: 18px 16px 16px;
        margin: 0 0 22px;
    }

    .registry-home > .statement {
        margin-bottom: 22px;
    }

    .request-box h2,
    .statement h2 {
        font-size: 1.18rem;
    }

    .verify-row .btn,
    .empty-state .btn {
        width: 100%;
        min-height: 48px;
        white-space: normal;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="file"],
    input[type="url"],
    select,
    textarea {
        font-size: 16px;
        min-height: 48px;
        border-radius: 10px;
    }

    textarea { min-height: 140px; }

    .channel-grid {
        gap: 16px;
    }

    .channel-grid section {
        padding-bottom: 4px;
    }

    .statement.notice {
        padding-left: 14px;
    }

    .site-footer {
        padding: 20px 16px max(28px, env(safe-area-inset-bottom));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        font-size: 0.82rem;
    }

    .notice {
        box-shadow: inset 0 3px 0 var(--gold), inset 0 -3px 0 var(--gold);
        border-left: 0;
        border-right: 0;
    }

    .notice-mast {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        gap: 12px;
        padding: 12px 16px;
    }

    .notice-status {
        font-size: 1.05rem;
    }

    .notice-mast {
        padding: 16px;
        border-bottom-width: 3px;
    }

    .notice-mast .verify-seal {
        width: 76px;
        height: 76px;
    }

    .name-tick,
    .name-tick-mark,
    .name-tick svg {
        width: 20px;
        height: 20px;
    }

    .notice-identity {
        display: grid;
        grid-template-columns: 124px minmax(0, 1fr);
        grid-template-areas:
            "photo particulars"
            "meta meta"
            "colophon colophon";
        column-gap: 16px;
        row-gap: 0;
        padding: 22px 18px 20px;
        align-items: start;
    }

    .notice-portrait {
        width: 100%;
    }

    .notice-particulars {
        width: 100%;
        text-align: left;
        min-width: 0;
        min-height: 124px;
        justify-content: center;
        padding-top: 0;
    }

    .notice-tags {
        margin-bottom: 8px;
        gap: 6px;
    }

    .notice-tags .category,
    .verified-chip {
        padding: 2px 7px;
        font-size: 0.62rem;
    }

    .notice-name {
        margin-bottom: 6px;
        align-items: center;
        gap: 8px;
    }

    .notice-particulars h1 {
        font-size: 1.42rem;
        text-align: left;
        min-width: 0;
    }

    .notice-role {
        margin: 0;
        font-size: 0.92rem;
    }

    .notice-meta,
    .notice-meta[data-count="1"],
    .notice-meta[data-count="2"],
    .notice-meta[data-count="3"],
    .notice-meta[data-count="4"] {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-top: 18px;
        padding: 4px 0 2px;
        text-align: left;
    }

    .notice-meta > div {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 16px;
        padding: 11px 0;
        border-bottom: 1px solid #ece6d8;
    }

    .notice-meta > div:last-child {
        border-bottom: 0;
        padding-bottom: 2px;
    }

    .notice-meta dt {
        margin: 0;
        flex: 0 1 auto;
    }

    .notice-meta dd {
        margin: 0;
        text-align: right;
        font-size: 1.02rem;
        line-height: 1.25;
    }

    .notice-auth {
        align-items: stretch;
        gap: 14px;
        padding: 10px;
    }

    .notice-auth-copy p {
        font-size: 0.58rem;
        letter-spacing: 0.06em;
    }

    .notice-auth-mark,
    .notice-auth-shield {
        width: 28px;
    }

    .notice-barcode {
        flex: 0 0 132px;
        width: 132px;
        align-self: flex-end;
    }

    .notice-barcode svg {
        height: 38px;
    }

    .notice-summary,
    .notice-meta dd,
    .auth-card p {
        overflow-wrap: break-word;
    }

    .notice-account {
        padding: 20px 18px 28px;
    }

    .notice-account.has-topics .notice-summary {
        display: none;
    }

    .notice-account-head {
        margin-bottom: 16px;
    }

    .notice-account-head h2 {
        font-size: 1.28rem;
    }

    .notice-account-layout {
        display: block;
    }

    .bio-menu-wrap {
        position: relative;
        margin: 0 -18px 18px;
    }

    .bio-menu-wrap::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 40px;
        height: calc(100% - 14px);
        pointer-events: none;
        background: linear-gradient(to right, rgba(255, 253, 248, 0), #fffdf8 72%);
    }

    .bio-menu {
        position: static;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        margin: 0;
        padding: 2px 48px 14px 18px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .bio-menu::-webkit-scrollbar { display: none; }

    .bio-menu-item {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        min-height: 40px;
        padding: 8px 13px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: #fff;
        font-size: 0.68rem;
        letter-spacing: 0.06em;
        white-space: nowrap;
        scroll-snap-align: start;
    }

    .bio-menu-item.is-active {
        background: var(--navy-deep);
        border-color: var(--navy-deep);
        color: var(--gold);
    }

    .bio-topic-panel h3 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .bio-topic-body {
        max-width: none;
    }

    .bio-topic-body p,
    .notice-summary {
        font-family: "DM Sans", sans-serif;
        font-size: 0.95rem;
        line-height: 1.7;
        overflow-wrap: anywhere;
    }

    .notice-endorsement {
        display: grid;
        gap: 12px;
        padding: 16px;
        text-align: center;
    }

    .notice-endorsement p {
        max-width: none;
    }

    .back-link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 48px;
        background: var(--navy);
        color: #fff;
        padding: 12px 16px;
        white-space: normal;
    }

    .match-list a {
        padding: 12px;
        min-height: 72px;
    }

    .match-list a > span {
        min-width: 0;
    }

    .match-list strong,
    .match-list small {
        overflow-wrap: break-word;
    }

    .match-list img,
    .thumb {
        width: 56px;
        height: 56px;
        flex-shrink: 0;
    }

    .auth-card {
        width: min(440px, calc(100% - 24px));
        margin: 6vh auto;
        padding: 24px 20px;
    }

    .auth-card h1 {
        font-size: 1.45rem;
    }

    .admin-side {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand user"
            "nav nav";
        gap: 12px 10px;
        padding: max(14px, env(safe-area-inset-top)) 16px 14px;
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }

    .admin-side .brand { grid-area: brand; }
    .admin-nav {
        grid-area: nav;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .admin-nav::-webkit-scrollbar { display: none; }
    .admin-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 10px 12px;
        min-height: 40px;
    }
    .admin-user {
        grid-area: user;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        text-align: right;
        font-size: 0.8rem;
    }
    .admin-user p { margin: 0; }
    .admin-user .link-button { color: #e8d7a8; }

    .admin-content {
        padding: 18px 16px 28px;
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: max(28px, env(safe-area-inset-bottom));
    }

    .page-head h1 { font-size: 1.55rem; }
    .page-head .btn,
    .toolbar .btn { width: 100%; min-height: 46px; }
    .toolbar input { max-width: none; }

    .table-wrap { display: none; }
    .identity-cards { display: block; }

    .panel { padding: 18px 16px; }

    .bio-topics-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 430px) {
    .registry-title h1 { font-size: 1.55rem; }
    .notice-particulars h1 { font-size: 1.28rem; }
    .notice-identity { grid-template-columns: 116px minmax(0, 1fr); }
    .notice-particulars { min-height: 116px; }
    .brand small { display: none; }
    .notice-auth {
        flex-direction: column;
        align-items: stretch;
    }
    .notice-barcode {
        width: 100%;
        flex-basis: auto;
        align-self: stretch;
    }
}

@media (max-width: 360px) {
    .registry-home { padding: 18px 12px 22px; }
    .request-box { padding: 16px 12px 14px; }
    .site-nav a { letter-spacing: 0.04em; font-size: 0.64rem; }
    .notice-mast,
    .notice-identity,
    .notice-endorsement { padding-left: 12px; padding-right: 12px; }
}

.site-manage .panel { margin-bottom: 20px; }

.site-group-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.site-group-head h2 {
    margin: 0 0 6px;
    color: var(--navy-deep);
}

.site-group-head p {
    margin: 0;
    color: var(--muted);
    max-width: 62ch;
}

.theme-preview {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.theme-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--line);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-row input[type="color"] {
    width: 48px;
    min-width: 48px;
    height: 44px;
    padding: 4px;
    cursor: pointer;
}

.site-manage-actions {
    display: flex;
    gap: 12px;
    margin: 8px 0 18px;
}

.site-restore {
    margin-bottom: 24px;
}

.page-head .muted {
    margin: 6px 0 0;
    max-width: 58ch;
}
