:root {
    --bg: #f5f6f8;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #f0f2f6;
    --border: #e4e7ec;
    --border-strong: oklch(60% 0.014 28);
    --text: #181b22;
    --text-secondary: #697384;
    --text-tertiary: #697384;
    --accent: #c92339;
    --accent-hover: #b81830;
    --accent-soft: #fbedef;
    --green: oklch(43% 0.105 150);
    --green-soft: oklch(43% 0.105 150 / 0.12);
    --amber: oklch(56% 0.130 72);
    --amber-soft: oklch(56% 0.130 72 / 0.14);
    --red: oklch(49% 0.190 26);
    --red-soft: oklch(49% 0.190 26 / 0.12);
    --blue: oklch(49% 0.115 248);
    --blue-soft: oklch(49% 0.115 248 / 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --font: "Meravel Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
    --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
    --shadow: 0 0 0 1px var(--border), 0 12px 32px -12px oklch(15% 0.010 28 / 0.08);
  }
  *, *::before, *::after { box-sizing: border-box; }
  html, body { margin: 0; height: 100%; }
  body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 13px;
    line-height: 1.45;
  }
  a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  .app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
  }

  /* ── Top bar ── */
  .topbar {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
    position: sticky; top: 0; z-index: 40;
  }
  .brand {
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  }
  .logo {
    width: 28px; height: 28px; border-radius: 7px;
    background: var(--text);
    display: grid; place-items: center;
    font-weight: 700; font-size: 12px; color: #fff;
    letter-spacing: -0.02em;
  }
  .brand-text { display: flex; flex-direction: column; gap: 0; }
  .brand-text strong {
    font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  }
  .brand-text span {
    font-size: 11px; color: var(--text-tertiary); font-weight: 400;
  }
  .divider-v {
    width: 1px; height: 24px; background: var(--border); flex-shrink: 0;
  }
  .meta-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1;
  }
  .chip {
    display: inline-flex; align-items: center; gap: 5px;
    height: 26px; padding: 0 10px; border-radius: 999px;
    font-size: 11px; color: var(--text-secondary);
    background: var(--surface); border: 1px solid var(--border);
    white-space: nowrap;
  }
  .chip em { font-style: normal; color: var(--text); font-weight: 500; }
  .chip.warn {
    color: var(--amber); border-color: var(--amber-soft);
    background: var(--amber-soft);
  }
  .legend-chips {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  }
  .leg {
    display: inline-flex; align-items: center; gap: 5px;
    height: 26px; padding: 0 9px; border-radius: 999px;
    font-size: 10px; font-weight: 500; letter-spacing: 0.01em;
    border: 1px solid transparent;
  }
  .leg i {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  }
  .leg.g { color: var(--green); background: var(--green-soft); border-color: var(--green-soft); }
  .leg.g i { background: var(--green); }
  .leg.a { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-soft); }
  .leg.a i { background: var(--amber); animation: pulse-dot 1.6s ease-in-out infinite; }
  .leg.r { color: var(--red); background: var(--red-soft); border-color: var(--red-soft); }
  .leg.r i { background: var(--red); }
  .leg.b { color: var(--blue); background: var(--blue-soft); border-color: var(--blue-soft); }
  .leg.b i { background: var(--blue); }
  @keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.85); }
  }

  /* Role switcher */
  .role-switch {
    display: flex; align-items: center; gap: 2px;
    padding: 2px; border-radius: 9px;
    background: var(--surface); border: 1px solid var(--border);
    margin-left: auto;
  }
  .role-btn {
    appearance: none; border: none; cursor: pointer;
    height: 28px; padding: 0 11px; border-radius: 7px;
    font-size: 11px; font-weight: 500; font-family: inherit;
    color: var(--text-tertiary); background: transparent;
    transition: color .12s, background .12s;
    white-space: nowrap;
  }
  .role-btn:hover { color: var(--text-secondary); }
  .role-btn.active {
    color: var(--text); background: var(--surface-2);
    box-shadow: 0 0 0 1px var(--border-strong);
  }
  .role-btn.admin.active {
    color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px var(--accent);
  }

  /* Admin banner */
  .admin-banner {
    display: none;
    align-items: center; gap: 10px;
    padding: 8px 20px;
    background: var(--accent-soft);
    border-bottom: 1px solid #e7c5cb;
    font-size: 12px; color: var(--text);
  }
  .admin-banner.visible { display: flex; }
  .admin-banner .badge {
    font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
    text-transform: uppercase; padding: 2px 7px; border-radius: 4px;
    background: var(--accent); color: #ffffff;
  }
  .admin-banner .sep { color: var(--text-tertiary); }

  /* ── Layout ── */
  .main {
    flex: 1; display: grid;
    grid-template-columns: 1fr 360px;
    min-height: 0;
  }
  @media (max-width: 900px) {
    .main { grid-template-columns: 1fr; }
    .panel { border-left: none; border-top: 1px solid var(--border); max-height: 48vh; }
    .role-switch { margin-left: 0; width: 100%; justify-content: stretch; }
    .role-btn { flex: 1; text-align: center; }
  }

  /* Map area */
  .map-area {
    display: flex; flex-direction: column; min-height: 0;
    padding: 16px 16px 20px;
  }
  .map-toolbar {
    display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
  }
  .filter-group {
    display: flex; gap: 2px; padding: 2px; border-radius: 9px;
    background: var(--surface); border: 1px solid var(--border);
  }
  .filter {
    appearance: none; border: none; cursor: pointer;
    height: 28px; padding: 0 12px; border-radius: 7px;
    font-size: 11px; font-weight: 500; font-family: inherit;
    color: var(--text-tertiary); background: transparent;
    transition: color .12s, background .12s;
  }
  .filter:hover { color: var(--text-secondary); }
  .filter.active {
    color: var(--text); background: var(--surface-2);
    box-shadow: 0 0 0 1px var(--border-strong);
  }
  .filter:disabled { opacity: 0.3; cursor: not-allowed; }
  .scope-hint {
    font-size: 11px; color: var(--text-tertiary); margin-left: auto;
  }
  .scope-hint strong { color: var(--text-secondary); font-weight: 500; }

  .canvas-frame {
    flex: 1; position: relative; min-height: 480px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background:
      linear-gradient(#e3e7ed 1px, transparent 1px),
      linear-gradient(90deg, #e3e7ed 1px, transparent 1px),
      var(--bg-elevated);
    background-size: 24px 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  svg.map {
    width: 100%; height: 100%; min-height: 480px; display: block;
  }

  /* SVG styles */
  .edge {
    fill: none; stroke-width: 3.5; stroke-linecap: round;
    cursor: pointer; transition: stroke-width .15s, opacity .2s, filter .15s;
    opacity: 0.9;
  }
  .edge:hover, .edge.selected { stroke-width: 5; filter: brightness(1.2); }
  .edge.dim { opacity: 0.12; pointer-events: none; }
  .edge-glow {
    fill: none; stroke-width: 10; opacity: 0.22; pointer-events: none;
    transition: opacity .2s;
  }
  .edge-glow.connected { opacity: 0.35; filter: blur(1px); }
  .edge.reconnect-anim {
    animation: dash-flow 1.2s linear infinite;
  }
  @keyframes dash-flow {
    to { stroke-dashoffset: -30; }
  }
  .station { cursor: pointer; transition: opacity .2s; }
  .station.dim { opacity: 0.15; pointer-events: none; }
  .station:hover .core-ring,
  .station.selected .core-ring { stroke-width: 2.5; }
  .label {
    font-size: 11px; fill: var(--text); font-family: var(--font); font-weight: 600;
    pointer-events: none;
  }
  .label-sub {
    font-size: 9.5px; fill: var(--text-tertiary); font-weight: 400;
    pointer-events: none;
  }
  .hub-ring {
    fill: none; stroke: var(--text); stroke-width: 1.5;
    stroke-dasharray: 3 5; opacity: 0.6;
    animation: spin 28s linear infinite;
    transform-origin: 0 0;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  .pulse-ring {
    fill: none; stroke: var(--text); stroke-width: 1; opacity: 0.2;
    animation: pulse-r 2.8s ease-out infinite;
  }
  @keyframes pulse-r {
    0% { r: 26; opacity: 0.45; }
    100% { r: 48; opacity: 0; }
  }

  /* ── Side panel ── */
  .panel {
    border-left: 1px solid var(--border);
    background: var(--surface);
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  .panel-head {
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .panel-head h2 {
    margin: 0; font-size: 13px; font-weight: 600; letter-spacing: -0.01em;
  }
  .panel-head p {
    margin: 4px 0 0; font-size: 11px; color: var(--text-tertiary); line-height: 1.5;
  }
  .stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
    padding: 12px 18px; flex-shrink: 0;
  }
  .stat {
    text-align: center; padding: 8px 4px;
    border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border);
  }
  .stat b {
    display: block; font-size: 18px; font-weight: 600;
    letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  }
  .stat span {
    font-size: 9px; color: var(--text-tertiary); font-weight: 500;
    letter-spacing: 0.02em; text-transform: uppercase;
  }
  .panel-body {
    flex: 1; overflow: auto; padding: 4px 18px 18px;
  }
  .empty {
    margin-top: 8px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    color: var(--text-tertiary);
  }
  .empty .empty-icon {
    width: 40px; height: 40px; margin: 0 auto 12px;
    border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    display: grid; place-items: center;
    font-size: 16px; color: var(--text-tertiary);
  }
  .empty p { margin: 0; font-size: 12px; line-height: 1.6; }
  .empty .hint { margin-top: 6px; font-size: 11px; color: var(--text-tertiary); opacity: 0.7; }

  .card {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
    overflow: hidden;
  }
  .card-top {
    padding: 14px 14px 10px;
    display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  }
  .card-title {
    font-size: 13px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35;
  }
  .pill {
    display: inline-flex; align-items: center; gap: 5px;
    height: 22px; padding: 0 8px; border-radius: 999px;
    font-size: 9px; font-weight: 600; letter-spacing: 0.04em;
    white-space: nowrap; flex-shrink: 0;
  }
  .pill::before {
    content: ""; width: 5px; height: 5px; border-radius: 50%;
  }
  .pill.CONNECTED { background: var(--green-soft); color: var(--green); }
  .pill.CONNECTED::before { background: var(--green); }
  .pill.RECONNECT { background: var(--amber-soft); color: var(--amber); }
  .pill.RECONNECT::before { background: var(--amber); animation: pulse-dot 1.6s ease-in-out infinite; }
  .pill.AUTHORIZATION_REQUIRED { background: var(--red-soft); color: var(--red); }
  .pill.AUTHORIZATION_REQUIRED::before { background: var(--red); opacity: 0.7; }
  .pill.CHECK_REQUIRED { background: var(--blue-soft); color: var(--blue); }
  .pill.CHECK_REQUIRED::before { background: var(--blue); }

  .card-body { padding: 0 14px 14px; }
  .kv {
    display: grid; grid-template-columns: 72px 1fr;
    gap: 6px 10px; font-size: 11px; margin-top: 2px;
  }
  .kv dt { color: var(--text-tertiary); padding-top: 1px; }
  .kv dd {
    margin: 0; font-family: var(--mono); font-size: 10.5px;
    color: var(--text-secondary); word-break: break-all; line-height: 1.4;
  }
  .kv dd.plain { font-family: var(--font); font-size: 11px; color: var(--text-secondary); }
  .note {
    margin: 10px 0 0; font-size: 11px; color: var(--text-tertiary); line-height: 1.55;
  }
  .action-box {
    margin-top: 12px; padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    border: 1px solid #e7c5cb;
    font-size: 12px; line-height: 1.5; color: var(--text-secondary);
  }
  .action-box strong { color: var(--text); font-weight: 600; }
  .btn-row { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 12px; border-radius: 8px;
    font-size: 11px; font-weight: 550; font-family: inherit;
    border: none; cursor: pointer; text-decoration: none;
    transition: opacity .12s, transform .08s;
  }
  .btn:active { transform: scale(0.98); }
  .btn.primary {
    background: var(--accent);
    color: #fff;
  }
  .btn.primary:hover { background: var(--accent-hover); }
  .btn.ghost {
    background: transparent; color: var(--text-tertiary);
    border: 1px solid var(--border); cursor: default;
  }
  .btn:disabled { opacity: 0.4; cursor: not-allowed; }

  .footnote {
    margin-top: auto; padding: 14px 18px;
    border-top: 1px solid var(--border);
    font-size: 10.5px; color: var(--text-tertiary); line-height: 1.55;
    flex-shrink: 0;
  }
  .footnote code {
    font-family: var(--mono); font-size: 10px;
    color: var(--text-secondary);
    background: var(--surface-2); padding: 1px 4px; border-radius: 3px;
  }
  .footnote strong { color: var(--text-secondary); font-weight: 550; }

  .nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
  .nav.guest-nav { margin-left: auto; }
  .nav.guest-nav a {
    color: #fff;
    background: var(--accent);
    font-weight: 550;
  }
  .nav.guest-nav a:hover { color: #fff; background: var(--accent-hover); }
  [data-auth-nav],
  [data-auth-surface],
  [data-auth-brand] { display: none; }
  html.has-session [data-auth-nav] { display: flex; }
  html.has-session [data-auth-surface] { display: block; }
  html.has-session [data-auth-brand] { display: inline; }
  html.has-session [data-guest-nav],
  html.has-session [data-guest-gate],
  html.has-session [data-guest-brand] { display: none; }
  .guest-gate { max-width: 34rem; padding-top: 18px; }
  .guest-gate h1 { font-size: 28px; line-height: 1.25; letter-spacing: -0.03em; margin: 0 0 12px; }
  .guest-gate p { font-size: 15px; line-height: 1.65; color: var(--text-secondary); margin: 0 0 20px; }
  .guest-gate .btn.primary { height: 36px; padding: 0 16px; font-size: 13px; }
  .guest-gate .guest-cta { margin: 0; }
  .nav a {
    color: var(--text-secondary); text-decoration: none; font-size: 12px;
    padding: 6px 8px; border-radius: 7px;
  }
  .nav a:hover { color: var(--text); background: var(--surface-2); }
  .nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
  .nav-advanced { position: relative; }
  .nav-advanced > summary {
    list-style: none; cursor: pointer; color: var(--text-secondary);
    font-size: 12px; padding: 6px 8px; border-radius: 7px;
  }
  .nav-advanced > summary::-webkit-details-marker { display: none; }
  .nav-advanced[open] > summary,
  .nav-advanced > summary:hover { color: var(--text); background: var(--surface-2); }
  .nav-advanced-menu {
    position: absolute; z-index: 8; top: calc(100% + 6px); right: 0;
    min-width: 148px; display: flex; flex-direction: column; gap: 2px;
    padding: 6px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 12px 32px oklch(15% 0.010 28 / 0.12);
  }
  details.advanced { margin-top: 16px; }
  details.advanced > summary {
    cursor: pointer; color: var(--text-secondary); font-size: 13px; margin-bottom: 10px;
  }
  .page { max-width: 880px; margin: 0 auto; padding: 28px 20px 48px; }
  .page h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
  .page p.lead { color: var(--text-secondary); margin: 0 0 18px; line-height: 1.55; }
  .stack { display: grid; gap: 10px; }
  .row-card {
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    padding: 14px 16px;
  }
  .row-card h2 { margin: 0 0 6px; font-size: 14px; }
  .row-card.alarm {
    border-color: var(--red);
    background: var(--red-soft);
  }
  .row-card.alarm h2,
  .row-card.alarm p,
  .row-card.alarm li { color: var(--red); }
  .row-card p, .row-card li { color: var(--text-secondary); line-height: 1.55; }
  .row-card ol { margin: 8px 0 0; padding-left: 18px; }
  label { display: block; font-size: 12px; color: var(--text-tertiary); margin-bottom: 6px; }
  input[type="text"], input[type="email"], input[type="password"], select {
    width: 100%; max-width: 520px; height: 36px; border-radius: 8px;
    border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
    padding: 0 10px; font: inherit;
  }
  .banner-gap {
    border: 1px solid var(--amber); background: var(--amber-soft);
    color: var(--amber); border-radius: var(--radius); padding: 10px 12px; font-size: 12px; line-height: 1.5;
  }
  .banner-gap a.token-entry, .empty a.token-entry {
    color: var(--text); font-weight: 650;
  }
  .page.wide { max-width: 1100px; }
  .me-layout { display: grid; gap: 16px; align-items: start; }
  .conn-list { display: grid; gap: 10px; }
  .conn-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    padding: 12px 14px;
  }
  .conn-card header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .conn-card h3 { margin: 0; font-size: 14px; font-weight: 600; }
  .conn-usage { margin: 8px 0 0; color: var(--text-secondary); font-size: 12px; }
  .conn-card .btn.primary:disabled {
    opacity: 1;
    cursor: default;
    background: var(--green-soft);
    color: var(--green);
    box-shadow: none;
  }
  .agent-install .install-fields { display: grid; gap: 10px; margin-top: 8px; }
  .agent-install .install-fields > div {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }
  .agent-install dt { color: var(--text-tertiary); font-size: 12px; padding-top: 6px; }
  .agent-install dd { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .agent-install code {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 8px;
    word-break: break-all;
  }
  .btn.copy {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-strong);
    cursor: pointer;
  }
  a.zip-link { color: var(--text-secondary); }
  @media (max-width: 979px) {
    .me-layout > .agent-install { order: -1; }
  }
  @media (min-width: 980px) {
    .me-layout { grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); }
    .me-layout > .agent-install { position: sticky; top: 72px; }
  }
  .table-wrap { overflow-x: auto; }
  .ops-table { width: 100%; border-collapse: collapse; font-size: 12px; }
  .ops-table th, .ops-table td {
    text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top;
  }
  .ops-table th { color: var(--text-tertiary); font-weight: 550; font-size: 11px; }
  .pill.AUTHORIZED, .pill.RECHECK_REQUIRED, .pill.NOT_PROBED, .pill.UNKNOWN, .pill.MIXED, .pill.BRIDGE_DECLARED {
    background: var(--surface-2); color: var(--text-secondary);
  }
  .pill.KEY_SAVED, .pill.KEY_REQUIRED { background: var(--red-soft); color: var(--red); }
  .pill.RECONNECT_REQUIRED { background: var(--amber-soft); color: var(--amber); }
  .pill.NOT_PROBED::before, .pill.UNKNOWN::before, .pill.MIXED::before, .pill.BRIDGE_DECLARED::before, .pill.AUTHORIZED::before { background: var(--text-tertiary); }
  .pill.OK, .pill.LIVE { background: var(--green-soft); color: var(--green); }
  .pill.OK::before, .pill.LIVE::before { background: var(--green); }
  .pill.MISSING_BINDING, .pill.SCOPE_BLOCKED, .pill.FIXTURE, .pill.CATALOG_ONLY, .pill.NOT_IN_DIRECTORY {
    background: var(--amber-soft); color: var(--amber);
  }
  .pill.MISSING_BINDING::before, .pill.SCOPE_BLOCKED::before, .pill.FIXTURE::before, .pill.CATALOG_ONLY::before, .pill.NOT_IN_DIRECTORY::before { background: var(--amber); }
  .grant-editor { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
  .grant-editor h3 { margin: 0; font-size: 13px; }
  .check-row { display: flex; flex-wrap: wrap; gap: 8px 14px; }
  .check-row label { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--text-secondary); }
  .check-stack { display: grid; gap: 6px; }
  .check-stack label { display: flex; align-items: flex-start; gap: 8px; margin: 0; line-height: 1.45; overflow-wrap: anywhere; color: var(--text-secondary); }
  .ops-table td { overflow-wrap: anywhere; }
  .grant-editor input[type="checkbox"] { accent-color: var(--accent); }

  .page.settings, .page.connections { max-width: 1180px; padding: 14px 20px 28px; }
  .page-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 0 0 10px; min-height: 32px;
  }
  .page-bar-copy { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
  .page.settings .page-bar h1, .page.connections .page-bar h1 {
    margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap;
  }
  .page-bar .lead {
    margin: 0; font-size: 13px; line-height: 1.3; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .summary-pills { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
  .sum-pill, .settings .who {
    display: inline-flex; align-items: center; height: 26px; margin: 0; padding: 0 10px;
    border-radius: 999px; border: 1px solid var(--border); background: #fff;
    color: var(--text-secondary); font-size: 12px; white-space: nowrap;
  }
  .sum-pill strong { color: var(--text); font-weight: 650; }
  .sum-pill.ok { background: var(--green-soft); border-color: transparent; color: var(--green); }
  .sum-pill.ok strong { color: var(--green); }
  .sum-pill.warn { background: var(--amber-soft); border-color: transparent; color: var(--amber); }
  .sum-pill.warn strong { color: var(--amber); }
  .settings .stack { gap: 8px; }
  .settings-toolbar { display: flex; align-items: center; gap: 12px; }
  .seg {
    display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px; background: var(--surface-2);
  }
  .seg-btn {
    border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 7px;
    font: inherit; font-size: 13px; color: var(--text-secondary); cursor: pointer;
  }
  .seg-btn[aria-selected="true"] {
    background: #fff; color: var(--text); font-weight: 650;
    box-shadow: 0 1px 2px oklch(15% 0.010 28 / 0.08);
  }
  .settings-panel { display: grid; gap: 8px; }
  .settings-panel[hidden] { display: none; }
  .settings-note, .settings .member-empty { margin: 0; color: var(--text-secondary); font-size: 12px; }
  .settings .panel-list {
    list-style: none; margin: 0; padding: 0;
    background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  }
  .settings .member-list > li {
    display: grid; grid-template-columns: minmax(220px, 34%) minmax(0, 1fr) auto;
    gap: 10px; align-items: center; height: 52px; padding: 0 12px; border-top: 1px solid var(--border);
  }
  .settings .member-list > li:first-child { border-top: 0; }
  .settings .member-id-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .settings .member-name {
    min-width: 0; font-size: 13px; font-weight: 650; letter-spacing: -0.01em;
    white-space: normal;
  }
  .settings .role-badge {
    flex: none; height: 22px; padding: 0 8px; border-radius: 999px;
    background: var(--surface-2); color: var(--text); font-size: 12px; line-height: 22px; white-space: nowrap;
  }
  .settings .role-badge.muted { color: var(--text-tertiary); background: transparent; padding: 0; }
  .settings .member-meta { flex: none; color: var(--text-tertiary); font-size: 12px; white-space: nowrap; }
  .settings td.scope-chips { vertical-align: middle; overflow: visible; }
  .settings .scope-chip {
    display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 6px; flex: 0 1 auto; min-width: 0; max-width: none; height: auto; min-height: 0;
    padding: 0; border-radius: 0; background: transparent; border: 0;
    color: var(--text); font-size: 13px; line-height: 1.35; white-space: normal;
    overflow: visible; text-overflow: unset;
  }
  .settings .scope-chip strong { font-weight: 680; }
  .settings .scope-chip.account { background: transparent; border: 0; }
  .settings .scope-chip.muted, .settings .scope-empty, .muted-action { color: var(--text-tertiary); background: transparent; border: 0; font-weight: 450; }
  .settings .scope-coverage { font-weight: 620; color: var(--text); }
  .settings .scope-quiet { color: var(--text-tertiary); font-size: 12px; font-weight: 450; }
  .settings .chip-kind { color: var(--text-secondary); margin-right: 4px; flex: none; }
  .settings .scope-chip > span:last-child,
  .settings .choice-line,
  .chip-meta { min-width: 0; overflow: visible; text-overflow: unset; white-space: normal; }
  .chip-meta { color: var(--text-secondary); margin-right: 4px; }
  .settings .scope-id { color: var(--text-secondary); font-weight: 450; font-size: 11px; }
  .settings .member-list > li > .btn { height: 28px; padding: 0 12px; font-size: 12px; }
  .settings .settings-conns {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    background: transparent; border: 0; overflow: visible;
  }
  .settings .settings-conns > li {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center; height: auto; min-height: 44px; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: 10px; background: #fff;
  }
  .settings .conn-name {
    font-size: 13px; font-weight: 650; min-width: 0; flex: 1 1 140px;
    white-space: normal; overflow: visible; text-overflow: unset;
  }
  .conn-people { color: var(--text-secondary); font-size: 12px; white-space: normal; }
  .settings .conn-action { justify-self: end; }
  .settings .conn-action .btn { height: 26px; padding: 0 8px; font-size: 12px; }
  .platform-badge, .status-pill {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
    border-radius: 999px; font-size: 12px; white-space: nowrap; flex: none;
  }
  .platform-badge { border: 1px solid var(--border); color: var(--text-secondary); background: #fff; }
  .status-pill { font-weight: 650; }
  .status-pill.ok { background: var(--green-soft); color: var(--green); }
  .status-pill.warn { background: var(--amber-soft); color: var(--amber); }
  .status-pill.bad { background: var(--red-soft); color: var(--red); }
  .status-pill.muted { background: var(--surface-2); color: var(--text-secondary); }
  .settings-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-start; }
  .settings .inactive-fold > summary, .settings .stub-fold > summary, .settings .settings-more > summary {
    width: fit-content; cursor: pointer; color: var(--text-secondary); font-size: 12px;
  }
  .settings .inactive-fold { margin-top: 2px; }
  .settings .stub-conns { grid-template-columns: 1fr; margin-top: 8px; }
  .settings .settings-more-body { display: grid; gap: 8px; margin-top: 8px; max-width: 520px; }
  .grant-dialog {
    width: min(960px, 94vw); max-height: none;
    margin: auto; padding: 0; border: 1px solid var(--border); border-radius: 14px;
    background: #fff; color: var(--text); box-shadow: 0 24px 64px oklch(15% 0.010 28 / 0.18);
  }
  .grant-dialog::backdrop { background: oklch(15% 0.010 28 / 0.45); }
  .grant-dialog form { display: flex; flex-direction: column; max-height: none; margin: 0; }
  .grant-dialog .dialog-scroll { overflow: visible; max-height: none; display: grid; gap: 8px; padding: 10px 16px 6px; }
  .grant-dialog .dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .grant-dialog h3 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.02em; }
  .grant-dialog .dialog-head .icon-close,
  .grant-dialog .dialog-head .btn,
  .grant-dialog .dialog-head button {
    width: auto; min-width: 28px; height: 28px; flex-shrink: 0;
    padding: 0 8px; border: 0; border-radius: 8px; background: transparent;
    color: var(--text-secondary); font-size: 13px; line-height: 28px; cursor: pointer;
    white-space: nowrap;
  }
  .grant-dialog fieldset { border: 0; margin: 0; padding: 0; min-inline-size: 0; }
  .grant-dialog legend { padding: 0; margin: 0 0 4px; font-size: 12px; font-weight: 650; color: var(--text); }
  .grant-dialog .role-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .grant-dialog .role-pick {
    position: relative; display: flex; align-items: center; justify-content: center; height: 28px; margin: 0;
    padding: 0 8px; border-radius: 999px; border: 1px solid var(--border); background: #fff;
    color: var(--text); font-size: 12px; cursor: pointer; white-space: nowrap;
  }
  .grant-dialog .role-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
  .grant-dialog .role-pick:has(input:checked) {
    border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 650;
  }
  .grant-dialog .role-pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
  .grant-dialog .grant-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
  .grant-dialog .choice-list { display: grid; gap: 2px; }
  .grant-dialog .choice {
    display: flex; align-items: center; gap: 8px; margin: 0; height: 32px; min-height: 32px; padding: 0 8px;
    border: 1px solid var(--border); border-radius: 8px; background: #fff;
    color: var(--text); font-size: 12px; cursor: pointer; min-width: 0;
  }
  .grant-dialog .choice > span,
  .grant-dialog .choice-line { min-width: 0; overflow: visible; text-overflow: unset; white-space: nowrap; display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; }
  .grant-dialog .choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
  .grant-dialog .choice input { margin: 0; accent-color: var(--accent); flex: none; }
  .grant-dialog .choice .scope-id { color: var(--text-secondary); font-weight: 450; font-size: 11px; }
  .grant-dialog .note { margin: 0; font-size: 12px; }
  .grant-dialog .grant-advanced { border-top: 1px solid var(--border); padding-top: 6px; }
  .grant-dialog .grant-advanced > summary { cursor: pointer; color: var(--text-secondary); font-size: 12px; }
  .grant-dialog .grant-advanced .check-row { margin-top: 8px; }
  .grant-dialog .dialog-actions {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 6px 14px 8px; border-top: 1px solid var(--border);
  }
  .grant-dialog .dialog-actions .btn { height: 32px; padding: 0 14px; font-size: 13px; }
  .grant-dialog .grant-result { padding: 0 16px 12px; }
  .grant-dialog .grant-result:empty { display: none; }
  .agent-install.agent-bar {
    border: 1px solid var(--border); border-radius: 10px; background: #fff;
    padding: 8px 12px; margin: 0 0 10px;
  }
  .agent-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
  .agent-bar-copy { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
  .agent-bar-copy strong { font-size: 13px; white-space: nowrap; }
  .agent-bar-copy span {
    color: var(--text-secondary); font-size: 12px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
  }
  .agent-bar-actions { display: flex; align-items: center; gap: 6px; flex: none; }
  .agent-bar-actions .btn { height: 28px; padding: 0 10px; font-size: 12px; }
  .agent-steps { position: relative; }
  .agent-steps > summary {
    list-style: none; cursor: pointer; height: 28px; display: inline-flex; align-items: center;
    padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong);
    background: var(--surface-2); color: var(--text); font-size: 12px;
  }
  .agent-steps > summary::-webkit-details-marker { display: none; }
  .agent-steps > summary::after { content: " ▾"; color: var(--text-secondary); }
  .agent-steps-body { display: none; }
  .agent-steps[open] .agent-steps-body {
    display: block; position: absolute; z-index: 6; right: 0; top: calc(100% + 6px);
    width: min(440px, 72vw); padding: 12px; background: #fff; border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 12px 32px oklch(15% 0.010 28 / 0.12);
  }
  .connections .conn-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .connections .conn-card {
    display: flex; align-items: center; flex-wrap: nowrap; gap: 10px; height: auto; min-height: 44px; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: 10px; background: #fff;
  }
  .connections .conn-main { flex: 1 1 auto; min-width: 0; }
  .connections .conn-card h3 {
    margin: 0; min-width: 0; font-size: 14px; font-weight: 680;
    white-space: normal; overflow: visible; text-overflow: unset;
  }
  .connections .conn-sub, .connections .conn-owner { margin: 1px 0 0; color: #697384; font-size: 12px; line-height: 1.35; }
  .connections .conn-card .conn-action, .connections .conn-block { flex: none; font-size: 12px; }
  .connections .conn-block { color: var(--text-tertiary); }
  @media (max-width: 1100px) {
    .connections .conn-list { grid-template-columns: 1fr 1fr; }
  }
  @media (max-width: 860px) {
    .settings .settings-conns, .grant-dialog .grant-split { grid-template-columns: 1fr; }
    .page-bar, .agent-bar-row { align-items: flex-start; flex-wrap: wrap; }
    .settings .member-list > li { height: auto; min-height: 48px; grid-template-columns: minmax(0, 1fr) auto; padding: 8px 12px; }
    .settings .scope-chips { grid-column: 1 / -1; }
  }
  @media (max-width: 720px) {
    .connections .conn-list, .grant-dialog .role-picks { grid-template-columns: 1fr; }
    .settings .member-list > li > .btn { grid-column: 2; }
  }

  .pill.ERROR, .pill.GRANT_HTTP_MISSING, .pill.DENIED, .pill.UNAVAILABLE {
    background: var(--red-soft); color: var(--red);
  }
  .pill.ERROR::before, .pill.GRANT_HTTP_MISSING::before, .pill.DENIED::before, .pill.UNAVAILABLE::before { background: var(--red); }

  .hidden { display: none !important; }
  .station-rows { margin: 4px 12px 16px; }
  .status-tabs, .provider-filters { display: flex; gap: 6px; flex-wrap: wrap; }
  .steps { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
  .steps li { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
  .steps .index { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 650; }
  .scope-list { margin: 6px 0 0; padding-left: 18px; }
  .subject-switch { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }

  /* Unified top header. The aside stays so .nav-button and the hidden advanced links keep working. */
  .app.shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    background: #f5f6f8;
  }
  html:not(.has-session) .app.shell { display: block; height: 100dvh; min-height: 0; overflow: hidden; }
  html:not(.has-session) .sidebar,
  html:not(.has-session) .topbar { display: none !important; }
  html:not(.has-session) .content-shell { height: 100dvh; min-height: 0; overflow: hidden; }
  html:not(.has-session) .shell .main.page { padding: 0; height: 100%; overflow: hidden; }
  html:not(.has-session) .guest-gate.login-split { min-height: 0; height: 100%; overflow: hidden; }
  html:not(.has-session) .login-showcase { min-height: 0; height: 100%; }
  html.has-session .app.shell { height: 100dvh; min-height: 0; overflow: hidden; }
  html.has-session .content-shell { height: 100%; min-height: 0; overflow: hidden; }
  html.has-session .shell .main.page { flex: 1; min-height: 0; overflow: auto; }
  body[data-page="login"] .sidebar { display: none !important; }
  body[data-page="login"] .app { display: block; height: 100dvh; min-height: 0; overflow: hidden; }
  body[data-page="login"] .login-split { height: 100dvh; min-height: 0; overflow: hidden; }
  body[data-page="login"] .login-showcase { min-height: 0; height: 100%; }
  .sidebar {
    height: 66px;
    min-height: 64px;
    max-height: 68px;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid #e4e7ec;
    overflow: hidden;
  }
  .sidebar .brand,
  .v19-brand-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0;
    text-decoration: none;
    color: inherit;
    flex: none;
    min-width: 0;
  }
  .sidebar .brand-logo {
    height: 28px;
    width: auto;
    max-width: 132px;
    object-fit: contain;
    object-position: left center;
    flex: none;
  }
  .brand-copy { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; }
  .brand-name { color: #181b22; font-size: 15px; font-weight: 720; letter-spacing: -0.02em; line-height: 1; }
  .brand-dot { color: #697384; font-size: 12px; }
  .brand-sub {
    color: #697384;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 500;
  }
  html.has-session .sidebar .nav[data-auth-nav] {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
  }
  html.has-session .sidebar-footer[data-auth-nav] {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    flex: none;
  }
  .sidebar .nav-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    width: auto;
    height: 32px;
    margin: 0;
    padding: 0 10px;
    border-radius: 8px;
    color: #181b22;
    background: transparent;
    font-size: 13px;
    font-weight: 550;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
  }
  .sidebar .nav-button:hover { color: #181b22; background: #f0f2f6; }
  .sidebar .nav-button.active,
  .sidebar .nav-button[aria-current="page"] {
    color: #c92339;
    background: #fbedef;
    font-weight: 650;
  }
  .sidebar .nav-button.active::before,
  .sidebar .nav-button[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 0;
    width: auto;
    height: 2px;
    border-radius: 3px;
    background: #c92339;
  }
  .sidebar .nav-icon { display: none; }
  .nav-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background: currentColor;
    mask: var(--icon) center / contain no-repeat;
    -webkit-mask: var(--icon) center / contain no-repeat;
  }
  .sidebar-footer {
    margin-top: 0;
    margin-left: auto;
    padding-top: 0;
    border-top: 0;
    gap: 8px;
  }
  .sidebar-footer .account {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
  }
  .sidebar .avatar { display: none; }
  .avatar {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fbedef;
    color: #c92339;
    font-size: 12px;
    font-weight: 700;
    flex: none;
  }
  .user-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: #f5f6f8;
    border: 1px solid #e4e7ec;
    white-space: nowrap;
  }
  .sidebar-footer .account strong { display: inline; font-size: 13px; font-weight: 650; line-height: 1.2; }
  .sidebar-footer .account small { display: inline; color: #697384; font-size: 12px; }
  .account-logout {
    display: inline-flex;
    align-items: center;
    height: 32px;
    margin-left: 0;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #e4e7ec;
    color: #697384;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
  }
  .account-logout:hover { color: #c92339; }
  .sidebar-more { padding: 0 6px 4px; }
  .sidebar-more > summary {
    cursor: pointer;
    color: #697384;
    font-size: 12px;
    list-style: none;
    padding: 4px 0;
  }
  .sidebar-more > summary::-webkit-details-marker { display: none; }
  .sidebar-more a {
    display: block;
    color: #181b22;
    text-decoration: none;
    font-size: 12px;
    padding: 3px 0;
  }
  .sidebar-more a:hover { color: #c92339; }
  .content-shell { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
  .shell .topbar {
    height: auto;
    min-height: 0;
    flex-wrap: nowrap;
    gap: 16px;
    padding: 14px 22px 0;
    background: transparent;
    border-bottom: 0;
  }
  .workspace-title { min-width: 0; }
  .workspace-title h1 {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 680;
    letter-spacing: -0.02em;
  }
  .workspace-title p { margin: 2px 0 0; color: #697384; font-size: 12px; line-height: 1.35; }
  .top-spacer { flex: 1; }
  .top-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .shell .main.page {
    display: block;
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 10px 16px 12px;
  }
  .shell .panel,
  #ops,
  .connections-panel,
  .studio-panel {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 16px;
    padding: 10px 14px 12px;
  }
  .tabs[hidden], .seg.tabs[hidden] { display: none !important; }
  .tabs, .settings .seg.tabs, .market-tabs {
    display: flex;
    gap: 0;
    align-items: flex-end;
    border-bottom: 1px solid #e4e7ec;
    margin: 0 0 10px;
  }
  .settings .seg-btn, .market-tabs .seg-btn {
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #697384;
    font-size: 13px;
    font-weight: 600;
  }
  .settings .seg-btn[aria-selected="true"], .market-tabs .seg-btn[aria-selected="true"] {
    color: #c92339;
    background: transparent;
    border-bottom-color: #c92339;
  }
  .tab-alias {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .admin-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
  .v21-support-users { width: 100%; border-collapse: collapse; }
  .v21-support-users th, .v21-support-users td {
    padding: 7px 8px;
    border-bottom: 1px solid #e4e7ec;
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
  }
  .v21-support-users th { color: #697384; font-size: 12px; font-weight: 600; }
  .v21-support-users .member-id-line { display: flex; align-items: center; gap: 8px; }
  .v21-support-users .member-name { font-weight: 650; }
  .v21-support-users .member-meta { display: block; color: #697384; font-size: 11px; }
  .v21-support-users .member-action { text-align: right; width: 168px; white-space: nowrap; }
  .v21-support-users .action-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-start; }
  .v21-support-users .action-row .btn { height: 26px; padding: 0 8px; font-size: 12px; }
  .mod-pills { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
  .mod-pill {
    display: inline-flex; align-items: center; height: 20px; padding: 0 6px;
    border-radius: 999px; border: 1px solid #e4e7ec; background: #fff;
    color: #697384; font-size: 11px; line-height: 20px; white-space: nowrap;
  }
  .mod-pill.on { color: #0f7a3a; background: #e8f6ee; border-color: #b7e4c7; }
  .mod-pill.reserved { border-style: dashed; color: #697384; background: #f7f8fa; }
  .browser-admin .member-tabs { margin: 8px 0 12px; }
  .browser-admin .line-table input,
  .browser-admin .line-table select {
    width: 100%;
    min-width: 72px;
    height: 28px;
    box-sizing: border-box;
  }
  .module-strip {
    display: flex; align-items: center; gap: 6px; height: 30px; margin-top: 6px;
    white-space: nowrap; overflow: hidden;
  }
  .grant-dialog .module-strip {
    height: auto; overflow: visible; flex-wrap: wrap; white-space: normal; align-items: flex-start;
  }
  .grant-dialog .mod-check { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; margin: 0 8px 4px 0; }
  .grant-dialog .country-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
  .country-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
  .country-tab {
    border: 1px solid #e4e7ec; background: #fff; border-radius: 999px; height: 28px; padding: 0 10px;
    font-size: 12px; cursor: pointer;
  }
  .country-tab[aria-selected="true"] { border-color: #c92339; color: #c92339; background: #fbedef; }
  .country-panel[hidden] { display: none !important; }
  .country-tools { display: flex; gap: 8px; margin: 4px 0; }
  .country-tools button { height: 26px; padding: 0 8px; border: 1px solid #e4e7ec; border-radius: 8px; background: #fff; font-size: 12px; cursor: pointer; }
  .browser-card { margin: 0 0 10px; padding: 10px 12px; border: 1px solid #e4e7ec; border-radius: 12px; background: #fff; }
  .browser-card h3 { margin: 0 0 4px; font-size: 14px; }
  .browser-card p { margin: 0 0 8px; font-size: 13px; }
  .module-strip .mod-pill { flex: none; }
  .grant-section { margin: 2px 0 0; font-size: 12px; font-weight: 650; }
  .preview-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin: 0 0 8px; padding: 8px 12px; border: 1px solid #f0d3a6; background: #fff8ee; border-radius: 10px;
  }
  .preview-banner p { margin: 0; font-size: 13px; line-height: 1.4; }
  .preview-tags { color: #697384; font-size: 12px; }
  .preview-switch { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; white-space: nowrap; overflow: hidden; }
  .preview-switch-label { color: #697384; font-size: 12px; flex: none; }
  .preview-pill {
    display: inline-flex; align-items: center; height: 24px; padding: 0 8px;
    border-radius: 999px; border: 1px solid #e4e7ec; background: #fff; color: #181b22;
    font-size: 12px; text-decoration: none; white-space: nowrap;
  }
  .preview-pill.active { border-color: #c92339; color: #c92339; background: #fbedef; }
  .muted-action { color: #697384; font-size: 12px; white-space: nowrap; }
  body.preview-mode [data-copy="header"] { display: none !important; }
  .role-badge.admin { color: #c92339; background: #fbedef; }
  .role-badge.member { color: #181b22; background: #f0f2f6; }
  .ghost-button {
    height: 28px;
    padding: 0 10px;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    background: #fff;
    color: #181b22;
    font-size: 12px;
  }
  .conn-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .conn-column h3 { margin: 0 0 6px; font-size: 13px; }
  .settings .settings-conns { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
  .settings .conn-name {
    margin: 0;
    min-width: 0;
    flex: 1 1 140px;
    font-size: 13px;
    font-weight: 620;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
  }
  .status-pill i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    margin-right: 4px;
  }
  .market-tag {
    color: #697384;
    font-size: 11px;
    border: 1px solid #e4e7ec;
    border-radius: 999px;
    padding: 1px 6px;
  }
  .connections .conn-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .connections .conn-column h3 { margin: 0 0 8px; font-size: 13px; }
  .connections .conn-column h3 small { color: #697384; font-weight: 550; }
  .connections .conn-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .connections-panel { margin-top: 8px; }
  .agent-install.agent-bar { min-height: 0; margin: 0 0 8px; display: flex; align-items: center; padding: 6px 10px; }
  .agent-bar-copy strong { font-weight: 600; color: #181b22; }
  .grant-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(960px, 94vw);
    max-height: calc(100dvh - 24px);
    margin: 0;
    border: 1px solid #e4e7ec;
    border-radius: 16px;
    overflow: visible;
  }
  .grant-dialog .dialog-scroll { max-height: none; overflow: visible; }
  .grant-dialog .choice,
  .grant-dialog .choice.connection-row {
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    padding: 0 8px;
    overflow: hidden;
    border-radius: 8px;
  }
  .grant-dialog .choice > span,
  .grant-dialog .choice-line {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: visible;
    white-space: nowrap;
    text-overflow: unset;
  }
  .grant-dialog .grant-advanced[hidden] { display: none !important; }
  .login-split {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    background: #f6f4f3;
  }
  .guest-gate.login-split { max-width: none; padding: 0; }
  .guest-gate.login-split h1 { font-size: 28px; letter-spacing: -0.03em; margin: 0 0 8px; }
  .guest-gate.login-split p { margin: 0 0 16px; }
  .login-showcase {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100dvh;
    padding: 28px 48px 48px;
    background: #f3f1f0 url("/login/login-bg-light.webp") center / cover no-repeat;
  }
  .login-showcase img { height: 28px; width: auto; }
  .login-showcase h2 {
    margin: 0;
    font-size: 52px;
    line-height: 1.12;
    letter-spacing: -0.04em;
    font-weight: 750;
    color: #181b22;
  }
  .login-showcase h2 span { display: block; color: #c92339; }
  .login-showcase p { max-width: 28rem; margin: 12px 0 0; color: #697384; font-size: 15px; line-height: 1.6; }
  .login-card { display: flex; align-items: center; justify-content: center; padding: 28px; }
  .login-card-inner {
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 24px;
    padding: 28px 28px 20px;
    box-shadow: 0 18px 40px oklch(15% 0.01 28 / 0.06);
  }
  .login-card-inner h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -0.03em; }
  .login-card-inner .lead, .login-card-inner p { color: #697384; }
  .login-card-inner label { display: block; margin: 12px 0 6px; font-size: 13px; color: #181b22; }
  .login-card-inner input {
    width: 100%;
    height: 42px;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
  }
  .login-card-inner .btn.primary { width: 100%; height: 42px; margin-top: 16px; border-radius: 12px; }
  .login-card-inner .advanced { margin-top: 14px; }
  .login-card-inner .advanced[hidden],
  .login-card #loginStatus[hidden],
  .proxy-row[hidden] { display: none !important; }
  body[data-page="login"] .sidebar { display: none; }
  body[data-page="login"] .login-split { width: 100%; }
  .login-card #passwordLogin { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .proxy-board { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
  .proxy-note { margin: 0; color: #697384; font-size: 12px; line-height: 1.5; }
  .proxy-row {
    display: grid;
    grid-template-columns: 92px repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
    padding: 8px;
    border: 1px solid #e4e7ec;
    border-radius: 12px;
    background: #fff;
  }
  .proxy-row strong { font-size: 13px; color: #181b22; padding-bottom: 8px; }
  .proxy-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #697384; }
  .proxy-row input,
  .proxy-row select {
    height: 32px;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    padding: 0 8px;
    background: #fff;
    color: #181b22;
  }
  .browser-module-panel { margin-bottom: 16px; }
  .nav-button[hidden] { display: none !important; }
  .login-foot { margin: 18px 0 0; color: #697384; font-size: 12px; }
  .nav-advanced[hidden] { display: none !important; }
  .tab-alias { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .market-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: auto; max-width: none; height: 22px; padding: 0 6px; box-sizing: border-box; flex: none;
    border-radius: 6px; background: #f5f6f8; border: 1px solid #e4e7ec;
    color: #181b22; font-size: 11px; font-weight: 650; white-space: nowrap;
  }
  .settings .scope-stack { display: grid; gap: 2px; width: 100%; }
  .settings .scope-stack .scope-chip { display: block; width: auto; max-width: 100%; }
  .settings .scope-stack .scope-line {
    display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; width: auto;
    white-space: nowrap;
  }
  .channel-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; }
  .channel-table tr { display: table-row; }
  .channel-table th, .channel-table td {
    display: table-cell;
    text-align: left; padding: 6px 10px; border-bottom: 1px solid #e4e7ec;
    vertical-align: middle; font-size: 12px; line-height: 1.35;
  }
  .channel-table th { color: #697384; font-weight: 600; white-space: nowrap; }
  .channel-table .col-market { width: 13%; white-space: nowrap; }
  .channel-table .col-country { width: 8%; white-space: nowrap; }
  .channel-table .col-brand { width: 10%; white-space: nowrap; }
  .channel-table .col-platform { width: 11%; }
  .channel-table .col-account { width: 20%; }
  .channel-table .col-subapps { width: 22%; white-space: normal; }
  .channel-table .col-who { width: 12%; white-space: normal; overflow: visible; text-overflow: clip; }
  .channel-table .col-usage { width: 12%; }
  .channel-table .col-status { width: 8%; white-space: nowrap; }
  .channel-table .col-actions { width: 10%; white-space: nowrap; }
  .channel-table th.col-actions,
  .channel-table td.col-actions { display: table-cell; }
  .channel-table-service { table-layout: fixed; }
  .channel-table-service .col-market { width: 13%; white-space: nowrap; }
  .channel-table-service .col-country { width: 8%; white-space: nowrap; }
  .channel-table-service .col-brand { width: 9%; white-space: nowrap; }
  .channel-table-service .col-account { width: 16%; }
  .channel-table-service .col-subapps { width: 22%; white-space: normal; }
  .channel-table-service .col-usage { width: 14%; white-space: nowrap; overflow: visible; text-overflow: clip; }
  .channel-table-service .col-status { width: 10%; white-space: nowrap; }
  .channel-table-service .col-actions { width: 13%; white-space: nowrap; }
  .channel-table-service .col-users { width: 10%; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
  .channel-table-service th,
  .channel-table-service td { padding: 4px 8px; }
  .channel-table-service th.col-status,
  .channel-table-service td.col-status { padding-left: 2px; padding-right: 2px; }
  .channel-table-service .status-pill { padding: 0 1px; font-size: 11px; }
  .channel-table-service .status-pill i { width: 6px; height: 6px; margin-right: 2px; }
  .mint-out {
    display: block; margin-top: 4px; font-size: 11px; line-height: 1.35;
    word-break: break-all; white-space: normal;
  }
  .mint-out:empty { display: none; }
  .channel-name { display: flex; align-items: center; gap: 6px; }
  .channel-name strong { flex: none; white-space: nowrap; font-weight: 650; }
  .channel-name .platform-badge { flex: none; }
  .channel-detail { color: #181b22; }
  .channel-actions, .channel-table .btn-row {
    display: flex; flex-wrap: nowrap; gap: 4px; align-items: center; margin: 0;
  }
  .btn-row.channel-actions,
  .channel-table .btn-row.channel-actions {
    display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; margin: 0;
  }
  .channel-actions .btn, .channel-table .btn {
    height: 26px; padding: 0 8px; font-size: 12px; white-space: nowrap; flex: none;
  }
  .channel-table-service .channel-actions .btn,
  .channel-table-service .btn { padding: 0 6px; height: 24px; }
  .channel-table-service .btn-row.channel-actions { gap: 4px; }
  .table-head-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 4px; }
  .table-head-bar h2 { margin: 0; white-space: nowrap; font-size: 13px; }
  .table-head-bar .filter-group { margin: 0; }
  details.advanced[hidden] { display: none !important; }
  body[data-page="station"] .map-toolbar { flex-wrap: nowrap; gap: 6px; margin: 0 0 6px; overflow: hidden; }
  body[data-page="station"] .map-toolbar .filter-group { flex: none; }
  body[data-page="station"] .filter { height: 24px; padding: 0 8px; }
  .service-refresh-raw[hidden] { display: none !important; }
  .monitor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
  .monitor-grid > .row-card { display: flex; flex-direction: column; height: 100%; min-height: 280px; }
  .kpi-badge { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; background: #fbedef; color: #c92339; font-weight: 650; font-size: 12px; }
  .bar-labels { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
  .sync-meta { margin: 8px 0; font-size: 12px; color: #475467; }
  .repair-list li, .repair-row { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px; }
  .repair-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body[data-page="connections"] .topbar { display: flex; align-items: center; gap: 16px; }
  body[data-page="connections"] .topbar .agent-install { margin: 0 0 0 auto; flex: 1 1 auto; }
  body[data-page="connections"] .agent-bar { margin: 0; }
  .preview-switch { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
  .sidebar .preview-switch { flex-wrap: nowrap; }
  .monitor-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .monitor-head h2 { margin: 0; }
  .metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 6px 0; }
  .metric-grid div { background: #f5f6f8; border-radius: 8px; padding: 6px 8px; min-width: 0; }
  .metric-grid span { display: block; color: #697384; font-size: 11px; }
  .metric-grid strong { display: block; margin-top: 2px; font-size: 12px; font-weight: 650; }
  .row-card .note { margin: 4px 0 0; font-size: 11px; line-height: 1.4; }
  .slot-fold { margin-top: 8px; }
  .top-meta .stats, .stats.inline-stats {
    display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0; background: transparent;
  }
  .top-meta .stat, html.has-session .stats .stat {
    display: inline-flex; align-items: baseline; gap: 6px;
    width: auto; padding: 0; text-align: left;
    background: transparent; border: 0; border-radius: 0;
  }
  .top-meta .stat b, html.has-session .stats .stat b { display: inline; font-size: 16px; }
  .top-meta .stat span, html.has-session .stats .stat span {
    font-size: 12px; letter-spacing: 0; text-transform: none;
  }
  html.has-session .stats { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 0 0 8px; }
  .v21-support-users { width: 100%; table-layout: fixed; }
  .v21-support-users col.col-member { width: 14%; }
  .v21-support-users col.col-modules { width: 18%; }
  .v21-support-users col.col-stores { width: 28%; }
  .v21-support-users col.col-accounts { width: 22%; }
  .v21-support-users col.col-ops { width: 18%; }
  .v21-support-users tr.member-row > td { vertical-align: middle; }
  .store-grid { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 6px 10px; }
  .account-stack { display: grid; gap: 6px; }
  .scope-line { display: flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; }
  .scope-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .country-badge, .brand-badge {
    display: inline-flex; align-items: center; flex: none; height: 20px; padding: 0 6px;
    border-radius: 999px; font-size: 11px; border: 1px solid #e4e7ec; background: #f8fafc; color: #344054;
  }
  .brand-badge { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
  .btn-secondary.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
  }
  .v21-support-users .scope-coverage { white-space: nowrap; margin-right: 8px; }
  .v21-support-users tr { display: table-row; }
  .v21-support-users th,
  .v21-support-users td { display: table-cell; vertical-align: middle; }
  .v21-support-users td.scope-chips { vertical-align: middle; padding-top: 6px; padding-bottom: 6px; }
  .actions-required {
    display: flex; align-items: center; gap: 10px;
    margin: 4px 0; padding: 4px 10px;
  }
  .actions-required h2 { margin: 0; font-size: 13px; white-space: nowrap; }
  .actions-required p { margin: 0; font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  body[data-page="service"] .shell .main.page { padding: 6px 14px 6px; }
  body[data-page="service"] .stack { gap: 4px; }
  body[data-page="service"] .monitor-grid { margin: 0; gap: 6px; }
  body[data-page="service"] .monitor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-page="service"] .row-card { padding: 6px 8px; }
  body[data-page="service"] .row-card > h2,
  body[data-page="service"] .monitor-head h2 { margin: 0 0 4px; font-size: 13px; }
  body[data-page="service"] .row-card > p { margin: 2px 0; font-size: 12px; line-height: 1.35; }
  body[data-page="service"] .metric-grid { margin: 4px 0; gap: 4px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body[data-page="service"] .metric-grid div { padding: 4px 6px; }
  body[data-page="service"] .metric-grid strong { font-size: 11px; }
  body[data-page="service"] .row-card .note {
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
    overflow: hidden; margin: 2px 0 0;
  }
  body[data-page="service"] .filter-group { margin: 0 0 6px; }
  .slot-fold { margin-top: 4px; }
  .slot-fold > summary, .stub-fold > summary { font-size: 12px; cursor: pointer; }
  .channel-filters, .channel-filter-bar, .service-filter-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 20px;
    align-items: center;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin: 0 0 10px;
  }
  .filter-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .filter-search {
    flex: 1; min-width: 0; height: 28px; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 0 8px; background: #fff; font-size: 12px;
  }
  .filter-reset { border: 0; background: transparent; color: #c92339; font-size: 12px; cursor: pointer; white-space: nowrap; }
  body[data-page="service"] .channel-filters { margin: 0 0 8px; }
  body[data-page="service"] .filter-pill { height: 24px; padding: 0 8px; font-size: 11px; }
  body[data-page="service"] .kpi-number { margin: 2px 0 4px; font-size: 22px; }
  body[data-page="service"] .bar-row { margin: 2px 0; }
  body[data-page="service"] .platform-kpis { margin-top: 4px; gap: 4px; }
  body[data-page="service"] .platform-kpis span { padding: 2px 6px; font-size: 11px; }
  body[data-page="service"] .metric-tiles div { padding: 4px 6px; }
  body[data-page="service"] .metric-tiles strong { font-size: 15px; }
  body[data-page="service"] .repair-list { margin: 4px 0 0; gap: 4px; }
  body[data-page="service"] .repair-list li { font-size: 12px; gap: 6px; }
  body[data-page="service"] .repair-list .btn, body[data-page="service"] .sync-actions .btn { height: 24px; padding: 0 8px; font-size: 11px; }
  body[data-page="service"] .sync-actions { margin-top: 4px; }
  .filter-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .filter-line > span { color: #697384; font-size: 12px; min-width: 72px; }
  .filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
  .filter-pill {
    height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid #e4e7ec;
    background: #fff; color: #181b22; font-size: 12px; cursor: pointer;
  }
  .filter-pill.active, .filter-pill[aria-pressed="true"] { color: #c92339; background: #fbedef; border-color: #f1c3cb; }
  .filter-count { margin: 0; color: #697384; font-size: 12px; }
  .member-chips, .scope-pills { display: flex; flex-wrap: wrap; gap: 4px; }
  .member-chip, .scope-pill {
    display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
    border-radius: 999px; border: 1px solid #e4e7ec; background: #f5f6f8;
    color: #181b22; font-size: 12px; white-space: nowrap;
  }
  .scope-pill.ok { color: #0f7a3a; background: #e8f6ee; border-color: #b7e4c7; }
  .scope-pill.warn { color: #92400e; background: #fff7ed; border-color: #fdba74; }
  .scope-pill.bad { color: #b42318; background: #fef3f2; border-color: #fecdca; }
  .platform-shop { background: #181b22; color: #fff; border-color: #181b22; }
  .platform-shopee { background: #fff4f0; color: #c2410c; border-color: #fdba74; }
  .platform-ads { background: #f5f6f8; color: #181b22; border-color: #181b22; }
  .platform-shopify { background: #f0fdf4; color: #3f6212; border-color: #bef264; }
  .usage-mini { display: inline-flex; align-items: center; gap: 6px; }
  .usage-mini .track { display: block; width: 72px; height: 8px; border-radius: 99px; background: #e5e7eb; overflow: hidden; }
  .usage-mini .track > i { display: block; height: 100%; border-radius: 99px; background: #c92339; }
  .usage-mini strong { font-size: 13px; font-weight: 720; }
  .kpi-number { margin: 4px 0 8px; font-size: 28px; line-height: 1.1; font-weight: 720; letter-spacing: -0.03em; }
  .kpi-number small { margin-left: 4px; color: #697384; font-size: 12px; font-weight: 550; }
  .bar-row { display: grid; grid-template-columns: minmax(92px, 128px) minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 4px 0; font-size: 12px; }
  .bar-track { display: block; height: 8px; border-radius: 99px; background: #eef0f3; overflow: hidden; }
  .bar-track > span { display: block; height: 100%; border-radius: 99px; background: #c92339; }
  .platform-kpis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
  .platform-kpis span { padding: 4px 8px; border-radius: 999px; background: #f5f6f8; border: 1px solid #e4e7ec; font-size: 12px; }
  .health-seg { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: #eef0f3; }
  .health-seg i { display: block; height: 100%; }
  .health-seg .ok { background: #16a34a; }
  .health-seg .warn { background: #d97706; }
  .health-seg .bad { background: #dc2626; }
  .health-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 8px; color: #697384; font-size: 12px; }
  .metric-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .metric-tiles div { background: #f5f6f8; border-radius: 10px; padding: 8px; }
  .metric-tiles strong { display: block; font-size: 18px; line-height: 1.2; }
  .metric-tiles span { color: #697384; font-size: 11px; }
  .repair-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
  .repair-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .sync-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
  @media (max-width: 1100px) {
    .monitor-grid, body[data-page="service"] .monitor-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 960px) {
    .app.shell { grid-template-columns: 1fr; }
    .sidebar { width: 100%; height: auto; min-height: 64px; max-height: none; flex-wrap: wrap; padding-block: 8px; }
    .login-split, .guest-gate.login-split { grid-template-columns: 1fr; }
    .login-showcase { min-height: 280px; }
    .conn-columns, .connections .conn-list { grid-template-columns: 1fr; }
    .store-grid { grid-template-columns: 1fr; }
  }

  /* Shadowrocket Proxy Node Table & Duration Presets & Feishu Bot Admin Panel */
  .shadowrocket-table input.sr-input,
  .shadowrocket-table select.sr-select {
    width: 100%;
    height: 30px;
    padding: 0 8px;
    border-radius: 7px;
    border: 1px solid #d5dbe3;
    background: #fff;
    font-size: 12px;
    color: #181b22;
  }
  .shadowrocket-table .sr-actions {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
  }
  .country-detect-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
  }
  .country-detect-badge.detected {
    background: #ecfdf3;
    color: #067647;
    border: 1px solid #abefc6;
  }
  .country-detect-badge.pending {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
  }
  .module-strip.module-checks {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .module-check-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
  }
  .browser-grant-box {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
  }
  .browser-grant-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .duration-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 12px;
  }
  .duration-pills {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .duration-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid #d5dbe3;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #344054;
    cursor: pointer;
  }
  .duration-pill input[type="radio"] {
    margin: 0;
    accent-color: #c92339;
  }
  .duration-pill.active,
  .duration-pill:has(input:checked) {
    background: #fbedef;
    color: #c92339;
    border-color: #f1c3cb;
  }
  .duration-preview {
    color: #067647;
    background: #ecfdf3;
    border: 1px solid #abefc6;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
  }
  .feishu-config-panel {
    display: grid;
    gap: 12px;
  }
  .feishu-banner-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
  }
  .feishu-banner-copy h3 {
    margin: 0 0 2px;
    font-size: 15px;
  }
  .feishu-banner-copy p.note {
    margin: 0;
  }
  .feishu-inline-inputs {
    display: grid;
    gap: 4px;
  }
  .feishu-input {
    width: 100%;
    height: 26px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid #d5dbe3;
    font-size: 11px;
    background: #fff;
  }
  .feishu-drawer-card {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
  }
  .feishu-drawer-card h4 {
    margin: 0 0 8px;
    font-size: 13px;
  }
  .feishu-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
  }
  .feishu-form-grid label {
    display: grid;
    gap: 4px;
    font-size: 12px;
    color: #475467;
  }
  .feishu-form-grid input,
  .feishu-form-grid select {
    height: 30px;
    padding: 0 8px;
    border-radius: 7px;
    border: 1px solid #d5dbe3;
    font-size: 12px;
    background: #fff;
  }
  .feishu-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  /* === APPLE HIG / LINEAR / STRIPE OVERHAUL === */
  body {
    background: #f5f5f7;
    color: #1d1d1f;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.011em;
  }

  /* 1. Unify Top Navigation & Eliminate Duplicate Headers / Floating Pills */
  .side-nav {
    height: 54px;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: none;
  }
  .brand-copy strong {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1d1d1f;
  }
  .brand-sub,
  .brand-copy .brand-dot,
  a.nav-button[data-nav-browser],
  .settings-toolbar,
  [data-settings-who],
  .admin-summary,
  [data-connection-summary] {
    display: none !important;
  }
  .nav-group {
    background: rgba(118, 118, 128, 0.11);
    padding: 3px;
    border-radius: 9px;
    gap: 2px;
  }
  .nav-button {
    height: 30px;
    padding: 0 14px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: #515154;
  }
  .nav-button.active,
  .nav-button[aria-current="page"] {
    background: #ffffff;
    color: #1d1d1f;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.04);
  }
  .nav-button.active::after,
  .nav-button[aria-current="page"]::after {
    display: none;
  }

  /* 2. Calm Page Container & Compact Topbar */
  .shell .main.page {
    display: block;
    max-width: 1320px;
    margin: 0 auto;
    padding: 16px 28px 32px;
  }
  .topbar {
    min-height: 0;
    margin-bottom: 12px;
    padding: 0;
    border-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: nowrap;
  }
  .workspace-title h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.022em;
    color: #1d1d1f;
    margin: 0;
  }
  .workspace-title p {
    display: none;
  }
  body[data-page="ops"] .topbar,
  body[data-page="service"] .topbar {
    margin-bottom: 10px;
  }

  /* 3. Apple Segmented Control for 4 Admin Views */
  .seg.tabs.admin-config-tabs {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: rgba(118, 118, 128, 0.12);
    border: 0;
    border-radius: 10px;
    margin-bottom: 14px;
    width: auto;
  }
  .seg.tabs.admin-config-tabs .seg-btn {
    height: 30px;
    padding: 0 14px;
    border-radius: 7px;
    border: 0;
    background: transparent;
    color: #515154;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: none;
  }
  .seg.tabs.admin-config-tabs .seg-btn b {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: #515154;
  }
  .seg.tabs.admin-config-tabs .seg-btn[aria-selected="true"] {
    background: #ffffff;
    color: #1d1d1f;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  }
  .seg.tabs.admin-config-tabs .seg-btn[aria-selected="true"] b {
    background: #1d1d1f;
    color: #ffffff;
  }

  /* 4. Single-Line 44px Apple / Linear Filter Toolbar (Replaces 5-Row Filter Wall) */
  .channel-filters.channel-filter-bar,
  .channel-filters.service-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 12px;
    min-height: 46px;
    padding: 8px 16px;
    margin: 0;
    background: #fafafc;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
  }
  .channel-filters.service-filter-bar {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }
  /* Hide multi-row pill walls; keep only the primary segmented bar on the left */
  .channel-filters.channel-filter-bar > .filter-line,
  .channel-filters.service-filter-bar > .filter-line {
    display: none;
  }
  .channel-filters.channel-filter-bar:not([data-connection-filters]) > .filter-line-status,
  .channel-filters.service-filter-bar > .filter-line-status,
  .channel-filters[data-connection-filters] > .filter-line-market {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
  }
  .channel-filters > .filter-line > span {
    display: none;
  }
  .channel-filters .filter-pills {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(118, 118, 128, 0.11);
    padding: 2px;
    border-radius: 8px;
  }
  .channel-filters .filter-pill {
    height: 26px;
    padding: 0 10px;
    border-radius: 6px;
    border: 0;
    background: transparent;
    color: #515154;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
  }
  .channel-filters .filter-pill.active,
  .channel-filters .filter-pill[aria-pressed="true"],
  .channel-filters .filter-pill[aria-selected="true"] {
    background: #ffffff;
    color: #1d1d1f;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  }
  .channel-filters .filter-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    margin-left: auto;
  }
  .apple-filter-selects {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .apple-filter-select {
    height: 28px;
    padding: 0 24px 0 10px;
    border-radius: 7px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
    color: #1d1d1f;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
  }
  .channel-filters .filter-search {
    height: 28px;
    width: 165px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: #ffffff;
    font-size: 12px;
  }
  .channel-filters .filter-reset {
    height: 28px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    color: #515154;
    font-size: 12px;
  }
  .channel-filters .filter-count {
    display: none;
  }

  /* 5. Apple / Linear Surfaces, Cards & Tables */
  .row-card,
  .table-wrap,
  .proxy-board {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  }
  .channel-filters + .table-wrap {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
  .channel-table th,
  .v21-support-users th {
    background: #fafafc;
    color: #6e6e73;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 9px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }
  .channel-table td,
  .v21-support-users td {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.045);
    font-size: 13px;
    color: #1d1d1f;
  }

  /* 6. Ban Rainbow Tag Soup — Neutral Monochrome Badges + Single Status Dot */
  .country-badge {
    background: transparent;
    border: 0;
    padding: 0;
    color: #1d1d1f;
    font-size: 13px;
    font-weight: 600;
  }
  .brand-badge {
    background: #f5f5f7;
    color: #515154;
    border: 0;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
  }
  .platform-badge,
  .platform-badge.platform-shop,
  .platform-badge.platform-shopee,
  .platform-badge.platform-ads,
  .platform-badge.platform-shopify {
    background: #f5f5f7;
    color: #515154;
    border: 0;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
  }
  .mod-pill,
  .mod-pill.api,
  .mod-pill.mcp,
  .mod-pill.bd,
  .mod-pill.browser {
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
  }
  .scope-pill,
  .scope-pill.ok {
    background: #f5f5f7;
    color: #515154;
    border: 0;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 500;
  }
  .scope-pill.warn {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.25);
  }
  .scope-pill.bad {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.25);
  }
  .member-chip {
    background: #f5f5f7;
    color: #515154;
    border: 0;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
  }
  .status-pill {
    background: transparent;
    border: 0;
    padding: 0;
    font-size: 12px;
    font-weight: 600;
  }
  .status-pill.ok {
    color: #059669;
  }
  .status-pill.warn {
    color: #d97706;
  }
  .status-pill.bad {
    color: #dc2626;
  }

  /* 7. Team Permissions Table (01): Clean Apple List Rows Instead of 24 Colliding Pill Boxes */
  .v21-support-users td {
    padding: 14px 16px;
    vertical-align: top;
  }
  .v21-support-users .scope-chips {
    display: grid;
    gap: 5px;
  }
  .v21-support-users .scope-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 0;
    padding: 1px 0;
    border-radius: 0;
    font-size: 12.5px;
    color: #1d1d1f;
  }
  .v21-support-users .scope-chip b {
    font-size: 11px;
    font-weight: 600;
    color: #6e6e73;
    background: #f5f5f7;
    padding: 1px 6px;
    border-radius: 4px;
    min-width: 34px;
    text-align: center;
  }
  .v21-support-users .scope-chip em {
    font-style: normal;
    font-size: 11px;
    color: #86868b;
    background: transparent;
    border: 0;
    padding: 0;
  }
  .v21-support-users .scope-chip em::before {
    content: "· ";
  }

  /* 8. Feishu Bot Config (03): Calm Read-Only Table + Hidden Drawer by Default */
  .feishu-banner-head {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 14px 18px;
  }
  .channel-name .sub-caption {
    display: block;
    font-size: 11.5px;
    color: #86868b;
    font-weight: 400;
    margin-top: 2px;
  }
  .feishu-scope-text {
    font-size: 12.5px;
    color: #515154;
  }
  .feishu-cred-summary {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: #1d1d1f;
    background: #f5f5f7;
    padding: 3px 8px;
    border-radius: 6px;
  }
  .feishu-cred-summary.empty {
    font-family: inherit;
    color: #86868b;
    background: transparent;
    padding: 0;
  }
  .feishu-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  /* 9. Shadowrocket Node Table & Modal (04, 05) */
  .browser-head {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .browser-head-copy h3 {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
  }
  .browser-head-copy p.note {
    margin: 0;
    font-size: 12px;
    color: #6e6e73;
  }
  .sr-display-remark {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
  }
  .mono-endpoint {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: #1d1d1f;
    background: #f5f5f7;
    padding: 2px 7px;
    border-radius: 5px;
  }
  .sr-auth-summary {
    font-size: 12px;
    color: #6e6e73;
  }
  .sr-node-dialog {
    width: min(560px, 92vw);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 0;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  }
  .sr-modal-body {
    padding: 18px 22px;
    display: grid;
    gap: 14px;
  }
  .sr-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .sr-modal-grid label {
    display: grid;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: #515154;
  }
  .sr-modal-grid input,
  .sr-modal-grid select {
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.14);
    font-size: 13px;
    background: #ffffff;
    color: #1d1d1f;
  }
  .sr-modal-detect-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f5f5f7;
    border-radius: 10px;
    font-size: 12px;
    color: #515154;
  }

  /* 10. Service Dashboard (07): 4-Column Single-Row KPI Header + Above-the-Fold Table */
  body[data-page="service"] .monitor-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
  }
  body[data-page="service"] .monitor-grid > .row-card {
    padding: 12px 14px;
    margin: 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
  }
  body[data-page="service"] .monitor-head {
    margin-bottom: 8px;
  }
  body[data-page="service"] .monitor-head h2 {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
  }
  body[data-page="service"] .kpi-badge {
    font-size: 11px;
    padding: 2px 8px;
    background: #f5f5f7;
    color: #1d1d1f;
    border: 0;
  }
  body[data-page="service"] .bar-row {
    font-size: 11.5px;
    padding: 3px 0;
  }
  body[data-page="service"] .metric-tiles {
    gap: 6px;
    margin-top: 6px;
  }
  body[data-page="service"] .metric-tiles > div {
    padding: 6px 4px;
    background: #f5f5f7;
    border: 0;
    border-radius: 8px;
    text-align: center;
  }
  body[data-page="service"] .metric-tiles strong {
    font-size: 15px;
  }
  body[data-page="service"] .metric-tiles span {
    font-size: 10.5px;
  }
  body[data-page="service"] .sync-meta,
  body[data-page="service"] .sync-summary {
    font-size: 11.5px;
    color: #6e6e73;
    margin: 0 0 6px;
    line-height: 1.35;
  }
  body[data-page="service"] .repair-list {
    gap: 4px;
    margin-top: 4px;
  }
  body[data-page="service"] .repair-row {
    padding: 4px 8px;
    background: #fafafc;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    font-size: 11px;
  }
  body[data-page="service"] .repair-row .btn {
    height: 22px;
    padding: 0 8px;
    font-size: 11px;
    background: #f5f5f7;
    color: #1d1d1f;
    border: 1px solid rgba(0, 0, 0, 0.08);
  }
  body[data-page="service"] .table-head-bar {
    display: none;
  }
  body[data-page="service"] .channel-table td {
    padding: 7px 12px;
  }

  /* 11. Customer View /me/connections (08): Compact Inline MCP Bar + Preview Switcher */
  .agent-install.agent-bar {
    margin: 0;
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  }
  .agent-bar-row {
    gap: 12px;
  }
  .agent-bar-copy strong {
    font-size: 12.5px;
    font-weight: 600;
    color: #1d1d1f;
  }
  .stub-fold.slot-fold {
    margin-top: 10px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    padding: 8px 14px;
  }

  /* === 12. High-Specificity Apple/Linear Polish for Screenshots 01..08 === */
  .sidebar {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    padding: 0 28px !important;
    background: rgba(255, 255, 255, 0.88) !important;
    backdrop-filter: saturate(180%) blur(20px) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
  }
  .sidebar .nav-button {
    height: 30px !important;
    padding: 0 14px !important;
    border-radius: 7px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #515154 !important;
    background: transparent !important;
  }
  .sidebar .nav-button.active,
  .sidebar .nav-button[aria-current="page"] {
    background: #f2f2f7 !important;
    color: #1d1d1f !important;
    font-weight: 600 !important;
  }
  .sidebar .nav-button.active::before,
  .sidebar .nav-button[aria-current="page"]::before {
    display: none !important;
  }

  /* Quiet ghost buttons for non-urgent actions in tables */
  .channel-actions .btn.copy,
  .channel-table .btn.copy,
  .sr-actions .btn.copy,
  .feishu-table .btn.copy {
    background: #f5f5f7 !important;
    color: #515154 !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: 7px !important;
    height: 26px !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
  }
  .channel-actions .btn.copy:hover,
  .channel-table .btn.copy:hover,
  .sr-actions .btn.copy:hover,
  .feishu-table .btn.copy:hover {
    background: #e8e8ed !important;
    color: #1d1d1f !important;
  }

  /* Shadowrocket Node Modal (05) header & footer */
  .sr-node-dialog .dialog-head {
    padding: 16px 22px 12px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  }
  .sr-node-dialog .dialog-head h3 {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: #1d1d1f !important;
    margin: 0 0 2px !important;
  }
  .sr-node-dialog .dialog-head p.note {
    font-size: 12px !important;
    color: #6e6e73 !important;
    margin: 0 !important;
  }
  .sr-node-dialog .dialog-foot {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    padding: 12px 22px 16px !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
    background: #fafafc !important;
    border-radius: 0 0 16px 16px !important;
  }
  .sr-node-dialog .dialog-foot .btn {
    height: 32px !important;
    padding: 0 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
  }
  .shadowrocket-table th:last-child,
  .shadowrocket-table td.col-actions {
    text-align: right !important;
  }
  .shadowrocket-table .sr-actions {
    justify-content: flex-end !important;
  }

  /* Member Permission Modal (06): Clean Apple Settings Sheet */
  .grant-dialog[data-member-editor] {
    width: min(860px, 94vw) !important;
    border-radius: 16px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18) !important;
  }
  .grant-dialog[data-member-editor] .dialog-scroll {
    padding: 18px 22px 14px !important;
    gap: 12px !important;
  }
  .grant-dialog[data-member-editor] .dialog-head {
    padding-bottom: 10px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
  }
  .grant-dialog[data-member-editor] .role-picks {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-top: 6px !important;
  }
  .grant-dialog[data-member-editor] .role-pick {
    height: 28px !important;
    border-radius: 7px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    background: #f5f5f7 !important;
    color: #515154 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
  }
  .grant-dialog[data-member-editor] .role-pick:has(input:checked) {
    background: #1d1d1f !important;
    color: #ffffff !important;
    border-color: #1d1d1f !important;
    font-weight: 600 !important;
  }
  .grant-dialog[data-member-editor] .country-tabs {
    background: rgba(118, 118, 128, 0.11) !important;
    padding: 3px !important;
    border-radius: 9px !important;
    display: inline-flex !important;
    gap: 2px !important;
  }
  .grant-dialog[data-member-editor] .country-tab {
    height: 28px !important;
    padding: 0 12px !important;
    border-radius: 7px !important;
    border: 0 !important;
    background: transparent !important;
    color: #515154 !important;
    font-weight: 500 !important;
  }
  .grant-dialog[data-member-editor] .country-tab[aria-selected="true"] {
    background: #ffffff !important;
    color: #1d1d1f !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
  }
  .grant-dialog[data-member-editor] .choice,
  .grant-dialog[data-member-editor] .choice.connection-row {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.07) !important;
    border-radius: 8px !important;
    padding: 0 10px !important;
    height: 34px !important;
  }
  .grant-dialog[data-member-editor] .choice:has(input:checked) {
    background: #f5f5f7 !important;
    border-color: rgba(0, 0, 0, 0.18) !important;
  }
  .grant-dialog[data-member-editor] .dialog-actions {
    padding: 12px 22px 14px !important;
    background: #fafafc !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: 0 0 16px 16px !important;
  }

  /* Service Dashboard (07) & Customer View (08): Calm Monochrome Progress Bars & Compact Layout */
  .bar-track > span,
  .usage-mini .track > i {
    background: #1d1d1f !important;
  }
  .usage-mini .track {
    width: 56px !important;
    height: 6px !important;
    background: #e8e8ed !important;
  }
  .usage-mini strong {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #1d1d1f !important;
  }
  body[data-page="service"] .shell .main.page {
    padding-top: 10px !important;
    padding-bottom: 16px !important;
  }
  body[data-page="service"] .topbar {
    margin-bottom: 8px !important;
  }
  body[data-page="service"] .monitor-grid {
    gap: 10px !important;
    margin-bottom: 10px !important;
  }
  body[data-page="service"] .monitor-grid > .row-card {
    min-height: 0 !important;
    height: auto !important;
    padding: 10px 14px !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
  }
  body[data-page="service"] .monitor-head button[data-sync-retry] {
    height: 24px !important;
    padding: 0 10px !important;
    font-size: 11.5px !important;
    background: #f5f5f7 !important;
    color: #1d1d1f !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 6px !important;
  }
  body[data-page="service"] .channel-table th {
    padding: 7px 10px !important;
  }
  body[data-page="service"] .channel-table td {
    padding: 5.5px 10px !important;
  }
  body[data-page="service"] .channel-filters {
    padding: 6px 12px !important;
    min-height: 38px !important;
  }
  body[data-page="service"] .stub-fold.slot-fold {
    margin-top: 6px !important;
    padding: 6px 12px !important;
  }

  /* Customer View /me/connections (08): Calm Scope Pills & Single-Line Topbar */
  body[data-page="connections"] .scope-pill,
  body[data-page="connections"] .scope-pill.ok,
  body[data-page="connections"] .scope-pill.warn,
  body[data-page="connections"] .scope-pill.bad {
    background: #f5f5f7 !important;
    color: #515154 !important;
    border: 0 !important;
  }
  body[data-page="connections"] .topbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 10px !important;
  }
  body[data-page="connections"] .topbar .agent-install {
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 4px 10px !important;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: 9px !important;
  }
  body[data-page="connections"] .agent-bar-actions .btn.primary {
    background: #1d1d1f !important;
    border-color: #1d1d1f !important;
    color: #ffffff !important;
  }
  .preview-switch {
    margin: 0 8px !important;
    background: rgba(118, 118, 128, 0.11) !important;
    padding: 3px 6px !important;
    border-radius: 8px !important;
    gap: 4px !important;
  }
  .preview-pill {
    height: 24px !important;
    padding: 0 10px !important;
    border-radius: 6px !important;
    border: 0 !important;
    background: transparent !important;
    color: #515154 !important;
    font-weight: 500 !important;
  }
  .preview-pill.active {
    background: #ffffff !important;
    color: #1d1d1f !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08) !important;
  }
  .preview-switch .btn.copy[data-exit-preview] {
    height: 24px !important;
    padding: 0 8px !important;
    font-size: 11.5px !important;
    border: 0 !important;
    background: transparent !important;
    color: #515154 !important;
  }

  /* === 13. Final Ultra-Clean Apple HIG Polish === */
  .proxy-board[hidden],
  .proxy-row[hidden],
  .grant-dialog[data-member-editor] .proxy-board {
    display: none !important;
  }

  /* Make capability items (.scope-pill) render as clean dot-separated text instead of tag soup */
  .scope-pills {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0 !important;
  }
  .scope-pill,
  .scope-pill.ok,
  body[data-page="connections"] .scope-pill,
  body[data-page="connections"] .scope-pill.ok,
  body[data-page="service"] .scope-pill,
  body[data-page="service"] .scope-pill.ok {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    height: auto !important;
    border-radius: 0 !important;
    color: #515154 !important;
    font-size: 12.5px !important;
    font-weight: 450 !important;
  }
  .scope-pill + .scope-pill::before {
    content: " · ";
    color: #86868b;
    padding: 0 3px;
    font-weight: 400;
  }
  .scope-pill.warn,
  body[data-page="service"] .scope-pill.warn {
    background: #fffbeb !important;
    color: #b45309 !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    margin-left: 4px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
  }
  .scope-pill.warn::before,
  .scope-pill.bad::before {
    display: none !important;
  }
  .scope-pill.bad,
  body[data-page="service"] .scope-pill.bad {
    background: #fef2f2 !important;
    color: #b91c1c !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    margin-left: 4px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
  }

  /* Clean text for country & brand columns so tables do not have 3 columns of gray pills */
  .country-badge,
  .brand-badge {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    color: #1d1d1f !important;
    font-weight: 500 !important;
  }
  .brand-badge {
    color: #515154 !important;
    font-weight: 450 !important;
  }

  /* Calm Card 4 on Service Dashboard (07): subtle text links instead of loud red buttons */
  body[data-page="service"] .repair-row {
    background: #f5f5f7 !important;
    border: 0 !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
  }
  body[data-page="service"] .repair-row .btn,
  body[data-page="service"] .repair-row .btn.primary,
  body[data-page="service"] .repair-row .btn.btn-primary {
    background: #ffffff !important;
    color: #1d1d1f !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    height: 22px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    border-radius: 5px !important;
    box-shadow: none !important;
  }

  /* Member Permission Modal (06): Clean Choice Items & Calm Duration Pills */
  .grant-dialog[data-member-editor] .browser-grant-box {
    background: #f5f5f7 !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    gap: 8px !important;
  }
  .grant-dialog[data-member-editor] .duration-pill {
    height: 26px !important;
    padding: 0 11px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    background: #ffffff !important;
    color: #515154 !important;
    font-weight: 500 !important;
  }
  .grant-dialog[data-member-editor] .duration-pill input[type="radio"] {
    display: none !important;
  }
  .grant-dialog[data-member-editor] .duration-pill.active,
  .grant-dialog[data-member-editor] .duration-pill:has(input:checked) {
    background: #1d1d1f !important;
    color: #ffffff !important;
    border-color: #1d1d1f !important;
    font-weight: 600 !important;
  }
  .grant-dialog[data-member-editor] .duration-preview {
    background: transparent !important;
    border: 0 !important;
    color: #059669 !important;
    font-weight: 500 !important;
    padding: 0 !important;
  }
  .grant-dialog[data-member-editor] .choice .scope-chip b {
    display: none !important;
  }
  .grant-dialog[data-member-editor] .choice .scope-chip em {
    background: #f5f5f7 !important;
    color: #6e6e73 !important;
    border: 0 !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    font-style: normal !important;
    font-size: 11px !important;
  }

/* ==========================================================================
   PR #90: Fundamental Bento Card Grid Layout Redesign across all 6 views
   (No display:flex on tr/th/td/.connection-row/.member-id/.scope-chips)
   ========================================================================== */

/* --- Shared Bento Tokens & Headers --- */
.bento-sec-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #86868b;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.bento-brand-pill,
.bento-member-pill,
.bento-country-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.bento-country-tag {
  background: rgba(0, 113, 227, 0.1);
  color: #0066cc;
}

.bento-brand-pill {
  background: rgba(88, 86, 214, 0.08);
  color: #5856d6;
}

.bento-member-pill {
  background: #f2f2f7;
  color: #3a3a3c;
}

/* ==========================================================================
   VIEW 1: /admin/settings Tab 1 — 成员权限分配 (3-Column Member Bento Cards)
   ========================================================================== */
.team-kpi-strip {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 16px !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.team-kpi-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.team-kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #86868b;
}

.team-kpi-card strong {
  font-size: 19px;
  font-weight: 700;
  color: #1d1d1f;
  letter-spacing: -0.02em;
}

.team-kpi-card small {
  font-size: 12px;
  color: #6e6e73;
}

.member-bento-wrap {
  width: 100%;
}

.member-bento-wrap > table.v21-support-users {
  display: block;
  width: 100%;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.member-bento-wrap > table.v21-support-users > colgroup,
.member-bento-wrap > table.v21-support-users > thead {
  display: none !important;
}

.member-bento-wrap > table.v21-support-users > tbody.member-bento-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.member-bento-grid > tr.member-bento-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03), 0 8px 20px rgba(0, 0, 0, 0.02);
  height: 100%;
}

.member-bento-grid > tr.member-bento-card > td {
  display: block;
  width: 100% !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
}

.member-bento-grid > tr.member-bento-card > td[hidden] {
  display: none !important;
}

.member-bento-grid > tr.member-bento-card > td.member-id {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 10px;
  padding-bottom: 14px !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.member-card-top-actions .action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.member-bento-grid > tr.member-bento-card > td.col-modules {
  padding-bottom: 12px !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.member-country-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.member-country-block {
  background: #f8f8fa;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 11px;
  padding: 10px 12px;
}

.member-country-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.member-country-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-country-name {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 113, 227, 0.11);
  color: #0066cc;
  font-size: 12px;
  font-weight: 700;
}

.member-country-brand {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(88, 86, 214, 0.09);
  color: #5856d6;
  font-size: 11.5px;
  font-weight: 600;
}

.member-country-count {
  font-size: 11.5px;
  font-weight: 600;
  color: #6e6e73;
}

.member-country-assets {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.bento-asset-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  font-size: 12.5px;
  color: #1d1d1f;
}

.bento-asset-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0071e3;
  flex-shrink: 0;
}

.bento-asset-item.ad .bento-asset-dot {
  background: #5856d6;
}

.bento-asset-name {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  line-height: 1.35;
}

.bento-asset-name strong {
  font-weight: 650;
  color: #1d1d1f;
}

.bento-asset-plat {
  font-size: 11.5px;
  font-weight: 500;
  color: #6e6e73;
}

/* ==========================================================================
   VIEW 2: /admin/settings Tab 2 — 电商 API 渠道配置 (2x2 Country Bento Grid)
   ========================================================================== */
.country-bento-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.country-bento-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.025);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.country-bento-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  background: #fafafc;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.country-bento-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.country-bento-title strong {
  font-size: 15px;
  font-weight: 700;
  color: #1d1d1f;
}

.country-bento-meta {
  font-size: 12px;
  font-weight: 600;
  color: #6e6e73;
  background: #f2f2f7;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.country-bento-body > table.channel-table {
  display: block;
  width: 100%;
  border: none !important;
}

.country-bento-body > table.channel-table > colgroup {
  display: none !important;
}

.country-bento-body > table.channel-table > tbody {
  display: block;
  width: 100%;
}

.country-bento-body > table.channel-table > tbody > tr.connection-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.country-bento-body > table.channel-table > tbody > tr.connection-row:last-child {
  border-bottom: none;
}

.country-bento-body > table.channel-table > tbody > tr.connection-row[hidden] {
  display: none !important;
}

.country-bento-body > table.channel-table > tbody > tr.connection-row > td {
  display: block;
  width: auto !important;
  padding: 0 !important;
  border: none !important;
}

.country-bento-body > table.channel-table > tbody > tr.connection-row > td[hidden] {
  display: none !important;
}

.bento-row-scopes {
  margin-top: 4px;
}

.bento-footer-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 16px !important;
  margin-top: 16px !important;
}

/* ==========================================================================
   VIEW 3: /admin/settings Tab 3 — 飞书 / Lark 机器人配置 (2x2 Regional Bot Cards)
   ========================================================================== */
.feishu-bento-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px 20px 20px;
}

.feishu-bento-card {
  background: #fafafc;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.feishu-bento-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.feishu-bento-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.feishu-bento-title h4 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #1d1d1f;
  line-height: 1.35;
}

.feishu-bento-meta {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.feishu-bento-meta > div {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
}

.feishu-bento-meta dt {
  color: #86868b;
  font-weight: 600;
}

.feishu-bento-meta dd {
  margin: 0;
  color: #1d1d1f;
  font-weight: 500;
}

.feishu-bento-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

/* ==========================================================================
   VIEW 4: /admin/browser — 浏览器插件二次跳转代理节点 (3-Column Shadowrocket Cards)
   ========================================================================== */
.shadowrocket-table {
  display: block !important;
  width: 100% !important;
  border: none !important;
  background: transparent !important;
}

.shadowrocket-table > colgroup,
.shadowrocket-table > thead {
  display: none !important;
}

.shadowrocket-table > tbody[data-proxy-node-tbody] {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 18px !important;
  padding: 18px !important;
}

.shadowrocket-table > tbody > tr.sr-bento-card {
  display: grid !important;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.shadowrocket-table > tbody > tr.sr-bento-card > td {
  display: block;
  width: 100% !important;
  padding: 0 !important;
  border: none !important;
}

.shadowrocket-table > tbody > tr.sr-bento-card > td.sr-bento-top {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.sr-bento-title-cell .sr-display-remark {
  font-size: 15px;
  font-weight: 700;
  color: #1d1d1f;
}

.shadowrocket-table > tbody > tr.sr-bento-card > td.sr-bento-server-box {
  background: #f5f5f7;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  padding: 12px 14px !important;
  display: grid;
  gap: 8px;
}

.sr-kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
}

.sr-kv-row > span:first-child {
  color: #86868b;
  font-weight: 600;
}

.shadowrocket-table > tbody > tr.sr-bento-card > td.sr-bento-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding-top: 10px !important;
  border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.sr-bento-who {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6e6e73;
}

/* ==========================================================================
   VIEW 5: /admin/service — 数据监测 (Executive Dashboard: 4 KPIs + 2-Col Bento)
   ========================================================================== */
.monitor-grid.exec-kpi-row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin-bottom: 16px !important;
}

.exec-kpi-card {
  padding: 16px 18px !important;
  border-radius: 14px !important;
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.025) !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.exec-kpi-big {
  font-size: 26px;
  font-weight: 750;
  color: #1d1d1f;
  letter-spacing: -0.03em;
  line-height: 1.15;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.exec-kpi-big.tone-warn {
  color: #d97706;
}

.exec-kpi-big small {
  font-size: 12px;
  font-weight: 600;
  color: #86868b;
  letter-spacing: 0;
}

.exec-kpi-foot {
  margin: 0;
  font-size: 12px;
  color: #6e6e73;
  line-height: 1.35;
}

.service-bento-grid {
  display: grid;
  grid-template-columns: 1fr 1.38fr;
  gap: 16px;
  align-items: start;
}

.service-bento-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.service-bento-card,
.service-bento-right {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  border-radius: 16px !important;
  padding: 16px 18px !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.025) !important;
}

.bento-dist-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.bento-dist-group:first-of-type {
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
}

/* Compact Activity Monitor Rows in Service Right Card */
.service-activity-wrap {
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  overflow: hidden;
}

.service-activity-wrap > table.channel-table-service {
  display: block;
  width: 100%;
  border: none !important;
}

.service-activity-wrap > table.channel-table-service > colgroup,
.service-activity-wrap > table.channel-table-service > thead {
  display: none !important;
}

.service-activity-wrap > table.channel-table-service > tbody {
  display: block;
  width: 100%;
}

.service-activity-wrap > table.channel-table-service > tbody > tr.connection-row {
  display: grid;
  grid-template-columns: auto auto minmax(140px, 1.2fr) minmax(110px, 0.9fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.service-activity-wrap > table.channel-table-service > tbody > tr.connection-row:last-child {
  border-bottom: none;
}

.service-activity-wrap > table.channel-table-service > tbody > tr.connection-row > td {
  display: block;
  width: auto !important;
  padding: 0 !important;
  border: none !important;
}

.service-activity-wrap > table.channel-table-service > tbody > tr.connection-row > td.col-subapps,
.service-activity-wrap > table.channel-table-service > tbody > tr.connection-row > td.col-users {
  display: none !important;
}

/* ==========================================================================
   VIEW 6: /me/connections — 店铺与广告 (4-Card Top Summary + 2-Col Store vs Ad)
   ========================================================================== */
.conn-top-bento-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.45fr;
  gap: 14px;
  margin-bottom: 14px;
}

.conn-kpi-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.025);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.conn-kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  color: #86868b;
}

.conn-kpi-val {
  font-size: 18px;
  font-weight: 750;
  color: #1d1d1f;
  letter-spacing: -0.02em;
}

.conn-kpi-sub {
  font-size: 12px;
  color: #6e6e73;
}

.conn-mcp-bento-slot .agent-bar {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.conn-mcp-bento-slot .agent-bar-row {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.conn-bento-split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 18px;
  align-items: start;
  margin-top: 12px;
}

.conn-bento-col {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.025);
  overflow: hidden;
}

.conn-bento-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  background: #fafafc;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.conn-bento-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #1d1d1f;
}

.conn-bento-head .note {
  margin: 2px 0 0;
  font-size: 12px;
}

.conn-bento-body > .table-wrap {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.conn-bento-body table.connections-table {
  display: block;
  width: 100%;
  border: none !important;
}

.conn-bento-body table.connections-table > colgroup,
.conn-bento-body table.connections-table > thead {
  display: none !important;
}

.conn-bento-body table.connections-table > tbody {
  display: block;
  width: 100%;
}

.conn-bento-body table.connections-table > tbody > tr.connection-row {
  display: grid;
  grid-template-columns: auto auto auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.conn-bento-body table.connections-table > tbody > tr.connection-row:last-child {
  border-bottom: none;
}

.conn-bento-body table.connections-table > tbody > tr.connection-row[hidden] {
  display: none !important;
}

.conn-bento-body table.connections-table > tbody > tr.connection-row > td {
  display: block;
  width: auto !important;
  padding: 0 !important;
  border: none !important;
}

.conn-bento-body table.connections-table > tbody > tr.connection-row > td.col-subapps {
  grid-column: 1 / 4;
}

.conn-bento-body table.connections-table > tbody > tr.connection-row > td.col-usage {
  grid-column: 4 / 5;
  justify-self: end;
}

.conn-bento-body table.connections-table > tbody > tr.connection-row > td.col-actions {
  grid-column: 5 / 6;
  justify-self: end;
}


/* =========================================================================
   PR-91: Clean Hierarchy & Seb's 7 Annotated Fixes
   ========================================================================= */

[hidden] {
  display: none !important;
}

/* 1. Team Members (View 1): Single-line inline summary bar (NO 3-card KPI row above 3 member cards!) */
.admin-summary.team-inline-summary {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px !important;
  margin-bottom: 14px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.team-inline-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.team-inline-left strong {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.team-inline-left span {
  font-size: 12px;
  color: #64748b;
}
.team-inline-stats {
  display: flex;
  align-items: center;
  gap: 8px;
}
.team-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #475569;
}
.team-stat-chip strong {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

/* Level 1 Country -> Level 2 Brand inside Member Cards */
.member-country-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}
.member-country-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}
.member-country-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}
.member-country-count {
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 999px;
}
.member-brand-subgroup {
  display: grid;
  gap: 6px;
  padding-left: 8px;
  border-left: 2px solid #cbd5e1;
}
.member-brand-subhead {
  display: flex;
  align-items: center;
  gap: 6px;
}
.member-country-brand {
  font-size: 11px;
  font-weight: 700;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1px 8px;
  border-radius: 6px;
}

/* 2. E-Commerce API Channels (View 2): Level 1 Country Header -> Level 2 Brand Subbar -> Level 3 Channel Rows */
.country-bento-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.country-bento-title strong {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.country-brand-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}
.country-brand-subbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.country-brand-owner {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.btn-subtle {
  color: #475569 !important;
  background: #f8fafc !important;
  border-color: #e2e8f0 !important;
  font-size: 12px !important;
  padding: 4px 10px !important;
}

/* 3. Feishu / Lark Bot Config (View 3 & 03b Modal): Read-Only Cards + Modal Dialog */
.feishu-inline-inputs {
  display: none !important;
}
.country-level1-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.feishu-bot-subname {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}
.feishu-bento-sections {
  padding: 12px 16px;
  display: grid;
  gap: 10px;
}
.feishu-sec-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}
.feishu-sec-head span {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.02em;
}
.feishu-kv-grid {
  display: grid;
  gap: 4px;
}
.feishu-kv-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.feishu-kv-line > span:first-child {
  color: #64748b;
  font-weight: 500;
}
.feishu-webhook-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 12px;
}
.feishu-webhook-tag strong {
  color: #0f172a;
  font-weight: 600;
}
.feishu-webhook-tag code {
  font-size: 11px;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
}
.webhook-dot.ok {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  display: inline-block;
  margin-right: 6px;
}
.feishu-webhook-empty {
  font-size: 12px;
  color: #94a3b8;
  padding: 4px 0;
}

/* Feishu Modal Overlay when opened */
.feishu-drawer-card.feishu-modal-card:not([hidden]) {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(680px, 92vw);
  z-index: 999;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.24), 0 0 0 100vmax rgba(15, 23, 42, 0.45);
  display: grid;
  gap: 16px;
}
.feishu-modal-sections {
  display: grid;
  gap: 14px;
}
.feishu-modal-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 16px 14px;
  margin: 0;
  background: #f8fafc;
}
.feishu-modal-fieldset legend {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  padding: 0 6px;
}
.feishu-webhook-form-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px;
}
.feishu-webhook-form-row label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}
.feishu-webhook-form-row input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  background: #ffffff;
}

/* 5. Service Monitoring Dashboard (View 5): 4 Balanced KPI Cards + Clean 5-Column Monitoring List */
.kpi-pill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.kpi-mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}
.kpi-mini-pill.ok {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.kpi-mini-pill.warn {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}
.kpi-mini-pill.bad {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
.health-seg i.info {
  background: #3b82f6;
}
.health-seg i.muted {
  background: #94a3b8;
}

/* Clean Repair Row in Left Column of Service Dashboard */
.service-bento-left .repair-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 12px !important;
}
.repair-row-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.repair-row-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.repair-row-top strong {
  font-size: 13px;
  color: #0f172a;
}
.repair-row-why {
  font-size: 12px;
  color: #b91c1c;
  font-weight: 500;
}
.service-bento-left .repair-row .mint-out:empty {
  display: none !important;
}

/* Single-line filter bar & Strict 5-Column Monitoring List on Right Column */
.service-filter-bar .filter-line {
  display: none !important;
}
.service-filter-bar {
  padding: 8px 16px !important;
}
.channel-table-service tbody tr.connection-row {
  display: grid !important;
  grid-template-columns: 118px 96px minmax(160px, 1fr) 136px 92px !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 9px 14px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}
.channel-table-service td.col-subapps,
.channel-table-service td.col-actions,
.channel-table-service td.col-users {
  display: none !important;
}
.channel-table-service td.col-country {
  display: block !important;
  white-space: nowrap;
}
.channel-table-service td.col-brand {
  display: block !important;
}
.channel-table-service td.col-account {
  min-width: 0 !important;
  overflow: hidden !important;
}
.channel-table-service td.col-account .channel-name {
  white-space: nowrap;
  overflow: hidden;
}
.channel-table-service td.col-usage {
  display: block !important;
  text-align: right;
}
.channel-table-service td.col-status {
  display: block !important;
  text-align: right;
}

/* 6. Customer View /me/connections (View 6): Grouped by Country -> Brand, Zero Read-Only Spam */
.conn-bento-body tr.conn-group-header-row {
  display: block !important;
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  padding: 7px 14px !important;
}
.conn-bento-body tr.conn-group-header-row td {
  display: block !important;
  padding: 0 !important;
  border: 0 !important;
}
.conn-group-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.conn-group-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.country-level1-pill {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.conn-group-bar-count {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}
.conn-bento-body tr.connection-row {
  display: grid !important;
  grid-template-columns: 92px minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 14px !important;
  border-bottom: 1px solid #f1f5f9 !important;
}
.conn-bento-body tr.connection-row td.col-country,
.conn-bento-body tr.connection-row td.col-brand,
.conn-bento-body tr.connection-row td.col-who,
.conn-bento-body tr.connection-row td.col-actions {
  display: none !important;
}
.conn-bento-body tr.connection-row td.col-platform {
  grid-column: 1;
  grid-row: 1 / span 2;
}
.conn-bento-body tr.connection-row td.col-account {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
.conn-bento-body tr.connection-row td.col-subapps {
  grid-column: 2;
  grid-row: 2;
  padding-left: 0 !important;
}
.conn-bento-body tr.connection-row td.col-usage {
  grid-column: 3;
  grid-row: 1 / span 2;
}
.conn-bento-body tr.connection-row td.col-usage .track {
  display: none !important;
}
.conn-bento-body tr.connection-row td.col-status {
  grid-column: 4;
  grid-row: 1 / span 2;
}

/* 7. Permission Modal (View 7): Compact Role Checkboxes + Level-1 Country Tabs -> Level-2 Brand Subbar */
.role-picks-compact-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.role-picks-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
}
.grant-editor .role-picks {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  margin: 0 !important;
}
.grant-editor .role-pick {
  padding: 3px 9px !important;
  font-size: 12px !important;
  border-radius: 6px !important;
  min-height: 0 !important;
}
.grant-editor .browser-grant-box {
  padding: 8px 12px !important;
  display: grid !important;
  gap: 6px !important;
}
.grant-editor .browser-manage-link {
  margin-left: auto;
  font-size: 12px;
}
.grant-brand-subbar {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 12px !important;
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 8px !important;
  margin-bottom: 10px !important;
}
.grant-brand-subbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.grant-brand-pill-tag {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
}
.grant-brand-count-note {
  font-size: 12px;
  color: #475569;
  font-weight: 600;
}
.grant-brand-subbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Do not repeat Country & Brand inside every checkbox row of the Country->Brand panel! */
.country-panel .choice .country-badge,
.country-panel .choice .brand-badge {
  display: none !important;
}

.feishu-modal-card input:focus,
.feishu-modal-card select:focus {
  outline: none !important;
  border-color: #64748b !important;
  box-shadow: 0 0 0 2px rgba(100, 116, 139, 0.15) !important;
}

/* One compact sign-in surface; decorative panels never stretch the brand. */
.login-split {
  grid-template-columns: minmax(0, 1fr);
  background: #f7f8fa;
}
.login-showcase { display: none; }
.login-card { min-height: 100dvh; padding: 24px 16px; box-sizing: border-box; }
.login-brand {
  display: block;
  width: 164px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  margin: 0 0 28px;
}
body[data-page="login"] .app,
body[data-page="login"] .login-split { height: auto; min-height: 100dvh; overflow: visible; }
.login-card-inner { box-sizing: border-box; }
.login-card-inner [hidden] { display: none !important; }
.login-modes { display: flex; gap: 4px; padding: 4px; margin: 24px 0 20px; background: #f3f4f6; border-radius: 10px; }
.login-modes button { flex: 1; border: 0; border-radius: 7px; padding: 10px 8px; color: #697384; background: transparent; cursor: pointer; font: inherit; font-size: 14px; }
.login-modes button[aria-pressed="true"] { background: #fff; color: #181b22; box-shadow: 0 1px 4px #10182812; }
.login-provider { display: block; width: 100%; min-height: 48px; margin: 12px 0; border: 1px solid #dce2ec; background: #fff; color: #181b22; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.login-provider:hover:enabled { border-color: #c92339; background: #fff9fa; }
.login-card-inner button:disabled { cursor: wait; opacity: .5; }
.login-card-inner input { box-sizing: border-box; }
.login-card-inner .password-field { position: relative; }
.login-card-inner .password-field input { padding-right: 48px; }
.password-eye { position: absolute; inset: 0 0 0 auto; display: grid; place-items: center; width: 44px; padding: 0; border: 0; border-radius: 12px; background: transparent; cursor: pointer; }
.password-eye svg { width: 20px; height: 20px; fill: none; stroke: #697384; stroke-width: 1.6; }
.password-eye .eye-slash { display: none; }
.password-eye[aria-pressed="true"] .eye-slash { display: block; }
.login-card-inner .login-hint { margin: 14px 0 0; font-size: 12px; text-align: center; line-height: 1.6; }
.login-card-inner #loginStatus { margin: 16px 0 0; font-size: 13px; line-height: 1.6; color: #9d2636; }
.login-account-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.login-account-links button, .login-switch-account { padding: 0; border: 0; background: none; color: #5b6577; font: inherit; font-size: 12px; cursor: pointer; }
.login-switch-account { display: block; margin: 20px auto 0; }
.login-foot { text-align: center; margin-top: 28px; font-size: 12px; }
.member-invitations { margin: 16px 0; }
.member-invite-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.member-invite-head h2 { margin: 0; font-size: 16px; }
.member-invite-head form { display: flex; align-items: center; gap: 8px; }
.member-invite-head select { width: auto; }
[data-member-invite-result] { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; padding: 20px 0; }
[data-member-invite-result][hidden] { display: none; }
[data-member-invite-result] > div { flex: 1; min-width: 240px; }
[data-member-invite-result] input { display: block; width: 100%; margin: 8px 0; }
.member-invite-row { display: flex; align-items: center; gap: 24px; padding: 10px 0; border-top: 1px solid #e4e7ec; font-size: 13px; }
.member-invite-row .btn { margin-left: auto; }
.account-login-settings { color: inherit; text-decoration: none; }
@media(max-width: 480px) {
  .login-card-inner { padding: 26px 22px 20px; border-radius: 18px; }
  .login-card { align-items: center; }
}

/* Admin console correction: natural-height cards and explicit flow entry points. */
.member-bento-wrap > table.v21-support-users > tbody.member-bento-grid { align-items:start; }
.member-bento-grid > tr.member-bento-card { height:auto; grid-template-rows:auto auto auto; min-width:0; box-sizing:border-box; }
.member-assets-details > summary { cursor:pointer; font-size:13px; font-weight:600; padding:8px 0; }
.member-assets-details[open] > summary { margin-bottom:8px; }
.member-copy,.member-name,.country-brand-owner { min-width:0; overflow-wrap:anywhere; }
.inactive-fold:not([open]) > :not(summary) { display:none!important; }
.grant-dialog[data-member-editor] { max-height:90dvh; overflow:auto; }
.grant-dialog[data-member-editor] .grant-split { grid-template-columns:repeat(2,minmax(0,1fr)); }
.grant-dialog[data-member-editor] .choice { min-width:0; box-sizing:border-box; height:auto; align-items:flex-start; }
.grant-dialog[data-member-editor] .choice .scope-chip { white-space:normal; overflow-wrap:anywhere; }
.channel-filters.channel-filter-bar { display:flex!important; flex-direction:column; align-items:stretch; gap:12px; }
.channel-filter-bar .filter-line-status .filter-pills { flex-wrap:wrap; }
.channel-filter-bar .filter-tools { flex-wrap:wrap; width:100%; }
.channel-filter-bar .apple-filter-selects { flex:1 1 600px; display:grid; grid-template-columns:repeat(4,minmax(100px,1fr)); gap:8px; }
.api-application-entry { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:16px; border:1px solid #e2e5eb; border-radius:12px; margin-bottom:16px; }
.api-application-entry h3 { margin:0 0 4px; }
.api-application-entry > div:first-child { margin-right:auto; }
.api-application-guide { position:relative; }
.api-application-guide summary { cursor:pointer; }
.api-application-options { position:absolute; right:0; top:100%; z-index:10; width:min(360px,80vw); padding:16px; background:white; border:1px solid #e2e5eb; border-radius:12px; box-shadow:0 8px 24px #0002; }
.api-application-options a { display:block; padding:10px 0; }
.robot-configuration-status { padding:24px; max-width:760px; }
@media(max-width:700px) { .member-bento-wrap > table.v21-support-users > tbody.member-bento-grid { grid-template-columns:1fr; } .channel-filter-bar .apple-filter-selects { grid-template-columns:repeat(2,minmax(0,1fr)); } .grant-dialog[data-member-editor] .grant-split { grid-template-columns:1fr; } }

.grant-dialog[data-member-editor] .grant-split > fieldset { min-width:0; border:0; margin:0; padding:0; }

body[data-page="service"] .shell .main.page,body[data-page="service"] .main.page { max-width:none; width:100%; box-sizing:border-box; padding:16px 24px 28px; }
body[data-page="service"] .connection-lifecycle { font-size:12px; margin-top:6px; }
.connection-lifecycle summary { cursor:pointer; color:#596476; }
.connection-lifecycle-body { margin-top:8px; padding:12px; border:1px solid #e2e5eb; border-radius:8px; background:#f8fafc; white-space:normal; }
.connection-lifecycle-body dl { display:grid; grid-template-columns:110px minmax(0,1fr); gap:6px; }
.connection-lifecycle-body dd { margin:0; overflow-wrap:anywhere; }
.connection-lifecycle-body ul { padding-left:16px; }
.connection-lifecycle-body li { display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:6px 0; }
.channel-table-service tr:has(.connection-lifecycle[open]) { grid-template-columns:minmax(100px,1fr) minmax(90px,1fr) minmax(260px,3fr) minmax(90px,1fr) auto; align-items:start; }
body[data-page="service"] .channel-table-service tr.connection-row:has(.connection-lifecycle[open]) { display:grid!important; grid-template-columns:minmax(80px,1fr) minmax(80px,1fr) minmax(0,1fr) minmax(80px,1fr) auto; align-items:start; gap:12px; }
body[data-page="service"] .channel-table-service tr.connection-row:has(.connection-lifecycle[open]) > td:not([hidden]) { grid-row:1!important; width:auto!important; min-width:0; }
body[data-page="service"] .channel-table-service tr.connection-row:has(.connection-lifecycle[open]) > td.col-account { grid-column:1 / -1!important; grid-row:2!important; width:100%!important; max-width:none!important; }
body[data-page="service"] .connection-lifecycle-body dl { grid-template-columns:minmax(90px,120px) minmax(0,1fr); }

.grant-editor .browser-duration-control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.grant-editor .browser-duration-control select {
  width: auto;
  min-width: 160px;
  max-width: 100%;
}

.usage-history-card { margin-top: 16px; }
.usage-history-card .monitor-head { flex-wrap: wrap; gap: 12px; }
.usage-history-card .monitor-head label { display: flex; align-items: center; gap: 8px; }
.usage-history-card select { width: auto; min-width: 120px; max-width: 100%; }
.usage-history-card [data-usage-history-rows] { margin-top: 12px; }
