
/* u-werte-catalog.css — Bauteil-Karten, Mobile-Tabs, Material-Picker, Physik-Panel */

.uw-mobile-tabs {
  display: none;
}

.uw-mobile-tabbar {
  display: none;
}

@media (max-width: 900px) {
  .uw-mobile-tabbar {
    display: flex;
  }

  .uw-mobile-tabs {
    display: flex;
    gap: 0;
    padding: 0;
    background: transparent;
    border-bottom: none;
    flex: 1;
  }

  .uw-mobile-tabs button {
    flex: 1;
    min-height: 48px;
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: color-mix(in srgb, #fff 75%, transparent);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
  }

  .uw-mobile-tabs button.is-active {
    color: #fff;
    border-bottom-color: #a5d6a7;
    background: color-mix(in srgb, #000 12%, transparent);
  }

  [data-uw-panel].uw-panel--hidden-mobile {
    display: none !important;
  }

  .uw-config-bar[data-uw-panel="bauteil"] {
    padding-bottom: 14px;
  }

  /* Ergebnis-Panel muss auf Mobile sichtbar und nutzbar sein */
  .uw-panel--result:not(.uw-panel--hidden-mobile) {
    display: block !important;
    min-height: 200px;
  }

  .uw-panel--result .uw-canvas-block,
  .uw-panel--result .uw-visual-dual,
  .uw-panel--result .uw-canvas-frame {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .uw-panel--result .uw-visual-dual {
    display: grid;
  }

  .uw-panel--result canvas {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
  }
}

.uw-bauteil-picker {
  padding: 12px 16px 0;
  border-bottom: 1px dashed color-mix(in srgb, var(--fg) 12%, transparent);
}

.uw-bauteil-picker__lead {
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--muted);
}

.uw-bauteil-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 12px;
}

.uw-bauteil-group__title {
  margin: 0 0 8px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.uw-bauteil-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.uw-bauteil-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  min-height: 52px;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--fg) 10%);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.uw-bauteil-card:hover {
  border-color: var(--brand, #2e7d32);
  box-shadow: 0 2px 8px rgba(46, 125, 50, .12);
}

.uw-bauteil-card.is-active {
  border-color: var(--brand-600, #1b5e20);
  background: color-mix(in srgb, var(--brand) 10%, var(--bg));
  box-shadow: inset 0 0 0 1px var(--brand-600, #1b5e20);
}

.uw-bauteil-card__label {
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.2;
}

.uw-bauteil-card__short {
  font-size: .72rem;
  color: var(--muted);
}

@media (min-width: 901px) {
  .uw-bauteil-picker {
    padding-top: 8px;
  }
  .uw-bauteil-cards {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  }
}

.layer-mat-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.layer-mat-row .layer-mat {
  flex: 1;
  min-width: 0;
}

.layer-mat-pick {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--fg) 12%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 8%, var(--bg));
  color: var(--brand-600, #1b5e20);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
}

.layer-mat-pick:hover {
  background: color-mix(in srgb, var(--brand) 15%, var(--bg));
}

.uw-physics-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent);
  background: color-mix(in srgb, var(--brand) 5%, var(--bg));
}

.uw-physics-panel__title {
  margin: 0 0 10px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--brand-600, #1b5e20);
}

.uw-physics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.uw-physics-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
}

.uw-physics-item span {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  margin-bottom: 4px;
}

.uw-physics-item strong {
  font-size: 1.05rem;
  color: var(--brand-600, #1b5e20);
}

.uw-physics-note {
  margin: 8px 0 0;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 520px) {
  .uw-physics-grid {
    grid-template-columns: 1fr;
  }
}

.uw-mat-dock-host {
  margin-top: 12px;
}

.uw-mat-dock {
  display: none;
  flex-direction: column;
  max-height: min(42vh, 360px);
  border: 2px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: 12px;
  background: var(--bg, #fff);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
  overflow: hidden;
}

.uw-mat-dock.is-open {
  display: flex;
}

.uw-mat-dock .uw-mat-sheet__body {
  max-height: min(32vh, 260px);
}

.uw-mat-dock__hint {
  flex: 1;
  margin: 0 8px;
  text-align: center;
}

@media (max-width: 600px) {
  .uw-mat-dock__hint {
    display: none;
  }
}

.uw-mat-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  /* über mobile-bottom-bar (z-index 9999) */
  z-index: 10040;
  display: none;
  pointer-events: none;
}

.uw-mat-sheet-backdrop.is-open {
  display: block;
  pointer-events: auto;
}

.uw-mat-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(85vh, 640px);
  z-index: 10050;
  display: none;
  flex-direction: column;
  background: var(--bg, #fff);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, .18);
  pointer-events: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.uw-mat-sheet.is-open {
  display: flex;
}

body.uw-sheet-open {
  overflow: hidden;
}

/* Bottom-Bar darf Sheet-✕ und Inhalt nicht überdecken */
body.uw-sheet-open .mobile-bottom-bar {
  display: none !important;
  pointer-events: none !important;
}

.uw-mat-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.uw-mat-sheet__head strong {
  font-size: 1rem;
  color: var(--brand-600, #1b5e20);
}

.uw-mat-sheet__close {
  min-width: 48px;
  min-height: 48px;
  border: none;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  border-radius: 10px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: var(--fg, #333);
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.uw-mat-sheet__close:hover,
.uw-mat-sheet__close:active {
  background: color-mix(in srgb, #b00020 12%, var(--bg));
  color: #b00020;
}

/* Aufklapp-Kategorien im Material-Picker */
.uw-mat-accordion {
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--fg) 10%);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--bg);
}

.uw-mat-accordion__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: .88rem;
  color: var(--brand-600, #1b5e20);
  list-style: none;
  user-select: none;
  background: color-mix(in srgb, var(--brand) 6%, var(--bg));
}

.uw-mat-accordion__head::-webkit-details-marker {
  display: none;
}

.uw-mat-accordion__head::before {
  content: '▸';
  margin-right: 8px;
  font-size: .75rem;
  transition: transform .15s;
}

.uw-mat-accordion[open] .uw-mat-accordion__head::before {
  transform: rotate(90deg);
}

.uw-mat-accordion__count {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
}

.uw-mat-accordion .uw-mat-cat__list {
  padding: 6px 10px 10px;
}

/* Schichtaufbau-Visualisierung */
.uw-stack-wrap {
  padding: 12px 14px;
  border-bottom: 1px solid var(--uw-border, #ccc);
  background: color-mix(in srgb, var(--brand) 4%, var(--bg));
}

.uw-stack-visual {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.uw-stack-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  text-align: center;
}

.uw-stack-bar {
  display: flex;
  flex-direction: column-reverse;
  min-height: 160px;
  max-height: 220px;
  border: 2px solid var(--brand-600, #1b5e20);
  border-radius: 8px;
  overflow: hidden;
  background: #fafcf9;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.06);
}

.uw-stack-seg {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  min-height: 22px;
  border-top: 1px solid rgba(0,0,0,.12);
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

.uw-stack-seg--insulation {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(0,0,0,.06) 4px,
    rgba(0,0,0,.06) 8px
  );
}

.uw-stack-seg--inhom {
  background-image: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 6px,
    rgba(101, 67, 33, 0.35) 6px,
    rgba(101, 67, 33, 0.35) 10px
  );
}

/* Inhomogene Schicht — UI */
.layer-inhom-wrap {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed color-mix(in srgb, var(--brand) 30%, transparent);
  background: color-mix(in srgb, var(--brand) 4%, var(--bg));
}

.layer-inhom-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--brand-600, #1b5e20);
  cursor: pointer;
  margin-bottom: 0;
}

.layer-inhom-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand, #2e7d32);
}

.layer-inhom-fields {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--fg) 10%, transparent);
}

.layer-card--inhom {
  border-color: color-mix(in srgb, var(--brand) 35%, transparent) !important;
  box-shadow: inset 3px 0 0 var(--brand-600, #1b5e20);
}

@media (min-width: 901px) {
  .uw-workbench .layer-inhom-wrap {
    grid-column: 3 / 8;
    margin: 4px 0 8px 38px;
  }
}

.uw-stack-seg__num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid #1b5e20;
  color: #1b5e20;
  font-size: .65rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.uw-stack-seg__label {
  flex: 1;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #1a1a1a;
}

.uw-stack-seg__d {
  flex-shrink: 0;
  font-size: .72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #333;
}

.uw-stack-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  color: var(--muted);
  font-size: .85rem;
}

/* Materialbibliothek Accordion */
.matlib-accordion {
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.matlib-accordion__head {
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: .85rem;
  color: var(--brand-600, #1b5e20);
  background: color-mix(in srgb, var(--brand) 5%, var(--bg));
  list-style: none;
}

.matlib-accordion__head::-webkit-details-marker {
  display: none;
}

.matlib-accordion__head::before {
  content: '▸ ';
  font-size: .75rem;
}

.matlib-accordion[open] .matlib-accordion__head::before {
  content: '▾ ';
}

.matlib-accordion .matlib-cat__grid {
  padding: 8px 10px 10px;
}

.uw-mat-sheet__search-wrap {
  padding: 10px 16px;
  flex-shrink: 0;
}

.uw-mat-sheet__search {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 16px;
  border: 1px solid color-mix(in srgb, var(--fg) 18%, transparent);
  border-radius: 10px;
  box-sizing: border-box;
}

.uw-mat-sheet__body {
  overflow-y: auto;
  padding: 0 16px 24px;
  flex: 1;
}

.uw-mat-cat h5 {
  margin: 14px 0 8px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
}

.uw-mat-cat__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.uw-mat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  min-height: 48px;
  border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
  border-radius: 10px;
  background: var(--bg);
  text-align: left;
  cursor: pointer;
}

.uw-mat-item:hover,
.uw-mat-item:focus-visible {
  border-color: var(--brand, #2e7d32);
  background: color-mix(in srgb, var(--brand) 6%, var(--bg));
}

.uw-mat-item__name {
  font-weight: 600;
  font-size: .9rem;
}

.uw-mat-item__meta {
  font-size: .75rem;
  color: var(--muted);
}

@media (min-width: 901px) {
  .uw-mat-sheet {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(520px, 96vw);
    border-radius: 16px;
    bottom: 10vh;
    max-height: 80vh;
  }
}

.matlib-cat {
  margin-bottom: 1rem;
}

.matlib-cat__title {
  margin: 0 0 8px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--brand-600, #1b5e20);
}

.matlib-cat__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.matlib-card {
  padding: 8px 10px !important;
  font-size: .85rem;
}

.uw-pr-table .col-sd {
  text-align: right;
  white-space: nowrap;
}
