/* Bitflow · Workspace (my devices, admin) — builds on the tokens and controls in auth.css. */
:root {
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239fb0cd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --danger-grad: linear-gradient(135deg, #d8394f 0%, #b3263f 100%);
}
:root[data-theme="light"] { --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5875' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); --danger-grad: linear-gradient(135deg, #d23a4c 0%, #a01f36 100%); }

.workspace { width: min(var(--content), 100%); margin: 0 auto; padding: clamp(.6rem, 2vw, 1.5rem) var(--gutter) max(4.5rem, calc(env(safe-area-inset-bottom) + 2rem)); }

/* ── Segmented controls ─────────────────────────────────────────────────
   Each pressed option paints its own background; fx.js adds a single thumb that glides between options. */
.seg-track { position: relative; isolation: isolate; }
.seg-track::before {
  content: ""; position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none;
  width: var(--seg-w, 0); height: var(--seg-h, 0); transform: translate(var(--seg-x, 0), var(--seg-y, 0));
  border-radius: var(--r-pill); background: var(--seg-bg); box-shadow: var(--seg-shadow); opacity: 0;
  transition: opacity .2s var(--ease);
}
.seg-track[data-seg-ready]::before { opacity: 1; }
.seg-track[data-seg-anim]::before { transition: transform .55s var(--ease-soft), width .55s var(--ease-soft), height .4s var(--ease), opacity .2s var(--ease); }
.seg-track[data-seg-ready] > :is([aria-pressed="true"], [aria-current="page"]) { background: transparent !important; box-shadow: none !important; border-color: transparent !important; }

.view-switch {
  --seg-bg: var(--primary-bg); --seg-shadow: var(--primary-shadow);
  display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .2rem; max-width: 100%;
  padding: .26rem; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface-flat); box-shadow: var(--glass-rim), var(--shadow-sm);
  -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  animation: step-in .6s var(--ease-out) backwards;
}
.view-switch:has(#admin-tab[hidden]) { display: none; }
.view-switch button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 2.45rem; padding: .45rem 1.15rem; border-radius: var(--r-pill);
  color: var(--muted); font-size: .9rem; font-weight: 500; white-space: nowrap;
  transition: color .3s var(--ease), transform .35s var(--ease-spring), background-color .2s;
}
.view-switch button .icon { width: 1.05rem; height: 1.05rem; }
.view-switch button[aria-current="page"] { color: var(--primary-ink); background: var(--primary-bg); box-shadow: var(--primary-shadow); }
@media (hover: hover) { .view-switch button:not([aria-current="page"]):hover { color: var(--ink); } }
.view-switch button:active { transform: scale(.96); }
.view-switch button:focus-visible { outline-offset: -3px; }

/* ── Page head ─────────────────────────────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem 1rem; margin: 1rem 0 1.25rem; }
#identity {
  position: relative; display: inline-flex; align-items: center; gap: .5rem; max-width: 100%;
  margin: 0; padding: .28rem .8rem .28rem .3rem; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface-flat); color: var(--ink-2); font-size: .86rem; font-weight: 500; overflow-wrap: anywhere;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  animation: step-in .6s var(--ease-out) .1s backwards;
}
#identity:empty { display: none; }
#identity::before { content: ""; flex: none; width: 1.55rem; height: 1.55rem; border-radius: 50%; background: var(--accent-grad); box-shadow: 0 0 0 2px var(--surface-solid), 0 0 14px rgb(var(--spot) / .45); }
#identity::after {
  content: ""; position: absolute; left: calc(.3rem + 1px); top: 50%; width: 1.55rem; height: 1.55rem; translate: 0 -50%;
  background: #04221e; -webkit-mask: var(--i-user) center / 62% no-repeat; mask: var(--i-user) center / 62% no-repeat;
}
.page-head .button { flex: none; min-width: 5.4rem; }
.workspace-actions { display: flex; flex-wrap: wrap; gap: .5rem; max-width: 100%; }
#refresh:disabled { opacity: 1; filter: none; cursor: progress; }
#refresh:disabled .icon { animation: spin .9s linear infinite; }

/* Loading: a shimmering placeholder in the shape of the page. */
#loading { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; color: var(--muted); font-size: .9rem; }
#loading::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); animation: pulse-dot 1.2s ease-in-out infinite; }
#loading::after {
  content: ""; flex-basis: 100%; height: clamp(14rem, 40vh, 22rem); border-radius: var(--r-xl);
  border: 1px solid var(--line-soft);
  background: linear-gradient(100deg, transparent 35%, rgb(var(--spot) / .07) 50%, transparent 65%) 0 0 / 250% 100%, var(--raised);
  animation: shimmer 1.6s linear infinite;
}

/* ── Panels ────────────────────────────────────────────────────────────── */
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.15rem; align-items: start; }
.glass {
  position: relative; isolation: isolate; min-width: 0;
  padding: clamp(1.15rem, 2.4vw, 1.8rem); border-radius: var(--r-xl);
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, -30%), rgb(var(--spot) / calc(var(--spot-a) * .09)), transparent 62%), var(--surface);
  box-shadow: var(--glass-rim), var(--shadow-lg);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  transition: --spot-a .6s var(--ease);
  animation: rise-in .75s var(--ease-out) backwards;
}
.glass::after {
  content: ""; position: absolute; inset: 0; z-index: 2; padding: 1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, -30%), rgb(var(--spot) / calc(var(--spot-a) * .7)), transparent 70%), var(--glass-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
@media (hover: hover) and (pointer: fine) { .glass:hover { --spot-a: 1; } }
.workspace-grid > .glass:nth-child(2) { animation-delay: .07s; }
.workspace-grid > .glass:nth-child(3) { animation-delay: .12s; }
.workspace-grid > .glass:nth-child(4) { animation-delay: .17s; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.6rem; margin-bottom: 1.15rem; }
.panel-title { display: flex; align-items: center; gap: .85rem; min-width: 0; }
#device-allowance { display: inline-flex; align-items: center; gap: .45rem; margin-top: .2rem; color: var(--muted); font-size: .84rem; font-weight: 500; }
#device-allowance:empty { display: none; }
#device-allowance::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgb(var(--spot) / .8); }

.icon-tile {
  position: relative; display: grid; place-items: center; flex: none;
  width: 2.75rem; height: 2.75rem; border-radius: .95rem;
  color: var(--ink); background: var(--raised); border: 1px solid var(--line);
  box-shadow: var(--glass-rim);
}
.icon-tile .icon { width: 1.35rem; height: 1.35rem; }
.icon-tile.accent, .icon-tile.phone { color: var(--accent-text); background: linear-gradient(145deg, rgb(var(--spot) / .24), rgb(var(--spot) / .05)); border-color: rgb(var(--spot) / .32); }
.icon-tile.computer { color: var(--upload); background: linear-gradient(145deg, color-mix(in srgb, var(--upload) 26%, transparent), color-mix(in srgb, var(--upload) 6%, transparent)); border-color: color-mix(in srgb, var(--upload) 36%, transparent); }

/* ── Devices ───────────────────────────────────────────────────────────── */
#device-list { display: grid; gap: .75rem; }
.device {
  position: relative; padding: 1rem 1.05rem 1.05rem; border-radius: var(--r-lg);
  background: var(--raised); border: 1px solid var(--line-soft);
  transition: border-color .3s var(--ease), box-shadow .45s var(--ease), transform .45s var(--ease-spring), background-color .3s var(--ease);
}
@media (hover: hover) { .device:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); } }
.device.is-new { animation: device-in .7s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 70ms + .15s); }
.device.is-new.is-added { animation-name: device-in, device-glow; animation-duration: .7s, 2.4s; }
@keyframes device-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@keyframes device-glow { 0%, 30% { box-shadow: 0 0 0 1px rgb(var(--spot) / .7), 0 0 30px -4px rgb(var(--spot) / .55); } }
.signed-in-device { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.device-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .7rem; }
.device-identity { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.device-identity > div { min-width: 0; }
.device-identity h3 { overflow-wrap: anywhere; }
.device-info { margin-top: .12rem; color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.device .icon-tile { transition: transform .5s var(--ease-spring); }
@media (hover: hover) { .device:hover .icon-tile { transform: rotate(-6deg) scale(1.06); } }

.status {
  --tone: var(--muted);
  display: inline-flex; align-items: center; gap: .42rem; flex: none;
  padding: .28rem .7rem .28rem .58rem; border-radius: var(--r-pill);
  color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 26%, transparent);
  font-size: .78rem; font-weight: 500; line-height: 1.35; white-space: nowrap;
}
.status::before { content: ""; flex: none; width: .44rem; height: .44rem; border-radius: 50%; background: currentColor; }
.status.pending, .status[data-tone="wait"] { --tone: var(--warn); }
.status.approved, .status.active, .status[data-tone="good"] { --tone: var(--ok); }
.status.rejected, .status.revoked, .status[data-tone="bad"] { --tone: var(--danger); }
.status[data-tone="accent"] { --tone: var(--accent-text); }
.status[data-tone="wait"] { --tone: var(--warn); }
.status[data-tone="good"]::before { animation: live 2.4s ease-out infinite; }
.status[data-tone="wait"]::before { animation: pulse-dot 1.6s ease-in-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 70%, transparent); } 70%, 100% { box-shadow: 0 0 0 .4rem transparent; } }

.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: .95rem 0 0; }
.metric { display: flex; flex-direction: column; gap: .12rem; min-width: 0; padding: .6rem .8rem; border-radius: var(--r-md); background: var(--well); border: 1px solid var(--line-soft); }
.metric dt { color: var(--subtle); font-size: .75rem; font-weight: 400; letter-spacing: .02em; }
.metric dd { margin: 0; color: var(--ink); font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; word-break: keep-all; overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .95rem; }
.row-actions .button { min-height: 2.35rem; padding: .42rem .95rem; font-size: .85rem; }
.row-actions > .meta, .row-actions > p { flex-basis: 100%; font-size: .86rem; }

.empty {
  text-align: center; padding: clamp(1.8rem, 5vw, 3.2rem) 1rem;
  border: 1.5px dashed var(--line); border-radius: var(--r-lg);
  background: radial-gradient(70% 90% at 50% 0%, rgb(var(--spot) / .08), transparent 70%);
  animation: rise-in .7s var(--ease-out) .15s backwards;
}
.empty .icon-tile { width: 3.7rem; height: 3.7rem; margin: 0 auto 1.1rem; border-radius: 1.25rem; color: var(--accent-text); background: linear-gradient(145deg, rgb(var(--spot) / .24), rgb(var(--spot) / .05)); border-color: rgb(var(--spot) / .32); animation: float 4.5s ease-in-out infinite; }
.empty .icon-tile .icon { width: 1.8rem; height: 1.8rem; }
.empty h3 { font-size: 1.08rem; }
.empty p { max-width: 26em; margin: .45rem auto 0; color: var(--muted); font-size: .92rem; }

/* ── Guide ─────────────────────────────────────────────────────────────── */
.devices > .panel-head, .device-head-actions { flex-wrap: wrap; }
.device-head-actions { display: flex; align-items: center; gap: .5rem; }
.guide-choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; }
/* System cards share the anatomy of the sign-in entry cards: icon, name, the app it uses, arrow. */
.entry-tile.guide-choice { grid-template-columns: auto minmax(0, 1fr) auto auto; min-height: 4.3rem; gap: .8rem; padding: .75rem .9rem .75rem .75rem; border-radius: 18px; }
.guide-choice .entry-icon { width: 2.6rem; height: 2.6rem; border-radius: 13px; }
.guide-choice .entry-icon .icon { width: 1.25rem; height: 1.25rem; }
.guide-here { padding: .12rem .5rem; border-radius: var(--r-pill); color: var(--accent-text); background: var(--accent-soft); border: 1px solid rgb(var(--spot) / .3); font-size: .72rem; font-weight: 500; white-space: nowrap; }
.guide-back { margin-top: 1.25rem; }
.guide-back .icon { transform: rotate(180deg); }
#guide-detail .steps + .modal-copy:not([hidden]), #guide-bind:not([hidden]) { margin-top: 1rem; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.chips button {
  display: inline-flex; align-items: center; gap: .42rem; min-height: 2.3rem; padding: .4rem .9rem;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--raised);
  color: var(--ink-2); font-size: .86rem; font-weight: 500;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), transform .35s var(--ease-spring), box-shadow .3s var(--ease);
}
.chips button .icon { width: 1rem; height: 1rem; }
@media (hover: hover) { .chips button:not([aria-pressed="true"]):hover { background: var(--raised-hover); border-color: var(--line-strong); color: var(--ink); } }
.chips button:active { transform: scale(.95); }
.chips button[aria-pressed="true"] { color: var(--primary-ink); background: var(--primary-bg); border-color: transparent; box-shadow: var(--primary-shadow); }
.platform-field { container: platform-picker / inline-size; }
#guide-intro { margin: 0; font-size: .92rem; line-height: 1.7; }
.guide-publisher-note { margin: 0 0 .65rem; font-size: .87rem; color: var(--ink-2); }
.guide-server { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .3rem .5rem; margin-top: 1rem; }
.guide-server label, .guide-server [role="status"] { grid-column: 1/-1; }
.guide-server label { font-weight: 600; color: var(--ink-2); }
.guide-server input { min-width: 0; width: 100%; padding: .6rem .7rem; border-radius: var(--r-sm); border: 1px solid var(--line); color: var(--ink); background: var(--well); font: inherit; }
.guide-server [role="status"]:empty { display: none; }
#guide-intro .button { margin-top: .1rem; }
.steps { list-style: none; counter-reset: step; margin: 1.3rem 0 0; padding: 0; }
.steps li { position: relative; counter-increment: step; padding: .2rem 0 1.15rem 2.8rem; color: var(--ink-2); font-size: .92rem; line-height: 1.65; animation: step-in .55s var(--ease-out) backwards; }
.steps li:last-child { padding-bottom: 0; }
.steps li:nth-child(2) { animation-delay: .08s; }
.steps li:nth-child(3) { animation-delay: .16s; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center;
  width: 1.95rem; height: 1.95rem; border-radius: 50%;
  color: var(--accent-text); background: var(--accent-soft); border: 1px solid rgb(var(--spot) / .38);
  font-size: .84rem; font-weight: 750; font-variant-numeric: tabular-nums;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: calc(.975rem - .5px); top: 2.15rem; bottom: .2rem; width: 1px; background: linear-gradient(rgb(var(--spot) / .5), rgb(var(--spot) / .05)); }

/* ── Passkeys ──────────────────────────────────────────────────────────── */
.account-tools { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: inherit; max-width: 100%; }
.account-tools:not(:has(button:not([hidden]))) { display: none; }
.account-tools .button { white-space: nowrap; }
#passkey-manager {
  margin: auto; width: min(38rem, calc(100% - 1.5rem)); max-width: none; padding: 0;
  max-height: min(85vh, 50rem); max-height: min(85dvh, 50rem); overflow: hidden; border-radius: var(--r-lg);
}
#passkey-manager .nt-surface { max-height: inherit; }
#passkey-manager .nt-body { flex: 1 1 auto; }
#passkey-manager .message { margin: .9rem 0 0; }
#passkey-status, #passkey-unsupported, #passkey-confirm p { font-size: .92rem; }
#passkey-unsupported, #passkey-confirm p { margin-top: .55rem; }
.key-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-top: 1rem; }
#passkey-list { list-style: none; margin: .85rem 0 0; padding: 0; border: 1px solid var(--line-soft); border-radius: var(--r-lg); background: var(--well); }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .85rem 1rem; }
.key-row + .key-row { border-top: 1px solid var(--line-soft); }
.key-row .button { flex: none; min-height: 2.35rem; padding: .45rem .8rem; font-size: .85rem; }
.key-details { display: grid; gap: .3rem; min-width: 0; overflow-wrap: anywhere; }
.key-details .muted { font-size: .84rem; }
.usage-panel { grid-column: 1 / -1; min-width: 0; }

/* ── Dialogs ───────────────────────────────────────────────────────────
   They rise and settle on opening and sink away on closing (where the browser can animate display). */
dialog {
  width: 100%; max-width: min(30rem, calc(100% - 2rem)); max-height: min(86dvh, 52rem);
  padding: 0; border: 0; border-radius: 28px;
  color: var(--ink); background: var(--sheet);
  box-shadow: var(--glass-rim), 0 0 0 1px var(--line), 0 50px 120px -30px #000000d9;
  overscroll-behavior: contain;
  opacity: 1; transform: none;
  transition: opacity .2s var(--ease), transform .25s var(--ease-in), overlay .25s allow-discrete, display .25s allow-discrete;
}
dialog[open] { transition: opacity .3s var(--ease), transform .55s var(--ease-soft), overlay .3s allow-discrete, display .3s allow-discrete; }
dialog:not([open]) { opacity: 0; transform: translateY(12px) scale(.97); }
@starting-style { dialog[open] { opacity: 0; transform: translateY(26px) scale(.95); } }
dialog::backdrop {
  background: var(--backdrop, #01040fa6);
  -webkit-backdrop-filter: blur(8px) saturate(1.2); backdrop-filter: blur(8px) saturate(1.2);
  opacity: 1; transition: opacity .3s var(--ease), overlay .3s allow-discrete, display .3s allow-discrete;
}
dialog:not([open])::backdrop { opacity: 0; }
@starting-style { dialog[open]::backdrop { opacity: 0; } }
.sheet-inner { padding: clamp(1.3rem, 4vw, 1.9rem); }
.sheet-inner > .panel-head { margin-bottom: 1.1rem; }
.sheet-inner > .panel-head h2 { font-size: 1.3rem; overflow-wrap: anywhere; }
.sheet-inner > .panel-head .round { width: 2.4rem; height: 2.4rem; }
@media (hover: hover) { #dismiss:hover .icon, .nt-head .round:hover .icon { transform: rotate(90deg); } }
.sheet-inner p { overflow-wrap: anywhere; }
.sheet-inner .meta { font-size: .88rem; line-height: 1.65; }
.sheet-inner .message { margin: 1rem 0 0; }
#sheet-body > h3, #sheet-body form > h3, .dg-setup > h3 {
  display: inline-flex; align-items: center; gap: .5rem; max-width: 100%; margin-bottom: .9rem;
  padding: .38rem .8rem; border-radius: var(--r-sm); background: var(--well); border: 1px solid var(--line-soft);
  font-size: .95rem; overflow-wrap: anywhere;
}
.dg-setup > h3 { margin-bottom: 0; width: fit-content; }
.modal-copy { margin: .2rem 0 1rem; color: var(--ink-2); line-height: 1.75; }
#sheet-body > .meta + .metrics { margin-top: .7rem; }
.sheet-inner .field { display: block; margin-bottom: 1.1rem; }
.sheet-inner .field > span, .sheet-inner legend { display: block; margin: 0 .2rem .45rem; color: var(--ink-2); font-size: .875rem; font-weight: 600; }
.sheet-inner :is(input[type="text"], input[type="password"], input:not([type]), select) {
  display: block; width: 100%; min-height: 3rem; padding: .7rem 1rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--field); color: var(--ink); font-size: 1rem; caret-color: var(--accent); outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur-slow) var(--ease), background-color var(--dur) var(--ease);
}
.sheet-inner select { appearance: none; -webkit-appearance: none; padding-right: 2.6rem; background: var(--select-arrow) right .9rem center / 1.1rem no-repeat, var(--field); cursor: pointer; }
.sheet-inner select:disabled { opacity: .7; cursor: not-allowed; }
.sheet-inner :is(input, select):focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background-color: var(--field-focus); }
.sheet-inner input:read-only { color: var(--ink-2); }
.sheet-inner small.meta { display: block; margin: .5rem .2rem 0; font-size: .82rem; }
.sheet-inner fieldset { min-width: 0; margin: 0 0 1.2rem; padding: 0; border: 0; }
.platform-options {
  display: grid;
  grid-auto-columns: minmax(max-content, 1fr);
  grid-auto-flow: column;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--well);
}
.platform-option { position: relative; min-width: 0; }
@container platform-picker (max-width: 21rem) {
  .platform-options-wrap { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container platform-picker (max-width: 15rem) {
  .platform-options { grid-auto-flow: row; grid-template-columns: minmax(0, 1fr); }
}
.platform-option input {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.platform-face {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .32rem;
  min-height: 3.7rem; padding: .4rem .15rem;
  border: 1px solid transparent; border-radius: 11px;
  color: var(--ink-2); font-size: .8125rem; font-weight: 550; line-height: 1.25; text-align: center;
}
.platform-face > .icon { width: 1.15rem; height: 1.15rem; }
.platform-face > span { white-space: nowrap; }
.platform-face > .platform-check { position: absolute; top: .32rem; right: .32rem; width: .72rem; height: .72rem; opacity: 0; stroke-width: 2.6; }
@media (hover: hover) {
  .platform-option input:enabled:not(:checked):hover + .platform-face { background: var(--surface-flat); }
}
.platform-option input:checked + .platform-face {
  border-color: rgb(var(--spot) / .52); background: var(--surface-solid); color: var(--accent-text);
  box-shadow: var(--shadow-sm); font-weight: 650;
}
.platform-option input:checked + .platform-face .platform-check { opacity: 1; }
.platform-option input:focus-visible + .platform-face { outline: 2px solid var(--accent-text); outline-offset: 1px; }
.platform-option input:disabled { cursor: default; }
@media (forced-colors: active) {
  .platform-option input:checked + .platform-face { border-color: Highlight; }
}
.sheet-inner form > .button.primary, .sheet-inner form > button[type="submit"] { width: 100%; min-height: 3rem; margin-top: .3rem; font-size: .98rem; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.3rem; }
.sheet-actions .button { min-height: 2.85rem; padding-inline: 1.3rem; }
.sheet-actions .button.danger { color: #fff; background: var(--danger-grad); border-color: transparent; box-shadow: inset 0 1px 0 #ffffff40, 0 12px 26px -12px #e0405ab3; }
@media (hover: hover) { .sheet-actions .button.danger:hover:not(:disabled) { background: var(--danger-grad); filter: brightness(1.06); box-shadow: inset 0 1px 0 #ffffff40, 0 16px 32px -12px #e0405ae6; } }
#sheet-body > .button.primary:not(.download-button) { width: 100%; min-height: 3rem; }
.usage-note { margin-top: 1rem; color: var(--subtle); font-size: .84rem; }

/* Passkey offer: a small celebration of the faster way in. */
.offer-inner { text-align: center; }
.offer-art { display: grid; place-items: center; margin: .4rem auto 1.1rem; width: 5.5rem; height: 5.5rem; border-radius: 50%; background: radial-gradient(closest-side, rgb(var(--spot) / .22), transparent); }
.offer-art .icon-tile { width: 3.6rem; height: 3.6rem; border-radius: 1.2rem; animation: pop-in .7s var(--ease-spring) .15s backwards; }
.offer-art .icon-tile .icon { width: 1.9rem; height: 1.9rem; }
#passkey-offer h2 { font-size: 1.35rem; }
#passkey-offer .modal-copy { margin: .7rem 0 1rem; text-wrap: balance; }
.passkey-preference { display: inline-flex; align-items: center; gap: .55rem; min-height: 2.75rem; padding: 0 .6rem; border-radius: var(--r-pill); color: var(--ink-2); font-size: .9rem; cursor: pointer; transition: background-color .2s; }
@media (hover: hover) { .passkey-preference:hover { background: var(--raised); } }
.passkey-preference input { width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--accent); }
#passkey-offer .row-actions { justify-content: center; margin-top: 1rem; }
#passkey-offer .row-actions .button { flex: 1 1 10rem; min-height: 2.9rem; font-size: .93rem; }

/* Defguard binding */
.dg-setup { display: grid; gap: .9rem; }
.dg-downloads { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.button.download-button { width: fit-content; min-width: 0; max-width: 100%; white-space: normal; }
.download-button .icon { flex-shrink: 0; }
.dg-setup > :is(h3, p), .dg-manual p { margin: 0; }
.dg-setup > .button { width: fit-content; }
.dg-setup > .button.primary:not(.download-button) { width: 100%; min-height: 3rem; }
.dg-manual { border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--well); padding: 0 1rem; transition: background-color .3s; }
.dg-manual[open] { padding-bottom: 1rem; }
.dg-manual summary { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 3rem; list-style: none; cursor: pointer; font-weight: 620; border-radius: var(--r-sm); }
.dg-manual summary::-webkit-details-marker { display: none; }
.dg-manual summary::after { content: ""; flex: none; width: 1.05rem; height: 1.05rem; background: var(--muted); -webkit-mask: var(--i-chevron) center / contain no-repeat; mask: var(--i-chevron) center / contain no-repeat; transition: transform .4s var(--ease-spring); }
.dg-manual[open] summary::after { transform: rotate(180deg); }
.dg-manual[open] > :not(summary) { margin-top: .7rem; animation: step-in .4s var(--ease-out) backwards; }
.dg-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: end; }
.dg-copy .field { min-width: 0; margin: 0; }
.dg-copy input { width: 100%; min-width: 0; font-family: var(--font-mono); font-size: .9rem !important; }
.dg-copy .button { min-height: 3rem; }
.dg-qr { width: min(220px, 100%); height: auto; image-rendering: pixelated; background: #fff; justify-self: center; border-radius: 16px; box-shadow: 0 0 0 1px var(--line), 0 0 0 6px var(--raised), 0 24px 50px -24px rgb(var(--spot) / .7); animation: pop-in .6s var(--ease-spring) backwards; }
.dg-manual .dg-qr { display: block; margin: .9rem auto .2rem; }
.button.is-copied { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
.button.is-copied .icon { animation: pop-in .45s var(--ease-spring); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 880px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr); gap: .95rem; }
}
@media (max-width: 560px) {
  .view-switch { display: grid; width: 100%; }
  /* Phones: the account pill and an icon-only refresh share the first row; the account tools fill an even row below. */
  .page-head { gap: .55rem .5rem; margin: .8rem 0 1rem; }
  .workspace-actions { display: contents; }
  #identity { order: 0; flex: 1 1 auto; min-width: 0; }
  #refresh { order: 1; flex: none; width: 2.45rem; min-width: 0; min-height: 2.45rem; padding: 0; gap: 0; font-size: 0; }
  #refresh .icon { width: 1.1rem; height: 1.1rem; margin: 0; }
  .account-tools { order: 2; flex: 1 1 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .4rem; }
  .account-tools .button { min-width: 0; min-height: 2.5rem; padding-inline: .45rem; gap: .35rem; font-size: .84rem; }
  .glass { border-radius: 22px; }
  .panel-head { align-items: flex-start; }
  .panel-head .button.primary { min-height: 2.5rem; padding-inline: .95rem; }
  .device { padding: .9rem; }
  /* Metrics become a compact label–value list, so dates never split. */
  .metrics, #user-detail > div:first-child .metrics { grid-template-columns: minmax(0, 1fr); gap: 0; border-radius: var(--r-md); background: var(--well); border: 1px solid var(--line-soft); overflow: hidden; }
  .metric { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .62rem .85rem; border: 0; border-radius: 0; background: none; }
  .metric + .metric { border-top: 1px solid var(--line-soft); }
  .metric dt { flex: none; }
  .metric dd { text-align: right; }
  .row-actions .button { flex: 1 1 auto; }
  .row-actions .button.danger { flex: 0 1 auto; }
  /* Sheets rise from the bottom edge on phones. */
  dialog { max-width: 100%; margin: auto 0 0; border-radius: 26px 26px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  dialog:not([open]) { opacity: 1; transform: translateY(100%); }
  @starting-style { dialog[open] { opacity: 1; transform: translateY(100%); } }
  dialog[open] { transition: transform .5s var(--ease-out), overlay .5s allow-discrete, display .5s allow-discrete; }
  dialog { transition: transform .28s var(--ease-in), overlay .28s allow-discrete, display .28s allow-discrete; }
  .sheet-actions .button { flex: 1 1 8rem; }
}
@media (max-width: 380px) {
  .workspace-actions .button .icon { display: none; }
  .device-identity .icon-tile { width: 2.35rem; height: 2.35rem; border-radius: .8rem; }
  .panel-title .icon-tile { display: none; }
}
@media (forced-colors: active) {
  .glass, dialog, .device, .metric, .icon-tile, .view-switch, .chips button, .status, .dg-manual, #identity { border: 1px solid ButtonText; }
  .glass::after, #identity::before, #identity::after, #loading::after { display: none; }
  .view-switch button[aria-current="page"], .chips button[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .seg-track::before { display: none; }
}
