:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7f8;
    color: #172026;
}

body {
    margin: 0;
}

.app-header {
    align-items: center;
    border-bottom: 1px solid #d8dee4;
    background: #ffffff;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 16px 24px;
}

.brand-lockup,
.header-actions,
.app-nav {
    align-items: center;
    display: flex;
    gap: 12px;
}

.brand-lockup a,
.app-nav a {
    color: inherit;
    text-decoration: none;
}

.brand-logo {
    display: block;
    height: 28px;
    width: auto;
}

.app-header span {
    color: #5f6b76;
}

.app-nav {
    flex: 1;
    gap: 16px;
}

.app-nav a {
    color: #33414d;
    font-size: 14px;
    font-weight: 700;
}

.app-nav a:hover {
    color: #172026;
}

.header-actions {
    justify-content: flex-end;
}

.app-header form {
    align-items: center;
    display: flex;
    gap: 12px;
    margin: 0;
}

.allowance-header {
    align-items: center;
    background: #edf6f2;
    border: 1px solid #b7dec8;
    border-radius: 6px;
    color: #245f44;
    display: flex;
    gap: 8px;
    padding: 7px 10px;
}

.allowance-header .allowance-title {
    color: inherit;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.allowance-metrics {
    display: flex;
    gap: 8px;
    margin: 0;
}

.allowance-metrics div {
    align-items: baseline;
    display: flex;
    gap: 4px;
}

.allowance-metrics dt {
    font-size: 11px;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
}

.allowance-metrics dd {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.allowance-header strong {
    font-size: 14px;
}

.allowance-header em {
    color: inherit;
    font-size: 12px;
    font-style: normal;
}

.allowance-header.low {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #7c2d12;
}

.allowance-header.unavailable {
    background: #f6f8fa;
    border-color: #d8dee4;
    color: #5f6b76;
}

.allowance-header.exhausted {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.app-header button,
.login-form button {
    background: #172026;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    padding: 9px 14px;
}

.page {
    margin: 0 auto;
    max-width: 960px;
    padding: 40px 24px;
}

.intro h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 8px;
}

.intro p {
    color: #5f6b76;
    margin: 0;
}

.scope-list {
    display: grid;
    gap: 16px;
    margin-top: 28px;
}

.scope-item {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    padding: 20px;
}

.scope-item h2 {
    font-size: 20px;
    margin: 0 0 16px;
}

.scope-item dl {
    display: grid;
    gap: 12px;
    margin: 0;
}

.scope-item dl div {
    display: grid;
    gap: 4px;
}

.scope-item dt {
    color: #5f6b76;
    font-size: 13px;
}

.scope-item dd {
    margin: 0;
}

.metadata-intro {
    border-bottom: 1px solid #d8dee4;
    padding-bottom: 24px;
}

.metadata-link {
    color: #172026;
    display: inline-block;
    font-weight: 700;
    margin-top: 16px;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.intro-actions {
    align-items: center;
    display: flex;
    justify-content: flex-end;
}

.intro-actions .metadata-link {
    background: #172026;
    border: 1px solid #172026;
    border-radius: 6px;
    color: #ffffff;
    margin-top: 0;
    padding: 9px 14px;
    text-decoration: none;
}

.eyebrow {
    color: #5f6b76;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 6px;
    text-transform: uppercase;
}

.metadata-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 24px;
}

.context-panel {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    padding: 20px;
}

.context-panel h2,
.section-heading h2 {
    font-size: 20px;
    line-height: 1.2;
    margin: 0;
}

.metadata-definition {
    display: grid;
    gap: 14px;
    margin: 18px 0 0;
}

.metadata-definition div {
    display: grid;
    gap: 4px;
}

.metadata-definition dt,
.season-form label {
    color: #5f6b76;
    font-size: 13px;
}

.metadata-definition dd {
    margin: 0;
}

.panel-heading,
.section-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.panel-heading span,
.section-heading > span {
    background: #eef2f5;
    border-radius: 999px;
    color: #33414d;
    font-size: 12px;
    padding: 5px 9px;
}

.season-form {
    margin-top: 18px;
}

.season-form label {
    display: grid;
    gap: 8px;
}

.season-form select {
    border: 1px solid #b9c3cc;
    border-radius: 6px;
    color: #172026;
    font: inherit;
    padding: 10px 12px;
}

.team-section {
    margin-top: 28px;
}

.team-browser {
    margin-top: 16px;
}

.team-list {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.team-row {
    align-items: center;
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    color: inherit;
    cursor: pointer;
    display: flex;
    font: inherit;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    text-align: left;
    text-decoration: none;
}

.team-row:hover,
.team-row:focus-visible {
    border-color: #64748b;
}

.active-context-list {
    border-bottom: 1px solid #e7ebef;
    border-top: 1px solid #e7ebef;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 18px 0;
    padding: 14px 0;
}

.active-context-list div {
    display: grid;
    gap: 4px;
}

.active-context-list dt {
    color: #5f6b76;
    font-size: 12px;
}

.active-context-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.empty-state {
    color: #5f6b76;
    margin: 0;
}

.ops-page {
    max-width: 1280px;
}

.management-toolbar {
    margin-top: 24px;
}

.management-toolbar form {
    align-items: end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.management-toolbar label {
    color: #33414d;
    display: grid;
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    gap: 7px;
    min-width: 260px;
}

.management-toolbar input {
    border: 1px solid #b9c3cc;
    border-radius: 6px;
    color: #172026;
    font: inherit;
    font-weight: 400;
    min-width: 0;
    padding: 10px 12px;
}

.management-toolbar button,
.management-toolbar a,
.table-action {
    background: #ffffff;
    border: 1px solid #b9c3cc;
    border-radius: 6px;
    color: #172026;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 10px 12px;
    text-decoration: none;
}

.management-toolbar button {
    background: #172026;
    border-color: #172026;
    color: #ffffff;
}

.management-section {
    margin-top: 18px;
}

.table-shell {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    overflow-x: auto;
}

.management-table {
    border-collapse: collapse;
    min-width: 920px;
    width: 100%;
}

.audit-table {
    min-width: 1180px;
}

.management-table th,
.management-table td {
    border-bottom: 1px solid #e7ebef;
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

.management-table th {
    color: #5f6b76;
    font-size: 12px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.management-table tr:last-child td {
    border-bottom: 0;
}

.management-table td {
    font-size: 14px;
}

.management-table td strong,
.management-table td span {
    display: block;
}

.management-table td strong {
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.management-table td span {
    color: #5f6b76;
    font-size: 12px;
    line-height: 1.35;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.table-action {
    display: inline-block;
    padding: 7px 10px;
}

.results-context {
    margin-top: 16px;
}

.results-page {
    max-width: none;
    padding: 24px 28px 36px;
}

.results-page .metadata-intro {
    align-items: end;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    padding-bottom: 18px;
}

.results-page .metadata-intro h1 {
    font-size: 28px;
}

.results-page .metadata-intro p:last-child {
    max-width: 520px;
    text-align: right;
}

.results-page .active-context-list {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    padding: 12px 16px;
}

.results-workspace {
    display: grid;
    gap: 14px;
    margin-top: 14px;
}

.filter-panel {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    display: grid;
    gap: 12px;
    padding: 14px;
}

.filter-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-filter-grid {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.filter-grid > label,
.filter-grid .filter-field {
    color: #33414d;
    display: grid;
    font-size: 12px;
    font-weight: 700;
    gap: 5px;
    grid-template-rows: 18px 36px;
    line-height: 18px;
}

.filter-field-heading {
    align-items: center;
    display: flex;
    gap: 6px;
    height: 18px;
    justify-content: flex-start;
    min-width: 0;
}

.filter-field-heading label {
    line-height: 18px;
    min-width: 0;
}

.icon-link {
    align-items: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #5f6b76;
    display: inline-flex;
    flex: 0 0 auto;
    height: 18px;
    justify-content: center;
    text-decoration: none;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
    width: 18px;
}

.icon-link:hover,
.icon-link:focus-visible {
    background: #eef2f5;
    border-color: #d8dee4;
    color: #172026;
    outline: none;
}

.icon-link svg {
    fill: none;
    height: 13px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
    width: 13px;
}

.filter-grid select,
.filter-grid input {
    background: #ffffff;
    border: 1px solid #b9c3cc;
    border-radius: 6px;
    box-shadow: none;
    box-sizing: border-box;
    color: #172026;
    font: inherit;
    font-size: 13px;
    font-weight: 400;
    height: 36px;
    line-height: 18px;
    min-width: 0;
    padding: 7px 9px;
    width: 100%;
}

.searchable-select {
    font: inherit;
    height: 36px;
    min-width: 0;
    position: relative;
    width: 100%;
}

.searchable-select.open {
    z-index: 30;
}

.filter-grid select.searchable-select-native {
    border: 0;
    height: 1px;
    margin: 0;
    opacity: 0;
    padding: 0;
    pointer-events: none;
    position: absolute;
    width: 1px;
}

.filter-grid .searchable-select-input {
    padding-right: 34px;
}

.searchable-select-input:focus {
    border-color: #3d7ca6;
    outline: 2px solid #c9e7f8;
    outline-offset: 0;
}

.searchable-select-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    bottom: 1px;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    padding: 0;
    position: absolute;
    right: 1px;
    top: 1px;
    width: 32px;
}

.searchable-select-toggle::before {
    border-color: #5f6b76 transparent transparent;
    border-style: solid;
    border-width: 5px 4px 0;
    content: "";
    height: 0;
    width: 0;
}

.searchable-select.open .searchable-select-toggle::before {
    transform: rotate(180deg);
}

.searchable-select-list {
    background: #ffffff;
    border: 1px solid #b9c3cc;
    border-radius: 6px;
    box-shadow: 0 12px 28px rgba(23, 32, 38, 0.16);
    box-sizing: border-box;
    left: 0;
    list-style: none;
    margin: 4px 0 0;
    max-height: 240px;
    overflow-y: auto;
    padding: 4px;
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 40;
}

.searchable-select-option {
    border-radius: 5px;
    color: #172026;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    line-height: 18px;
    padding: 7px 8px;
}

.searchable-select-option:hover,
.searchable-select-option.active {
    background: #eef2f5;
}

.searchable-select-option.selected {
    font-weight: 700;
}

.searchable-select-option.disabled,
.searchable-select-option.empty {
    color: #5f6b76;
    cursor: default;
}

.searchable-select-option.disabled:hover,
.searchable-select-option.empty:hover {
    background: transparent;
}

.filter-actions {
    align-items: center;
    display: flex;
    gap: 12px;
}

.filter-actions span {
    color: #5f6b76;
    font-size: 12px;
}

.loading-indicator {
    align-items: center;
    color: #33414d;
    display: none;
    font-size: 12px;
    gap: 8px;
}

.loading-indicator.htmx-request {
    display: inline-flex;
}

.loading-spinner {
    animation: loading-spin 800ms linear infinite;
    border: 2px solid #d8dee4;
    border-radius: 999px;
    border-top-color: #172026;
    box-sizing: border-box;
    display: inline-block;
    flex: 0 0 auto;
    height: 14px;
    width: 14px;
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.filter-panel > button,
.filter-actions button {
    background: #172026;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    justify-self: start;
    padding: 9px 14px;
}

.filter-actions button:disabled {
    background: #d8dee4;
    color: #5f6b76;
    cursor: not-allowed;
}

.active-filters {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    padding: 12px 14px;
}

.active-filters .section-heading h2 {
    font-size: 16px;
}

.active-filters .eyebrow {
    margin-bottom: 3px;
}

.clear-filters {
    color: #172026;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.active-filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.filter-chip {
    margin: 0;
}

.filter-chip button {
    align-items: center;
    background: #eef2f5;
    border: 1px solid #d8dee4;
    border-radius: 999px;
    color: #33414d;
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 13px;
    gap: 8px;
    max-width: 100%;
    padding: 5px 9px;
}

.filter-chip span {
    overflow-wrap: anywhere;
}

.filter-chip strong {
    font-size: 14px;
    line-height: 1;
}

.results-section {
    margin-top: 0;
}

.results-section .section-heading {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px 8px 0 0;
    padding: 12px 14px;
}

.results-section .section-heading h2 {
    font-size: 18px;
}

.results-section .table-shell {
    border-radius: 0 0 8px 8px;
    border-top: 0;
}

.results-section > .empty-state {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 0 0 8px 8px;
    border-top: 0;
    padding: 16px 14px;
}

.results-section > .loading-panel {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-top: 0;
    padding: 16px 14px;
}

.results-section > .loading-panel.htmx-request {
    display: flex;
}

.results-table-workspace {
    margin-top: 0;
}

.home-page .team-section .team-browser {
    margin-top: 14px;
}

.results-workspace .management-toolbar {
    margin-top: 0;
}

.guide-page {
    max-width: 1120px;
}

.guide-sections {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.guide-section {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 18px;
}

.guide-section h2 {
    font-size: 20px;
    line-height: 1.2;
    margin: 0;
}

.guide-section p {
    color: #33414d;
    line-height: 1.55;
    margin: 0;
}

.guide-section a {
    color: #0b65a3;
    font-weight: 700;
    text-decoration: none;
}

.guide-section a:hover,
.guide-section a:focus-visible {
    color: #172026;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.guide-safety-section {
    background: #fff7ed;
    border-color: #fed7aa;
}

.guide-safety-section p {
    color: #7c2d12;
}

.event-result {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    display: grid;
    gap: 18px;
    margin-top: 14px;
    padding: 20px;
}

.event-summary {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.event-summary h3 {
    font-size: 18px;
    line-height: 1.2;
    margin: 0 0 4px;
}

.event-summary p {
    color: #5f6b76;
    margin: 0;
}

.event-summary > span {
    background: #edf6f2;
    border-radius: 999px;
    color: #245f44;
    font-size: 12px;
    padding: 5px 9px;
}

.event-actions {
    align-items: center;
    display: flex;
    gap: 8px;
}

.event-actions > span {
    background: #edf6f2;
    border-radius: 999px;
    color: #245f44;
    font-size: 12px;
    padding: 5px 9px;
}

.event-actions button,
.help-heading button,
.clip-request-panel form button {
    background: #ffffff;
    border: 1px solid #b9c3cc;
    border-radius: 6px;
    color: #172026;
    cursor: pointer;
    font: inherit;
    padding: 7px 10px;
}

.event-table-shell {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-top: 0;
    border-radius: 0 0 8px 8px;
    max-height: calc(100vh - 360px);
    min-height: 260px;
    overflow: auto;
}

.event-table {
    border-collapse: collapse;
    min-width: 1540px;
    width: 100%;
}

.event-table th,
.event-table td {
    border-bottom: 1px solid #e7ebef;
    font-size: 13px;
    line-height: 1.35;
    padding: 9px 10px;
    text-align: left;
    vertical-align: top;
}

.event-table th {
    background: #f8fafc;
    color: #5f6b76;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    position: sticky;
    text-transform: uppercase;
    top: 0;
    z-index: 1;
}

.event-table tr:hover td {
    background: #fbfcfd;
}

.event-table tr:last-child td {
    border-bottom: 0;
}

.event-table td strong,
.event-table td span {
    display: block;
}

.event-table td strong {
    line-height: 1.25;
}

.event-table td span,
.identifier-cell span {
    color: #5f6b76;
    font-size: 12px;
    margin-top: 2px;
}

.event-table td strong.metadata-line {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.event-table .metadata-row {
    display: block;
    margin-top: 2px;
}

.event-table .metadata-tooltip {
    color: inherit;
    display: inline-flex;
    margin: 0;
    position: relative;
    vertical-align: baseline;
}

.event-table .metadata-tooltip-trigger {
    background: transparent;
    border: 0;
    border-bottom: 1px dotted #8b98a5;
    border-radius: 3px;
    color: inherit;
    cursor: help;
    display: inline-flex;
    font: inherit;
    font-weight: inherit;
    line-height: inherit;
    padding: 0 1px;
    text-align: left;
}

.event-table .metadata-tooltip-trigger:hover,
.event-table .metadata-tooltip-trigger:focus-visible {
    background: #eef2f5;
    outline: 2px solid #99c2e6;
    outline-offset: 2px;
}

.event-table .metadata-tooltip-label,
.event-table .metadata-divider {
    display: inline;
    margin: 0;
}

.event-table .metadata-tooltip-label {
    color: inherit;
    font: inherit;
}

.event-table .metadata-divider {
    color: #5f6b76;
    font-size: 13px;
}

.event-table .metadata-tooltip-panel {
    background: #172026;
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(23, 32, 38, 0.18);
    color: #ffffff;
    display: block;
    font-size: 12px;
    font-weight: 500;
    left: 0;
    line-height: 1.4;
    margin: 0;
    max-width: 280px;
    min-width: 220px;
    opacity: 0;
    overflow-wrap: anywhere;
    padding: 9px 10px;
    pointer-events: none;
    position: absolute;
    text-transform: none;
    top: calc(100% + 7px);
    transform: translateY(-2px);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
    visibility: hidden;
    white-space: normal;
    z-index: 6;
}

.event-table .metadata-tooltip-panel > span {
    background: transparent;
    border-radius: 0;
    color: inherit;
    display: block;
    font: inherit;
    margin: 0;
    padding: 0;
}

.event-table .metadata-tooltip-panel a {
    color: #d9ecff;
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    margin-top: 7px;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.event-table .metadata-tooltip:hover .metadata-tooltip-panel,
.event-table .metadata-tooltip:focus-within .metadata-tooltip-panel,
.event-table .metadata-tooltip.open .metadata-tooltip-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    visibility: visible;
}

.nowrap {
    white-space: nowrap;
}

.identifier-cell {
    max-width: 220px;
}

.identifier-cell span {
    overflow-wrap: anywhere;
}

.table-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 130px;
}

.table-tag-list > span:not(.metadata-tooltip-tag) {
    background: #eef2f5;
    border-radius: 999px;
    color: #33414d;
    display: inline-block;
    font-size: 11px;
    line-height: 1.2;
    margin: 0;
    padding: 4px 7px;
}

.table-tag-list > .metadata-tooltip-tag {
    background: transparent;
    border-radius: 0;
    color: inherit;
    display: inline-flex;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
    padding: 0;
}

.table-tag-list .metadata-tooltip-tag .metadata-tooltip-trigger {
    background: #eef2f5;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #33414d;
    font-size: 11px;
    line-height: 1.2;
    padding: 4px 7px;
}

.table-tag-list .metadata-tooltip-tag .metadata-tooltip-trigger:hover,
.table-tag-list .metadata-tooltip-tag .metadata-tooltip-trigger:focus-visible {
    background: #e7ebef;
    border-color: #b9c3cc;
}

.table-tag-list .metadata-tooltip-tag .metadata-tooltip-panel {
    left: auto;
    right: 0;
}

.table-actions {
    align-items: stretch;
    flex-direction: column;
    min-width: 112px;
}

.help-heading {
    align-items: flex-start;
    border-bottom: 1px solid #e7ebef;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding-bottom: 14px;
}

.help-heading h2 {
    font-size: 20px;
    margin: 0;
}

.help-definition {
    display: grid;
    gap: 12px;
    margin: 0;
}

.help-definition div {
    display: grid;
    gap: 4px;
}

.help-definition div.selected {
    border-left: 3px solid #172026;
    padding-left: 10px;
}

.help-definition dt {
    color: #5f6b76;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.help-definition dd {
    margin: 0;
}

.help-definition dd small {
    color: #5f6b76;
    display: block;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 4px;
}

.help-definition.compact {
    gap: 10px;
}

.help-source {
    display: grid;
    gap: 6px;
}

.help-source a {
    color: #0b65a3;
    font-weight: 700;
    text-decoration: none;
}

.help-source a:hover,
.help-source a:focus-visible {
    color: #172026;
    text-decoration: underline;
}

.help-block {
    display: grid;
    gap: 10px;
}

.help-block h3 {
    font-size: 15px;
    margin: 0;
}

.event-help-modal {
    background: rgba(23, 32, 38, 0.46);
    display: grid;
    inset: 0;
    padding: 24px;
    place-items: center;
    position: fixed;
    z-index: 20;
}

.event-help-panel {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(23, 32, 38, 0.18);
    display: grid;
    gap: 16px;
    max-height: min(760px, calc(100vh - 48px));
    max-width: 720px;
    overflow: auto;
    padding: 18px;
    width: min(100%, 720px);
}

.result-grid,
.identifier-list {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

.result-grid div,
.identifier-list div {
    border-top: 1px solid #e7ebef;
    display: grid;
    gap: 4px;
    min-width: 0;
    padding-top: 10px;
}

.result-grid dt,
.identifier-list dt {
    color: #5f6b76;
    font-size: 12px;
}

.result-grid dd,
.identifier-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-list span {
    background: #eef2f5;
    border-radius: 999px;
    color: #33414d;
    font-size: 12px;
    padding: 6px 10px;
}

.clip-request-dialog {
    background: rgba(23, 32, 38, 0.42);
    display: grid;
    inset: 0;
    padding: 24px;
    place-items: center;
    position: fixed;
    z-index: 20;
}

.clip-request-panel {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    display: grid;
    gap: 16px;
    max-width: 560px;
    padding: 18px;
    width: min(100%, 560px);
}

.paid-warning {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    color: #7c2d12;
    margin: 0;
    padding: 12px;
}

.paid-warning.low {
    background: #fffbeb;
    border-color: #fde68a;
    color: #78350f;
}

.paid-warning.exhausted {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.clip-request-panel form {
    margin: 0;
}

.clip-actions {
    display: flex;
    margin-top: 14px;
}

.clip-actions a {
    background: #ffffff;
    border: 1px solid #b9c3cc;
    border-radius: 6px;
    color: #172026;
    padding: 7px 10px;
    text-decoration: none;
}

.clip-request-panel form button {
    background: #172026;
    border-color: #172026;
    color: #ffffff;
}

.clip-request-panel form button:disabled {
    background: #d8dee4;
    border-color: #c3ccd5;
    color: #5f6b76;
    cursor: not-allowed;
}

@media (max-width: 720px) {
    .app-header,
    .team-row,
    .panel-heading,
    .section-heading,
    .event-summary,
    .results-page .metadata-intro {
        align-items: flex-start;
        flex-direction: column;
    }

    .results-page {
        padding: 24px 18px 32px;
    }

    .results-page .metadata-intro p:last-child {
        max-width: none;
        text-align: left;
    }

    .intro-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .metadata-grid,
    .guide-sections,
    .team-browser,
    .filter-grid,
    .results-with-help,
    .active-context-list,
    .result-grid,
    .identifier-list {
        grid-template-columns: 1fr;
    }
}

.login-page {
    align-items: center;
    display: flex;
    min-height: 100vh;
    padding: 24px;
}

.login-panel {
    background: #ffffff;
    border: 1px solid #d8dee4;
    border-radius: 8px;
    margin: 0 auto;
    max-width: 380px;
    padding: 28px;
    width: 100%;
}

.login-logo {
    height: auto;
    margin-bottom: 18px;
    max-width: 260px;
    width: 100%;
}

.login-panel h1 {
    font-size: 26px;
    line-height: 1.2;
    margin: 0 0 8px;
}

.login-panel p {
    color: #5f6b76;
    margin: 0 0 20px;
}

.login-form {
    display: grid;
    gap: 16px;
}

.login-form label {
    color: #33414d;
    display: grid;
    font-size: 14px;
    gap: 6px;
}

.login-form input {
    border: 1px solid #b9c3cc;
    border-radius: 6px;
    font: inherit;
    padding: 10px 12px;
}

.form-message {
    background: #edf6f2;
    border: 1px solid #b8d8ca;
    border-radius: 6px;
    margin-bottom: 16px;
    padding: 10px 12px;
}

.form-message.error {
    background: #fff0f0;
    border-color: #e0b4b4;
}
