:root {
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-soft: #eef5f2;
  --text: #1f2a2e;
  --muted: #68777c;
  --line: #d9e2df;
  --primary: #237c72;
  --primary-dark: #185e56;
  --accent: #f0a44b;
  --shadow: 0 16px 40px rgba(31, 42, 46, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Yu Gothic UI",
    sans-serif;
  line-height: 1.7;
}

button,
input,
textarea {
  font: inherit;
}

.app-header {
  background:
    linear-gradient(90deg, rgba(35, 124, 114, 0.92), rgba(35, 124, 114, 0.76)),
    radial-gradient(circle at top right, rgba(240, 164, 75, 0.45), transparent 36%);
  color: #ffffff;
  padding: 42px 20px 38px;
}

.header-inner,
.app-shell,
.app-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.92rem;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.2;
  letter-spacing: 0;
}

.lead {
  max-width: 720px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.9);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 20px;
  padding: 28px 0;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.panel-heading {
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.panel-heading h2 {
  margin-bottom: 4px;
  font-size: 1.2rem;
}

.panel-heading p,
.note p,
.app-footer p {
  color: var(--muted);
}

.form-grid {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(35, 124, 114, 0.14);
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

legend {
  margin-bottom: 8px;
  font-weight: 700;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
}

.segmented input:checked + span {
  border-color: var(--primary);
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #ffffff;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
}

button.secondary:hover {
  background: #f0f4f2;
}

.output-box textarea {
  min-height: 430px;
  background: #fbfcfb;
}

#copy-status {
  min-height: 1.5em;
  color: var(--primary-dark);
  font-weight: 700;
}

.note {
  margin-top: 18px;
  border-left: 4px solid var(--accent);
  background: #fff8ef;
  padding: 14px 16px;
}

.note h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.note p {
  margin-bottom: 0;
}

.app-footer {
  padding: 8px 0 36px;
}

.app-footer p {
  margin-bottom: 0;
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .output-box textarea {
    min-height: 320px;
  }
}

@media (max-width: 560px) {
  .segmented {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }
}
