:root {
   --background: #f9fcfe;
   --surface: #ffffff;
   --text: #15202b;
   --muted: #567086;
   --line: #c9dcef;
   --accent: #006aa8;
   --accent-strong: #004f80;
   --subgrid-header: #dcebf5;
   --subgrid-row: #f4f8fb;
   --subgrid-row-hover: #eaf3f8;
   --warning: #8a6500;
   --warning-bg: #fff0b8;
}

* {
   box-sizing: border-box;
}

html {
   min-height: 100%;
   scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
   html {
      overflow-y: scroll;
   }
}

body {
   min-height: 100%;
   margin: 0;
   background: var(--background);
   color: var(--text);
   font-family:
      Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
      "Segoe UI", sans-serif;
   line-height: 1.5;
}

a {
   color: var(--accent);
   text-decoration: none;
}

a:hover {
   color: var(--accent-strong);
}

.site-header {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 16px;
   padding:
      calc(10px + env(safe-area-inset-top, 0px))
      calc(32px + env(safe-area-inset-right, 0px))
      10px
      calc(32px + env(safe-area-inset-left, 0px));
   border-bottom: 1px solid rgba(255, 204, 0, 0.22);
   background: #006aa8;
   color: #ffcc00;
}

.site-header-main {
   display: flex;
   align-items: center;
   min-width: 0;
   gap: 14px;
}

.brand {
   flex: 0 0 auto;
   color: #ffcc00;
   font-size: 18px;
   font-weight: 800;
}

.brand:hover {
   color: #ffcc00;
}

.site-nav {
   display: flex;
   flex: 0 0 auto;
   gap: 18px;
   font-size: 14px;
   font-weight: 700;
}

.site-nav a {
   color: #ffcc00;
}

.site-nav a:hover {
   color: #ffcc00;
}

.admin-top-menu {
   display: flex;
   align-items: center;
   gap: 6px;
   min-width: 0;
   overflow-x: auto;
}

.admin-top-menu-link {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   min-height: 26px;
   padding: 0 8px;
   border: 1px solid rgba(255, 204, 0, 0.55);
   border-radius: 3px;
   background: #006aa8;
   color: #ffcc00;
   font-size: 12px;
   font-weight: 800;
   line-height: 1.2;
   white-space: nowrap;
}

.admin-top-menu-link:hover,
.admin-top-menu-link.is-active {
   border-color: rgba(255, 204, 0, 0.55);
   background: #005b91;
   color: #ffcc00;
}

.page-shell {
   width: min(1120px, calc(100% - 32px));
   margin: 0 auto;
   padding: 36px 0 64px;
}

.activity-entry-title {
   margin-top: 0px;
   margin-bottom: 0px;
}

.activity-entry-organization {
   margin-top: 0px;
   margin-bottom: 0px;
}

.page-heading {
   margin-bottom: 28px;
}

.page-heading-row {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 12px;
}

.page-heading-title-row {
   display: flex;
   align-items: center;
   flex-wrap: wrap;
   gap: 12px;
}

.entity-name-filter {
   width: 154px;
   max-width: 100%;
}

.entity-type-filter {
   width: 168px;
   max-width: 100%;
}

.entity-sport-filter {
   width: 168px;
   max-width: 100%;
}

.entity-filter-grid {
   display: grid;
   grid-template-columns:
      154px
      144px
      168px
      168px
      auto;
   align-items: end;
   gap: 12px;
}

.entity-filter-grid label {
   margin-bottom: 0;
}

.entity-filter-grid .multi-select-header {
   min-height: 32px;
   padding-top: 5px;
   padding-bottom: 5px;
}

.entity-filter-count {
   align-self: end;
   justify-self: end;
   padding-bottom: 8px;
   font-size: 12px;
   font-weight: 700;
   line-height: 1.2;
   white-space: nowrap;
}

.entity-filter-count strong {
   font-weight: 800;
}

.eyebrow {
   margin: 0 0 4px;
   color: var(--muted);
   font-size: 13px;
   font-weight: 800;
   text-transform: uppercase;
}

h1,
h2,
p {
   margin-top: 0;
}

h1 {
   margin-bottom: 0;
   font-size: 26px;
   line-height: 1.15;
}

h2 {
   font-size: 18px;
   line-height: 1.25;
}

.relevance {
   margin-bottom: 0;
   color: var(--muted);
}

.notice {
   padding: 14px 16px;
   margin-bottom: 12px;
   border: 1px solid var(--line);
   border-radius: 8px;
   background: var(--surface);
}

.notice-warning {
   border-color: #efca94;
   background: var(--warning-bg);
   color: var(--warning);
}

.notice-error {
   border-color: #e0aaaa;
   background: #fff5f5;
   color: #8c2d2d;
}

.button {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   min-height: 32px;
   padding: 0 10px;
   border: 1px solid var(--line);
   border-radius: 3px;
   background: var(--surface);
   color: var(--text);
   font: inherit;
   font-size: 13px;
   font-weight: 700;
   line-height: 1.2;
   cursor: pointer;
}

.button-primary {
   border-color: var(--accent);
   background: var(--accent);
   color: #ffffff;
}

.button-cancel {
   background: var(--muted);
   color: #ffffff;
}

.broadcast-ai-check-action {
   min-height: 28px;
   padding: 0 8px;
   border-color: rgba(0, 108, 103, 0.18);
   background: #ffffff;
   color: var(--accent-strong);
   font-size: 12px;
}

.broadcast-ai-check-action:hover {
   border-color: rgba(0, 108, 103, 0.32);
   background: rgba(0, 108, 103, 0.06);
   color: var(--accent-strong);
}

.button-row {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
}

.form-status {
   display: inline-flex;
   align-items: center;
   min-height: 32px;
   color: var(--muted);
   font-size: 12px;
   font-weight: 700;
}

.form-status-error {
   color: var(--warning);
}

.filter-form {
   display: flex;
   align-items: end;
   flex-wrap: wrap;
   gap: 8px;
}

.filter-form label {
   min-width: 180px;
   margin-bottom: 0;
}

.filter-checkbox {
   min-width: auto !important;
}

.filter-sports {
   display: grid;
   gap: 4px;
   min-width: min(100%, 520px);
   font-weight: 700;
}

.filter-sports label {
   margin-bottom: 0;
}

.filter-sports select {
   min-height: inherit;
}

.admin-layout {
   display: grid;
   grid-template-columns: 220px minmax(0, 1fr);
   gap: 16px;
}

.admin-sidebar {
   display: grid;
   align-content: start;
   overflow: hidden;
   border: 1px solid var(--line);
   border-radius: 6px;
   background: var(--surface);
}

.admin-sidebar-group {
   display: grid;
   gap: 1px;
   padding: 8px 0;
   border-bottom: 1px solid var(--line);
}

.admin-sidebar-group:last-child {
   border-bottom: 0;
}

.admin-sidebar-group h2 {
   margin: 0;
   padding: 0 12px 4px;
   color: var(--muted);
   font-size: 10px;
   font-weight: 800;
   line-height: 1.2;
   text-transform: uppercase;
   letter-spacing: 0.03em;
}

.admin-sidebar a {
   display: block;
   padding: 5px 12px;
   color: var(--text);
   font-size: 13px;
   font-weight: 700;
   line-height: 1.25;
}

.admin-sidebar a.is-active {
   background: rgba(0, 106, 168, 0.08);
   color: var(--accent-strong);
}

.admin-sidebar-group a {
   font-weight: 700;
}

.admin-sidebar-group a:hover {
   background: rgba(0, 106, 168, 0.06);
}

.compact-heading {
   margin-bottom: 14px;
}

.compact-heading p {
   margin-bottom: 0;
   color: var(--muted);
}

.stats-report-list {
   display: flex;
   flex-wrap: wrap;
   gap: 6px;
   margin-bottom: 12px;
}

.stats-report-frame {
   width: 100%;
   min-height: 75vh;
   border: 1px solid var(--line);
   border-radius: 8px;
   background: var(--surface);
}

.admin-table-wrap {
   width: 100%;
   overflow-x: auto;
   border: 1px solid var(--line);
   border-radius: 8px;
   background: var(--surface);
}

.admin-table {
   width: 100%;
   border-collapse: collapse;
   min-width: 760px;
   font-size: 13px;
   line-height: 1.35;
}

.admin-table-compact {
   min-width: 0;
   font-size: 12px;
   line-height: 1.25;
}

.admin-table-compact th,
.admin-table-compact td {
   padding: 4px 6px;
}

.admin-table-compact thead th {
   background: var(--subgrid-header);
   color: var(--accent-strong);
}

.admin-table-compact tbody th,
.admin-table-compact tbody td {
   background: var(--subgrid-row);
}

.admin-table-compact tbody tr:hover > th,
.admin-table-compact tbody tr:hover > td {
   background: var(--subgrid-row-hover);
}

.subgrid-heading {
   margin: 12px 0 6px;
   font-size: 14px;
   line-height: 1.2;
}

.entity-activities-table {
   table-layout: fixed;
}

.entity-sources-table {
   table-layout: fixed;
}

.entity-sources-table .source-observed-column {
   width: 17%;
}

.entity-sources-table .source-kind-column {
   width: 14%;
}

.entity-sources-table .source-url-column {
   width: 41%;
}

.entity-sources-table .source-title-column {
   width: 14%;
}

.entity-sources-table .source-excerpt-column {
   width: 14%;
}

.entity-sources-table .source-url {
   overflow-wrap: anywhere;
}

.activity-facts-table {
   table-layout: fixed;
}

.activity-facts-table .activity-facts-date-column {
   width: 7rem;
}

.activity-facts-table .activity-facts-actions-column {
   width: 4rem;
}

.activity-facts-table .source-url {
   overflow-wrap: anywhere;
}

.broadcasts-table {
   table-layout: fixed;
   min-width: 0;
}

.broadcast-inline-editable {
   cursor: pointer;
}

.broadcast-inline-editable:hover {
   background: rgba(0, 106, 168, 0.05);
}

.broadcast-inline-edit-display {
   display: block;
}

.broadcast-inline-edit-input {
   width: 100%;
   box-sizing: border-box;
   font: inherit;
   color: inherit;
   padding: 4px 6px;
   border: 1px solid var(--line);
   border-radius: 4px;
   background: var(--surface);
}

.broadcast-inline-editable[data-broadcast-inline-editing="true"] {
   cursor: text;
}

.entities-table {
   table-layout: fixed;
   width: 100%;
   min-width: 0;
}

.entities-col-name {
   width: 16%;
}

.entities-col-related {
   width: 15%;
}

.entities-col-sport {
   width: 8%;
}

.entities-col-gender {
   width: 5%;
}

.entities-col-age {
   width: 12%;
}

.entities-col-height,
.entities-col-weight {
   width: 7%;
}

.entities-col-first-club {
   width: 14%;
}

.entities-col-watch-priority {
   width: 6%;
}

.entities-col-actions {
   width: 10%;
}

.entity-list-type {
   display: block;
   color: var(--muted);
   font-size: 12px;
}

.entity-inline-editable {
   cursor: pointer;
}

.entity-inline-editable:hover {
   background: rgba(0, 106, 168, 0.05);
}

.entity-inline-edit-display {
   display: block;
}

.entity-inline-edit-input {
   width: 100%;
   box-sizing: border-box;
   font: inherit;
   color: inherit;
   padding: 4px 6px;
   border: 1px solid var(--line);
   border-radius: 4px;
   background: var(--surface);
}

.entity-inline-editable[data-entity-inline-editing="true"] {
   cursor: text;
}

.broadcasts-col-channel {
   width: 120px;
}

.broadcasts-col-time {
   width: 92px;
}

.broadcasts-col-broadcast {
   width: auto;
   min-width: 0;
}

.broadcasts-col-organization {
   width: 240px;
}

.broadcasts-col-group {
   width: 200px;
}

.broadcast-group-participants {
   display: block;
   margin-top: 4px;
   color: var(--muted);
}

.broadcast-group-participants span {
   display: block;
}

.broadcast-org-autocomplete {
   position: relative;
   min-width: 0;
}

.entity-linked-entities-field {
   display: grid;
   gap: 4px;
   margin-bottom: 10px;
   font-weight: 700;
}

.entity-linked-entities-field > span {
   font-size: 12px;
   line-height: 1.2;
}

.entity-linked-entities-picker {
   display: grid;
   gap: 8px;
   width: 100%;
   min-width: 0;
}

.entity-linked-entities-input-wrap {
   position: relative;
   width: min(280px, 100%);
   min-width: 0;
}

.entity-linked-entities-picker .broadcast-org-entity-input {
   padding: 3px 6px;
   font-size: 12px;
   line-height: 1.25;
}

.entity-linked-entities-selected {
   display: flex;
   flex-wrap: wrap;
   gap: 6px;
   min-width: 0;
}

.entity-linked-entities-chip {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   max-width: 100%;
   padding: 3px 8px;
   border: 1px solid #bed3e4;
   border-radius: 999px;
   background: #ecf5fd;
   color: #294257;
   font-size: 12px;
   line-height: 1.25;
}

.entity-linked-entities-chip > span {
   min-width: 0;
}

.entity-linked-entities-chip-remove {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   flex: 0 0 auto;
   width: 18px;
   height: 18px;
   padding: 0;
   border: 0;
   border-radius: 999px;
   background: transparent;
   color: inherit;
   font: inherit;
   font-size: 16px;
   line-height: 1;
   cursor: pointer;
}

.entity-linked-entities-chip-remove:hover,
.entity-linked-entities-chip-remove:focus-visible {
   color: var(--accent);
   outline: none;
}

.activity-participant-picker {
   position: relative;
   width: min(280px, 100%);
   margin-bottom: 8px;
}

.activity-participant-inactive {
   opacity: 0.5;
}

.activity-participant-picker .broadcast-org-entity-input {
   padding: 3px 6px;
   font-size: 12px;
   line-height: 1.25;
}

.broadcast-org-entity-input {
   width: 100%;
   min-width: 0;
   box-sizing: border-box;
   font: inherit;
   color: inherit;
   padding: 4px 6px;
   border: 1px solid var(--line);
   border-radius: 4px;
   background: var(--surface);
}

.broadcast-org-autocomplete.is-locked .broadcast-org-entity-input {
   background: #ecf5fd;
   border-color: #bed3e4;
   color: #536c81;
   cursor: not-allowed;
   opacity: 1;
   box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.broadcast-org-autocomplete.is-locked .broadcast-org-entity-input::selection {
   background: rgba(0, 106, 168, 0.18);
}

.broadcast-org-entity-suggestions {
   position: absolute;
   z-index: 20;
   top: calc(100% + 2px);
   left: 0;
   right: 0;
   display: grid;
   gap: 2px;
   max-height: 220px;
   overflow: auto;
   padding: 4px;
   border: 1px solid var(--line);
   border-radius: 6px;
   background: var(--surface);
   box-shadow: 0 14px 28px rgba(20, 22, 20, 0.14);
}

.broadcast-org-entity-suggestions[hidden] {
   display: none;
}

.broadcast-org-entity-option,
.broadcast-org-entity-empty {
   display: block;
   width: 100%;
   padding: 6px 8px;
   border: 0;
   border-radius: 4px;
   background: transparent;
   color: var(--text);
   font: inherit;
   font-size: 13px;
   line-height: 1.3;
   text-align: left;
}

.broadcast-org-entity-option {
   cursor: pointer;
}

.broadcast-org-entity-option:hover,
.broadcast-org-entity-option.is-active {
   background: rgba(0, 106, 168, 0.08);
}

.broadcasts-col-categories {
   width: 140px;
}

.broadcasts-col-actions {
   width: 64px;
}

.entities-table td {
   min-width: 0;
   overflow-wrap: anywhere;
}

.entities-table .table-actions {
   white-space: normal;
}

.entities-table .table-actions form {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 4px;
}

.entities-table .table-actions .form-status {
   max-width: 100%;
   overflow-wrap: anywhere;
}

.admin-table th,
.admin-table td {
   padding: 9px 10px;
   border-bottom: 1px solid var(--line);
   text-align: left;
   vertical-align: top;
}

.admin-table-hover tbody tr {
   transition: background-color 0.12s ease-in-out;
}

.admin-table-hover tbody tr:hover > td {
   background: #edf3ee;
}

.admin-table-hover tbody tr.activity-description-missing > td,
.admin-table-hover tbody tr.activity-description-missing:hover > td {
   background: var(--warning-bg);
}

.admin-table-hover tbody tr[data-participation-status="running"] > td {
   background: #fff6d9;
}

.admin-table-hover tbody tr[data-participation-status="pending"] > td {
   background: #eef7ff;
}

.admin-table-hover tbody tr[data-ai-run-status="running"] > td {
   background: #fff6d9;
}

.admin-table-hover tbody tr[data-ai-run-status="pending"] > td {
   background: #eef7ff;
}

.admin-table-hover
   tbody
   tr[data-participation-status="running"]:hover > td {
   background: #fbeebb;
}

.admin-table-hover
   tbody
   tr[data-participation-status="pending"]:hover > td {
   background: #ddeeff;
}

.admin-table-hover
   tbody
   tr[data-ai-run-status="running"]:hover > td {
   background: #fbeebb;
}

.admin-table-hover
   tbody
   tr[data-ai-run-status="pending"]:hover > td {
   background: #ddeeff;
}

.admin-table th {
   color: var(--muted);
   font-size: 11px;
   line-height: 1.2;
   text-transform: uppercase;
}

.admin-table th .button {
   min-height: 28px;
   padding: 0 8px;
   font-size: 12px;
   line-height: 1;
   white-space: nowrap;
}

.admin-table td span {
   display: block;
   color: var(--muted);
   font-size: 12px;
}

.broadcast-categories-list {
   display: grid;
   gap: 2px;
   min-width: 0;
}

.broadcast-categories-list span {
   display: block;
   min-width: 0;
   color: var(--text);
   overflow-wrap: anywhere;
}

.ai-runs-table {
   table-layout: fixed;
   width: 100%;
   min-width: 0;
}

.ai-runs-col-started {
   width: 140px;
}

.ai-runs-started-cell {
   white-space: nowrap;
   overflow: hidden;
}

.ai-runs-job-cell {
   white-space: nowrap;
   overflow: hidden;
}

.ai-runs-col-job {
   width: 40px;
}

.ai-runs-col-event {
   width: 180px;
}

.ai-runs-col-summary {
   width: auto;
}

.ai-runs-col-status {
   width: 82px;
}

.ai-runs-col-payload {
   width: 70px;
}

.ai-runs-col-rounds {
   width: 54px;
}

.ai-runs-col-duration {
   width: 82px;
}

.ai-runs-col-actions {
   width: 72px;
}

.ai-runs-result-cell {
   overflow-wrap: anywhere;
}

.ai-runs-environment {
   display: block;
   overflow: hidden;
   text-overflow: ellipsis;
   white-space: nowrap;
}

.ai-runs-table th,
.ai-runs-table td {
   padding: 6px 8px;
   line-height: 1.2;
}

.ai-runs-table .table-actions {
   text-align: left;
   padding-left: 4px;
   padding-right: 8px;
}

.ai-runs-table-actions {
   display: flex;
   gap: 4px;
   align-items: center;
   white-space: nowrap;
}

.ai-runs-table .table-actions a {
   display: block;
   width: auto;
   white-space: normal;
   text-align: left;
   font-size: 12px;
}

.ai-runs-table .table-actions form {
   display: block;
   width: auto;
}

.ai-runs-table .table-actions button {
   display: block;
   width: auto;
   text-align: left;
}

.admin-table input[type="checkbox"] {
   width: 16px;
   height: 16px;
}

.audit-id {
   color: var(--muted);
   font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
   overflow-wrap: anywhere;
}

.prompt-details {
   margin: 16px 0;
}

.prompt-details summary {
   cursor: pointer;
   color: var(--accent-strong);
   font-weight: 800;
}

.prompt-details pre {
   max-height: 360px;
   margin: 12px 0 0;
   overflow: auto;
   white-space: pre-wrap;
   overflow-wrap: anywhere;
   padding: 14px;
   border: 1px solid var(--line);
   border-radius: 8px;
   background: #f7faf9;
   color: var(--ink);
   font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.prompt-details-pre {
   max-height: 360px;
   margin: 0;
   overflow: auto;
   white-space: pre-wrap;
   overflow-wrap: anywhere;
   word-break: break-word;
   padding: 14px;
   border: 1px solid var(--line);
   border-radius: 8px;
   background: #f7faf9;
   color: var(--ink);
   font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.run-data-details {
   display: grid;
   gap: 12px;
}

.run-data-details > summary {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 12px;
   cursor: pointer;
   list-style: none;
   color: var(--accent-strong);
   font-size: 18px;
   font-weight: 800;
}

.run-data-details > summary::-webkit-details-marker {
   display: none;
}

.run-data-details > summary::after {
   content: "+";
   flex: 0 0 auto;
   color: var(--muted);
   font-size: 18px;
   line-height: 1;
}

.run-data-details[open] > summary::after {
   content: "−";
}

.tool-trace-summary-content {
   display: grid;
   gap: 8px;
   min-width: 0;
}

.run-tool-trace-loading,
.run-tool-trace-poll-status {
   display: flex;
   align-items: center;
   gap: 8px;
   color: var(--muted);
   font-size: 12px;
   font-weight: 700;
}

.run-tool-trace-poll-status {
   justify-content: flex-end;
   margin-bottom: 8px;
}

.run-tool-trace-spinner {
   width: 14px;
   height: 14px;
   border: 2px solid var(--line);
   border-top-color: var(--accent-strong);
   border-radius: 50%;
   animation: run-tool-trace-spin 1s linear infinite;
}

.run-tool-trace-host.is-refreshing .run-tool-trace-spinner {
   animation-duration: 0.45s;
}

.run-tool-trace-host.is-stopped .run-tool-trace-spinner {
   display: none;
}

@keyframes run-tool-trace-spin {
   to {
      transform: rotate(360deg);
   }
}

.tool-trace-summary-header {
   display: flex;
   align-items: baseline;
   justify-content: space-between;
   gap: 12px;
   min-width: 0;
}

.tool-trace-summary-count {
   flex: 0 0 auto;
   color: var(--muted);
   font-size: 13px;
   font-weight: 700;
}

.tool-trace-summary-badges {
   display: flex;
   flex-wrap: wrap;
   gap: 8px;
}

.tool-trace-badge {
   display: inline-flex;
   align-items: center;
   min-height: 24px;
   padding: 0 10px;
   border-radius: 999px;
   background: #edf2ef;
   color: var(--text);
   font-size: 11px;
   font-weight: 800;
   line-height: 1.2;
}

.tool-trace-badge-round {
   background: #e8f1ef;
   color: var(--accent-strong);
}

.tool-trace-badge-count {
   background: #f3f4f1;
   color: var(--muted);
}

.tool-trace-badge-temperature {
   background: #fff4dd;
   color: #9a5b00;
}

.tool-trace-badge-assistant {
   background: #f0f1f6;
   color: #434762;
}

.tool-trace-badge-tool {
   background: #eef4ff;
   color: #284e8d;
}

.tool-trace-badge-submit-report {
   background: #f2ecff;
   color: #5e3fb3;
}

.tool-trace-badge-result {
   background: #edf7ee;
   color: #2c6b38;
}

.tool-trace-badge-finish {
   background: #fff1df;
   color: var(--warning);
}

.tool-trace-list {
   display: grid;
   gap: 10px;
}

.tool-trace-turn {
   display: grid;
   gap: 8px;
   padding: 10px 12px;
   border: 1px solid var(--line);
   border-radius: 10px;
   background: var(--surface);
}

.tool-trace-turn-header {
   display: grid;
   gap: 6px;
}

.tool-trace-turn-header-main {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   justify-content: space-between;
   gap: 6px;
}

.tool-trace-turn-label {
   display: inline-flex;
   align-items: center;
   min-height: 24px;
   padding: 0 8px;
   border-radius: 999px;
   background: #e8f1ef;
   color: var(--accent-strong);
   font-size: 11px;
   font-weight: 800;
   text-transform: uppercase;
}

.tool-trace-turn-badges {
   display: flex;
   flex-wrap: wrap;
   gap: 6px;
}

.tool-trace-turn-details {
   display: grid;
   gap: 8px;
}

.tool-trace-turn-details > summary {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 6px;
   width: 100%;
   min-height: 24px;
   margin: 0;
   cursor: pointer;
   list-style: none;
   color: var(--muted);
   font-size: 11px;
   font-weight: 800;
   text-transform: uppercase;
}

.tool-trace-turn-details > summary::-webkit-details-marker {
   display: none;
}

.tool-trace-turn-details > summary::after {
   content: "+";
   flex: 0 0 auto;
   color: var(--muted);
   font-size: 16px;
   line-height: 1;
}

.tool-trace-turn-details[open] > summary::after {
   content: "−";
}

.tool-trace-block {
   display: grid;
   gap: 6px;
}

.tool-trace-block-label {
   color: var(--muted);
   font-size: 11px;
   font-weight: 800;
   text-transform: uppercase;
}

.tool-trace-items {
   display: grid;
   gap: 8px;
}

.tool-trace-item {
   display: grid;
   gap: 6px;
   padding: 8px 10px;
   border: 1px solid var(--line);
   border-radius: 8px;
   background: #fbfcfb;
}

.tool-trace-item-title {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 8px;
   color: var(--muted);
   font-size: 11px;
   font-weight: 700;
}

.tool-trace-item-title code {
   color: var(--accent-strong);
   font-weight: 800;
}

.tall-textarea {
   min-height: 200px;
   height: 200px;
}

.medium-textarea {
   min-height: 95px !important;
   height: 95px !important;
}

.proposal-summary {
   display: grid;
   grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
   gap: 24px;
}

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

.detail-grid div {
   min-width: 0;
}

.detail-grid dt {
   color: var(--muted);
   font-size: 12px;
   font-weight: 800;
   text-transform: uppercase;
}

.detail-grid dd {
   margin: 2px 0 0;
   overflow-wrap: anywhere;
   font-weight: 700;
}

.run-execution-environment-form {
   display: flex;
   flex-wrap: nowrap;
   gap: 8px;
   align-items: center;
}

.run-execution-environment-form select {
   width: 220px;
   max-width: 100%;
   min-width: 0;
   flex: 0 0 220px;
}

.run-execution-environment-form .button {
   flex: 0 0 auto;
}

.review-actions {
   display: grid;
   gap: 18px;
}

.reject-form {
   display: grid;
   gap: 12px;
   padding-top: 18px;
   border-top: 1px solid var(--line);
}

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

.status-pill {
   display: inline-flex;
   min-width: 70px;
   justify-content: center;
   padding: 3px 8px;
   border-radius: 999px;
   background: #eef4f2;
   color: var(--accent-strong) !important;
   font-weight: 800;
}

.status-pill-positive {
   background: #e4f4ea;
   color: #15603b !important;
}

.status-pill-neutral {
   background: #eef4f2;
   color: var(--accent-strong) !important;
}

.status-pill-warning {
   background: var(--warning-bg);
   color: var(--warning) !important;
}

.broadcast-ai-check-runs {
   display: block;
   width: 100%;
   min-width: 0;
}

.broadcast-ai-check-runs-head th {
   width: 100%;
   padding: 0 0 8px;
   border: 0;
   background: transparent;
}

.broadcast-ai-check-runs-body {
   width: 100%;
}

.broadcast-ai-check-runs-summary-bar {
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 12px;
   width: 100%;
   color: var(--accent-strong);
   font: inherit;
   font-size: 12px;
   font-weight: 800;
   line-height: 1.2;
}

.broadcast-ai-check-runs-summary-text {
   min-width: 0;
   overflow-wrap: anywhere;
}

.broadcast-ai-check-runs-summary-text.tool-trace-badge {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   padding-top: 2px;
   padding-bottom: 2px;
   line-height: 1;
}

.broadcast-ai-check-runs-summary-actions {
   display: inline-flex;
   align-items: center;
   gap: 8px;
   margin-left: auto;
}

.broadcast-ai-check-toggle {
   min-height: 28px;
   min-width: 30px;
   padding: 0 10px;
   font-size: 12px;
}

.broadcast-participation-main-row > td {
   vertical-align: top;
   border-bottom: 0;
}

.broadcast-participation-runs-row > td {
   padding-top: 0;
   border-top: 0;
}

.broadcast-participation-spacer {
   padding: 0 10px;
   border-bottom: 0;
}

.broadcast-participation-runs-cell {
   padding-left: 0;
   padding-right: 0;
}

.broadcast-participation-runs-cell .broadcast-ai-check-runs {
   padding-right: 10px;
}

.broadcast-ai-check-runs-table {
   width: 100%;
   border-collapse: collapse;
   table-layout: auto;
}

.broadcast-ai-check-runs-body > tr > td {
   padding-top: 4px;
   vertical-align: top;
   min-width: 0;
}

.broadcast-ai-check-runs-body > tr:first-child > td {
   padding-top: 0;
}

.broadcast-ai-check-summary-cell {
   width: 96px;
   max-width: 96px;
   padding-right: 12px;
}

.broadcast-ai-check-participants-cell {
   width: 160px;
   min-width: 160px;
   max-width: 160px;
   padding-right: 12px;
   white-space: normal;
}

.broadcast-ai-check-sources-cell {
   width: auto;
   min-width: 0;
   padding-right: 12px;
}

.broadcast-ai-check-activity-cell {
   width: auto;
   min-width: 0;
   padding-right: 12px;
}

.broadcast-ai-check-activity-links {
   display: flex;
   flex-direction: column;
   align-items: flex-end;
   gap: 2px;
   width: 100%;
}

.broadcast-ai-check-activity-link {
   display: flex;
   justify-content: flex-end;
   width: 100%;
}

.broadcast-ai-check-archive-form {
   display: flex;
   justify-content: flex-end;
   width: 100%;
   margin: 0;
}

.broadcast-ai-check-archive-link {
   display: inline-block;
   padding: 0;
   border: 0;
   background: none;
   color: var(--accent);
   font: inherit;
   font-size: 13px;
   font-weight: 400;
   line-height: 1.2;
   cursor: pointer;
   white-space: nowrap;
}

.broadcast-ai-check-archive-link:hover {
   color: var(--accent-strong);
   text-decoration: underline;
}

.broadcast-ai-check {
   display: block;
   min-width: 0;
}

.broadcast-ai-check-line {
   display: flex;
   flex-wrap: wrap;
   align-items: center;
   gap: 8px;
   min-width: 0;
}

.broadcast-ai-check-participants {
   display: inline-grid;
   gap: 2px;
   color: var(--muted);
   overflow-wrap: anywhere;
   min-width: 0;
   width: fit-content;
   max-width: 100%;
   justify-items: start;
}

.broadcast-ai-check-participant-row {
   display: flex;
   align-items: center;
   gap: 8px;
   flex-wrap: wrap;
}

.broadcast-ai-check-participant-row > a,
.broadcast-ai-check-participant-row > span {
   white-space: nowrap;
}

.broadcast-ai-check-participant-row .ses-entity-search-link {
   margin-left: 0;
}

.broadcast-ai-check-participant-link {
   color: var(--accent);
   text-decoration: underline;
}

.broadcast-ai-check-participant-link:hover {
   text-decoration: underline;
}

.broadcast-ai-check-participant-create-form {
   display: inline-flex;
   margin: 0;
}

.broadcast-ai-check-participant-create-button {
   min-width: 24px;
   min-height: 24px;
   padding: 0 6px;
   border: 1px solid var(--line);
   border-radius: 999px;
   background: var(--surface);
   color: var(--accent-strong);
   font: inherit;
   font-size: 14px;
   font-weight: 800;
   line-height: 1;
   cursor: pointer;
}

.broadcast-ai-check-participant-create-button:hover {
   border-color: var(--accent);
   background: rgba(0, 108, 103, 0.06);
}

.broadcast-ai-check-sources {
   color: var(--muted);
   font-size: 12px;
   min-width: 0;
   display: block;
}

.broadcast-ai-check-sources-list {
   display: grid;
   gap: 2px;
   min-width: 0;
   overflow-wrap: anywhere;
}

.broadcast-ai-check-sources-list a {
   display: block;
   width: 100%;
   min-width: 0;
   color: var(--accent);
}

.broadcast-ai-check-sources-list a:hover {
   text-decoration: underline;
}

.broadcast-ai-check-empty {
   color: var(--muted);
}

.broadcast-ai-check-pending {
   color: var(--muted);
   font-style: italic;
}

.broadcast-ai-check-error {
   color: var(--warning);
   overflow-wrap: anywhere;
}

.broadcast-ai-check-retry {
   min-height: 28px;
   font-size: 12px;
}

.table-actions {
   text-align: right !important;
   white-space: nowrap;
}

.table-actions-stack {
   display: flex;
   flex-direction: column;
   align-items: flex-end;
   gap: 5px;
}

.table-actions-primary {
   display: flex;
   align-items: center;
   gap: 8px;
   justify-content: flex-end;
}

.table-actions a.broadcast-activity-link {
   display: inline-block;
   color: var(--accent-strong);
   font-size: 11px;
   font-weight: 800;
   line-height: 1.2;
}

.table-actions a.broadcast-activity-link:hover {
   color: var(--accent-strong);
   text-decoration: underline;
}

.table-actions form {
   display: inline-block;
}

.table-actions .form-status {
   min-height: 0;
   font-size: 11px;
   line-height: 1.2;
}

.table-actions button {
   display: inline-block;
   padding: 0;
   border: 0;
   background: transparent;
   color: var(--warning);
   font: inherit;
   font-size: 11px;
   font-weight: 800;
   line-height: 1.2;
   cursor: pointer;
}

.table-actions button.broadcast-participation-check-link {
   color: var(--accent);
}

.table-actions button.broadcast-participation-check-link:hover,
.table-actions button.broadcast-participation-check-link:focus-visible {
   color: var(--accent-strong);
}

.edit-form {
   display: grid;
   gap: 12px;
}

.form-section,
.login-panel {
   padding: 14px;
   border: 1px solid var(--line);
   border-radius: 4px;
   background: var(--surface);
   margin: 0px;
}

.form-section h2,
.login-panel h1 {
   margin-bottom: 12px;
}

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

.activity-time-fields {
   display: grid;
   grid-template-columns: repeat(2, minmax(0, 1fr));
   gap: 10px;
}

.activity-group-description-options {
   margin: -8px 0 10px;
   color: var(--muted);
   font-size: 11px;
   line-height: 1.3;
}

.activity-source-add-row {
   display: flex;
   align-items: flex-end;
   gap: 10px;
   margin-top: 14px;
}

.activity-source-add-row label {
   flex: 1;
   margin-bottom: 0;
}

.ai-runs-filter-grid {
   grid-template-columns:
      160px minmax(220px, 280px) 160px minmax(0, 1fr);
   align-items: end;
   justify-content: start;
   gap: 12px;
}

.ai-runs-filter-grid label {
   margin-bottom: 0;
}

.ai-runs-status-select {
   height: 32px;
   min-height: 32px;
   padding-right: 32px;
   overflow: hidden;
   white-space: nowrap;
   text-overflow: ellipsis;
   appearance: none;
   -webkit-appearance: none;
   -moz-appearance: none;
   background-image:
      linear-gradient(45deg, transparent 50%, var(--muted) 50%),
      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
   background-position:
      calc(100% - 15px) 13px,
      calc(100% - 10px) 13px;
   background-size: 5px 5px;
   background-repeat: no-repeat;
   cursor: pointer;
}

label {
   display: grid;
   gap: 4px;
   margin-bottom: 10px;
   font-weight: 700;
}

label span {
   font-size: 12px;
   line-height: 1.2;
}

.field-validation-error,
.validation-summary-errors {
   color: #8c2d2d;
   font-size: 12px;
   font-weight: 800;
   line-height: 1.3;
}

.field-validation-valid,
.validation-summary-valid {
   display: none;
}

.field-validation-error {
   display: block;
   margin-top: 2px;
}

.validation-summary-errors {
   display: grid;
   gap: 4px;
   margin-bottom: 14px;
}

.validation-summary-errors ul {
   margin: 0;
   padding-left: 18px;
}

input.input-validation-error,
select.input-validation-error,
textarea.input-validation-error {
   border-color: #d38f8f;
   background: #fff7f7;
}

input,
select,
textarea {
   width: 100%;
   min-height: 32px;
   padding: 5px 8px;
   border: 1px solid var(--line);
   border-radius: 3px;
   background: var(--subgrid-row);
   color: var(--text);
   font: inherit;
   font-size: 13px;
   line-height: 1.25;
}

input:focus,
select:focus,
textarea:focus {
   border-color: var(--accent);
   outline: 2px solid var(--subgrid-header);
   background: var(--subgrid-row-hover);
}

input[readonly],
select:disabled {
   background: #eceff0;
   color: #687276;
   cursor: not-allowed;
   opacity: 0.8;
}

.admin-date-field {
   position: relative;
}

.admin-date-stepper {
   position: absolute;
   top: calc(100% + 1px);
   left: 0;
   right: 0;
   z-index: 1;
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 4px;
   min-width: 0;
   margin: 0;
   padding: 0;
   font-size: 10px;
   line-height: 1;
   pointer-events: none;
}

.admin-date-stepper-button {
   padding: 0;
   border: 0;
   background: transparent;
   color: var(--accent-strong);
   font: inherit;
   font-size: 10px;
   font-weight: 800;
   line-height: 1;
   cursor: pointer;
   pointer-events: auto;
}

.admin-date-stepper-button:hover {
   color: var(--accent);
}

.admin-date-stepper-clear {
   color: var(--muted);
   font-size: 9px;
   font-weight: 700;
   text-decoration: underline;
   text-underline-offset: 2px;
}

.admin-date-stepper-clear:hover,
.admin-date-stepper-clear:focus-visible {
   color: var(--accent);
}

.admin-date-stepper-button:focus-visible {
   outline: 2px solid var(--subgrid-header);
   outline-offset: 1px;
}

textarea {
   min-height: 88px;
   resize: vertical;
}

.edit-form textarea {
   min-height: 28px;
   height: 28px;
   resize: vertical;
   overflow: auto;
}

.edit-form textarea.tall-textarea {
   min-height: 200px;
   height: 200px;
}

.multi-select-row {
   display: flex;
   align-items: flex-start;
   gap: 8px;
}

.multi-select-row .multi-select {
   flex: 1 1 auto;
   min-width: 0;
}

.multi-select-clear {
   flex: 0 0 auto;
   min-height: 32px;
   padding: 5px 12px;
   border: 1px solid var(--line);
   border-radius: 3px;
   background: #ffffff;
   color: var(--text);
   font: inherit;
   font-size: 13px;
   font-weight: 700;
   line-height: 1.25;
   cursor: pointer;
}

.multi-select-clear:disabled {
   opacity: 0.5;
   cursor: not-allowed;
}

.multi-select-clear:not(:disabled):hover,
.multi-select-clear:not(:disabled):focus-visible {
   border-color: var(--accent);
   outline: none;
}

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

.check-row {
   display: flex;
   align-items: center;
   gap: 6px;
   margin: 0;
   height: 32px;
}

.check-row input {
   width: 16px;
   min-height: 16px;
}

.login-panel {
   max-width: 420px;
   margin: 40px auto;
}

.dashboard-section {
   margin-top: 32px;
}

.dashboard-section-heading {
   display: flex;
   align-items: flex-end;
   justify-content: space-between;
   gap: 16px;
   margin-bottom: 12px;
}

.dashboard-section-heading h2,
.dashboard-section-heading p {
   margin-bottom: 0;
}

.dashboard-section-heading p,
.page-heading p {
   color: var(--muted);
}

.dashboard-date-table th,
.dashboard-date-table td {
   text-align: right;
}

.dashboard-date-table .dashboard-date-label {
   text-align: left;
}

.admin-table-hover tbody tr.dashboard-attention-row > td {
   background: var(--warning-bg);
}

.admin-table-hover tbody tr.dashboard-attention-row-light > td {
   background: #fff8d6;
}

.admin-table-hover tbody tr.dashboard-attention-row:hover > td,
.admin-table-hover tbody tr.dashboard-attention-row-light:hover > td {
   background: #edf3ee;
}

.dashboard-issue-list {
   display: flex;
   flex-wrap: wrap;
   gap: 6px;
}

.dashboard-health-grid {
   display: grid;
   grid-template-columns: repeat(2, minmax(0, 1fr));
   gap: 16px;
}

.dashboard-health-card {
   padding: 12px;
   border: 1px solid var(--line);
   border-radius: 8px;
   background: var(--surface);
}

.dashboard-health-card h3 {
   margin-top: 0;
   margin-bottom: 6px;
   font-size: 15px;
}

.dashboard-health-count {
   display: inline-block;
   font-size: 15px;
   font-weight: 800;
   text-decoration: underline;
   text-underline-offset: 2px;
}

.dashboard-health-count-pending {
   color: var(--accent);
}

.dashboard-health-count-running {
   color: #b07a00;
}

.dashboard-health-count-failed {
   color: #8c2d2d;
}

.dashboard-health-ok {
   margin-bottom: 6px;
   color: #28733f;
   font-weight: 700;
}

.dashboard-health-list {
   margin: 0;
}

.dashboard-health-list div {
   display: flex;
   justify-content: space-between;
   gap: 16px;
   padding: 4px 0;
   border-top: 1px solid var(--line);
   line-height: 1.25;
}

.dashboard-health-list dt {
   color: var(--muted);
}

.dashboard-health-list dd {
   margin: 0;
   font-weight: 700;
   text-align: right;
}

@media (max-width: 720px) {
   .page-heading-row,
   .form-actions {
      align-items: flex-start;
      flex-direction: column;
   }

   .site-header {
      align-items: stretch;
      flex-direction: column;
      padding:
         calc(10px + env(safe-area-inset-top, 0px))
         calc(16px + env(safe-area-inset-right, 0px))
         10px
         calc(16px + env(safe-area-inset-left, 0px));
   }

   .site-header-main {
      align-items: flex-start;
      flex-direction: column;
      gap: 8px;
   }

   .admin-layout,
   .proposal-summary,
   .form-grid,
   .detail-grid,
   .dashboard-health-grid {
      grid-template-columns: 1fr;
   }

   .dashboard-section-heading {
      align-items: flex-start;
      flex-direction: column;
   }

   h1 {
      font-size: 28px;
   }
}

.ses-expand {
   width: 100% !important;
   text-align: center !important;
}

.ses-expand > button {
   width: 100% !important;
}

.ses-icon-search {
   display: inline-block;
   width: 0.85em;
   height: 0.85em;
   border: 0.14em solid currentColor;
   border-radius: 50%;
   position: relative;
   box-sizing: border-box;
}

   .ses-icon-search::after {
      content: "";
      position: absolute;
      width: 0.45em;
      height: 0.14em;
      background: currentColor;
      right: -0.34em;
      bottom: -0.12em;
      transform: rotate(45deg);
   }

.ses-entity-search-link {
   display: inline-flex;
   align-items: center;
   margin-left: 0.45rem;
   line-height: 1;
}

.ses-entity-search-link-missing {
   justify-content: center;
   width: 1.5rem;
   height: 1.5rem;
   margin-left: 0;
   border: 1px solid #e5bd75;
   border-radius: 999px;
   background: #fff7e5;
   color: #a86419;
   transition:
      background 120ms ease,
      border-color 120ms ease,
      transform 120ms ease;
}

.ses-entity-search-link-missing:hover {
   border-color: #ce8a35;
   background: #ffedc7;
   color: #8b4a0b;
   transform: translateY(-1px);
}

.ses-entity-search-link-missing:focus-visible {
   outline: 2px solid #bd6500;
   outline-offset: 2px;
}

.ses-nowrap {
   text-wrap: nowrap;
}
