:root {
  color-scheme: light dark;
  --bg: light-dark(#f4f6f8, #101820);
  --surface: light-dark(#fff, #19232d);
  --text: light-dark(#172f39, #e8f0f5);
  --muted: light-dark(#586b77, #a4b6c4);
  --line: light-dark(#dfe7eb, #30414e);
  --accent: light-dark(#087b68, #67dec4);
  --on-accent: light-dark(#fff, #102b25);
  --soft: light-dark(#e5f3ed, #203d35);
  --danger: light-dark(#b12e35, #ff9ca2);
  --danger-soft: light-dark(#fff0f0, #3d242b);
  --warn: light-dark(#94580a, #f2c46d);
  --warn-soft: light-dark(#fdf3e2, #3a2f1b);
  --shadow: 0 12px 40px #00000012;
  font:
    14px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background: var(--bg);
}
:root[data-theme="light"] {
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
button:hover,
.button:hover {
  border-color: var(--accent);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.danger {
  color: var(--danger);
  border-color: var(--danger);
}
.ghost {
  border-color: transparent;
  background: transparent;
}
button.link {
  min-height: 0;
  padding: 2px 8px;
  margin-inline-start: 8px;
  font-size: 12px;
  color: var(--accent);
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
input:disabled {
  background: var(--bg);
}
textarea {
  resize: vertical;
  min-height: 100px;
}
input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}
label {
  display: block;
  font-weight: 500;
  margin-bottom: 7px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.035em;
}
h2 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.015em;
}
h3 {
  font-size: 15px;
  font-weight: 600;
}
p {
  margin-top: 8px;
}
small,
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}
.brand-mark {
  flex: none;
  width: 34px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
  font-size: 18px;
}
.boot {
  padding: 70px;
  text-align: center;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  padding: 12px;
  background: var(--surface);
  z-index: 20;
}
.skip-link:focus {
  top: 12px;
}
.shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  padding: 30px 20px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.sidebar nav {
  display: grid;
  gap: 6px;
  margin-top: 38px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
}
.nav-link:hover {
  background: var(--bg);
  color: var(--text);
}
.nav-link[aria-current="page"] {
  background: var(--soft);
  color: var(--accent);
}
/* Each workspace has its own accent so it is never mistaken for another:
   Admin green, Debug magenta, Releases blue, Docs amber. A tab takes
   its accent only while it is the open one; the others (the external Testing
   link too) share one muted color. */
:root {
  --ws-admin: light-dark(#087b68, #67dec4);
  --ws-debug: light-dark(#a8327f, #f2a6d9);
  --ws-releases: light-dark(#1f62c4, #8db8ff);
  --ws-docs: light-dark(#a35a06, #f2b866);
}
.shell[data-workspace="debug"] {
  --accent: var(--ws-debug);
  --on-accent: light-dark(#fff, #40142f);
  --soft: light-dark(#fbe9f4, #42203a);
}
.shell[data-workspace="releases"] {
  --accent: var(--ws-releases);
  --on-accent: light-dark(#fff, #0e2447);
  --soft: light-dark(#e7effc, #1e3358);
}
.shell[data-workspace="docs"] {
  --accent: var(--ws-docs);
  --on-accent: light-dark(#fff, #3d2506);
  --soft: light-dark(#fdf0dc, #46321b);
}
.workspace-tag {
  margin-left: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}
.workspace-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.workspace-switch a {
  padding: 6px 14px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}
.workspace-switch a:hover {
  color: var(--text);
}
.workspace-switch a[aria-current="page"] {
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 1px 3px #0000001f;
}
.nav-icon {
  width: 18px;
  text-align: center;
  font-size: 18px;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 32px;
}
.sidebar-footer p {
  font-size: 12px;
  color: var(--muted);
}
.workspace {
  min-width: 0;
}
.topbar {
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar-right,
.actions,
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.menu-button {
  display: none;
}
.environment {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.connection {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.connection:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 36px 32px 70px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.page-heading p {
  color: var(--muted);
}
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.panel,
.metric {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 24px;
  min-width: 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.metric .value {
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 10px 0 2px;
  font-variant-numeric: tabular-nums;
}
.metric .small {
  color: var(--muted);
}
.metric .growth {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.metric .growth .up {
  color: var(--accent);
  font-weight: 600;
}
.metric .growth .down {
  color: var(--danger, #c0392b);
  font-weight: 600;
}
.metric .metric-tests {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--muted);
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}
.columns {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}
.stack {
  display: grid;
  gap: 20px;
}
.quick-link {
  display: flex;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
}
.quick-link:last-child {
  border: 0;
}
.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 8px;
}
.track {
  height: 8px;
  background: var(--bg);
  border-radius: 8px;
  overflow: hidden;
}
.fill {
  height: 100%;
  background: var(--accent);
}
.toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar .field {
  min-width: 150px;
  flex: 1;
}
.toolbar .search {
  flex: 2;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}
th,
td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th:first-child,
td:first-child {
  padding-left: 0;
}
td:last-child,
th:last-child {
  padding-right: 0;
}
tbody tr:last-child td {
  border-bottom: 0;
}
.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--accent);
  font-weight: 600;
}
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  background: var(--soft);
  color: var(--accent);
}
.badge.neutral {
  background: var(--bg);
  color: var(--muted);
}
.badge.error {
  color: var(--danger);
  background: var(--danger-soft);
}
.pagination {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.empty {
  padding: 32px 18px;
  text-align: center;
  color: var(--muted);
}
.error-box {
  padding: 18px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}
.error-box button {
  margin-top: 12px;
}
.loading {
  min-height: 180px;
  display: grid;
  align-content: center;
  gap: 14px;
}
.skeleton {
  height: 16px;
  border-radius: 6px;
  background: var(--line);
  animation: pulse 1.3s ease-in-out infinite;
}
.skeleton:nth-child(2) {
  width: 75%;
}
.skeleton:nth-child(3) {
  width: 50%;
}
@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.field .hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.span-2 {
  grid-column: 1/-1;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
  margin: 0;
}
.form-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.form-section:first-child {
  padding-top: 0;
}
.form-section h2 {
  margin-bottom: 18px;
}
.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.limit-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.limit-row input[type="number"] {
  max-width: 130px;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.plan-card {
  display: flex;
  flex-direction: column;
}
.plan-card .price {
  font-size: 32px;
  margin: 24px 0 14px;
  font-weight: 500;
}
.plan-card .price small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.plan-card ul {
  padding-left: 18px;
  color: var(--muted);
}
.plan-card .actions {
  margin-top: auto;
  padding-top: 22px;
}
.plan-card .plan-description {
  margin-top: 12px;
  color: var(--muted);
}
.code-label,
code {
  font:
    12px/1.4 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
}
.code-label {
  margin-top: 3px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.details {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr);
  gap: 0;
  margin: 16px 0;
}
.details dt,
.details dd {
  padding: 12px 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.details dt {
  color: var(--muted);
}
.details.compact {
  grid-template-columns: minmax(110px, 1fr) minmax(0, 1.4fr);
  margin-bottom: 12px;
}
.details.compact dt,
.details.compact dd {
  padding: 9px 0;
}
.plan-summary,
.plan-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}
.plan-summary {
  padding: 16px;
  margin: 18px 0;
}
.plan-summary h3,
.plan-preview h3 {
  margin-top: 4px;
  font-size: 17px;
  line-height: 1.3;
}
.plan-summary dl {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(0, 1.6fr);
  gap: 8px 14px;
  margin: 14px 0 0;
}
.plan-summary dt,
.plan-summary dd {
  margin: 0;
}
.plan-summary dt {
  color: var(--muted);
}
.plan-preview {
  padding: 14px;
  margin-top: 12px;
}
.plan-preview .empty {
  margin: 0;
  background: transparent;
  border: 0;
  padding: 8px 0;
}
.plan-preview ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}
.breadcrumb {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: 24px;
}
.detail-panel {
  background: var(--surface);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.detail-panel input {
  margin-bottom: 12px;
}
.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  margin: 24px 0;
}
.snapshot-grid strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-weight: 500;
}
details {
  margin-top: 12px;
}
.trace-guide-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.trace-guide-item:last-child {
  border-bottom: 0;
}
.trace-guide-item summary {
  font-weight: 600;
}
.trace-inline {
  display: flex;
  gap: 8px;
}
.trace-state {
  padding: 16px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.trace-state .details {
  margin-top: 12px;
}
summary {
  cursor: pointer;
  color: var(--accent);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 380px;
  overflow: auto;
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
  font-size: 12px;
}
code {
  overflow-wrap: anywhere;
}
.log-message {
  min-width: 180px;
  overflow-wrap: anywhere;
  max-width: 420px;
}
.onboarding-preview {
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 12px;
  margin-top: 20px;
}
.preview-step {
  display: flex;
  gap: 12px;
  margin: 18px 0;
  align-items: center;
}
.step-number {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--accent);
}
.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-intro {
  background: var(--soft);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
}
.login-intro h1 {
  font-size: clamp(36px, 4.5vw, 64px);
  max-width: 550px;
  line-height: 1.1;
}
.login-intro p {
  max-width: 390px;
  color: var(--muted);
  font-size: 16px;
  margin-top: 24px;
}
.login-intro footer {
  color: var(--muted);
  font-size: 12px;
}
.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--surface);
}
.login-form {
  width: 100%;
  max-width: 380px;
}
.login-form h1 {
  margin-top: 12px;
}
.login-form .field {
  margin-top: 28px;
}
.key-input {
  display: flex;
  gap: 8px;
}
.key-input button {
  flex: none;
}
.login-form .primary {
  width: 100%;
  margin-top: 20px;
}
.login-form .error-box {
  margin-top: 20px;
}
.login-note {
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}
.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}
.session-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 16px;
}
#notifications {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: min(420px, calc(100vw - 48px));
  z-index: 50;
}
.toast {
  border: 1px solid var(--line);
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  width: min(460px, calc(100% - 32px));
  box-shadow: var(--shadow);
}
dialog::backdrop {
  background: #06171d88;
}
dialog p {
  margin: 14px 0 24px;
  overflow-wrap: anywhere;
}
dialog .actions {
  justify-content: flex-end;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
/* Live Trace */
.lt-workspace {
  position: relative;
  display: grid;
  gap: 14px;
}
.lt-context-bar {
  position: sticky;
  top: 16px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}
.lt-picker-wrap {
  position: relative;
  min-width: 0;
}
.lt-user-picker-button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  max-width: min(560px, 60vw);
  padding: 2px;
  border: 0;
  background: transparent;
  text-align: left;
}
.lt-picker-label {
  display: grid;
  min-width: 0;
}
.lt-picker-label strong,
.lt-picker-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-user-picker {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 12;
  width: min(440px, calc(100vw - 320px));
  max-height: min(620px, calc(100vh - 150px));
  padding: 18px;
  box-shadow: var(--shadow);
}
.lt-user-picker > input {
  width: 100%;
  margin-bottom: 10px;
}
.lt-user-picker .lt-user-list {
  max-height: min(340px, 42vh);
  margin-top: 8px;
}
.lt-context-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.lt-action-menu {
  position: absolute;
  top: -64px;
  right: 0;
  z-index: 10;
  display: grid;
  width: 230px;
  padding: 8px;
  box-shadow: var(--shadow);
}
.lt-action-menu button {
  justify-content: flex-start;
}
.lt-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
}
.lt-status-strip strong {
  color: var(--text);
  font-weight: 600;
}
.lt-summary {
  display: grid;
  gap: 8px;
  padding: 14px 18px;
}
.lt-summary-values,
.lt-summary-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.lt-summary-footer {
  justify-content: space-between;
}
.lt-summary-warning {
  color: var(--warn);
}
.lt-tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}
.lt-tab {
  padding: 10px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}
.lt-tab[aria-selected="true"] {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.lt-tab-panel {
  min-width: 0;
}
#live-trace-state-panel {
  display: grid;
  gap: 16px;
}
.lt-access {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.lt-access.has-warning {
  border-color: var(--warn);
  background: var(--warn-soft);
}
.lt-access dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.lt-access dl div,
.lt-state-groups dl div {
  min-width: 0;
}
.lt-access dt,
.lt-state-groups dt {
  color: var(--muted);
  font-size: 12px;
}
.lt-access dd,
.lt-state-groups dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}
.lt-state-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.lt-state-groups section {
  padding: 14px;
  border-radius: 12px;
  background: var(--bg);
}
.lt-state-groups section h3 {
  margin-bottom: 10px;
}
.lt-state-groups dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}
.lt-battery-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.lt-battery-kpis .metric {
  padding: 14px 16px;
}
.lt-filters-main {
  align-items: end;
}
.lt-extra-filters {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
}
.lt-event-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}
.lt-event-workspace.has-inspector {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 38%);
  align-items: start;
}
.lt-event-inspector {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 18px;
}
.lt-event-inspector pre {
  max-height: 420px;
}
.lt-event-body > button {
  min-height: 28px;
  margin-top: 4px;
  padding: 2px 0;
}
.lt-sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 45;
}
.lt-sheet-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #06171d88;
}
.lt-settings-sheet {
  position: absolute;
  top: 20px;
  right: 20px;
  bottom: 20px;
  width: min(520px, calc(100% - 40px));
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow);
}
.lt-settings-sheet hr {
  width: 100%;
  margin: 4px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.lt-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.lt-rail {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 14px;
  padding: 20px;
  max-height: calc(100vh - 48px);
  grid-template-rows: auto minmax(0, 1fr);
}
.lt-rail-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.lt-rail-head h2 {
  font-size: 16px;
  margin-right: auto;
}
.lt-rail-head {
  justify-content: flex-start;
  align-items: center;
}
.lt-rail-toggle {
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
  font-size: 16px;
  line-height: 1;
}
.lt-rail-body {
  display: grid;
  gap: 14px;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
/* Collapsed: the rail shrinks to its toggle and the detail takes the width. */
.lt-layout.rail-collapsed {
  grid-template-columns: 56px minmax(0, 1fr);
}
.rail-collapsed .lt-rail {
  padding: 12px;
  grid-template-rows: auto;
}
.rail-collapsed .lt-rail-body,
.rail-collapsed .lt-rail-head h2,
.rail-collapsed #live-trace-count {
  display: none;
}
.lt-export {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.lt-export-spacer {
  flex: 1;
}
.lt-export select {
  width: auto;
}
.lt-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 500;
}
.lt-select {
  margin-top: 3px;
}
.lt-segments {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  gap: 3px;
  border-radius: 10px;
  background: var(--bg);
}
.lt-segments button {
  min-height: 32px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.lt-segments button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px #0000001f;
}
.lt-user-list {
  overflow-y: auto;
  margin: 0 -8px;
}
.lt-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
}
.lt-user:hover {
  background: var(--bg);
}
.lt-user[aria-current="true"] {
  background: var(--soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.lt-user-text,
.lt-user-meta {
  display: grid;
  min-width: 0;
}
.lt-user-text strong,
.lt-user-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lt-user-text strong {
  font-weight: 600;
}
.lt-user-meta {
  justify-items: end;
  gap: 2px;
}
.lt-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
}
.lt-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.lt-pill.on::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--soft);
}
.lt-note {
  padding: 8px;
}
.lt-open {
  display: grid;
  gap: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.lt-open .trace-inline input {
  min-width: 0;
}
.lt-detail {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.lt-placeholder {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 64px 24px;
  text-align: center;
}
.lt-placeholder p {
  max-width: 420px;
}
.lt-placeholder-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
}
.lt-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
}
.lt-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.lt-identity .avatar {
  width: 44px;
  height: 44px;
  font-size: 18px;
}
.lt-identity h2 {
  font-size: 18px;
  overflow-wrap: anywhere;
}
.lt-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.lt-kpis .metric {
  padding: 18px 20px;
}
.lt-kpi-value {
  margin: 6px 0 2px;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.lt-kpi-of {
  color: var(--muted);
  font-weight: 400;
}
.lt-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.lt-grid h3,
.lt-detail h3 {
  font-size: 15px;
}
.lt-tight {
  margin-bottom: 14px;
}
.lt-policy {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}
.lt-policy fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
.lt-policy legend {
  margin-bottom: 8px;
}
.lt-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.lt-level {
  position: relative;
  margin: 0;
  cursor: pointer;
}
.lt-level input {
  position: absolute;
  opacity: 0;
}
.lt-level > span {
  display: grid;
  gap: 2px;
  height: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.lt-level input:checked + span {
  border-color: var(--accent);
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.lt-level input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.danger-ghost {
  color: var(--danger);
}
.danger-ghost:hover:not(:disabled) {
  background: var(--danger-soft);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.lt-state {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.lt-state div {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  min-width: 0;
}
.lt-state dt {
  color: var(--muted);
  font-size: 12px;
}
.lt-state dd {
  margin: 2px 0 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.lt-devices {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lt-devices li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.lt-devices strong {
  overflow-wrap: anywhere;
}
.lt-device-icon {
  color: var(--muted);
  font-size: 18px;
}
.lt-filters .field {
  min-width: 120px;
}
.lt-timeline {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.lt-day {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px 0 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lt-event {
  display: grid;
  grid-template-columns: auto 84px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0 12px 14px;
  border-bottom: 1px solid var(--line);
  box-shadow: inset 3px 0 0 var(--line);
}
.lt-event.warn {
  box-shadow: inset 3px 0 0 var(--warn);
}
.lt-event.error {
  box-shadow: inset 3px 0 0 var(--danger);
  background: linear-gradient(90deg, var(--danger-soft), transparent 40%);
}
.lt-event time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.lt-event-body {
  min-width: 0;
}
.lt-event-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}
.lt-event-title .log-message {
  min-width: 0;
  max-width: none;
}
.lt-event details {
  margin-top: 6px;
}
.lt-event details details {
  margin-left: 12px;
}
.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.lt-more {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.lt-guide {
  margin-top: 24px;
  padding: 18px 24px;
}
.lt-guide details {
  margin: 0;
}
.lt-guide summary {
  font-weight: 600;
}
.lt-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 24px;
  margin-top: 16px;
}
.lt-guide-grid h3 {
  font-size: 14px;
  margin-bottom: 4px;
}
@media (max-width: 1280px) {
  .lt-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .lt-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 1100px) {
  .lt-layout,
  .lt-layout.rail-collapsed {
    grid-template-columns: 1fr;
  }
  .rail-collapsed .lt-rail-head h2 {
    display: block;
  }
  .lt-rail {
    position: static;
    max-height: none;
  }
  .lt-user-list {
    max-height: 320px;
  }
}
@media (max-width: 760px) {
  .lt-levels {
    grid-template-columns: 1fr;
  }
  .lt-state {
    grid-template-columns: 1fr 1fr;
  }
  .lt-event {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .lt-event .lt-select {
    grid-row: span 2;
  }
  .lt-event time {
    grid-column: 2 / -1;
  }
  .lt-header {
    padding: 16px;
  }
}
@media (max-width: 380px) {
  .lt-kpis,
  .lt-levels,
  .lt-state {
    grid-template-columns: 1fr;
  }
}

/* Live Trace responsive overrides are kept last so the compact context bar
   wins over the generic mobile panel padding. */
@media (max-width: 1280px) {
  .lt-battery-kpis,
  .lt-access dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .lt-user-picker {
    width: min(440px, calc(100vw - 90px));
  }
  .lt-context-bar {
    top: 10px;
  }
  .lt-event-workspace.has-inspector {
    grid-template-columns: 1fr;
  }
  .lt-event-inspector {
    position: static;
    max-height: none;
  }
}
@media (max-width: 760px) {
  .lt-context-bar {
    position: static;
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }
  .lt-user-picker-button {
    max-width: 100%;
    width: 100%;
  }
  .lt-user-picker {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 10px;
    box-shadow: none;
  }
  .lt-user-picker .lt-user-list {
    max-height: 320px;
  }
  .lt-context-actions {
    justify-content: flex-start;
  }
  .lt-action-menu {
    top: -54px;
    width: min(230px, 100%);
  }
  .lt-tabs {
    gap: 14px;
    overflow-x: auto;
  }
  .lt-tab {
    white-space: nowrap;
  }
  .lt-state-groups,
  .lt-state-groups dl,
  .lt-battery-kpis,
  .lt-access dl {
    grid-template-columns: 1fr;
  }
  .lt-settings-sheet {
    top: 10px;
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    padding: 20px;
  }
  .lt-status-strip {
    gap: 6px 14px;
  }
  .lt-summary {
    padding: 14px;
  }
  .lt-event {
    padding-left: 8px;
  }
}
@media (min-width: 1100px) {
  .detail-panel {
    position: sticky;
    top: 24px;
    align-self: start;
  }
}
@media (max-width: 1100px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .columns,
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-panel {
    grid-row: 1;
  }
  .shell {
    grid-template-columns: 195px minmax(0, 1fr);
  }
  .sidebar {
    padding: 24px 14px;
  }
  main {
    padding: 28px 22px;
  }
  .topbar {
    padding: 16px 22px;
  }
}
@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
    height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar.open {
    display: flex;
  }
  .sidebar nav {
    margin-top: 20px;
    grid-template-columns: 1fr 1fr;
  }
  .sidebar-footer {
    display: none;
  }
  .menu-button {
    display: inline-flex;
  }
  /* Phone: the workspace tabs first, then the page menu button beside
     Sign out; the page menu opens under the bar, above the content. */
  .shell {
    display: flex;
    flex-direction: column;
  }
  .workspace {
    display: contents;
  }
  .topbar {
    order: 0;
    padding: 12px 18px;
  }
  .sidebar {
    order: 1;
  }
  main {
    order: 2;
  }
  .topbar > .row {
    display: contents;
  }
  .topbar .workspace-switch {
    order: -1;
    flex-basis: 100%;
    max-width: 100%;
    overflow-x: auto;
  }
  .topbar-right {
    margin-left: auto;
  }
  .topbar .eyebrow {
    display: none;
  }
  main {
    padding: 24px 18px 48px;
  }
  .login-layout {
    grid-template-columns: 1fr;
  }
  .login-intro {
    padding: 30px;
    gap: 32px;
  }
  .login-intro h1 {
    font-size: 36px;
  }
  .login-intro footer {
    display: none;
  }
  .login-main {
    padding: 36px 24px;
  }
  .login-form {
    max-width: 460px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .span-2 {
    grid-column: auto;
  }
  .panel,
  .detail-panel {
    padding: 20px;
  }
  .plan-grid {
    grid-template-columns: 1fr;
  }
  .environment {
    display: none;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar .field {
    min-width: 130px;
  }
}
@media (max-width: 380px) {
  .metrics {
    grid-template-columns: 1fr;
  }
  .topbar-right {
    gap: 6px;
  }
  .connection {
    font-size: 11px;
  }
  h1 {
    font-size: 26px;
  }
  .form-footer .actions {
    width: 100%;
  }
  .login-intro {
    padding: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badges .badge {
  white-space: nowrap;
}
.badge.admin {
  background: var(--warn-soft);
  color: var(--warn);
}
.role-switch {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.role-switch h3 {
  margin: 0 0 4px;
  font-size: 15px;
}
.role-switch p {
  margin: 0;
}
button.switch {
  flex: none;
  position: relative;
  width: 48px;
  height: 28px;
  min-height: 0;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--line);
  transition: background 0.15s ease;
}
button.switch .switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px #0003;
  transition: transform 0.15s ease;
}
button.switch[aria-checked="true"] {
  background: var(--accent);
  border-color: var(--accent);
}
button.switch[aria-checked="true"] .switch-thumb {
  transform: translateX(20px);
}
@media (prefers-reduced-motion: reduce) {
  button.switch,
  button.switch .switch-thumb {
    transition: none;
  }
}

.lt-battery-chart {
  display: block;
  width: 100%;
  height: 120px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.lt-battery-chart polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}
.lt-battery-charging {
  fill: var(--warn-soft);
}
.lt-battery-axis {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.lt-battery-warning {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--warn);
  background: var(--warn-soft);
}

.translation {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin-top: 12px;
}
.translation summary {
  cursor: pointer;
  font-weight: 600;
}
.translation .form-grid {
  margin-top: 12px;
}

.translation-status {
  margin: 12px 0;
  line-height: 2;
}
@media (max-width: 760px) {
  .lt-context-bar,
  .lt-summary {
    padding: 14px;
  }
}

/* Person timeline */
.tl-chips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0 20px;
}
.tl-chips div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tl-chips dt {
  color: var(--muted);
  font-size: 12px;
}
.tl-chips dd {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 600;
}
.tl-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tl-day {
  padding: 14px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.tl-item {
  display: grid;
  grid-template-columns: 76px 14px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.tl-item time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.tl-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--muted);
}
.tl-place .tl-dot,
.tl-sent .tl-dot {
  background: var(--accent);
}
.tl-move .tl-dot {
  background: light-dark(#2f7fd1, #8cc4ff);
}
.tl-signal .tl-dot,
.tl-car .tl-dot {
  background: light-dark(#0f8a7e, #6fe0d0);
}
.tl-car .tl-dot {
  border-radius: 3px;
}
.tl-warn .tl-dot {
  background: var(--warn);
}
.tl-error .tl-dot {
  background: var(--danger);
}
.tl-error strong {
  color: var(--danger);
}
.tl-system .tl-dot {
  background: transparent;
  border: 2px solid var(--muted);
}
.tl-subhead {
  margin: 8px 0 4px;
  font-size: 14px;
}
.tl-subhead + p + .table-wrap {
  margin-bottom: 16px;
}
/* Support */
.support-message {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.nav-count {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.support-reply {
  margin: 10px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
  border-radius: 8px;
}
.support-reply p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.support-reply-form {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}
.support-reply-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
}
.support-tabs {
  flex-wrap: wrap;
  gap: 8px;
}
.support-device {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 24px;
}
.support-pre {
  max-height: 420px;
  overflow: auto;
  font-size: 12px;
}
.support-reply.from-customer {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}

/* Plan editor */
.pe-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}
.pe-main {
  display: grid;
  gap: 20px;
  min-width: 0;
}
.pe-card {
  padding: 24px;
}
.pe-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}
.pe-head h2 {
  margin: 0 0 4px;
}
.pe-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.pe-step {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}
.pe-row {
  margin-top: 18px;
}
.status-picker {
  border: 0;
  padding: 0;
  margin: 20px 0 0;
}
.status-picker legend {
  font-weight: 600;
  margin-bottom: 8px;
}
.segmented,
.type-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.type-tiles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.seg,
.tile {
  position: relative;
  margin: 0;
  cursor: pointer;
}
.seg input,
.tile input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.seg span,
.tile span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-weight: 400;
  transition: border-color 0.15s, background 0.15s;
}
.seg small,
.tile small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.seg input:checked + span,
.tile input:checked + span {
  border-color: var(--accent);
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.seg-hidden input:checked + span {
  border-color: var(--muted);
  background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--muted);
}
.seg-expired input:checked + span {
  border-color: var(--warn);
  background: var(--warn-soft);
  box-shadow: inset 0 0 0 1px var(--warn);
}
.seg input:focus-visible + span,
.tile input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--soft);
  font-size: 14px;
  line-height: 1.45;
}
.notice.warn {
  background: var(--warn-soft);
  color: var(--text);
  border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
}
.store-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.store-block {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
}
.store-block.off .field,
.store-block.off #google-summary {
  opacity: 0.55;
}
.store-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.store-head h3 {
  margin: 0 0 2px;
}
.store-summary-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg);
}
.ss-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.ss-price {
  text-align: right;
  font-weight: 700;
  font-size: 18px;
  white-space: nowrap;
}
.ss-price small {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}
.ss-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  white-space: nowrap;
}
.chip.ok {
  border-color: transparent;
  background: var(--soft);
  color: var(--accent);
}
.chip.warn {
  border-color: transparent;
  background: var(--warn-soft);
  color: var(--warn);
}
.fallback {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.fallback summary {
  cursor: pointer;
  font-weight: 600;
}
.fallback .form-grid {
  margin-top: 14px;
}
.lang-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.lang-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  padding: 10px 14px;
  color: var(--muted);
  white-space: nowrap;
}
.lang-tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}
.dot.on {
  background: var(--accent);
}
.lang-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.lang-col {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}
.lang-col h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 15px;
}
.play-col {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.counter {
  float: right;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
}
.benefits {
  display: grid;
  gap: 8px;
}
.lang-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.pe-side {
  position: sticky;
  top: 24px;
}
.pe-summary {
  display: grid;
  gap: 16px;
}
.preview-card {
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--soft), var(--surface));
  border: 1px solid var(--line);
}
.preview-card h3 {
  margin: 10px 0 2px;
}
.preview-card p {
  margin: 0;
  font-size: 13px;
}
.preview-card .price {
  margin: 12px 0 4px;
  font-size: 20px;
  font-weight: 700;
}
.preview-card .price small {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.preview-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
}
.readiness {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 13px;
}
.readiness li {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.readiness span {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}
.readiness .ok span {
  background: var(--soft);
  color: var(--accent);
}
.readiness .todo span {
  background: var(--warn-soft);
  color: var(--warn);
}
.pe-save {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.pe-save .actions {
  justify-content: flex-end;
}
dialog.store-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: min(86vh, 900px);
  overflow: auto;
  padding: 0;
}
.sd-inner {
  padding: 0 28px 28px;
}
.sd-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  margin: 0 -28px;
  padding: 12px 12px 0;
  height: 0;
  overflow: visible;
}
.sd-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.store-dialog #store-dialog-body,
.store-dialog .sd-body {
  padding-top: 28px;
}
.store-dialog #store-dialog-body h2,
.store-dialog .sd-body h2 {
  padding-right: 44px;
}
.store-dialog > .sd-inner > .actions {
  justify-content: flex-end;
  margin-top: 20px;
}
.store-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 22px 0 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 17px;
}
.dialog-section {
  margin: 24px 0 10px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.dialog-block {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.dialog-block h3 {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
}
.dialog-block p {
  margin: 0 0 8px;
  white-space: pre-line;
}
.price-table {
  max-height: 260px;
  overflow: auto;
  margin-top: 8px;
}
.store-summary {
  margin-top: 4px;
}
@media (max-width: 1100px) {
  .pe-layout {
    grid-template-columns: 1fr;
  }
  .pe-side {
    position: static;
  }
}
@media (max-width: 760px) {
  .type-tiles,
  .segmented,
  .store-grid,
  .lang-cols {
    grid-template-columns: 1fr;
  }
  .play-col {
    padding-left: 0;
    border-left: 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
  }
}
/* Plan editor sections open one at a time */
.pe-card .pe-head {
  cursor: pointer;
  align-items: center;
  margin: -8px -8px 12px;
  padding: 8px;
  border-radius: 12px;
}
.pe-card .pe-head:hover {
  background: var(--bg);
}
.pe-card .pe-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.pe-card .pe-head > div {
  min-width: 0;
}
.pe-sum {
  margin-left: auto;
  max-width: 45%;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pe-card:not(.collapsed) .pe-sum {
  display: none;
}
.pe-chevron {
  flex: none;
  width: 10px;
  height: 10px;
  margin: 0 6px 0 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 0.15s;
}
.pe-card.collapsed .pe-chevron {
  transform: rotate(-45deg);
}
.pe-card:not(.collapsed) .pe-chevron {
  margin-left: auto;
}
.pe-card.collapsed {
  padding-top: 16px;
  padding-bottom: 16px;
}
.pe-card.collapsed .pe-head {
  margin-bottom: -8px;
}
.pe-card.collapsed .pe-head p {
  display: none;
}
.pe-card.collapsed .pe-body {
  display: none;
}
@media (max-width: 760px) {
  .pe-sum {
    display: none;
  }
}

.plans-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.plans-toolbar .small {
  margin-left: auto;
}
.sync-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.sync-row .actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.sync-row select {
  max-width: 260px;
}
.notice.ok {
  border-color: var(--ok, #2e7d32);
}
@media (max-width: 640px) {
  .sync-row {
    flex-direction: column;
    align-items: stretch;
  }
  .plans-toolbar .small {
    margin-left: 0;
  }
}

.sub-history {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.timeline li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 2px 12px;
}
.timeline li .small:last-child {
  grid-column: 2;
}

/* Speed tab: one colour per mode, from the timeline's palette. */
.sp-walking { --sp: var(--accent); }
.sp-running { --sp: var(--warn); }
.sp-driving { --sp: light-dark(#2f7fd1, #8cc4ff); }
.sp-moving { --sp: light-dark(#0f8a7e, #6fe0d0); }
.sp-still { --sp: var(--line); }
.sp-strip {
  display: flex;
  gap: 1px;
  height: 10px;
  min-width: 120px;
  margin-bottom: 4px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg);
}
.sp-strip span {
  flex: 1 1 0;
  min-width: 2px;
  background: var(--sp);
}
.sp-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.sp-mode::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sp);
}
.sp-day th {
  background: var(--bg);
  color: var(--muted);
  font-weight: 600;
  text-align: left;
}
.sp-samples {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

/* Big lists on a person's card: closed until opened, loaded then. */
details.lazy > summary {
  cursor: pointer;
  padding: 4px 0;
}
details.lazy[open] > summary {
  margin-bottom: 12px;
}
details.lazy > .lazy-body > .panel:first-child {
  margin-top: 0;
}

/* A banner that opens the release walkthrough in a new window. */
.release-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--soft);
  color: var(--text);
  text-decoration: none;
}
.release-guide > span:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.release-guide:hover {
  background: var(--surface);
}
.release-guide:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Release walkthrough: route, stages, timeline, share charts. */
.rd-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}
.rd-node {
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  min-width: 0;
  max-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.rd-node.rd-go {
  border-color: var(--accent);
  background: var(--soft);
}
.rd-arrow {
  align-self: center;
  color: var(--muted);
}
.rd-flow > .rd-node,
.rd-flow > .rd-lanes {
  flex: 1 1 150px;
  max-width: none;
}
.rd-lanes .rd-node {
  max-width: none;
}
.rd-lanes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rd-android {
  border-left: 4px solid var(--accent);
}
.rd-ios {
  border-left: 4px solid var(--warn);
}
.rd-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.rd-stage {
  display: flex;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  min-width: 0;
}
.rd-stage h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}
.rd-stage dl {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
}
.rd-stage dl div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
}
.rd-stage dt {
  color: var(--muted);
  font-size: 0.8rem;
}
.rd-stage dd {
  margin: 0;
}
.rd-stage p {
  margin: 0;
}
.rd-n {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}
.rd-gantt {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
}
.rd-days,
.rd-row {
  display: grid;
  grid-template-columns: 70px minmax(560px, 1fr);
  gap: 8px;
  align-items: center;
}
.rd-axis,
.rd-track {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 2px;
}
.rd-axis span {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.rd-label {
  font-weight: 700;
  font-size: 0.85rem;
}
.rd-bar {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
}
.rd-a1, .rd-i1 { background: var(--soft); color: var(--text); }
.rd-a2, .rd-i2 { background: color-mix(in srgb, var(--accent) 35%, var(--surface)); color: var(--text); }
.rd-a3, .rd-i3 { background: color-mix(in srgb, var(--accent) 70%, var(--surface)); color: var(--on-accent); }
.rd-a4, .rd-i4 { background: var(--accent); color: var(--on-accent); }
.rd-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 10px;
}
.rd-key {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 3px;
  vertical-align: -1px;
}
.rd-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 12px;
}
.rd-pair h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
}
.rd-share {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 170px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
}
.rd-share > div {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  font-size: 0.8rem;
}
.rd-fill {
  width: 100%;
  border-radius: 6px 6px 0 0;
  background: var(--accent);
}
.rd-checks {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.rd-checks li {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.rd-checks li:last-child {
  border-bottom: 0;
}
@media (max-width: 600px) {
  .rd-node {
    max-width: none;
    flex: 1 1 100%;
  }
  .rd-arrow {
    display: none;
  }
  .rd-checks li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Releases page: the store tables get a full row each; forms sit below their text. */
#release-stores .rd-pair {
  grid-template-columns: 1fr;
}
#release-forms .panel p.muted + form {
  margin-top: 14px;
}

/* Releases: the versions in the stores on the left, what can be done with the
   picked one on the right. */
.rel-layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 20px;
  margin-top: 12px;
  align-items: start;
}
.rel-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 640px;
  overflow-y: auto;
}
.rel-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.rel-item[aria-current="true"] {
  border-color: var(--accent);
  background: var(--soft);
}
.rel-new strong {
  color: var(--accent);
}
.rel-detail h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}
.rel-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.rel-block h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}
.rel-block form {
  margin-top: 12px;
}
@media (max-width: 760px) {
  .rel-layout {
    grid-template-columns: 1fr;
  }
  .rel-list {
    max-height: 260px;
  }
}

.rel-intro {
  margin: 12px 0 0;
  max-width: 78ch;
}
.rel-explain {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--soft);
  font-size: 13px;
}
.rel-explain ol {
  margin: 6px 0 0;
  padding-left: 18px;
}
.rel-detail > h3 + p {
  margin-top: 0;
}
.rel-explain + form,
.rel-detail > form {
  margin-top: 16px;
}
.rel-item {
  flex: none;
}
.rel-group {
  margin: 12px 0 2px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.rel-new + .rel-group {
  margin-top: 16px;
}
@media (max-width: 900px) {
  .rel-layout {
    grid-template-columns: 1fr;
  }
}
.rel-new-pane {
  margin-top: 16px;
  max-width: 760px;
}
.rel-new-pane h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}
#release-forms .lt-tabs {
  margin-top: 12px;
}

/* Release page: the tracks a version is on, as a bordered table. */
.rel-tracks {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0 12px;
}
.rel-tracks table {
  font-size: 13px;
}
.rel-tracks th,
.rel-tracks td {
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.rel-tracks th {
  background: var(--bg);
}
.rel-tracks th + th,
.rel-tracks td + td {
  border-left: 1px solid var(--line);
}
.rel-tracks tbody tr:last-child td {
  border-bottom: 0;
}

/* Live Trace report: lanes on one time axis. Its colors are the palette's. */
:root {
  --rep-gps: var(--danger);
  --rep-start: var(--warn);
  --rep-move: var(--ws-admin);
  --rep-walk: var(--ws-releases);
  --rep-drive: var(--ws-debug);
  --rep-wifi: var(--ws-releases);
  --rep-app: var(--ws-docs);
}
.rep-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 12px 0 16px;
}
.rep-controls .actions {
  margin: 0;
}
.rep-figs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
.rep-fig {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
}
.rep-fig dt {
  color: var(--muted);
  font-size: 12px;
}
.rep-fig dd {
  margin: 2px 0;
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rep-fig.bad {
  border-color: var(--danger);
}
.rep-fig.bad dd {
  color: var(--danger);
}
.rep-fig.warn dd {
  color: var(--warn);
}
.rep-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.rep-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rep-chips button {
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
}
.rep-chips .rep-reset {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
}
.rep-chips .rep-reset[hidden] {
  display: none;
}
.rep-chart svg {
  user-select: none;
}
.rep-chips button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.rep-chart {
  overflow-x: auto;
  cursor: crosshair;
}
.rep-chart text {
  font-size: 11px;
  fill: var(--muted);
}
.rep-chart .rep-label {
  fill: var(--text);
  font-size: 12px;
  font-weight: 500;
}
.rep-chart .rep-group {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.rep-chart .rep-note {
  font-size: 10px;
}
.rep-chart .rep-in {
  fill: var(--text);
  font-size: 10px;
}
.rep-key i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin: 0 3px 0 6px;
  vertical-align: -1px;
}
.rep-tip {
  position: fixed;
  z-index: 50;
  width: 290px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow), 0 4px 14px #0000002a;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
}
.rep-tip dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1px 10px;
  margin: 0;
}
.rep-tip dt {
  color: var(--muted);
}
.rep-tip dd {
  margin: 0;
}
.rep-when {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.rep-evs {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}
.rep-devices {
  margin-top: 20px;
}
.rep-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rep-pct {
  font-variant-numeric: tabular-nums;
}
.rep-logic {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.rep-logic > div {
  max-width: 80ch;
  min-width: 0;
}
.motion-logic {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 3px 3px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
.motion-logic button {
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.motion-logic button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}
.rep-export {
  display: inline-flex;
  gap: 8px;
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
/* Report as PDF: only the report, on a landscape page. */
.rep-print-title,
#rep-print-parts {
  display: none;
}
body.printing-report #rep-print-parts {
  display: block;
}
@media print {
  body.printing-report .rep-print-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    font-size: 14px;
  }
  @page {
    size: A4 landscape;
    margin: 10mm;
  }
  body.printing-report {
    background: #fff;
  }
  body.printing-report .sidebar,
  body.printing-report .topbar,
  body.printing-report .page-heading,
  body.printing-report .lt-context-bar,
  body.printing-report #person-health,
  body.printing-report .lt-tabs,
  body.printing-report .lt-summary,
  body.printing-report .lt-status-strip,
  body.printing-report #person-report > .section-title,
  body.printing-report .rep-controls,
  body.printing-report .rep-chips,
  body.printing-report .rep-bar span,
  body.printing-report .rep-logic button,
  body.printing-report .rep-tip,
  body.printing-report .lt-tab-panel:not(#live-trace-report-panel) {
    display: none !important;
  }
  body.printing-report .shell,
  body.printing-report .workspace,
  body.printing-report main {
    display: block;
    margin: 0;
    padding: 0;
  }
  body.printing-report .panel {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  body.printing-report .rep-chart {
    overflow: visible;
  }
  body.printing-report .rep-devices {
    break-before: page;
  }
  body.printing-report #rep-chart,
  body.printing-report .rep-bar {
    display: none !important;
  }
  body.printing-report .rep-print-part {
    break-before: page;
  }
  body.printing-report .rep-print-part h3 {
    display: flex;
    justify-content: space-between;
    margin: 0 0 8px;
    font-size: 15px;
  }
  body.printing-report .rep-print-part h3 span {
    font-weight: 400;
    color: var(--muted);
  }
  body.printing-report .rep-part-figs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin: 0 0 10px;
  }
  body.printing-report .rep-part-figs div {
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
  }
  body.printing-report .rep-part-figs dt {
    color: var(--muted);
    font-size: 11px;
  }
  body.printing-report .rep-part-figs dd {
    margin: 0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }
  body.printing-report * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

.topbar {
  position: relative;
}
.admin-prefs {
  position: absolute;
  top: calc(100% + 8px);
  right: 32px;
  z-index: 40;
  width: min(420px, calc(100vw - 32px));
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 12px 32px rgb(0 0 0 / 25%);
}
.admin-prefs[hidden] {
  display: none;
}
.admin-prefs h3 {
  margin: 20px 0 8px;
}
.settings-search {
  margin-bottom: 16px;
}
.settings-search input {
  width: 100%;
}
.setting-block {
  margin-top: 0;
  padding: 0;
}
.setting-block[hidden] {
  display: none;
}
.setting-block > summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 24px;
  color: inherit;
  list-style: none;
}
.setting-block > summary::-webkit-details-marker {
  display: none;
}
.setting-block > summary::after {
  content: "⌄";
  position: absolute;
  right: 24px;
  font-size: 18px;
  color: var(--muted);
}
.setting-block {
  position: relative;
}
.setting-block[open] > summary::after {
  content: "⌃";
}
.setting-title {
  font-weight: 600;
  font-size: 16px;
}
.setting-desc {
  color: var(--muted);
  font-size: 13px;
  padding-right: 28px;
}
.setting-body {
  padding: 0 24px 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.offer-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.offer-list li + li {
  margin-top: 6px;
}

/* Google Play and App Store marks beside their names. */
.store-icon {
  display: inline-block;
  vertical-align: -3px;
  flex: none;
}
button .store-icon + .store-icon { margin-left: 2px; }

/* One user: a head with a find-anyone box, the account in two columns. */
.user-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.user-head-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.user-head h2 {
  margin: 0 0 6px;
}
.user-jump {
  position: relative;
  flex: 1 1 280px;
  max-width: 420px;
}
.user-jump input {
  width: 100%;
  margin: 0;
}
.jump-results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgb(0 0 0 / 0.25);
  overflow: hidden;
}
.jump-results a {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
}
.jump-results a:hover,
.jump-results a:focus-visible {
  background: var(--line);
}
.user-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 24px;
  align-items: start;
}
.user-main {
  display: grid;
  gap: 16px;
}
.user-side {
  position: sticky;
  top: 24px;
}
.user-side-card,
.fold {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.user-side-card {
  padding: 20px;
}
.fold > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.fold > summary::-webkit-details-marker {
  display: none;
}
.fold > summary::before {
  content: "›";
  display: inline-block;
  margin-right: 10px;
  transition: transform 0.15s;
}
.fold[open] > summary::before {
  transform: rotate(90deg);
}
.fold > summary > span:first-child {
  flex: 1;
}
.fold-body {
  padding: 0 20px 20px;
}
.fold-body input,
.fold-body select {
  margin-bottom: 12px;
}
.usage-row {
  margin-bottom: 14px;
}
.usage-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.usage-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.usage-bar span {
  display: block;
  height: 100%;
  background: var(--accent, #00b3a4);
}
@media (max-width: 1100px) {
  .user-columns {
    grid-template-columns: 1fr;
  }
  .user-side {
    position: static;
    order: -1;
  }
}
.user-side {
  display: grid;
  gap: 16px;
}
.uid-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  word-break: break-all;
}
.user-side {
  position: static;
}
.metrics.mini {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 0;
}
.metrics.mini .metric {
  padding: 10px 12px;
}
.metrics.mini .value {
  font-size: 26px;
}

/* Notifications page: sections of events, three switches per event. */
.nt-section {
  padding-bottom: 8px;
}
.nt-head,
.nt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, 92px);
  gap: 12px;
  align-items: center;
}
.nt-head {
  margin-top: 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted, #8a93a2);
  font-size: 12px;
  text-align: center;
}
.nt-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.nt-row:last-child {
  border-bottom: 0;
}
.nt-name p {
  margin: 2px 0 0;
}
.nt-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.nt-label {
  display: none;
  font-size: 12px;
  color: var(--muted, #8a93a2);
}
.nt-none {
  color: var(--muted, #8a93a2);
  opacity: 0.5;
}
.nt-extra {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
  font-size: 13px;
}
.nt-extra input,
.nt-extra select {
  width: auto;
  min-width: 90px;
}
.nt-extra .field {
  margin: 0;
}
button.switch:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
@media (max-width: 720px) {
  .nt-head {
    display: none;
  }
  .nt-row {
    grid-template-columns: repeat(3, 1fr);
  }
  .nt-name {
    grid-column: 1 / -1;
  }
  .nt-label {
    display: block;
  }
}

/* Release forms (MAHRAM-206): flat groups, draft or publish picked each time,
   one summary line above the start button. */
.rel-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.rel-box {
  margin: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
}
.rel-box > legend {
  padding: 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.rel-mode {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.rel-mode > legend {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
}
.segmented.rel-seg-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.seg-publish input:checked + span {
  border-color: var(--warn);
  background: var(--warn-soft);
  box-shadow: inset 0 0 0 1px var(--warn);
}
.rel-mode-missing .seg span {
  border-color: var(--danger);
}
.rel-mode-hint {
  color: var(--danger);
}
.rel-more {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}
.rel-more > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.rel-more[open] > summary {
  margin-bottom: 8px;
}
.rel-more ol {
  margin: 0;
  padding-left: 18px;
}
.rel-go {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.rel-summary {
  margin: 0;
  flex: 1 1 260px;
  padding: 8px 12px;
  border-radius: 10px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
  font-size: 13px;
}
.rel-summary[data-tone="warn"] {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}
.rel-summary[data-tone="danger"] {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}
.rel-summary[data-tone="missing"] {
  border-left-color: var(--line);
  background: var(--bg);
  color: var(--muted);
}
.rel-summary:empty {
  display: none;
}

/* The release confirmation: its top edge and button take the tone. */
.rel-confirm {
  border-top: 4px solid var(--accent);
}
.rel-confirm-warn {
  border-top-color: var(--warn);
}
.rel-confirm-danger {
  border-top-color: var(--danger);
}
.rel-confirm-list {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
}
.rel-confirm-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.rel-confirm-list dt {
  color: var(--muted);
}
.rel-confirm-list dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}
.warn-solid {
  background: var(--warn);
  border-color: var(--warn);
  color: var(--surface);
}
.danger-solid {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--surface);
}

/* A run that did not do its job, said on top of the runs. */
.rel-problem {
  margin-top: 16px;
  border-color: var(--danger);
}
.rel-problem ul {
  margin: 4px 0 8px;
  padding-left: 18px;
}
.rel-problem-line {
  margin-top: 4px;
  max-width: 42ch;
  color: var(--danger);
}

/* Groups & plans: filters, the owner's groups under a row. */
.gp-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.gp-controls input[type="search"] {
  flex: 1 1 240px;
  min-width: 0;
}
.gp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.gp-tabs .chip {
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.gp-tabs .chip[aria-pressed="true"] {
  border-color: transparent;
  background: var(--soft);
  color: var(--accent);
  font-weight: 600;
}
.gp-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}
.gp-sub > td {
  background: var(--bg, transparent);
  padding: 8px 16px 16px;
}
.gp-grant {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 6px 0 12px;
}
.gp-grant select {
  width: auto;
  min-width: 180px;
}
.gp-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.gp-group-head {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}
.gp-people {
  margin-top: 8px;
}
.gp-confirm {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}
.gp-confirm[hidden] {
  display: none;
}
.gp-confirm input {
  width: auto;
  min-width: 200px;
}
@media (max-width: 720px) {
  .gp-actions {
    justify-content: flex-start;
  }
}

.gp-rule-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 0}
.gp-rule-row + .gp-rule-row{border-top:1px solid var(--border,rgba(127,127,127,.25))}
.gp-rule-row p{margin:2px 0 0;max-width:68ch}

/* Live Trace map (trace-map.js) */
.lt-gps-points {
  align-items: flex-start;
  margin: 4px 0 12px;
}
.lt-gps-points input {
  margin-top: 4px;
}
.tm-range {
  align-items: flex-end;
}
.tm-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  margin-top: 8px;
}
.tm-map {
  height: 560px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.tm-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.tm-side h3 {
  margin: 0 0 6px;
  font-size: 14px;
}
.tm-side .lt-check {
  margin: 2px 0;
}
.tm-legend ul {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
.tm-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tm-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.tm-dot-saved {
  background: #1a9850;
}
.tm-dot-used {
  border: 2px solid #1a9850;
}
.tm-ramp {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.tm-ramp i {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #1a9850, #fee04c, #d73027);
}
.tm-when-inputs {
  display: flex;
  gap: 6px;
}
.tm-when-inputs input[type="text"] {
  width: 6.5em;
}
.tm-map-wrap {
  position: relative;
  min-width: 0;
}
.tm-map-tools {
  position: absolute;
  top: 10px;
  left: 54px;
  z-index: 500;
}
.tm-map-tools button {
  box-shadow: var(--shadow);
}
.tm-map-tools button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}
.tm-map.is-selecting,
.tm-map.is-selecting .leaflet-interactive {
  cursor: crosshair;
}
.tm-map.is-selecting {
  touch-action: none;
}
.tm-num {
  background: #fff;
  color: #172f39;
  border: 1px solid #172f39;
  border-radius: 8px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  white-space: nowrap;
  margin: -18px 0 0 6px;
  pointer-events: none;
}
.tm-pin span {
  display: inline-block;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 1px 4px #0006;
  transform: translate(-50%, 10px);
}
.tm-pin-end span {
  transform: translate(-50%, calc(-100% - 10px));
}
.tm-note-pin {
  background: #7b3fbf;
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 18px;
  text-align: center;
  font-size: 12px;
  box-shadow: 0 1px 4px #0006;
  margin: -11px 0 0 -11px;
}
.tm-compose {
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px;
  background: var(--soft);
}
.tm-compose textarea {
  width: 100%;
}
.tm-player-help {
  margin: 6px 0 0;
}
.tm-notes {
  margin-top: 18px;
}
.tm-notes h3 {
  margin: 0 0 6px;
  font-size: 14px;
}
.tm-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tm-all-list {
  margin: 8px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.tm-notes ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.tm-notes li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text);
}
.tm-notes li.is-active {
  border-color: var(--accent);
  background: var(--soft);
}
.tm-notes li p {
  margin: 4px 0;
  white-space: pre-wrap;
}
.tm-player {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.tm-player button {
  min-height: 36px;
  padding: 6px 12px;
}
.tm-player select {
  width: auto;
}
.tm-slider {
  flex: 1;
  min-width: 160px;
}
.tm .leaflet-container {
  font: inherit;
}
@media (max-width: 900px) {
  .tm-body {
    grid-template-columns: 1fr;
  }
  .tm-map {
    height: 420px;
  }
}
.lt-storage {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.lt-storage button {
  min-height: 0;
  padding: 0 6px;
}
.lt-storage-detail {
  margin-bottom: 16px;
}
.lt-storage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.lt-storage-table th,
.lt-storage-table td {
  padding: 3px 10px 3px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.lt-storage-table .num {
  text-align: right;
}
.lt-storage-table .muted {
  color: var(--muted);
}
.lt-share {
  position: relative;
  width: 30%;
  min-width: 90px;
}
.lt-share span {
  position: absolute;
  left: 0;
  top: 7px;
  height: 8px;
  border-radius: 4px;
  background: var(--accent);
  opacity: 0.35;
}
.lt-share b {
  position: relative;
  font-weight: 600;
  padding-left: 6px;
}
/* Onboarding scenarios: the steps as blocks dragged into place. */
.scenarios {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  margin-top: 18px;
}
.scenario-editor {
  min-width: 0;
}
.scenario-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scenario-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scenario-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.scenario-pick {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  text-align: left;
  gap: 10px;
  padding: 8px 10px;
}
.scenario-pick > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.scenario-pick small {
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scenario-item.selected .scenario-pick {
  border-color: var(--accent);
  background: var(--soft);
}
.scenario-letter {
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.scenario-move {
  display: flex;
  flex-direction: column;
}
.scenario-move button {
  min-height: 0;
  padding: 0 8px;
  height: 20px;
  border: 0;
  background: none;
  color: var(--muted);
}
.scenario-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 16px;
}
.scenario-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 8px 0 16px;
}
.flow-board {
  position: relative;
  overflow-x: auto;
  padding: 64px 16px 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle, var(--line) 1px, transparent 1.5px) 0 0 / 18px 18px,
    var(--bg);
  touch-action: pan-y;
}
.flow-board.invalid {
  border-color: var(--danger);
}
.flow-zones {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.flow-zone {
  position: absolute;
  top: 10px;
  bottom: 10px;
  border-radius: 12px;
  transition: left 0.18s, width 0.18s;
}
.flow-zone span {
  position: absolute;
  left: 12px;
  bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.flow-zone.before {
  background: color-mix(in srgb, var(--warn-soft) 70%, transparent);
}
.flow-zone.after {
  background: color-mix(in srgb, var(--soft) 70%, transparent);
}
.flow-bracket {
  position: absolute;
  bottom: 26px;
  height: 12px;
  border: 2px solid var(--accent);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  transition: left 0.18s;
}
.flow-bracket span {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  color: var(--accent);
  background: var(--bg);
  padding: 0 6px;
}
.flow-links {
  position: absolute;
  top: 0;
  left: 0;
  height: 64px;
  overflow: visible;
  pointer-events: none;
}
.flow-links path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-dasharray: 4 3;
}
.flow-links path.bad {
  stroke: var(--danger);
  stroke-dasharray: none;
  stroke-width: 2.2;
}
.flow-links marker path {
  fill: var(--accent);
  stroke: none;
}
.flow-row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 30px;
  width: max-content;
  position: relative;
}
.flow-block {
  position: relative;
  width: 128px;
  min-height: 156px;
  padding: 14px 12px 12px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.18s ease, box-shadow 0.18s, border-color 0.18s;
}
.flow-block:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -24px;
  top: 58px;
  color: var(--muted);
  font-size: 18px;
}
.flow-block:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.flow-block:hover {
  border-color: var(--accent);
}
.flow-block.dragging {
  cursor: grabbing;
  z-index: 2;
  transition: none;
  border-color: var(--accent);
  box-shadow: 0 18px 50px #0003;
  scale: 1.04;
}
.flow-block.dragging::after {
  display: none;
}
.flow-block.refused {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.flow-block.shake {
  animation: flow-shake 0.35s;
}
@keyframes flow-shake {
  25% { translate: -6px 0; }
  50% { translate: 6px 0; }
  75% { translate: -3px 0; }
}
.flow-index {
  position: absolute;
  top: -11px;
  left: -11px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  color: var(--on-accent);
}
.flow-glyph {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: var(--soft);
  color: var(--accent);
  margin-bottom: 4px;
}
.flow-block small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.flow-invite {
  margin-top: auto;
  min-height: 0;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 8px;
  border-color: var(--accent);
  color: var(--accent);
}
.flow-invite.off {
  border-style: dashed;
  border-color: var(--line);
  color: var(--muted);
}
.flow-message {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.flow-message.bad {
  color: var(--danger);
  font-weight: 500;
}
.scenario-actions {
  margin-top: 14px;
}
@media (max-width: 1100px) {
  .scenarios {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .scenario-fields {
    grid-template-columns: 1fr;
  }
  .flow-block {
    width: 118px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .flow-block,
  .flow-zone,
  .flow-bracket {
    transition: none;
  }
  .flow-block.shake {
    animation: none;
  }
}

/* Plans: a table per block; a row opens the plan's details under it. */
.plan-block {
  margin-bottom: 20px;
}
.plan-block .section-title p {
  margin: 4px 0 0;
}
.plan-table tr.plan-row {
  cursor: pointer;
}
.plan-table tr.plan-row:hover td {
  background: var(--soft);
}
.plan-table tr.plan-row[aria-expanded="true"] td {
  border-bottom: 0;
}
.plan-table .plan-open {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.plan-table .plan-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.plan-table .plan-caret {
  display: inline-block;
  color: var(--muted);
  transition: transform 0.15s;
}
.plan-table .plan-open[aria-expanded="true"] .plan-caret {
  transform: rotate(90deg);
}
.plan-table .num {
  text-align: right;
}
.plan-table .nowrap {
  white-space: nowrap;
}
/* Hidden and expired plans are not offered: greyed out. */
.plan-table tr.plan-off > td {
  opacity: 0.55;
}
.plan-table tr.plan-off:hover > td {
  opacity: 0.8;
}
.plan-table tr.plan-detail > td {
  padding-top: 0;
  padding-left: 22px;
}
.plan-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px 32px;
}
.plan-detail .plan-features {
  padding-left: 18px;
  color: var(--muted);
}
.plan-detail .actions {
  justify-content: flex-start;
  margin-top: 12px;
}

/* Plans: the view switch (table / blocks), the store filter, the order. */
.plan-seg {
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.plan-seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.plan-seg button:hover {
  color: var(--text);
}
.plan-seg button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px #0000001f;
}
.plan-seg-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.plan-seg button[aria-pressed="true"] .plan-seg-count {
  background: var(--soft);
  color: var(--accent);
}
.plan-block-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}
#plans-dups .notice {
  margin: 0 0 16px;
}
.plan-order {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent);
  font: 600 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.plan-order.dup {
  background: var(--warn-soft);
  color: var(--warn);
  outline: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
}
.plan-table .plan-order-head,
.plan-table .plan-order-cell {
  width: 1%;
  text-align: center;
}
.plan-dup {
  display: flex;
  width: fit-content;
  margin-top: 6px;
}
.plan-aud {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 13px;
}
.plan-aud.everyone {
  color: var(--muted);
}
.plan-aud-label {
  font-weight: 600;
  color: var(--warn);
}
.plan-aud-email {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* Plans as blocks. */
.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.plan-tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  border-top: 3px solid var(--accent);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.plan-tile:hover {
  box-shadow: var(--shadow);
}
.plan-tile.status-hidden {
  border-top-color: var(--muted);
}
.plan-tile.status-expired {
  border-top-color: var(--warn);
}
.plan-tile.status-hidden,
.plan-tile.status-expired {
  opacity: 0.65;
}
.plan-tile.status-hidden:hover,
.plan-tile.status-expired:hover {
  opacity: 1;
}
.plan-tile.has-dup {
  border-color: color-mix(in srgb, var(--warn) 55%, var(--line));
  border-top-color: var(--warn);
}
.plan-tile-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.plan-tile-title {
  flex: 1;
  min-width: 0;
}
.plan-tile-title h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
}
.plan-tile-title code {
  overflow-wrap: anywhere;
}
.plan-tile-price {
  font-size: 24px;
  font-weight: 500;
}
.plan-tile-price small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.plan-tile-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.plan-tile-facts {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  margin: 0;
  font-size: 13px;
}
.plan-tile-facts dt {
  color: var(--muted);
}
.plan-tile-facts dd {
  margin: 0;
}
.plan-tile-stores {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.plan-store-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
}
.plan-store-chip code {
  overflow-wrap: anywhere;
}
.plan-store-chip.off {
  opacity: 0.6;
  text-decoration: line-through;
}
.plan-tile-limits {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin: 0;
  padding: 10px 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
  text-align: center;
}
.plan-tile-limits b {
  display: block;
  font-size: 14px;
}
.plan-tile-limits span {
  color: var(--muted);
  font-size: 11px;
}
.plan-tile .actions {
  margin-top: auto;
  justify-content: flex-start;
}
@media (max-width: 760px) {
  .plan-block-tools {
    justify-content: flex-start;
  }
  .plan-seg {
    flex-wrap: wrap;
  }
}
.plan-table th {
  white-space: nowrap;
}

/* Users: sortable headers, test accounts faint, the load profile. */
.th-sort {
  all: unset;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.th-sort:hover,
.th-sort.on {
  color: var(--accent);
}
.th-sort:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
tr.test-row td {
  opacity: 0.6;
}
.load-profile {
  margin: 8px 0 0;
  font-variant-numeric: tabular-nums;
}

/* Admin → Data retention (MAHRAM-324) */
.ret-table th[scope="row"] { font-weight: 600; min-width: 12rem; }
.ret-table td, .ret-table th { vertical-align: top; }
.ret-table .ret-days { width: 5.5rem; }
.ret-table tr.ret-attention th[scope="row"] { box-shadow: inset 3px 0 0 var(--danger, #c0392b); padding-left: 0.6rem; }
.ret-table .ret-kept { white-space: nowrap; }
