:root {
  color-scheme: light dark;
  --bg: #0b1220;
  --panel: rgba(16, 24, 40, 0.92);
  --panel-alt: rgba(21, 30, 50, 0.95);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e5eefb;
  --muted: #98a4b7;
  --accent: #63b3ed;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(99, 179, 237, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(56, 161, 105, 0.12), transparent 25%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(1180px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.hero, .card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent), var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  padding: 18px 18px 14px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
}

h1, h2, h3, p {
  margin: 0;
}

.hero h1 {
  font-size: clamp(24px, 3.3vw, 38px);
  line-height: 1.05;
}

.hero p {
  margin: 8px 0 0;
}

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

.span-12 { grid-column: span 12; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }

@media (max-width: 920px) {
  .span-7, .span-6, .span-5 {
    grid-column: span 12;
  }
}

.card {
  padding: 16px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 18px;
}

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

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

.row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
}

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

.field.full { grid-column: span 12; }
.field.small { grid-column: span 3; }

label {
  font-size: 12px;
  color: var(--muted);
}

select, input, button {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-alt);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
}

textarea {
  width: 100%;
  min-height: 132px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-alt);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
}

button {
  cursor: pointer;
  background: linear-gradient(180deg, rgba(99, 179, 237, 0.15), rgba(56, 161, 105, 0.20));
  font-weight: 700;
}

button.secondary {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
}

button:hover {
  filter: brightness(1.08);
}

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

.list-item {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 10px 12px;
}

.list-item button {
  all: unset;
  display: block;
  width: 100%;
  cursor: pointer;
}

.list-item:hover {
  border-color: rgba(99, 179, 237, 0.55);
}

.list-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.list-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 179, 237, 0.12);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-pill {
  justify-content: space-between;
  min-width: 120px;
}

.status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  min-height: 20px;
}

.status.error {
  color: #fca5a5;
}

.status.ok {
  color: #86efac;
}

.status.warning-static {
  color: #fcd34d;
}

.detail-line {
  margin: 0 0 6px;
  color: var(--muted);
}

.detail-line strong {
  color: var(--text);
}

.code {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.long-code {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.hidden {
  display: none;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.check-row input {
  width: auto;
}

.preview-box {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.message-body-preview {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  line-height: 1.5;
  color: var(--text);
}

.invite-item {
  display: grid;
  gap: 10px;
}

.invite-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.invite-meta-grid {
  display: grid;
  gap: 4px 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.invite-link {
  color: var(--muted);
}

.tiny-button {
  width: auto;
  min-width: 0;
  padding: 8px 10px;
}

.invite-status-used {
  border-color: rgba(99, 179, 237, 0.45);
}

.invite-status-revoked {
  border-color: rgba(252, 211, 77, 0.45);
}
