:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #d9dee7;
  --text: #17202c;
  --muted: #657184;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --ok: #067647;
  --warn: #b54708;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.setup-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 44px;
}

.setup-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0 26px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 34px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
}

.summary,
.subtle {
  color: var(--muted);
}

.field-help {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.secret-state.configured {
  color: var(--ok);
  font-weight: 700;
}

.secret-state.missing {
  color: var(--danger);
  font-weight: 700;
}

.summary {
  margin-bottom: 0;
  max-width: 620px;
  line-height: 1.5;
}

.status-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill,
.mono {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.pill.ok {
  border-color: #abefc6;
  color: var(--ok);
  background: #ecfdf3;
}

.pill.warn {
  border-color: #fedf89;
  color: var(--warn);
  background: #fffaeb;
}

.pill.bad {
  border-color: #fecdca;
  color: var(--danger);
  background: #fef3f2;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.notice {
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.notice.error {
  border-color: #fecdca;
  color: var(--danger);
  background: #fef3f2;
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
}

label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd3df;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.wallet-upload {
  display: grid;
  gap: 9px;
}

.drop-zone {
  display: grid;
  gap: 5px;
  min-height: 92px;
  border: 1px dashed #9aa7b9;
  background: #f8fafc;
  color: #344054;
  padding: 14px;
  cursor: pointer;
}

.drop-zone strong {
  font-size: 14px;
}

.drop-zone span {
  color: var(--muted);
  font-size: 13px;
}

.drop-zone.dragover,
.drop-zone:focus {
  border-color: var(--accent);
  background: #ecfdf3;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
  outline: none;
}

.action-panel {
  grid-column: 1 / -1;
}

.schema-reset-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #fecdca;
  background: #fef3f2;
}

.schema-reset-panel label {
  color: #7a271a;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

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

button,
.link-button {
  min-height: 40px;
  border: 1px solid #b8c1cf;
  background: #ffffff;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

button:hover,
.link-button:hover {
  border-color: #8792a3;
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.result-box {
  min-height: 110px;
  max-height: 320px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: #111827;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

@media (max-width: 920px) {
  .setup-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-panel {
    justify-content: flex-start;
  }

  .setup-grid {
    grid-template-columns: 1fr;
  }
}
