:root {
  --primary: #0284c7;
  --secondary: #0f766e;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--text-main);
  min-height: 100vh;
  background: linear-gradient(120deg, #f0f9ff 0%, #dcfce7 100%);
  background-attachment: fixed;
  padding: 2rem 1rem 6rem;
  line-height: 1.6;
}

.header,
.container {
  width: min(1000px, 94vw);
  margin: 0 auto;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem 1rem;
}

.header h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #0284c7 0%, #14b8a6 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.header p {
  color: var(--text-muted);
  font-weight: 500;
}

/* Ergebnisse */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
}

.result-card,
.panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px -10px rgba(14, 165, 233, 0.25);
  padding: 1.5rem;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.result-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.result-value {
  display: block;
  width: 100%;
  font-size: clamp(1.1rem, 3.4vw, 1.6rem);
  font-weight: 700;
  word-break: break-all;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  cursor: pointer;
  user-select: all;
  min-height: 3.6rem;
}

.result-value:hover {
  background: #e2e8f0;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

/* Passwortstärke */
.strength {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0 0;
}

.strength-bar {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 50px;
  overflow: hidden;
}

.strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 50px;
  background: var(--primary);
  transition: width 0.25s ease, background 0.25s ease;
}

.strength-bar span[data-tone="weak"] { background: #ef4444; }
.strength-bar span[data-tone="fair"] { background: #f59e0b; }
.strength-bar span[data-tone="good"] { background: #14b8a6; }
.strength-bar span[data-tone="strong"] { background: #0f766e; }

.strength-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Knöpfe */
.copy-btn,
.primary-btn,
.ghost-btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  border: none;
}

.copy-btn {
  width: 100%;
  margin-top: 1rem;
  background: var(--primary);
  color: white;
}

.primary-btn {
  background: var(--secondary);
  color: white;
}

.ghost-btn {
  background: white;
  color: var(--text-main);
  border: 1px solid #e2e8f0;
}

.copy-btn:hover,
.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px -8px rgba(15, 23, 42, 0.35);
}

.copy-btn:active,
.primary-btn:active,
.ghost-btn:active {
  transform: translateY(0);
}

.icon-btn {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--primary);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.icon-btn:hover {
  background: #f0f9ff;
  transform: rotate(90deg);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.5rem 0 2rem;
}

/* Einstellungen */
.panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.panel h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid rgba(226, 232, 240, 0.8);
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 1rem 0 0.4rem;
}

.field-label:first-of-type {
  margin-top: 0;
}

.text-input,
.select-input,
.number-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-main);
}

.text-input:focus,
.select-input:focus,
.number-input:focus {
  outline: none;
  background: white;
  border-color: var(--primary);
}

.range-input {
  width: 100%;
  accent-color: var(--primary);
}

.range-input:disabled {
  opacity: 0.4;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.chip {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 0.45rem 0.9rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.chip.is-active {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  font-size: 0.95rem;
  cursor: pointer;
}

.check input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--primary);
}

.hint {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: #b45309;
  min-height: 1.2rem;
}

/* Liste */
.list-panel {
  margin-top: 1.25rem;
}

.list-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.list-controls .field-label {
  margin: 0;
}

.list-controls .number-input {
  width: 5.5rem;
}

.batch-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.batch-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 1.4fr) auto;
  align-items: center;
  gap: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  word-break: break-all;
}

.batch-row .icon-btn:hover {
  transform: none;
}

/* Hinweisfenster */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translate(-50%, 1rem);
  background: var(--text-main);
  color: white;
  padding: 0.7rem 1.3rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 120;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.upscaler {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  padding: 0.7rem 1.3rem;
  background: white;
  color: var(--text-main);
  text-decoration: none;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.upscaler:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

@media (max-width: 640px) {
  body {
    padding: 1rem 0.5rem 5rem;
  }

  .header h1 {
    font-size: 2rem;
  }

  .panels,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .batch-row {
    grid-template-columns: 1fr auto;
  }

  .batch-row .batch-pass {
    grid-column: 1 / -1;
  }

  .upscaler {
    left: 50%;
    transform: translateX(-50%);
    bottom: 0.8rem;
  }

  .upscaler:hover {
    transform: translateX(-50%) translateY(-3px);
  }
}
