:root {
  --purple: #652d91;
  --blue: #5490cc;
  --green: #38bb93;
  --yellow: #f6f06b;
  --brick: #a3343e;
  --rose: #e27396;
  --charcoal: #262329;
  --warm-white: #fffdfa;
  --mist: #f5f3f8;
  --line: #d8d0df;
  --muted: #62596a;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--mist); color: var(--charcoal); font: 16px/1.55 Lato, Arial, sans-serif; }
.masthead { background: var(--purple); color: #fff; padding: 1.35rem 1.25rem 1.55rem; border-bottom: 4px solid var(--yellow); }
.masthead-inner, #workspace, footer { max-width: 1220px; margin: auto; }
.masthead-logo { display: block; width: min(355px, 72vw); height: auto; margin: 0 0 .7rem; }
.eyebrow, .step-label { margin: 0; color: var(--purple); font-weight: 900; font-size: .77rem; letter-spacing: .11em; }
.masthead h1 { font-size: clamp(2rem, 5vw, 3.35rem); line-height: 1.05; margin: .25rem 0 .45rem; color: #fff; }
.lede { font: 19px/1.42 Lora, Georgia, serif; margin: 0; max-width: 790px; color: rgba(255,255,255,.94); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--yellow); padding: .5rem; z-index: 4; }
.toolbar { margin: 1.25rem 0; display: flex; justify-content: space-between; align-items: end; gap: 1rem; background: var(--warm-white); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.toolbar strong { display: block; font-size: 1.05rem; }
.toolbar span { color: var(--muted); font-size: .9rem; }
.template-picker { min-width: 310px; }
.template-picker label { font-size: .8rem; }
.toast-region { position: fixed; top: 1rem; right: 1rem; z-index: 1000; width: min(410px, calc(100vw - 2rem)); display: grid; gap: .6rem; pointer-events: none; }
.toast { pointer-events: auto; display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: start; border: 1px solid var(--line); border-left: 6px solid var(--blue); border-radius: 9px; background: #fff; padding: .8rem .85rem; box-shadow: 0 10px 30px rgba(38,35,41,.18); font-weight: 800; animation: toast-in .16s ease-out; }
.toast.success { border-left-color: var(--green); background: #e7f8f2; }
.toast.error { border-left-color: var(--brick); background: #fff0f1; color: var(--brick); }
.toast.info { border-left-color: var(--blue); }
.toast button { min-height: 28px; min-width: 28px; padding: 0 .35rem; border: 0; background: transparent; color: currentColor; font-size: 1.1rem; line-height: 1; }
@keyframes toast-in { from { transform: translateY(-6px); opacity: .2; } to { transform: translateY(0); opacity: 1; } }
.workflow-nav { position: sticky; top: 1rem; float: left; width: 225px; padding: .35rem 0 1.2rem; max-height: calc(100vh - 2rem); overflow-y: auto; overflow-x: hidden; }
.scenario-manager { margin: 0 .35rem 1rem; padding: .7rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.scenario-manager-heading { display: grid; grid-template-columns: 1fr; align-items: stretch; gap: .45rem; margin-bottom: .55rem; }
.scenario-manager-heading p { margin: 0; color: var(--purple); font-weight: 900; }
.scenario-manager-actions { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:.3rem; align-items:stretch; width:100%; }
.scenario-manager-heading button { width:100%; min-width:0; min-height: 30px; padding: .3rem .4rem; font-size: .75rem; white-space:nowrap; }
.scenario-list { display: grid; gap: .35rem; }
.scenario-item { display: grid; grid-template-columns: 1fr; gap: .18rem; align-items: center; width: 100%; min-height: 0; padding: .5rem .55rem; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--charcoal); text-align: left; font-size: .82rem; }
.scenario-item:hover { filter: none; border-color: var(--purple); }
.scenario-item.active { border-color: var(--purple); background: #eee7f4; color: var(--purple); }
.scenario-item .scenario-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; }
.scenario-item .scenario-status { display:flex; align-items:center; gap:.32rem; color:var(--muted); font-size:.68rem; font-weight:700; line-height:1.2; }
.scenario-item.active .scenario-status { color:var(--purple); }
.scenario-item .scenario-dot { flex:0 0 auto; width: .5rem; height: .5rem; border-radius: 50%; background: #aaa; }
.scenario-item .scenario-dot.calculated { background: var(--green); }
.scenario-item .scenario-dot.dirty { background: var(--yellow); border: 1px solid #8c8530; }
.scenario-item .scenario-dot.error { background: var(--brick); }
.scenario-remove { display: block; width: 100%; min-height: 28px; margin-top: .45rem; padding: .25rem .35rem; border: 0; background: transparent; color: var(--muted); font-size: .76rem; text-align: left; }
.scenario-remove:hover { color: var(--brick); filter: none; }
.scenario-manager-hint { margin: .45rem 0 0 !important; color: var(--muted) !important; font-size: .72rem; line-height: 1.35; font-weight: 400 !important; }
.workflow-nav p { color: var(--muted); font-weight: 800; margin: 0 1rem .5rem; }
.workflow-nav ol { list-style: none; padding: 0; margin: 0; }
.workflow-nav > ol button { display: flex; gap: .65rem; align-items: center; width: 100%; border: 0; border-left: 4px solid transparent; border-radius: 0; background: transparent; color: var(--charcoal); text-align: left; padding: .65rem 1rem; font-weight: 800; }
.workflow-nav > ol button:hover, .workflow-nav > ol button[aria-current="step"] { background: #ece5f3; border-left-color: var(--purple); color: var(--purple); filter: none; }
.workspace-content { margin-left: 250px; min-height: 570px; }
.workflow-step { display: none; background: var(--warm-white); border: 1px solid var(--line); border-radius: 12px; padding: clamp(1rem, 3vw, 2rem); box-shadow: 0 8px 24px rgba(38,35,41,.05); }
.workflow-step.active { display: block; }
.section-heading { border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.section-heading .step-label { color: var(--purple); }
h2 { font-size: clamp(1.65rem, 3vw, 2.2rem); margin: .15rem 0; }
h3 { color: var(--purple); }
.section-heading p:last-child { font-family: Lora, Georgia, serif; margin: .4rem 0 1rem; color: #4f4656; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.scenario-start { display: grid; grid-template-columns: minmax(170px,.7fr) minmax(280px,1.4fr) auto; gap: 1rem; align-items: end; background: #f7f4f8; border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: 10px; padding: 1rem; margin: 0 0 1.4rem; }
.scenario-state strong { display: block; font-size: 1rem; }
.scenario-state span { display: block; color: var(--muted); font-size: .9rem; margin-top: .25rem; }
.scenario-start .template-picker { min-width: 0; }
.scenario-start > button { margin-bottom: 0; white-space: nowrap; }
.scenario-grid { margin-bottom: 1.5rem; }
label { display: block; font-size: .9rem; font-weight: 800; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; padding: .6rem; border: 1px solid #958b9f; border-radius: 6px; background: #fff; color: var(--charcoal); font: inherit; }
.input-suffix { color: var(--muted); font-weight: 400; }
.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; }
.unit-input { position: relative; margin-top: .3rem; }
.unit-input input { margin-top: 0; padding-right: 3.1rem; }
.unit-suffix { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .82rem; font-weight: 800; pointer-events: none; }
textarea { font-family: ui-monospace, Consolas, monospace; }
input:focus, select:focus, textarea:focus, button:focus, a:focus, summary:focus { outline: 3px solid var(--yellow); outline-offset: 2px; }
.hint { color: var(--muted); font-size: .9rem; }
.warning, #validation { color: var(--brick); font-weight: 800; }
.definition { border-left: 5px solid var(--green); background: #e7f8f2; padding: .85rem; margin: 1.3rem 0; }
.file { display: inline-block; color: var(--purple); cursor: pointer; font-weight: 900; }
.file input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
button { border: 2px solid var(--purple); border-radius: 7px; min-height: 40px; padding: .62rem .9rem; background: var(--purple); color: #fff; font: 800 .92rem/1.15 Lato, Arial, sans-serif; cursor: pointer; }
button:hover { filter: brightness(.9); }
button.secondary { background: #fff; color: var(--purple); }
button:disabled { opacity: .48; cursor: not-allowed; filter: none; }
button.compact { min-height: 32px; padding: .35rem .55rem; font-size: .82rem; }
.button-group, .button-bar, .step-actions { display: flex; gap: .55rem; flex-wrap: wrap; }
.button-bar { margin: 1rem 0; }
.button-bar button { min-width: 150px; text-align: center; }
.step-actions { justify-content: space-between; border-top: 1px solid var(--line); padding-top: 1rem; margin: 1rem 0; }
.subhead-row { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-top: 1rem; }
.subhead-row h3, .subhead-row p { margin-bottom: .25rem; }
.editable-table { overflow-x: auto; margin: 1rem 0; }
.editable-table table, .result-table { width: 100%; border-collapse: collapse; }
.editable-table th, .editable-table td, .result-table th, .result-table td { border: 1px solid var(--line); padding: .5rem; text-align: left; vertical-align: top; }
.editable-table th, .result-table th { background: #f3f0ae; font-size: .85rem; }
.editable-table input, .editable-table select { min-width: 95px; margin-top: 0; }
.stay-share-summary { margin: -.35rem 0 1rem; padding: .75rem .9rem; border: 1px solid var(--line); border-left: 5px solid var(--green); border-radius: 8px; background: #e7f8f2; font-weight: 800; }
.stay-share-summary.invalid { border-left-color: var(--brick); background: #fff0f1; color: var(--brick); }
.stay-share-summary:focus { outline: 3px solid var(--blue); outline-offset: 3px; }
.stay-share-cell.invalid input { border-color: var(--brick); box-shadow: 0 0 0 1px var(--brick); }
.selected-row td { background: #f8f3fb; }
.asset-tabs { display: flex; gap: .35rem; overflow-x: auto; padding: .1rem 0 .8rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.asset-tab { flex: 0 0 auto; background: #fff; color: var(--charcoal); border-color: var(--line); min-height: 36px; padding: .45rem .75rem; }
.asset-tab.active { background: var(--purple); border-color: var(--purple); color: #fff; }
.asset-tab.inactive { opacity: .6; }
.muted-field { opacity: .55; }
.conditional-hidden { display: none !important; }
.chart-panel { margin: 1.5rem 0; background: #fbfafc; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; }
.chart-panel h3 { margin: 0 0 .25rem; }
.chart-panel svg { display: block; width: 100%; height: auto; margin: .5rem 0; }
.chart-key { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .85rem; }
.key-dot { display: inline-block; width: .75rem; height: .75rem; border-radius: 50%; margin-right: .3rem; }
.key-dot.blue { background: var(--blue); }
.key-dot.purple { background: var(--purple); }
.key-dot.green { background: var(--green); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: .75rem; margin: 1rem 0; }
.card { padding: 1rem; border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: 8px; background: #fff; }
.card:nth-child(3n+2) { border-top-color: var(--green); }
.card:nth-child(3n) { border-top-color: var(--purple); }
.card span { font-size: .83rem; color: var(--muted); font-weight: 800; }
.card strong { display: block; font-size: 1.3rem; line-height: 1.25; color: var(--charcoal); }
.result-summary { font-size: .92rem; background: #f7f4f8; border-radius: 8px; padding: .8rem; }
.active-scenario-strip { display: grid; grid-template-columns: 1.5fr 1fr; gap: .75rem; margin: 0 0 1rem; padding: .8rem; border: 1px solid var(--line); border-left: 5px solid var(--purple); border-radius: 9px; background: #f7f4f8; }
.active-scenario-strip span { display: block; color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.active-scenario-strip strong { display: block; margin-top: .1rem; }
.response-panel { margin-top: 1.5rem; border: 1px solid var(--line); border-radius: 10px; padding: 1rem; background: #fff; }
.response-panel > h3 { margin-top: 0; }
details { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
details.response-panel { border-top: 1px solid var(--line); }
details.response-panel > summary { color: var(--purple); font-weight: 900; cursor: pointer; }
.file-warning { max-width: 760px; margin: 4rem auto; padding: 2rem; background: var(--warm-white); border: 3px solid var(--purple); border-radius: 12px; }
.file-warning .eyebrow { color: var(--purple); }
footer { clear: both; padding: 2rem 1.25rem; color: var(--muted); font-size: .9rem; }

@media (max-width: 760px) {
  .masthead { padding: 1rem; }
  .masthead-rule { margin-bottom: .75rem; }
  .masthead-logo { width: min(310px, 82vw); }
  .toolbar, .subhead-row { align-items: stretch; flex-direction: column; }
  .scenario-start { grid-template-columns: 1fr; align-items: stretch; }
  .template-picker { width: 100%; min-width: 0; }
  .workflow-nav { position: static; float: none; width: auto; max-height: none; overflow: visible; padding: .5rem 0; }
  .scenario-manager { margin: 0 0 .75rem; }
  .scenario-list { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .workflow-nav ol { display: flex; width: 100%; overflow-x: auto; }
  .workflow-nav > ol button { border-left: 0; border-bottom: 4px solid transparent; white-space: nowrap; }
  .workflow-nav > ol button[aria-current="step"] { border-bottom-color: var(--purple); }
  .workspace-content { margin-left: 0; }
  .workflow-step { padding: 1rem; }
  .button-bar button { flex: 1 1 44%; min-width: 0; }
  .active-scenario-strip { grid-template-columns: 1fr; }
  .editable-table { margin-inline: -.2rem; }
  .chart-panel { overflow-x: auto; }
  .chart-panel svg { min-width: 540px; }
}

/* PPSM 0.6 behavioral-response workspace */
.behavior-unavailable { display: none; margin: 0 0 1rem; padding: 1rem; border: 1px solid var(--line); border-left: 5px solid var(--yellow); border-radius: 9px; background: #fbf9df; }
.behavior-unavailable strong, .behavior-unavailable span { display: block; }
.behavior-unavailable span { margin-top: .25rem; color: var(--muted); }
.behavior-controls { margin: 0; padding: 0; border: 0; min-width: 0; }
#behavior.behavior-disabled .behavior-unavailable { display: block; }
#behavior.behavior-disabled .behavior-controls { opacity: .46; filter: grayscale(.15); }
#behavior.behavior-disabled .behavior-controls * { cursor: not-allowed; }
.sensitivity-table input { min-width: 88px; max-width: 130px; display: inline-block; }
.sensitivity-table .cell-suffix { margin-left: .25rem; color: var(--muted); }
.sensitivity-table td, .sensitivity-table th { vertical-align: middle; }
#transitionSummary { margin-top: 1rem; }
#paidResponseRange h4, #directResponseRange h4, #diversionRangeBlock h4 { margin-bottom: .25rem; color: var(--charcoal); }
#behavior .response-panel:first-of-type { margin-top: 0; }
.field-note { display:block; margin-top:.2rem; color:var(--muted); font-size:.78rem; font-weight:600; }
.sensitivity-table .central-sensitivity th,
.result-table .central-sensitivity th { border-left:4px solid var(--purple); }
.sensitivity-table .central-sensitivity td,
.result-table .central-sensitivity td { background:#fbf8fd; }

.subsection-divider { border-top: 1px solid var(--line); margin: 1.35rem 0 1rem; }

.pricing-basis-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; margin-bottom: .85rem; }
.pricing-basis-grid > label, .pricing-basis-grid > .form-field { min-width: 0; }
.pricing-basis-grid > label, .max-stay-field > label { white-space: nowrap; }
#fixedPricingPanel, #elapsedPricingPanel, #timeOfDayPricingPanel { margin-top: .35rem; }
#fixedPricingPanel .definition { border-left-color: var(--purple); }
#timeOfDayPricingPanel .definition { border-left-color: var(--blue); }
.fixed-rate-field { max-width: 360px; margin: .6rem 0 1.1rem; }

@media (max-width: 1050px) and (min-width: 761px) {
  .pricing-basis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .pricing-basis-grid { grid-template-columns: 1fr; }
}
