/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #18211f;
  background: #f4f2ec;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.app-body { min-height: 100vh; background: #f2f1eb; }
.app-frame { min-height: 100vh; display: grid; grid-template-columns: 16.5rem minmax(0, 1fr); }
.app-sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; justify-content: space-between; padding: 2rem 1.25rem 1.4rem; background: #102821; color: #eef5f1; }
.brand-lockup { display: flex; align-items: center; min-height: 3rem; padding: 0 .75rem; text-decoration: none; }
.brand-lockup > span { display: grid; gap: .1rem; }
.brand-lockup strong { letter-spacing: .22em; font-size: 1.05rem; }
.brand-lockup small { color: #9fb5ad; font-size: .68rem; letter-spacing: .04em; }
.primary-nav { display: grid; gap: .35rem; margin-top: 2.5rem; }
.primary-nav a { position: relative; padding: .8rem .9rem; border-radius: .6rem; color: #b9cbc5; font-size: .92rem; font-weight: 650; text-decoration: none; }
.primary-nav a:hover { background: rgb(255 255 255 / .06); color: white; }
.primary-nav a.active { background: #f0b84d; color: #1d251d; }
.sidebar-footer { display: grid; gap: .65rem; padding: 0 .75rem; color: #a9beb7; font-size: .75rem; }
.sidebar-footer p { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.environment-badge, .status-dot-label { display: inline-flex; align-items: center; gap: .45rem; }
.environment-badge span, .status-dot-label span, .status-chip span { width: .45rem; height: .45rem; border-radius: 50%; background: #50bd87; box-shadow: 0 0 0 .18rem rgb(80 189 135 / .14); }
.quiet-button { border: 0; padding: 0; background: transparent; color: #d6e3df; cursor: pointer; text-align: left; }
.app-main { min-width: 0; }
.mobile-bar { display: none; }
.operator-shell { padding: clamp(1rem, 4vw, 4rem); max-width: 80rem; margin: 0 auto; }
.operator-shell.narrow { max-width: 44rem; }
.operator-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.operator-heading h1, .hero-panel h1, .section-heading h2 { margin: .2rem 0 0; letter-spacing: -.035em; }
.heading-actions, .hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; }
.primary-action, .secondary-action { display: inline-flex; align-items: center; justify-content: center; min-height: 2.7rem; border: 1px solid transparent; border-radius: .55rem; padding: .68rem 1rem; text-decoration: none; font-weight: 700; cursor: pointer; }
.primary-action { background: #173f35; color: white; box-shadow: 0 .35rem 1rem rgb(23 63 53 / .18); }
.primary-action:hover { background: #0f332b; }
.primary-action.compact { min-height: 2.2rem; padding: .45rem .75rem; }
.secondary-action { border-color: #cfd4ce; background: #fff; color: #20332e; }
.secondary-action:hover { border-color: #9ba7a1; background: #fafbf9; }
.text-link { color: #285e50; font-size: .86rem; font-weight: 700; text-underline-offset: .18rem; }
.page-lead { max-width: 42rem; color: #63706b; font-size: 1.02rem; line-height: 1.65; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; }
.data-table th, .data-table td { text-align: left; padding: .75rem; border-bottom: 1px solid #cbd0cc; }
.operator-form { display: grid; gap: .75rem; }
.operator-form input, .operator-form select, .operator-form textarea { padding: .65rem; font: inherit; }
.operator-form fieldset { display: grid; gap: .5rem; }
.run-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; }
.run-summary div { padding: 1rem; background: white; border: 1px solid #daddd9; }
.run-summary dt { color: #626c68; font-size: .8rem; }.run-summary dd { margin: .3rem 0 0; font-weight: 650; }
.run-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0; }
.inline-form { display: flex; gap: .5rem; }.status-chip { display: inline-flex; align-items: center; gap: .45rem; padding: 0; background: transparent; border: 0; border-radius: 0; color: #285547; font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.status-chip--draft span, .status-chip--reserved span, .status-chip--allocated span { background: #d29c36; box-shadow: 0 0 0 .18rem rgb(210 156 54 / .14); }
.status-chip--failed span, .status-chip--cancelled span { background: #b75e65; box-shadow: 0 0 0 .18rem rgb(183 94 101 / .14); }

.dashboard-shell { max-width: 92rem; }
.hero-panel { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(20rem, .8fr); gap: clamp(2rem, 5vw, 5rem); align-items: end; padding: clamp(1.6rem, 4vw, 3.4rem); border-radius: 1.25rem; background: #e4e0d2; border: 1px solid #d8d2c1; box-shadow: inset 0 1px rgb(255 255 255 / .55); }
.hero-panel h1 { max-width: 12ch; font-size: clamp(2.4rem, 5vw, 4.8rem); line-height: .98; }
.hero-actions { margin-top: 1.5rem; }
.arena-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border: 1px solid rgb(29 63 53 / .18); border-radius: .85rem; overflow: hidden; background: rgb(255 255 255 / .5); }
.arena-stats div { display: grid; gap: .25rem; padding: 1rem; border-right: 1px solid rgb(29 63 53 / .14); }
.arena-stats div:last-child { border: 0; }
.arena-stats dt { color: #65736d; font-size: .72rem; }
.arena-stats dd { margin: 0; font-size: 1.65rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.dashboard-section { margin-top: 2.8rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-heading h2 { font-size: clamp(1.35rem, 2vw, 1.8rem); }
.section-heading .eyebrow { margin: 0; }
.match-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.match-card { display: grid; gap: 1.25rem; min-height: 17rem; padding: 1.25rem; border: 1px solid #d8dcd6; border-radius: .9rem; background: #fff; box-shadow: 0 .5rem 1.5rem rgb(31 48 42 / .05); }
.match-card-topline { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.match-card-topline time { color: #79817e; font-size: .75rem; }
.versus-lockup { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: .7rem; min-height: 4.5rem; }
.versus-lockup span { font-weight: 760; line-height: 1.2; }
.versus-lockup span:last-child { text-align: right; }
.versus-lockup b { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: #f0eadc; color: #7c6750; font-size: .68rem; }
.match-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0; }
.match-meta div { min-width: 0; }
.match-meta dt { color: #858d89; font-size: .67rem; text-transform: uppercase; letter-spacing: .04em; }
.match-meta dd { margin: .2rem 0 0; overflow: hidden; text-overflow: ellipsis; font-size: .77rem; font-weight: 650; }
.match-link { display: flex; justify-content: center; align-items: center; min-height: 2.6rem; align-self: end; border-radius: .5rem; background: #173f35; color: white; text-decoration: none; font-size: .84rem; font-weight: 720; }
.empty-state { padding: 2.25rem; border: 1px dashed #c8cec8; border-radius: .9rem; background: rgb(255 255 255 / .45); text-align: center; }
.empty-state h2, .empty-state h3 { margin-top: 0; }
.empty-state p, .empty-copy { color: #74807b; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.competitor-list, .compact-match-list { overflow: hidden; border: 1px solid #d8dcd6; border-radius: .85rem; background: #fff; }
.competitor-row, .compact-match-list a { display: grid; align-items: center; gap: .85rem; padding: .95rem 1rem; border-bottom: 1px solid #e7e9e5; text-decoration: none; }
.competitor-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.competitor-row:last-child, .compact-match-list a:last-child { border-bottom: 0; }
.competitor-row:hover, .compact-match-list a:hover { background: #fafbf9; }
.competitor-row > span:nth-child(2), .compact-match-list a > span:first-child { display: grid; min-width: 0; gap: .18rem; }
.competitor-row small, .compact-match-list small { overflow: hidden; color: #76807c; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.provider-orb { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: .6rem; background: #dbe8e3; color: #1e5143; font-size: .76rem; font-weight: 800; }
.provider-orb--stockfish { background: #eee3cd; color: #725625; }
.status-dot-label { color: #547065; font-size: .7rem; font-weight: 700; }
.compact-match-list a { grid-template-columns: minmax(0, 1fr) auto; }
.compact-match-list a > span:last-child { color: #2f6657; font-size: .75rem; font-weight: 720; }
.compact-match-list .empty-copy, .competitor-list .empty-copy { margin: 0; padding: 1.5rem; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 1rem; }
.model-card { display: grid; gap: 1.25rem; padding: 1.2rem; border: 1px solid #d8dcd6; border-radius: .8rem; background: #fff; }
.model-card h2 { margin: .75rem 0 .35rem; font-size: 1rem; overflow-wrap: anywhere; }
.model-card p { color: #74807b; font-size: .78rem; }
.provider-mark { display: inline-flex; padding: .25rem .5rem; border-radius: .35rem; background: #e2ece8; color: #2a5b4d; font-size: .68rem; font-weight: 750; }
.match-builder-shell { max-width: 68rem; }
.match-builder-shell .operator-form { gap: 1rem; }
.form-panel { padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid #d8dcd6; border-radius: .9rem; background: #fff; box-shadow: 0 .35rem 1.2rem rgb(31 48 42 / .04); }
.form-panel-heading { display: flex; align-items: flex-start; gap: .85rem; margin-bottom: 1.4rem; }
.form-panel-heading > span { display: grid; place-items: center; flex: 0 0 2rem; width: 2rem; height: 2rem; border-radius: 50%; background: #173f35; color: white; font-size: .78rem; font-weight: 800; }
.form-panel-heading h2 { margin: 0; font-size: 1.15rem; }
.form-panel-heading p { margin: .2rem 0 0; color: #77817d; font-size: .8rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid .full-span { grid-column: 1 / -1; }
.form-grid > div:not(.form-panel-heading) { display: grid; align-content: start; gap: .4rem; }
.operator-form label { color: #34453f; font-size: .78rem; font-weight: 720; }
.operator-form input, .operator-form select, .operator-form textarea { width: 100%; min-height: 2.75rem; border: 1px solid #cbd1cb; border-radius: .5rem; background: #fbfcfa; color: #17231f; }
.operator-form input:focus, .operator-form select:focus, .operator-form textarea:focus { outline: 3px solid rgb(41 102 84 / .18); border-color: #296654; }
.competitor-picker { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem !important; padding: 0; border: 0; }
.competitor-picker > div { position: relative; display: grid; grid-template-columns: auto 1fr; gap: .65rem; align-items: center; min-height: 3.7rem; padding: .85rem; border: 1px solid #d3d8d2; border-radius: .65rem; background: #fafbf9; }
.competitor-picker > div:has(input:checked) { border-color: #296654; background: #edf5f1; box-shadow: inset 0 0 0 1px #296654; }
.competitor-picker input { width: 1rem; min-height: auto; height: 1rem; accent-color: #1d5b4a; }
.competitor-picker label { font-size: .84rem; cursor: pointer; }
.clock-panel { background: #f0eadc; border-color: #dfd3bd; }
.clock-input input { font-size: 1.6rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.clock-input small { color: #7b7060; font-size: .7rem; }
.form-submit-bar { position: sticky; bottom: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border: 1px solid #ccd2cc; border-radius: .75rem; background: rgb(255 255 255 / .92); box-shadow: 0 .8rem 2rem rgb(28 46 40 / .14); backdrop-filter: blur(.6rem); }
.form-submit-bar p { margin: 0; color: #6c7873; font-size: .76rem; }

.spectator-shell { padding: clamp(1rem, 3vw, 3rem); }
.spectator-header { display: flex; justify-content: space-between; gap: 2rem; align-items: end; }
.eyebrow { color: #626c68; text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; }
.status-list { display: flex; gap: 1.5rem; margin: 0; }
.status-list div { display: grid; gap: .2rem; }
.status-list dt { color: #626c68; font-size: .75rem; }
.status-list dd { margin: 0; font-weight: 650; }
.veyra-clock { min-width: 8.5rem; padding: .65rem .8rem; border-radius: .55rem; background: #173f35; color: white; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12); }
.veyra-clock dt { color: #a9c8bd !important; }
.veyra-clock dd { margin-top: .15rem; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.veyra-clock dd small { color: #a9c8bd; font-size: .68rem; font-weight: 600; }
.veyra-clock.is-urgent { background: #8c353d; }
.spectator-grid { display: grid; grid-template-columns: minmax(38rem, 1.7fr) minmax(20rem, 1fr); gap: clamp(1rem, 3vw, 3rem); margin-top: 2rem; align-items: start; }
.spectator-board-stage {
  position: relative;
  display: grid;
  width: min(100%, 42rem);
  aspect-ratio: 1;
  place-items: center;
}
.spectator-board-stage > [data-spectator-board-mount],
.spectator-board-stage > .board-loading-skeleton { grid-area: 1 / 1; width: 100%; height: 100%; }
.spectator-board [data-spectator-board-mount] { width: 100%; aspect-ratio: 1; }
.board-text-fallback { margin-top: 1rem; }
.perspective-pair { display: grid; grid-template-columns: repeat(2, minmax(16rem, 1fr)); gap: clamp(1rem, 2vw, 2rem); align-items: start; }
.perspective-pair + [data-attempt-replay-target="analysisPanel"] { margin-top: 2rem; }
.perspective-note { min-height: 2.8em; margin: -.35rem 0 .7rem; color: #626c68; font-size: .8rem; line-height: 1.35; }
.veyra-board h2, .spectator-board h2 { margin-bottom: .75rem; }
.veyra-chessground-stage { width: 100%; aspect-ratio: 1; }
.veyra-token { --token-fill: #d89c2f; --token-ink: #3c2b0f; position: relative; display: grid; place-items: center; width: 72%; height: 72%; z-index: 1; filter: drop-shadow(0 .08rem .08rem rgb(0 0 0 / .22)); }
.veyra-token--slate { --token-fill: #45535d; --token-ink: #f4f2ec; }
.veyra-token-mark, .veyra-token-mark::before, .veyra-token-mark::after { box-sizing: border-box; display: block; content: ""; }
.veyra-token-mark { width: 68%; height: 68%; background: var(--token-fill); border: .16rem solid var(--token-ink); }
.veyra-token--nexus .veyra-token-mark { border-radius: 50%; background: radial-gradient(circle, var(--token-ink) 0 18%, var(--token-fill) 20% 48%, var(--token-ink) 50% 59%, var(--token-fill) 61%); }
.veyra-token--vector .veyra-token-mark { transform: rotate(45deg); border-radius: 12%; }
.veyra-token--vector .veyra-token-mark::after { width: 100%; height: 100%; background: var(--token-fill); border: .16rem solid var(--token-ink); transform: rotate(45deg); }
.veyra-token--tower .veyra-token-mark { border-radius: 8%; box-shadow: inset 0 .38rem 0 var(--token-ink); }
.veyra-token--prism .veyra-token-mark { transform: rotate(45deg) scale(.78); border-radius: 50% 8% 50% 8%; }
.veyra-token--hopper .veyra-token-mark { width: 58%; height: 68%; border: 0; border-left: .42rem solid var(--token-ink); border-bottom: .42rem solid var(--token-ink); background: transparent; }
.veyra-token--scout .veyra-token-mark { width: 58%; height: 58%; border-radius: 50%; }
.veyra-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem .7rem; list-style: none; padding: .65rem; margin: .7rem 0 .4rem; background: #fff; border: 1px solid #cbd0cc; border-radius: .35rem; }
.veyra-legend li { display: flex; align-items: center; gap: .35rem; min-width: 0; font-size: .75rem; }
.veyra-legend .veyra-token { flex: 0 0 1.6rem; width: 1.6rem; height: 1.6rem; filter: none; }
.veyra-team-key { display: flex; align-items: center; gap: .35rem; margin: .35rem 0; color: #56605c; font-size: .8rem; }
.team-swatch { width: .85rem; height: .85rem; border-radius: 50%; border: 1px solid #28312e; background: #d89c2f; }.team-swatch--slate { margin-left: .5rem; background: #45535d; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.event-timeline { list-style: none; padding: 0; margin: 0; border-top: 1px solid #cbd0cc; }
.event-timeline li { display: grid; grid-template-columns: 3rem minmax(8rem, 1fr) auto auto; gap: .75rem; padding: .8rem 0; border-bottom: 1px solid #cbd0cc; }
.event-sequence, .event-timeline time { color: #626c68; font-variant-numeric: tabular-nums; }
.event-timeline li[data-branch-kind="analysis"] { border-left: .25rem dashed #7b5a9b; padding-left: .6rem; }
.event-timeline li[data-branch-kind="commitment"] { border-left: .25rem solid #1d6654; padding-left: .6rem; }
.event-timeline li[aria-current="step"] { background: #e6ede9; }
.event-kind { border: 1px solid #aab3af; border-radius: 999px; padding: .12rem .45rem; font-size: .72rem; align-self: center; }
.replay-controls { display: grid; grid-template-columns: repeat(5, max-content) 1fr; align-items: center; gap: .5rem; margin: 0 0 1rem; }
.replay-controls button, .replay-controls select { font: inherit; padding: .4rem .55rem; }
.replay-controls input[type="range"] { grid-column: 1 / -1; width: 100%; }
.agent-report { margin: 0 0 1rem; border: 1px solid #c8ceca; border-radius: .35rem; background: #fff; }
.agent-report > summary { cursor: pointer; padding: .75rem 1rem; font-weight: 650; }
.translation-notice { margin: 0; padding: .75rem 1rem; border-top: 1px solid #e1e4e2; color: #56605c; }
.agent-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: #e1e4e2; border-top: 1px solid #e1e4e2; }
.agent-report-grid section { background: #fff; padding: 1rem; }
.agent-report-grid h3 { margin-top: 0; font-size: .9rem; }
.agent-report-grid p { white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-report-grid small { color: #56605c; }
.event-detail { margin: 0 0 1rem; padding: .85rem 1rem; border: 1px solid #c8ceca; border-radius: .35rem; background: #fff; }
.event-detail h3 { margin: 0 0 .65rem; font-size: .95rem; }
.event-detail dl { display: grid; gap: .45rem; margin: 0; }
.event-detail dl div { display: grid; grid-template-columns: 8rem 1fr; gap: .75rem; }
.event-detail dt { color: #56605c; }.event-detail dd { margin: 0; overflow-wrap: anywhere; }
.event-timeline li { cursor: pointer; }
.branch-label { padding: .6rem .8rem; border-left: .3rem dashed #7b5a9b; background: #f0eaf5; }
.supporting-copy { color: #626c68; max-width: 48rem; }
.compact-form { margin-top: 1rem; max-width: 32rem; }
.comparison-options { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; margin: 1.5rem 0 .75rem; }
.comparison-options select, .comparison-options input { padding: .55rem; font: inherit; }
.comparison-options label { font-weight: 650; }
.comparison-boards { display: grid; grid-template-columns: repeat(2, minmax(16rem, 1fr)); gap: clamp(1rem, 3vw, 3rem); margin-top: 2rem; }
.comparison-boards .spectator-board [data-spectator-board-mount] { width: 100%; }
.condition-label { display: inline-block; padding: .25rem .5rem; background: #dce9e4; border-radius: 999px; }
.comparison-controls { display: grid; grid-template-columns: max-content max-content 1fr; gap: .6rem; align-items: center; margin: 1.5rem 0; }
.comparison-controls button { padding: .45rem .6rem; font: inherit; }
.comparison-controls input { grid-column: 1 / -1; width: 100%; }

@media (max-width: 52rem) {
  .app-frame { display: block; }
  .app-sidebar { position: static; width: 100%; height: auto; padding: 1rem; }
  .app-sidebar .primary-nav, .app-sidebar .sidebar-footer { display: none; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem; background: #102821; }
  .mobile-brand { color: white; font-size: .84rem; font-weight: 800; letter-spacing: .18em; text-decoration: none; }
  .hero-panel { grid-template-columns: 1fr; }
  .arena-stats { grid-template-columns: 1fr; }
  .arena-stats div { border-right: 0; border-bottom: 1px solid rgb(29 63 53 / .14); }
  .dashboard-grid { grid-template-columns: 1fr; gap: 0; }
  .operator-heading { align-items: stretch; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full-span { grid-column: auto; }
  .form-submit-bar { align-items: stretch; flex-direction: column; }
  .heading-actions { align-items: stretch; }
  .heading-actions a { flex: 1; }
  .spectator-header, .status-list { align-items: start; flex-direction: column; }
  .spectator-grid { grid-template-columns: 1fr; }
  .perspective-pair { grid-template-columns: 1fr; }
  .replay-controls { grid-template-columns: repeat(2, 1fr); }
  .agent-report-grid { grid-template-columns: 1fr; }
  .comparison-boards { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .spectator-board *, .spectator-board *::before, .spectator-board *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
