* {
  box-sizing: border-box;
}
:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
  --bg: #f6f5f9;
  --surface: #fff;
  --fg: #24212f;
  --muted: #666071;
  --line: #e3dfea;
  --purple: #5c2cbf;
  --selected: #efe9fb;
  --pink: #a52b70;
  --success: #216347;
  --danger: #aa2341;
  --soft: #faf9fc;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17151d;
  --surface: #201d28;
  --fg: #f1edf8;
  --muted: #b8b0c5;
  --line: #393343;
  --purple: #b99afa;
  --selected: #382650;
  --pink: #ef9ac5;
  --success: #91d4b1;
  --danger: #ffadc1;
  --soft: #26212f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17151d;
    --surface: #201d28;
    --fg: #f1edf8;
    --muted: #b8b0c5;
    --line: #393343;
    --purple: #b99afa;
    --selected: #382650;
    --pink: #ef9ac5;
    --success: #91d4b1;
    --danger: #ffadc1;
    --soft: #26212f;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: 0.6;
}
:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}
a {
  color: var(--purple);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.7px;
  line-height: 1.2;
}
h2 {
  font-size: 20px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 16px;
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
.stack {
  display: grid;
  gap: 16px;
}
.button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  border-radius: 9px;
  min-height: 44px;
  padding: 9px 15px;
  font-weight: 600;
  white-space: normal;
}
.button:hover {
  background: var(--soft);
}
.primary {
  background: #5c2cbf;
  color: #fff;
  border-color: #5c2cbf;
}
.primary:hover {
  background: #482197;
}
.danger {
  color: var(--danger);
}
.text {
  border-color: transparent;
  background: transparent;
  color: var(--purple);
}
.field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  background: var(--surface);
  color: var(--fg);
  padding: 10px 12px;
}
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  accent-color: #5c2cbf;
}
textarea {
  resize: vertical;
  overflow-wrap: anywhere;
}
.check {
  display: flex;
  gap: 9px;
  align-items: center;
}
.form {
  display: grid;
  gap: 17px;
  max-width: 640px;
}
.form .button[type="submit"] {
  justify-self: start;
  min-width: 140px;
}
.error {
  color: var(--danger);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.error:empty {
  display: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
}
.brand strong {
  letter-spacing: 0.8px;
}
.brand small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 1px;
}
.login {
  min-height: 100dvh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 28px 20px;
}
.login-box {
  width: min(100%, 420px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  display: grid;
  gap: 26px;
}
.login-box .form {
  max-width: 100%;
}
.login-box .form .primary {
  width: 100%;
}
.login-footer {
  margin-top: 20px;
  max-width: 350px;
  text-align: center;
  font-size: 13px;
}
.password-row {
  display: flex;
  gap: 8px;
  align-items: end;
}
.password-row .field {
  flex: 1;
}
.password-row button {
  flex-shrink: 0;
}
.topbar {
  height: 72px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 12px;
}
.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.owner-name {
  font-size: 13px;
  color: var(--muted);
}
.sidebar {
  position: fixed;
  top: 72px;
  bottom: 0;
  left: 0;
  width: 224px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 24px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  padding: 9px 12px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: left;
  font-weight: 550;
}
.nav-item[aria-current="page"] {
  background: var(--selected);
  color: var(--purple);
}
.nav-icon {
  font-size: 19px;
  width: 23px;
  text-align: center;
  flex-shrink: 0;
}
.collapse {
  margin-top: auto;
}
.main {
  margin-left: 224px;
  padding: 32px clamp(22px, 3vw, 48px);
  max-width: 1700px;
  min-height: calc(100dvh - 72px);
}
.page-head {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--pink);
  font-weight: 700;
  margin-bottom: 7px;
}
.toolbar {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-bottom: 22px;
  max-width: 760px;
}
.toolbar .field {
  flex: 1;
}
.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.table th {
  font-weight: 550;
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
}
.table th,
.table td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table th:last-child,
.table td:last-child {
  width: 150px;
  white-space: nowrap;
  overflow-wrap: normal;
}
.table td:last-child .button {
  white-space: nowrap;
  min-width: 92px;
}
.cell-name {
  font-weight: 650;
}
.subline {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  background: var(--soft);
  color: var(--muted);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
}
.badge.good {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 9%, var(--surface));
}
.badge.warn {
  color: var(--pink);
  background: color-mix(in srgb, var(--pink) 8%, var(--surface));
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 28px;
}
.metric {
  background: var(--surface);
  padding: 22px;
}
.metric strong {
  display: block;
  font-size: 32px;
  letter-spacing: -1px;
  margin-top: 8px;
}
.section-title {
  margin: 26px 0 14px;
}
.quick-list {
  display: grid;
}
.quick-list button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  background: var(--surface);
  color: var(--fg);
}
.quick-list button:last-child {
  border-bottom: 0;
}
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.service {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  display: grid;
  gap: 15px;
}
.service-top {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: start;
}
.service-profile {
  font-weight: 600;
  color: var(--purple);
}
.service-footer {
  border-top: 1px solid var(--line);
  padding-top: 13px;
  color: var(--muted);
  font-size: 13px;
}
.service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.empty {
  padding: 40px 20px;
  text-align: center;
  display: grid;
  gap: 8px;
}
.empty strong {
  font-size: 17px;
}
.detail-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}
.detail-bar .grow {
  flex: 1;
}
.bottom-nav {
  display: none;
}
.loading {
  padding: 50px;
  text-align: center;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--fg);
  width: min(620px, calc(100% - 24px));
  max-height: calc(100dvh - 30px);
  padding: 24px;
  overflow: auto;
}
dialog::backdrop {
  background: #14101f80;
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}
.dialog-head h2 {
  font-size: 20px;
}
dialog .form {
  width: 100%;
}
.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.settings {
  max-width: 700px;
  display: grid;
  gap: 24px;
}
.settings section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  display: grid;
  gap: 14px;
}
.skip {
  position: fixed;
  top: -100px;
  z-index: 99;
  background: var(--surface);
  padding: 12px;
}
.skip:focus {
  top: 8px;
}
#notifications:not(:empty) {
  position: fixed;
  bottom: 22px;
  right: 22px;
  max-width: min(400px, calc(100% - 32px));
  border: 1px solid var(--line);
  padding: 13px 18px;
  background: var(--surface);
  color: var(--fg);
  border-radius: 10px;
  z-index: 10;
  pointer-events: none;
}
.shell.compact .sidebar {
  width: 80px;
}
.shell.compact .nav-name,
.shell.compact .nav-label {
  display: none;
}
.shell.compact .main {
  margin-left: 80px;
}
.back {
  margin-bottom: 18px;
}
.explanation {
  max-width: 62ch;
}
.mobile-only {
  display: none;
}
@media (max-width: 767px) {
  .topbar {
    height: 66px;
    padding: 0 16px;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  .owner-name {
    display: none;
  }
  .sidebar {
    display: none;
  }
  .main,
  .shell.compact .main {
    margin-left: 0;
    padding: 25px 16px calc(105px + env(safe-area-inset-bottom));
  }
  .page-head {
    align-items: start;
    gap: 12px;
    margin-bottom: 22px;
  }
  .page-head .button {
    padding: 9px 12px;
  }
  .eyebrow {
    font-size: 10px;
  }
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .metric {
    padding: 14px 10px;
    font-size: 12px;
  }
  .metric strong {
    font-size: 26px;
  }
  .table,
  .table tbody {
    display: block;
  }
  .table thead {
    display: none;
  }
  .table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 15px;
    gap: 9px;
    border-bottom: 1px solid var(--line);
  }
  .table tbody tr:last-child {
    border: 0;
  }
  .table td {
    display: block;
    border: 0;
    padding: 0;
    min-width: 0;
  }
  .table td:last-child {
    width: auto;
    grid-column: 2;
    grid-row: 1/3;
    align-self: center;
  }
  .table td:nth-last-child(2) {
    grid-column: 1;
  }
  .table .desktop-only {
    display: none;
  }
  .service-grid {
    grid-template-columns: 1fr;
  }
  .service {
    padding: 18px;
  }
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
    z-index: 3;
  }
  .bottom-nav .nav-item {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    justify-content: center;
    padding: 5px;
    min-height: 52px;
    font-size: 11px;
  }
  .bottom-nav .nav-icon {
    font-size: 19px;
  }
  .two-fields {
    grid-template-columns: 1fr;
  }
  dialog {
    padding: 20px;
  }
  .login-box {
    padding: 24px;
  }
  .mobile-only {
    display: block;
  }
  .toolbar {
    gap: 8px;
  }
  #notifications:not(:empty) {
    bottom: calc(88px + env(safe-area-inset-bottom));
    right: 16px;
  }
  .detail-bar .grow {
    flex-basis: 100%;
  }
  .dialog-head h2 {
    font-size: 18px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .button,
  .nav-item {
    transition:
      background 0.14s ease,
      color 0.14s ease;
  }
  .main {
    animation: appear 0.16s ease;
  }
  @keyframes appear {
    from {
      opacity: 0.6;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

.mail-section {
  margin-top: 1.8rem;
}
.mail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.mail-info {
  min-width: 0;
}
.mail-address {
  overflow-wrap: anywhere;
  user-select: text;
}
.mail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.mail-row .muted {
  margin: 0.25rem 0;
}
@media (max-width: 767px) {
  .mail-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .mail-actions {
    width: 100%;
  }
}

.request-detail {
  max-width: 46rem;
  padding: 1rem 0;
}
.request-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.verification-code {
  font-size: clamp(2rem, 10vw, 3.25rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  user-select: all;
  color: var(--fg);
}

.connection-steps {
  padding-left: 1.3rem;
  margin: 0;
}
.connection-steps li {
  margin-bottom: 1.5rem;
  padding-left: 0.25rem;
}
.connection-steps .field {
  margin: 0.65rem 0;
}
.connection-steps .button {
  margin: 0.25rem 0.25rem 0.25rem 0;
}
.connection-guide {
  min-width: 0;
}
.connection-guide a {
  overflow-wrap: anywhere;
}

.connection-guide a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  vertical-align: middle;
}
