:root {
  color: #10233d;
  background: #f4f7fb;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #102b3f;
  --muted: #5c6f86;
  --line: #dce5eb;
  --paper: #fff;
  --navy: #071a2b;
  --blue: #087f9c;
  --teal: #12a6c7;
  --teal-dark: #087f9c;
  --amber: #986000;
  --red: #b52b39;
  --shadow: 0 18px 48px rgba(21, 45, 77, .08);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: linear-gradient(180deg, #eef4fa 0, #f7f9fc 420px); color: var(--ink); }
body, button, input, select, code, td, dd { overflow-wrap: anywhere; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; }
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px #005fcc; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .8rem 1rem; border-radius: .5rem; background: #fff; }
.skip-link:focus { top: 1rem; }
.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; }
.shell-header { position: sticky; top: 0; z-index: 20; min-height: 78px; padding: 0 clamp(1rem, 4vw, 4.5rem); display: grid; grid-template-columns: minmax(150px, .8fr) minmax(0, 2fr) minmax(110px, .6fr); align-items: center; gap: 2rem; color: #fff; background: radial-gradient(circle at 88% -110%, rgba(18,166,199,.25), transparent 31rem), var(--navy); border-bottom: 1px solid rgba(140,206,230,.16); box-shadow: 0 6px 22px rgba(7,26,43,.12); }
.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; justify-self: start; }
nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: clamp(.5rem, 2vw, 1.75rem); }
.nav-step { display: flex; min-width: 0; min-height: 48px; gap: .6rem; align-items: center; justify-content: center; padding: .85rem 1.2rem; border: 1px solid transparent; border-radius: 999px; background: transparent; color: #c4d5e3; font-weight: 650; line-height: 1.4; }
.nav-step span { font-size: .68rem; color: #6ed0e5; }
.nav-step.is-active { color: #9beaf6; border-color: rgba(110,208,229,.65); background: transparent; }
.nav-step:not(:disabled):hover { border-color: rgba(110,208,229,.4); }
.connection { justify-self: end; display: flex; align-items: center; gap: .6rem; color: #c4d5e3; font-size: .75rem; }
.connection span { width: .55rem; height: .55rem; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 .25rem rgba(0,168,149,.13); }
main { min-height: calc(100vh - 130px); }
.screen { max-width: 1640px; margin: 0 auto; padding: 2rem clamp(1rem, 3vw, 3rem) 3rem; }
.screen[hidden] { display: none !important; }
.section-header { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, .65fr); gap: 3rem; align-items: end; margin-bottom: 2.2rem; }
.hero-grid { display: block; margin-bottom: 1.5rem; }
#screen-plano > .section-header { grid-template-columns: 1fr; }
#scenario-refine-button { justify-self: start; }
.eyebrow, .step-label { margin: 0 0 .7rem; color: var(--teal-dark); font-weight: 800; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; max-width: 840px; color: var(--navy); font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.15; letter-spacing: -.035em; }
.lead { max-width: 780px; margin: .65rem 0 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }
h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.02em; }
.brand-logo { display: block; width: 182px; height: 64px; object-fit: contain; object-position: left center; }
.deployment-logo { display: block; max-width: 140px; max-height: 38px; object-fit: contain; padding: 4px 6px; border-radius: 4px; background: #fff; }
.maestro-avatar { width: 110px; height: 110px; object-fit: contain; justify-self: end; padding: 14px; border-radius: 24px; background: var(--navy); }
.sample-notice { margin: 0 0 1.25rem; }
.workspace-grid { display: grid; gap: 1.25rem; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 1.25rem; align-items: start; }
.panel { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: .85rem; padding: clamp(1rem, 1.6vw, 1.5rem); }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.calendar-panel .status-pill, .upload-panel .status-pill { flex-shrink: 0; white-space: nowrap; }
.status-pill { display: inline-flex; padding: .36rem .65rem; border-radius: 999px; color: var(--amber); background: #fff3d4; font-weight: 750; font-size: .7rem; }
.status-pill.neutral { color: #42617f; background: #edf3f8; }
.status-pill.success { color: #006f61; background: #daf5ef; }
.drop-zone { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; border: 1.5px dashed #8fa7bf; border-radius: .8rem; color: var(--muted); background: #f8fbfe; text-align: center; transition: border-color .18s, background .18s; }
.drop-zone.is-over { border-color: var(--teal); background: #eafaf7; }
.drop-zone:focus-within { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px #005fcc; border-color: var(--teal); }
.drop-zone input { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); }
.drop-zone strong { color: var(--navy); font-size: 1rem; }
.drop-zone span:last-child { font-size: .78rem; }
.upload-icon { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; border-radius: 50%; background: #e8f0fb; color: var(--blue); font-size: 1.35rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }
.button { border: 1px solid transparent; border-radius: .58rem; padding: .76rem 1rem; font-weight: 750; transition: transform .12s, background .15s; }
.button:not(:disabled):active { transform: translateY(1px); }
.button.primary { background: var(--navy); color: #fff; }
.button.primary:hover { background: #1b4777; }
.button.secondary { color: var(--navy); border-color: #a9bbcf; background: #fff; }
.button.ghost { color: var(--muted); background: transparent; }
.button.danger { color: var(--red); border-color: #efb8bd; background: #fff; }
.button.full { width: 100%; margin-top: 1.25rem; display: flex; justify-content: space-between; }
.notice { padding: .65rem .8rem; border-radius: .45rem; font-size: .76rem; }
.notice.warning { color: #754a00; background: #fff6df; }
.preview-summary, .metric-strip { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: .8rem; }
.preview-summary span, .metric-strip div { padding: .55rem .7rem; border-radius: .45rem; background: #edf3f8; font-size: .72rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .78rem; }
caption { text-align: left; padding: 0 0 .6rem; color: var(--muted); font-size: .7rem; }
th { padding: .72rem .65rem; color: #425b73; background: #edf3f8; text-align: left; white-space: nowrap; }
td { padding: .72rem .65rem; border-bottom: 1px solid #e7edf4; vertical-align: top; }
tbody tr:hover { background: #f8fbfe; }
.field-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .85rem; }
.planning-mode-field { margin: 1.2rem 0 .8rem; }
.duration-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 1rem 0; }
.staffing-grid input { min-width: 4rem; max-width: 8rem; }
.staffing-grid th small { display: block; font-weight: 400; color: var(--muted); }
.staffing-grid tfoot { font-weight: 700; }
.team-editor { margin: 1.25rem 0; }
.team-editor > p { color: var(--muted); }
label > span { display: block; margin-bottom: .32rem; color: #425b73; font-size: .76rem; font-weight: 700; }
input, select { width: 100%; min-width: 0; max-width: 100%; min-height: 43px; border: 1px solid #aabccc; border-radius: .5rem; padding: .65rem .75rem; color: var(--ink); background: #fff; }
.calendar-line { display: grid; grid-template-columns: 1fr 2rem 1fr; align-items: center; gap: .5rem; margin: 1.2rem 0; }
.calendar-line div { padding: .8rem; border-radius: .5rem; background: #edf3f8; }
.calendar-line span { display: block; color: var(--muted); font-size: .68rem; }
.calendar-line i { height: 1px; background: #9bb0c5; }
.client-departure-controls { margin-bottom: 1.2rem; }
.client-departure-controls label + label { display: block; margin-top: .85rem; }
.client-departure-option { display: flex; align-items: center; gap: .65rem; }
.client-departure-option input { width: 1.1rem; min-height: 1.1rem; margin: 0; }
.client-departure-option span { margin: 0; }
.client-departure-controls small { display: block; margin-top: .35rem; color: var(--muted); font-size: .7rem; }
details { border-top: 1px solid var(--line); padding-top: 1rem; }
summary { color: var(--navy); font-size: .8rem; font-weight: 750; cursor: pointer; }
details ul { padding-left: 1.2rem; color: var(--muted); font-size: .77rem; line-height: 1.55; }
.run-panel, .authoritative { margin-top: 1.25rem; padding: 1.1rem 1.3rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; background: var(--navy); border-radius: 1rem; color: #fff; }
.run-panel > div:first-child { display: flex; align-items: center; gap: 1rem; }
.run-panel h2, .run-panel p { margin: 0; }
.run-panel p { margin-top: .25rem; color: #b9cbe0; font-size: .8rem; }
.spinner { width: 2rem; height: 2rem; border: 3px solid rgba(255,255,255,.22); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.run-time { text-align: right; }
.run-time span, .run-time small { display: block; color: #b9cbe0; font-size: .67rem; }
.run-time strong { display: block; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.authoritative { background: #e8f8f4; color: var(--ink); border: 1px solid #93d6ca; }
.authoritative p:not(.step-label) { max-width: 520px; margin: .45rem 0 0; color: #425b73; font-size: .76rem; }
.attempt-actions { margin-top: 1.25rem; border-color: #efb8bd; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.attempt-actions p:not(.step-label) { margin: .45rem 0 0; color: var(--muted); font-size: .78rem; }
.section-header h1 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.kpi { min-width: 0; padding: 1.4rem; border-radius: 1rem; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.shift-kpi-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.3rem; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
.shift-kpi-heading h2 { color: var(--navy); font-size: 1.15rem; }
.shift-kpi-window { color: var(--muted); font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.shift-kpi-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.35rem 1rem; margin: 0; }
.shift-kpi-values dt { color: var(--muted); font-size: .74rem; }
.shift-kpi-values dd { margin: 0; }
.shift-kpi-values strong { display: block; margin: .45rem 0 .3rem; color: var(--navy); font-size: clamp(1.45rem, 2vw, 1.8rem); letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.shift-kpi-values small { display: block; color: #62798f; font-size: .68rem; line-height: 1.45; }
.result-grid { margin-bottom: 1.25rem; }
.context-note { margin: 1rem 0 0; color: var(--muted); font-size: .75rem; }
.completion-progress { width: 100%; height: 18px; margin: 2rem 0 .6rem; border: 0; border-radius: 999px; overflow: hidden; background: #e4ebf3; }
.completion-progress::-webkit-progress-bar { background: #e4ebf3; }
.completion-progress::-webkit-progress-value { background: linear-gradient(90deg, var(--teal), var(--blue)); }
.completion-progress::-moz-progress-bar { background: var(--teal-dark); }
#completion-caption { color: var(--muted); font-size: .74rem; }
.detail-list { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: .55rem 1rem; margin: 1rem 0 0; font-size: .76rem; }
.detail-list div { display: contents; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; font-weight: 750; text-align: right; overflow-wrap: anywhere; }
.filter-row { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.timeline { padding: .9rem; margin-bottom: 1rem; border-radius: .55rem; background: #edf3f8; }
.timeline-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: .8rem; }
.timeline-legend { display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; margin: .8rem 0 1rem; font-size: .72rem; color: var(--muted); }
.timeline-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.timeline-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; }
.timeline-legend i[data-kind="work"] { background: #154875; }
.timeline-legend i[data-kind="congestion"] { background: var(--amber); }
.timeline-legend i[data-kind="transport"] { background: var(--teal); }
.timeline-legend i[data-kind="empty"] { background: #dfe8f2; border: 1px solid #c7d4e2; }
.timeline-axis, .timeline-lane { display: grid; grid-template-columns: minmax(0, 24%) minmax(0, 1fr); column-gap: .75rem; align-items: center; }
.timeline-axis { margin-bottom: .7rem; color: var(--muted); font-size: .68rem; }
.timeline-axis > div { position: relative; height: 1.3rem; }
.timeline-axis > div > span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.timeline-axis > div > span:first-child { transform: none; }
.timeline-axis > div > span:last-child { transform: translateX(-100%); }
.timeline-lane { min-height: 32px; margin: .35rem 0; }
.timeline-resource { font-size: .7rem; font-weight: 650; overflow-wrap: anywhere; }
.timeline-rail { position: relative; min-height: 26px; border-radius: 3px; background: repeating-linear-gradient(to right, transparent 0, transparent calc(12.5% - 1px), #c7d4e2 calc(12.5% - 1px), #c7d4e2 12.5%), #dfe8f2; }
.timeline-event { display: block; position: absolute; top: 2px; height: 22px; border-radius: 2px; background: #154875; }
.timeline-event[data-kind="congestion"] { background: var(--amber); }
.timeline-event[data-kind="transport"] { background: var(--teal); }
.event-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); margin-top: 1.5rem; padding-top: 1rem; }
.event-detail-heading h3 { margin: 0; font-size: .95rem; }
@media (max-width: 700px) { .timeline-controls { grid-template-columns: 1fr; } .timeline-axis > div > span:nth-child(even) { visibility: hidden; } }

.row-plan-card { margin-top: 1.25rem; }
.completion-entities { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.25rem; }
.entity-card { min-width: 0; }
.entity-card .panel-heading { align-items: center; }
.entity-card td:first-child, .entity-card td:nth-child(2) { max-width: 16rem; }
.downloads { margin-top: 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.downloads p:not(.step-label) { margin-bottom: 0; color: var(--muted); font-size: .8rem; }
.maestro-header { align-items: center; }
.explanation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.explanation-lead { grid-column: 1 / -1; padding: 2rem; border-radius: 1rem; color: #fff; background: var(--navy); }
.explanation-lead h2 { font-size: 2rem; }
.explanation-lead p:last-child { max-width: 900px; color: #c7d5e5; line-height: 1.6; }
.explanation-card { position: relative; min-height: 220px; }
.explanation-card h2 { padding-right: 3rem; }
.explanation-card ul { padding-left: 1.15rem; color: var(--muted); line-height: 1.65; }
.card-index { position: absolute; top: 1.2rem; right: 1.2rem; color: #52677d; font-size: .7rem; font-weight: 800; }
.validation-seal { margin-top: 1rem; display: flex; align-items: center; gap: 1rem; padding: 1.2rem 1.4rem; border: 1px solid #93d6ca; border-radius: .8rem; background: #e8f8f4; }
.validation-seal > span { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--teal-dark); color: #fff; }
.validation-seal p { margin: .25rem 0 0; color: var(--muted); font-size: .8rem; }
.toast { position: fixed; z-index: 50; right: 1rem; bottom: 1rem; max-width: min(430px, calc(100vw - 2rem)); display: flex; gap: 1rem; align-items: start; padding: 1rem 1.1rem; border-radius: .7rem; color: #fff; background: #9d2531; box-shadow: 0 18px 60px rgba(50,0,0,.25); }
.toast p { margin: 0; line-height: 1.45; }
.toast button { border: 0; color: #fff; background: transparent; font-size: 1.2rem; }
footer { min-height: 52px; padding: 0 clamp(1rem,4vw,4.5rem); display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: .7rem; }
@media (max-width: 980px) {
  .shell-header { grid-template-columns: 1fr auto; }
  .shell-header nav { order: 3; grid-column: 1 / -1; justify-content: center; overflow-x: auto; }
  .connection { grid-column: 2; grid-row: 1; }
  .hero-grid, .section-header, .workspace-grid, .result-grid, .completion-entities { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-row { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
}
@media (max-width: 620px) {
  .shell-header { padding: .8rem 1rem 0; }
  .connection { display: none; }
  .nav-step { padding: .6rem .35rem; gap: .35rem; font-size: .72rem; }
  .screen { padding-top: 2.2rem; }
  h1 { font-size: 2.45rem; }
  .run-panel, .authoritative, .attempt-actions, .downloads { align-items: stretch; flex-direction: column; }
  .run-time { text-align: left; }
  .kpi-grid, .explanation-grid { grid-template-columns: 1fr; }
  .explanation-lead { grid-column: auto; }
  .filter-row { grid-template-columns: 1fr; }
  footer { align-items: start; gap: .3rem; flex-direction: column; padding-top: 1rem; padding-bottom: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.agent-chat { margin-bottom: 1.3rem; }
.agent-history { min-height: 220px; max-height: min(60vh, 640px); overflow-y: auto; padding: .25rem .4rem .8rem 0; scroll-behavior: smooth; }
.agent-empty { display: grid; align-content: center; min-height: 210px; max-width: 650px; margin: 0 auto; padding: 1.4rem; text-align: center; }
.agent-empty h3 { margin: 0 0 .65rem; color: var(--navy); font-size: 1.4rem; }
.agent-empty p { margin: 0; color: var(--muted); line-height: 1.6; }
.agent-exchange { display: grid; gap: .85rem; margin-bottom: 1.5rem; }
.agent-message { max-width: 92%; padding: 1rem 1.2rem; border-radius: 1rem; }
.agent-message.user { justify-self: end; color: var(--navy); background: #edf3f8; }
.agent-message.maestro { justify-self: start; width: 100%; border: 1px solid var(--line); background: #fff; }
.agent-speaker { font-size: .72rem; color: var(--teal-dark); font-weight: 750; }
.agent-message p { margin: .5rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; font-size: .88rem; }
.agent-message .agent-job-state { color: var(--muted); font-size: .72rem; }
.agent-proposal { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.agent-proposal h3 { margin: 0; font-size: 1rem; }
.agent-changes { padding-left: 1.15rem; line-height: 1.65; font-size: .82rem; }
.agent-proposal caption { padding-top: .6rem; }
.agent-proposal tbody th { white-space: normal; font-size: .74rem; background: #f7f9fc; }
.agent-proposal .button { margin-top: .8rem; }
.agent-composer { padding-top: 1rem; border-top: 1px solid var(--line); }
.agent-composer-top, .agent-composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.agent-mode { display: inline-flex; gap: .3rem; padding: .3rem; border: 1px solid var(--line); border-radius: 999px; background: #f4f7fb; }
.agent-mode button { padding: .65rem 1.15rem; border: 0; border-radius: 999px; color: var(--muted); background: transparent; font: inherit; font-weight: 700; font-size: .8rem; white-space: nowrap; overflow-wrap: normal; }
.agent-mode button[aria-pressed="true"] { color: #fff; background: var(--navy); }
.agent-keyboard-hint { color: var(--muted); font-size: .68rem; }
.agent-composer .context-note { margin: .85rem 0 .65rem; line-height: 1.5; }
.agent-composer textarea { display: block; width: 100%; min-height: 96px; resize: vertical; padding: .9rem 1rem; border: 1px solid #aabccc; border-radius: .8rem; background: #fff; color: var(--ink); font: inherit; font-size: .88rem; line-height: 1.55; overflow-wrap: anywhere; }
.agent-composer textarea:disabled { background: #f7f9fc; }
.agent-composer-actions > p { margin: .75rem 0 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.agent-composer-actions > p[data-state="error"] { color: var(--red); }
.agent-plan-summary { margin-top: 1.5rem; border-top: 0; }
.agent-plan-summary > summary { margin-bottom: 1rem; }
@media (max-width: 620px) {
  .agent-message { max-width: 100%; padding: .85rem; }
  .agent-composer-top, .agent-composer-actions { align-items: stretch; flex-direction: column; gap: .5rem; }
  .agent-keyboard-hint { display: none; }
  .agent-mode { align-self: start; }
  .agent-mode button { padding: .6rem .85rem; }
  .agent-composer-actions .button-row { justify-content: flex-end; }
}

.agent-proposal table { margin-bottom: .9rem; }
.agent-area-goal, .agent-removal-impact { margin: 1.1rem 0; padding-top: .85rem; border-top: 1px solid var(--line); }
.agent-area-goal h4, .agent-removal-impact h4 { margin: 0 0 .7rem; color: var(--navy); font-size: .9rem; }
.agent-message .agent-removal-warning { font-weight: 650; line-height: 1.6; margin-top: 1rem; }
.agent-message > .button.secondary { margin-top: .85rem; }

.agent-report { margin-top: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #f7f9fc; }
.agent-report h3 { margin: 0; color: var(--navy); font-size: 1rem; overflow-wrap: anywhere; }
.agent-report .button-row { margin-top: .8rem; flex-wrap: wrap; }
.agent-report .button { margin-top: 0; }

.scenario-generate { margin-top: .7rem; }
.scenario-comparison { margin-top: 1.5rem; }
.scenario-comparison td { white-space: normal; min-width: 7rem; }
.scenario-comparison td:first-child { font-weight: 650; min-width: 12rem; }
.scenario-comparison .context-note { line-height: 1.6; }

.scenario-comparison th { white-space: normal; }
.scenario-comparison th:nth-child(2) { min-width: 10rem; max-width: 14rem; }
.scenario-comparison .button { white-space: nowrap; }
/* Allocated nonproductive time is separate from physical resource activity. */
.timeline-legend i[data-kind="pause"], .timeline-event[data-kind="pause"] { background: #8a62ad; }
.timeline-legend i[data-kind="idle"], .timeline-event[data-kind="idle"] { background: #dfe8f2; border: 1px solid #c7d4e2; }

/* Entrada follows the same order as the work: file, day, hours, people. */
.upload-panel { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(260px, 1.4fr) auto; gap: .8rem 1.25rem; align-items: center; }
.upload-panel .panel-heading, .upload-panel .button-row { margin: 0; }
.upload-panel .panel-heading { align-items: center; }
.upload-panel .step-label { margin-bottom: .35rem; }
.upload-panel .drop-zone { min-height: 76px; padding: .7rem 1rem; display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; text-align: left; }
.upload-panel .upload-icon { grid-row: span 2; }
.upload-panel .drop-zone strong, .upload-panel .drop-zone span:last-child { justify-self: start; margin: 0; }
.upload-panel .notice, .upload-preview { grid-column: 1 / -1; margin: 0; }
.upload-panel .notice { padding: .5rem .7rem; }
.upload-preview > summary { padding-bottom: .6rem; }
.calendar-panel { min-width: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.settings-card { min-height: 320px; border-top: 3px solid #087f9c; }
.settings-card h2 { font-size: 1.1rem; line-height: 1.35; }
.settings-help { min-height: 3rem; margin: .6rem 0 1rem; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.settings-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; margin-bottom: 1rem; border-radius: .6rem; color: #087f9c; background: #edf7fa; }
.settings-card .planning-mode-field { margin-top: 0; }
.settings-card .calendar-line { grid-template-columns: 1fr 1fr; margin: 1rem 0 0; }
.settings-card .calendar-line i { display: none; }
.settings-card .calendar-line div { padding: .6rem; }
.settings-card .context-note { line-height: 1.55; }
.settings-card .staffing-grid th, .settings-card .staffing-grid td { padding: .5rem .3rem; }
.settings-card .staffing-grid input { min-width: 0; padding: .5rem; }
.advanced-settings { margin-top: 1.25rem; padding: 1rem 1.25rem; background: #f8fafc; }
.advanced-settings > summary { font-size: .85rem; }
.advanced-settings > .client-departure-controls { margin-top: 1rem; }
.generate-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.generate-bar p { margin: 0; font-weight: 650; }
.generate-bar p span { display: block; margin-top: .25rem; color: var(--muted); font-size: .85rem; font-weight: 400; }

/* The plan and its conversation are one workspace. */
#screen-plano > .section-header { margin-bottom: .5rem; }
.plan-toolbar { margin-bottom: 1.25rem; }
.plan-toolbar .button-row { margin-top: .5rem; }
.plan-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 390px); gap: 1.25rem; align-items: start; }
.plan-main { min-width: 0; display: grid; gap: 1.25rem; }
.plan-main > .team-editor { margin: 0; }
.area-plan-panel .timeline { padding: 0; margin-bottom: 0; background: transparent; }
.area-gantt { padding: 1rem; border: 1px solid var(--line); border-radius: .65rem; background: #f8fafc; }
.area-gantt + .area-gantt { margin-top: .8rem; }
.area-gantt-heading { margin: 0; font-size: .95rem; color: var(--navy); }
.area-gantt .context-note { margin: .3rem 0 1rem; }
.area-gantt .timeline-axis { font-size: .64rem; }
.work-orders-panel > .panel-heading { align-items: center; margin-bottom: .4rem; }
.work-orders-panel > .panel-heading select { font-size: .8rem; }
.work-order-status { color: var(--navy); font-size: .85rem; font-weight: 650; }
.work-order-list { margin: 0; padding: 0; list-style: none; }
.work-order-list > li { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.queue-rank { display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: #eaf3f8; color: #087f9c; font-size: .8rem; font-weight: 750; }
.queue-description, .work-order-list small { display: block; margin-top: .25rem; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.work-order-list strong { font-size: .95rem; }
.work-order-list .button { font-size: .8rem; }
.work-order-list > .queue-empty { display: block; padding: 1.25rem 0; color: var(--muted); line-height: 1.6; }
.queue-pagination { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: .65rem; }
.queue-pagination .button { font-size: .8rem; }
.work-order-confirmation { margin-top: 1rem; padding: 1rem; border: 1px solid #70b9c9; border-radius: .6rem; background: #eff9fc; }
.work-order-confirmation h3 { margin: 0; font-size: 1rem; }
.work-order-confirmation p { font-size: .85rem; line-height: 1.6; }
.plan-details { padding: 1rem 0 0; }
.plan-details > summary { margin-bottom: 1rem; font-size: .9rem; }
.plan-details > .panel, .plan-details > .result-grid, .plan-details > .completion-entities { margin-bottom: 1.25rem; }
.plan-details .result-grid, .plan-details .kpi-grid { grid-template-columns: 1fr; }
.maestro-dock { min-width: 0; position: sticky; top: 98px; }
.maestro-dock .agent-chat { display: flex; flex-direction: column; height: calc(100dvh - 120px); min-height: 540px; max-height: 940px; margin-bottom: 0; }
.maestro-dock .panel-heading { margin-bottom: .7rem; }
.maestro-dock .panel-heading .status-pill { display: none; }
.maestro-dock .agent-history { flex: 1; min-height: 160px; max-height: none; }
.maestro-dock .agent-message { max-width: 100%; padding: .85rem; }
.maestro-dock .agent-composer { flex-shrink: 0; }
.maestro-dock .agent-composer textarea { min-height: 90px; }
.maestro-dock .agent-composer-top, .maestro-dock .agent-composer-actions { flex-wrap: wrap; gap: .5rem; }
.maestro-dock .agent-keyboard-hint { display: none; }

@media (max-width: 1180px) {
  .upload-panel { grid-template-columns: minmax(140px, .7fr) minmax(260px, 1.3fr); }
  .upload-panel > .button-row { grid-column: 1 / -1; }
  .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-card:last-child { grid-column: 1 / -1; }
  .plan-workspace { grid-template-columns: minmax(0, 1fr) minmax(310px, 350px); gap: 1rem; }
}
@media (max-width: 980px) {
  .plan-workspace { grid-template-columns: minmax(0, 1fr); }
  .maestro-dock { position: static; }
  .maestro-dock .agent-chat { height: auto; min-height: 0; max-height: none; }
  .maestro-dock .agent-history { min-height: 160px; max-height: 420px; }
}
@media (max-width: 620px) {
  .screen { padding-top: 1.5rem; }
  .upload-panel, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-card { min-height: 0; }
  .settings-help { min-height: 0; }
  .generate-bar { align-items: stretch; flex-direction: column; }
  .generate-bar .button { width: 100%; }
  .work-order-list > li { grid-template-columns: 1.8rem minmax(0, 1fr); gap: .5rem; }
  .work-order-list > li > .button, .work-order-list > li > .status-pill { grid-column: 2; justify-self: start; }
  .area-gantt { padding: .75rem; }
  .timeline-axis, .timeline-lane { column-gap: .4rem; }
  .work-orders-panel > .panel-heading { flex-wrap: wrap; }
}

/* Approved vertical workspace and expandable area spans. */

:root{--shell-sidebar-width:112px}
.shell-sidebar{position:fixed;inset:0 auto 0 0;z-index:40;width:var(--shell-sidebar-width);height:100dvh;min-width:0;display:flex;flex-direction:column;align-items:center;padding:14px 10px;color:rgba(255,255,255,.68);background:var(--navy);border-right:1px solid rgba(140,206,230,.16);box-shadow:4px 0 18px rgba(0,0,0,.18);overflow-y:auto}
.sidebar-brand{display:grid;width:54px;height:54px;flex:none;place-items:center;padding:7px;border-radius:17px;background:linear-gradient(145deg,#071a2b,#0d2c47);box-shadow:0 9px 20px rgba(7,26,43,.22)}
.sidebar-symbol{display:block;width:100%;height:100%;object-fit:contain}
.shell-sidebar nav{display:flex;flex-direction:column;gap:7px;min-width:0;width:100%;margin-top:26px}
.shell-sidebar .nav-step{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;width:100%;min-height:58px;padding:8px 4px;border-radius:14px;border:0;text-align:center;font-weight:700;color:rgba(255,255,255,.68);background:transparent;transition:color .18s ease,background .18s ease}
.shell-sidebar .nav-step::before{position:absolute;top:15px;bottom:15px;left:-10px;width:3px;border-radius:0 6px 6px 0;background:#12a6c7;content:"";opacity:0;transform:scaleY(.5);transition:opacity .18s ease,transform .18s ease}
.shell-sidebar .nav-step .sidebar-tab-label{font-size:10px;line-height:1.45;color:inherit;letter-spacing:.01em;white-space:normal}
.shell-sidebar .sidebar-icon{display:block;flex:none;width:20px;height:20px}
.shell-sidebar .nav-step.is-active{color:#9beaf6;background:rgba(18,166,199,.18)}
.shell-sidebar .nav-step.is-active::before{opacity:1;transform:scaleY(1)}
.shell-sidebar .nav-step:not(:disabled):hover{color:#fff;background:rgba(18,166,199,.14)}
:is(body,#application-shell)>.shell-header,:is(body,#application-shell)>main,:is(body,#application-shell)>footer{margin-left:var(--shell-sidebar-width);min-width:0}
.shell-header{grid-template-columns:1fr auto;gap:1rem;min-height:78px;padding:.65rem clamp(.75rem,2.5vw,2rem)}
.sidebar-footer{flex:none;width:100%;margin-top:auto;text-align:center}
.daily-token-usage{width:100%;min-width:0;padding-top:24px;padding-bottom:4px;color:#e8f3fa;text-align:center}
.daily-token-heading{display:flex;flex-direction:column;gap:.3rem;align-items:center;font-size:.75rem;font-weight:600;line-height:1.4}
.daily-token-heading>span{max-width:100%;color:#b7cddd;white-space:normal}
.daily-token-indicator{position:relative;display:grid;place-items:center;width:40px;height:40px;margin:.5rem auto 0}
.daily-token-meter{position:absolute;inset:0}
.daily-token-ring{display:block;width:100%;height:100%;transform:rotate(-90deg)}
.daily-token-ring circle{fill:none;stroke-width:3;stroke-linecap:butt}
.daily-token-track{stroke:rgba(214,231,244,.2)}
.daily-token-remaining{stroke:#66dfc3}
.daily-token-summary{font-size:.5625rem;font-weight:600;font-variant-numeric:tabular-nums;line-height:1}
.daily-token-usage[data-state="unavailable"] .daily-token-summary{color:#f6d99c}
.application-version{display:block;margin:.5rem 0 .25rem;color:#9bb3c5;font-size:.625rem;line-height:1.4}
.help-panel{max-width:48rem}
.terms-of-use{max-width:30rem}
.terms-of-use summary{cursor:pointer;color:var(--ink);text-decoration:underline;text-underline-offset:.2em}
.terms-of-use summary:hover{color:var(--teal-dark)}
.terms-of-use p{margin:.5rem 0 .3rem;font-size:.75rem;line-height:1.5}
@media(max-width:1050px){.shell-header .connection{display:none}}
:is(body,#application-shell)>main{min-height:calc(100dvh - 208px)}
:is(body,#application-shell)>footer{gap:.5rem;flex-wrap:wrap}
@media(max-width:920px){:root{--shell-sidebar-width:104px}}
@media(max-width:620px){:root{--shell-sidebar-width:88px}.shell-sidebar{padding:14px 6px}.sidebar-brand{width:46px;height:46px;padding:5px;border-radius:14px}.shell-sidebar nav{margin-top:20px}.shell-sidebar .nav-step::before{left:-6px}.shell-header{padding:.4rem .75rem}.shell-header .brand-logo{width:142px;height:54px}.shell-header .connection{display:none}.screen{padding-left:.75rem;padding-right:.75rem}:is(body,#application-shell)>footer{padding-left:.75rem;padding-right:.75rem}.timeline-axis{grid-template-columns:minmax(72px,30%) minmax(0,1fr)}}


.plan-workspace { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.plan-toolbar { display: flex; flex-wrap: wrap; gap: .65rem; margin-bottom: 1rem; }
#screen-plano > .section-header { margin-bottom: .5rem; }
.second-shift-option { display: flex; align-items: center; gap: .6rem; }
.second-shift-option input { width: 1.1rem; min-height: 1.1rem; margin: 0; }
.second-shift-option span { margin: 0; }
.area-gantt > summary { cursor: pointer; list-style: none; }
.area-gantt > summary::-webkit-details-marker { display: none; }
.area-gantt > summary:focus-visible { outline-color: var(--blue); }
.area-gantt-heading { display: grid; grid-template-columns: minmax(80px, 24%) minmax(0, 1fr); align-items: center; gap: .65rem; }
.area-gantt-heading > span:first-child::before { content: '▸ '; color: var(--teal-dark); }
.area-gantt[open] > .area-gantt-heading > span:first-child::before { content: '▾ '; }
.area-summary-rail { position: relative; display: block; min-width: 0; height: 38px; border-radius: .4rem; background: #edf3f6; }
.area-summary-bar { position: absolute; top: 6px; height: 26px; background: #c6eaf0; border-radius: .3rem; overflow: hidden; text-align: center; color: #174357; font-size: .7rem; line-height: 26px; white-space: nowrap; }
.area-empty { padding: .5rem; font-size: .7rem; font-weight: 400; }
.timeline-legend i[data-kind="area"] { background: #c6eaf0; }
.work-order-list > li { grid-template-columns: minmax(0, 1fr) auto auto; }
.task-state { padding: .3rem .5rem; border-radius: .35rem; font-size: .72rem; color: #52677d; background: #edf2f6; }
.task-state[data-state="in_progress"] { color: #17617c; background: #e4f4fa; }
.task-state[data-state="completed"] { color: #216342; background: #e6f6ee; }
.maestro-dock .agent-composer textarea { min-height: 110px; }
@media (max-width: 980px) { .plan-workspace { grid-template-columns: minmax(0, 1fr); } .maestro-dock { position: static; } }
@media (max-width: 620px) { .work-order-list > li { grid-template-columns: minmax(0, 1fr) auto; } .work-order-list > li > .task-state { grid-column: 1; grid-row: 2; justify-self: start; } .work-order-list > li > .button { grid-column: 2; grid-row: 1 / span 2; } }

/* Whole-shipment demand selection stays independent from available staffing. */
.demand-areas { min-width: 0; margin: 1rem 0; padding: .9rem; border: 1px solid var(--line); border-radius: .55rem; }
.demand-areas legend { padding: 0 .3rem; color: var(--navy); font-size: .85rem; font-weight: 650; }
.area-selection { display: flex; flex-wrap: wrap; gap: .45rem; }
.area-selection label { display: flex; align-items: center; gap: .45rem; min-height: 44px; padding: .35rem .65rem; border: 1px solid var(--line); border-radius: .4rem; background: #fff; cursor: pointer; }
.area-selection input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--teal-dark); }
.area-selection span { font-size: .8rem; }
.scope-preview { margin-bottom: 1rem; padding: .9rem; border: 1px solid var(--line); border-radius: .55rem; background: #f4f8fb; }
.scope-preview h3 { margin: 0 0 .5rem; font-size: .85rem; }
.scope-preview p { font-size: .78rem; line-height: 1.5; overflow-wrap: anywhere; }
.scope-preview-counts p { margin: .4rem 0; }
.plan-demand-scope { margin: 0 0 1rem; line-height: 1.6; overflow-wrap: anywhere; }

/* The native hidden shell prevents any application flash before startup. */
.startup-screen { position: fixed; inset: 0; z-index: 100; display: grid; min-height: 100dvh; place-items: center; padding: 2rem 1.5rem; background: var(--navy); color: #e3f1f7; opacity: 1; transition: opacity 280ms ease, display 280ms allow-discrete; }
.startup-screen[hidden] { opacity: 0; pointer-events: none; }
.startup-card { display: grid; justify-items: center; width: 100%; max-width: 24rem; text-align: center; }
.startup-logo { display: block; width: min(16rem, 100%); height: auto; animation: startup-breathe 2.8s ease-in-out infinite; }
.startup-tangram { display: block; width: min(21rem, 100%); height: auto; margin-top: 1.5rem; }
.startup-piece { transform-box: view-box; transform-origin: 0 0; transform: var(--pose-a); stroke: var(--navy); stroke-width: 1.5; stroke-linejoin: round; animation: startup-assemble 12s cubic-bezier(.45, 0, .2, 1) -2.1s infinite; }
.startup-large-a { fill: var(--teal); --pose-a: translate(160px, 110px) rotate(225deg); --pose-b: translate(160px, 132px) rotate(180deg); --pose-c: translate(138px, 132px) rotate(180deg); }
.startup-large-b { fill: #4c9fd5; --pose-a: translate(160px, 110px) rotate(315deg); --pose-b: translate(160px, 132px) rotate(270deg); --pose-c: translate(226px, 132px) rotate(180deg); }
.startup-medium { fill: #8bd9e6; --pose-a: translate(97.774603255584px, 110px) rotate(45deg); --pose-b: translate(160px, 132px) rotate(0deg); --pose-c: translate(182px, 132px) rotate(0deg); }
.startup-square { fill: #5099b6; --pose-a: translate(191.112698372208px, 141.112698372208px) rotate(135deg); --pose-b: translate(72px, 132px) rotate(0deg); --pose-c: translate(138px, 132px) rotate(0deg); }
.startup-parallelogram { fill: #087f9c; --pose-a: translate(97.774603255584px, 47.774603255584px) rotate(45deg); --pose-b: translate(116px, 132px) rotate(0deg); --pose-c: translate(50px, 132px) rotate(0deg); }
.startup-small-a { fill: #a9deed; --pose-a: translate(160px, 110px) rotate(135deg); --pose-b: translate(116px, 176px) rotate(270deg); --pose-c: translate(138px, 132px) rotate(90deg); }
.startup-small-b { fill: #48b8d0; --pose-a: translate(191.112698372208px, 141.112698372208px) rotate(45deg); --pose-b: translate(248px, 176px) rotate(180deg); --pose-c: translate(182px, 176px) rotate(270deg); }
.startup-card p { margin: 1.5rem 0 .75rem; line-height: 1.6; }
.startup-retry { display: none; color: #a5bdce; font-size: .875rem; text-underline-offset: .2em; }
.startup-screen[data-state="error"] .startup-retry { display: inline; }
.startup-screen[data-state="error"] .startup-tangram { display: none; }
.startup-screen[data-state="error"] .startup-logo { animation: none; opacity: 1; }
.startup-screen[data-state="error"] .startup-piece { animation: none; }
@keyframes startup-breathe { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes startup-assemble {
  0%, 18%, 100% { transform: var(--pose-a); }
  33%, 51% { transform: var(--pose-b); }
  66%, 84% { transform: var(--pose-c); }
}
@media (prefers-reduced-motion: reduce) {
  .startup-screen { transition: none; }
  .startup-logo, .startup-piece { animation: none; }
  .startup-logo { opacity: 1; }
}
