.advanced-hero { background: #191a32; color: #f9f7ff; border-bottom: 1px solid #383554; }
.advanced-intro { padding-block: 44px 50px; }
.advanced-path { color: #d3c5fc; font-size: 13px; font-weight: 750; }
.advanced-intro h1 { font-size: clamp(32px, 5.3vw, 59px); line-height: 1.22; letter-spacing: -.045em; margin-top: 8px; }
.advanced-intro > p:not(.advanced-path) { color: #dddded; margin-top: 13px; max-width: 44rem; }
.advanced-intro nav { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 21px; margin-top: 21px; }
.advanced-section { padding-block: 38px 0; scroll-margin-top: 16px; }
.reservation-workspace { border: 1px solid var(--line); background: #fff; border-radius: 14px; overflow: hidden; }
.reservation-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px 20px; background: #f0ecff; color: #453174; }
.reservation-flow span { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 9px; font-size: 12px; }
.reservation-flow b { font: 700 13px var(--mono); }
.lab-body { display: grid; grid-template-columns: minmax(0, .78fr) minmax(0, 1.22fr); }
#reservation-form, .lab-results { padding: 19px 22px; min-width: 0; }
.lab-results { border-left: 1px solid var(--line); background: #fafaff; }
.slot { display: flex; align-items: baseline; flex-wrap: wrap; gap: 7px 11px; }
.slot b { font-size: 19px; }
.slot span { color: var(--muted); font-size: 14px; }
.strategy-options { border: none; padding: 0; margin: 15px 0 11px; }
.strategy-options legend { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.strategy-options label { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 7px; border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; cursor: pointer; }
.strategy-options label:has(input:checked) { border-color: #856abe; background: #f3effe; }
.strategy-options input, .crash-option input { accent-color: var(--accent); margin-top: 5px; }
.strategy-options b { display: block; font-size: 14px; }
.strategy-options small { display: block; color: var(--muted); font-size: 12px; }
.crash-option { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.advanced-run { background: #513787; color: #fff; margin-top: 14px; }
.advanced-run:enabled:hover { background: #6546a3; }
.advanced-run:disabled { opacity: .65; }
.lab-results h3 { font-size: 17px; }
.reservation-status { color: var(--muted); font-size: 14px; margin-top: 5px; }
.reservation-status.has-conflict { color: #932e31; }
.reservation-status.has-success { color: #1a6547; }
.reservation-outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.attempt-card { border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; font-size: 13px; }
.attempt-card.accepted { background: #edf8f2; color: #19553d; }
.attempt-card.rejected { background: #fff1ed; color: #842e26; }
.attempt-card p { font-size: 11px; }
.state-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 12px; line-height: 1.5; }
.state-table caption { text-align: left; font-weight: 700; margin-bottom: 3px; }
.state-table th, .state-table td { border-bottom: 1px solid var(--line); text-align: center; padding: 6px 4px; }
.state-table th:first-child { text-align: left; }
.state-table thead { color: #45405e; background: #f0eef7; }
.state-table thead th:not(:first-child) { white-space: nowrap; }
.state-table tbody th { font-weight: 500; }
.worker-result { color: var(--muted); font-size: 12px; margin-top: 8px; }
.advanced-reading { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }
.advanced-reading article { min-width: 0; }
.advanced-reading h3 { font-size: 19px; margin-bottom: 8px; }
.advanced-reading p, .advanced-reading li { font-size: 14px; line-height: 1.85; }
.advanced-reading p + p { margin-top: 8px; }
.advanced-reading pre { overflow: auto; margin: 10px 0; padding: 12px; border-radius: 8px; background: #25243c; color: #eee8fa; font: 12px/1.7 var(--mono); }
.source-list { margin: 9px 0 0; padding-left: 1.3rem; }
.source-list a { color: var(--accent); text-underline-offset: 3px; }
.advanced-question { margin-top: 20px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.advanced-question summary { cursor: pointer; font-weight: 700; }
.advanced-question p { margin-top: 8px; font-size: 14px; }
.nginx-section { margin-top: 37px; border-top: 1px solid var(--line); padding-bottom: 51px; }
.nginx-diagram { display: grid; grid-template-columns: minmax(0, .72fr) auto minmax(0, .92fr) auto minmax(0, 1.36fr); align-items: center; gap: 12px; padding: 14px; background: #e7f3ef; border: 1px solid #c1dbd0; border-radius: 12px; }
.nginx-node, .nginx-destinations span { display: block; padding: 9px 12px; border-radius: 6px; background: white; color: #234c43; }
.nginx-node { font-weight: 750; }
.nginx-node small { display: block; font-size: 11px; font-weight: 500; }
.nginx-arrow { color: #245a52; font-weight: 750; text-align: center; }
.proxy-node { background: #1e5246; color: #eefaf5; }
.nginx-destinations { display: grid; gap: 5px; }
.nginx-destinations span { font-size: 13px; }
.nginx-destinations code { white-space: nowrap; }
.nginx-experiment { margin-top: 18px; border: 1px solid #c1dbd0; border-radius: 12px; background: #fff; overflow: hidden; scroll-margin-top: 16px; }
.nginx-experiment-header { padding: 15px 19px; background: #e7f3ef; color: #234c43; }
.nginx-experiment-header h3 { font-size: 19px; }
.nginx-experiment-header p { margin-top: 3px; font-size: 13px; overflow-wrap: anywhere; }
.nginx-experiment-body { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
#nginx-form, .proxy-results { min-width: 0; padding: 16px 19px; }
#nginx-form label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.proxy-editor { padding: 9px 12px; border-radius: 8px; background: #25243c; color: #e5dbf7; font: 13px/1.5 var(--mono); }
.proxy-editor > code { display: block; }
.proxy-editor input { display: block; width: calc(100% - 1rem); margin: 5px 0 5px 1rem; padding: 6px 8px; border-radius: 4px; border: 1px solid #77708f; background: #1b1a2f; color: #fff; font: inherit; }
#proxy-edit-help { margin-top: 7px; color: var(--muted); font-size: 12px; }
.proxy-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.proxy-actions .button { margin-top: 0; min-height: 36px; padding: 6px 9px; font-size: 12px; }
.proxy-results { border-left: 1px solid #c1dbd0; background: #f6fbf8; }
.proxy-results h4 { margin: 0; font-size: 15px; }
.proxy-status { margin-block: 4px 8px; color: var(--muted); font-size: 12px; }
.proxy-status.has-error { color: #932e31; }
.proxy-result { margin-top: 7px; padding: 8px 10px; border: 1px solid #d3e4dc; border-radius: 6px; background: #fff; overflow-wrap: anywhere; }
.proxy-result-directive { color: #234c43; font-size: 12px; font-weight: 700; }
.proxy-result dl { display: grid; gap: 1px 9px; grid-template-columns: 8.5rem minmax(0, 1fr); margin: 4px 0 0; font-size: 11px; }
.proxy-result dt { color: var(--muted); }
.proxy-result dd { margin: 0; font-family: var(--mono); }
.proxy-result p { margin-top: 4px; font-size: 11px; }
.proxy-result p:empty { display: none; }
.nginx-reading ol { padding-left: 1.6rem; margin-block: 0 12px; }
.nginx-reading li + li { margin-top: 4px; }
@media (max-width: 740px) {
  .advanced-intro { padding-block: 28px 33px; }
  .advanced-section { padding-top: 29px; }
  .lab-body, .advanced-reading, .nginx-experiment-body { grid-template-columns: minmax(0, 1fr); }
  .lab-results { border-left: 0; border-top: 1px solid var(--line); }
  .proxy-results { border-left: 0; border-top: 1px solid #c1dbd0; }
  .reservation-flow, #reservation-form, .lab-results { padding-inline: 13px; }
  .nginx-diagram { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .nginx-arrow { transform: rotate(90deg); }
}
@media (max-width: 380px) {
  .reservation-outcomes { grid-template-columns: minmax(0, 1fr); }
  #nginx-form, .proxy-results, .nginx-experiment-header { padding-inline: 12px; }
  .proxy-result dl { grid-template-columns: minmax(0, 1fr); }
}
