:root {
  color-scheme: light;
  --bg: #0f172a;
  --panel: #0b1224;
  --border: #1f2a44;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #7c3aed;
  --accent-strong: #a855f7;
  --danger: #f87171;
  --success: #34d399;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(130% 130% at 20% 20%, rgba(30, 27, 75, 0.9) 0%, rgba(15, 23, 42, 0) 65%),
    radial-gradient(160% 140% at 80% 10%, rgba(14, 165, 233, 0.7) 0%, rgba(14, 165, 233, 0) 55%),
    #0f172a;
  background-repeat: no-repeat;
  background-size: 200% 200%, 200% 200%, auto;
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text);
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

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

h1 {
  margin: 6px 0;
  font-size: 28px;
}

h2 {
  margin: 6px 0;
  font-size: 22px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.lede {
  max-width: 740px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.pill {
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--accent-strong);
  font-weight: 600;
  min-width: 160px;
  text-align: center;
}

.pill-muted {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border-color: var(--border);
}

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

.panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.35);
  grid-column: span 6;
  min-width: 0;
}

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

.span-2 {
  grid-column: 1 / -1;
}

.button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: none;
  border-radius: 10px;
  color: white;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

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

.secondary {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.6);
  border-radius: 10px;
  color: #fecdd3;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}

.ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 16px;
  font-weight: 600;
}

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

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

input, select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b1224;
  color: var(--text);
  font-size: 15px;
}

.status {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  margin-bottom: 12px;
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.meta dt {
  font-size: 13px;
  color: var(--muted);
}

.meta dd {
  margin: 4px 0 0;
  font-weight: 600;
}

.hint {
  color: var(--muted);
  margin-top: 10px;
  font-size: 14px;
}

.list {
  color: var(--muted);
  line-height: 1.6;
  padding-left: 18px;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.option-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.option-index {
  font-weight: 700;
  font-size: 18px;
}

.option-pool {
  color: var(--muted);
  font-size: 14px;
}

.input-inline {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  align-items: center;
}

.message {
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  margin-top: 6px;
}

.message.success {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
}

.message.error {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
}

.empty {
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 18px;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 6px;
}

.owner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.control-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-card h3 {
  margin: 0 0 4px;
}

.exit-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 14px;
}

.exit-status-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exit-status {
  margin: 0;
  font-weight: 700;
  font-size: 17px;
}

.compact-meta {
  gap: 8px 14px;
}

.exit-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.exit-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exit-input-row {
  max-width: 460px;
}

.exit-input-row input {
  max-width: 220px;
}

.exit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

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

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

  .exit-controls {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .exit-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
