:root {
  color-scheme: dark;
  --page: #0e1320;
  --panel: #151b2b;
  --line: #323c54;
  --text: #edf0fe;
  --muted: #aebad3;
  --focus: #b9b0ff;
  --mint: #94ddc4;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--text); }
button, input, select, textarea { font: inherit; }
p, h1, h2, h3 { margin: 0; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .64; cursor: wait; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
.site-header {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px clamp(20px, 4.8vw, 70px);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 720;
  font-size: 20px;
  letter-spacing: -.035em;
}
.mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #191630;
  background: var(--focus);
  font-size: 25px;
  line-height: 1;
}
.shell {
  max-width: 1100px;
  margin: clamp(30px, 10vh, 110px) auto;
  padding: 0 clamp(18px, 4.8vw, 53px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 1.14fr);
  gap: clamp(28px, 5.5vw, 82px);
  align-items: start;
}
.intro { padding-top: clamp(0px, 3vh, 30px); }
.emblem { width: 68px; height: 65px; position: relative; margin-bottom: 19px; }
.emblem span {
  width: 59px;
  height: 26px;
  position: absolute;
  left: 3px;
  top: 19px;
  border-radius: 50%;
  border: 1px solid #b0a4fd;
  transform: rotate(-43deg);
}
.emblem span:nth-child(2) { transform: rotate(43deg); border-color: #a2e7cf; }
.emblem span:nth-child(3) { transform: rotate(90deg); }
.emblem i {
  position: absolute;
  left: 29px;
  top: 28px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 20px #a0ebcb80;
}
.intro-title { font-size: clamp(34px, 5vw, 63px); font-weight: 740; letter-spacing: -.06em; line-height: 1.04; }
.intro p + p { color: var(--muted); max-width: 30ch; margin-top: 17px; }
.content { min-width: 0; display: grid; gap: 16px; }
.card {
  padding: clamp(17px, 3vw, 28px);
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 15px;
}
.card h1 { font-size: clamp(22px, 3vw, 29px); font-weight: 690; line-height: 1.2; letter-spacing: -.035em; }
.card h2 { font-size: 21px; font-weight: 680; }
.subtext { color: var(--muted); font-size: 14px; margin: 8px 0 16px; overflow-wrap: anywhere; }
form label, .invite-share label { display: block; margin: 13px 0 5px; font-size: 14px; font-weight: 620; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  display: block;
  padding: 10px 11px;
  border: 1px solid #54627d;
  background: #101628;
  border-radius: 7px;
  color: var(--text);
}
textarea { resize: vertical; }
.primary, .secondary, .link-button {
  display: inline-block;
  padding: 9px 13px;
  border-radius: 7px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 650;
  line-height: 1.4;
}
.primary { background: var(--focus); color: #1a1734; }
.primary:hover:not(:disabled) { background: #d1cbff; }
.secondary { color: var(--text); background: transparent; border-color: #61708f; }
.secondary:hover:not(:disabled) { border-color: var(--focus); }
.link-button { background: transparent; color: var(--muted); padding: 7px 5px; }
.link-button:hover:not(:disabled) { color: var(--text); text-decoration: underline; }
#login-form .primary, #activate-form .primary, #session-retry { margin-top: 18px; }
#activate-form .link-button { margin-left: 7px; }
.field-help { color: var(--muted); margin-top: 5px; font-size: 13px; }
.first-access { margin-top: 15px; }
.feedback {
  color: #ffc0ba;
  background: #301e28;
  border: 1px solid #89555c;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 14px;
}
.confirmation { background: #172b29; color: var(--mint); border-color: #3d7564; }
.owner-access { display: grid; justify-items: start; gap: 12px; font-size: 14px; }
.cockpit .field-help:empty { display: none; }
.mail-connection label { display: block; margin: 9px 0 5px; font-size: 14px; font-weight: 620; }
.mail-connection .link-button { padding-left: 0; font-size: 13px; }
.mail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#mail-review {
  width: min(92vw, 540px);
  max-height: 88vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  color: var(--text);
}
#mail-review::backdrop { background: #0a0e18bf; }
.mail-review-details { margin: 14px 0; }
.mail-review-details dt { margin: 8px 0 2px; color: var(--muted); font-size: 13px; }
.mail-review-details dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
#review-message { max-height: 220px; overflow: auto; }
#review-status { margin-bottom: 10px; }
.station-list, .handoff-list { list-style: none; margin: 8px 0 0; padding: 0; }
.station-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(153px, 1fr)); gap: 8px; }
.station-list a { display: block; height: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; overflow-wrap: anywhere; }
.station-list a:hover { border-color: var(--focus); }
.station-list span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.cockpit-section { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; }
.cockpit-section summary { cursor: pointer; font-weight: 650; }
.cockpit-section .list-header { margin-top: 0; }
.cockpit-section .secondary { margin-top: 10px; font-size: 14px; }
.portal-share { margin-top: 4px; }
.portal-share button { padding-left: 0; font-size: 13px; }
.handoff-list li { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 11px; }
.handoff-preview { display: block; max-height: 9rem; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; }
.handoff-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.handoff-actions .link-button { font-size: 13px; }
.invite-controls { display: flex; gap: 8px; align-items: stretch; }
.invite-controls button { flex-shrink: 0; padding-inline: 9px; }
.invite-share { margin-top: 15px; border: 1px solid #4b756a; border-radius: 8px; padding: 9px 12px 12px; }
.invite-share label { margin-top: 0; }
.list-header { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 18px; }
.list-header h3 { font-size: 15px; }
.invite-list { list-style: none; margin: 6px 0 0; padding: 0; }
.invite-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.invite-list p { font-size: 14px; }
.invite-list span { display: block; color: var(--muted); font-size: 12px; }
.invite-list button { padding: 5px 7px; font-size: 13px; }
@media (max-width: 720px) {
  .shell { grid-template-columns: minmax(0, 1fr); margin: 25px auto 45px; }
  .intro-title br { display: none; }
  .intro p + p { max-width: 40ch; }
  .emblem { height: 53px; margin-bottom: 10px; }
}
@media (max-width: 405px) {
  .invite-controls { flex-wrap: wrap; }
  .invite-controls button { width: 100%; }
}
