/* ═══════════════════════════════════════
   YUNITY · components.css  v4
═══════════════════════════════════════ */

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  padding: 13px 32px;
  background: var(--amber);
  color: var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  transition:
    opacity var(--t-fast),
    transform var(--t-mid),
    box-shadow var(--t-slow);
  position: relative;
  overflow: hidden;
}
/* Shimmer-Effekt beim Hover */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}
.btn-primary:hover::after { left: 150%; }
.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(200,169,110,0.22);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.24;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 11px 22px;
  background: transparent;
  color: var(--ash);
  border: 1px solid var(--clay);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--t-mid), color var(--t-mid), background var(--t-mid);
}
.btn-secondary:hover {
  border-color: var(--fog);
  color: var(--linen);
  background: rgba(255,255,255,0.02);
}

.btn-ghost {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
  background: none;
  border: none;
  border-bottom: 1px solid var(--ash);
  padding-bottom: 2px;
  cursor: pointer;
  transition: color var(--t-mid), border-color var(--t-mid);
}
.btn-ghost:hover { color: var(--ash); border-color: var(--ash); }

.mini-btn {
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--clay);
  color: var(--ash);
  border-radius: var(--radius);
  cursor: pointer;
  background: none;
  transition: border-color var(--t-mid), color var(--t-mid), background var(--t-mid);
}
.mini-btn:hover { border-color: var(--ash); color: var(--sand); }
.mini-btn.amber { border-color: var(--amber-line); color: var(--amber); }
.mini-btn.amber:hover { border-color: var(--amber); background: var(--amber-dim); }

/* ── VIEW SWITCH ── */
.view-switch { display: flex; gap: 6px; margin-bottom: 22px; }

.vs-btn {
  font-family: var(--font-sans);
  font-size: 8px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 7px 16px;
  border: 1px solid var(--clay);
  color: var(--ash);
  border-radius: var(--radius);
  cursor: pointer;
  background: none;
  transition: all var(--t-mid);
}
.vs-btn:hover { color: var(--ash); border-color: var(--fog); }
.vs-btn.active {
  border-color: var(--amber-line);
  color: var(--amber);
  background: var(--amber-dim);
}

/* ── RUN CARD ── */
.run-card {
  background: var(--stone);
  border: 1px solid var(--clay);
  border-radius: var(--radius);
  padding: 15px 20px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color var(--t-mid), background var(--t-mid), transform var(--t-mid);
  cursor: default;
  border-left: 2px solid transparent;
}
.run-card:hover {
  border-color: var(--fog);
  background: rgba(255,255,255,0.012);
  transform: translateX(2px);
}
/* Neuester Run hervorgehoben */
.run-card.latest {
  border-left-color: var(--amber);
  background: rgba(200,169,110,0.025);
}
.run-card.latest:hover {
  background: rgba(200,169,110,0.04);
}
.run-card-info { flex: 1; }
.run-card-title { font-size: 14px; color: var(--linen); margin-bottom: 3px; }
.run-card-date { font-size: 10px; color: var(--ash); letter-spacing: 0.04em; }
.run-card-btns { display: flex; gap: 7px; }

/* ── CONTEXT TAG ── */
.ctx-tag {
  display: inline-block;
  font-size: 8px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fog);
  border: 1px solid var(--clay);
  padding: 4px 12px;
  border-radius: var(--radius);
  margin-bottom: 18px;
}

/* ── PROGRESS DOTS ── */
.progress-dots { display: flex; gap: 5px; align-items: center; }

.prog-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--clay);
  transition: all var(--t-mid);
}
.prog-dot.done { background: var(--fog); }
.prog-dot.active {
  width: 6px; height: 6px;
  background: var(--amber);
  box-shadow: 0 0 7px rgba(200,169,110,0.6);
}

/* ══════════════════════════════════════
   HEATMAP  v4
   Kernkomponente — maximaler Aufwand
══════════════════════════════════════ */
.heatmap-card {
  background: var(--stone);
  border: 1px solid var(--clay);
  border-radius: var(--radius);
  padding: 26px 30px 22px;
  margin-bottom: 24px;
  position: relative;
  overflow: visible;
}

/* Ambient-Schimmer an der Kante */
.heatmap-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: radial-gradient(ellipse at 80% 0%,
    rgba(200,169,110,0.04) 0%,
    transparent 60%);
  pointer-events: none;
}

.hm-table {
  border-collapse: separate;
  border-spacing: 3px;
  width: 100%;
}

.hm-th {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-hi);
  padding: 0 4px 3px;
  font-weight: 300;
  text-align: center;
}

.hm-rh {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-hi);
  text-align: right;
  padding-right: 10px;
  padding-bottom: 3px;
  font-weight: 300;
  white-space: nowrap;
  vertical-align: middle;
}

.hm-cell {
  padding: 0;
  vertical-align: middle;
}

/* Jede Zelle ist ein eigenständiges visuelles Objekt */
.hm-inner {
  border-radius: 2px;
  min-width: 36px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  cursor: default;
  transition: background var(--t-mid);
}

/* Innere Schimmerline oben (nur bei belegten Zellen) */



/* Horizontal Bar Indicators */
.hm-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--clay);
  border-radius: 2px;
  overflow: hidden;
}
.hm-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.hm-bar-ist {
  background: var(--amber);
  opacity: 0.9;
}
.hm-bar-soll {
  background: var(--sage);
  opacity: 0.85;
}
.hm-num { display: none; }

/* Delta-Zelle */
.hm-delta-val {
  font-size: 15px;
  font-weight: 300;
  letter-spacing: 0.02em;
}
.hm-delta-val.pos { color: var(--amber); }
.hm-delta-val.neg { color: var(--ash); }
.hm-delta-val.zero { color: var(--clay); font-size: 18px; }

.hm-hint {
  font-size: 11px;
  color: var(--ash);
  margin-top: 18px;
  line-height: 1.7;
}

/* ── IMAGE CARDS ── */
.img-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.img-card {
  background: var(--stone);
  border: 1px solid var(--clay);
  border-radius: var(--radius);
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--t-mid),
    background var(--t-mid),
    transform var(--t-slow),
    box-shadow var(--t-slow);
}

/* Innerer Schein auf Mouse-Hover */
.img-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%,
    rgba(200,169,110,0.08) 0%, transparent 65%);
  opacity: 0;
  transition: opacity var(--t-slow);
  pointer-events: none;
}

.img-card:hover {
  border-color: var(--fog);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}
.img-card:hover::after { opacity: 1; }

.img-card.selected {
  border-color: var(--amber);
  background: rgba(200,169,110,0.04);
  transform: translateY(-2px);
  box-shadow:
    0 8px 32px rgba(200,169,110,0.14),
    inset 0 0 0 1px rgba(200,169,110,0.1);
}
.img-card.selected::after { opacity: 1; }

/* Top-Linie: Gradient statt solide */
.img-card.selected::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--amber) 30%,
    var(--amber-mid) 70%,
    transparent 100%);
}

.img-card img {
  width: 100%;
  max-width: 150px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 14px;
  opacity: 0.55;
  transition: opacity var(--t-mid), transform var(--t-slow), filter var(--t-slow);
  user-select: none;
  -webkit-user-drag: none;
  filter: invert(1) saturate(0.5) brightness(0.6);
  mix-blend-mode: screen;
}
.img-card:hover img {
  opacity: 0.78;
  transform: scale(1.03);
  filter: invert(1) saturate(0.7) brightness(0.75);
}
.img-card.selected img {
  opacity: 1;
  transform: scale(1.04);
  filter: invert(1) saturate(1) brightness(0.85);
}

.img-card-letter {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ash);
  transition: color var(--t-mid);
}
.img-card.selected .img-card-letter { color: var(--amber); }

.check-badge {
  position: absolute;
  top: 9px; right: 9px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: var(--ink);
  font-weight: 600;
  opacity: 0;
  transform: scale(0.4) rotate(-15deg);
  transition: opacity var(--t-mid), transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.img-card.selected .check-badge {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* ── DIMENSION BLOCK ── */
.dimension-block {
  margin-bottom: 56px;
  padding-bottom: 52px;
  border-bottom: 1px solid rgba(37,34,32,0.8);
}
.dimension-block:last-child { border-bottom: none; margin-bottom: 0; }

.dim-title {
  font-size: clamp(16px, 2.2vw, 21px);
  font-weight: 300;
  color: var(--linen);
  margin-bottom: 5px;
}
.dim-question {
  font-size: 14px;
  color: var(--ash);
  margin-bottom: 26px;
  max-width: 520px;
  line-height: 1.65;
}

/* ── KONTEXT DIM BOXES ── */
.ctx-dims-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }

.ctx-dim-box {
  flex: 1;
  min-width: 110px;
  background: var(--stone);
  border: 1px solid var(--clay);
  border-radius: var(--radius);
  padding: 13px 15px;
}
.cdim-label {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 7px;
}
.cdim-val {
  font-size: 18px;
  font-weight: 300;
  color: var(--linen);
  margin-bottom: 10px;
}
.cdim-bar { height: 2px; background: var(--clay); border-radius: 1px; }
.cdim-fill {
  height: 100%;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--amber), rgba(200,169,110,0.5));
  transition: width 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── MIRROR TEXT ── */
.mirror-text {
  font-size: 16px;
  color: var(--sand);
  line-height: 1.9;
  margin-top: 22px;
  max-width: 620px;
}

/* ── CONTEXT GRID ── */
.context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.context-card {
  background: var(--stone);
  border: 1px solid var(--clay);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: border-color var(--t-mid), transform var(--t-slow);
}
.context-card:hover {
  border-color: var(--fog);
  transform: translateY(-2px);
}

.ctx-card-title {
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fog);
  margin-bottom: 14px;
}

/* ── LEGEND ── */
.legend-row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--ash); }
.leg-line { width: 18px; height: 2px; }
.leg-line-dash { width: 18px; border-top: 2px dashed var(--sage); }

/* ── INSIGHT CARD ── */
.insight-card {
  background: var(--stone);
  border: 1px solid var(--clay);
  border-left: 2px solid rgba(200,169,110,0.55);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
/* insight amber accent - stronger */
.insight-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--amber), rgba(200,169,110,0.15));
}
.insight-card p {
  font-size: 15px;
  color: var(--sand);
  line-height: 1.85;
  margin-bottom: 8px;
  padding-left: 16px;
}
.insight-card p:last-child { margin-bottom: 0; }
.insight-card p::before {
  content: '—';
  color: var(--ash);
  margin-right: 8px;
}

/* ── EMPTY STATE ── */
.empty-state { padding: 32px 0; }
.empty-state p {
  font-size: 16px;
  color: var(--ash);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--clay); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--fog); }

/* ── COMPARE SELECT ── */
.run-select-wrap { display: flex; flex-direction: column; gap: 6px; }
.run-select-label { font-size: 9px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--ash); }
.run-select-label.a { color: var(--amber); }
.run-select-label.b { color: var(--sage); }
.run-select {
  background: var(--stone);
  border: 1px solid var(--clay);
  color: var(--linen);
  font-family: var(--font-sans);
  font-size: 11px;
  padding: 9px 32px 9px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='5'%3E%3Cpath d='M0 0l4.5 5L9 0z' fill='%2346423d'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 190px;
  transition: border-color var(--t-mid);
}
.run-select:focus { outline: none; border-color: var(--fog); }

/* ══════════════════════════════════════
   RADAR COMPONENTS
══════════════════════════════════════ */

.radar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.radar-canvas {
  width: 180px;
  height: 180px;
}

.radar-title {
  font-size: 8px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fog);
}

/* Mini Radar Cards (Run Screen) */

.context-card-mini {
  background: var(--stone);
  border: 1px solid var(--clay);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: border-color var(--t-mid), transform var(--t-slow);
}

.context-card-mini:hover {
  border-color: var(--fog);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════
   YUNITY · Heatmap (MIRA Style)
═══════════════════════════════════════ */

.hm-table {
  width:100%;
  border-collapse:separate;
  border-spacing:4px 6px;
}

.hm-th{
  font-size:9px;
  letter-spacing:0.14em;
  color:var(--text-hi);
  font-weight:300;
  text-align:center;
  text-transform:uppercase;
}

.hm-rh{
  text-align:right;
  font-size:9px;
  letter-spacing:0.08em;
  color:var(--text-hi);
  font-weight:300;
  padding-right:14px;
  text-transform:uppercase;
}

.hm-cell{
  width:auto;
}

.hm-inner{
  position: relative;
  min-height: 44px;
  background: transparent;
  border: none;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  overflow: visible;
}



.hm-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--clay);
  border-radius: 2px;
  overflow: hidden;
}

.hm-bar{
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.16,1,0.3,1);
}

.hm-bar-ist {
  background: var(--amber);
  opacity: 0.9;
}

.hm-bar-soll {
  background: var(--sage);
  opacity: 0.85;
}

.hm-num{ display: none; }

.hm-delta-val{
  font-size:12px;
}

.hm-delta-val.pos{
  color:var(--sage);
}

.hm-delta-val.neg{ color: var(--ash); }

.hm-delta-val.zero{
  color:var(--ash);
}