:root {
    --brand-red: #ed1c24;
    --brand-blue: #0077c0;
    --brand-deep: #005e90;
    --brand-alert: #b20000;
    --ink: #102133;
    --muted: #5e6b7a;
    --paper: #ffffff;
    --sky: #edf5fb;
    --line: rgba(16, 33, 51, 0.12);
    --shadow: 0 20px 50px rgba(0, 50, 92, 0.12);
}

@font-face {
    font-family: "Roboto";
    src: url("./font/Roboto-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Roboto";
    src: url("./font/Roboto-Italic.ttf") format("truetype");
    font-weight: 400;
    font-style: italic;
}

@font-face {
    font-family: "Roboto";
    src: url("./font/Roboto-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: "Roboto";
    src: url("./font/Roboto-BoldItalic.ttf") format("truetype");
    font-weight: 700;
    font-style: italic;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Roboto", "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink);
    background: #f5f9fd;
}

a {
    color: inherit;
    text-decoration: none;
}

.portal-shell {
    min-height: 100vh;
}

.site-header {
    padding: 0.9rem clamp(1.15rem, 2.6vw, 2.2rem) 0;
}

.brand-row {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.76);
    border-radius: 24px;
    padding: 0.8rem 1rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.brand-mark img {
    width: 100%;
    height: auto;
    display: block;
}

.eyebrow {
    margin: 0 0 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    color: var(--brand-red);
    font-weight: 700;
}

.brand-copy h1,
.spotlight-copy h2,
.panel-head h2,
.panel-head h3 {
    margin: 0;
    line-height: 1.05;
}

.brand-copy h1 {
    font-size: clamp(1.4rem, 2.2vw, 1.95rem);
}

.subcopy {
    margin: 0.35rem 0 0;
    color: var(--muted);
    max-width: 48rem;
}

.top-nav {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

.mobile-admin-toggle,
.mobile-public-toggle {
    display: none;
    border: 0;
    border-radius: 16px;
    padding: 0;
    font: inherit;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: var(--brand-red);
    width: 3rem;
    height: 3rem;
    box-shadow: 0 14px 30px rgba(237, 28, 36, 0.18);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hamburger-lines {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.28rem;
    width: 100%;
    height: 100%;
}

.hamburger-lines span {
    display: block;
    width: 1.2rem;
    height: 2px;
    border-radius: 999px;
    background: #fff;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.mobile-public-toggle[aria-expanded="true"] .hamburger-lines span:nth-child(1) {
    transform: translateY(0.4rem) rotate(45deg);
}

.mobile-public-toggle[aria-expanded="true"] .hamburger-lines span:nth-child(2) {
    opacity: 0;
}

.mobile-public-toggle[aria-expanded="true"] .hamburger-lines span:nth-child(3) {
    transform: translateY(-0.4rem) rotate(-45deg);
}

.top-nav a,
.secondary-link,
.ghost-link {
    border-radius: 999px;
    padding: 0.72rem 0.92rem;
    font-weight: 700;
}

.top-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #5a6b84;
    background: transparent;
    border: 1px solid transparent;
    transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.top-nav a:hover {
    color: var(--brand-deep);
    background: rgba(0, 119, 192, 0.06);
}

.top-nav a.is-active {
    color: var(--brand-blue);
    background: rgba(0, 119, 192, 0.08);
}

.top-nav a.is-active::after {
    content: "";
    position: absolute;
    left: 1rem;
    right: 1rem;
    bottom: 0.24rem;
    height: 2px;
    border-radius: 999px;
    background: var(--brand-blue);
}

.top-nav a.is-plain {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(0, 119, 192, 0.12);
}

.top-nav a.is-primary {
    color: #fff;
    background: var(--brand-blue);
    box-shadow: 0 16px 32px rgba(0, 119, 192, 0.18);
}

.top-nav a.is-primary:hover {
    color: #fff;
    background: var(--brand-deep);
}

.top-nav a.is-primary::after {
    display: none;
}

.nav-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 1rem;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-ribbon {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem 0.25rem 0;
}

.hero-ribbon span {
    background: var(--brand-red);
    color: #fff;
    border-radius: 999px;
    padding: 0.58rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
}

.page-wrap {
    padding: 0.85rem clamp(1.15rem, 2.6vw, 2.2rem) 2.1rem;
}

.admin-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: 1.25rem;
    display: grid;
    gap: 1rem;
}

.admin-sidebar-card,
.admin-nav {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.sidebar-user {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.sidebar-user strong,
.sidebar-user span {
    display: block;
}

.sidebar-user span {
    color: var(--muted);
    margin-top: 0.2rem;
}

.admin-nav {
    display: grid;
    gap: 0.55rem;
}

.admin-nav a {
    display: block;
    padding: 0.82rem 0.9rem;
    border-radius: 16px;
    color: var(--ink);
    background: rgba(0, 119, 192, 0.05);
    font-weight: 700;
}

.admin-nav a.is-active {
    color: #fff;
    background: var(--brand-blue);
    box-shadow: 0 16px 30px rgba(0, 74, 130, 0.16);
}

.admin-content {
    min-width: 0;
}

.auth-shell {
    display: flex;
    justify-content: center;
    padding: 2rem 0;
}

.auth-card {
    width: min(100%, 34rem);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 26px;
    box-shadow: var(--shadow);
    padding: 1.35rem;
}

.admin-hero {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.05rem;
    padding: 1.2rem 1.3rem;
    border-radius: 26px;
    background: var(--brand-blue);
    color: #fff;
    box-shadow: var(--shadow);
}

.admin-hero .eyebrow,
.admin-hero .subcopy {
    color: rgba(255, 255, 255, 0.88);
}

.admin-hero h2 {
    margin: 0;
    font-size: clamp(1.45rem, 2.5vw, 2.15rem);
}

.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 0 1.1rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(0, 84, 166, 0.1);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 36px rgba(10, 31, 68, 0.06);
}

.settings-tab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.75rem;
    padding: 0.8rem 1.15rem;
    border: 1px solid var(--brand-blue);
    border-radius: 999px;
    background: var(--brand-blue);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.settings-tab-link:hover,
.settings-tab-link:focus-visible {
    border-color: var(--secondary-color);
    color: #fff;
    background: var(--brand-deep);
    box-shadow: 0 12px 26px rgba(0, 84, 166, 0.18);
    transform: translateY(-1px);
}

.settings-tab-link.is-active {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #fff;
    box-shadow: 0 12px 30px rgba(237, 28, 36, 0.24);
}

.settings-form-actions {
    justify-content: flex-start;
    align-items: center;
}

.settings-form-actions .primary-button,
.settings-form-actions .ghost-button {
    width: auto;
    min-width: 220px;
    max-width: 100%;
}

.settings-section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.settings-section-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.55rem;
    padding: 0.72rem 1rem;
    border-radius: 999px;
    background: #f3f8fd;
    border: 1px solid rgba(0, 84, 166, 0.12);
    color: var(--brand-deep);
    font-weight: 700;
    text-decoration: none;
}

.settings-navigation-grid {
    display: grid;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
    gap: 1rem;
}

.settings-navigation-card {
    padding: 1rem;
    border-radius: 22px;
    background: #f8fbfe;
    border: 1px solid rgba(0, 84, 166, 0.1);
    display: grid;
    gap: 1rem;
}

.settings-navigation-card h4 {
    margin: 0;
}

.settings-toggle-list,
.settings-menu-items {
    display: grid;
    gap: 0.9rem;
}

.settings-navigation-head {
    align-items: center;
}

.settings-menu-item-row {
    padding: 1rem;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(0, 84, 166, 0.1);
    display: grid;
    gap: 0.85rem;
}

.settings-menu-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
}

.settings-menu-order-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.settings-order-button {
    min-width: 7.25rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    padding: 1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow);
}

.stat-card span,
.stat-card small {
    display: block;
}

.stat-card span {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.stat-card strong {
    display: block;
    margin: 0.5rem 0 0.25rem;
    font-size: 1.75rem;
    line-height: 1;
}

.accent-red {
    border-color: rgba(237, 28, 36, 0.18);
}

.accent-blue {
    border-color: rgba(0, 119, 192, 0.18);
}

.accent-amber {
    border-color: rgba(197, 137, 14, 0.2);
}

.accent-slate {
    border-color: rgba(16, 33, 51, 0.18);
}

.dashboard-grid,
.panel-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.admin-grid {
    grid-template-columns: repeat(3, 1fr);
}

.admin-panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.taxonomy-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.taxonomy-panel-head,
.taxonomy-group-head,
.taxonomy-toolbar,
.taxonomy-pane-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.taxonomy-tab-shell {
    display: grid;
    gap: 1rem;
    padding: 1.1rem;
}

.taxonomy-toolbar {
    align-items: center;
}

.taxonomy-tab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.taxonomy-tab-button {
    min-width: 180px;
    border: 1px solid rgba(0, 119, 192, 0.12);
    background: #f8fbfe;
    color: var(--brand-deep);
    border-radius: 20px;
    padding: 0.85rem 1rem;
    display: grid;
    gap: 0.16rem;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.taxonomy-tab-button span {
    display: block;
    font-size: 0.94rem;
    font-weight: 800;
}

.taxonomy-tab-button small {
    color: var(--muted);
    font-size: 0.78rem;
}

.taxonomy-tab-button.is-active {
    background: rgba(0, 119, 192, 0.08);
    border-color: rgba(0, 119, 192, 0.2);
    box-shadow: inset 0 0 0 1px rgba(0, 119, 192, 0.06);
}

.taxonomy-pane {
    display: none;
    gap: 1rem;
}

.taxonomy-pane.is-active {
    display: grid;
}

.taxonomy-pane-layout {
    display: grid;
    grid-template-columns: minmax(240px, 0.6fr) minmax(0, 1.4fr);
    gap: 1rem;
    align-items: start;
}

.taxonomy-guide-card,
.taxonomy-table-card {
    border-radius: 22px;
    border: 1px solid rgba(0, 119, 192, 0.08);
    background: #fbfdff;
    padding: 1rem;
}

.taxonomy-guide-card h4 {
    margin: 0 0 0.9rem;
    font-size: 1rem;
}

.taxonomy-form-shell {
    gap: 1.1rem;
}

.taxonomy-status-card {
    display: grid;
    gap: 0.5rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: rgba(0, 119, 192, 0.04);
    border: 1px solid rgba(0, 119, 192, 0.1);
}

.taxonomy-status-card > .check-field {
    margin: 0;
}

.taxonomy-guide-panel {
    align-self: start;
}

.taxonomy-guide-list {
    display: grid;
    gap: 0.85rem;
}

.taxonomy-guide-item {
    display: grid;
    gap: 0.28rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: #f8fbfe;
    border: 1px solid rgba(0, 119, 192, 0.1);
}

.taxonomy-guide-item strong {
    font-size: 0.94rem;
}

.taxonomy-guide-item span {
    color: var(--muted);
    line-height: 1.5;
}

.taxonomy-status-card.compact {
    padding: 0.8rem 0.95rem;
}

.taxonomy-group-card {
    padding: 1rem 1rem 1.1rem;
}

.taxonomy-group-meta {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.taxonomy-group-meta span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.48rem 0.75rem;
    background: rgba(0, 119, 192, 0.08);
    color: var(--brand-deep);
    font-size: 0.82rem;
    font-weight: 700;
}

.taxonomy-table-wrap {
    border-radius: 20px;
}

.taxonomy-inline-table {
    table-layout: fixed;
}

.taxonomy-table td strong {
    font-size: 0.95rem;
}

.taxonomy-empty-state {
    min-height: 140px;
    display: grid;
    place-items: center;
}

.taxonomy-modal-dialog {
    max-width: 760px;
}

.team-editor-panel,
.team-filter-panel {
    align-self: start;
}

.team-filter-panel-full {
    margin-bottom: 1.25rem;
}

.team-import-panel {
    margin-bottom: 1.25rem;
}

.team-queue-panel {
    margin-bottom: 1.25rem;
}

.queue-launch-panel {
    margin-bottom: 1.25rem;
}

.compact-queue-stats .stat-card {
    min-height: auto;
}

.team-modal-mode-switch {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.1rem 0;
    flex-wrap: wrap;
}

.team-modal-mode-switch .ghost-button.is-active {
    border-color: var(--brand-blue);
    background: rgba(0, 119, 192, 0.12);
    color: var(--brand-blue);
}

.team-editor-form {
    gap: 1.1rem;
}

.team-table-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.team-member-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-top: 0.75rem;
}

.team-member-head .panel-head {
    margin-bottom: 0;
}

.team-members-workspace {
    display: grid;
    gap: 0.9rem;
}

.team-member-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.team-member-tab {
    border: 1px solid rgba(0, 119, 192, 0.2);
    background: #fff;
    color: var(--brand-deep);
    border-radius: 999px;
    padding: 0.65rem 0.95rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.team-member-tab.is-active {
    background: rgba(0, 119, 192, 0.12);
    border-color: rgba(0, 119, 192, 0.35);
}

.team-member-panels {
    display: grid;
}

.team-member-panel {
    display: none;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #f9fbfe;
    padding: 1rem;
    gap: 0.9rem;
}

.team-member-panel.is-active {
    display: grid;
}

.team-member-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.team-member-panel-head h4 {
    margin: 0.2rem 0 0;
}

.team-pagination-row {
    align-items: center;
}

.team-bulk-toolbar {
    justify-content: space-between;
}

.team-bulk-toolbar select {
    min-width: 220px;
}

.team-bulk-toolbar .primary-button {
    min-width: 120px;
}

.team-bulk-toolbar .helper-copy {
    margin: 0;
}

.queue-command-card {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: #f8fbfe;
    border: 1px solid rgba(0, 119, 192, 0.1);
}

.queue-command-card code {
    display: block;
    padding: 0.8rem 0.9rem;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid rgba(0, 119, 192, 0.12);
    color: var(--brand-deep);
    word-break: break-all;
}

.queue-reset-form {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.queue-reset-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.queue-reset-inline input,
.queue-reset-inline select {
    border: 1px solid rgba(0, 119, 192, 0.16);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-deep);
    padding: 0.5rem 0.8rem;
    font: inherit;
}

.queue-reset-inline input {
    width: 82px;
}

.queue-detail-panel {
    margin-bottom: 1.25rem;
}

.queue-workspace-shell {
    display: grid;
    gap: 1.25rem;
}

.queue-workspace-panel {
    margin-bottom: 0;
}

.queue-detail-summary {
    margin-bottom: 0.85rem;
}

.queue-detail-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
}

.queue-detail-filter-row .ghost-button.is-active {
    border-color: var(--brand-blue);
    background: rgba(0, 119, 192, 0.12);
    color: var(--brand-blue);
}

.queue-detail-panel .status-pill + .status-pill {
    margin-top: 0.35rem;
}

.team-import-modal-card {
    display: grid;
    gap: 0.95rem;
    padding: 1rem;
    border-radius: 24px;
    background: #f8fbfe;
    border: 1px solid rgba(0, 119, 192, 0.1);
}

.team-queue-panel button[disabled] {
    opacity: 0.55;
    pointer-events: none;
}

.queue-popup-modal[hidden] {
    display: none;
}

.queue-popup-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
}

.queue-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 14, 24, 0.62);
    backdrop-filter: blur(4px);
}

.queue-popup-dialog {
    position: relative;
    width: min(1200px, calc(100vw - 2rem));
    height: min(88vh, 920px);
    margin: 4vh auto;
    background: #fff;
    border-radius: 30px;
    box-shadow: 0 26px 70px rgba(12, 41, 72, 0.26);
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

.queue-popup-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    border-bottom: 1px solid rgba(0, 119, 192, 0.12);
    background: linear-gradient(180deg, #fbfdff 0%, #f4f9fe 100%);
}

.queue-popup-frame-wrap {
    min-height: 0;
    background: #f5f9fd;
}

.queue-popup-frame-wrap iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #f5f9fd;
}

.is-standalone-shell {
    min-height: 100vh;
}

.is-standalone-page-wrap {
    padding: 1.25rem;
}

.standalone-content {
    width: min(1400px, 100%);
    margin: 0 auto;
}

.pagination-summary {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.page-link.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.active-filter-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.2rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.72rem;
    border-radius: 999px;
    background: rgba(0, 119, 192, 0.08);
    color: var(--brand-deep);
    font-size: 0.85rem;
    font-weight: 600;
}

.filter-chip strong {
    font-weight: 700;
}

.team-modal[hidden] {
    display: none;
}

.team-modal-form[hidden],
.team-modal .is-hidden {
    display: none !important;
}

.team-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
}

.team-modal.is-open {
    display: block;
}

.team-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 14, 24, 0.62);
    backdrop-filter: blur(4px);
}

.team-modal-dialog {
    position: relative;
    width: min(100%, 1080px);
    margin: 4vh auto;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.team-modal-head,
.team-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
}

.team-modal-head {
    border-bottom: 1px solid var(--line);
    background: #f5f9fd;
}

.team-modal-head h3 {
    margin: 0;
}

.team-modal-close-button {
    min-width: 2.6rem;
    padding-inline: 0;
    font-size: 1.2rem;
}

.team-modal-body {
    padding: 1.1rem;
    display: grid;
    gap: 1rem;
    max-height: 72vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.team-modal-form {
    gap: 0;
}

.team-modal-actions {
    border-top: 1px solid var(--line);
    justify-content: flex-end;
    background: rgba(16, 33, 51, 0.02);
}

.template-manager-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.2fr);
}

.template-form-section {
    padding: 1rem;
    border-radius: 24px;
    background: #f8fbfe;
    border: 1px solid rgba(0, 119, 192, 0.1);
}

.template-gallery-hero,
.editor-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.editor-title-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: rgba(0, 119, 192, 0.08);
    color: var(--brand-deep);
    font-weight: 700;
}

.template-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
    gap: 1rem;
}

.template-tile {
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    color: var(--ink);
    border: 1px solid rgba(0, 119, 192, 0.1);
    box-shadow: var(--shadow);
}

.template-tile-preview {
    aspect-ratio: 16 / 9;
    background: #eef5fb;
}

.template-tile-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.template-tile-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
}

.template-tile-placeholder strong,
.template-tile-placeholder span {
    display: block;
}

.template-tile-body {
    padding: 1rem 1rem 1.1rem;
}

.template-tile-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
}

.template-tile-head h3 {
    margin: 0;
    font-size: 1.45rem;
}

.template-status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
    background: rgba(17, 128, 74, 0.14);
    color: #11804a;
    font-weight: 700;
    font-size: 0.84rem;
}

.template-tile-meta,
.template-tile-coverage {
    margin: 0.75rem 0 0;
    color: var(--muted);
}

.template-tile-actions {
    display: flex;
    gap: 0.65rem;
    margin-top: 1rem;
    align-items: center;
}

.template-editor-shell {
    gap: 1.25rem;
}

.template-step-tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.template-step-tab {
    border: 1px solid rgba(0, 119, 192, 0.14);
    background: rgba(255, 255, 255, 0.88);
    color: var(--ink);
    border-radius: 999px;
    padding: 0.85rem 1.1rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.template-step-tab.is-active {
    color: #fff;
    background: var(--brand-blue);
}

.template-step-tab:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.template-step-panel {
    display: none;
}

.template-step-panel.is-active {
    display: block;
}

.template-editor-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1rem;
}

.template-settings-sidebar {
    align-self: start;
    position: sticky;
    top: 1rem;
}

.template-setting-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3rem;
    margin: 0;
}

.template-setting-list dt {
    margin-top: 0.7rem;
    color: var(--muted);
    font-weight: 700;
}

.template-setting-list dd {
    margin: 0;
    font-weight: 700;
}

.template-designer-stage {
    display: grid;
    gap: 1rem;
}

.spotlight-card,
.status-card,
.panel {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 1.2rem;
}

.spotlight-card {
    background: var(--brand-blue);
    color: #fff;
}

.spotlight-card .eyebrow,
.spotlight-card p {
    color: rgba(255, 255, 255, 0.88);
}

.spotlight-copy p {
    max-width: 40rem;
}

.spotlight-metrics,
.metric-band {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1.1rem;
}

.metric {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    padding: 1rem;
}

.metric strong {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 0.35rem;
}

.status-list,
.archive-rules,
.sequence-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.status-list li,
.archive-rules li,
.sequence-list li {
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
}

.status-list li:last-child,
.archive-rules li:last-child,
.sequence-list li:last-child {
    border-bottom: 0;
}

.status-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.is-ok strong {
    color: #11804a;
}

.is-warn strong {
    color: var(--brand-alert);
}

.panel-head {
    margin-bottom: 1rem;
}

.certificate-form .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.certificate-form label {
    display: block;
}

.certificate-form span {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--muted);
}

.certificate-form input,
.certificate-form select,
.admin-import-form input[type="text"],
.admin-import-form input[type="email"],
.admin-import-form input[type="password"],
.admin-import-form input[type="number"],
.admin-import-form input[type="color"],
.admin-import-form select,
.admin-import-form textarea,
.template-modal input[type="text"],
.template-modal input[type="number"],
.template-modal input[type="color"],
.template-modal select {
    width: 100%;
    border: 1px solid rgba(0, 119, 192, 0.16);
    border-radius: 14px;
    padding: 0.82rem 0.9rem;
    font: inherit;
    background: #fff;
    color: var(--ink);
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.certificate-form input:focus,
.certificate-form select:focus,
.admin-import-form input:focus,
.admin-import-form select:focus,
.admin-import-form textarea:focus,
.template-modal input:focus,
.template-modal select:focus {
    outline: 0;
    border-color: rgba(0, 119, 192, 0.34);
    box-shadow: 0 0 0 4px rgba(0, 119, 192, 0.1);
    background: #fff;
}

.admin-import-form textarea {
    resize: vertical;
    min-height: 6rem;
}

.admin-import-form label span,
.certificate-form label span {
    
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--muted);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
}

.primary-button,
.secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    color: #fff;
    background: var(--brand-red);
    border-radius: 999px;
    padding: 0.84rem 1.1rem;
    font: inherit;
    font-weight: 700;
}

.ghost-link {
    color: var(--brand-deep);
    background: rgba(0, 119, 192, 0.08);
}

.table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--line);
}

.result-cards {
    display: grid;
    gap: 1rem;
}

.team-result-card {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 1rem;
    background: #fff;
}

.team-result-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.team-result-head h4 {
    margin: 0;
    font-size: 1.3rem;
}

.team-meta {
    margin: 0.45rem 0 0;
    color: var(--muted);
}

.team-actions {
    display: flex;
    align-items: center;
}

.missing-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.55rem 0.8rem;
    background: rgba(178, 0, 0, 0.08);
    color: var(--brand-alert);
    font-size: 0.85rem;
    font-weight: 700;
}

.file-link {
    color: var(--brand-deep);
    font-weight: 700;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    text-align: left;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.path-list {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: 0.6rem 1rem;
    margin: 0;
}

.path-list dt {
    font-weight: 700;
    color: var(--brand-deep);
}

.path-list dd {
    margin: 0;
    word-break: break-word;
}

.empty-state {
    border-radius: 20px;
    padding: 1rem 1.1rem;
    background: var(--sky);
    color: var(--muted);
}

.flash-banner {
    margin-bottom: 1rem;
    border-radius: 18px;
    padding: 0.9rem 1rem;
    font-weight: 700;
}

.flash-success {
    background: rgba(17, 128, 74, 0.12);
    color: #11804a;
}

.flash-error {
    background: rgba(178, 0, 0, 0.08);
    color: var(--brand-alert);
}

.admin-import-form {
    display: grid;
    gap: 1rem;
}

.file-field span {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--muted);
}

.file-field input[type="file"] {
    width: 100%;
    border: 1px solid rgba(0, 119, 192, 0.16);
    border-radius: 16px;
    padding: 0.8rem;
    background: #fff;
}

.helper-copy {
    margin-top: 0.85rem;
    color: var(--muted);
    font-size: 0.92rem;
}

.mini-metric-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1rem;
}

.mini-metric {
    padding: 0.95rem 1rem;
    border-radius: 20px;
    background: var(--sky);
}

.mini-metric strong,
.mini-metric span {
    display: block;
}

.mini-metric strong {
    font-size: 1.25rem;
}

.check-field {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    color: var(--ink);
    font-weight: 600;
}

.check-field input[type="checkbox"] {
    inline-size: 1rem;
    block-size: 1rem;
}

.import-email-toggle-group {
    display: grid;
    gap: 0.7rem;
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(0, 119, 192, 0.04);
    border: 1px solid rgba(0, 119, 192, 0.1);
}

.import-toggle-heading {
    display: block;
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--muted);
}

.import-email-toggle-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.import-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.import-actions .primary-button,
.import-actions .ghost-link,
.import-actions .ghost-button {
    min-width: 220px;
}

.inline-form {
    margin: 0;
}

.ghost-button {
    border: 1px solid rgba(0, 119, 192, 0.18);
    background: rgba(0, 119, 192, 0.08);
    color: var(--brand-deep);
    border-radius: 999px;
    padding: 0.55rem 0.85rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.action-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}

.action-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.bulk-action-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

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

.permission-grid {
    display: grid;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.analytics-list {
    display: grid;
    gap: 0.75rem;
}

.analytics-bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: 18px;
    background: var(--sky);
}

.compact-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.verify-qr-panel {
    text-align: center;
}

.verify-qr-code {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid var(--line);
    min-height: 16rem;
}

.verify-qr-code svg {
    display: block;
    max-width: 100%;
    height: auto;
}

.template-designer {
    display: grid;
    gap: 1rem;
}

.template-designer-toolbar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stage-toolbar {
    justify-content: space-between;
    align-items: center;
}

.stage-toolbar-copy {
    color: var(--muted);
    font-size: 0.92rem;
}

.multi-check-select {
    position: relative;
    display: grid;
    gap: 0.45rem;
    z-index: 1;
}

.multi-check-select.is-open {
    z-index: 80;
}

.multi-check-trigger {
    width: 100%;
    border: 1px solid rgba(0, 119, 192, 0.16);
    border-radius: 16px;
    padding: 0.9rem 1rem;
    background: #fff;
    cursor: pointer;
    text-align: left;
    display: grid;
    align-items: flex-start;
    gap: 0.2rem;
}

.multi-check-trigger strong,
.multi-check-trigger small {
    display: block;
}

.multi-check-trigger small {
    color: var(--muted);
}

.multi-check-panel {
    position: absolute;
    z-index: 15;
    inset-inline: 0;
    top: calc(100% + 0.4rem);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 0.5rem;
    box-shadow: var(--shadow);
    max-height: 18rem;
    overflow: auto;
    display: none;
}

.multi-check-select.is-open .multi-check-panel {
    display: grid;
}

.multi-check-option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.75rem;
    border-radius: 14px;
}

.multi-check-option:hover {
    background: rgba(0, 119, 192, 0.06);
}

.template-designer-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1rem;
    align-items: start;
}

.template-canvas-wrap {
    overflow: auto;
    border-radius: 24px;
    border: 1px solid var(--line);
    padding: 1rem;
    background: #f8fbfe;
}

.template-canvas {
    position: relative;
    width: min(100%, 960px);
    aspect-ratio: 297 / 210;
    margin: 0 auto;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(16, 33, 51, 0.1);
}

.template-canvas-background {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.template-canvas-pdf {
    border: 0;
    pointer-events: none;
    background: #ffffff;
}

.template-canvas::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(16, 33, 51, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 33, 51, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    background-position: 0 0;
}

.template-canvas-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 2rem;
    color: var(--muted);
    background: #f1f7fc;
}

.template-canvas-placeholder strong,
.template-canvas-placeholder span {
    display: block;
}

.template-canvas-placeholder strong {
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.template-element {
    position: absolute;
    z-index: 2;
    border: 1px dashed rgba(0, 119, 192, 0.45);
    background: transparent;
    border-radius: 10px;
    padding: 0.2rem 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: grab;
    user-select: none;
    backdrop-filter: blur(4px);
    min-width: 1.5rem;
    min-height: 1.5rem;
}

.template-element.is-selected {
    border-color: var(--brand-red);
    box-shadow: 0 0 0 3px rgba(237, 28, 36, 0.15);
}

.template-element-label {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.2rem 0.6rem;
}

.template-element-resize {
    position: absolute;
    inset-inline-end: -0.45rem;
    inset-block-end: -0.45rem;
    width: 0.95rem;
    height: 0.95rem;
    border-radius: 50%;
    border: 0;
    cursor: nwse-resize;
    background: var(--brand-blue);
    box-shadow: 0 8px 18px rgba(0, 50, 92, 0.18);
}

.template-variable-table {
    display: grid;
    gap: 0.75rem;
}

.template-modal[hidden] {
    display: none;
}

.template-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    overflow-y: auto;
    padding: 1rem;
}

.template-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 14, 24, 0.72);
    backdrop-filter: blur(5px);
}

.template-modal-dialog {
    position: relative;
    width: min(100%, 920px);
    margin: min(5vh, 2.5rem) auto;
    background: #fff;
    border-radius: 34px;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

.template-modal-head,
.template-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--line);
}

.template-modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
}

.template-modal-actions {
    border-bottom: 0;
    border-top: 1px solid var(--line);
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    z-index: 2;
}

.template-modal-head h3 {
    margin: 0;
}

.template-modal-body {
    padding: 1.2rem;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

body.has-modal {
    overflow: hidden;
}

.meta-separator {
    display: inline-block;
    margin: 0 0.4rem;
    color: rgba(255, 255, 255, 0.55);
}

.template-gallery-hero {
    padding: 1.15rem 1.3rem;
    border-radius: 26px;
    background: #ffffff;
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
}

.template-gallery-hero .eyebrow,
.template-gallery-hero .subcopy {
    color: var(--muted);
}

.template-gallery-hero h2 {
    margin: 0;
    font-size: clamp(1.55rem, 2.6vw, 2.2rem);
}

.template-tile-grid {
    align-items: start;
}

.template-tile {
    background: #ffffff;
    color: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.84);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.template-tile:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 119, 192, 0.2);
    box-shadow: 0 30px 80px rgba(0, 50, 92, 0.16);
}

.template-tile-preview {
    position: relative;
    overflow: hidden;
    background: #eef5fb;
}

.template-tile-preview::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 38%;
    background: rgba(16, 33, 51, 0.06);
    pointer-events: none;
}

.template-tile-head {
    margin-bottom: 0.35rem;
}

.template-tile-meta {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted);
}

.template-tile-coverage {
    min-height: 1.6rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.template-tile-actions .ghost-button {
    background: rgba(0, 119, 192, 0.08);
    border-color: rgba(0, 119, 192, 0.18);
    color: var(--brand-deep);
}

.editor-hero {
    padding: 0.2rem 0 0.4rem;
}

.editor-title-chip {
    background: rgba(0, 119, 192, 0.08);
    border: 1px solid rgba(0, 119, 192, 0.16);
}

.template-editor-shell {
    display: grid;
}

.template-step-tabs {
    margin-bottom: 1rem;
}

.template-step-tab {
    box-shadow: 0 10px 24px rgba(0, 50, 92, 0.06);
}

.template-step-panel .panel {
    overflow: visible;
}

[data-template-tab-panel="mapping"] .form-grid,
[data-template-tab-panel="mapping"] .multi-check-select {
    overflow: visible;
}

.template-form-section {
    margin-bottom: 1rem;
}

.template-editor-layout {
    align-items: start;
}

.template-settings-sidebar {
    background: #ffffff;
}

.template-setting-list {
    background: rgba(0, 119, 192, 0.04);
    border: 1px solid rgba(0, 119, 192, 0.1);
    border-radius: 20px;
    padding: 0.9rem 0.95rem;
}

.helper-copy {
    margin-top: 1rem;
    padding: 0.85rem 0.9rem;
    border-radius: 16px;
    background: rgba(16, 33, 51, 0.04);
    color: var(--muted);
    line-height: 1.55;
}

.action-stack {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.template-designer-stage {
    background: #ffffff;
}

.template-designer {
    display: grid;
    gap: 1rem;
}

.stage-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.8rem 0.9rem 0;
}

.stage-toolbar-copy {
    color: var(--muted);
    font-size: 0.9rem;
}

.template-canvas-wrap {
    box-shadow: inset 0 0 0 1px rgba(0, 119, 192, 0.08);
}

.template-canvas {
    max-width: 100%;
}

.template-canvas::after {
    opacity: 0.45;
}

.template-element {
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.template-element:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 74, 130, 0.12);
}

.template-element-label {
    overflow: hidden;
    word-break: break-word;
}

.template-variable-table {
    border-top: 1px solid rgba(0, 119, 192, 0.08);
    padding-top: 0.5rem;
}

.template-variable-table table {
    background: #fff;
}

.template-variable-table td small {
    color: var(--muted);
}

.template-modal-dialog {
    background: #ffffff;
}

.template-modal-head {
    background: #f5f9fd;
    padding-block: 1rem;
}

.template-modal-head .ghost-button {
    min-width: 2.8rem;
    padding-inline: 0;
}

.template-modal-actions {
    background: rgba(16, 33, 51, 0.02);
}

.template-modal-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 1.05rem;
    border-radius: 20px;
    background: #f8fbfe;
    border: 1px solid rgba(0, 119, 192, 0.12);
}

.template-modal-intro strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 1rem;
}

.template-modal-intro p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.template-variable-preview-card {
    display: grid;
    gap: 0.55rem;
    align-content: start;
    padding: 0.9rem 0.95rem 0.85rem;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(0, 119, 192, 0.14);
}

.template-variable-preview-card span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.template-variable-preview-card code {
    display: inline-flex;
    align-items: center;
    min-height: 2.9rem;
    padding: 0.75rem 0.9rem;
    border-radius: 16px;
    background: var(--brand-blue);
    color: #ffffff;
    font-size: 0.95rem;
}

.template-modal-grid {
    display: grid;
    gap: 1rem;
}

.template-modal-section {
    padding: 1rem 1.05rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid rgba(0, 119, 192, 0.11);
    box-shadow: 0 14px 34px rgba(0, 50, 92, 0.05);
}

.template-modal-section h4 {
    margin: 0 0 0.85rem;
    font-size: 0.94rem;
}

.template-modal-section .form-grid {
    gap: 0.9rem 1rem;
}

.template-modal-section label {
    display: grid;
    gap: 0.45rem;
}

.template-sequence-builder {
    display: grid;
    gap: 0.75rem;
}

.template-sequence-list {
    display: grid;
    gap: 0.5rem;
}

.template-sequence-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 119, 192, 0.12);
    background: #f8fbfe;
}

.template-sequence-item strong {
    color: #102133;
}

.template-modal-section input,
.template-modal-section select {
    min-height: 2.9rem;
    background: #f8fbfe;
    padding: 0.8rem 0.9rem;
    font-size: 0.94rem;
}

.template-modal-section input[type="color"] {
    min-height: 2.9rem;
    padding: 0.45rem;
    border-radius: 16px;
}

.template-check-card {
    min-height: 2.9rem;
    padding: 0.75rem 0.85rem;
    border-radius: 16px;
    background: rgba(0, 119, 192, 0.04);
    border: 1px solid rgba(0, 119, 192, 0.1);
}

.template-element-label.is-qr {
    padding: 0.2rem;
}

.template-element-label.is-qr svg {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
}

code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.88rem;
    word-break: break-word;
}

.year-badges {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.85rem;
}

.year-badge {
    padding: 1rem;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid var(--line);
}

.year-badge strong,
.year-badge span {
    display: block;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.status-sent {
    background: rgba(17, 128, 74, 0.12);
    color: #11804a;
}

.status-pending {
    background: rgba(0, 119, 192, 0.12);
    color: var(--brand-blue);
}

.status-failed,
.status-none {
    background: rgba(178, 0, 0, 0.08);
    color: var(--brand-alert);
}

.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    color: #fff;
    background: var(--brand-red);
    border-radius: 999px;
    padding: 0.84rem 1.1rem;
    font: inherit;
    font-weight: 700;
}

.danger-button-small {
    padding: 0.55rem 0.85rem;
    font-size: 0.92rem;
}

.pagination-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    padding: 0.65rem 0.8rem;
    border-radius: 999px;
    background: rgba(0, 119, 192, 0.08);
    color: var(--brand-deep);
    font-weight: 700;
}

.page-link.is-active {
    background: var(--brand-blue);
    color: #fff;
}

.home-search-layout,
.home-trust-strip {
    margin-bottom: 1.25rem;
    margin-top: 20px;
}
.home-feature-chip span,
.home-trust-item strong,
.home-trust-item span,
.home-verified-note strong,
.home-verified-note span {
    display: block;
}

.home-feature-chip strong,
.home-trust-item strong,
.home-verified-note strong {
    font-size: 0.95rem;
}

.home-feature-chip span,
.home-trust-item span,
.home-verified-note span {
    margin-top: 0.28rem;
    color: var(--muted);
    font-size: 0.87rem;
}

.home-search-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.65fr);
    gap: 1rem;
    align-items: stretch;
}

.home-search-panel {
    padding: 1.15rem;
    border-radius: 26px;
    background: #ffffff;
}

.home-search-panel-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.home-search-tips {
    min-width: 170px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 119, 192, 0.12);
    box-shadow: 0 12px 30px rgba(0, 50, 92, 0.06);
}

.home-search-tips summary {
    list-style: none;
    cursor: pointer;
    padding: 0.8rem 0.9rem;
    font-weight: 700;
    color: var(--brand-deep);
}

.home-search-tips summary::-webkit-details-marker {
    display: none;
}

.home-search-tips-body {
    padding: 0 0.9rem 0.9rem;
}

.home-search-tips-body p {
    margin: 0.5rem 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.home-certificate-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.05rem;
}

.home-field {
    position: relative;
}

.home-field > span {
    padding-left: 0.15rem;
}

.home-label-title {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
    margin-bottom: 0.45rem;
    padding-left: 0.15rem;
}

.home-label-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    color: var(--brand-blue);
    flex: 0 0 1rem;
}

.home-label-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.home-label-title > span {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0;
    padding-left: 0;
}

.home-label-title .home-label-icon {
    margin-bottom: 0;
}

.home-certificate-form input,
.home-certificate-form select {
    min-height: 3.1rem;
    border-radius: 18px;
    background: #ffffff;
    border-color: rgba(0, 119, 192, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.home-certificate-form input::placeholder {
    color: #9aabc1;
}

.home-form-actions {
    margin-top: 1rem;
}

.home-primary-button,
.home-ghost-link {
    min-width: 180px;
    min-height: 3rem;
}

.home-primary-button {
    box-shadow: 0 20px 34px rgba(237, 28, 36, 0.18);
}

.home-ghost-link {
    justify-content: center;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(0, 119, 192, 0.12);
}

.home-visual-card {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-radius: 26px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.home-visual-figure {
    margin: 0;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(0, 119, 192, 0.08);
    background: #f8fbfe;
}

.home-visual-figure img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.home-verified-note {
    padding: 0.9rem 0.95rem;
    border-radius: 18px;
    background: #f8fbfe;
    border: 1px solid rgba(0, 119, 192, 0.1);
}

.home-trust-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow);
}

.home-trust-item {
    padding: 0.72rem 0.82rem;
    border-radius: 18px;
    background: #ffffff;
}

.home-results-panel {
    background: #ffffff;
}

.home-team-result-card {
    padding: 1rem;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(0, 50, 92, 0.06);
}

.home-empty-state {
    background: #f8fbfe;
}

.search-detail-list {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
    text-align: left;
}

.search-detail-list span {
    color: var(--text-muted);
    font-size: 0.95rem;
}

@media (max-width: 980px) {
    .admin-shell,
    .brand-row,
    .stats-grid,
    .taxonomy-stats-grid,
    .dashboard-grid,
    .panel-grid,
    .admin-grid,
    .admin-panel-grid,
    .spotlight-metrics,
    .metric-band,
    .mini-metric-row,
    .taxonomy-pane-layout,
    .template-designer-workspace,
    .template-editor-layout,
    .certificate-form .form-grid,
    .home-search-layout,
    .home-trust-strip,
    .team-stats-grid,
    .form-grid.two-col,
    .form-grid.three-col {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .mobile-admin-toggle {
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }

    .mobile-public-toggle {
        display: inline-flex;
        justify-content: center;
        align-items: center;
    }

    .admin-nav {
        display: none;
    }

    .admin-nav.is-open {
        display: grid;
    }

    .admin-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .top-nav {
        display: none;
        width: 100%;
        justify-content: stretch;
        padding-top: 0.35rem;
        border-top: 1px solid var(--line);
    }

    .top-nav.is-open {
        display: grid;
        grid-template-columns: 1fr;
    }

    .brand-row.is-public-header {
        grid-template-columns: auto auto minmax(0, 1fr);
        align-items: center;
    }

    .brand-row.is-public-header .mobile-public-toggle {
        order: 1;
        justify-self: start;
    }

    .brand-row.is-public-header .brand-mark {
        order: 2;
        width: 84px;
        justify-self: center;
    }

    .brand-row.is-public-header .brand-copy {
        order: 3;
        min-width: 0;
    }

    .brand-row.is-public-header .top-nav {
        order: 4;
        grid-column: 1 / -1;
    }

    .team-result-head {
        flex-direction: column;
    }

    .home-search-panel-head {
        align-items: flex-start;
    }

    .taxonomy-panel-head,
    .taxonomy-group-head,
    .taxonomy-toolbar,
    .taxonomy-pane-head {
        flex-direction: column;
        align-items: stretch;
    }

    .taxonomy-tab-button {
        min-width: 0;
        width: 100%;
    }

    .team-member-head {
        flex-direction: column;
        align-items: stretch;
    }

    .team-table-head,
    .team-modal-head,
    .team-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .home-visual-card {
        order: -1;
    }

    .table-wrap {
        overflow: visible;
        border: 0;
    }

    table[data-mobile-cards] thead {
        display: none;
    }

    table[data-mobile-cards],
    table[data-mobile-cards] tbody,
    table[data-mobile-cards] tr,
    table[data-mobile-cards] td {
        display: block;
        width: 100%;
    }

    table[data-mobile-cards] tr {
        border: 1px solid var(--line);
        border-radius: 22px;
        padding: 0.35rem 0;
        margin-bottom: 1rem;
        background: #fff;
        box-shadow: var(--shadow);
    }

    table[data-mobile-cards] td {
        border-bottom: 1px solid var(--line);
        padding: 0.85rem 1rem;
    }

    table[data-mobile-cards] td:last-child {
        border-bottom: 0;
    }

    table[data-mobile-cards] td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.3rem;
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    .verify-qr-code {
        min-height: auto;
    }

    .template-canvas {
        width: 100%;
    }

    .multi-check-panel {
        position: static;
        display: grid;
        max-height: 14rem;
        margin-top: 0.35rem;
    }

    .multi-check-trigger {
        display: none;
    }

    .template-settings-sidebar {
        position: static;
    }

    .stage-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding-inline: 0;
    }

    .template-gallery-hero {
        padding: 1.2rem;
    }

    .template-modal-intro {
        grid-template-columns: 1fr;
    }

    .template-modal {
        padding: 0.6rem;
    }

    .template-modal-dialog {
        width: 100%;
        max-height: calc(100vh - 1.2rem);
        margin: 0 auto;
        border-radius: 22px;
    }

    .template-modal-body {
        padding: 0.9rem;
    }
}

@media (max-width: 640px) {
    .site-header,
    .page-wrap {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .brand-row {
        grid-template-columns: 1fr;
        padding: 1rem;
        border-radius: 22px;
    }

    .brand-row.is-public-header {
        grid-template-columns: auto auto;
        align-items: center;
        gap: 0.35rem;
    }

    .home-search-panel,
    .home-visual-card,
    .home-trust-strip {
        padding: 1rem;
        border-radius: 24px;
    }

    .brand-mark {
        max-width: 180px;
    }

    .brand-row.is-public-header .brand-mark {
        max-width: 180px;
        width: 180px;
        margin: 0;
    }

    .brand-copy {
        order: 2;
    }

    .brand-row.is-public-header .brand-copy {
        order: 3;
        text-align: left;
        grid-column: 1 / -1;
        margin-top: 15px;
    }

    .brand-row.is-public-header .brand-copy .eyebrow {
        margin-bottom: 0.2rem;
        font-size: 0.63rem;
        letter-spacing: 0.12em;
    }

    .brand-row.is-public-header .brand-copy h1 {
        font-size: 1.15rem;
        line-height: 1.12;
    }

    .brand-row.is-public-header .brand-copy .subcopy {
        margin-top: 0.2rem;
        font-size: 0.8rem;
        line-height: 1.35;
    }

    .mobile-public-toggle,
    .mobile-admin-toggle {
        order: 3;
        width: 100%;
    }

    .brand-row.is-public-header .mobile-public-toggle {
        order: 1;
        width: 3.4rem;
        height: 3.4rem;
        justify-self: start;
    }

    .brand-row.is-public-header .brand-mark {
        justify-self: start;
    }

    .top-nav {
        order: 4;
    }

    .brand-row.is-public-header .top-nav {
        grid-column: 1 / -1;
    }

    .top-nav a,
    .secondary-link,
    .ghost-link,
    .primary-button,
    .danger-button {
        width: 100%;
    }

    .team-modal-dialog {
        width: calc(100% - 1rem);
        margin: 2vh auto;
        border-radius: 22px;
    }

    .team-modal-body {
        padding: 0.95rem;
        max-height: 76vh;
    }

    .form-actions,
    .bulk-action-row,
    .action-row {
        flex-direction: column;
        align-items: stretch;
    }

    .import-email-toggle-row {
        flex-direction: column;
        align-items: stretch;
    }

    .import-actions .primary-button,
    .import-actions .ghost-link,
    .import-actions .ghost-button {
        min-width: 0;
        width: 100%;
    }

    .settings-tabs {
        padding: 0.8rem;
        gap: 0.6rem;
    }

    .settings-tab-link {
        flex: 1 1 calc(50% - 0.6rem);
        min-height: 2.55rem;
        padding: 0.72rem 0.95rem;
        text-align: center;
    }

    .settings-form-actions {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .settings-form-actions .primary-button,
    .settings-form-actions .ghost-button {
        width: auto;
        min-width: 0;
    }

    .settings-section-tabs {
        gap: 0.6rem;
    }

    .settings-section-tab {
        flex: 1 1 calc(50% - 0.6rem);
        text-align: center;
    }

    .settings-navigation-grid {
        grid-template-columns: 1fr;
    }

    .settings-menu-row-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .settings-menu-order-actions {
        width: 100%;
    }

    .settings-order-button {
        width: 100%;
        min-width: 0;
    }

    .pagination-row {
        justify-content: center;
    }

}
