/* Verortung (6.8): place tree, template choice, assignment dialog. Places carry their own
   object colour (ochre) next to systems (blue) and functions (green). */
:root {
  --scs-kind-location: #8a6a1c;
  --scs-kind-location-soft: #f6efdc;
  --scs-kind-location-line: #e0cf9f;
}
html[data-theme='dark'] {
  --scs-kind-location: #d9b65a;
  --scs-kind-location-soft: #3a3120;
  --scs-kind-location-line: #6b5a2e;
}
.locations-table td {
  vertical-align: middle;
}
.locations-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.location-tree {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: calc(var(--depth, 0) * 22px);
  min-width: 0;
}
.location-fold,
.location-fold-space {
  flex: none;
  width: 20px;
  height: 20px;
}
.locations-table .location-fold {
  border: 0;
  box-shadow: none;
  min-height: 0;
  background: transparent;
  padding: 0;
  color: var(--scs-ink-3);
  font-size: 12px;
  cursor: pointer;
}
.locations-table .location-fold:hover {
  color: var(--scs-accent);
}
.location-glyph {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--scs-kind-location);
  background: var(--scs-kind-location-soft);
  border: 1px solid var(--scs-kind-location-line);
}
.location-glyph svg {
  width: 15px;
  height: 15px;
}
.location-name {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--scs-ink);
  text-align: left;
  cursor: pointer;
}
.location-name:hover {
  color: var(--scs-accent);
  text-decoration: underline;
}
.location-designation {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  color: var(--scs-kind-location);
}
.location-designation .location-path {
  color: var(--scs-ink-3);
}
.location-kind {
  display: inline-flex;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--scs-surface-3);
  color: var(--scs-ink-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.location-context td {
  opacity: 0.6;
}
.location-systems .function-count {
  max-width: 100%;
  overflow: hidden;
}
.location-systems .function-count span {
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}
.location-template-option {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 8px;
  align-items: baseline;
  padding: 6px 0;
}
.location-template-option span {
  grid-column: 2;
  font-size: 12.5px;
  color: var(--scs-ink-3);
}
.location-assign-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.location-assign-context,
.location-assign-place {
  font-size: 12.5px;
  color: var(--scs-ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.location-assign-place {
  color: var(--scs-kind-location);
}
.location-assign-section {
  margin: 12px 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--scs-ink-2);
}
.location-assign-free {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  white-space: nowrap;
}
.location-import-text {
  width: 100%;
  font-family: inherit;
  tab-size: 14;
}
.location-import-problems {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--scs-warn);
}
.locations-table .location-fold {
  background: transparent;
  padding: 0;
}

/* 6.12: empty page. The unified empty state on top, below it the templates as one list whose
   rows show their kinds as the chips of the Ortsart column. */
.location-empty {
  max-width: 940px;
  margin: 0 auto;
  padding: 8px 24px 40px;
}
html:root .location-empty .req-empty {
  padding: 40px 0 28px;
}
.location-empty-symbol {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: var(--scs-radius-m, 8px);
  color: var(--scs-kind-location);
  background: var(--scs-kind-location-soft);
  border: 1px solid var(--scs-kind-location-line);
}
.location-empty-symbol svg {
  width: 22px;
  height: 22px;
}
.location-template-list {
  border-top: 1px solid var(--scs-line);
  padding-top: 22px;
}
.location-template-list h4 {
  margin: 0 0 4px;
  font-size: var(--scs-text-m);
  font-weight: 600;
  color: var(--scs-ink);
}
.location-template-list > p {
  margin: 0 0 12px;
  font-size: var(--scs-text-s);
  color: var(--scs-ink-3);
}
.location-template-list > ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--scs-line);
  border-radius: var(--scs-radius-m, 8px);
  background: var(--scs-surface);
  overflow: hidden;
}
.location-template-list > ol > li + li {
  border-top: 1px solid var(--scs-line-2, var(--scs-line));
}
html:root .location-template-list .location-template {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  height: auto;
  min-height: 54px;
  margin: 0;
  padding: 10px 16px 10px 18px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  color: var(--scs-ink);
  font: inherit;
  text-align: left;
  white-space: normal;
  cursor: pointer;
}
html:root .location-template-list .location-template.recommended {
  border-left-color: var(--scs-kind-location);
}
html:root .location-template-list .location-template:hover:not(:disabled) {
  background: var(--scs-row-hover, var(--scs-surface-2));
}
html:root .location-template-list .location-template:focus-visible {
  outline: 2px solid var(--scs-focus, var(--scs-accent));
  outline-offset: -2px;
}
.location-template-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 600;
}
.location-template-name small {
  font-size: var(--scs-text-xs, 11.5px);
  font-weight: 500;
  color: var(--scs-kind-location);
}
.location-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
html:root .location-template-list .location-chain li {
  border: 0;
}
.location-chain li {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  color: var(--scs-ink-2);
  white-space: nowrap;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--scs-surface-3);
}
.location-chain li + li {
  margin-left: 14px;
  position: relative;
}
.location-chain li + li::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  width: 10px;
  border-top: 1px solid var(--scs-kind-location-line);
}
.location-chain-free {
  font-size: 12.5px;
  color: var(--scs-ink-3);
}
.location-template-go {
  font-size: var(--scs-text-s);
  color: var(--scs-ink-3);
  white-space: nowrap;
}
.location-template:hover:not(:disabled) .location-template-go,
.location-template:focus-visible .location-template-go {
  color: var(--scs-accent);
}
@media (max-width: 760px) {
  html:root .location-template-list .location-template {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .location-template-go {
    display: none;
  }
}

/* Footer actions: quiet text links inside the sentence, not framed buttons. */
html:root .model-list-footer .location-footer-link {
  display: inline;
  min-height: 0;
  height: auto;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  color: var(--scs-accent);
  font: inherit;
  cursor: pointer;
}
html:root .model-list-footer .location-footer-link:hover {
  text-decoration: underline;
}

/* Import dialog (6.12): file and pasted cells side by side, the preview below. */
.location-import-source {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  align-items: start;
  gap: 8px 16px;
}
.location-import-file {
  display: grid;
  gap: 8px;
}
.location-import-source .term-import-options {
  grid-column: 1 / -1;
}
.location-import-notes {
  margin: 0;
  padding-left: 16px;
  font-size: 12.5px;
  color: var(--scs-ink-2);
}
html:root .location-import-table tr td .location-import-notes {
  color: var(--scs-ink-2);
}
html:root .location-import-table tr[data-import-action='error'] td .location-import-notes {
  color: var(--scs-danger);
}
.location-import-table td {
  vertical-align: top;
}
@media (max-width: 760px) {
  .location-import-source {
    grid-template-columns: minmax(0, 1fr);
  }
}
