/* Sway Studio dashboard. Tokens and ds- components come from /ds/ (source: design/ at the repo root).
   This file is layout and the few dashboard-only pieces: shell, sidebar, site grid, setup flow, settings, overlays. */

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; }
::selection { background: var(--accent-soft-strong); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.ds-btn:focus-visible, .ds-input:focus-visible, .ds-select:focus-visible { outline: none; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
svg { flex: none; }

.form-error { color: var(--danger-ink); font-size: var(--text-sm); line-height: var(--leading-sm); }
.muted { color: var(--text-muted); }
.section-label { font: var(--weight-medium) var(--text-sm) / var(--leading-sm) var(--font-sans); color: var(--text-secondary); letter-spacing: var(--tracking-sm); }

/* ── Sign in ─────────────────────────────────────────────── */
/* The beat before we know whether you are signed in: a plain page, and the mark only if it drags on. */
.boot { min-height: 100dvh; display: grid; place-content: center; background: var(--bg-subtle); }
.boot img { display: block; opacity: 0; animation: boot-in 240ms ease-out 700ms forwards; }
@keyframes boot-in { to { opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { .boot img { animation-duration: 1ms; } }
.auth { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: var(--space-6); padding: var(--space-6); background: var(--bg-subtle); }
.auth-brand img { display: block; }
.auth-card { display: grid; gap: var(--space-4); width: min(380px, 100%); padding: var(--space-8); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); }
.auth-lede { color: var(--text-secondary); margin-top: calc(var(--space-2) * -1); }
.auth-card > form, .auth-card > div:not(.qr):not(.auth-steps):not(.sheet-actions) { display: grid; gap: var(--space-4); }
.auth-forgot { justify-self: center; color: var(--text-secondary); font-size: var(--text-sm); }
.auth-card.wide { width: min(460px, 100%); }
.code-input { height: var(--control-lg); font-size: 22px; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: grid; place-items: center; padding: var(--space-3); border-radius: var(--radius-md); background: #fff; box-shadow: inset 0 0 0 1px var(--border); }
.qr svg { display: block; width: 176px; height: 176px; }
.setup-key { font-family: var(--font-mono); font-size: 13px; text-align: center; color: var(--text-secondary); word-break: break-all; }
.backup-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin: 0; padding: var(--space-4); list-style: none; border-radius: var(--radius-md); background: var(--bg-muted); font-family: var(--font-mono); font-size: 14px; text-align: center; }
.auth-steps { display: flex; gap: 6px; }
.auth-steps i { height: 3px; flex: 1; border-radius: 2px; background: var(--border); }
.auth-steps i.on { background: var(--accent); }
html[data-theme="dark"] .auth-brand img { filter: invert(1) hue-rotate(180deg); }

/* ── Shell ───────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.topbar { display: none; }

.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg-subtle);
  border-right: 1px solid var(--border);
}
.sidebar-scroll { flex: 1; overflow-y: auto; padding: var(--space-3) var(--space-3) var(--space-4); display: grid; align-content: start; gap: var(--space-3); }

.workspace {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 40px; padding: 0 8px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); cursor: pointer;
  font: var(--weight-semibold) var(--text-md) / 1 var(--font-sans); letter-spacing: var(--tracking-md);
  text-align: left; transition: background-color var(--duration-fast) var(--ease);
}
.workspace:hover, .workspace[aria-expanded="true"] { background: var(--bg-hover); }
.workspace img { border-radius: var(--radius-xs); }
html[data-theme="dark"] .workspace img, html[data-theme="dark"] .topbar img { filter: invert(1) hue-rotate(180deg) brightness(1.4); }
.workspace-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-chev { width: 16px; height: 16px; color: var(--text-muted); }

.sidebar-search {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 6px 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text-placeholder); font: var(--weight-regular) var(--text-md) / 1 var(--font-sans); cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease);
}
.sidebar-search:hover { border-color: var(--border-strong); }
.sidebar-search svg { width: 15px; height: 15px; }
.sidebar-search span:first-of-type { flex: 1; text-align: left; }

.sidebar-actions { display: grid; gap: 6px; }
.sidebar-action { justify-content: flex-start; width: 100%; }
.sidebar-nav { margin-top: var(--space-1); }
.ds-navlist a { position: relative; }
.nav-dot { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: var(--accent); }

.sidebar-group { display: grid; gap: 2px; }
.sidebar-group-head { display: flex; align-items: center; justify-content: space-between; height: 28px; padding: 0 4px 0 10px; color: var(--text-muted); font: var(--weight-medium) var(--text-xs) / 1 var(--font-sans); }
.sidebar-group-head .ds-btn { --btn-h: 24px; color: var(--text-muted); }
.folder-row { display: flex; align-items: center; }
.folder-row a { flex: 1; min-width: 0; }
.folder-row a span.folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-row.is-drop a { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.folder-rename { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: var(--weight-medium) var(--text-md) / 1 var(--font-sans); box-shadow: var(--focus-ring); outline: none; }

.sidebar-foot { display: grid; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--border); }
.credits { display: grid; gap: 6px; padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none; transition: background-color var(--duration-fast) var(--ease); }
.credits:hover { background: var(--bg-hover); }
.credits-row { display: flex; justify-content: space-between; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--text-secondary); }
.credits .ds-progress { height: 4px; }
.credits.is-low .ds-progress > span { background: var(--warning); }
.sidebar-foot-row { display: flex; justify-content: space-between; }

.main { min-width: 0; }
.view { max-width: 1320px; margin: 0 auto; padding: var(--space-8) var(--space-8) var(--space-16); }

/* ── Page head ───────────────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.page-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-icon { width: 22px; height: 22px; color: var(--text-secondary); }
.page-count { color: var(--text-placeholder); font-size: var(--text-lg); }
.page-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.page-search { width: 240px; height: 32px; }
.seg-icon { width: 16px; height: 16px; display: block; }
.ds-segmented button { display: inline-grid; place-items: center; }

.select-pill { position: relative; display: inline-flex; }
.select-pill select {
  appearance: none; height: 32px; padding: 0 30px 0 12px; border: 0; border-radius: var(--radius-pill);
  background: var(--surface); box-shadow: var(--shadow-control); color: var(--text);
  font: var(--weight-medium) var(--text-sm) / 1 var(--font-sans); cursor: pointer;
}
.select-pill select:hover { background: var(--bg-muted); }
.select-pill select:focus-visible { outline: none; box-shadow: var(--shadow-control), var(--focus-ring); }
.select-pill svg { position: absolute; right: 10px; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

/* ── Invitations ─────────────────────────────────────── */
.invitations { display: grid; gap: var(--space-2); margin-bottom: var(--space-6); }
.invitation { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 35%, transparent); }
.invitation .rowi-icon { background: var(--surface); color: var(--accent-ink); }
.invitation p { flex: 1; min-width: 16rem; color: var(--text); }
.invitation p b { font-weight: var(--weight-semibold); }
.invitation p span { display: block; color: var(--text-secondary); font-size: var(--text-sm); }
.invitation-actions { display: flex; gap: var(--space-2); }
.card-shared { color: var(--accent-ink); }

/* ── Checklist ───────────────────────────────────────────── */
.checklist { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-4) var(--space-6); margin-bottom: var(--space-6); padding: var(--space-5) var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.checklist-art { width: 56px; height: 56px; }
.checklist h2 { font: var(--weight-medium) var(--text-base) / var(--leading-base) var(--font-sans); letter-spacing: var(--tracking-base); }
.checklist p { color: var(--text-secondary); }
.checklist-steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.checklist-step { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bg-subtle); text-decoration: none; color: var(--text); font-weight: var(--weight-medium); transition: background-color var(--duration-fast) var(--ease); }
a.checklist-step:hover { background: var(--bg-hover); }
.checklist-step .tick { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--border-strong); color: transparent; flex: none; }
.checklist-step .tick svg { width: 12px; height: 12px; }
.checklist-step { height: 100%; box-sizing: border-box; }
.checklist-step:not(.done) { box-shadow: inset 0 0 0 1px var(--border); }
.checklist-step.done { color: var(--text-muted); }
.checklist-step.waits { color: var(--text-muted); cursor: default; }
.checklist-step.waits small { display: block; font-size: var(--text-xs); font-weight: var(--weight-regular); color: var(--text-muted); }
.checklist-step.done .tick { background: var(--positive); box-shadow: none; color: var(--white); }

/* ── Recents ─────────────────────────────────────────────── */
.recents { display: grid; gap: var(--space-3); margin-bottom: var(--space-8); }
.recent-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.recent { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); text-decoration: none; transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease); min-width: 0; }
.recent:hover { border-color: var(--border-strong); box-shadow: var(--shadow-control); }
.recent-thumb { width: 56px; height: 36px; border-radius: 6px; overflow: hidden; background: var(--bg-muted); flex: none; }
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.recent-copy { min-width: 0; display: grid; }
.recent-copy b { font-weight: var(--weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-copy span { font-size: var(--text-xs); color: var(--text-muted); }

/* ── Site grid ───────────────────────────────────────────── */
.site-grid[data-layout="grid"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: var(--space-6) var(--space-5); }
.site-grid[data-layout="list"] { display: grid; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }

.card { position: relative; display: grid; min-width: 0; border-radius: var(--radius-md); outline: none; }
.card-thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  border-radius: var(--radius-md); background: var(--bg-muted);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: box-shadow var(--duration) var(--ease);
}
.card-thumb > img.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity 240ms var(--ease); }
.card-thumb > img.shot.loaded { opacity: 1; }
.card-thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.06); pointer-events: none; }
.card:hover .card-thumb, .card:focus-within .card-thumb { box-shadow: inset 0 0 0 1px var(--border), var(--shadow-raised); }
.card.is-selected .card-thumb { box-shadow: 0 0 0 2px var(--accent), var(--shadow-raised); }

.card-fallback { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--text-muted); font-size: var(--text-sm); }
.card-fallback .site-favicon { width: 40px; height: 40px; border-radius: 10px; font-size: 16px; }
.card-thumb.has-shot .card-fallback { visibility: hidden; }
.card-thumb.is-loading .card-fallback { visibility: hidden; }
.card-thumb.is-loading::before { content: ""; position: absolute; inset: 0; background: var(--gradient-shimmer); background-size: 300% 100%; animation: ds-shimmer 1.4s linear infinite; }

.card-status { position: absolute; left: 10px; bottom: 10px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.card-status.ds-chip--plain { background: var(--surface); }
.card-open { position: absolute; right: 10px; bottom: 10px; opacity: 0; transform: translateY(4px); transition: opacity var(--duration-fast) var(--ease), transform var(--duration-fast) var(--ease); }
.card:hover .card-open, .card:focus-within .card-open { opacity: 1; transform: none; }

.card-check { position: absolute; left: 10px; top: 10px; z-index: 2; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border-radius: 6px; border: 0; background: var(--surface); box-shadow: var(--shadow-control); color: transparent; cursor: pointer; opacity: 0; transition: opacity var(--duration-fast) var(--ease); }
.card-check svg { width: 13px; height: 13px; }
.card:hover .card-check, .card:focus-within .card-check, .site-grid.is-selecting .card-check { opacity: 1; }
.card.is-selected .card-check { background: var(--accent-solid); color: var(--white); }

.card-more { position: absolute; right: 8px; top: 8px; z-index: 2; --btn-h: 28px; background: var(--surface); opacity: 0; transition: opacity var(--duration-fast) var(--ease); }
.card:hover .card-more, .card:focus-within .card-more, .card-more[aria-expanded="true"] { opacity: 1; }

.card-body { display: flex; align-items: flex-start; gap: 10px; padding: 12px 2px 0; min-width: 0; }
.card-body .site-favicon { margin-top: 1px; }
.card-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.card-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--weight-medium) var(--text-md) / var(--leading-md) var(--font-sans); letter-spacing: var(--tracking-md); color: var(--text); text-decoration: none; }
.card-name::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-open, .card-status { z-index: 2; }
.card-meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--text-muted); }
.card-meta .dom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta .sep { color: var(--text-placeholder); }
.card-meta time { white-space: nowrap; }
.card-avatars { margin-left: auto; position: relative; z-index: 2; }
.card .ds-avatar { --size: 22px; }
.ds-avatar.is-editing { box-shadow: 0 0 0 1.5px var(--bg), 0 0 0 3px var(--positive); }
.name-edit { position: relative; z-index: 3; width: 100%; height: 24px; padding: 0 6px; margin-left: -6px; border: 1px solid var(--accent); border-radius: 6px; background: var(--surface); color: var(--text); font: var(--weight-medium) var(--text-md) / 1 var(--font-sans); box-shadow: var(--focus-ring); outline: none; }

.card.is-dragging { opacity: 0.45; }
.card.is-leaving { animation: card-out 200ms var(--ease) forwards; }
@keyframes card-out { to { opacity: 0; transform: scale(0.97); } }

/* list layout reuses the card markup */
.site-grid[data-layout="list"] .card { grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); padding: 10px var(--space-4); border-radius: 0; border-top: 1px solid var(--border); }
.site-grid[data-layout="list"] .card:first-child { border-top: 0; }
.site-grid[data-layout="list"] .card:hover { background: var(--bg-subtle); }
.site-grid[data-layout="list"] .card-thumb { width: 88px; border-radius: 6px; }
.site-grid[data-layout="list"] .card:hover .card-thumb { box-shadow: inset 0 0 0 1px var(--border); }
.site-grid[data-layout="list"] .card-status, .site-grid[data-layout="list"] .card-open, .site-grid[data-layout="list"] .card-fallback .dom { display: none; }
.site-grid[data-layout="list"] .card-fallback .site-favicon { width: 22px; height: 22px; font-size: 10px; border-radius: 6px; }
.site-grid[data-layout="list"] .card-check { left: 4px; top: 4px; width: 18px; height: 18px; }
.site-grid[data-layout="list"] .card-body { padding: 0; align-items: center; }
.site-grid[data-layout="list"] .card-body .site-favicon { display: none; }
.site-grid[data-layout="list"] .card-more { position: static; opacity: 1; background: transparent; box-shadow: none; }
.site-grid[data-layout="list"] .list-status { display: inline-flex; position: relative; z-index: 2; }
.list-status { display: none; }
.list-end { display: none; }
.site-grid[data-layout="list"] .list-end { display: flex; align-items: center; gap: var(--space-3); position: relative; z-index: 2; }

.site-favicon { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; overflow: hidden; flex: none; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); color: var(--text-secondary); font: var(--weight-semibold) 10px / 1 var(--font-sans); text-transform: uppercase; }
.site-favicon { position: relative; }
.site-favicon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 2px; background: var(--surface); }
.site-favicon.lg { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }
.site-favicon.lg img { padding: 6px; }

.empty-art { width: 88px; height: 72px; }
.site-grid .ds-empty, .view > .ds-empty { grid-column: 1 / -1; padding: var(--space-16) var(--space-6); }
.ds-empty h2 { font: var(--weight-medium) var(--text-base) / var(--leading-base) var(--font-sans); }
.ds-empty .ds-btn { margin-top: var(--space-2); }
.site-grid[data-layout="list"] .ds-empty { border: 0; }

.skeleton-card { display: grid; gap: 12px; }
.skeleton-card .ds-skeleton:first-child { aspect-ratio: 16 / 10; border-radius: var(--radius-md); }

/* Bulk bar */
.bulkbar { position: fixed; left: calc(248px + (100vw - 248px) / 2); bottom: var(--space-6); transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: var(--space-2); padding: 6px 6px 6px var(--space-4); border-radius: var(--radius-pill); background: var(--surface-raised); box-shadow: var(--shadow-overlay); animation: rise 180ms var(--ease); }
.bulkbar > span { margin-right: var(--space-2); font-weight: var(--weight-medium); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ── Site page ───────────────────────────────────────────── */
.crumbs { display: flex; align-items: center; gap: 4px; margin-bottom: var(--space-4); font-size: var(--text-sm); color: var(--text-muted); }
.crumbs a { padding: 2px 4px; border-radius: 4px; text-decoration: none; color: var(--text-secondary); }
.crumbs a:hover { color: var(--text); background: var(--bg-muted); }
.crumbs svg { width: 14px; height: 14px; color: var(--text-placeholder); }
.crumbs [aria-current] { color: var(--text); padding: 2px 4px; }
.site-header { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-6); }
.site-header-copy { flex: 1; min-width: 0; }
.site-header-copy h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-header-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; color: var(--text-muted); font-size: var(--text-sm); }
.site-header-sub a { display: inline-flex; align-items: center; gap: 4px; color: var(--text-secondary); text-decoration: none; }
.site-header-sub svg { width: 12px; height: 12px; }
.site-header-sub .sep { color: var(--text-placeholder); }
.site-header-sub a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.site-header-actions { display: flex; gap: var(--space-2); }
.site-tabs { margin-bottom: var(--space-8); overflow-x: auto; scrollbar-width: none; }
.site-tabs .ds-tab { white-space: nowrap; }

.tab-body { display: grid; gap: var(--space-8); max-width: 880px; }
.tab-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.block { display: grid; gap: var(--space-4); align-content: start; }
.block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.block-head h2 { font: var(--weight-medium) var(--text-base) / var(--leading-base) var(--font-sans); letter-spacing: var(--tracking-base); }
.block-head p { color: var(--text-muted); font-size: var(--text-sm); margin-top: 2px; }
.preview-shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: var(--radius-lg); background: var(--bg-muted); box-shadow: inset 0 0 0 1px var(--border); }
.preview-shot img.shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.preview-shot.has-shot .card-fallback { visibility: hidden; }
.preview-shot .card-fallback .site-favicon { width: 48px; height: 48px; }

.facts { display: grid; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); min-height: 48px; padding: 8px var(--space-4); border-top: 1px solid var(--border); }
.facts > div:first-child { border-top: 0; }
.facts dt { color: var(--text-muted); font-size: var(--text-sm); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts dd a { color: var(--text); text-decoration: none; }
.facts dd a:hover { text-decoration: underline; text-underline-offset: 3px; }
.facts .ds-btn { --btn-h: 28px; }

.rows { display: grid; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.rows > .rowi { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: 10px var(--space-4); border-top: 1px solid var(--border); }
.rows > .rowi:first-child { border-top: 0; }
.rowi-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rowi-main b { font-weight: var(--weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rowi-main span { font-size: var(--text-sm); color: var(--text-muted); overflow-wrap: anywhere; }
.rowi-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--bg-muted); color: var(--text-secondary); flex: none; }
.rowi-icon svg { width: 16px; height: 16px; }
.rows-empty { padding: var(--space-8) var(--space-4); text-align: center; color: var(--text-muted); }

.timeline { display: grid; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: var(--space-3); padding-bottom: var(--space-5); }
.timeline li::before { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 12px; height: 12px; margin: 5px 4px; border-radius: 50%; background: var(--border-strong); box-shadow: 0 0 0 3px var(--bg); }
.timeline .dot.live { background: var(--positive); }
.timeline .dot.preview { background: var(--info); }
.timeline .dot.failed { background: var(--danger); }
.timeline b { font-weight: var(--weight-medium); }
.timeline p { color: var(--text-muted); font-size: var(--text-sm); }
.timeline p a { display: inline-flex; align-items: center; gap: 4px; color: var(--text-secondary); }
.timeline p a svg { width: 12px; height: 12px; }
.timeline .ds-btn { align-self: start; }

.dns { display: grid; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); background: var(--bg-subtle); border: 1px solid var(--border); }
.dns-record { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: var(--space-3); align-items: center; font-size: var(--text-sm); }
.dns-record code { font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; }
.dns-record span { color: var(--text-muted); }

.danger { border: 1px solid color-mix(in oklab, var(--danger) 30%, var(--border)); }

.seo-preview { display: grid; gap: 4px; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.seo-preview .u { font-size: var(--text-xs); color: var(--text-muted); }
.seo-preview .t { color: var(--info-ink); font-size: var(--text-lg); line-height: 24px; }
.seo-preview .d { color: var(--text-secondary); font-size: var(--text-sm); }
.counter { font-size: var(--text-xs); color: var(--text-placeholder); justify-self: end; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--danger-ink); }

/* ── New site ────────────────────────────────────────────── */
.setup { max-width: 640px; margin: 0 auto; }
.setup-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-10, 40px); }
.steps { display: flex; align-items: center; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-weight: var(--weight-medium); font-size: var(--text-sm); }
.steps li + li::before { content: ""; width: 28px; height: 1px; background: var(--border-strong); margin-right: 2px; }
.steps .n { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--border-strong); font-size: 11px; }
.steps li[aria-current="step"] { color: var(--text); }
.steps li[aria-current="step"] .n { background: var(--text); color: var(--bg); box-shadow: none; }
.steps li.done .n { background: var(--positive); color: var(--white); box-shadow: none; }
.steps li.done .n svg { width: 12px; height: 12px; }
.setup-head { display: grid; gap: var(--space-2); margin-bottom: var(--space-8); }
.setup-head h1 { font-size: var(--text-3xl); line-height: var(--leading-3xl); letter-spacing: var(--tracking-3xl); font-weight: var(--weight-semibold); text-wrap: balance; }
.setup-head p { color: var(--text-secondary); font-size: var(--text-base); line-height: var(--leading-base); max-width: 52ch; }
.setup-form { display: grid; gap: var(--space-5); }
.setup-actions { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-8); padding: var(--space-4) 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-icon > .ds-input { padding-left: 36px; height: var(--control-lg); font-size: var(--text-base); }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; padding: 4px; background: var(--surface-raised); border-radius: var(--radius-md); box-shadow: var(--shadow-overlay); }
.combo-list button { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: var(--weight-regular) var(--text-md) / 1 var(--font-sans); text-align: left; cursor: pointer; }
.combo-list button svg { width: 16px; height: 16px; color: var(--text-muted); }
.combo-list button[aria-selected="true"], .combo-list button:hover { background: var(--bg-muted); }
.combo-list .owner { color: var(--text-muted); }
.inline-note { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--bg-subtle); border: 1px solid var(--border); color: var(--text-secondary); font-size: var(--text-sm); }
.inline-note > svg { width: 18px; height: 18px; color: var(--text); }
.inline-note > span { flex: 1; min-width: 12rem; }

.checks { display: grid; gap: var(--space-3); margin: 0; padding: var(--space-5); list-style: none; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.checks li { display: flex; align-items: center; gap: var(--space-3); color: var(--text-muted); transition: color var(--duration) var(--ease); }
.checks li.done { color: var(--text); }
.checks li .ds-spinner { width: 16px; height: 16px; }
.checks li svg { width: 16px; height: 16px; color: var(--positive); }
.checks li.warn svg { color: var(--warning); }

.stack-list { display: grid; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.stack-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 2px var(--space-3); align-items: center; padding: var(--space-4); border-top: 1px solid var(--border); }
.stack-row:first-child { border-top: 0; }
.stack-row h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: var(--weight-medium) var(--text-md) / var(--leading-md) var(--font-sans); }
.stack-row p { font-size: var(--text-sm); color: var(--text-muted); }
.stack-row-body { grid-column: 2 / -1; display: grid; gap: var(--space-3); padding-top: var(--space-3); }
.option-row { display: flex; flex-wrap: wrap; gap: 6px; }
.option { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text); font: var(--weight-medium) var(--text-sm) / 1 var(--font-sans); cursor: pointer; transition: border-color var(--duration-fast) var(--ease), background-color var(--duration-fast) var(--ease); }
.option:hover { border-color: var(--border-strong); }
.option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent); }
.services { display: flex; flex-wrap: wrap; gap: 6px; }

.summary { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-5); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.summary .preview-shot { border-radius: var(--radius-md); }
.summary-copy { display: grid; align-content: center; gap: 6px; min-width: 0; }
.summary-copy b { font-size: var(--text-lg); font-weight: var(--weight-medium); }
details.advanced { border: 1px solid var(--border); border-radius: var(--radius-lg); }
details.advanced summary { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 var(--space-4); cursor: pointer; list-style: none; font-weight: var(--weight-medium); }
details.advanced summary::-webkit-details-marker { display: none; }
details.advanced summary svg { width: 16px; height: 16px; color: var(--text-muted); transition: transform var(--duration-fast) var(--ease); transform: rotate(-90deg); }
details.advanced[open] summary svg { transform: none; }
details.advanced .advanced-body { display: grid; gap: var(--space-4); padding: 0 var(--space-4) var(--space-4); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }

/* ── Settings ────────────────────────────────────────────── */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--space-12); align-items: start; }
.settings-nav { position: sticky; top: var(--space-8); }
.settings-body { display: grid; gap: 40px; max-width: 720px; }
.settings-section { display: grid; gap: var(--space-4); }
.settings-section > header h2 { font: var(--weight-medium) var(--text-lg) / var(--leading-lg) var(--font-sans); letter-spacing: var(--tracking-lg); }
.settings-section > header p { color: var(--text-muted); margin-top: 2px; }
.balance { display: flex; align-items: baseline; gap: var(--space-3); }
.balance strong { font: var(--weight-semibold) var(--text-3xl) / var(--leading-3xl) var(--font-sans); letter-spacing: var(--tracking-3xl); font-variant-numeric: tabular-nums; }
.balance span { color: var(--text-muted); }
.reveal { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; padding: var(--space-3); border-radius: var(--radius-md); background: var(--bg-muted); box-shadow: inset 0 0 0 1px var(--border); }
.reveal code { font-family: var(--font-mono); font-size: 12.5px; overflow-wrap: anywhere; }
.reveal p { grid-column: 1 / -1; font-size: var(--text-xs); color: var(--text-muted); }
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.theme-pick button { display: grid; gap: 8px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font: var(--weight-medium) var(--text-sm) / 1 var(--font-sans); text-align: left; cursor: pointer; }
.theme-pick button[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-pick i { display: block; height: 64px; border-radius: 6px; }
.theme-pick .light i { background: linear-gradient(90deg, #fafafa 28%, #fff 28%); box-shadow: inset 0 0 0 1px #e8e8e8; }
.theme-pick .dark i { background: linear-gradient(90deg, #16171e 28%, #121319 28%); }
.theme-pick .system i { background: linear-gradient(135deg, #fff 50%, #121319 50%); box-shadow: inset 0 0 0 1px #e8e8e8; }
.profile { display: flex; align-items: center; gap: var(--space-4); }
.profile .ds-avatar { --size: 56px; }
.inline-form { display: flex; gap: var(--space-2); }
.inline-form .ds-input { flex: 1; }

/* ── People / activity ───────────────────────────────────── */
.people-layout { display: grid; gap: var(--space-8); max-width: 880px; }
.feed { display: grid; margin: 0; padding: 0; list-style: none; max-width: 760px; }
.feed li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.feed li:first-child { border-top: 0; }
.feed p b { font-weight: var(--weight-medium); }
.feed time { color: var(--text-muted); font-size: var(--text-sm); white-space: nowrap; }
.feed-day { padding: var(--space-6) 0 var(--space-2); }

/* ── Overlays ────────────────────────────────────────────── */
dialog { color: var(--text); }
dialog::backdrop { background: var(--scrim); }
.palette { width: min(600px, calc(100vw - 32px)); max-height: min(520px, 70vh); margin: 12vh auto auto; padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: var(--shadow-overlay); overflow: hidden; }
.palette[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: pop 160ms var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.985); } }
.palette-field { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 var(--space-4); border-bottom: 1px solid var(--border); }
.palette-field svg { width: 18px; height: 18px; color: var(--text-muted); }
.palette-field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; color: var(--text); font: var(--weight-regular) var(--text-base) / 1 var(--font-sans); letter-spacing: var(--tracking-base); }
.palette-field input::placeholder { color: var(--text-placeholder); }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-group { padding: 10px 10px 4px; font: var(--weight-medium) var(--text-xs) / 1 var(--font-sans); color: var(--text-muted); }
.palette-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: var(--weight-regular) var(--text-md) / 1 var(--font-sans); text-align: left; cursor: pointer; }
.palette-item > svg { width: 16px; height: 16px; color: var(--text-muted); }
.palette-item .hint { margin-left: auto; color: var(--text-placeholder); font-size: var(--text-sm); }
.palette-item[aria-selected="true"] { background: var(--bg-muted); }
.palette-item mark { background: none; color: var(--accent-ink); font-weight: var(--weight-semibold); }
.palette-empty { padding: var(--space-8); text-align: center; color: var(--text-muted); }
.palette-foot { display: flex; gap: var(--space-4); padding: 8px var(--space-4); border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--text-xs); }
.palette-foot span { display: inline-flex; align-items: center; gap: 4px; }

.sheet { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: var(--shadow-overlay); }
.sheet[open] { animation: pop 160ms var(--ease); }
.sheet-body { display: grid; gap: var(--space-4); padding: var(--space-6); }
.sheet-body h2 { font: var(--weight-semibold) var(--text-lg) / var(--leading-lg) var(--font-sans); letter-spacing: var(--tracking-lg); }
.sheet-body p { color: var(--text-secondary); }
.sheet-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }
.shortcut-list { display: grid; margin: 0; }
.shortcut-list div { display: flex; justify-content: space-between; align-items: center; height: 36px; border-bottom: 1px solid var(--border); }
.shortcut-list div:last-child { border-bottom: 0; }
.shortcut-list dd { margin: 0; display: flex; gap: 4px; }

.floating-menu { position: fixed; inset: auto; margin: 0; border: 0; color: var(--text); min-width: 220px; max-height: 70vh; overflow-y: auto; }
.floating-menu:popover-open { animation: pop 120ms var(--ease); }
.ds-menu-item[aria-disabled="true"] { color: var(--text-placeholder); cursor: default; }
.ds-menu-item[aria-disabled="true"]:hover { background: none; }
.ds-menu-item .check { margin-left: auto; width: 14px; height: 14px; color: var(--accent-ink); }
.ds-menu-label { padding: 8px 10px 4px; font: var(--weight-medium) var(--text-xs) / 1 var(--font-sans); color: var(--text-muted); }
.menu-account { display: grid; gap: 2px; padding: 8px 10px 10px; }
.menu-account b { font-weight: var(--weight-medium); }
.menu-account span { color: var(--text-muted); font-size: var(--text-sm); }

.invite-pop { position: fixed; inset: auto; margin: 0; width: 320px; padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface-raised); box-shadow: var(--shadow-overlay); color: var(--text); }
.invite-pop:popover-open { animation: pop 140ms var(--ease); }
.invite-pop-form { display: grid; gap: var(--space-4); padding: var(--space-5); }
.invite-kind { display: flex; }
.invite-guest-fields { display: grid; gap: var(--space-4); }
.invite-publish { justify-content: space-between; flex-direction: row-reverse; justify-self: stretch; font-size: var(--text-sm); }
.invite-kind button { flex: 1; }

.tooltip { position: fixed; inset: auto; margin: 0; border: 0; pointer-events: none; z-index: 100; }
.tooltip .ds-kbd { background: rgb(255 255 255 / 0.14); box-shadow: none; color: var(--white); }

.toasts { position: fixed; left: 50%; bottom: var(--space-6); z-index: 90; display: grid; justify-items: center; gap: var(--space-2); transform: translateX(-50%); pointer-events: none; }
.toasts .ds-toast { position: relative; pointer-events: auto; overflow: hidden; animation: toast-in 200ms var(--ease); }
.toasts .ds-toast.out { animation: toast-out 160ms var(--ease) forwards; }
.ds-toast .toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgb(255 255 255 / 0.3); transform-origin: left; animation: toast-time linear forwards; }
.ds-toast.is-error { background: var(--danger-ink); }
html[data-theme="dark"] .ds-toast.is-error { background: var(--ember-700); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(4px); } }
@keyframes toast-time { to { transform: scaleX(0); } }

.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1100px) {
  .tab-grid { grid-template-columns: 1fr; }
  .recent-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checklist-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 52px 1fr; }
  .topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 0 var(--space-3); background: color-mix(in oklab, var(--bg) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
  .topbar-title { flex: 1; font-weight: var(--weight-medium); }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform 220ms var(--ease); box-shadow: var(--shadow-overlay); }
  .shell.nav-open .sidebar { transform: none; }
  .view { padding: var(--space-6) var(--space-4) var(--space-16); }
  .page-tools { width: 100%; }
  .page-search { flex: 1; width: auto; min-width: 0; }
  .card-open, .card-more { opacity: 1; transform: none; }
  .card-check { display: none; }
  .settings-layout { grid-template-columns: 1fr; gap: var(--space-6); }
  .settings-nav { position: static; display: flex; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .settings-nav a { white-space: nowrap; }
  .bulkbar { left: 50%; }
  .site-header { flex-wrap: wrap; }
  .site-header-actions { width: 100%; }
  .summary { grid-template-columns: 1fr; }
  .setup-head h1 { font-size: var(--text-2xl); line-height: var(--leading-2xl); }
  .facts > div { grid-template-columns: 1fr auto; }
  .facts dt { grid-column: 1 / -1; }
  .dns-record { grid-template-columns: 1fr auto; }
  .checklist { grid-template-columns: 1fr auto; }
  .checklist-art { display: none; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .recent-row { grid-template-columns: 1fr; }
  .checklist-steps { grid-template-columns: 1fr; }
  .steps li:not([aria-current="step"]) .label { display: none; }
  .page-tools .ds-segmented, #sort-btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
.steps-list { margin: 0; padding-left: 1.25em; display: grid; gap: 6px; font-size: var(--text-sm); line-height: var(--leading-sm); }
.steps-list a { color: inherit; text-decoration: underline; }

/* ── Desktop app on a Mac: no title bar ─────────────────────── */
/* The app adds sway-app-mac. The window's buttons sit top left over the sidebar, and the top strip drags the window. */
html.sway-app-mac body::after { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 28px; -webkit-app-region: drag; pointer-events: none; z-index: 1; }
html.sway-app-mac .sidebar-scroll { padding-top: 44px; }
html.sway-app-mac .sidebar::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 44px; -webkit-app-region: drag; }
html.sway-app-mac .page-head { -webkit-app-region: drag; }
html.sway-app-mac .page-head :is(a, button, input, select, [role="button"], .ds-btn) { -webkit-app-region: no-drag; }

/* Site analytics: pick or connect a PostHog project from the site, inline. */
.analytics-new { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.analytics-new summary { cursor: pointer; color: var(--ink-2, inherit); }
.analytics-new > * { flex: 1 1 180px; }

/* Apps: one card per connected app, the look of Sway AI's Apps page (icon, name and detail, then Connect or Disconnect). */
.app-head { margin: 0 0 var(--space-4); }
.app-head h2 { margin: 0; font-size: var(--text-xl, 22px); font-weight: var(--weight-semibold, 600); letter-spacing: -0.01em; }
.app-head p { margin: 4px 0 0; color: var(--text-muted); font-size: var(--text-sm); }
.app-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.app-row { display: flex; align-items: center; gap: var(--space-3); padding: 12px var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.app-icon { position: relative; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-muted); color: var(--text-secondary); font-weight: var(--weight-semibold, 600); font-size: 14px; }
.app-icon img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.app-main { flex: 1; min-width: 0; }
.app-main h3 { margin: 0; font-size: var(--text-base); font-weight: var(--weight-medium); }
.app-main p { margin: 2px 0 0; font-size: var(--text-sm); color: var(--text-muted); text-wrap: pretty; }
.app-actions { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.app-badge { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--positive-soft); color: var(--positive-ink); border: 1px solid var(--positive-soft); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.app-badge--muted { background: var(--bg-muted); color: var(--text-secondary); border-color: var(--border); }
.app-connect, .app-disconnect { display: inline-flex; align-items: center; gap: 4px; height: 28px; font: inherit; font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text); cursor: pointer; text-decoration: none; }
.app-connect { padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: transparent; }
.app-connect:hover { background: var(--bg-muted); }
.app-disconnect { padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); }
.app-disconnect:hover { background: var(--bg-muted); color: var(--text); }
.app-connect:focus-visible, .app-disconnect:focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
.app-form { display: flex; flex-wrap: wrap; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.app-form.hidden { display: none; }
@media (max-width: 560px) {
  .app-row { flex-wrap: wrap; }
  .app-actions { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .app-main p { white-space: normal; }
}

/* Desktop app: a newer version is ready (app.js). */
.app-update { align-items: center; flex-wrap: wrap; margin: var(--space-4) var(--space-6) 0; }
.app-update > span { flex: 1 1 280px; }
.app-update[hidden] { display: none; }
.app-update-cmd { flex: 1 1 100%; display: flex; align-items: center; gap: var(--space-2); padding: 6px 6px 6px 14px; border-radius: var(--radius-md); background: var(--carbon, #1d1d1b); color: #f3f2fe; }
.app-update-cmd[hidden] { display: none; }
.app-update-cmd code { flex: 1; font: 13px/20px var(--font-mono); overflow-x: auto; white-space: nowrap; }
