:root {
  color-scheme: light;
  --bg: #f5f5f3;
  --panel: #ffffff;
  --text: #171b22;
  --muted: #6f7783;
  --line: #e2ded6;
  --primary: #151b24;
  --soft: #f6efe1;
  --accent: #c7a968;
  --danger: #b54747;
  --success: #287a54;
  --shadow: 0 16px 38px rgba(24, 27, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.shell {
  display: grid;
  gap: 12px;
  width: min(900px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0;
}

.hidden {
  display: none;
}

.auth-gate {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow,
h1,
h2,
p {
  margin: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.badge.ok {
  border-color: #c9e6d7;
  color: var(--success);
}

.badge.warn {
  border-color: #efd0d0;
  color: var(--danger);
}

.card,
.result-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
}

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

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: 0;
  background: #fff;
  color: var(--text);
}

select {
  height: 40px;
  padding: 0 12px;
}

input {
  height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 220px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(199, 169, 104, 0.14);
}

.actions {
  display: flex;
  gap: 9px;
  margin-top: 12px;
}

button {
  height: 38px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 780;
  padding: 0 16px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

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

.ghost,
.copy {
  border-color: #eadfca;
  background: var(--soft);
  color: #5d4a22;
}

.status {
  min-height: 20px;
  color: var(--muted);
  font-size: 14px;
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

.result-card {
  overflow: hidden;
  padding: 0;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
}

.result-text {
  min-height: 160px;
  padding: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.result-text.empty {
  color: #9ca3af;
}

@media (max-width: 640px) {
  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
