:root {
  color-scheme: dark;
  --bg: #101216;
  --surface: #191c22;
  --raised: #20242c;
  --line: #343a46;
  --control: #778194;
  --text: #f2f4f8;
  --muted: #aeb7c7;
  --blue: #2563eb;
  --link: #9abfff;
  --green: #83dfb6;
  --red: #ffaaaa;
  --radius: 12px;
  font:
    16px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--link);
}
p {
  margin: 8px 0 20px;
  color: var(--muted);
  max-width: 65ch;
}
h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.025em;
}
h1 {
  overflow-wrap: anywhere;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
}
h2 {
  font-size: 1.2rem;
}
h3 {
  font-size: 1rem;
}
button,
.btn {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--control);
  background: var(--raised);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
}
button:hover,
.btn:hover {
  background: #303743;
}
button:active,
.btn:active {
  transform: translateY(1px);
}
.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.primary:hover {
  background: #1d4ed8;
}
.danger {
  color: var(--red);
  border-color: #aa6565;
  background: transparent;
}
.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}
button svg,
.btn svg,
nav svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:focus-visible {
  outline: 3px solid #bad6ff;
  outline-offset: 3px;
}
input,
select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--control);
  background: #111419;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23aeb7c7' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}
html[dir="rtl"] select {
  background-position: left 12px center;
}
@media (forced-colors: active) {
  select {
    -webkit-appearance: auto;
    appearance: auto;
    background-image: none;
  }
}
input::placeholder {
  color: #a2acbc;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  accent-color: var(--blue);
  flex-shrink: 0;
}
label {
  display: block;
  font-size: 0.9rem;
  font-weight: 550;
  margin-bottom: 8px;
}
.field {
  margin-bottom: 20px;
}
.credential-group {
  margin-bottom: 24px;
}
.credential-group .field {
  margin-bottom: 0;
}
.credential-group .grid {
  gap: 20px;
}
.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 8px 0 0;
}
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin: 0;
  cursor: pointer;
  font-weight: 400;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
}
.brandmark {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand small {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.08em;
  display: block;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}
aside {
  border-inline-end: 1px solid var(--line);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  background: #14171c;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.mobile-bar,
.drawer-backdrop,
#menu-close {
  display: none;
}
.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  color: var(--muted);
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
}
nav a:hover {
  background: var(--raised);
  color: var(--text);
}
nav a[aria-current="page"] {
  color: #c6daff;
  background: #203151;
  box-shadow: inset 3px 0 #7aafff;
}
html[dir="rtl"] nav a[aria-current="page"] {
  box-shadow: inset -3px 0 #7aafff;
}
.aside-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aside-footer select,
.aside-footer button {
  width: 100%;
}
header {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 40px;
  border-bottom: 1px solid var(--line);
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.toolbar select {
  width: auto;
  min-width: 95px;
  font-size: 0.85rem;
}
main {
  max-width: 1240px;
  margin: auto;
  padding: 40px;
  width: 100%;
}
.standalone header {
  max-width: 1080px;
  margin: auto;
  border: 0;
}
.standalone main {
  max-width: 860px;
  padding-top: 32px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-weight: 650;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.page-head p {
  margin-bottom: 0;
}
.card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 24px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.card-header p {
  margin-bottom: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.stat .value {
  font-size: 2rem;
  letter-spacing: -0.04em;
  margin: 12px 0 0;
  line-height: 1.2;
  font-weight: 600;
}
.stat .hint {
  margin-top: 12px;
}
.stat-label {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.stat-label svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #203b32;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 6px;
  padding: 5px 9px;
  white-space: nowrap;
}
.badge.warn {
  background: #403522;
  color: #f5d18c;
}
.badge.neutral {
  background: #2b303b;
  color: #cbd3e0;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.row:first-child {
  padding-top: 0;
}
.row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.account-row {
  position: relative;
  isolation: isolate;
}
.account-row,
.account-row:first-child,
.account-row:last-child {
  padding: 12px;
  margin-inline: -12px;
}
.account-link {
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.account-row::before,
.account-link::after {
  content: "";
  position: absolute;
  inset: 4px 0;
  border-radius: 8px;
}
.account-row::before {
  z-index: -1;
}
.account-link:hover {
  color: var(--link);
}
.account-row:has(.account-link:hover)::before {
  background: var(--raised);
}
.account-link:focus-visible {
  outline: none;
}
.account-link:focus-visible::after {
  outline: 3px solid #bad6ff;
  outline-offset: 4px;
}
.account-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account-row button {
  position: relative;
  z-index: 1;
}
.identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.identity h3 {
  overflow-wrap: anywhere;
}
.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  background: #273449;
  color: #aacaff;
  font-weight: 600;
}
.identity p {
  margin: 4px 0 0;
  font-size: 0.82rem;
}
.empty {
  text-align: center;
  padding: 32px 12px;
}
.empty svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  margin-bottom: 16px;
}
.empty p {
  margin: 12px auto 24px;
}
.notice {
  padding: 14px 16px;
  border: 1px solid #63738d;
  border-radius: 8px;
  color: #cbd7e8;
  background: #202a39;
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.error {
  border-color: #b16a6a;
  color: var(--red);
  background: #342326;
}
.install {
  background: linear-gradient(120deg, #1b2b47, #191e29);
  border-color: #3b5278;
}
.install h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.install-actions {
  margin: 4px 0 16px;
}
.install .install-actions .btn {
  margin: 0;
  min-height: 48px;
}
.install-logo {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
}
.copy-field {
  display: flex;
  gap: 10px;
}
.copy-field input {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  direction: ltr;
}
.section-label {
  margin: 32px 0 16px;
}
.muted {
  color: var(--muted);
}
.sources {
  max-height: 320px;
  overflow: auto;
  margin: 16px 0;
}
.sources .check {
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.steps {
  display: flex;
  list-style: none;
  gap: 8px;
  padding: 0;
  margin: 0 0 32px;
  counter-reset: step;
}
.steps li {
  flex: 1;
  border-top: 2px solid var(--line);
  padding-top: 12px;
  font-size: 0.8rem;
  color: var(--muted);
}
.steps li[aria-current="step"] {
  color: #b2cfff;
  border-color: #7aafff;
}
.steps li::before {
  counter-increment: step;
  content: counter(step) ". ";
  font-weight: 700;
}
.form-width {
  max-width: 600px;
}
.login {
  max-width: 460px;
  margin: 56px auto;
}
.login h1 {
  overflow-wrap: anywhere;
  font-size: 1.8rem;
  margin-bottom: 12px;
}
.split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.qr {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  border-radius: 10px;
}
.segmented {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}
.segmented button {
  flex: 1;
}
.segmented button[aria-pressed="true"] {
  background: #243957;
  border-color: #9abfff;
  color: #c7ddff;
}
dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--control);
  border-radius: 16px;
  padding: 28px;
  width: min(520px, calc(100% - 32px));
  max-height: 90vh;
  overflow: auto;
}
dialog::backdrop {
  background: #000a;
  backdrop-filter: blur(4px);
}
dialog h2 {
  margin-bottom: 12px;
}
dialog .close {
  float: inline-end;
  margin: -12px -12px 4px 8px;
}
.dialog-body {
  clear: both;
}
.dialog-error:empty {
  display: none;
}
#toast:empty {
  display: none;
}
#toast {
  position: fixed;
  inset-block-end: 24px;
  inset-inline-end: 24px;
  max-width: calc(100% - 48px);
  padding: 14px 20px;
  border: 1px solid var(--control);
  border-radius: 10px;
  background: #283344;
  color: var(--text);
  box-shadow: 0 8px 28px #0006;
  z-index: 20;
}
.skip {
  position: fixed;
  top: -100px;
  left: 16px;
  padding: 12px;
  background: var(--blue);
  color: white;
  z-index: 30;
}
.skip:focus {
  top: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.help-line {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 24px;
}
.filename {
  overflow-wrap: anywhere;
}
details summary {
  cursor: pointer;
  min-height: 44px;
  padding: 8px 0;
  font-weight: 600;
}
details[open] summary {
  margin-bottom: 16px;
}
.tutorial-list {
  max-width: 860px;
}
.tutorial {
  border: 1px solid var(--control);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 16px;
}
.tutorial > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 60px;
  padding: 16px 20px;
  border-radius: var(--radius);
  list-style: none;
  color: var(--text);
}
.tutorial > summary::-webkit-details-marker {
  display: none;
}
.tutorial > summary:hover {
  background: var(--raised);
}
.tutorial[open] > summary {
  margin-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.tutorial-chevron {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 160ms ease-out;
}
.tutorial-chevron svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tutorial[open] .tutorial-chevron {
  transform: rotate(180deg);
}
.tutorial-body {
  padding: 24px;
  border-top: 1px solid var(--line);
}
.tutorial-body > p:first-child {
  margin-top: 0;
}
.tutorial-video {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a0c10;
  box-shadow: 0 16px 38px #0005;
}
.tutorial-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.tutorial-instructions {
  margin-top: 24px;
}
.tutorial-instructions h3 {
  margin-bottom: 12px;
}
.tutorial-instructions ol {
  margin: 0;
  padding-inline-start: 1.5rem;
  color: var(--muted);
}
.tutorial-instructions li {
  padding-inline-start: 6px;
  margin-bottom: 8px;
}
.tutorial-instructions li:last-child {
  margin-bottom: 0;
}
.tutorial-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  max-width: none;
  margin-top: 16px;
}
.tutorial-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.tutorial-note {
  max-width: none;
  padding: 14px 16px;
  border-inline-start: 3px solid #7aafff;
  border-radius: 6px;
  background: #202a39;
  color: #cbd7e8;
  margin-bottom: 0;
}
@media (max-width: 1000px) {
  .shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  main,
  header {
    padding: 24px;
  }
  .stats {
    gap: 12px;
  }
  .card {
    padding: 22px;
  }
  .row {
    flex-wrap: wrap;
  }
  .row .actions {
    margin-inline-start: auto;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .mobile-bar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 72px;
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
    background: #14171c;
  }
  .mobile-bar .brand small {
    display: none;
  }
  .mobile-bar .brandmark {
    width: 36px;
    height: 36px;
  }
  #menu-toggle {
    flex-shrink: 0;
  }
  .shell aside {
    display: none;
    position: fixed;
    inset-block-start: 0;
    inset-inline-start: 0;
    z-index: 40;
    width: min(320px, 90vw);
    height: 100vh;
    height: 100dvh;
    padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    gap: 24px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .shell aside.drawer-open {
    display: flex;
  }
  .sidebar-heading .brand {
    font-size: 1rem;
    gap: 8px;
    min-width: 0;
  }
  .sidebar-heading .brandmark {
    width: 32px;
    height: 32px;
  }
  #menu-close {
    display: inline-flex;
    flex-shrink: 0;
    padding: 10px;
  }
  .drawer-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgb(0 0 0 / 65%);
  }
  body.navigation-open {
    position: fixed;
    width: 100%;
    overflow: hidden;
  }
  main,
  .standalone main {
    padding: 24px 20px;
  }
  .standalone header {
    padding: 16px 20px;
  }
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .stat {
    margin-bottom: 0;
  }
  .stats {
    margin-bottom: 24px;
  }
  .stat .value {
    font-size: 1.6rem;
  }
  .card {
    padding: 20px;
  }
  .copy-field {
    flex-wrap: wrap;
  }
  .copy-field input {
    flex-basis: 100%;
  }
  .grid {
    gap: 0;
  }
  .row .actions {
    margin-inline-start: 0;
  }
  .toolbar {
    margin-inline-start: auto;
  }
  .steps li {
    font-size: 0.75rem;
  }
  .actions {
    gap: 8px;
  }
  .card-header {
    align-items: flex-start;
  }
  .login {
    margin: 24px auto;
  }
  .brand {
    font-size: 1rem;
  }
  .install .install-actions .btn {
    width: 100%;
  }
  .tutorial > summary {
    padding: 14px 16px;
  }
  .tutorial-body {
    padding: 20px 16px;
  }
  .tutorial-links {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.page-head > div {
  min-width: 0;
}

.qr-expired {
  color: var(--red);
  font-weight: 600;
}

#generate[hidden] {
  display: none;
}
