:root {
  --bg: #0a0e1a;
  --surface: rgba(19, 27, 48, 0.88);
  --surface-strong: rgba(23, 32, 57, 0.96);
  --surface-soft: rgba(16, 23, 41, 0.76);
  --ink: #eef4ff;
  --muted: #9aa7c2;
  --line: rgba(150, 170, 205, 0.18);
  --accent: #45e0b0;
  --accent-strong: #1fb688;
  --accent-soft: rgba(69, 224, 176, 0.14);
  --danger: #ff8f7a;
  --danger-soft: rgba(255, 143, 122, 0.14);
  --success: #5ef0c2;
  --success-soft: rgba(94, 240, 194, 0.14);
  --shadow: 0 32px 80px rgba(2, 6, 15, 0.46);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-heading: "DM Mono", "SFMono-Regular", Consolas, monospace;
  --font-body: "DM Sans", "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  --bg: #f5efe4;
  --surface: rgba(255, 252, 246, 0.92);
  --surface-strong: #fffdf7;
  --surface-soft: rgba(255, 255, 255, 0.62);
  --ink: #1f2521;
  --muted: #58635b;
  --line: rgba(31, 37, 33, 0.12);
  --accent: #146356;
  --accent-strong: #0f4b41;
  --accent-soft: rgba(20, 99, 86, 0.08);
  --danger: #ae3b2f;
  --danger-soft: rgba(174, 59, 47, 0.11);
  --success: #1f6f4f;
  --success-soft: rgba(38, 123, 86, 0.12);
  --shadow: 0 24px 60px rgba(32, 41, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(69, 224, 176, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(76, 125, 255, 0.16), transparent 24%),
    radial-gradient(circle at bottom center, rgba(140, 95, 255, 0.12), transparent 34%),
    linear-gradient(180deg, #09111f 0%, #0c1221 38%, #080d18 100%);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at top left, rgba(20, 99, 86, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(191, 128, 64, 0.16), transparent 24%),
    linear-gradient(180deg, #f7f2ea 0%, #efe7d9 100%);
}

a {
  color: inherit;
}

code {
  font-family: var(--font-heading);
  font-size: 0.95em;
}

.shell {
  min-height: 100vh;
  padding: 32px 18px 64px;
}

.shell__frame {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.brandbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.brandbar__tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.brandbar__home {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brandmark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f7f6a 0%, #22b49a 100%);
  color: #f5fffd;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.06em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 14px 32px rgba(8, 18, 33, 0.34);
}

.brandmark::before {
  content: "Mx";
  position: relative;
  z-index: 1;
}

.brandmark::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #ffe082;
}

.brandbar__title {
  font-size: 0.88rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.brandbar__status {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(19, 27, 48, 0.78);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
  backdrop-filter: blur(16px);
}

.tool-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(19, 27, 48, 0.78);
  color: var(--ink);
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease;
}

.tool-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(69, 224, 176, 0.26);
}

.tool-btn svg {
  width: 18px;
  height: 18px;
}

html[data-theme="light"] .brandbar__status,
html[data-theme="light"] .tool-btn {
  background: rgba(255, 253, 247, 0.78);
}

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 28px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid rgba(114, 134, 175, 0.18);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.panel--single {
  grid-template-columns: minmax(0, 1fr);
}

.hero {
  padding: 12px 8px 12px 4px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--font-heading);
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: rgba(69, 224, 176, 0.5);
}

.hero h1,
.card h1,
.card h2 {
  margin: 0 0 12px;
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.04;
}

.hero h1 {
  font-size: clamp(2.3rem, 4.8vw, 4.2rem);
}

.hero p,
.card p,
.metric__copy,
.inline-note {
  color: var(--muted);
  line-height: 1.65;
}

.hero__grid,
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.metric,
.status-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.metric__value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 8px;
  color: var(--ink);
}

.card {
  padding: 28px;
  border-radius: calc(var(--radius-lg) - 8px);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.card__header {
  margin-bottom: 20px;
}

.card__header h1,
.card__header h2 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.card__header h1 {
  max-width: 16ch;
}

.stack {
  display: grid;
  gap: 14px;
}

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

.field label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font: inherit;
  color: var(--ink);
  background: rgba(8, 13, 24, 0.72);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.field select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font: inherit;
  color: var(--ink);
  background: rgba(8, 13, 24, 0.72);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

html[data-theme="light"] .field input,
html[data-theme="light"] .field select {
  background: #fff;
}

.field input::placeholder {
  color: rgba(154, 167, 194, 0.72);
}

.field input:focus {
  outline: none;
  border-color: rgba(69, 224, 176, 0.52);
  box-shadow: 0 0 0 4px rgba(69, 224, 176, 0.12);
  background: rgba(9, 15, 28, 0.92);
}

.field select:focus {
  outline: none;
  border-color: rgba(69, 224, 176, 0.52);
  box-shadow: 0 0 0 4px rgba(69, 224, 176, 0.12);
  background: rgba(9, 15, 28, 0.92);
}

.actions,
.links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.button,
button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease;
}

.button--primary,
button[type="submit"] {
  background: linear-gradient(135deg, #22b49a 0%, #148f79 100%);
  color: #07111e;
  box-shadow: 0 16px 32px rgba(15, 127, 106, 0.24);
}

.button--secondary {
  background: var(--accent-soft);
  color: #c8fff0;
}

.button--ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.button:hover,
button:hover {
  transform: translateY(-1px);
}

.button--ghost:hover {
  border-color: rgba(69, 224, 176, 0.3);
  background: rgba(69, 224, 176, 0.06);
}

html[data-theme="light"] .button--primary,
html[data-theme="light"] button[type="submit"] {
  color: #fff;
  box-shadow: 0 14px 28px rgba(20, 99, 86, 0.18);
}

.button[aria-disabled="true"],
button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.message {
  display: none;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}

.message.is-visible {
  display: block;
}

.message--info {
  background: rgba(76, 125, 255, 0.12);
  color: #afc6ff;
}

.message--error {
  background: var(--danger-soft);
  color: var(--danger);
}

.message--success {
  background: var(--success-soft);
  color: var(--success);
}

.flow-list {
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

.setting-group {
  display: grid;
  gap: 14px;
}

.choice-list {
  display: grid;
  gap: 10px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.choice input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.choice strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.choice span {
  color: var(--muted);
  line-height: 1.55;
}

.subtle-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.subtle-card h3 {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
}

.subtle-card p {
  margin: 0;
  color: var(--muted);
}

.status-card strong,
.metric strong,
.status-card code,
.metric code {
  color: var(--ink);
}

.status-card code,
[data-app-detail] {
  display: block;
  margin-top: 8px;
  color: #9ef5d7;
}

[data-app-detail] {
  white-space: pre-wrap;
  word-break: break-word;
}

.actions .button,
.actions button,
.links a {
  font-size: 0.95rem;
}

.links a {
  color: var(--muted);
}

.links a:hover {
  color: var(--ink);
}

@media (max-width: 920px) {
  .panel,
  .hero__grid,
  .status-grid {
    grid-template-columns: 1fr;
  }

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

  .brandbar__tools {
    margin-left: 0;
  }
}
