:root {
  color-scheme: dark;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --vibe-ground: #070414;
  --vibe-ground-raised: #0c0721;
  --vibe-surface: #110a2d;
  --vibe-surface-raised: #17103c;
  --vibe-field: #0d0831;
  --vibe-border: #2b1a64;
  --vibe-border-strong: #4a2da4;
  --vibe-text: #f5f3ff;
  --vibe-text-muted: #d2d8ff;
  --vibe-text-subtle: #aaa5d2;
  --vibe-primary: #6d3ce5;
  --vibe-primary-hover: #8150f2;
  --vibe-primary-active: #5930c6;
  --vibe-focus: #a843e5;
  --vibe-teal: #7ec5eb;
  --vibe-error: #ffb6c4;
  --vibe-error-surface: #341427;
  --vibe-success: #9de8c2;
  --vibe-success-surface: #102a28;
  --vibe-warning: #ffe19a;
  --vibe-warning-surface: #312412;
  --vibe-shadow: 0 18px 50px rgb(0 0 0 / 0.34);
  background: var(--vibe-ground);
  color: var(--vibe-text);
}
* { box-sizing: border-box; }
* {
  scrollbar-width: thin;
  scrollbar-color: #51407f #090517;
}
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: #090517;
}
::-webkit-scrollbar-thumb {
  border: 3px solid #090517;
  border-radius: 99px;
  background: #51407f;
}
::-webkit-scrollbar-thumb:hover {
  background: #6a34be;
}
body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  background: var(--vibe-ground);
}
main {
  width: min(760px, calc(100% - 32px));
  margin: 48px auto;
  padding: 32px;
  border: 1px solid var(--vibe-border);
  border-radius: 16px;
  background: var(--vibe-surface);
  box-shadow: var(--vibe-shadow);
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
h1 {
  margin: 0;
  color: var(--vibe-text);
  letter-spacing: -0.03em;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
}
p {
  line-height: 1.6;
  color: var(--vibe-text-muted);
}
form {
  display: grid;
  gap: 12px;
  margin: 24px 0;
}
input,
select,
button {
  font: inherit;
  padding: 12px;
  border: 1px solid var(--vibe-border);
  border-radius: 8px;
}
.action-button {
  display: inline-flex;
  min-height: 2.55rem;
  align-items: center;
  justify-content: center;
  border: 1px solid #8b5cf6;
  background: linear-gradient(135deg, var(--vibe-primary), #4b22b9);
  padding: 0 14px;
}
.action-button-small { min-height: 2.2rem; padding-inline: 11px; font-size: .86rem; }
.action-button-secondary {
  border-color: #534da5;
  background: transparent;
  color: var(--vibe-text);
}
.vibe-field { border-color: #534da5; background: var(--vibe-field); color: var(--vibe-text); }
.status-pill {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  border: 1px solid #534da5;
  border-radius: 999px;
  background: color-mix(in srgb, #7c3aed 20%, transparent);
  color: #c4b5fd;
  padding: 3px 9px;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1;
}
input,
select,
textarea {
  width: 100%;
  background: var(--vibe-field);
  color: var(--vibe-text);
}
input::placeholder,
textarea::placeholder { color: var(--vibe-text-subtle); }
input:hover,
select:hover,
textarea:hover { border-color: var(--vibe-border-strong); }
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 3px solid var(--vibe-focus);
  outline-offset: 2px;
}
button {
  cursor: pointer;
  border-color: transparent;
  background: var(--vibe-primary);
  color: #fff;
  font-weight: 700;
  transition: background-color 160ms ease-out, transform 160ms ease-out;
}
button:hover:not(:disabled) {
  background: var(--vibe-primary-hover);
}
button:active:not(:disabled) {
  background: var(--vibe-primary-active);
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.58;
  cursor: wait;
}
button.secondary {
  border-color: var(--vibe-border);
  background: var(--vibe-surface-raised);
  color: var(--vibe-text);
}
output {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid var(--vibe-border);
  background: var(--vibe-ground-raised);
  padding: 18px;
  margin: 16px 0;
  font-family: monospace;
}
ul#conversations,
ul#messages {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
ul#conversations li,
ul#messages li {
  padding: 0;
  margin: 0 0 8px;
}
ul#conversations button.inbox-row {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--vibe-surface-raised);
  color: var(--vibe-text);
  border: 1px solid var(--vibe-border);
}
ul#conversations button.inbox-row.has-bodies {
  border-color: var(--vibe-border-strong);
  background: #1b1048;
}
ul#conversations .row-title {
  display: block;
  font-weight: 600;
}
ul#conversations .row-meta {
  display: block;
  margin-top: 4px;
  color: var(--vibe-text-subtle);
  font-size: 0.92em;
}
ul#messages li {
  padding: 10px 12px;
  background: var(--vibe-surface-raised);
  border-radius: 8px;
  border: 1px solid var(--vibe-border);
  overflow-wrap: anywhere;
}
.compose {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--vibe-border);
}
.compose h3 {
  margin: 0 0 8px;
}
.compose-meta {
  margin: 0 0 12px;
  color: var(--vibe-text-subtle);
  font-size: 0.92em;
}
textarea#draft-text {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 12px;
  border: 1px solid var(--vibe-border);
  border-radius: 8px;
  resize: vertical;
  min-height: 96px;
}
.compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.delivery-outcome {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--vibe-border);
  background: var(--vibe-surface-raised);
  overflow-wrap: anywhere;
}
.delivery-outcome.confirmed {
  border-color: var(--vibe-success);
  background: var(--vibe-success-surface);
}
.delivery-outcome.failed {
  border-color: var(--vibe-error);
  background: var(--vibe-error-surface);
}
.delivery-outcome.unknown {
  border-color: var(--vibe-warning);
  background: var(--vibe-warning-surface);
}
label {
  font-weight: 600;
  color: var(--vibe-text);
}
[hidden] {
  display: none !important;
}
body.login-page {
  display: grid;
  place-items: center;
  overflow-x: hidden;
  background: transparent;
}
body.login-page .gradient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
}
.login-shell {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100% - 40px));
  margin: 32px auto;
  padding: 0;
  overflow: hidden;
  border: 5px solid transparent;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #05062d, #0c0e41) padding-box,
    linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb) border-box;
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.46);
}
.login-panel { padding: clamp(28px, 6vw, 42px); }
.login-heading { display: block; margin-bottom: 30px; text-align: center; }
.login-logo {
  display: block;
  width: 189px;
  height: auto;
  margin: 0 auto 18px;
}
.login-heading h1 {
  margin: 0 auto;
  max-width: 22ch;
  font-size: clamp(1.05rem, 2.8vw, 1.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--vibe-text);
}
.page-title-highlight {
  background-image: linear-gradient(to right, #00f4ff, #b154ec);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.login-form { margin: 0; gap: 18px; }
.field-group { display: grid; gap: 8px; }
.login-form label { font-weight: 700; }
.login-form input { min-height: 46px; }

/* Critical action (same material as shared/vibe-ui action-buttons.css) */
.login-form {
  --vibe-action-radius: 6px;
  --vibe-action-radius-inner: 4px;
  --vibe-action-border-width: 2px;
  --vibe-action-face: rgb(5 6 45);
  --vibe-action-gradient: linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb);
}
@property --critical-action-border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.login-form .critical-action-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  margin-top: 6px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--vibe-action-radius);
  background: transparent;
  padding: var(--vibe-action-border-width);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  white-space: nowrap;
  transition: transform 180ms ease;
}
.login-form .critical-action-button::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  content: "";
  border-radius: inherit;
  background: var(--vibe-action-gradient);
  pointer-events: none;
}
.login-form .critical-action-button__content {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-self: stretch;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--vibe-action-radius-inner);
  background: transparent;
  padding: 8px 12px;
  transition: background-color 300ms ease;
}
.login-form .critical-action-button:hover:not(:disabled) {
  background: transparent;
  transform: translateY(-1px);
}
.login-form .critical-action-button:hover:not(:disabled) .critical-action-button__content {
  background: var(--vibe-action-face);
}
.login-form .critical-action-button:hover:not(:disabled)::before {
  background: conic-gradient(from var(--critical-action-border-angle), #af40ff 0deg, #5b42f3 120deg, #00ddeb 240deg, #af40ff 360deg);
  animation: critical-action-border-rotate 1.35s linear infinite;
}
.login-form .critical-action-button:active:not(:disabled) {
  background: transparent;
  transform: none;
}
.login-form .critical-action-button:focus-visible {
  outline: 3px solid var(--vibe-focus);
  outline-offset: 3px;
}
.login-form .critical-action-button:disabled {
  cursor: wait;
  opacity: 0.5;
}
@keyframes critical-action-border-rotate {
  to { --critical-action-border-angle: 1turn; }
}
.form-status {
  margin: 0;
  color: var(--vibe-text-muted);
  font-size: 0.925rem;
  text-align: center;
}
.form-status:not(:empty) {
  min-height: 1.6em;
  margin-top: 14px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  body.login-page .gradient-bg .g1,
  body.login-page .gradient-bg .g2,
  body.login-page .gradient-bg .g3,
  body.login-page .gradient-bg .g4,
  body.login-page .gradient-bg .g5,
  body.login-page .gradient-bg .s1,
  body.login-page .gradient-bg .s2,
  body.login-page .gradient-bg .s3,
  body.login-page .gradient-bg .s4,
  body.login-page .gradient-bg .s5,
  body.login-page .gradient-bg .s6,
  body.login-page .gradient-bg .s7,
  body.login-page .gradient-bg .s8 {
    animation: none !important;
  }
  .login-form .critical-action-button:hover:not(:disabled)::before {
    animation: none !important;
  }
}
@media (forced-colors: active) {
  input, select, textarea, button, main, .login-shell { forced-color-adjust: auto; }
  * { scrollbar-color: CanvasText Canvas; }
  ::-webkit-scrollbar-track { background: Canvas !important; }
  ::-webkit-scrollbar-thumb {
    border-color: Canvas !important;
    background: CanvasText !important;
  }
}
@media (max-width: 800px) {
  main {
    width: calc(100% - 32px);
    margin: 16px auto;
    padding: 20px;
  }
  header {
    gap: 12px;
  }
}
@media (max-width: 480px) {
  .login-shell { width: calc(100% - 28px); margin: 14px auto; }
  .login-panel { padding: 28px 22px; }
}
