/* ShiftZero app */
body.app { background: var(--paper); min-height: 100vh; display: flex; flex-direction: column; }
.app-header { display: flex; align-items: center; gap: 1rem; padding: 0 1.5rem; min-height: 62px; background: var(--panel); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 10; }
.app-header-right { margin-left: auto; display: flex; align-items: center; gap: .9rem; }
.who { color: var(--steel); font-size: .9rem; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-small { padding: .55rem .85rem; font-size: .9rem; }
.badge { font-size: .78rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px; }
.badge.demo { background: var(--amber-soft); color: #6b4100; }
.badge.live { background: var(--signal-soft); color: var(--signal-ink); }

.app-shell { flex: 1; display: grid; grid-template-columns: 250px minmax(0, 1fr); width: min(1240px, 100%); margin: 0 auto; }
.rail { padding: 2.25rem 1.25rem; border-right: 1px solid var(--rule); }
.rail ol { list-style: none; margin: 0; padding: 0; position: sticky; top: 90px; display: grid; gap: .25rem; }
.rail li > button, .rail li > .rail-static { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .55rem .6rem; border: 0; background: none; font: inherit; font-size: .95rem; color: var(--steel); text-align: left; border-radius: var(--radius-s); }
.rail li > button { cursor: pointer; color: var(--ink); }
.rail li > button:hover { background: rgba(13, 36, 32, .05); }
.rail-num { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1.5px solid var(--rule); display: grid; place-items: center; font-size: .8rem; font-weight: 700; flex: none; background: var(--panel); }
.rail li.done .rail-num { background: var(--signal); border-color: var(--signal); color: var(--ink); }
.rail li.current > * { color: var(--ink); font-weight: 700; }
.rail li.current .rail-num { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.stage { padding: 2.25rem clamp(1.25rem, 4vw, 3.5rem) 4rem; outline: none; }
.view { max-width: 820px; }
.view h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); font-stretch: 115%; font-weight: 780; line-height: 1.08; outline: none; }
.view h2 { font-size: 1.15rem; font-stretch: 104%; font-weight: 720; margin: 0 0 .6rem; }
.view .lede { font-size: 1.1rem; }
.fine { color: var(--steel); font-size: .9rem; margin-top: 1.5rem; }
.hint { color: var(--steel); font-size: .9rem; margin: .45rem 0 0; }
.muted { color: var(--steel); }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 2rem; }
.choice { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.6rem; display: flex; flex-direction: column; align-items: flex-start; }
.choice p { flex: 1; color: var(--ink-2); }
@media (max-width: 760px) { .choice-grid { grid-template-columns: 1fr; } }

.field { margin: 1.4rem 0 0; max-width: 560px; }
.field label { display: block; font-weight: 650; margin-bottom: .4rem; }
select, input[type='text'] { width: 100%; font: inherit; font-size: 1rem; padding: .75rem .85rem; border: 1.5px solid var(--rule); border-radius: var(--radius-s); background: var(--panel); color: var(--ink); }
select:focus, input[type='text']:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(0, 176, 122, .35); }

.server-list { margin-top: 1.6rem; display: grid; gap: .5rem; }
.group-label { margin: 1rem 0 .1rem; font-size: .85rem; font-weight: 650; color: var(--steel); }
.server { display: flex; gap: .9rem; align-items: flex-start; padding: .95rem 1rem; background: var(--panel); border: 1.5px solid var(--rule); border-radius: var(--radius-m); cursor: pointer; }
.server:hover { border-color: #9fb3ad; }
.server.selected { border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.server input { margin-top: .25rem; width: 1.15rem; height: 1.15rem; accent-color: var(--signal-ink); }
.server-main { display: grid; gap: .1rem; }
.server-name { font-weight: 700; }
.server-meta { color: var(--steel); font-size: .9rem; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }
.loading { display: flex; align-items: center; gap: .7rem; color: var(--ink-2); margin: 1.5rem 0; }
.spinner { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2.5px solid var(--rule); border-top-color: var(--signal-ink); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.plan-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.25rem 0 1.5rem; padding: 1rem 1.15rem; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); }
.plan-summary dt { font-size: .8rem; color: var(--steel); font-weight: 600; }
.plan-summary dd { margin: .15rem 0 0; font-weight: 650; overflow-wrap: break-word; }
.plan-summary dd small { display: block; font-weight: 500; color: var(--steel); font-size: .88rem; }
@media (max-width: 700px) { .plan-summary { grid-template-columns: 1fr; } }

.panel { border-radius: var(--radius-m); padding: 1rem 1.2rem; margin: 1.25rem 0; border: 1px solid; }
.panel p:last-child { margin-bottom: 0; }
.panel-title { font-weight: 750; font-size: 1.05rem; margin-bottom: .3rem; }
.panel-ok { background: var(--signal-soft); border-color: #9ad9c1; }
.panel-warn { background: var(--amber-soft); border-color: #e7c88e; }
.panel-error { background: var(--red-soft); border-color: #e2a99c; }
.panel-info { background: var(--panel); border-color: var(--rule); }
.panel pre { white-space: pre-wrap; word-break: break-word; margin: .6rem 0 0; }
.panel details summary { cursor: pointer; font-weight: 600; margin-top: .4rem; }

.result { margin: 1.6rem 0 0; }
.result ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.result li { position: relative; padding: .7rem .9rem .7rem 2.4rem; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-s); }
.result li::before { position: absolute; left: .85rem; top: .7rem; font-weight: 800; }
.result-block li::before { content: '\2715'; color: var(--red); }
.result-warn li::before { content: '!'; color: var(--amber); left: 1rem; }
.result-ok li::before { content: '\2713'; color: var(--signal-ink); }
.result-info li::before { content: '\2192'; color: var(--steel); }
.inline-fix { margin-top: .6rem; }

.inventory-wrap { margin-top: 2rem; }
.inventory { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: .8rem 1rem; margin-bottom: .6rem; }
.inventory summary { cursor: pointer; font-weight: 650; }
.inventory table { width: 100%; border-collapse: collapse; margin-top: .8rem; font-size: .92rem; }
.inventory th, .inventory td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--rule); }
.inventory th { font-size: .8rem; color: var(--steel); font-weight: 650; }

.what-happens { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.1rem 1.25rem; }
.what-happens ul { margin: 0; padding-left: 1.1rem; }
.what-happens li { margin-bottom: .35rem; }

.progress { background: var(--ink); color: #e6efec; border-radius: var(--radius-m); padding: 1.5rem 1.6rem; margin-top: 1rem; }
.progress h2 { color: #fff; }
.progress .hint { color: #b9c9c4; }
.clock { font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 800; font-stretch: 120%; margin: .2rem 0 .4rem; color: #fff; }
.progress-line { color: #c9d6d2; }
.hb { margin-top: 1rem; }
.hb-strip { display: flex; gap: 2px; height: 26px; overflow: hidden; align-items: stretch; }
.hb-strip i { flex: 0 0 3px; background: var(--signal); border-radius: 1px; }
.hb-counts { font-size: .9rem; color: #b9c9c4; margin: .5rem 0 0; }

.timings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 0 0 1.5rem; }
.timings dt { font-size: .8rem; color: var(--steel); font-weight: 600; }
.timings dd { margin: .1rem 0 0; font-size: 1.5rem; font-weight: 800; font-stretch: 115%; }
.checks { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 1.1rem 1.25rem; margin-bottom: .8rem; }
.checks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.checks .yes { color: var(--signal-ink); font-weight: 800; }
.checks .no { color: var(--red); font-weight: 800; }

.app-footer { border-top: 1px solid var(--rule); padding: 1rem 1.5rem; font-size: .8rem; color: var(--steel); background: var(--panel); }
.app-footer p { margin: 0 0 .25rem; max-width: none; }
.app-footer a { margin-right: .75rem; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .rail { border-right: 0; border-bottom: 1px solid var(--rule); padding: .75rem 1rem; overflow-x: auto; }
  .rail ol { position: static; display: flex; gap: .25rem; }
  .rail li > button, .rail li > .rail-static { white-space: nowrap; padding: .45rem .5rem; font-size: .85rem; }
  .who { display: none; }
}

@media print {
  .app-header, .rail, .actions, .app-footer, .skip { display: none !important; }
  .app-shell { display: block; }
  .stage { padding: 0; }
  body.app { background: #fff; }
  .panel, .checks, .plan-summary, .result li { break-inside: avoid; }
}
