/* Affinity Scan Studio — app chrome.
   Same face and palette as the viewer (viewer/style.css): Syne for display,
   the maroon-to-black gradient off the top edge, #4da3ff as the live accent.
   Fonts are served from viewer/fonts so there are no third-party requests. */

@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/syne-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Syne';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/syne-800.woff2') format('woff2');
}

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --page-bg: #050203;
  --bg: #0d0f12;
  --panel: rgba(18, 21, 26, 0.88);
  --line: rgba(255, 255, 255, 0.12);
  --text: #e8eaed;
  --dim: #9aa0a6;
  --accent: #4da3ff;
  --red: #8b0000;
  --maroon: #3b0909;
  --ember: #ff6b6b;
}

html, body { min-height: 100%; }

body {
  background: var(--page-bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The red glow is anchored off the top edge so it reads as light behind the
   wordmark rather than a flat wash — same construction as the viewer's
   loading screen, scaled down for a scrolling page. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(125% 70% at 50% -18%,
      #a51414 0%, #7d0f0f 14%, #4d0c0c 30%,
      var(--maroon) 46%, #150406 70%, var(--page-bg) 100%);
}

a { color: inherit; }

.wordmark {
  font-family: 'Syne', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 800;
  letter-spacing: 0.012em;
  line-height: 1.05;
  color: #fff;
  text-wrap: balance;
}

h1, h2, h3 {
  font-family: 'Syne', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 700;
  letter-spacing: .01em;
}

/* ------------------------------------------------------------------ shell */

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background: rgba(8, 4, 6, .5);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topnav .wordmark { font-size: 19px; text-decoration: none; }
.topnav .wordmark small {
  display: block;
  font-family: inherit;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255, 180, 180, .62);
  margin-top: 2px;
}

.who { display: flex; align-items: center; gap: 11px; }
.who .name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.who .role { font-size: 11px; color: rgba(240, 220, 220, .55); }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(150deg, #c11a1a, var(--red) 55%, var(--maroon));
  border: 1px solid rgba(255, 255, 255, .22);
}
.who a { font-size: 12px; color: rgba(240, 220, 220, .6); text-decoration: none; }
.who a:hover { color: #fff; }

/* ----------------------------------------------------------------- toast */

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 12px);
  z-index: 70;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: rgba(12, 6, 8, .95);
  border: 1px solid rgba(255, 140, 140, .5);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .6);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }


/* [hidden] loses to the display rules these carry, so state it explicitly. */
#samples[hidden] { display: none; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 34px 28px 72px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head h1 { font-size: 30px; }
.page-head p { color: rgba(240, 220, 220, .6); font-size: 13px; margin-top: 5px; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(10, 6, 8, .5);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .14s, border-color .14s, transform .14s;
}
.btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* inline-flex beats the UA [hidden] rule, so a .btn toggled with the hidden
   attribute stays on screen. Same trap as #samples[hidden] above. */
.btn[hidden] { display: none; }

.btn-primary {
  background: linear-gradient(160deg, #c11a1a, var(--red));
  border-color: rgba(255, 140, 140, .5);
  color: #fff;
}
.btn-primary:hover {
  background: linear-gradient(160deg, #d92222, #a01010);
  border-color: rgba(255, 175, 175, .85);
  transform: translateY(-1px);
}
.btn-ghost { background: none; }

/* -------------------------------------------------------- dashboard deck */

/* The dashboard is a fixed two-pane screen, not a scrolling document: the
   tour rail sits against the left edge of the window, the map fills the rest,
   and the rail is the only thing that scrolls — so the map never travels up
   or down out of view. No centred .wrap here; that column could hold a list
   or a usable map, not both. */
body.app { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
/* sticky buys nothing once the page cannot scroll, and a sticky element still
   raises a stacking context over the map's own controls. */
body.app .topnav { position: static; flex: 0 0 auto; }

.deck {
  flex: 1 1 auto;
  /* Without this the grid takes its content's height and the page — not the
     rail — is what ends up scrolling. */
  min-height: 0;
  display: grid;
  /* The rail is as wide as a row needs and no wider — the map is what this
     screen is mostly for. The upper bound stops it eating the map on an
     ultrawide monitor. */
  grid-template-columns: clamp(400px, 28vw, 480px) 1fr;
}

/* min-width:0 because a grid item defaults to min-width:auto and so refuses
   to shrink below its content — which on a narrow screen pushes the action
   buttons off the side of the rail instead of narrowing the row. */
.deck-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid rgba(255, 255, 255, .12);
  background: rgba(8, 4, 6, .38);
}

.deck-head { flex: 0 0 auto; padding: 22px 20px 14px; }
.deck-head h1 { font-size: 25px; }
.deck-head p { color: rgba(240, 220, 220, .6); font-size: 12px; margin-top: 4px; }

.tour-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* Don't chain the scroll out to the body when the rail hits its end. */
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 20px 22px;
  min-width: 0;
}

/* Rows follow .sample's idiom below — same hairline, same fill, same timing —
   so the list reads as the same family as the sample picker. */
.tour-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  /* The rail is a fixed-height flex column that scrolls, and flex items there
     shrink to fit by default instead of overflowing — which crushed every row
     until they overlapped and clipped their own titles. */
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(10, 6, 8, .45);
  overflow: hidden;
  transition: border-color .14s, background .14s;
}
/* The whole row opens the details popup, through the title's stretched hit
   area below; the locate and delete buttons sit above it and keep their own
   click. */
.tour-row[data-slug] { cursor: pointer; }
.tour-row:hover, .tour-row.lit {
  border-color: rgba(255, 140, 140, .8);
  background: rgba(139, 0, 0, .22);
}
/* The selected row and its enlarged pin are the same state seen twice, so it
   has to outrank plain hover rather than look like it. */
.tour-row.selected {
  border-color: rgba(255, 175, 175, .95);
  background: rgba(160, 12, 12, .34);
}
.tour-row.selected .row-art img { filter: none; }

.row-art {
  flex: 0 0 auto;
  width: 76px; height: 56px;
  border-radius: 7px;
  background: #100a0c;
  overflow: hidden;
  display: grid; place-items: center;
  position: relative;
}
/* The grid tinted the orthophoto hard so a wall of cards read as one surface.
   At row size that reads as mud, so only the desaturation survives. */
.row-art img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(.4) brightness(.9);
  transition: filter .2s;
}
.tour-row:hover .row-art img { filter: none; }
.row-art .noart {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 24px;
  color: rgba(255, 255, 255, .12);
}

.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
/* Tour names are often a raw scan filename with no spaces in it, and one long
   token is enough to shove the buttons off a phone screen. */
.row-body h3 { font-size: 15px; overflow-wrap: anywhere; }
/* A real button, reset to read as the heading it sits in. Its ::after covers
   the whole row (.tour-row is position: relative), which is what makes the
   card clickable everywhere without the row itself being a control. */
.row-title {
  padding: 0; border: 0; background: none;
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
}
.row-title::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
/* The ring goes on the whole card, since the whole card is what activates. */
.row-title:focus-visible { outline: none; }
.row-title:focus-visible::after { outline: 2px solid var(--ember); outline-offset: -2px; border-radius: 10px; }
.row-body .meta { font-size: 12px; color: rgba(240, 220, 220, .55); }
.row-body .stats {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 11px; color: rgba(240, 220, 220, .5);
  font-variant-numeric: tabular-nums;
}
/* One line, ellipsised: an address is arbitrarily long and must not reflow
   the row height and shove every pin association out of alignment. */
/* Flex so the address ellipsises on its own and the precision badge keeps its
   full width — truncating the badge to "APPROXIM…" would hide the one thing it
   exists to say. */
.row-site { display: flex; align-items: center; gap: 7px; font-size: 11px; min-width: 0; }
.row-site .addr {
  color: rgba(255, 190, 190, .7);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.row-site .noaddr { color: rgba(240, 220, 220, .3); font-style: italic; }
.row-site .approx {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 20px; font-size: 9px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  border: 1px solid rgba(255, 190, 120, .45);
  color: rgba(255, 205, 150, .9);
}

/* Stacked in the row's right edge, and above the title's stretched hit area
   so a click on either button is not also a click on the card. */
.row-acts {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* One shared class for both row actions. The only other button vocabulary
   here is .btn/.btn-primary/.btn-ghost, which is sized for dialogs, not for a
   corner of a list row. Colours are the file's existing literals. */
.row-act {
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(10, 6, 8, .5);
  color: rgba(240, 220, 220, .55);
  font: 600 11px/1 -apple-system, BlinkMacSystemFont, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
}
.row-act svg { width: 13px; height: 13px; }
.row-act:not(:disabled):hover {
  border-color: rgba(255, 140, 140, .8);
  background: rgba(139, 0, 0, .22);
  color: #fff;
}
.row-act:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.row-act.del:hover { background: #b31414; border-color: rgba(255, 190, 190, .9); }
/* A tour with no coordinates has nothing to locate. */
.row-act:disabled { opacity: .3; cursor: default; }

/* Collapse and slide, not the grid's scale(.95) — a full-width row shrinking
   toward its own centre reads as a glitch; closing the gap reads as a list. */
.tour-row.dropping {
  opacity: 0;
  transform: translateX(-16px);
  max-height: 0;
  min-height: 0;
  padding-top: 0; padding-bottom: 0;
  margin-bottom: -10px;              /* eat the flex gap as it goes */
  border-width: 0;
  transition: opacity .2s, transform .2s, max-height .25s, padding .25s,
              margin .25s, border-width .25s;
}

.row-new {
  justify-content: center;
  gap: 10px;
  padding: 16px 12px;
  border-style: dashed;
  border-color: rgba(255, 140, 140, .45);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.row-new .plus {
  font-family: 'Syne', sans-serif;
  font-size: 22px; font-weight: 800; line-height: 1;
  color: rgba(255, 160, 160, .85);
}
.row-new > span:last-child { min-width: 0; }
.row-new strong { display: block; font-size: 14px; font-weight: 700; }
.row-new em { font-style: normal; font-size: 12px; color: rgba(240, 220, 220, .55); }
.row-new:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* The map fills its half of the deck edge to edge — no card border, no radius,
   nothing that reads as a widget sitting on a page. */
.deck-map { position: relative; min-width: 0; }
.map-pane {
  position: absolute;
  inset: 0;
  background: rgba(10, 6, 8, .45);
  overflow: hidden;
}
/* [hidden] loses to display:grid, same as #samples above. */
.map-pane[hidden] { display: none; }
.map-empty {
  height: 100%;
  display: grid; place-items: center;
  padding: 24px; text-align: center;
  font-size: 13px; color: rgba(240, 220, 220, .42);
}

/* Upload lives over the bottom-right of the map: the rail's own header row is
   too narrow for it once the map has the majority of the screen. */
.map-fab {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
}

/* Two panes still fit, but the rail gives up width first — the map is the
   half that gets useless when squeezed. */
@media (max-width: 1080px) {
  .deck { grid-template-columns: minmax(300px, 38vw) 1fr; }
}

/* Below this there is no map worth reading. It goes, the rail becomes the
   whole page, and the page scrolls normally again. map.js asks the pane for
   its computed display, so the Maps JS is never requested here — a billed
   request for nothing. */
@media (max-width: 640px) {
  body.app { height: auto; overflow: visible; }
  .deck { grid-template-columns: 1fr; }
  .deck-map { display: none; }
  .tour-list { overflow: visible; overscroll-behavior: auto; }
  /* No map on screen, so nothing to locate on. */
  .row-act.locate { display: none; }
}


/* ------------------------------------------------------------ edit modal */

.cover-row { display: flex; gap: 14px; align-items: flex-start; }

.cover-prev {
  flex: 0 0 auto;
  width: 132px; height: 84px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: #100a0c center / cover no-repeat;
  display: grid; place-items: center;
  overflow: hidden;
}
.cover-prev .noart {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 28px;
  color: rgba(255, 255, 255, .12);
}

.cover-acts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.cover-acts .btn { padding: 7px 13px; font-size: 12px; }
.cover-note { font-size: 11px; color: rgba(240, 220, 220, .45); line-height: 1.5; }

#edit-address:disabled { opacity: .5; cursor: not-allowed; }

/* The row is the positioning context for the suggestion list, so the list
   tracks the input and not the dialog. */
.addr-row { display: flex; gap: 8px; align-items: stretch; position: relative; }

/* ------------------------------------------------- address suggestions */

.suggest {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  /* Stops short of the Find button so the list lines up with the field. */
  right: 74px;
  z-index: 30;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 232px;
  overflow-y: auto;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: #14090b;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
}

.suggest[hidden] { display: none; }

.suggest-item {
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.35;
}

/* One class for hover and for keyboard focus: the arrow keys move the same
   highlight the mouse does, so there is only ever one selected row. */
.suggest-item.active { background: rgba(139, 0, 0, .55); }

.suggest-main {
  display: block;
  font-size: 13px;
  color: rgba(255, 235, 235, .95);
}

.suggest-sec {
  display: block;
  font-size: 11.5px;
  color: rgba(240, 220, 220, .5);
}

.suggest-item.active .suggest-sec { color: rgba(255, 225, 225, .72); }
.addr-row input { flex: 1; min-width: 0; }
.addr-row .btn { flex: 0 0 auto; padding: 0 15px; font-size: 12px; }

.geo-result {
  margin-top: 9px;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(5, 2, 3, .5);
  font-size: 12px;
  line-height: 1.5;
}
.geo-result[hidden] { display: none; }
.geo-result.bad { border-color: rgba(255, 120, 120, .5); background: rgba(90, 8, 8, .4); }
.geo-result .matched { color: rgba(255, 190, 190, .85); }
.geo-result .warn {
  display: block; margin-top: 5px;
  color: rgba(255, 205, 150, .9);
}


.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 140, 140, .4);
  color: rgba(255, 190, 190, .9);
  background: rgba(139, 0, 0, .3);
}

.empty {
  border: 1px dashed rgba(255, 255, 255, .16);
  border-radius: 12px;
  padding: 46px 24px;
  text-align: center;
  color: rgba(240, 220, 220, .55);
}

/* ------------------------------------------------------------------ login */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 14px;
  background: rgba(10, 6, 8, .55);
  backdrop-filter: blur(10px);
  padding: 34px 30px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.login-card .wordmark { font-size: clamp(26px, 5vw, 34px); margin-bottom: 6px; }
.login-card .sub {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 180, 180, .6);
  margin-bottom: 26px;
}

.field { text-align: left; margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(240, 220, 220, .55);
  margin-bottom: 6px;
}
input[type=text], input[type=password], select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(5, 2, 3, .6);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
input:focus, select:focus {
  outline: none;
  border-color: rgba(255, 140, 140, .8);
  box-shadow: 0 0 0 3px rgba(139, 0, 0, .3);
}
select option { background: #14090c; }

.login-card .btn { width: 100%; justify-content: center; margin-top: 8px; }

.error {
  border: 1px solid rgba(255, 120, 120, .5);
  background: rgba(139, 0, 0, .3);
  color: #ffd4d4;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 12px;
  margin-bottom: 16px;
}
.hint {
  margin-top: 20px;
  font-size: 11px;
  color: rgba(240, 220, 220, .42);
  line-height: 1.6;
}
.hint code {
  color: rgba(255, 190, 190, .95);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ------------------------------------------------------------------ modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 1, 2, .74);
  backdrop-filter: blur(6px);
}
.modal[hidden] { display: none; }
.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  background: #0c0508;
  padding: 26px 28px 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .7);
}
.modal-card h2 { font-size: 21px; margin-bottom: 4px; }
.modal-card .sub { color: rgba(240, 220, 220, .55); font-size: 12px; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------------------------------------------------------- details modal */

/* The picture runs edge to edge across the top of the card, so the card's
   top padding goes and the image's negative side margins undo the rest. */
.details-card { max-width: 560px; padding-top: 0; }
.det-art {
  margin: 0 -28px 20px;
  height: 220px;
  background: #100a0c;
  display: grid; place-items: center;
  overflow: hidden;
}
.det-art img { width: 100%; height: 100%; object-fit: cover; }
.det-art .noart {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 64px;
  color: rgba(255, 255, 255, .12);
}
.details-card h2 { overflow-wrap: anywhere; }
.det-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin: 0;
}
.det-list > div { min-width: 0; }
.det-list > div[hidden] { display: none; }
.det-list .wide { grid-column: 1 / -1; }
.det-list dt {
  font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(240, 220, 220, .45);
  margin-bottom: 4px;
}
.det-list dd { margin: 0; font-size: 13px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
/* The row ellipsises the address to hold its height; here there is room for
   all of it. */
.det-site .addr { white-space: normal; font-size: 13px; }
.details-card .modal-actions { flex-wrap: wrap; }
/* Close sits apart on the left, away from the actions that do something. */
.details-card .det-close { margin-right: auto; }
.modal-actions a.btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
}
.btn.ok { color: #7ee081; border-color: rgba(126, 224, 129, .6); }

/* Building layout: a labelled group under the scan's own details. */
.det-layout {
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.det-layout[hidden], .det-bldgs[hidden] { display: none; }
.det-layout h3 { font-size: 13px; margin-bottom: 12px; }
.det-bldgs { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.det-bldgs li {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px;
  padding: 7px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .04);
}
.det-bldgs .b-name { min-width: 0; overflow-wrap: anywhere; }
.det-bldgs .b-count { flex: 0 0 auto; color: rgba(240, 220, 220, .55); font-variant-numeric: tabular-nums; }

.dropzone {
  border: 1px dashed rgba(255, 140, 140, .45);
  border-radius: 11px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: background .14s, border-color .14s;
}
.dropzone:hover, .dropzone.over {
  background: rgba(139, 0, 0, .22);
  border-color: rgba(255, 170, 170, .9);
}
.dropzone .big { font-family: 'Syne', sans-serif; font-weight: 800; font-size: 15px; }
.dropzone .small { font-size: 12px; color: rgba(240, 220, 220, .55); margin-top: 4px; }
.dropzone.picked { border-style: solid; border-color: rgba(255, 170, 170, .9); }

.sep {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(240, 220, 220, .38);
}
.sep::before, .sep::after {
  content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, .12);
}

.sample {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 8px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(5, 2, 3, .5);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color .14s, background .14s;
}
.sample:hover, .sample.on {
  border-color: rgba(255, 140, 140, .85);
  background: rgba(139, 0, 0, .26);
}
.sample .sz { font-size: 11px; color: rgba(240, 220, 220, .5); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- progress */

.build-page { max-width: 720px; }

.bar {
  height: 9px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
  margin: 18px 0 10px;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--red), #e02626 60%, var(--ember));
  transition: width .45s ease-out;
}
/* Nothing streams a percentage during the E57 index read, so the bar shows
   motion rather than a frozen sliver. */
.bar.indeterminate > i {
  width: 32% !important;
  animation: slide 1.5s ease-in-out infinite;
}
@keyframes slide { 0% { margin-left: -32%; } 100% { margin-left: 100%; } }

.pct {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 44px;
  font-variant-numeric: tabular-nums;
}
.build-msg { color: rgba(240, 220, 220, .68); font-size: 13px; min-height: 20px; }

.steps { list-style: none; margin: 26px 0 0; display: grid; gap: 2px; }
.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13px;
  color: rgba(240, 220, 220, .42);
  transition: background .2s, color .2s;
}
.steps li .dot {
  width: 18px; height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .2);
  display: grid; place-items: center;
  font-size: 10px;
}
.steps li.active {
  background: rgba(139, 0, 0, .26);
  color: #fff;
}
.steps li.active .dot { border-color: var(--ember); }
.steps li.active .dot::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ember);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .3; transform: scale(.7); } }
.steps li.done { color: rgba(240, 220, 220, .72); }
.steps li.done .dot { border-color: rgba(255, 140, 140, .7); color: var(--ember); }
.steps li.done .dot::after { content: '✓'; }

.log {
  margin-top: 22px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  background: rgba(3, 1, 2, .6);
  padding: 12px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.7;
  color: rgba(200, 190, 195, .62);
  max-height: 190px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.done-panel {
  margin-top: 28px;
  border: 1px solid rgba(255, 140, 140, .45);
  background: rgba(139, 0, 0, .2);
  border-radius: 12px;
  padding: 22px 24px;
  text-align: center;
}
.done-panel h2 { font-size: 22px; margin-bottom: 6px; }
.done-panel p { font-size: 13px; color: rgba(240, 220, 220, .65); margin-bottom: 16px; }
.done-panel .btn + .btn { margin-left: 10px; }

.fail-panel {
  margin-top: 24px;
  border: 1px solid rgba(255, 120, 120, .5);
  background: rgba(90, 8, 8, .4);
  border-radius: 12px;
  padding: 18px 20px;
  font-size: 13px;
}

@media (max-width: 560px) {
  .wrap { padding: 24px 18px 60px; }
  .topnav { padding: 14px 18px; }
  .who .name, .who .role { display: none; }
  .deck-head { padding: 18px 14px 12px; }
  .tour-list { padding: 2px 14px 20px; }
  .row-art { width: 72px; height: 54px; }
  .row-body .stats { display: none; }
}
