/* Farbpalette-Designer — Oberfläche.
   Baut ausschließlich auf den Tokens aus aquarius-tokens.css auf. Keine eigenen
   Farbwerte, keine eigenen Abstände: wo hier eine Zahl steht, ist sie ein Token. */

/* ---------- Gerüst ---------- */

body {
  min-height: 100vh;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(2, 99, 190, .18), transparent 60%),
    radial-gradient(90% 80% at 92% 6%, rgba(2, 176, 175, .12), transparent 62%),
    var(--surface-page);
  background-attachment: fixed;
}

.wrap {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) var(--space-9);
}

/* ---------- Kopf ---------- */

.masthead {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding-bottom: var(--space-5);
  border-bottom: var(--border-w) solid var(--border-subtle);
  margin-bottom: var(--space-7);
}

.masthead img { height: 40px; width: auto; flex: none; }
.masthead .titles { min-width: 0; }
.masthead h1 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  margin-bottom: 2px;
}
.masthead p { color: var(--text-muted); font-size: var(--fs-body-s); }

/* ---------- Karten ---------- */

.card {
  background: var(--surface-card);
  border: var(--border-w) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2), var(--inset-hairline);
  padding: var(--space-5);
}

.card + .card { margin-top: var(--space-5); }

.card > h2 {
  font-size: var(--fs-h3);
  margin-bottom: var(--space-4);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin: var(--space-8) 0 var(--space-4);
}
.section-head h2 { font-size: var(--fs-h2); }
.section-head .count { color: var(--text-faint); font-size: var(--fs-body-s); }

/* ---------- Formular ---------- */

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
  align-items: end;
}

.field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }

label.lbl {
  font-family: var(--font-ui);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
}

input[type="text"], select {
  height: var(--control-h-md);
  padding: 0 var(--space-3);
  background: var(--surface-sunken);
  color: var(--text-strong);
  border: var(--border-w) solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-stretch: var(--font-stretch-brand);
  transition: border-color var(--dur-fast) var(--ease-standard);
}
input[type="text"]:hover, select:hover { border-color: var(--border-strong); }
input.mono { font-family: var(--font-mono); letter-spacing: .01em; }

.hex-field { display: flex; gap: var(--space-2); }
.hex-field input { flex: 1 1 auto; min-width: 0; }
input[type="color"] {
  width: var(--control-h-md);
  height: var(--control-h-md);
  flex: none;
  padding: 0;
  border: var(--border-w) solid var(--border-default);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: var(--radius-xs); }

/* ---------- Knöpfe ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: var(--control-h-md);
  padding: 0 var(--space-4);
  border: var(--border-w) solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-brand);
  color: var(--text-on-brand);
  font-family: var(--font-ui);
  font-size: var(--fs-body-s);
  font-weight: var(--fw-semibold);
  font-stretch: var(--font-stretch-brand);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-standard),
              border-color var(--dur-fast) var(--ease-standard);
}
.btn:hover { background: var(--aq-blue-700); }
.btn:active { background: var(--aq-blue-800); }
.btn[disabled] { opacity: .5; cursor: default; }

.btn-ghost {
  background: transparent;
  color: var(--text-body);
  border-color: var(--border-default);
}
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn-ghost:active { background: var(--surface-active); }

.btn-sm { height: var(--control-h-sm); padding: 0 var(--space-3); font-size: var(--fs-caption); }
.btn-icon { padding: 0; width: var(--control-h-sm); justify-content: center; }

.btn svg, .btn-icon svg { width: 15px; height: 15px; flex: none; }

.actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-5); }

/* ---------- Meldungen ---------- */

.note {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border-left: var(--border-w-thick) solid var(--aq-cyan);
  background: var(--surface-cyan-soft);
  color: var(--text-body);
  font-size: var(--fs-body-s);
  line-height: var(--lh-snug);
}
.note.warn { border-left-color: var(--watch); background: rgba(232, 163, 23, .10); }
.note.bad  { border-left-color: var(--alert); background: rgba(224, 69, 63, .10); }
.note + .note, .note:last-child { margin-top: var(--space-4); }
.note strong { color: var(--text-strong); }
.note a { text-decoration: underline; text-underline-offset: 2px; }

.err { color: var(--alert); font-size: var(--fs-body-s); margin-top: var(--space-3); }
.err:empty { display: none; }

/* ---------- Palette ---------- */

.pal { margin-top: var(--space-5); }

.pal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.pal-head .meta { color: var(--text-muted); font-size: var(--fs-caption); }
.pal-head .meta b { color: var(--text-body); font-weight: var(--fw-semibold); }
.pal-head .name {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}

.swatches { display: grid; gap: var(--space-3); }

.sw {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: var(--space-4);
  align-items: stretch;
  background: var(--surface-raised);
  border: var(--border-w) solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.sw-chip {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-3);
  min-height: 96px;
}
.sw-chip .variant {
  font-family: var(--font-ui);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  opacity: .82;
}
.sw-chip .hex {
  font-family: var(--font-mono);
  font-size: var(--fs-body-l);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}

.sw-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: var(--space-2) var(--space-5);
  padding: var(--space-3) var(--space-4);
  align-content: center;
}

.val { min-width: 0; }
.val dt {
  font-family: var(--font-ui);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1px;
}
.val dd {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-body-s);
  font-variant-numeric: tabular-nums;
  color: var(--text-body);
}
.val dd.strong { color: var(--text-strong); }

.copy {
  flex: none;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--radius-xs);
  background: transparent; color: var(--text-faint);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-standard),
              background var(--dur-fast) var(--ease-standard);
}
.copy:hover { color: var(--aq-cyan); background: var(--surface-hover); }
.copy svg { width: 13px; height: 13px; }
.copy.done { color: var(--ok); }

/* ---------- Historie ---------- */

.hist-item {
  background: var(--surface-card);
  border: var(--border-w) solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.hist-item + .hist-item { margin-top: var(--space-3); }

.hist-top {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.hist-strip { display: flex; gap: 3px; flex: none; }
.hist-strip span {
  width: 34px; height: 34px;
  border-radius: var(--radius-xs);
  border: var(--border-w) solid var(--border-subtle);
}
.hist-meta { flex: 1 1 220px; min-width: 0; }
.hist-meta .base {
  font-family: var(--font-mono);
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  color: var(--text-strong);
}
.hist-meta .base .label {
  font-family: var(--font-body);
  font-weight: var(--fw-regular);
  color: var(--text-body);
  margin-left: var(--space-2);
}
.hist-meta .sub { color: var(--text-faint); font-size: var(--fs-caption); }
.hist-tools { display: flex; gap: var(--space-2); flex: none; }

.hist-detail { margin-top: var(--space-4); }
.hist-detail[hidden] { display: none; }

table.vals {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-caption);
}
table.vals th, table.vals td {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: var(--border-w) solid var(--border-subtle);
  white-space: nowrap;
}
table.vals th {
  font-family: var(--font-ui);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--text-faint);
}
table.vals td { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
table.vals td.variant { font-family: var(--font-body); color: var(--text-body); }
table.vals tr:last-child td { border-bottom: none; }
table.vals .chip {
  display: inline-block;
  width: 13px; height: 13px;
  border-radius: 3px;
  border: var(--border-w) solid var(--border-subtle);
  vertical-align: -2px;
  margin-right: var(--space-2);
}
.table-scroll { overflow-x: auto; }

.empty {
  color: var(--text-faint);
  font-size: var(--fs-body-s);
  padding: var(--space-6) 0;
  text-align: center;
}

/* ---------- Profile ---------- */

.prof-list { display: grid; gap: var(--space-2); margin-top: var(--space-4); }
.prof {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-sunken);
  border: var(--border-w) solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: var(--fs-body-s);
}
.prof .nm { flex: 1 1 auto; min-width: 0; color: var(--text-body); }
.prof .tag {
  font-family: var(--font-ui);
  font-size: var(--fs-micro);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--aq-teal-300);
  flex: none;
}
.prof .sz { color: var(--text-faint); font-family: var(--font-mono); font-size: var(--fs-caption); flex: none; }

.drop {
  margin-top: var(--space-4);
  padding: var(--space-5);
  border: var(--border-w-thick) dashed var(--border-default);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-body-s);
  transition: border-color var(--dur-fast) var(--ease-standard),
              background var(--dur-fast) var(--ease-standard);
}
.drop.over { border-color: var(--aq-cyan); background: var(--surface-cyan-soft); color: var(--text-body); }
.drop input[type="file"] { display: none; }
.drop .pick {
  color: var(--text-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* ---------- Fußzeile ---------- */

footer.foot {
  margin-top: var(--space-9);
  padding-top: var(--space-5);
  border-top: var(--border-w) solid var(--border-subtle);
  color: var(--text-faint);
  font-size: var(--fs-caption);
  line-height: var(--lh-snug);
}
footer.foot p + p { margin-top: var(--space-2); }

/* ---------- Hinweis-Einblendung ---------- */

#toast {
  position: fixed;
  left: 50%; bottom: var(--space-6);
  transform: translate(-50%, 16px);
  padding: var(--space-3) var(--space-5);
  background: var(--surface-raised);
  border: var(--border-w) solid var(--border-strong);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-3);
  color: var(--text-strong);
  font-size: var(--fs-body-s);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
  z-index: 40;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Schmale Fenster ---------- */

@media (max-width: 720px) {
  .sw { grid-template-columns: 1fr; }
  .sw-chip { min-height: 72px; }
  .masthead { flex-wrap: wrap; }
}
