/* Tool desk tokens: quiet surfaces, compact controls, one green accent. */
:root {
  --accent: #0f735d;
  --accent-ink: #fff;
  --accent-soft: #e8f2ee;
  --bg: #f4f6f5;
  --surface: #fff;
  --raised: #f8faf9;
  --ink: #192621;
  --text: #3f4d47;
  --muted: #6e7d75;
  --line: #e4e9e6;
  --input: #cbd5cf;
  --danger: #b23d37;
  --danger-soft: #fbecea;
  --warn: #996419;
  --warn-soft: #fff5e5;
  --r-ctl: 7px;
  --r: 12px;
  --pad: 16px;
  --sh-1:
    0 0 0 1px rgb(22 41 31 / 0.055), 0 1px 2px rgb(22 41 31 / 0.035),
    0 3px 10px rgb(22 41 31 / 0.035);
  --sh-2:
    0 0 0 1px rgb(22 41 31 / 0.07), 0 8px 24px rgb(22 41 31 / 0.1),
    0 24px 64px rgb(22 41 31 / 0.12);
  --side: 204px;
  --font:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --accent: #55b89b;
  --accent-ink: #09221a;
  --accent-soft: #19372d;
  --bg: #121814;
  --surface: #1b231e;
  --raised: #222b25;
  --ink: #e4ece7;
  --text: #bdcbc2;
  --muted: #94a79b;
  --line: #303d34;
  --input: #4c5d51;
  --danger: #f68d85;
  --danger-soft: #3d2524;
  --warn: #e6bd71;
  --warn-soft: #3c3321;
  --sh-1: 0 0 0 1px rgb(255 255 255 / 0.065), 0 2px 6px rgb(0 0 0 / 0.2);
  --sh-2: 0 0 0 1px rgb(255 255 255 / 0.1), 0 16px 48px rgb(0 0 0 / 0.5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --accent: #55b89b;
    --accent-ink: #09221a;
    --accent-soft: #19372d;
    --bg: #121814;
    --surface: #1b231e;
    --raised: #222b25;
    --ink: #e4ece7;
    --text: #bdcbc2;
    --muted: #94a79b;
    --line: #303d34;
    --input: #4c5d51;
    --danger: #f68d85;
    --danger-soft: #3d2524;
    --warn: #e6bd71;
    --warn-soft: #3c3321;
    --sh-1: 0 0 0 1px rgb(255 255 255 / 0.065);
    --sh-2: 0 0 0 1px rgb(255 255 255 / 0.1), 0 16px 48px rgb(0 0 0 / 0.5);
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.55 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
}
h1 {
  font-size: 26px;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 16px;
}
h3 {
  font-size: 14px;
}
p {
  margin: 0 0 12px;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
p:last-child {
  margin-bottom: 0;
}
small,
.fine {
  font-size: 12px;
  color: var(--muted);
}
.muted,
.subtle {
  color: var(--muted);
}
.subtle {
  display: block;
  font-size: 12px;
  font-weight: 400;
  margin-top: 3px;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}
.num {
  text-align: right;
  white-space: nowrap;
}
.svg-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn .svg-icon {
  width: 16px;
  height: 16px;
}
[hidden] {
  display: none !important;
}
.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 100;
  background: var(--surface);
  padding: 10px 16px;
  box-shadow: var(--sh-2);
}
.skip-link:focus {
  top: 12px;
}
.shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  min-height: 100dvh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.brand {
  height: 72px;
  padding: 17px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  flex: none;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 8px;
  flex: none;
}
.brand-mark .svg-icon {
  width: 20px;
  height: 20px;
}
.brand-copy {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  margin-top: 1px;
  color: var(--muted);
}
.workspace {
  margin: 0 12px 10px;
  padding: 10px;
  background: var(--raised);
  border-radius: 8px;
}
.workspace label {
  font-size: 11px;
  color: var(--muted);
  display: block;
  margin-bottom: 5px;
}
.workspace select {
  width: 100%;
  height: 32px;
  padding: 3px 8px;
  font-size: 12px;
  background: var(--surface);
}
#role-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}
#nav {
  overflow: auto;
  padding: 0 9px 10px;
  flex: 1;
}
.nav-group {
  padding: 6px 0;
}
.nav-group + .nav-group {
  border-top: 1px solid var(--line);
}
.nav-label {
  display: block;
  padding: 5px 10px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.nav-group button {
  border: 0;
  background: none;
  border-radius: 7px;
  color: var(--text);
  height: 37px;
  width: 100%;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  position: relative;
  font-size: 13px;
  margin: 2px 0;
}
.nav-group button:hover {
  background: var(--raised);
}
.nav-group button.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.nav-help {
  margin-top: 5px;
}
.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.user-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px 9px;
  min-width: 0;
}
.user-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: var(--raised);
  border-radius: 50%;
  flex: none;
}
.user-icon .svg-icon {
  width: 14px;
  height: 14px;
}
#identity {
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.sidebar-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-controls form {
  margin-left: auto;
}
.icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  color: var(--muted);
  padding: 0;
}
.icon-button:hover {
  background: var(--raised);
  color: var(--ink);
}
.content-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 52px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 12px;
  background: var(--bg);
}
#breadcrumb {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: none;
}
#sync-time {
  font-size: 11px;
  color: var(--muted);
}
#main {
  padding: 22px 26px 36px;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  min-width: 0;
  flex: 1;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 26px 15px;
  color: var(--muted);
  font-size: 10px;
}
.mobile-menu {
  display: none;
}
.nav-scrim {
  position: fixed;
  inset: 0;
  border: 0;
  background: #10251b66;
  z-index: 29;
}
.sidebar-compact {
  --side: 64px;
}
.sidebar-compact .brand {
  padding: 17px;
}
.sidebar-compact .brand-copy,
.sidebar-compact .workspace,
.sidebar-compact .nav-label,
.sidebar-compact .nav-text,
.sidebar-compact .nav-count,
.sidebar-compact .user-row {
  display: none;
}
.sidebar-compact #nav {
  overflow: visible;
  padding: 0 9px;
}
.sidebar-compact .nav-group button {
  justify-content: center;
  padding: 0;
}
.sidebar-compact .sidebar-bottom {
  padding: 10px 9px;
}
.sidebar-compact .sidebar-controls {
  flex-direction: column;
}
.sidebar-compact .sidebar-controls form {
  margin: 0;
}
.sidebar-compact .nav-group {
  padding: 10px 0;
}
.sidebar-compact .nav-group button:where(:hover, :focus-visible)::after {
  content: attr(data-tip);
  position: absolute;
  left: 54px;
  top: 5px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 400;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 12px;
  box-shadow: var(--sh-1);
  animation: tip-in 0.01s 0.25s backwards;
  z-index: 50;
}
@keyframes tip-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}
.page-heading p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
  max-width: 840px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 13px;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--input);
  border-radius: var(--r-ctl);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  text-decoration: none;
  transition:
    background 0.12s,
    border-color 0.12s;
}
.btn:hover {
  background: var(--raised);
  border-color: var(--muted);
  text-decoration: none;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.primary:hover {
  filter: brightness(1.08);
}
.btn.danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--input));
}
.btn.small {
  min-height: 29px;
  padding: 4px 9px;
  font-size: 11px;
}
.btn.text-button,
.text-button {
  background: none;
  border: 0;
  color: var(--accent);
  padding: 0;
  font-size: 12px;
}
.btn.wide,
.wide {
  width: 100%;
}
.spacer {
  flex: 1;
}
.eyebrow,
.band-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}
.badge {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border-radius: 5px;
  padding: 2px 7px;
  background: var(--raised);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.badge.green,
.badge.blue {
  color: var(--accent);
  background: var(--accent-soft);
}
.badge.amber {
  color: var(--warn);
  background: var(--warn-soft);
}
.badge.red {
  color: var(--danger);
  background: var(--danger-soft);
}
.dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.card {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  min-width: 0;
  margin-bottom: 16px;
  overflow: clip;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 18px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.card-head .subtle {
  margin: 0;
}
.card-body {
  padding: 18px;
}
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.grid-2 .card {
  margin: 0;
}
.grid-2 {
  margin-bottom: 16px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.metric {
  background: var(--surface);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--sh-1);
}
.metric-label {
  font-size: 12px;
  color: var(--muted);
  display: block;
}
.metric strong {
  display: block;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.035em;
  margin: 7px 0;
}
.metric small {
  display: block;
  font-size: 11px;
}
.metric.accent {
  background: var(--accent-soft);
}
.metric.accent strong {
  color: var(--accent);
}
.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.hero-card {
  padding: 24px;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  position: relative;
  min-width: 0;
}
.hero-card h2 {
  font-size: 20px;
  margin: 12px 0 9px;
}
.hero-number {
  font-size: 46px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--accent);
}
.hero-number span {
  font-size: 16px;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--muted);
  margin-left: 10px;
}
.hero-lead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 20px;
}
.hero-card .actions {
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.hero-note {
  font-size: 12px;
  color: var(--muted);
  max-width: 350px;
}
.summary-stack {
  display: grid;
  gap: 12px;
}
.summary-row {
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.summary-row .summary-value {
  font-size: 26px;
  font-weight: 600;
  min-width: 40px;
}
.summary-row h3 {
  font-size: 12px;
}
.summary-row p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.summary-row .summary-link {
  margin-left: auto;
}
.overview-body {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(260px, 1fr);
  gap: 16px;
}
.overview-body > div {
  min-width: 0;
}
.steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.step-num {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  flex: none;
}
.step p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.status-list {
  display: grid;
  gap: 0;
}
.status-list > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.status-list > div:last-child {
  border: 0;
}
.status-list strong {
  font-weight: 500;
}
.status-list .subtle {
  margin-top: 0;
}
.notice {
  font-size: 12px;
  color: var(--text);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 11px 14px;
  margin: 0 0 16px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.notice.warning {
  background: var(--warn-soft);
  color: var(--warn);
}
.notice.danger,
.error {
  background: var(--danger-soft);
  color: var(--danger);
}
.error {
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 7px;
  margin-bottom: 12px;
}
.empty {
  text-align: center;
  padding: 38px 18px;
  color: var(--muted);
}
.empty-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin: 0 auto 11px;
  color: var(--muted);
  background: var(--raised);
  border-radius: 10px;
}
.empty h3 {
  font-size: 14px;
}
.empty p {
  font-size: 12px;
  max-width: 500px;
  margin: 7px auto 16px;
}
.empty .btn {
  margin: 0 auto;
}
.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.table-scroll {
  overflow: auto;
  max-width: 100%;
  scrollbar-width: thin;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
th {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 10px 16px;
  background: var(--raised);
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  line-height: 1.5;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--raised);
}
td strong {
  font-size: 12px;
  font-weight: 600;
}
.message {
  max-width: 380px;
  min-width: 180px;
  overflow-wrap: anywhere;
}
.progress {
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  width: 100px;
  margin-top: 6px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbar input[type="search"] {
  width: 240px;
}
.toolbar select {
  max-width: 200px;
}
.toolbar .subtle {
  margin: 0;
}
.device-band {
  padding: 16px 18px;
}
.device-band + .device-band {
  border-top: 1px solid var(--line);
}
.band-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.band-head h2 {
  font-size: 14px;
}
.band-index {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-weight: 600;
}
.band-head .subtle {
  margin: 0 0 0 auto;
}
.band-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.band-actions p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  flex: 1;
  min-width: 160px;
}
.selection-summary {
  font-size: 12px;
  color: var(--muted);
  margin: 0 2px;
}
.selection-summary strong {
  font-size: 14px;
  color: var(--accent);
  margin: 0 3px;
}
.segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--raised);
  border: 1px solid var(--line);
  padding: 2px;
  border-radius: 8px;
}
.segmented button {
  min-height: 28px;
  padding: 4px 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: none;
  font-size: 11px;
}
.segmented button .svg-icon {
  width: 14px;
  height: 14px;
}
.segmented button.active {
  color: var(--accent);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  padding: 16px;
}
.device-card {
  padding: 13px;
  background: var(--surface);
  border-radius: 9px;
  box-shadow: inset 0 0 0 1px var(--line);
  min-width: 0;
}
.device-card.selected {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.device-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}
.device-card-head strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.device-card-head .badge {
  margin-left: auto;
}
.device-meta {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 5px;
  font-size: 11px;
  margin: 11px 0;
  color: var(--muted);
}
.device-meta dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}
.device-meta dt {
  margin: 0;
}
.device-card .actions {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.selected-row {
  background: var(--accent-soft);
}
.list-footer {
  padding: 10px 16px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.plan-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
}
.plan-card {
  background: var(--surface);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--sh-1);
}
.plan-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  justify-content: space-between;
}
.plan-time {
  font-size: 24px;
  letter-spacing: -0.03em;
  line-height: 1.4;
  margin: 16px 0 5px;
}
.plan-time .subtle {
  display: inline;
  font-size: 11px;
  letter-spacing: 0;
  margin-left: 5px;
}
.plan-card .actions {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 16px;
}
.mini-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  padding: 13px 18px;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  margin-bottom: 16px;
}
.mini-stats span {
  color: var(--muted);
  font-size: 12px;
}
.mini-stats strong {
  margin-left: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}
.connection-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.connection-option {
  padding: 20px;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
}
.option-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.option-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}
.option-head h2 {
  font-size: 16px;
}
.option-head .badge {
  margin-left: auto;
}
.connection-option > p {
  font-size: 12px;
  color: var(--muted);
  min-height: 36px;
}
.connection-option .steps {
  margin: 20px 0;
}
.connection-option .step-num {
  width: 20px;
  height: 20px;
  font-size: 10px;
}
.connection-option .step h3 {
  font-size: 12px;
}
.connection-option .actions {
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
.flow-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  background: var(--raised);
  border-radius: 8px;
  padding: 15px;
  font-size: 12px;
  margin: 15px 0;
}
.flow-strip .svg-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.address-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--raised);
  padding: 13px 14px;
  border-radius: 8px;
  margin: 12px 0;
}
.address-box code {
  font:
    12px ui-monospace,
    monospace;
  overflow-wrap: anywhere;
  flex: 1;
  min-width: 0;
}
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
}
.checklist li {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.checklist li:first-child {
  border: 0;
}
.checklist .svg-icon {
  margin-top: 2px;
  color: var(--muted);
}
.checklist strong {
  font-weight: 500;
  display: block;
}
.checklist p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.checklist li.done .svg-icon {
  color: var(--accent);
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}
.help-card {
  padding: 20px;
  background: var(--surface);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
}
.help-card .option-icon {
  margin-bottom: 12px;
}
.help-card p {
  font-size: 12px;
  color: var(--muted);
  margin: 9px 0 16px;
}
.help-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.help-list details {
  background: var(--surface);
  padding: 14px 18px;
  border-radius: var(--r);
  box-shadow: var(--sh-1);
}
.help-list details p {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text);
}
summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}
summary:hover {
  color: var(--accent);
}
.technical {
  padding: 12px 14px;
  background: var(--raised);
  border-radius: 8px;
  margin: 14px 0;
}
.technical .split-value {
  font-size: 11px;
}
.technical .split-value strong {
  font:
    11px ui-monospace,
    monospace;
  overflow-wrap: anywhere;
  max-width: 72%;
  text-align: right;
}
.split-value {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.split-value:last-child {
  border: 0;
}
.split-value > span {
  color: var(--muted);
}
.split-value strong {
  font-weight: 500;
  overflow-wrap: anywhere;
  max-width: 72%;
  text-align: right;
}
.release-source {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: var(--raised);
  border-radius: 8px;
  font-size: 12px;
  margin: 12px 0;
}
.release-source p {
  margin: 0;
  flex: 1;
  color: var(--muted);
}
.release-import {
  display: block;
  padding: 12px 0;
}
.release-import input[type="file"] {
  height: auto;
  padding: 6px 0;
  border: 0;
  font-size: 12px;
  background: none;
  max-width: 100%;
}
.package-summary {
  padding: 13px;
  background: var(--accent-soft);
  border-radius: 8px;
  margin-top: 12px;
  font-size: 12px;
}
.package-summary strong {
  display: block;
}
.package-summary span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.readonly-grid {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 8px;
  font-size: 11px;
  margin: 12px 0 0;
}
.readonly-grid dt {
  color: var(--muted);
}
.readonly-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.role-card {
  background: var(--surface);
  padding: 15px 16px;
  box-shadow: var(--sh-1);
  border-radius: var(--r);
}
.role-card h3 {
  font-size: 13px;
}
.role-card p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  border: 1px solid var(--input);
  background: var(--surface);
  border-radius: var(--r-ctl);
  padding: 7px 10px;
  min-height: 36px;
  font-size: 12px;
  max-width: 100%;
  min-width: 0;
}
input[type="checkbox"],
input[type="radio"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  vertical-align: middle;
  flex: none;
}
input[readonly] {
  background: var(--raised);
  color: var(--muted);
}
textarea {
  min-height: 82px;
  resize: vertical;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 14px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font-weight: 400;
}
.field small {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 16px;
}
.form-section {
  padding: 17px 0;
  border-top: 1px solid var(--line);
}
.form-section:first-child {
  padding-top: 0;
  border: 0;
}
.form-section:last-child {
  padding-bottom: 0;
}
.form-section h3 {
  font-size: 12px;
  margin-bottom: 13px;
}
.form-section .field:last-child {
  margin-bottom: 0;
}
.check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
  margin: 0 0 14px;
}
.check-group label,
.check-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text);
}
.check-line {
  min-height: 32px;
  margin-bottom: 8px;
}
.device-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 10px;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--raised);
}
.device-picker label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px;
  font-size: 12px;
  min-width: 0;
  flex-wrap: wrap;
}
.device-picker .subtle {
  font-size: 10px;
  margin: 0;
}
.code-block {
  margin: 12px 0;
  padding: 12px 14px;
  font:
    11px/1.7 ui-monospace,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--raised);
  border-radius: 8px;
  max-height: 340px;
  overflow: auto;
}
.binding-code {
  padding: 20px 12px;
  text-align: center;
  font:
    600 24px/1.4 ui-monospace,
    monospace;
  letter-spacing: 0.07em;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 8px;
  margin: 15px 0;
  overflow-wrap: anywhere;
}
dialog {
  border: 0;
  border-radius: 14px;
  box-shadow: var(--sh-2);
  padding: 0;
  width: min(680px, calc(100vw - 32px));
  max-width: 720px;
  max-height: min(88dvh, 900px);
  background: var(--surface);
  color: var(--ink);
}
dialog::backdrop {
  background: rgb(15 30 22 / 0.38);
}
#modal-form {
  display: flex;
  flex-direction: column;
  max-height: min(88dvh, 900px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.dialog-head h2 {
  font-size: 17px;
}
.dialog-head .icon-button {
  width: 28px;
  height: 28px;
}
#modal-body {
  overflow: auto;
  padding: 20px;
  min-height: 0;
  overscroll-behavior: contain;
}
.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}
.dialog-error {
  margin: 0 20px 12px;
  flex: none;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--sh-2);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 12px;
  max-width: min(600px, calc(100vw - 40px));
  overflow-wrap: anywhere;
}
.login-page {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 32px;
}
.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(350px, 1fr);
  max-width: 940px;
  width: 100%;
  min-height: 530px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--sh-2);
  overflow: hidden;
}
.login-story {
  background: var(--raised);
  padding: 30px 34px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}
.login-story .brand {
  padding: 0;
  height: auto;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 55px;
}
.login-story h1 {
  font-size: 32px;
  line-height: 1.3;
  letter-spacing: -0.045em;
  margin: 10px 0 17px;
}
.login-story p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.login-story .fine {
  margin-top: auto;
  padding-top: 30px;
  font-size: 11px;
}
.login-card {
  padding: 56px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-card h2 {
  font-size: 23px;
  margin: 8px 0;
}
.login-card > p {
  font-size: 12px;
  margin-bottom: 26px;
}
.login-card form .btn {
  margin-top: 8px;
}
.login-help {
  margin-top: 23px;
  font-size: 11px !important;
}
.login-flow {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 28px;
  font-size: 11px;
  color: var(--accent);
}
.login-flow span {
  background: var(--accent-soft);
  padding: 6px 8px;
  border-radius: 5px;
}
.login-flow .svg-icon {
  width: 14px;
  height: 14px;
}
@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.enter {
  animation: enter 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  animation-delay: calc(min(var(--i, 0), 7) * 65ms);
}
@media (min-width: 1700px) {
  #main {
    padding-top: 28px;
  }
  .page-heading {
    margin-bottom: 24px;
  }
}
@media (max-width: 1100px) {
  .hero-layout,
  .overview-body {
    grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr);
  }
  #main {
    padding: 20px;
  }
  .metrics {
    gap: 10px;
  }
  .metric {
    padding: 14px;
  }
  .page-heading .actions {
    max-width: 40%;
    justify-content: flex-end;
  }
  .table-scroll table {
    min-width: 650px;
  }
  .connection-options {
    gap: 12px;
  }
  .flow-strip {
    gap: 8px;
  }
}
@media (max-width: 768px) {
  :root,
  .sidebar-compact {
    --side: 0px;
  }
  .shell {
    display: block;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 224px;
    transform: translateX(-100%);
    visibility: hidden;
    height: 100dvh;
    box-shadow: var(--sh-2);
  }
  .nav-open .sidebar {
    transform: none;
    visibility: visible;
  }
  .sidebar-compact .brand {
    padding: 17px 16px;
  }
  .sidebar-compact .brand-copy,
  .sidebar-compact .workspace,
  .sidebar-compact .nav-label,
  .sidebar-compact .nav-text,
  .sidebar-compact .nav-count,
  .sidebar-compact .user-row {
    display: revert;
  }
  .sidebar-compact .nav-group button {
    justify-content: flex-start;
    padding: 0 10px;
  }
  .sidebar-compact #nav {
    overflow: auto;
  }
  .sidebar-compact .sidebar-controls {
    flex-direction: row;
  }
  .sidebar-compact .sidebar-controls form {
    margin-left: auto;
  }
  .sidebar-compact .nav-group button::after {
    display: none;
  }
  .sidebar-compact .nav-group {
    padding: 6px 0;
  }
  .mobile-menu {
    display: flex;
  }
  #sidebar-toggle {
    display: none;
  }
  .topbar {
    padding: 0 15px;
    height: 48px;
  }
  .topbar-right {
    margin-left: auto;
    gap: 7px;
  }
  #sync-time {
    display: none;
  }
  #breadcrumb {
    font-size: 11px;
  }
  #main {
    padding: 20px 15px 28px;
  }
  h1 {
    font-size: 24px;
  }
  .page-heading {
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 17px;
  }
  .page-heading .actions {
    max-width: none;
    justify-content: flex-start;
  }
  .hero-layout,
  .overview-body,
  .grid-2,
  .connection-options {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hero-card {
    padding: 20px;
  }
  .hero-lead {
    margin-bottom: 16px;
  }
  .hero-number {
    font-size: 38px;
  }
  .summary-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-row {
    padding: 14px;
    gap: 9px;
  }
  .summary-row .summary-link {
    display: none;
  }
  .summary-row .summary-value {
    font-size: 22px;
    min-width: 25px;
  }
  .summary-row:last-child:nth-child(odd) {
    grid-column: 1/-1;
  }
  .device-band {
    padding: 14px;
  }
  .toolbar input[type="search"] {
    width: 100%;
    flex-basis: 100%;
  }
  .band-actions {
    gap: 10px;
  }
  .band-actions p {
    width: 100%;
    flex-basis: 100%;
  }
  .band-head .subtle {
    font-size: 10px;
  }
  .card-head {
    padding: 13px 15px;
  }
  .device-grid {
    padding: 12px;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  }
  .role-grid {
    grid-template-columns: 1fr;
  }
  .role-card {
    padding: 13px 15px;
  }
  .role-card p {
    margin-top: 3px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .form-row.compact-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
  }
  .page-footer {
    font-size: 9px;
    padding: 12px 15px;
    flex-wrap: wrap;
  }
  .table-scroll th,
  .table-scroll td {
    padding: 10px 13px;
  }
  .device-picker {
    grid-template-columns: 1fr;
  }
  dialog {
    max-height: 92dvh;
    width: calc(100vw - 20px);
    border-radius: 11px;
  }
  #modal-form {
    max-height: 92dvh;
  }
  #modal-body {
    padding: 16px;
  }
  .dialog-head {
    padding: 14px 16px;
  }
  .dialog-foot {
    padding: 12px 16px;
  }
  .readonly-grid {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .readonly-grid dd {
    margin-bottom: 8px;
  }
  .login-page {
    padding: 18px;
  }
  .login-layout {
    display: block;
    max-width: 460px;
    min-height: 0;
  }
  .login-story {
    display: none;
  }
  .login-card {
    padding: 35px 26px;
  }
  .login-card h2 {
    font-size: 24px;
  }
  .flow-strip {
    flex-wrap: wrap;
  }
  .address-box {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  .card,
  .hero-card,
  .summary-row,
  .metric,
  .plan-card,
  .connection-option,
  .help-card,
  .role-card,
  dialog {
    border: 1px solid CanvasText;
  }
  .badge {
    outline: 1px solid CanvasText;
  }
  .nav-group button.active {
    outline: 1px solid Highlight;
  }
  .btn.primary {
    border: 1px solid ButtonText;
  }
}

/* 0.2.1: account link, account page, card tables on narrow screens. */
a.user-row {
  color: inherit;
  text-decoration: none;
  border-radius: var(--r-ctl);
}
a.user-row:hover,
a.user-row:focus-visible {
  color: var(--ink);
}
.user-link {
  margin-left: auto;
  flex: none;
  font-size: 11px;
  color: var(--accent);
}
.hero-number .hero-total {
  white-space: nowrap;
}
.account-page {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}
.account-layout {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}
.account-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.account-head form {
  margin: 0;
}
.account-title h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--ink);
  margin: 6px 0 4px;
  overflow-wrap: anywhere;
}
.account-title p {
  margin: 0 0 20px;
  font-size: 13px;
}
.account-page .card {
  margin-bottom: 16px;
}
.account-form {
  max-width: 420px;
}
.account-form h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
}
.account-text {
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 16px;
}
.account-steps {
  font-size: 13px;
  line-height: 1.8;
  padding-left: 20px;
  margin: 0 0 14px;
}
.account-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.qr-box {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  padding: 6px;
  margin: 0 0 12px;
  line-height: 0;
}
.qr-box svg {
  display: block;
  width: 200px;
  height: auto;
}
.secret-box {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  padding: 14px 16px;
  margin: 0 0 12px;
}
.secret-box code {
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--ink);
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.account-page .technical {
  margin-bottom: 16px;
}
.account-page .code-block {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .stack-table table {
    min-width: 0 !important;
  }
  .stack-table thead {
    display: none;
  }
  .stack-table tr {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
  }
  .stack-table tr:last-child {
    border-bottom: 0;
  }
  .stack-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 6px 0 !important;
    border: 0;
    text-align: right;
    min-width: 0;
    max-width: none;
  }
  .stack-table td::before {
    content: attr(data-label);
    flex: none;
    color: var(--muted);
    font-size: 11px;
    text-align: left;
    padding-top: 2px;
  }
  .stack-table td > .cell {
    min-width: 0;
    text-align: right;
  }
  .stack-table td > .cell .subtle {
    display: block;
  }
  .stack-table td .actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .stack-table td.message {
    overflow-wrap: anywhere;
  }
  .card-head:has(.toolbar) {
    flex-wrap: wrap;
  }
  .card-head:has(.toolbar) h2 {
    flex: none;
  }
  .card-head .toolbar {
    width: 100%;
    flex-wrap: wrap;
  }
  .card-head .toolbar input {
    flex: 1 1 100%;
    min-width: 0;
  }
  .account-layout {
    padding: 20px 16px 40px;
  }
  .account-split {
    grid-template-columns: 1fr;
  }
}

/* First-phone guide: one current action; setup instructions are secondary. */
.guide-wrap { max-width: 940px; margin-inline: auto; }
.guide-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.guide-modes button { text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 16px 20px; cursor: pointer; }
.guide-modes button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.guide-modes strong, .guide-modes span { display: block; }
.guide-modes strong { font-size: 15px; color: var(--ink); }
.guide-modes span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.guide-progress { display: flex; margin: 20px 0 12px; gap: 8px; flex-wrap: wrap; }
.guide-progress button { display: flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--muted); padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 12px; }
.guide-progress button span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line); font-variant-numeric: tabular-nums; }
.guide-progress button[aria-current="step"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.guide-progress button[aria-current="step"] span { color: var(--accent-ink); background: var(--accent); }
.guide-progress button:disabled { cursor: not-allowed; opacity: .5; }
.guide-main { overflow: hidden; }
.guide-body { padding: 28px 32px 24px; min-height: 320px; }
.guide-body h2 { font-size: 24px; line-height: 1.35; text-wrap: balance; margin: 10px 0 18px; }
.guide-body h2:focus { outline: none; }
.guide-lead { font-size: 15px; color: var(--text); margin: 0 0 20px; }
.guide-body p { line-height: 1.8; }
.guide-instructions { padding-left: 23px; margin: 18px 0; }
.guide-instructions li { padding: 5px 0 8px 5px; line-height: 1.8; }
.guide-instructions strong { color: var(--ink); }
.guide-result { padding: 12px 16px; margin-top: 24px; border-left: 3px solid var(--accent); background: var(--raised); font-size: 13px; }
.guide-footer { display: flex; justify-content: space-between; align-items: center; padding: 18px 32px; gap: 12px; background: var(--raised); }
.guide-admin { margin-top: 20px; padding: 16px 20px; font-size: 12px; color: var(--muted); }
.guide-admin summary { cursor: pointer; color: var(--text); }
.guide-admin p { margin: 14px 0; line-height: 1.8; }
.guide-fields { margin: 20px 0; }
.guide-fields div { display: grid; grid-template-columns: 175px 1fr; border-bottom: 1px solid var(--line); padding: 13px 0; gap: 10px; }
.guide-fields dt { color: var(--muted); }
.guide-fields dd { margin: 0; overflow-wrap: anywhere; }
.guide-devices { list-style: none; padding: 0; max-height: 250px; overflow: auto; }
.guide-devices li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.guide-devices span { font-size: 12px; color: var(--muted); }
@media (max-width: 768px) {
 .guide-body { padding: 22px 18px; min-height: 0; }
 .guide-body h2 { font-size: 21px; }
 .guide-modes { gap: 8px; }
 .guide-modes button { padding: 12px; }
 .guide-modes strong { font-size: 13px; }
 .guide-progress { display: grid; grid-template-columns: 1fr 1fr; }
 .guide-progress button { text-align: left; padding: 7px 4px; }
 .guide-footer { padding: 16px 18px; align-items: flex-start; flex-wrap: wrap; }
 .guide-fields div { grid-template-columns: 1fr; gap: 4px; }
 .guide-admin { padding: 12px 4px; }
}

/* Activation and customer handoff: one primary action, stable reading order. */
.activation-history { margin-top:24px; }
.activation-history .card-head { flex-wrap:wrap; gap:12px; }
.guide-fields a { overflow-wrap:anywhere; color:var(--accent); }
.binding-code { font-variant-numeric:tabular-nums; overflow-wrap:anywhere; user-select:all; }
.guide-main h2 { text-wrap:balance; }
@media(max-width:768px){ .activation-history .card-head { align-items:flex-start; } }

/* 0.5: aligned controls, independently scrollable histories, optional onboarding guide. */
:root { --sh-1:none; --sh-2:none; }
select:not([multiple]):not([size]) {
  appearance:none; -webkit-appearance:none;
  padding-right:34px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e7d75' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 11px center; background-size:16px;
}
select:focus { box-shadow:none; }
.history-toolbar {display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap; padding:18px 22px; margin-bottom:16px;}
.history-toolbar .mini-stats {margin:0; padding:0; border:0; background:none; flex-wrap:wrap; gap:24px;}
.history-toolbar .toolbar {margin:0; display:flex; align-items:center; gap:10px;}
.history-toolbar .toolbar label {display:flex; align-items:center; gap:10px; margin:0; white-space:nowrap;}
.history-toolbar select {min-width:140px; height:38px;}
.history-card {overflow:hidden; margin-bottom:20px;}
.history-card .card-head {display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:64px; padding:18px 22px;}
.history-card .card-head h2 {margin:0;}
.history-scroll {max-height:480px; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; scroll-behavior:auto;}
.history-scroll > .table-scroll {overflow:visible;}
.history-scroll table {width:100%;}
.history-scroll thead th {position:sticky; top:0; z-index:1; background:var(--raised);}
.history-scroll th, .history-scroll td {vertical-align:middle;}
.history-scroll .plan-list {padding:18px; margin:0;}
.history-scroll .empty {padding-block:42px;}
.history-pager {display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px 22px; border-top:1px solid var(--line); background:var(--surface);}
.pager-controls {display:flex; align-items:center; gap:10px;}
.pager-controls label {display:flex; align-items:center; gap:8px; margin:0; font-size:12px; color:var(--muted); white-space:nowrap;}
.pager-controls select {width:88px; min-width:0; height:34px; padding-block:4px; padding-left:10px; border:1px solid var(--input); border-radius:var(--r-ctl); background-color:var(--surface);}
.pager-arrow.btn {width:34px; height:34px; min-height:34px; padding:0; display:inline-flex; align-items:center; justify-content:center;}
.pager-arrow svg {width:16px; height:16px; flex-shrink:0;}
.page-index {min-width:50px; text-align:center; font-size:12px; color:var(--text);}
.history-error {padding:12px 22px; background:var(--warn-soft); color:var(--warn); display:flex; align-items:center; justify-content:space-between; gap:12px;}
.connect-workbench {display:grid; grid-template-columns:minmax(0,1fr) 370px; align-items:start; gap:22px;}
.connect-primary, .connect-help {min-width:0;}
.connect-primary > .card {margin-bottom:20px;}
.connect-primary .card-head, .connect-help .card-head {padding:18px 22px; gap:12px; align-items:center;}
.connect-primary .card-body {padding:22px;}
.connect-primary .actions {gap:10px; flex-wrap:wrap;}
.connect-primary .guide-fields div {grid-template-columns:135px 1fr;}
.connect-help .guide-progress {display:grid; grid-template-columns:1fr 1fr; gap:6px; margin:0; padding:12px; border-bottom:1px solid var(--line);}
.connect-help .guide-progress button {padding:8px 6px; gap:6px; text-align:left;}
.connect-help .guide-progress button span {width:22px; height:22px; flex-shrink:0;}
.connect-help .guide-progress svg {margin-left:auto; width:14px; height:14px; flex-shrink:0;}
.connect-help .guide-body {min-height:0; padding:22px;}
.connect-help .guide-body h2 {font-size:18px; margin:10px 0 14px; text-wrap:initial;}
.connect-help .guide-lead {font-size:13px; margin:0 0 14px;}
.connect-help .guide-footer {padding:14px 22px; flex-wrap:wrap;}
.connect-help .guide-footer .btn {font-size:12px; min-height:34px;}
.connect-help .guide-fields div {grid-template-columns:1fr; gap:4px;}
.connect-help .guide-result {margin-top:18px; padding:10px 12px;}
.connect-help .guide-admin {padding:16px; margin-top:16px;}
.connect-primary .activation-history {margin-top:0;}
.activation-history .table-scroll {max-height:340px; overflow:auto; overscroll-behavior:contain;}
.activation-history thead th {position:sticky; top:0; z-index:1; background:var(--raised);}
.guide-modes button {height:100%;}
@media (max-width:1150px) {
 .connect-workbench {grid-template-columns:minmax(0,1fr) 320px; gap:16px;}
 .history-toolbar .mini-stats {gap:16px;}
}
@media (max-width:900px) {
 .connect-workbench {grid-template-columns:1fr;}
 .connect-help .guide-progress {grid-template-columns:repeat(4,1fr);}
 .history-toolbar {align-items:flex-start;}
 .history-scroll {max-height:430px;}
 .history-pager {flex-wrap:wrap; gap:10px;}
}
@media (max-width:600px) {
 .history-toolbar, .history-card .card-head, .history-pager {padding:14px 16px;}
 .history-toolbar .toolbar {width:100%;}
 .history-toolbar .toolbar label {width:100%; justify-content:space-between;}
 .history-toolbar select {flex:1;}
 .pager-controls {width:100%; justify-content:flex-end; gap:8px;}
 .pager-controls label {margin-right:auto;}
 .connect-help .guide-progress {grid-template-columns:1fr 1fr;}
 .connect-primary .card-head, .connect-primary .card-body, .connect-help .guide-body {padding:18px;}
 .connect-primary .guide-fields div {grid-template-columns:1fr;}
}
