:root {
  color-scheme: dark;
  --bg: #070b12;
  --panel: #121821;
  --panel-strong: #172132;
  --line: #263247;
  --text: #eef4ff;
  --muted: #8ea0bd;
  --accent: #3b82f6;
  --accent-strong: #2563eb;
  --good: #22c55e;
  --notice-bg: #18271d;
  --input: #1d2534;
}

* {
  box-sizing: border-box;
}

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

.app-shell {
  width: min(100% - 32px, 820px);
  margin: 0 auto;
  padding: 42px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.25;
}

h1 span {
  color: var(--muted);
  font-size: 17px;
}

h2 {
  font-size: 15px;
}

.status-pill,
#taskBadge {
  flex: 0 0 auto;
  border: 1px solid #244b87;
  border-radius: 999px;
  background: #132545;
  color: #bfdbfe;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}

.activation-form {
  display: grid;
  gap: 14px;
}

.notice {
  display: grid;
  gap: 4px;
  border: 1px solid #28563a;
  border-radius: 8px;
  background: var(--notice-bg);
  color: #bbf7d0;
  padding: 12px 14px;
  font-size: 14px;
}

.notice span {
  color: #a7c9b0;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.api-fields {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d131d;
  padding: 14px;
}

.api-fields[hidden] {
  display: none;
}

textarea,
input {
  width: 100%;
  border: 1px solid #22304a;
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  padding: 12px 13px;
  font: inherit;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
}

textarea:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

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

button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--accent-strong);
}

button.secondary,
button.ghost-button {
  border: 1px solid var(--line);
  background: transparent;
  color: #cbd5e1;
}

button.secondary:hover,
button.ghost-button:hover {
  background: var(--panel-strong);
}

.inline-button {
  width: fit-content;
}

.run-log {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

#logList {
  margin: 14px 0 0;
  padding-left: 22px;
  color: #c7d2e5;
  line-height: 1.7;
  font-size: 14px;
}

@media (min-width: 940px) {
  .app-shell {
    padding-top: 56px;
  }

  .panel {
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
  }

  .run-log {
    border-top: 0;
    border-left: 1px solid var(--line);
    padding-top: 0;
    padding-left: 18px;
  }
}

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

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .actions {
    flex-direction: column;
  }

  button,
  .inline-button {
    width: 100%;
  }
}
