/* summit's tokens (pos/apps/summit/src/app/globals.css), so the library reads as one of ours. */
:root {
  --background: #ffffff;
  --foreground: #0f172a;
  --surface: #fafbfc;
  --card: #ffffff;
  --primary: #06294c;
  --primary-light: #0a3d6e;
  --primary-foreground: #ffffff;
  --link: #06294c;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #f1f5f9;
  --border: #e2e8f0;
  --ring: #06294c;
  --gold: #f2ab00;
  --warning: #fffbeb;
  --warning-foreground: #92400e;
  --success: #ecfdf5;
  --success-foreground: #065f46;
  --danger: #b42318;
  --sidebar: #fafbfc;
  --nav-idle: rgb(15 23 42 / 0.62);
  --nav-hover: rgb(15 23 42 / 0.04);
  --nav-active: rgb(15 23 42 / 0.07);
  --radius: 0.75rem;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 4px 16px rgb(15 23 42 / 0.06);
  --shadow-lg: 0 4px 12px rgb(15 23 42 / 0.08), 0 16px 40px rgb(15 23 42 / 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

/* carbon, summit's dark theme. the system setting picks it unless the account menu chose one. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: #0c1116;
    --foreground: #e6e8eb;
    --surface: #10151b;
    --card: #151b22;
    --primary: #1f5d99;
    --primary-light: #2f6fb3;
    --link: #7fb2ec;
    --muted: #1b222b;
    --muted-foreground: #9aa0a8;
    --accent: #1b222b;
    --border: #2a313b;
    --ring: #2f6fb3;
    --warning: #2b2210;
    --warning-foreground: #f5c46b;
    --success: #0c2a20;
    --success-foreground: #6ee7b7;
    --danger: #f05252;
    --sidebar: #0c1116;
    --nav-idle: rgb(230 232 235 / 0.6);
    --nav-hover: rgb(230 232 235 / 0.05);
    --nav-active: rgb(230 232 235 / 0.1);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
    --shadow-lg: 0 8px 24px rgb(0 0 0 / 0.45), 0 24px 56px rgb(0 0 0 / 0.4);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .when-light {
    display: none;
  }
  :root:not([data-theme="light"]) .when-dark {
    display: revert;
  }
}
:root[data-theme="dark"] {
  --background: #0c1116;
  --foreground: #e6e8eb;
  --surface: #10151b;
  --card: #151b22;
  --primary: #1f5d99;
  --primary-light: #2f6fb3;
  --link: #7fb2ec;
  --muted: #1b222b;
  --muted-foreground: #9aa0a8;
  --accent: #1b222b;
  --border: #2a313b;
  --ring: #2f6fb3;
  --warning: #2b2210;
  --warning-foreground: #f5c46b;
  --success: #0c2a20;
  --success-foreground: #6ee7b7;
  --danger: #f05252;
  --sidebar: #0c1116;
  --nav-idle: rgb(230 232 235 / 0.6);
  --nav-hover: rgb(230 232 235 / 0.05);
  --nav-active: rgb(230 232 235 / 0.1);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.35);
  --shadow-lg: 0 8px 24px rgb(0 0 0 / 0.45), 0 24px 56px rgb(0 0 0 / 0.4);
  color-scheme: dark;
}
:root[data-theme="dark"] .when-light {
  display: none;
}
:root[data-theme="dark"] .when-dark {
  display: revert;
}
.when-dark {
  display: none;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font:
    14px/1.5 "Inter",
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: var(--link);
}
h1 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h2 {
  font-size: 13px;
  margin: 0;
  color: var(--muted-foreground);
  font-weight: 600;
}
p {
  margin: 0;
}
svg {
  flex: none;
}
[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted-foreground);
}
.small {
  font-size: 12px;
}
.serif {
  font-family: "Oswald", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.01em;
}
.stack {
  display: grid;
  gap: 14px;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.grow {
  flex: 1;
  min-width: 0;
}
.truncate {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 600 13px/1 inherit;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  min-width: 0;
  transition:
    background-color 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.1s var(--ease);
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.55;
  cursor: default;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover {
  background: var(--primary-light);
}
.btn-outline {
  background: var(--card);
  color: var(--foreground);
  border-color: var(--border);
}
.btn-outline:hover {
  background: var(--accent);
}
.btn-ghost {
  background: transparent;
  color: var(--foreground);
}
.btn-ghost:hover {
  background: var(--accent);
}
.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}
.btn-icon {
  width: 36px;
  padding: 0;
}
.btn-icon.btn-sm {
  width: 30px;
}
.btn-square {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  color: var(--muted-foreground);
  flex: none;
}
.btn-square:hover {
  color: var(--foreground);
}
.btn-block {
  width: 100%;
}
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible,
.menu-item:focus-visible,
.user-btn:focus-visible,
.comment:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* form controls */
.input,
textarea.input {
  width: 100%;
  font: inherit;
  color: var(--foreground);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
  min-height: 36px;
  transition: border-color 0.15s;
}
.input:focus {
  border-color: var(--ring);
  outline: none;
}
textarea.input {
  resize: vertical;
  min-height: 76px;
}
.label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
}
.hint {
  font-weight: 400;
  font-size: 12px;
  color: var(--muted-foreground);
}

/* surfaces */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--warning);
  color: var(--warning-foreground);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  white-space: nowrap;
}
.badge-warn {
  background: var(--warning);
  color: var(--warning-foreground);
}

/* brand */
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--foreground);
  flex: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-foreground);
  flex: none;
}
.brand-mark.sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.brand-name {
  display: block;
  font-size: 16px;
  line-height: 1.15;
}
.brand-sub {
  display: block;
  font-size: 11px;
  color: var(--muted-foreground);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* app shell. the rail is 68px collapsed: its 12px padding leaves 44px rows whose 14px inset puts
   every 16px icon (and the 36px mark and avatar) on the same centre line, so collapsing only
   narrows the rail and fades the labels - nothing moves. */
.app {
  display: flex;
  height: 100%;
}
.sidebar {
  width: 248px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 12px 12px 0;
  overflow: hidden;
  transition: width 0.2s var(--ease);
}
.app.collapsed .sidebar {
  width: 68px;
}
.nav {
  display: grid;
  gap: 2px;
  align-content: start;
}
.nav-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  color: var(--nav-idle);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  min-width: 0;
  transition:
    background-color 0.15s,
    color 0.15s;
}
.nav-row:hover {
  background: var(--nav-hover);
  color: var(--foreground);
}
.nav-row[aria-current="page"] {
  background: var(--nav-active);
  color: var(--foreground);
  font-weight: 500;
}
.nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.app.collapsed .nav-label,
.app.collapsed .nav-label-icon {
  opacity: 0;
}
.sidebar .brand {
  height: auto;
  padding: 4px;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--foreground);
}
.new-btn {
  justify-content: flex-start;
  gap: 12px;
  padding: 0 13px;
  margin-bottom: 12px;
  flex: none;
  text-align: left;
}
.nav-recent {
  margin-top: 18px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  transition:
    opacity 0.15s,
    visibility 0.15s;
}
.app.collapsed .nav-recent {
  opacity: 0;
  visibility: hidden;
}
.nav-title {
  padding: 0 14px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.nav-empty {
  padding: 0 14px;
}
.sidebar-foot {
  margin: auto -12px 0;
  border-top: 1px solid var(--border);
  padding: 10px;
}
.user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s;
}
.user-btn:hover {
  background: var(--nav-hover);
}
.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--muted);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--foreground);
  font-size: 11px;
  font-weight: 600;
  flex: none;
}
.avatar.sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.user-meta {
  display: grid;
}
.user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--foreground);
}
.user-email {
  font-size: 11px;
  color: var(--muted-foreground);
}
.scrim {
  display: none;
}
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 57px;
  flex: none;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.topbar .title {
  font-weight: 600;
  font-size: 15px;
}
.topbar-sep {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--border);
  flex: none;
}
.when-collapsed {
  display: none;
}
.app.collapsed .when-collapsed {
  display: block;
}
.app.collapsed .when-expanded {
  display: none;
}
.content {
  flex: 1;
  overflow-y: auto;
}
.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  display: grid;
  gap: 20px;
}

/* popover menus: the account menu and the version picker. the script places them beside their
   button; the top layer keeps them clear of the rail's overflow. */
.menu {
  position: fixed;
  inset: auto;
  margin: 0;
  min-width: 15rem;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  transition:
    opacity 0.15s var(--ease),
    transform 0.15s var(--ease),
    overlay 0.15s allow-discrete,
    display 0.15s allow-discrete;
}
.menu:popover-open {
  opacity: 1;
  transform: none;
}
@starting-style {
  .menu:popover-open {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: 500 13px/1.25 inherit;
  font-family: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s;
}
.menu-item:hover,
.menu-item.active {
  background: var(--accent);
}
.menu-item.danger {
  color: var(--danger);
}
.menu-sep {
  height: 1px;
  margin: 4px -4px;
  background: var(--border);
}
.menu-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}
.menu-label .grow {
  display: grid;
}
.menu form {
  margin: 0;
}

/* version picker */
.picker-btn {
  gap: 8px;
  max-width: 17rem;
  padding: 0 10px 0 12px;
  flex: 0 1 auto;
}
.picker-v {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.picker-note {
  font-weight: 400;
  color: var(--muted-foreground);
  min-width: 0;
  flex: 1;
}
.picker-menu {
  width: min(22rem, calc(100vw - 24px));
}
.menu-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -4px -4px 4px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--border);
}
.menu-search input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  outline: none;
}
.picker-list {
  display: grid;
  gap: 2px;
  max-height: min(60vh, 360px);
  overflow-y: auto;
}
.picker-opt .grow {
  display: grid;
  gap: 1px;
}
.picker-opt[aria-selected="true"] {
  background: var(--nav-active);
}
.opt-note {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 500;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.opt-meta {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted-foreground);
}
.opt-check {
  color: var(--link);
}
.picker-empty {
  padding: 10px;
}

/* page list */
.tabs {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 10px;
  background: var(--muted);
}
.tabs a {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-decoration: none;
  transition:
    background-color 0.15s,
    color 0.15s;
}
.tabs a[aria-current="page"] {
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}
.list {
  display: grid;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s;
}
.list-item:first-child {
  border-top: 0;
}
.list-item:hover {
  background: var(--surface);
}
.list-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--muted);
  color: var(--link);
  flex: none;
}
.list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 2px;
}
.empty {
  padding: 40px 20px;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

/* upload */
.dropzone {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition:
    border-color 0.15s,
    background-color 0.15s;
}
.dropzone:hover,
.dropzone.over {
  border-color: var(--primary);
  background: var(--accent);
}
.dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.dropzone .file {
  font-weight: 600;
  color: var(--foreground);
}

/* dialogs */
dialog.dialog {
  width: min(480px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  color: var(--foreground);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease),
    overlay 0.2s allow-discrete,
    display 0.2s allow-discrete;
}
dialog.dialog[open] {
  opacity: 1;
  transform: none;
}
@starting-style {
  dialog.dialog[open] {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
dialog.dialog::backdrop {
  background: rgb(15 23 42 / 0);
  transition:
    background-color 0.2s,
    overlay 0.2s allow-discrete,
    display 0.2s allow-discrete;
}
dialog.dialog[open]::backdrop {
  background: rgb(15 23 42 / 0.35);
}
@starting-style {
  dialog.dialog[open]::backdrop {
    background: rgb(15 23 42 / 0);
  }
}
.dialog-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px 0;
}
.dialog-head h3 {
  margin: 0;
  font-size: 16px;
  flex: 1;
}
.dialog-body {
  padding: 14px 18px 18px;
  display: grid;
  gap: 14px;
}
.status {
  font-size: 12.5px;
  color: var(--muted-foreground);
  min-height: 1em;
}
.status.ok {
  color: var(--success-foreground);
}
.status.err {
  color: var(--danger);
}

/* viewer */
.viewer {
  flex: 1;
  display: flex;
  min-height: 0;
}
.viewer iframe {
  flex: 1;
  min-width: 0;
  border: 0;
  background: #fff;
}
.comments-btn[aria-pressed="true"] {
  background: var(--nav-active);
}
.panel {
  width: 360px;
  flex: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  transition:
    margin-right 0.25s var(--ease),
    opacity 0.2s;
}
.panel.closed {
  margin-right: -360px;
  opacity: 0;
  pointer-events: none;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  flex: none;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 {
  color: var(--foreground);
  font-size: 14px;
}
.panel-head .badge {
  margin-right: auto;
}
.panel .scroll {
  overflow-y: auto;
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
  flex: 1;
}
.composer {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: grid;
  gap: 8px;
  background: var(--background);
}
.composer-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.composer-box:focus-within {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent);
}
.composer-box textarea {
  display: block;
  width: 100%;
  min-height: 72px;
  max-height: 240px;
  padding: 10px 12px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  resize: none;
  outline: none;
  field-sizing: content;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px 6px;
}
.tool {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted-foreground);
  cursor: pointer;
  transition:
    background-color 0.12s,
    color 0.12s;
}
.tool:hover {
  background: var(--accent);
  color: var(--foreground);
}
.tool-sep {
  width: 1px;
  height: 16px;
  margin: 0 4px;
  background: var(--border);
}
.composer-hint {
  font-size: 11.5px;
  color: var(--muted-foreground);
}
.quote {
  font-size: 12.5px;
  color: var(--muted-foreground);
  border-left: 3px solid var(--gold);
  padding: 2px 0 2px 8px;
  margin: 0;
  max-height: 5.5em;
  overflow: hidden;
}
.comment {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    opacity 0.2s;
}
.comment.on {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 18%, transparent);
}
.comment.resolved {
  opacity: 0.6;
}
.comment .who {
  font-size: 12px;
  color: var(--muted-foreground);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.comment .who b {
  color: var(--foreground);
  font-weight: 600;
}
.comment .btn {
  justify-self: start;
}
.md {
  overflow-wrap: anywhere;
}
.md > * + * {
  margin-top: 6px;
}
.md ul,
.md ol {
  margin-bottom: 0;
  padding-left: 20px;
}
.md li + li {
  margin-top: 2px;
}
.md code {
  font:
    12px/1.4 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  background: var(--muted);
  border-radius: 5px;
  padding: 1px 5px;
}
.count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}
.signin-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--accent);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

/* centered pages (sign in, messages) */
.center {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--surface);
}
.center .card {
  width: min(420px, 100%);
  padding: 26px;
  display: grid;
  gap: 16px;
}

@media (max-width: 900px) {
  .sidebar,
  .app.collapsed .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(300px, 86vw);
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
  }
  .sidebar.open {
    transform: none;
    box-shadow: var(--shadow-lg);
  }
  .app.collapsed .nav-label,
  .app.collapsed .nav-label-icon,
  .app.collapsed .nav-recent {
    opacity: 1;
    visibility: visible;
  }
  .when-expanded,
  .app.collapsed .when-expanded {
    display: none;
  }
  .when-collapsed {
    display: block;
  }
  .scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgb(15 23 42 / 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .sidebar.open + .scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .topbar {
    padding: 0 10px;
    gap: 6px;
  }
  .topbar-sep {
    display: none;
  }
  .page {
    padding: 20px 14px 48px;
  }
  .hide-sm {
    display: none !important;
  }
  .panel {
    position: fixed;
    z-index: 35;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: min(78vh, 640px);
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgb(15 23 42 / 0.2);
    transition:
      transform 0.28s var(--ease),
      opacity 0.2s;
  }
  .panel.closed {
    margin-right: 0;
    transform: translateY(100%);
    box-shadow: none;
  }
  .panel-head::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 6px;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 4px;
    background: var(--border);
  }
  .panel-head {
    position: relative;
    height: 56px;
    padding-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after,
  dialog.dialog,
  dialog.dialog::backdrop,
  .menu {
    transition: none !important;
  }
}
