/* Scoped to the existing portal's green and gold design tokens. */
.maestro-shell { color: var(--text); min-width: 0; }
.maestro-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.maestro-heading h2 { margin: 8px 0; font: 500 clamp(25px, 3vw, 36px)/1.15 Georgia, serif; letter-spacing: -.025em; }
.maestro-heading p:not(.section-kicker), .maestro-scope { color: var(--muted); font-size: 13px; line-height: 1.65; }
.maestro-scope { margin: 0 0 22px; padding-left: 12px; border-left: 2px solid var(--gold); }
.maestro-layout { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap: 22px; align-items: start; }
.maestro-main, .maestro-detail, .maestro-missions { min-width: 0; }
.maestro-shell h3 { margin: 0 0 14px; font-size: 15px; }
.maestro-missions { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 12px; background: var(--shell); }
.maestro-missions h3 { padding: 0 6px; }
.maestro-missions ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; max-height: 680px; overflow-y: auto; scrollbar-width: thin; }
.maestro-mission { display: grid; width: 100%; gap: 9px; padding: 14px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; text-align: left; color: var(--text); cursor: pointer; }
.maestro-mission:hover, .maestro-mission.is-selected { background: var(--surface-2); border-color: var(--line-strong); }
.maestro-mission.is-selected { box-shadow: inset 3px 0 var(--gold); }
.maestro-mission strong { font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.maestro-mission small, .maestro-id { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.maestro-state { display: inline-flex; width: fit-content; padding: 5px 8px; border-radius: 7px; font-size: 10px; line-height: 1.4; color: var(--muted); background: var(--surface-3); }
.maestro-state-completed { color: var(--green); background: rgba(119, 201, 154, .1); }
.maestro-state-running, .maestro-state-waiting_approval, .maestro-state-waiting_dependency { color: var(--gold); background: rgba(229, 189, 103, .1); }
.maestro-state-failed { color: var(--red); background: rgba(255, 140, 130, .1); }
.maestro-compose { display: grid; gap: 10px; padding: clamp(18px, 3vw, 25px); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.maestro-compose label { display: grid; gap: 8px; font-size: 11px; font-weight: 700; color: var(--muted); }
.maestro-compose textarea, .maestro-compose select { width: 100%; min-width: 0; min-height: 44px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; }
.maestro-compose textarea { min-height: 105px; resize: vertical; line-height: 1.7; }
.maestro-compose textarea::placeholder { color: var(--muted); }
.maestro-form-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0; }
.maestro-compose-footer, .maestro-detail-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.maestro-compose-footer { margin-top: 7px; }
.maestro-compose-footer small { font-size: 11px; color: var(--muted); }
.maestro-shell button { min-height: 40px; }
.maestro-shell button:disabled { cursor: wait; opacity: .55; }
.maestro-shell button:focus-visible, .maestro-shell textarea:focus-visible, .maestro-shell select:focus-visible, .maestro-shell summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.maestro-feedback { min-height: 20px; margin: 10px 0; color: var(--gold); font-size: 12px; line-height: 1.6; }
.maestro-error { border: 1px solid rgba(255, 140, 130, .35); padding: 14px; border-radius: var(--radius-sm); color: var(--red); background: rgba(255, 140, 130, .06); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.maestro-detail { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: rgba(18, 36, 29, .5); }
.maestro-detail-header { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.maestro-detail-header > div:first-child { display: grid; gap: 8px; }
.maestro-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.maestro-transcript { display: grid; gap: 18px; padding: clamp(16px, 3vw, 25px); }
.maestro-message { min-width: 0; max-width: 100%; padding: 18px; border-radius: 14px; font-size: 13px; line-height: 1.75; }
.maestro-message p { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.maestro-message-owner { margin-left: min(10%, 60px); border: 1px solid var(--line-strong); background: var(--surface-3); }
.maestro-message-assistant { border: 1px solid var(--line); background: var(--surface); }
.maestro-speaker { display: block; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.maestro-message-assistant .maestro-speaker { color: var(--green); }
.maestro-result-summary { font-size: 14px; }
.maestro-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.maestro-facts div { min-width: 0; }
.maestro-facts dt { color: var(--muted); font-size: 10px; font-weight: 750; }
.maestro-facts dd { margin: 4px 0 0; color: var(--text); overflow-wrap: anywhere; white-space: pre-wrap; }
.maestro-evidence { padding-top: 14px; margin-top: 16px; border-top: 1px solid var(--line); }
.maestro-shell summary { color: var(--muted); font-size: 12px; cursor: pointer; line-height: 1.6; }
.maestro-shell pre { padding: 12px; margin: 10px 0 0; border-radius: 9px; background: var(--bg); color: var(--muted); font-size: 11px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; }
.maestro-history { padding: 18px 22px; border-top: 1px solid var(--line); }
.maestro-events, .maestro-steps { padding-left: 18px; margin: 16px 0 0; }
.maestro-events li, .maestro-steps li { padding: 0 0 14px 6px; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.maestro-events li > div { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.maestro-events strong, .maestro-steps strong { color: var(--text); font-size: 11px; }
.maestro-events time { font-size: 10px; }
.maestro-progress { padding: 14px; color: var(--gold); background: rgba(229, 189, 103, .06); border-radius: 10px; font-size: 12px; line-height: 1.7; }
.maestro-empty { display: grid; place-items: center; min-height: 160px; padding: 25px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.7; }
.maestro-empty-inline { margin: 4px 6px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.maestro-command { margin: 0 0 30px; }
.maestro-command-header, .maestro-proposal > header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; }
.maestro-command-header h3 { margin: 6px 0; font: 500 27px/1.2 Georgia, serif; }
.maestro-command-header p:not(.section-kicker), .maestro-production-lock { color: var(--muted); font-size: 12px; line-height: 1.7; }
.maestro-production-lock { padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(229, 189, 103, .04); }
.maestro-command-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.maestro-command-card { min-width: 0; min-height: 160px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.maestro-command-card h4 { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin: 0 0 14px; font-size: 12px; }
.maestro-command-card h4 span { color: var(--gold); font-size: 20px; font-weight: 500; }
.maestro-command-card ul, .maestro-patterns ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.maestro-command-card li { font-size: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); line-height: 1.6; overflow-wrap: anywhere; }
.maestro-command-card li:last-child { border-bottom: 0; padding-bottom: 0; }
.maestro-command-card small, .maestro-proposal > header small { display: block; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.maestro-command-card p { font-size: 11px; line-height: 1.7; color: var(--muted); margin: 5px 0; }
.maestro-shell .maestro-link-button { display: block; padding: 0; text-align: left; color: var(--green); background: none; border: 0; min-height: 28px; font: inherit; line-height: 1.6; cursor: pointer; overflow-wrap: anywhere; }
.maestro-shell .maestro-link-button:hover { text-decoration: underline; }
.maestro-health dl { display: grid; gap: 8px; margin: 12px 0; font-size: 11px; }
.maestro-health dl div { display: flex; justify-content: space-between; gap: 8px; }
.maestro-health dd { margin: 0; }
.maestro-feed-panel, .maestro-proposal, .maestro-authority, .maestro-patterns { margin-top: 20px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--shell); }
.maestro-feed { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; max-height: 440px; overflow: auto; }
.maestro-feed > li { display: flex; gap: 20px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.7; }
.maestro-feed time { flex: 0 0 140px; color: var(--muted); font-size: 10px; }
.maestro-feed strong { color: var(--text); font-weight: 600; }
.maestro-proposal { border-color: var(--line-strong); }
.maestro-proposal h3 { margin: 4px 0 10px; font: 500 25px/1.3 Georgia, serif; }
.maestro-proposal h4 { font-size: 13px; margin: 0 0 10px; }
.maestro-proposal h5 { margin: 12px 0 6px; font-size: 12px; }
.maestro-proposal p, .maestro-authority p { font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.maestro-proposal-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.maestro-proposal-facts dt { color: var(--muted); font-size: 10px; font-weight: 700; }
.maestro-proposal-facts dd { margin: 6px 0 0; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.maestro-before-after { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.maestro-before-after > section { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 16px; background: var(--surface); }
.maestro-before-after > section:last-child { border-color: rgba(119, 201, 154, .35); }
.maestro-before-after p { margin: 0; }
.maestro-proposal form { display: grid; gap: 12px; margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.maestro-proposal label { display: grid; gap: 8px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.maestro-proposal input:not([type="checkbox"]), .maestro-proposal textarea { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 8px; padding: 12px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; }
.maestro-proposal textarea { min-height: 90px; resize: vertical; }
.maestro-proposal textarea[readonly] { color: var(--muted); border-style: dashed; }
.maestro-proposal label.maestro-confirmation { display: flex; align-items: start; gap: 10px; color: var(--text); }
.maestro-confirmation input { margin-top: 5px; flex: 0 0 auto; }
.maestro-mock-controls { border: 1px dashed var(--gold); border-radius: 10px; background: rgba(229, 189, 103, .04); padding: 17px; margin-top: 20px; }
.maestro-mock-controls button { margin: 8px 8px 0 0; }
.maestro-evidence-list { margin: 14px 0; padding-left: 20px; font-size: 12px; line-height: 1.7; }
.maestro-evidence-list small { display: block; overflow-wrap: anywhere; color: var(--muted); }
.maestro-test-results { padding: 16px; border: 1px solid var(--line); border-radius: 10px; margin: 18px 0; }
.maestro-test-results article { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
.maestro-checks { list-style: none; display: grid; gap: 8px; padding: 0; font-size: 11px; }
.maestro-checks li { display: flex; justify-content: space-between; gap: 16px; overflow-wrap: anywhere; }
.maestro-proposal-history { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.maestro-authority article { padding: 12px 0; border-top: 1px solid var(--line); font-size: 12px; }
.maestro-response-policy, .maestro-governance { margin-top: 22px; padding: 20px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--shell); }
.maestro-response-policy h3, .maestro-governance h3 { margin: 8px 0 14px; font: 500 25px/1.3 Georgia, serif; }
.maestro-response-policy h4, .maestro-governance h4 { margin: 18px 0 10px; font-size: 13px; }
.maestro-response-policy p, .maestro-governance p { font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.maestro-policy-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 20px 0; }
.maestro-policy-facts div { min-width: 0; }
.maestro-policy-facts dt { font-size: 10px; color: var(--muted); font-weight: 700; }
.maestro-policy-facts dd { margin: 5px 0 0; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; white-space: pre-wrap; }
.maestro-policy-confirm, .maestro-governance form { display: grid; gap: 12px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 16px; margin: 18px 0; }
.maestro-response-policy label, .maestro-governance label { font-size: 12px; line-height: 1.8; display: grid; gap: 8px; }
.maestro-response-policy label.maestro-confirmation, .maestro-governance label.maestro-confirmation { display: flex; align-items: start; gap: 10px; }
.maestro-governance input:not([type="checkbox"]) { width: 100%; padding: 12px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-strong); border-radius: 9px; }
.maestro-policy-active { color: var(--green); padding: 12px; border-left: 2px solid var(--green); background: rgba(119,201,154,.05); }
.maestro-response-policy > button { margin: 8px 8px 0 0; }
.maestro-policy-releases, .maestro-plan-list, .maestro-capabilities { list-style: none; padding: 0; display: grid; gap: 12px; }
.maestro-runtime-proof, .maestro-policy-observations, .maestro-execution-plan { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.maestro-capability-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.maestro-capability-grid article { min-width: 0; border: 1px solid var(--line); padding: 14px; border-radius: 10px; font-size: 12px; }
.maestro-capability-grid span { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }
@media (max-width: 1000px) {
  .maestro-command-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .maestro-layout { grid-template-columns: minmax(170px, 210px) minmax(0, 1fr); gap: 14px; }
  .maestro-form-options { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .maestro-policy-facts, .maestro-capability-grid { grid-template-columns: 1fr; }
  .maestro-command-grid, .maestro-proposal-facts, .maestro-before-after { grid-template-columns: 1fr; }
  .maestro-command-header > button { width: 100%; }
  .maestro-feed > li { flex-direction: column; gap: 4px; }
  .maestro-feed time { flex-basis: auto; }
  .maestro-layout { grid-template-columns: 1fr; }
  .maestro-missions { padding: 14px; }
  .maestro-missions ul { display: flex; gap: 8px; overflow-x: auto; max-height: none; padding-bottom: 4px; }
  .maestro-missions li { flex: 0 0 min(75vw, 240px); }
  .maestro-mission strong { max-height: 3.2em; overflow: hidden; }
  .maestro-compose-footer, .maestro-detail-header { align-items: stretch; }
  .maestro-compose-footer > button { width: 100%; }
  .maestro-facts { grid-template-columns: 1fr; }
  .maestro-message-owner { margin-left: 12px; }
  .maestro-actions { width: 100%; }
  .maestro-actions > button { flex: 1; }
}
