:root {
  --bg-top: #f7f2e8;
  --bg-bottom: #efe3cf;
  --ink: #16231d;
  --muted: #5e6a62;
  --surface: rgba(255, 250, 242, 0.8);
  --surface-strong: rgba(255, 255, 255, 0.72);
  --line: rgba(22, 35, 29, 0.12);
  --accent: #e46c39;
  --accent-dark: #c4491b;
  --accent-green: #13674f;
  --accent-green-dark: #0f4e3d;
  --soft: rgba(228, 108, 57, 0.12);
  --shadow: 0 24px 60px rgba(32, 35, 30, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --display: "Bahnschrift SemiCondensed", "Arial Narrow", "Segoe UI", sans-serif;
  --body: "Segoe UI Variable", "Segoe UI", "Trebuchet MS", sans-serif;
  --mono: "Cascadia Code", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(228, 108, 57, 0.2), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(19, 103, 79, 0.14), transparent 26%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 85%);
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100% - 24px));
  margin: 0 auto;
  padding: 22px 0 48px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px 22px;
  border-radius: 999px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  color: #ffffff;
  font: 700 19px var(--display);
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.brand-name {
  margin: 0;
  font: 700 28px/1 var(--display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.badge {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 13px;
}

.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  padding: 32px;
}

.hero::after {
  content: "";
  position: absolute;
  top: -130px;
  right: -110px;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(228, 108, 57, 0.22), transparent 70%);
}

.hero-kicker,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent-green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.panel h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 860px;
  font-size: clamp(38px, 5vw, 72px);
  line-height: 0.95;
}

.hero-text {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 24px;
  align-items: start;
}

.column-stack {
  display: grid;
  gap: 24px;
}

.panel {
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel h2 {
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1;
}

.section-text {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.preset {
  min-height: 132px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.64);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.preset:hover,
.preset:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(228, 108, 57, 0.42);
  box-shadow: 0 18px 32px rgba(34, 28, 19, 0.1);
  outline: none;
}

.preset.is-active {
  background: linear-gradient(180deg, rgba(228, 108, 57, 0.14), rgba(255, 255, 255, 0.74));
  border-color: rgba(228, 108, 57, 0.44);
}

.preset-tag {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.preset-title {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.preset-text {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label {
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select,
.result-box {
  width: 100%;
  padding: 14px 16px;
  color: inherit;
  border: 1px solid rgba(22, 35, 29, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.result-box:focus {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(19, 103, 79, 0.42);
  box-shadow: 0 0 0 4px rgba(19, 103, 79, 0.08);
}

.field textarea,
.result-box {
  resize: vertical;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option-card {
  display: flex;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
}

.option-card input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--accent-green);
}

.option-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.option-card span span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.action-row,
.output-actions {
  display: grid;
  gap: 12px;
}

.action-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.output-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.button {
  padding: 14px 16px;
  cursor: pointer;
  border: 0;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.button-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 18px 28px rgba(196, 73, 27, 0.26);
}

.button-secondary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-green), var(--accent-green-dark));
  box-shadow: 0 18px 28px rgba(15, 78, 61, 0.22);
}

.button-ghost {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.sticky-panel {
  position: sticky;
  top: 22px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.meta-row span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 12px;
}

.result-box {
  min-height: 480px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.65;
}

.note {
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  padding: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
}

.history-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.history-item span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.history-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.footer-bar {
  margin-top: 24px;
  padding: 22px 24px;
  text-align: center;
}

.footer-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--accent-dark);
  outline: none;
}

.noscript-card {
  margin-top: 18px;
  padding: 18px 22px;
  color: var(--ink);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1120px) {
  .layout,
  .preset-grid,
  .action-row,
  .output-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sticky-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .site-shell {
    width: min(100% - 18px, 100%);
    padding-top: 16px;
  }

  .header-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
    border-radius: 26px;
  }

  .badge-row {
    justify-content: flex-start;
  }

  .layout,
  .preset-grid,
  .form-grid,
  .option-grid,
  .action-row,
  .output-actions {
    grid-template-columns: 1fr;
  }

  .hero,
  .panel {
    padding: 22px;
  }
}
