/* stilpruefung.css · nur Seitenspezifisches; Tokens und Bausteine kommen aus fsx-tools.css (Kopie v1)
   fabrik-ausnahme: UI-003 Radien und Schatten wie fsx-tools.css, projektweit: Stilprüfung wie die FSX-Werkzeuge (Falk, 2026-11-16)

   Klassen und IDs, die app.js liest oder erzeugt, bleiben unverändert:
   .tab, .mode, .active, .result, .compare-result, .output, .card, .legend-item, .off, .swatch,
   .txt, .name, .count, .metric, .v, .gauge, .track, .fill, .note, .ctable, .cat, .cat-dot,
   .total, .meta, .delta-up, .delta-down, .delta-zero, mark[data-cat]. */

/* Kategorienfarben. app.js verweist auf diese Namen (var(--c-…)).
   Wo es passt, Tokens aus fsx-tools.css; vier Kategorien brauchen eigene Töne,
   weil fsx-tools.css nur sechs unterscheidbare Farben kennt.
   feste-farbe: --c-phrase, --c-tricolon, --c-rhetfrage, --c-hedge (je Hell und Dunkel, mind. 3:1 zum Hintergrund) */
:root {
  --c-antithese:  var(--color-err);
  --c-transition: var(--color-warn);
  --c-booster:    var(--color-ok);
  --c-meaning:    var(--color-brand);
  --c-phrase:     light-dark(#6a4c8c, #b392f0);
  --c-tricolon:   light-dark(#b35900, #f0883e);
  --c-rhetfrage:  light-dark(#a03a6b, #f778ba);
  --c-hedge:      light-dark(#0e7c86, #39c5cf);
  --c-dash:       var(--color-text-faint);
  --c-multi:      var(--color-text);

  --up:   var(--color-err-dark);
  --down: var(--color-ok);
}

/* Kopf der Seite */
.sp-note {
  margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm); color: var(--color-text-muted);
  background: var(--color-bg-raised); border: var(--border-hair);
  border-left: 3px solid var(--color-line-strong); border-radius: var(--radius-sm);
}
.sp-note p { margin: 0 0 var(--space-2); }
.sp-note p:last-child { margin-bottom: 0; }
.sp-note strong { color: var(--color-text); }

/* Reiter (app.js schaltet .active) */
.tabs { gap: 0; padding: 0 var(--space-3); }
.tab {
  min-height: var(--touch-min); padding: 0 var(--space-4);
  font: inherit; font-size: var(--text-sm); font-weight: 500;
  color: var(--color-text-muted); background: none; cursor: pointer;
  border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--color-text); }
.tab.active { color: var(--color-text); border-bottom-color: var(--color-brand); font-weight: 600; }

.mode { display: none; padding: var(--space-5); }
.mode.active { display: block; }

.panel-label {
  display: block; margin: 0 0 var(--space-2);
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: var(--tracking-wide); color: var(--color-text-muted);
}

textarea {
  display: block; width: 100%; min-height: 240px; resize: vertical;
  padding: var(--space-4); font: inherit; font-size: var(--text-base); line-height: var(--leading-loose);
  color: var(--color-text); background: var(--color-bg-raised);
  border: var(--border-strong); border-radius: var(--radius-md);
}
textarea:focus-visible { border-color: var(--color-brand); }
#s-input { min-height: 320px; }

.controls { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0 0; }

/* Einzeltext */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: var(--space-6); align-items: start; }
.sp-col { min-width: 0; }

.result { display: none; margin-top: var(--space-6); }
.result.active { display: block; }

.output {
  padding: var(--space-5); font-size: var(--text-base); line-height: 1.95;
  white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--color-bg); border: var(--border-hair); border-radius: var(--radius-md);
}

mark { background: transparent; color: inherit; cursor: help; padding-bottom: 1px; }
mark[data-cat="antithese"]  { border-bottom: 2px solid var(--c-antithese);  background: color-mix(in srgb, var(--c-antithese) 12%, transparent); }
mark[data-cat="transition"] { border-bottom: 2px solid var(--c-transition); background: color-mix(in srgb, var(--c-transition) 12%, transparent); }
mark[data-cat="booster"]    { border-bottom: 2px solid var(--c-booster);    background: color-mix(in srgb, var(--c-booster) 12%, transparent); }
mark[data-cat="phrase"]     { border-bottom: 2px solid var(--c-phrase);     background: color-mix(in srgb, var(--c-phrase) 12%, transparent); }
mark[data-cat="meaning"]    { border-bottom: 2px solid var(--c-meaning);    background: color-mix(in srgb, var(--c-meaning) 12%, transparent); }
mark[data-cat="tricolon"]   { border-bottom: 2px solid var(--c-tricolon);   background: color-mix(in srgb, var(--c-tricolon) 12%, transparent); }
mark[data-cat="rhetfrage"]  { border-bottom: 2px solid var(--c-rhetfrage);  background: color-mix(in srgb, var(--c-rhetfrage) 12%, transparent); }
mark[data-cat="hedge"]      { border-bottom: 2px solid var(--c-hedge);      background: color-mix(in srgb, var(--c-hedge) 12%, transparent); }
mark[data-cat="dash"]       { border-bottom: 2px solid var(--c-dash);       background: color-mix(in srgb, var(--c-dash) 15%, transparent); }
mark[data-cat="multi"]      { border-bottom: 3px double var(--c-multi);     background: color-mix(in srgb, var(--c-multi) 12%, transparent); }

/* Seitenleiste; die Karten blendet app.js über style.display ein */
aside { position: sticky; top: var(--space-6); min-width: 0; }
#s-metricsCard, #s-legendCard { display: none; }
.card {
  margin-bottom: var(--space-4); padding: var(--space-4);
  background: var(--color-bg-soft); border: var(--border-hair); border-radius: var(--radius-md);
}
.card h2 {
  margin: 0 0 var(--space-3); font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--color-text-muted);
}

.metric {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: var(--space-1) 0; border-bottom: 1px dotted var(--color-line);
  font-family: var(--font-mono); font-size: var(--text-sm);
}
.metric:last-of-type { border-bottom: none; }
.metric .v { font-weight: 600; }

.gauge { margin-top: var(--space-3); }
.gauge .track { height: 6px; margin: var(--space-2) 0 var(--space-1); background: var(--color-line); border-radius: 3px; overflow: hidden; }
.gauge .fill { height: 100%; width: 0; background: var(--c-booster); border-radius: 3px; transition: width var(--dur) var(--ease); }
.gauge .note { font-size: var(--text-xs); line-height: var(--leading-normal); color: var(--color-text-muted); }

.legend-item {
  display: flex; align-items: center; gap: var(--space-2);
  min-height: var(--touch-min); padding: var(--space-1) 0;
  cursor: pointer; user-select: none; border-bottom: 1px dotted var(--color-line);
}
.legend-item:last-child { border-bottom: none; }
.legend-item.off { opacity: .45; }
.legend-item.off .name { text-decoration: line-through; }  /* Zustand nicht nur über Deckkraft */
.swatch { width: 14px; height: 14px; flex-shrink: 0; border-radius: var(--radius-sm); }
.legend-item .txt { flex: 1; min-width: 0; font-size: var(--text-sm); line-height: var(--leading-snug); }
.legend-item .txt .name { font-weight: 600; }
.legend-item .count { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); }

/* Vergleich */
.compare-inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); }
.field-hint { margin: var(--space-1) 0 0; font-size: var(--text-xs); font-style: italic; color: var(--color-text-muted); }

.compare-result { display: none; margin-top: var(--space-6); }
.compare-result.active { display: block; }

.frame-note {
  margin-bottom: var(--space-5); padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm); color: var(--color-text-muted);
  background: var(--color-bg-soft); border-left: 3px solid var(--color-line-strong); border-radius: var(--radius-sm);
}

.sp-table-scroll { overflow-x: auto; border: var(--border-hair); border-radius: var(--radius-md); }
.ctable { width: 100%; border-collapse: collapse; background: var(--color-bg-raised); }
.ctable th, .ctable td {
  padding: var(--space-2) var(--space-3); text-align: right;
  font-family: var(--font-mono); font-size: var(--text-sm); border-bottom: var(--border-hair);
}
.ctable th {
  background: var(--color-bg-soft); color: var(--color-text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: var(--tracking-wide); font-size: var(--text-xs);
}
.ctable td.cat, .ctable th.cat { text-align: left; font-family: var(--font-sans); }
.ctable tr:last-child td { border-bottom: none; }
.ctable tr.total td { font-weight: 700; border-top: 2px solid var(--color-line-strong); background: var(--color-bg-soft); }
.ctable tr.meta td { color: var(--color-text-muted); }
.cat-dot { display: inline-block; width: 10px; height: 10px; margin-right: var(--space-2); vertical-align: middle; border-radius: var(--radius-sm); }
.delta-up { color: var(--up); font-weight: 700; }
.delta-down { color: var(--down); font-weight: 700; }
.delta-zero { color: var(--color-text-muted); }

.compare-texts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-5); margin-top: var(--space-6); }
.compare-texts .output { font-size: var(--text-sm); line-height: var(--leading-loose); padding: var(--space-4); }
.text-head { margin: 0 0 var(--space-1); font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); }
.text-mini { margin: 0 0 var(--space-3); font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-text-muted); }

/* Erläuterungen */
.method details { border-top: var(--border-hair); }
.method details:first-of-type { border-top: 0; }
.method summary {
  display: flex; align-items: center; min-height: var(--touch-min); padding: var(--space-2) 0;
  font-weight: 600; cursor: pointer; list-style: none; user-select: none;
}
.method summary::-webkit-details-marker { display: none; }
.method summary::before { content: "\25B8\00a0"; color: var(--color-text-muted); }
.method details[open] summary::before { content: "\25BE\00a0"; }
.method .body { padding: 0 0 var(--space-4); font-size: var(--text-sm); color: var(--color-text-muted); }
.method .body p { margin: 0 0 var(--space-3); }
.method .body p:last-child { margin-bottom: 0; }
.method .body strong { color: var(--color-text); }
.method dl { margin: var(--space-2) 0 0; }
.method dt { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); font-weight: 600; color: var(--color-text); }
.method dt .cat-dot { margin-right: 0; }
.method dd { margin: var(--space-1) 0 0 var(--space-5); }
.method .ex { font-style: italic; color: var(--color-text); }

/* Farbpunkte in der Erläuterung (statt style-Attribut) */
.cat-dot--antithese  { background: var(--c-antithese); }
.cat-dot--transition { background: var(--c-transition); }
.cat-dot--booster    { background: var(--c-booster); }
.cat-dot--phrase     { background: var(--c-phrase); }
.cat-dot--meaning    { background: var(--c-meaning); }
.cat-dot--tricolon   { background: var(--c-tricolon); }
.cat-dot--rhetfrage  { background: var(--c-rhetfrage); }
.cat-dot--hedge      { background: var(--c-hedge); }
.cat-dot--dash       { background: var(--c-dash); }

@media (max-width: 880px) {
  .grid, .compare-texts { grid-template-columns: minmax(0, 1fr); }
  aside { position: static; }
}
@media (max-width: 760px) {
  .compare-inputs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .mode { padding: var(--space-4); }
  .tabs { padding: 0; }
  .tab { flex: 1 1 0; padding: 0 var(--space-2); }
  .controls .fsx-btn { flex: 1 1 auto; }
  .ctable th, .ctable td { padding: var(--space-2) var(--space-1); letter-spacing: 0; }
  .ctable td.cat, .ctable th.cat { padding-left: var(--space-2); }
}
