/* Prospekt. Builds on base.css (Basalt tokens). Ember is only used while something is live. */

.pk-page { min-height: 100%; }
a.btn { text-decoration: none; }

.pk-top {
  height: 56px; padding: env(safe-area-inset-top) 20px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--line);
}
.pk-top__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pk-top__sep { color: var(--line-strong); font-size: 18px; }
.pk-top__app { font-weight: 600; font-size: 15px; text-decoration: none; }
.pk-top__right { display: flex; align-items: center; gap: 8px; }
.pk-top .avatar { width: 28px; height: 28px; font-size: 12px; }

.pk {
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100% - 56px);
}

/* ---------- Sidebar: drop zone + list ---------- */

.pk-side { border-right: 1px solid var(--line); padding: 20px 16px 32px; display: flex; flex-direction: column; gap: 18px; }

.drop {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  cursor: pointer; transition: border-color 0.15s, background-color 0.15s; overflow: hidden;
}
.drop:hover, .drop.is-over { border-color: var(--text-3); background: var(--surface); }
.drop:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.drop.is-busy { pointer-events: none; border-style: solid; border-color: var(--ember-line); }
.drop__icon {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2);
}
.drop.is-over .drop__icon { color: var(--text); background: var(--surface-3); }
.drop__text { display: grid; gap: 2px; min-width: 0; }
.drop__title { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop__hint { font-size: 12.5px; color: var(--text-3); }
.drop__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--surface-2); }
.drop__bar > span { display: block; height: 100%; width: 0; background: var(--ember); transition: width 0.2s; }

.signin-cta {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; background: var(--surface);
}
.signin-cta:hover { border-color: var(--line-strong); background: var(--surface-2); }
.page-link.is-plain { cursor: default; }
.page-link.is-plain:hover { color: var(--text-3); background: var(--surface-2); }

.share {
  display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.share__toggle { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; cursor: pointer; width: fit-content; }
.share__toggle input { width: 17px; height: 17px; accent-color: var(--text-2); }
.share__status { font-size: 13px; color: var(--text-2); margin-top: -4px; }
.share__row { display: flex; gap: 8px; align-items: center; }
.share__row input {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--text); font-size: 13.5px;
}
.share__row input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.share__note { margin: 0; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }

.pk-side__title {
  margin: 6px 0 -8px; padding: 0 6px; font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3);
}
.jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.jobs__empty { padding: 6px; font-size: 13px; color: var(--text-3); line-height: 1.5; }
.job {
  display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 9px 10px; border-radius: var(--r-sm); text-decoration: none;
}
.job:hover { background: var(--surface-2); }
.job[aria-current="page"] { background: var(--surface-3); }
.job__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--stone); justify-self: center; }
.job__dot.is-live { background: var(--ember); animation: pulse 1.4s ease-in-out infinite; }
.job__dot.is-failed { background: var(--danger); }
.job__text { display: grid; min-width: 0; }
.job__name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job__sub { font-size: 12px; color: var(--text-3); }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- Main ---------- */

.pk-main { padding: 36px 40px 64px; min-width: 0; }
.pk-main > * { max-width: 860px; }
.pk-main > .report-layout { max-width: none; }

.empty { padding-top: 48px; max-width: 620px; }
.empty__icon {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text);
}
.empty__icon .icon { width: 24px; height: 24px; }
.empty__title { margin: 22px 0 0; font-size: clamp(26px, 3.4vw, 34px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.empty__lede { margin: 14px 0 0; font-size: 15.5px; line-height: 1.65; color: var(--text-2); }
.empty__note { margin: 18px 0 0; font-size: 13px; color: var(--text-3); }

.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Progress */
.run { display: grid; gap: 14px; max-width: 620px; }
.run__title { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.run__meta { margin: -8px 0 6px; font-size: 13px; color: var(--text-3); }
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter__fill { display: block; height: 100%; border-radius: 99px; background: var(--ember); transition: width 0.6s var(--ease); }
.stages { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.stage { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-3); }
.stage__mark {
  width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  display: grid; place-items: center; flex: none;
}
.stage.is-done { color: var(--text-2); }
.stage.is-done .stage__mark { background: var(--surface-3); border-color: transparent; color: var(--text); }
.stage.is-live { color: var(--text); font-weight: 500; }
.stage.is-live .stage__mark { border-color: var(--ember); box-shadow: inset 0 0 0 4px var(--ember-soft); }
.run__note { margin: 4px 0 0; font-size: 13.5px; color: var(--text-2); min-height: 1.5em; font-variant-numeric: tabular-nums; }
.run__hint { margin: 0; font-size: 12.5px; color: var(--text-3); }

.verdict {
  margin: 0; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md);
  font-size: 14.5px; line-height: 1.5;
}
.verdict .icon { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.verdict--warn { background: var(--danger-soft); color: var(--danger); }

/* Report */
.report { display: grid; gap: 28px; }
.report__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.report__heading { min-width: 0; }
.report__title { margin: 0; font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; overflow-wrap: anywhere; }
.report__meta { margin: 6px 0 0; font-size: 13px; color: var(--text-3); overflow-wrap: anywhere; }
.report__summary { margin: 0; font-size: 16px; line-height: 1.7; color: var(--text); max-width: 70ch; }
.report__none { margin: 0; color: var(--text-2); }

.block { display: grid; gap: 12px; }
.block__title { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.block__title .icon { color: var(--text-3); }
.count {
  font-size: 12px; font-weight: 500; color: var(--text-3); background: var(--surface-2);
  border-radius: 99px; padding: 1px 8px; font-variant-numeric: tabular-nums;
}

.facts-grid {
  margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface);
}
.fact { padding: 13px 15px; min-width: 0; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.fact dt { font-size: 12.5px; color: var(--text-3); }
.fact dd { margin: 4px 0 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.fact__value { font-size: 15.5px; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.mcosts {
  margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden;
}
.mcost { display: flex; justify-content: space-between; gap: 16px; padding: 11px 15px; border-bottom: 1px solid var(--line); }
.mcost:last-child { border-bottom: 0; }
.mcost dt { color: var(--text-2); font-size: 14px; }
.mcost dd { margin: 0; font-size: 14.5px; font-variant-numeric: tabular-nums; text-align: right; }
.mcost.is-total { background: var(--surface-2); }
.mcost.is-total dt, .mcost.is-total dd { color: var(--text); font-weight: 600; }

.loan {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start;
  padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
}
.loan__controls { display: grid; gap: 18px; }
.loan__base { margin: 0; font-size: 12.5px; color: var(--text-3); }
.slider { display: grid; gap: 8px; }
.slider__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.slider__head label { font-size: 13.5px; color: var(--text-2); }
.slider__head output { font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: pre; }
.slider input[type="range"] { width: 100%; margin: 0; accent-color: var(--text-2); height: 22px; cursor: pointer; }
.slider input[type="range"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.loan-warn { margin: -6px 0 0; font-size: 12.5px; color: var(--danger); }

.loan-result { margin: 0; display: grid; border-left: 1px solid var(--line); padding-left: 24px; }
.lrow { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.lrow:last-child { border-bottom: 0; }
.lrow dt { font-size: 14px; color: var(--text-2); }
.lrow dd { margin: 0; font-size: 14.5px; text-align: right; white-space: nowrap; }
.lrow.is-key dt, .lrow.is-key dd { color: var(--text); font-weight: 600; }
.lrow.is-total { margin: 4px -10px; padding: 9px 10px; border-radius: var(--r-sm); background: var(--surface-2); border-bottom: 0; }
.lrow.is-total dt, .lrow.is-total dd { color: var(--text); font-weight: 600; font-size: 15px; }
.lrow.is-sub { padding-top: 0; }
.lrow.is-sub dt, .lrow.is-sub dd { font-size: 12.5px; color: var(--text-3); }
.lrow.is-sub dt { padding-left: 14px; }

@media (max-width: 700px) {
  .loan { grid-template-columns: minmax(0, 1fr); }
  .loan-result { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 8px; }
}
.finance__note { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-3); }

.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.finding {
  padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  border-left-width: 3px; display: grid; gap: 6px;
}
.sev--red .finding { border-left-color: var(--danger); }
.sev--red .block__title .icon { color: var(--danger); }
.sev--amber { --amber: #d9a441; }
:root[data-theme="light"] .sev--amber { --amber: #b07d12; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .sev--amber { --amber: #b07d12; } }
.sev--amber .finding { border-left-color: var(--amber); }
.sev--amber .block__title .icon { color: var(--amber); }
.sev--info .finding { border-left-color: var(--line-strong); }
.finding__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.finding__title { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.finding__detail { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-2); white-space: pre-line; }
.chip {
  flex: none; font-size: 11.5px; color: var(--text-2); border: 1px solid var(--line-strong);
  border-radius: 99px; padding: 1px 8px; white-space: nowrap;
}

.finding__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }
.check .icon { width: 13px; height: 13px; }
.check.is-unchecked { font-style: italic; }
.pages { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.page-link {
  font-size: 12px; color: var(--text-3); text-decoration: none; font-variant-numeric: tabular-nums;
  border-radius: 5px; padding: 1px 5px; background: var(--surface-2);
}
.page-link:hover { color: var(--text); background: var(--surface-3); }

.questions { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.6; }
.questions li::marker { color: var(--text-3); }

.report__foot { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 6px; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
.report__foot p { margin: 0; }
.report__warn { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); }
.report__warn .icon { margin-top: 2px; }

/* ---------- Report + gallery side by side on wide screens ---------- */

.report-layout {
  display: grid; grid-template-columns: minmax(0, 860px) minmax(280px, 420px); gap: 44px; align-items: start;
}
.gallery {
  position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; overscroll-behavior: contain;
  display: grid; gap: 18px; padding-right: 4px;
}
.gallery__group { display: grid; gap: 8px; }
.gallery__label { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s var(--ease); }
.thumbs--drawing .thumb { background: #fff; }
.thumbs--drawing .thumb img { object-fit: contain; }
.thumb:hover img { transform: scale(1.03); }
.thumb__page {
  position: absolute; left: 6px; bottom: 6px; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 5px;
  background: rgba(15, 17, 19, 0.72); color: #e8e6e1; font-variant-numeric: tabular-nums;
}

.viewer {
  width: min(1400px, 96vw); max-width: none; height: min(94vh, 1100px); max-height: none; padding: 0;
  border: 0; border-radius: var(--r-lg); background: #0e1012; color: #e8e6e1; overflow: hidden;
}
.viewer[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.viewer::backdrop { background: rgba(5, 6, 7, 0.82); }
.viewer__stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 16px 64px; }
.viewer__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.viewer__img.is-drawing { background: #fff; }
.viewer__nav {
  position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.08); color: #e8e6e1;
}
.viewer__nav:hover { background: rgba(255, 255, 255, 0.16); }
.viewer__nav--prev { left: 12px; }
.viewer__nav--prev .icon { rotate: 180deg; }
.viewer__nav--next { right: 12px; }
.viewer__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px 10px 18px; border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.viewer__caption { font-size: 13px; color: #a9afb6; font-variant-numeric: tabular-nums; }
.viewer .btn--quiet, .viewer .icon-btn { color: #c9ccd0; }
.viewer .btn--quiet:hover, .viewer .icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

@media (max-width: 1360px) {
  .report-layout { grid-template-columns: minmax(0, 860px); gap: 32px; }
  .gallery { position: static; max-height: none; overflow: visible; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (max-width: 860px) {
  .pk { grid-template-columns: minmax(0, 1fr); }
  .pk-side { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .jobs { max-height: 220px; overflow-y: auto; }
  .pk-main { padding: 24px 16px 48px; }
  .empty { padding-top: 8px; }
  .finding__head { flex-direction: column; gap: 6px; }
  .viewer { width: 100vw; height: 100dvh; border-radius: 0; }
  .viewer__stage { padding: 8px; }
  .viewer__nav { display: none; }
}
.signin-cta .drop__title { white-space: normal; }
