:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef3f4;
  --text: #18212a;
  --muted: #62707f;
  --line: #d9e0e6;
  --primary: #0f766e;
  --primary-dark: #0b5d57;
  --danger: #b42318;
  --success: #137333;
  --warning: #a15c00;
  --shadow: 0 18px 50px rgba(24, 33, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
}

.workspace,
.status-panel {
  min-width: 0;
}

.heading {
  padding: 10px 0 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.04;
  letter-spacing: 0;
}

.heading p,
.compact p,
.guide li,
.status-card p {
  color: var(--muted);
  line-height: 1.65;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.step {
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.step span {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
  flex: 0 0 auto;
}

.step strong {
  font-size: 14px;
}

.step.is-active,
.step.is-done {
  border-color: rgba(15, 118, 110, 0.38);
  color: var(--text);
}

.step.is-active span,
.step.is-done span {
  background: var(--primary);
  color: white;
}

.panel,
.status-card,
.guide {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.field + .field {
  margin-top: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--text);
  font: inherit;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

textarea {
  resize: vertical;
  min-height: 210px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.13);
}

.account-preview {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.07);
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
}

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

.account-preview strong {
  word-break: break-all;
}

.member-warning {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(161, 92, 0, 0.28);
  border-radius: 8px;
  background: rgba(161, 92, 0, 0.08);
  color: #794600;
  font-size: 14px;
  line-height: 1.55;
}

.actions,
.query-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

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

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

.button.secondary {
  background: var(--surface-soft);
  color: var(--text);
}

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

.compact {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  box-shadow: none;
}

.compact h2,
.guide h2,
.status-card h2 {
  margin-bottom: 8px;
  font-size: 20px;
  letter-spacing: 0;
}

.query-row input {
  flex: 1;
}

.status-panel {
  position: sticky;
  top: 24px;
  align-self: start;
  display: grid;
  gap: 16px;
}

.status-card {
  padding: 24px;
  min-height: 220px;
  border-top: 5px solid var(--primary);
}

.status-label {
  display: block;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

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

.status-card.warning {
  border-top-color: var(--warning);
}

.guide {
  padding: 22px;
  box-shadow: none;
}

.guide ol {
  margin: 10px 0 0;
  padding-left: 20px;
}

.guide a {
  color: var(--primary);
  font-weight: 700;
}

.tutorial-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 18px;
}

.tutorial-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.07);
  text-decoration: none;
}

.tutorial-links a:hover {
  background: rgba(15, 118, 110, 0.12);
}

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

  .status-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding: 20px 0;
  }

  .steps,
  .actions,
  .query-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .button {
    width: 100%;
  }

  .panel {
    padding: 16px;
  }
}
