/* Preconfiguration.com Alpha live demo: embedded in preconfiguration.com/demo/ or opened full
 * screen at /demo/app/. Same look as the other project demos: navy, teal, and plain cards. */
:root {
  --navy: #1F3A5F;
  --navy-2: #2A4B75;
  --teal: #0E7C86;
  --teal-2: #0A646C;
  --teal-light: #E6F3F4;
  --ink: #262626;
  --gray: #5F6B7A;
  --gray-2: #8A95A3;
  --rule: #D5DDE5;
  --zebra: #F4F7F9;
  --off: #EEF1F4;
  --bg: #F7F9FB;
  --card: #FFFFFF;
  --amber: #B8700F;
  --amber-light: #FBF1E1;
  --red: #C0392B;
  --red-light: #FBEAE8;
  --green: #2E7D4F;
  --green-light: #E7F4EC;
  --term: #0F1B2A;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: var(--teal); }
button, select, input, textarea { font: inherit; }
[hidden] { display: none !important; }
code { font-family: var(--mono); font-size: .92em; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---- app bar (full screen only) ------------------------------------------------------ */
.appbar { background: #000; color: #fff; }
.appbar .wrap { display: flex; align-items: center; gap: 14px; min-height: 56px; }
.brand { color: rgba(255,255,255,.9); font-family: "avenir next", avenir, sans-serif; font-weight: 200; font-size: 24px; text-decoration: none; }
.brand:hover { color: #fff; }
.appbar .tag { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; background: rgba(255,255,255,.14); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.appbar .grow { flex: 1; }
.appbar .home { color: rgba(255,255,255,.85); font-size: 15px; text-decoration: none; white-space: nowrap; }
.appbar .home:hover { color: #fff; text-decoration: underline; }

.embedded .appbar { display: none; }
.embedded body { background: transparent; }
.embedded .wrap { padding-left: 0; padding-right: 0; }
.embedded .controls { margin-top: 0; }
.embedded .appfoot { padding-bottom: 8px; }

/* ---- controls ----------------------------------------------------------------------- */
.controls {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247,249,251,.96); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule); margin: 12px 0 12px;
}
.controls .wrap { display: flex; align-items: center; gap: 10px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--rule); background: #fff; color: var(--navy);
  font-weight: 650; font-size: 15.5px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:hover { border-color: var(--gray-2); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(14,124,134,.35); outline-offset: 2px; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-2); border-color: var(--teal-2); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.progress { flex: 1 1 180px; min-width: 160px; display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: 8px; background: var(--off); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--teal); border-radius: 99px; transition: width .2s linear; }
.progress .pct { font-variant-numeric: tabular-nums; color: var(--gray); font-size: 14px; min-width: 8em; text-align: right; }

/* ---- step tabs ------------------------------------------------------------------------ */
.steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.steps button {
  text-align: left; border: 1px solid var(--rule); background: #fff; border-radius: 10px; padding: 8px 10px;
  cursor: pointer; color: var(--navy); min-height: 58px; display: flex; flex-direction: column; gap: 2px;
}
.steps button:hover { border-color: var(--teal); }
.steps button b { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--teal); }
.steps button span { font-size: 13.5px; line-height: 1.3; }
.steps button.on { border-color: var(--teal); background: var(--teal-light); box-shadow: 0 0 0 2px rgba(14,124,134,.2); }
.steps button.done b::after { content: " \2713"; color: var(--green); }

/* ---- stage ---------------------------------------------------------------------------- */
.stage { background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 18px 20px 20px; }
.eyebrow { color: var(--teal); font-weight: 700; font-size: 12.5px; letter-spacing: 1.4px; text-transform: uppercase; margin: 0 0 4px; }
.scene-head h2 { color: var(--navy); font-size: 24px; line-height: 1.2; margin: 0 0 6px; }
.scene-text { margin: 0 0 14px; max-width: 980px; color: #333; }
.scene-outro {
  margin: 14px 0 0; background: var(--teal-light); border: 1px solid #b9dde0; color: #0c4f55;
  border-radius: 10px; padding: 10px 14px; font-size: 15.5px;
}
.stage-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: 16px; align-items: stretch; }

.term-card { background: var(--term); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #0a1420; }
.term-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #2c3a4c; }
.term-title { margin-left: 8px; color: #8fa3b8; font-size: 12.5px; }
.term {
  font-family: var(--mono); font-size: 12.2px; line-height: 1.55; color: #cfd9e4;
  padding: 10px 12px 14px; min-height: 520px; flex: 1 1 0; overflow: auto; white-space: pre-wrap; word-break: break-word;
  contain: size; /* the terminal's content never sets the height of the row */
}
.term .l { display: block; animation: fadein .25s ease-out; min-height: 1.55em; }
.term .cmd { color: #7ee0e6; font-weight: 700; margin-top: 6px; }
.term .dim { color: #7f93a8; }
.term .hint { color: #8fa3b8; }
.term .err { color: #ff8c7e; }
.term .warn { color: #f2c46d; }
.term .note { color: #a9b8c8; }
.term .ok { color: #8fdca8; }
.term .good { color: #8fdca8; font-weight: 700; }
.term .bad { color: #ff8c7e; font-weight: 700; }
.term .have { color: #7ee0e6; }
.term .out { color: #e8eef5; }
.term .exit { color: #8fa3b8; font-style: italic; }
@keyframes fadein { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

.panel-card { border: 1px solid var(--rule); border-radius: 12px; padding: 12px; min-width: 0; display: flex; flex-direction: column; }
.panel { display: flex; flex-direction: column; gap: 10px; height: 100%; min-width: 0; }
.p-h { font-size: 15.5px; color: var(--navy); margin: 2px 0 0; }
.p-sub { color: var(--gray); font-weight: 400; font-size: 13.5px; margin-left: 4px; }
.muted { color: var(--gray); font-size: 14.5px; }
.muted.small, .small.muted { font-size: 13px; }

/* file lists */
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.files li { border: 1px solid var(--off); border-radius: 10px; padding: 7px 10px; background: #fff; transition: background .25s, border-color .25s, opacity .25s; }
.files li .fn { font-family: var(--mono); font-size: 13px; color: var(--navy); font-weight: 650; }
.files li .fd { display: block; color: var(--gray); font-size: 13px; }
.files li.read { border-color: #b9dde0; background: var(--teal-light); }
.files li.read .fd { color: #0c4f55; }
.files li.skip { opacity: .55; }
.files li.changed { border-color: #edd3a8; background: var(--amber-light); }
.files li.changed .fd { color: #7a4a09; }
.files li.same { opacity: .6; }
.files li.fixed { border-color: #b7dcc4; background: var(--green-light); }
.files li.fixed .fd { color: #1f5e3a; }
.files .pick { font-family: var(--mono); font-size: 12.3px; color: #0c4f55; display: block; }
.verdict-line { border-radius: 10px; padding: 9px 12px; font-size: 14.5px; background: var(--green-light); color: #1f5e3a; border: 1px solid #b7dcc4; }
.verdict-line.warn { background: var(--amber-light); color: #7a4a09; border-color: #edd3a8; }

/* the targets diagram */
#targets { width: 100%; height: auto; display: block; }
#targets text { font-family: var(--sans); }
#targets .src { fill: var(--navy); }
#targets .src-name { fill: #fff; font-size: 15px; font-weight: 750; font-family: var(--mono); }
#targets .src-sub { fill: #bcd0e4; font-size: 12px; }
#targets .engine { fill: var(--teal); }
#targets .engine-name { fill: #fff; font-size: 14px; font-weight: 750; }
#targets .box { fill: #fff; stroke: #C3CDD8; stroke-width: 1.3; transition: fill .25s, stroke .25s; }
#targets .name { font-size: 14px; font-weight: 700; fill: var(--navy); }
#targets .sub { font-size: 11.5px; fill: var(--gray); font-family: var(--mono); }
#targets .size { font-size: 11.5px; fill: var(--green); font-weight: 700; }
#targets .wire { stroke: #C3CDD8; stroke-width: 2; fill: none; transition: stroke .25s; }
#targets .t.on .box { fill: var(--green-light); stroke: var(--green); }
#targets .t.on .wire { stroke: var(--green); }

/* file viewer */
.viewer { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; min-width: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 0; background: var(--zebra); border-bottom: 1px solid var(--rule); }
.tabs button { border: 0; border-right: 1px solid var(--rule); background: transparent; padding: 6px 10px; font: 12.3px var(--mono); color: var(--navy); cursor: pointer; }
.tabs button:hover { background: #fff; }
.tabs button.on { background: #fff; font-weight: 700; box-shadow: inset 0 -2px 0 var(--teal); }
.code { margin: 0; background: #fff; padding: 8px 10px; font: 11.8px/1.5 var(--mono); white-space: pre; overflow: auto; max-height: 250px; color: #22303f; }
.code.small { max-height: 200px; background: var(--zebra); border: 1px solid var(--off); border-radius: 8px; }
.code .c { color: var(--gray-2); }
.code .ln { display: block; min-height: 1.5em; }
.code .add { background: var(--green-light); color: #1f5e3a; display: block; }
.code .rm { background: var(--red-light); color: var(--red); display: block; }
.code .hunk { color: var(--teal-2); display: block; }
.code .fh { color: var(--navy); font-weight: 700; display: block; }
.here { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.here .ok { color: var(--green); font-weight: 650; }
.here .bad { color: var(--red); font-weight: 650; }

/* counters */
.counters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.counters.three { grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr) minmax(0, 1fr); }
.counter { background: var(--zebra); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.counter .n { font-size: 20px; font-weight: 750; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.25; }
.counter .l { font-size: 12px; color: var(--gray); }
.counter.badn .n { color: var(--red); }
.counter.warnn .n { color: var(--amber); }
.counter.good { background: var(--green-light); }
.counter.good .n { color: var(--green); }
.counter.bad { background: var(--red-light); }
.counter.bad .n { color: var(--red); }
#v-have { font-size: 14.5px; line-height: 1.4; }

/* findings */
.findings { display: flex; flex-direction: column; gap: 8px; overflow: auto; max-height: 470px; }
.fcard { border: 1px solid var(--rule); border-radius: 10px; padding: 8px 10px; }
.fcard h4 { margin: 0 0 4px; font: 700 13px var(--mono); color: var(--navy); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.fcard h4 small { font: 400 12.5px var(--sans); color: var(--gray); }
.fcard.missing { border-style: dashed; }
.frow { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 2px 8px; padding: 4px 0; border-top: 1px solid var(--off); font-size: 13.2px; animation: fadein .25s ease-out; }
.frow:first-of-type { border-top: 0; }
.sev { font: 700 11px/1.9 var(--sans); letter-spacing: .5px; text-transform: uppercase; text-align: center; border-radius: 6px; height: 21px; }
.sev.error { background: var(--red-light); color: var(--red); }
.sev.warning { background: var(--amber-light); color: var(--amber); }
.sev.note { background: var(--off); color: var(--gray); }
.frow .msg { color: var(--ink); }
.frow .msg code { font-size: 12px; color: var(--gray); }
.frow .so { grid-column: 2; color: var(--gray); font-size: 12.8px; }

/* timeline */
.timeline { display: flex; flex-direction: column; gap: 3px; }
.trow { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 52px; gap: 8px; align-items: center; font-size: 12.8px; min-height: 22px; }
.trow .tn { font-family: var(--mono); font-size: 12px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .tb { position: relative; height: 12px; background: var(--off); border-radius: 99px; }
.trow .tb i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: #7d8ea3; min-width: 3px; }
.trow.run .tb i { background: repeating-linear-gradient(90deg, var(--teal) 0 6px, #52b1b8 6px 12px); animation: run 1s linear infinite; background-size: 24px 100%; }
.trow.ok .tb i { background: var(--green); }
.trow.fail .tb i { background: var(--red); }
.trow.fail .tn { color: var(--red); font-weight: 700; }
.trow .ts { text-align: right; font-variant-numeric: tabular-nums; color: var(--gray); }
.trow.wait { opacity: .45; }
@keyframes run { to { background-position: 24px 0; } }
.machine-card { background: var(--term); border-radius: 10px; overflow: hidden; margin-top: auto; }
.machine-bar { color: #8fa3b8; font-size: 12px; padding: 6px 10px; background: #0a1420; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.machine-bar span { color: #7ee0e6; font-family: var(--mono); }
.machine { font: 11px/1.45 var(--mono); color: #a9b8c8; height: 150px; overflow: hidden; padding: 6px 10px; white-space: pre; display: flex; flex-direction: column; justify-content: flex-end; }
.machine .mk { color: #7ee0e6; font-weight: 700; }
.machine .er { color: #ff8c7e; }

details.diffs summary { cursor: pointer; color: var(--teal); font-size: 14px; margin: 4px 0; }

/* ---- sections below -------------------------------------------------------------------- */
.section { scroll-margin-top: 84px; margin: 22px 0 0; background: #fff; border: 1px solid var(--rule); border-radius: 14px; padding: 20px 20px 22px; }
.section h2 { color: var(--navy); font-size: 23px; margin: 0 0 6px; }
.section h3 { color: var(--navy); font-size: 17px; margin: 18px 0 8px; }
.section p { margin: 6px 0; max-width: 940px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.preset { border: 1px solid var(--rule); background: var(--zebra); color: var(--navy); border-radius: 99px; padding: 5px 12px; font-size: 13.5px; cursor: pointer; text-align: left; }
.preset:hover { border-color: var(--teal); background: var(--teal-light); }
.preset.on { border-color: var(--teal); background: var(--teal-light); font-weight: 650; }
.preset small { color: var(--gray); }
.lab-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 12px; }
.lab-grid textarea {
  width: 100%; min-height: 330px; resize: vertical; border: 1px solid var(--rule); border-radius: 10px;
  padding: 10px 12px; font: 13px/1.5 var(--mono); color: var(--ink); background: #fff; tab-size: 2;
}
.lab-grid textarea:focus, .kind select:focus { outline: 3px solid rgba(14,124,134,.25); border-color: var(--teal); }
.lab-side { display: flex; flex-direction: column; gap: 10px; align-items: stretch; min-width: 0; }
.lab-side .btn { align-self: flex-start; }
.lab-status { font-size: 13.5px; margin: 4px 0 0; color: var(--gray); }
.lab-status.good { color: var(--green); font-weight: 650; }
.lab-status.bad { color: var(--red); font-weight: 650; }
.kind { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--gray); margin-bottom: 8px; }
.kind select { min-height: 42px; border: 1px solid var(--rule); border-radius: 10px; padding: 0 10px; font-size: 14px; color: var(--ink); background: #fff; max-width: 100%; }
.check { font-size: 14px; color: var(--navy); display: inline-flex; gap: 6px; align-items: center; }
.diags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.diags li { border: 1px solid var(--off); border-radius: 10px; padding: 7px 10px; font-size: 13.5px; display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 2px 8px; }
.diags li .where { font: 12px var(--mono); color: var(--gray); }
.diags li .hint { grid-column: 2; color: var(--gray); font-size: 13px; white-space: pre-wrap; }
.diags li.clean { display: block; background: var(--green-light); border-color: #b7dcc4; color: #1f5e3a; font-weight: 650; }
.diags li.info { display: block; color: var(--gray); }

.real { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.real h3 { margin-top: 0; }
.real ul { margin: 0; padding-left: 20px; }
.real li { margin: 4px 0; }

.appfoot { color: var(--gray); font-size: 13.5px; padding: 22px 0 36px; }
.noscript, .fatal { background: var(--red-light); color: var(--red); border-radius: 10px; padding: 12px 14px; margin: 16px 0; font-weight: 600; }

/* ---- smaller screens ------------------------------------------------------------------- */
@media (max-width: 1060px) {
  .stage-grid { grid-template-columns: minmax(0, 1fr); }
  .term { min-height: 340px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lab-grid { grid-template-columns: minmax(0, 1fr); }
  .findings { max-height: none; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .embedded .wrap { padding-left: 0; padding-right: 0; }
  .appbar .home { display: none; }
  .controls .wrap { gap: 6px; padding-top: 7px; padding-bottom: 7px; }
  .controls .btn { flex: 1 1 0; min-width: 0; padding: 0 4px; font-size: 14px; gap: 5px; min-height: 42px; }
  .controls .btn .long { display: none; }
  .progress { flex-basis: 100%; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps button { min-height: 50px; }
  .stage, .section { padding: 14px 14px 16px; }
  .scene-head h2 { font-size: 21px; }
  .term { font-size: 11.2px; min-height: 300px; }
  .counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .counters.three { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .counters.three .counter:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .trow { grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) 46px; }
  .real { grid-template-columns: minmax(0, 1fr); }
  .lab-grid textarea { min-height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  .bar > i, .term .l, .files li, .frow, #targets .box, #targets .wire { transition: none; animation: none; }
  .trow.run .tb i { animation: none; }
}
