/* Startseite „Projekt einrichten" (start.js). Nur Klassen mit Präfix st-, Farben aus style.css. */

.st-root {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: calc(100vh - 48px);
}
.st-root input[type='text'] {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  background: #fff;
  color: var(--ink);
  min-width: 0;
}
.st-root input:focus-visible,
.st-root select:focus-visible,
.st-root textarea:focus-visible,
.st-root button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Kopf */
.st-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.st-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
}
.st-steps li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.st-steps li + li::before {
  content: '→';
  color: #b8b5ae;
  margin-right: 2px;
}
.st-steps b {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}
.st-steps li.st-on {
  color: var(--ink);
  font-weight: 600;
}
.st-steps li.st-on b {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.st-proj {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.st-namefield {
  flex: 1 1 260px;
}
.st-name {
  font-size: 16px !important;
  font-weight: 600;
  padding: 6px 10px !important;
}
.st-open {
  max-width: 320px;
}

/* Karten */
.st-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.st-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.st-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.st-card-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.st-sub {
  margin: 0 0 4px;
}
.st-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.st-badge,
.st-tag {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.st-badge.st-ok,
.st-tag.st-ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
  background: color-mix(in srgb, var(--ok) 8%, transparent);
}
.st-badge.st-req {
  color: var(--accent);
  border-color: var(--accent);
}
.st-tag.st-warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 35%, transparent);
  background: color-mix(in srgb, var(--warn) 8%, transparent);
}

/* Ablage */
.st-drop {
  border: 1.5px dashed #cfccc5;
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  text-align: center;
  color: var(--muted);
  background: #faf9f7;
  transition: border-color 0.12s, background 0.12s;
}
.st-drop.st-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, #fff);
  color: var(--ink);
}
.st-drop.st-busy {
  border-style: solid;
  color: var(--ink);
}
.st-drop.st-busy .st-drop-text::before {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -1px;
  animation: st-spin 0.8s linear infinite;
}
@keyframes st-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Texte */
.st-empty {
  margin: 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #faf9f7;
  color: var(--muted);
}
.st-note {
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: #faf9f7;
  border-radius: 0 6px 6px 0;
}
.st-note.st-warn {
  border-left-color: var(--warn);
  color: var(--warn);
}
.st-err {
  margin: 0;
  color: var(--err);
}
ul.st-warn {
  margin: 0;
  padding-left: 18px;
  color: var(--warn);
}
.st-running {
  margin: 0;
}
.st-file {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.st-right {
  margin-left: auto;
}

/* Kennzahlen */
.st-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 3px 12px;
  margin: 0;
}
.st-facts dt {
  color: var(--muted);
}
.st-facts dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.st-probe {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.st-probe > p {
  margin: 0;
}
.st-probe-ctl {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

/* Grundrisse */
.st-queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.st-queue[hidden] {
  display: none;
}
.st-queue li {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  font-size: 12px;
}
.st-q-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.st-q-state {
  color: var(--muted);
  text-align: right;
}
.st-queue li.st-q-err .st-q-state {
  color: var(--err);
}
.st-plan {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.st-plan-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.st-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.st-thumb {
  flex: 0 0 auto;
  width: 112px;
  padding: 4px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
.st-thumb:hover {
  border-color: #c9c6bf;
}
.st-thumb.st-done {
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
}
.st-thumb.st-on {
  outline: 2px solid var(--ok);
  outline-offset: -1px;
}
.st-thumb img,
.st-noimg {
  width: 100%;
  height: 80px;
  object-fit: contain;
  background: #faf9f7;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.st-thumb-cap {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.25;
}

/* Baubeschrieb */
.st-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.st-item {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.st-item:last-child {
  border-bottom: 0;
}
.st-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.st-item-head input {
  margin: 0;
  accent-color: var(--accent);
}
.st-item-name {
  font-weight: 600;
}
.st-conf {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.st-item-val {
  padding-left: 20px;
}
.st-item.st-off .st-item-val,
.st-item.st-off .st-item-name {
  color: var(--muted);
  text-decoration: line-through;
}
.st-item.st-unsure {
  color: var(--muted);
}
.st-item.st-unsure .st-item-head {
  cursor: default;
}
.st-item.st-unsure .st-conf {
  color: var(--warn);
}
.st-src {
  padding-left: 20px;
  font-size: 12px;
}
.st-src summary {
  cursor: pointer;
  color: var(--muted);
  width: max-content;
}
.st-src p {
  margin: 4px 0 0;
  padding: 6px 8px;
  background: #faf9f7;
  border-radius: 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.st-preview {
  background: #faf9f7;
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.st-preview h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
}
.st-preview p {
  margin: 0;
}
.st-phrases {
  margin: 0;
  padding-left: 18px;
  font: 12px/1.45 ui-monospace, 'SF Mono', Menlo, monospace;
}

/* Aussicht */
.st-photo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}
.st-photo-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.st-photo-frame {
  position: relative;
  cursor: crosshair;
  line-height: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #faf9f7;
}
.st-photo-frame img {
  width: 100%;
  height: auto;
  display: block;
}
.st-horizon {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 2px dashed #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.st-photo-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.st-photo-fields input[type='number'] {
  width: 84px;
}
.st-dirrow {
  display: flex;
  gap: 10px;
  align-items: center;
}
.st-compass {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  cursor: pointer;
}
.st-c-ring {
  fill: #faf9f7;
  stroke: var(--line);
  stroke-width: 1.5;
}
.st-c-lbl {
  font-size: 11px;
  fill: var(--muted);
  font-weight: 600;
  pointer-events: none;
}
.st-c-fov {
  fill: color-mix(in srgb, var(--accent) 22%, transparent);
  stroke: var(--accent);
  stroke-width: 0.8;
}
.st-c-needle {
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.st-c-dot {
  fill: var(--accent);
}
.st-dir {
  min-width: 2.2em;
  font-weight: 600;
}
.st-two {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.st-chips {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.st-chip {
  font: inherit;
  font-size: 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 9px;
  cursor: pointer;
}
.st-chip:hover {
  border-color: #c9c6bf;
}
.st-chip.st-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.st-text {
  font: inherit !important;
}

/* Fuss */
.st-foot {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: auto -16px 0;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.st-summary {
  display: flex;
  gap: 4px 14px;
  flex-wrap: wrap;
  color: var(--muted);
  min-width: 0;
}
.st-miss {
  color: var(--err);
}
/* Meldung vom «Editor öffnen»: eigene, umbrechende Zeile über Zusammenfassung und Knöpfen */
.st-foot-err {
  flex: 1 1 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}
.st-foot-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-left: auto;
}
.st-save {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.st-save.st-saved {
  color: var(--ok);
}
.st-save.st-dirty,
.st-save.st-saving {
  color: var(--warn);
}
.st-save.st-error {
  color: var(--err);
}
.st-go {
  padding: 7px 18px;
  font-weight: 600;
}
.st-root [hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .st-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 560px) {
  .st-root {
    padding: 12px 12px 0;
  }
  .st-foot {
    margin: auto -12px 0;
    padding: 10px 12px;
  }
  .st-photo {
    grid-template-columns: minmax(0, 1fr);
  }
  .st-open {
    max-width: none;
    width: 100%;
  }
  .st-proj > * {
    flex: 1 1 100%;
  }
  .st-foot-right {
    width: 100%;
  }
  .st-go {
    flex: 1;
  }
}
