* {
  box-sizing: border-box;
}

:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f2f4f8;
  background: #0b0d12;
  color-scheme: dark;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #0b0d12;
}

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

.container {
  width: min(1180px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  padding: 48px 0 28px;
}

.eyebrow,
.step-label {
  margin: 0 0 6px;
  color: #a8b0bd;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
}

h2 {
  font-size: 1.35rem;
}

.subtitle {
  max-width: 720px;
  margin: 12px 0 20px;
  font-size: 1.08rem;
  color: #b8c0cc;
}

.notice {
  max-width: 840px;
  padding: 12px 14px;
  border: 1px solid #303a48;
  border-radius: 10px;
  background: #151a22;
  font-size: 0.92rem;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.panel {
  padding: 24px;
  border: 1px solid #293240;
  border-radius: 16px;
  background: #12161d;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.output-panel {
  position: sticky;
  top: 18px;
}

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

.field {
  margin-bottom: 18px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: inline-block;
  margin-bottom: 7px;
  font-weight: 700;
}

input[type="text"],
select,
textarea {
  width: 100%;
  border: 1px solid #3a4656;
  border-radius: 9px;
  padding: 11px 12px;
  color: #f2f4f8;
  background: #0d1117;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
pre:focus-visible {
  outline: 3px solid rgba(139, 124, 246, 0.34);
  outline-offset: 2px;
  border-color: #9b8cff;
}

[aria-invalid="true"] {
  border-color: #ff7b72;
}

.hint {
  margin: 7px 0 0;
  color: #9da7b5;
  font-size: 0.86rem;
}

.error {
  min-height: 1.15em;
  margin: 5px 0 0;
  color: #ff9188;
  font-size: 0.84rem;
}

.checkbox-field {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 9px;
  align-items: start;
}

.checkbox-field input {
  margin-top: 5px;
}

.checkbox-field label {
  margin: 0;
}

.checkbox-field .error {
  grid-column: 2;
}

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

.button {
  min-height: 42px;
  border-radius: 9px;
  padding: 9px 14px;
  border: 1px solid transparent;
  font-weight: 750;
  cursor: pointer;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button-primary {
  color: #ffffff;
  background: #745ee8;
}

.button-primary:hover {
  background: #6650d8;
}

.button-secondary {
  color: #ddd7ff;
  background: #211b3d;
  border-color: #6657a8;
}

.button-ghost {
  color: #d8dee8;
  background: #171c24;
  border-color: #3a4554;
}

.status {
  min-height: 1.5em;
  margin: 0 0 10px;
  color: #b8c1ce;
  font-weight: 700;
}

.status.stale {
  color: #f2b86b;
}

pre {
  min-height: 430px;
  margin: 0;
  padding: 18px;
  border-radius: 12px;
  background: #090c11;
  color: #f3f6fa;
  border: 1px solid #252e3a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.94rem/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pre.is-locked {
  user-select: none;
  cursor: not-allowed;
}

pre.is-selectable {
  user-select: text;
  cursor: text;
}

.save-section {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid #293240;
}

.save-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.save-hint {
  max-width: 210px;
  margin: 0;
  text-align: right;
}

.save-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: #3a4554;
  background: #171c24;
}

.export-button:hover:not(:disabled) {
  background: #202833;
}

.export-button[aria-pressed="true"] {
  border-color: #6aa779;
  box-shadow: 0 0 0 1px rgba(106, 167, 121, 0.2);
}

.export-excel {
  color: #72c78a;
}

.export-sheets {
  color: #f2f4f8;
}

.brand-logo {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.footer {
  padding: 22px 0 36px;
  color: #929cab;
  font-size: 0.88rem;
}

.footer p {
  margin: 0;
}

.footer p + p {
  margin-top: 6px;
}

.footer strong {
  color: #d8dee8;
}

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

  .output-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 20px, 1180px);
  }

  .site-header {
    padding-top: 28px;
  }

  .panel {
    padding: 18px;
    border-radius: 12px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .panel-heading {
    flex-direction: column;
  }

  .save-heading {
    flex-direction: column;
  }

  .save-hint {
    max-width: none;
    text-align: left;
  }

  .panel-heading .button {
    width: 100%;
  }

  .actions .button {
    flex: 1 1 100%;
  }

  .save-actions {
    grid-template-columns: 1fr;
  }

  pre {
    min-height: 320px;
  }
}
