  /* ─── Design Tokens ─── */
  :root,
  [data-theme="light"] {
      --color-bg: #f7f6f2;
      --color-surface: #f9f8f5;
      --color-surface-2: #fbfbf9;
      --color-surface-offset: #f3f0ec;
      --color-surface-dynamic: #e6e4df;
      --color-divider: #dcd9d5;
      --color-border: #d4d1ca;
      --color-text: #28251d;
      --color-text-muted: #7a7974;
      --color-text-faint: #bab9b4;
      --color-text-inverse: #f9f8f4;
      --color-primary: #01696f;
      --color-primary-hover: #0c4e54;
      --color-primary-active: #0f3638;
      --color-primary-highlight: #cedcd8;
      --color-success: #437a22;
      --color-success-hover: #2e5c10;
      --color-success-highlight: #d4dfcc;
      --color-error: #a12c7b;
      --color-error-hover: #7d1e5e;
      --color-error-highlight: #e0ced7;
      --color-warning: #964219;
      --color-warning-hover: #713417;
      --color-warning-highlight: #ddcfc6;
      --color-notification: #a13544;
      --color-notification-highlight: #dececb;
      --color-orange: #da7101;
      --color-orange-highlight: #e7d7c4;
      --shadow-sm: 0 1px 2px oklch(0.2 0.01 80 / 0.06);
      --shadow-md: 0 4px 12px oklch(0.2 0.01 80 / 0.08);
      --shadow-lg: 0 12px 32px oklch(0.2 0.01 80 / 0.12);
      --radius-sm: 0.375rem;
      --radius-md: 0.5rem;
      --radius-lg: 0.75rem;
      --radius-xl: 1rem;
      --radius-full: 9999px;
      --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
      --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
      --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
      --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
      --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
      --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
      --space-1: 0.25rem;
      --space-2: 0.5rem;
      --space-3: 0.75rem;
      --space-4: 1rem;
      --space-5: 1.25rem;
      --space-6: 1.5rem;
      --space-8: 2rem;
      --space-10: 2.5rem;
      --space-12: 3rem;
      --space-16: 4rem;
      --font-body: 'Satoshi', 'Inter', sans-serif;
      --content-default: 960px;
  }

  [data-theme="dark"] {
      --color-bg: #171614;
      --color-surface: #1c1b19;
      --color-surface-2: #201f1d;
      --color-surface-offset: #1d1c1a;
      --color-surface-dynamic: #2d2c2a;
      --color-divider: #262523;
      --color-border: #393836;
      --color-text: #cdccca;
      --color-text-muted: #797876;
      --color-text-faint: #5a5957;
      --color-text-inverse: #2b2a28;
      --color-primary: #4f98a3;
      --color-primary-hover: #227f8b;
      --color-primary-active: #1a626b;
      --color-primary-highlight: #313b3b;
      --color-success: #6daa45;
      --color-success-hover: #4d8f25;
      --color-success-highlight: #3a4435;
      --color-error: #d163a7;
      --color-error-hover: #b9478f;
      --color-error-highlight: #4c3d46;
      --color-warning: #bb653b;
      --color-warning-hover: #b95525;
      --color-warning-highlight: #564942;
      --color-notification: #dd6974;
      --color-notification-highlight: #574848;
      --color-orange: #fdab43;
      --color-orange-highlight: #564b3e;
      --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
      --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
      --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
  }

  @media (prefers-color-scheme: dark) {
      :root:not([data-theme]) {
          --color-bg: #171614;
          --color-surface: #1c1b19;
          --color-surface-2: #201f1d;
          --color-surface-offset: #1d1c1a;
          --color-surface-dynamic: #2d2c2a;
          --color-divider: #262523;
          --color-border: #393836;
          --color-text: #cdccca;
          --color-text-muted: #797876;
          --color-text-faint: #5a5957;
          --color-text-inverse: #2b2a28;
          --color-primary: #4f98a3;
          --color-primary-hover: #227f8b;
          --color-primary-active: #1a626b;
          --color-primary-highlight: #313b3b;
          --color-success: #6daa45;
          --color-success-hover: #4d8f25;
          --color-success-highlight: #3a4435;
          --color-error: #d163a7;
          --color-error-hover: #b9478f;
          --color-error-highlight: #4c3d46;
          --color-warning: #bb653b;
          --color-warning-hover: #b95525;
          --color-warning-highlight: #564942;
          --color-notification: #dd6974;
          --color-notification-highlight: #574848;
          --color-orange: #fdab43;
          --color-orange-highlight: #564b3e;
          --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.2);
          --shadow-md: 0 4px 12px oklch(0 0 0 / 0.3);
          --shadow-lg: 0 12px 32px oklch(0 0 0 / 0.4);
      }
  }

  /* ─── Reset ─── */
  *,
  *::before,
  *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
  }

  html {
      -webkit-text-size-adjust: none;
      text-size-adjust: none;
      -webkit-font-smoothing: antialiased;
      scroll-behavior: smooth;
  }

  body {
      min-height: 100dvh;
      font-family: var(--font-body);
      font-size: var(--text-base);
      color: var(--color-text);
      background: var(--color-bg);
      line-height: 1.6;
      padding-bottom: calc(72px + env(safe-area-inset-bottom));
      overflow-x: hidden;
  }

  img,
  svg {
      display: block;
  }

  button {
      cursor: pointer;
      background: none;
      border: none;
      font: inherit;
      color: inherit;
      transition: color var(--transition), background var(--transition), box-shadow var(--transition);
  }

  input,
  select,
  textarea {
      font: inherit;
      color: inherit;
  }

  p,
  li {
      text-wrap: pretty;
  }

  @media (prefers-reduced-motion: reduce) {

      *,
      *::before,
      *::after {
          animation-duration: 0.01ms !important;
          transition-duration: 0.01ms !important;
      }
  }

  /* ─── Layout ─── */
  .container {
      max-width: var(--content-default);
      margin-inline: auto;
      padding-inline: var(--space-4);
  }

  /* ─── Header ─── */
  .header {
      position: sticky;
      top: 0;
      z-index: 100;
      background: color-mix(in oklch, var(--color-bg) 85%, transparent);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      border-bottom: 1px solid var(--color-divider);
      padding-top: env(safe-area-inset-top);
  }

  .header-inner {
      display: flex;
      align-items: center;
      gap: var(--space-3);
      padding: var(--space-3) var(--space-4);
      max-width: var(--content-default);
      margin-inline: auto;
  }

  .logo {
      display: flex;
      align-items: center;
      gap: var(--space-2);
      text-decoration: none;
      color: var(--color-text);
      font-weight: 700;
      font-size: var(--text-base);
  }

  .header-actions {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: var(--space-2);
  }

  .btn-icon {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      border-radius: var(--radius-md);
      color: var(--color-text-muted);
      -webkit-tap-highlight-color: transparent;
  }

  .btn-icon:hover {
      background: var(--color-surface-dynamic);
      color: var(--color-text);
  }

  .status-dot {
      width: 8px;
      height: 8px;
      border-radius: var(--radius-full);
      background: var(--color-text-faint);
      flex-shrink: 0;
      transition: background var(--transition);
  }

  .status-dot.active {
      background: var(--color-success);
      box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-success) 20%, transparent);
  }

  /* ─── Main ─── */
  main {
      padding-block: var(--space-6);
  }

  @media (min-width: 641px) {
      main {
          padding-block: var(--space-8);
      }
  }

  .page-title {
      font-size: var(--text-xl);
      font-weight: 700;
      margin-bottom: var(--space-2);
  }

  .page-subtitle {
      font-size: var(--text-sm);
      color: var(--color-text-muted);
      margin-bottom: var(--space-8);
  }

  /* ─── Grid ─── */
  .grid-2 {
      display: grid;
      grid-template-columns: 1fr;
      gap: var(--space-4);
  }

  @media (min-width: 641px) {
      .grid-2 {
          grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
          gap: var(--space-6);
      }
  }

  /* ─── Card ─── */
  .card {
      background: var(--color-surface);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-xl);
      padding: var(--space-4);
      box-shadow: var(--shadow-sm);
  }

  @media (min-width: 641px) {
      .card {
          padding: var(--space-5);
      }
  }

  .card-header {
      display: flex;
      align-items: center;
      gap: var(--space-3);
      margin-bottom: var(--space-4);
  }

  .card-icon {
      width: 36px;
      height: 36px;
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
  }

  .card-title {
      font-size: var(--text-base);
      font-weight: 600;
  }

  .card-subtitle {
      font-size: var(--text-xs);
      color: var(--color-text-muted);
      margin-top: 2px;
  }

  /* ─── Buttons ─── */
  .btn {
      display: inline-flex;
      align-items: center;
      gap: var(--space-2);
      padding: var(--space-2) var(--space-4);
      border-radius: var(--radius-md);
      font-size: var(--text-sm);
      font-weight: 500;
      font-family: inherit;
      cursor: pointer;
      border: none;
      transition: background var(--transition), color var(--transition), box-shadow var(--transition);
      white-space: nowrap;
      min-height: 44px;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
  }

  .btn-primary {
      background: var(--color-primary);
      color: var(--color-text-inverse);
  }

  .btn-primary:hover {
      background: var(--color-primary-hover);
  }

  .btn-primary:active {
      transform: scale(0.98);
  }

  .btn-primary:disabled {
      opacity: 0.5;
      cursor: not-allowed;
  }

  .btn-secondary {
      background: var(--color-surface-dynamic);
      color: var(--color-text);
  }

  .btn-secondary:hover {
      background: var(--color-border);
  }

  .btn-ghost {
      background: transparent;
      color: var(--color-text-muted);
  }

  .btn-ghost:hover {
      background: var(--color-surface-dynamic);
      color: var(--color-text);
  }

  .btn-danger {
      background: var(--color-error-highlight);
      color: var(--color-error);
  }

  .btn-danger:hover {
      background: var(--color-error);
      color: white;
  }

  .btn-sm {
      padding: var(--space-1) var(--space-3);
      font-size: var(--text-xs);
      min-height: 36px;
  }

  .btn-full {
      width: 100%;
      justify-content: center;
  }

  /* ─── Badge ─── */
  .badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px var(--space-2);
      border-radius: var(--radius-full);
      font-size: var(--text-xs);
      font-weight: 500;
  }

  .badge-success {
      background: var(--color-success-highlight);
      color: var(--color-success);
  }

  .badge-error {
      background: var(--color-error-highlight);
      color: var(--color-error);
  }

  .badge-warning {
      background: var(--color-warning-highlight);
      color: var(--color-warning);
  }

  .badge-primary {
      background: var(--color-primary-highlight);
      color: var(--color-primary);
  }

  .badge-muted {
      background: var(--color-surface-dynamic);
      color: var(--color-text-muted);
  }

  /* ─── Input ─── */
  .field {
      display: flex;
      flex-direction: column;
      gap: var(--space-1);
      margin-bottom: var(--space-4);
  }

  .field label {
      font-size: var(--text-xs);
      font-weight: 500;
      color: var(--color-text-muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
  }

  .input {
      background: var(--color-surface-2);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-md);
      padding: var(--space-3) var(--space-3);
      font-size: 16px;
      /* prevents iOS zoom */
      color: var(--color-text);
      transition: border-color var(--transition), box-shadow var(--transition);
      width: 100%;
      min-height: 44px;
  }

  @media (min-width: 641px) {
      .input {
          font-size: var(--text-sm);
      }
  }

  .input:focus {
      outline: none;
      border-color: var(--color-primary);
      box-shadow: 0 0 0 3px color-mix(in oklch, var(--color-primary) 20%, transparent);
  }

  /* Input group: stacked on mobile, inline on desktop */
  .input-group {
      display: flex;
      flex-direction: column;
      gap: var(--space-2);
  }

  .input-group .input {
      border-radius: var(--radius-md);
      flex: 1;
  }

  .input-group .btn {
      border-radius: var(--radius-md);
  }

  @media (min-width: 480px) {
      .input-group {
          flex-direction: row;
          gap: 0;
      }

      .input-group .input {
          border-radius: var(--radius-md) 0 0 var(--radius-md);
      }

      .input-group .btn {
          border-radius: 0 var(--radius-md) var(--radius-md) 0;
      }
  }

  /* API Key input group has 2 buttons — keep them inline always */
  .input-group-inline {
      display: flex;
      gap: 0;
  }

  .input-group-inline .input {
      border-radius: var(--radius-md) 0 0 var(--radius-md);
      flex: 1;
      min-width: 0;
  }

  .input-group-inline .btn:last-child {
      border-radius: 0 var(--radius-md) var(--radius-md) 0;
  }

  .input-group-inline .btn:not(:first-child):not(:last-child) {
      border-radius: 0;
  }

  /* ─── Code block ─── */
  .code-block {
      background: var(--color-bg);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-md);
      padding: var(--space-3) var(--space-4);
      font-family: 'Fira Code', 'Cascadia Code', monospace;
      font-size: var(--text-xs);
      color: var(--color-primary);
      overflow-x: auto;
      white-space: pre-wrap;
      word-break: break-all;
      line-height: 1.7;
  }

  .code-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: var(--space-2);
  }

  .code-lang {
      font-size: var(--text-xs);
      color: var(--color-text-faint);
      font-family: monospace;
  }

  /* ─── Toggle ─── */
  .toggle-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: var(--space-4);
      padding: var(--space-3) 0;
      border-bottom: 1px solid var(--color-divider);
  }

  .toggle-row:last-child {
      border-bottom: none;
      padding-bottom: 0;
  }

  .toggle-info .toggle-label {
      font-size: var(--text-sm);
      font-weight: 500;
  }

  .toggle-info .toggle-desc {
      font-size: var(--text-xs);
      color: var(--color-text-muted);
  }

  .toggle {
      position: relative;
      width: 44px;
      height: 24px;
      flex-shrink: 0;
  }

  .toggle input {
      opacity: 0;
      width: 0;
      height: 0;
      position: absolute;
  }

  .toggle-track {
      position: absolute;
      inset: 0;
      background: var(--color-border);
      border-radius: var(--radius-full);
      cursor: pointer;
      transition: background var(--transition);
  }

  .toggle input:checked+.toggle-track {
      background: var(--color-primary);
  }

  .toggle-track::after {
      content: '';
      position: absolute;
      top: 2px;
      left: 2px;
      width: 20px;
      height: 20px;
      border-radius: var(--radius-full);
      background: white;
      transition: transform var(--transition);
  }

  .toggle input:checked+.toggle-track::after {
      transform: translateX(20px);
  }

  /* ─── Notification item ─── */
  .notif-list {
      display: flex;
      flex-direction: column;
      gap: var(--space-2);
      overflow-y: auto;
      /* mobile: grows freely; desktop: capped */
  }

  @media (min-width: 641px) {
      .notif-list {
          max-height: 400px;
      }
  }

  .notif-item {
      display: flex;
      align-items: flex-start;
      gap: var(--space-3);
      padding: var(--space-3);
      background: var(--color-surface-2);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-lg);
      animation: slideIn 0.2s ease;
      cursor: pointer;
      transition: border-color var(--transition), background var(--transition);
  }

  .notif-item:hover {
      border-color: var(--color-text-faint);
  }

  .notif-item.expanded {
      border-color: var(--color-primary);
      background: var(--color-surface-offset);
  }

  @keyframes slideIn {
      from {
          opacity: 0;
          transform: translateY(-6px);
      }

      to {
          opacity: 1;
          transform: translateY(0);
      }
  }

  .notif-dot {
      width: 8px;
      height: 8px;
      border-radius: var(--radius-full);
      flex-shrink: 0;
      margin-top: 6px;
  }

  .notif-dot.error {
      background: var(--color-error);
  }

  .notif-dot.warning {
      background: var(--color-warning);
  }

  .notif-dot.success {
      background: var(--color-success);
  }

  .notif-dot.info {
      background: var(--color-primary);
  }

  .notif-body {
      flex: 1;
      min-width: 0;
  }

  .notif-title {
      font-size: var(--text-sm);
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
  }

  .notif-text {
      font-size: var(--text-xs);
      color: var(--color-text-muted);
      margin-top: 2px;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
  }

  .notif-meta {
      font-size: var(--text-xs);
      color: var(--color-text-faint);
      margin-top: var(--space-1);
      display: flex;
      align-items: center;
      gap: var(--space-2);
      flex-wrap: wrap;
  }

  .notif-empty {
      text-align: center;
      padding: var(--space-10) var(--space-4);
      color: var(--color-text-faint);
  }

  .notif-empty svg {
      margin: 0 auto var(--space-3);
  }

  /* Expanded notification detail */
  .notif-detail {
      display: none;
      margin-top: var(--space-3);
      padding-top: var(--space-3);
      border-top: 1px solid var(--color-border);
  }

  .notif-item.expanded .notif-detail {
      display: block;
  }

  .notif-item.expanded .notif-text {
      display: none;
  }

  .notif-item:not(.expanded) .notif-detail {
      display: none;
  }

  /* Markdown content in notifications */
  .notif-md {
      font-size: var(--text-sm);
      color: var(--color-text);
      line-height: 1.6;
      word-break: break-word;
  }

  .notif-md p {
      margin-bottom: var(--space-2);
  }

  .notif-md p:last-child {
      margin-bottom: 0;
  }

  .notif-md code {
      background: var(--color-surface-dynamic);
      padding: 1px 5px;
      border-radius: 4px;
      font-family: 'Fira Code', 'Cascadia Code', monospace;
      font-size: 0.85em;
  }

  .notif-md pre {
      background: var(--color-bg);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-md);
      padding: var(--space-3);
      overflow-x: auto;
      margin: var(--space-2) 0;
  }

  .notif-md pre code {
      background: none;
      padding: 0;
      font-size: var(--text-xs);
      line-height: 1.6;
  }

  .notif-md strong {
      font-weight: 600;
  }

  .notif-md em {
      font-style: italic;
  }

  .notif-md ul,
  .notif-md ol {
      padding-left: var(--space-5);
      margin-bottom: var(--space-2);
  }

  .notif-md li {
      margin-bottom: 2px;
  }

  .notif-md a {
      color: var(--color-primary);
      text-decoration: underline;
  }

  .notif-md a:hover {
      color: var(--color-primary-hover);
  }

  .notif-md blockquote {
      border-left: 3px solid var(--color-primary);
      padding-left: var(--space-3);
      margin: var(--space-2) 0;
      color: var(--color-text-muted);
  }

  .notif-url {
      margin-top: var(--space-2);
  }

  .notif-url a {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: var(--text-xs);
      color: var(--color-primary);
      text-decoration: none;
      word-break: break-all;
  }

  .notif-url a:hover {
      text-decoration: underline;
  }

  /* ─── Stat cards ─── */
  .stats-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: var(--space-2);
      margin-bottom: var(--space-4);
  }

  @media (min-width: 641px) {
      .stats-row {
          gap: var(--space-3);
          margin-bottom: var(--space-6);
      }
  }

  .stat-card {
      background: var(--color-surface);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-lg);
      padding: var(--space-3) var(--space-2);
      text-align: center;
  }

  @media (min-width: 641px) {
      .stat-card {
          padding: var(--space-4);
      }
  }

  .stat-value {
      font-size: var(--text-lg);
      font-weight: 700;
      color: var(--color-primary);
      line-height: 1;
  }

  @media (min-width: 641px) {
      .stat-value {
          font-size: var(--text-xl);
      }
  }

  .stat-label {
      font-size: var(--text-xs);
      color: var(--color-text-muted);
      margin-top: var(--space-1);
  }

  /* ─── iOS Banner ─── */
  .ios-banner {
      display: none;
      background: var(--color-primary-highlight);
      border: 1px solid var(--color-primary);
      border-radius: var(--radius-lg);
      padding: var(--space-4);
      margin-bottom: var(--space-6);
      gap: var(--space-3);
      align-items: flex-start;
  }

  .ios-banner.visible {
      display: flex;
  }

  .ios-banner-text {
      font-size: var(--text-sm);
      color: var(--color-text);
  }

  .ios-banner-text strong {
      display: block;
      font-weight: 600;
      margin-bottom: 2px;
  }

  /* ─── Tab bar (mobile) ─── */
  .tab-bar {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      background: color-mix(in oklch, var(--color-surface) 95%, transparent);
      backdrop-filter: blur(20px);
      -webkit-backdrop-filter: blur(20px);
      border-top: 1px solid var(--color-divider);
      padding: var(--space-1) var(--space-2) calc(var(--space-1) + env(safe-area-inset-bottom));
      z-index: 100;
  }

  .tab-bar-inner {
      display: flex;
      justify-content: space-around;
  }

  .tab-btn {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      padding: var(--space-2) var(--space-3);
      border-radius: var(--radius-md);
      color: var(--color-text-muted);
      font-size: 10px;
      font-weight: 500;
      min-width: 56px;
      min-height: 50px;
      justify-content: center;
      -webkit-tap-highlight-color: transparent;
      touch-action: manipulation;
  }

  .tab-btn.active {
      color: var(--color-primary);
  }

  .tab-btn svg {
      transition: transform var(--transition);
  }

  .tab-btn.active svg {
      transform: scale(1.1);
  }

  /* Mobile: tab bar visible, sections controlled by JS */
  @media (max-width: 640px) {
      .tab-bar {
          display: block;
      }

      .section {
          display: none;
      }

      .section.active {
          display: block;
      }
  }

  /* Desktop: all sections visible, no tab bar */
  @media (min-width: 641px) {
      .tab-bar {
          display: none !important;
      }

      .section {
          display: block !important;
      }
  }

  /* ─── Install banner ─── */
  .install-banner {
      display: none;
      background: var(--color-surface-offset);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-lg);
      padding: var(--space-3) var(--space-4);
      margin-bottom: var(--space-6);
      align-items: center;
      gap: var(--space-3);
  }

  .install-banner.visible {
      display: flex;
  }

  .install-banner-text {
      flex: 1;
      font-size: var(--text-sm);
  }

  /* ─── Scrollbar ─── */
  .notif-list::-webkit-scrollbar {
      width: 4px;
  }

  .notif-list::-webkit-scrollbar-track {
      background: transparent;
  }

  .notif-list::-webkit-scrollbar-thumb {
      background: var(--color-border);
      border-radius: var(--radius-full);
  }

  /* ─── Toast ─── */
  #toast {
      position: fixed;
      bottom: calc(80px + env(safe-area-inset-bottom));
      left: 50%;
      transform: translateX(-50%) translateY(20px);
      background: var(--color-text);
      color: var(--color-bg);
      padding: var(--space-2) var(--space-5);
      border-radius: var(--radius-full);
      font-size: var(--text-sm);
      font-weight: 500;
      opacity: 0;
      transition: opacity 0.25s ease, transform 0.25s ease;
      z-index: 300;
      pointer-events: none;
      white-space: nowrap;
      max-width: calc(100vw - 2rem);
      text-align: center;
  }

  #toast.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
  }

  @media (min-width: 641px) {
      #toast {
          bottom: var(--space-6);
      }
  }

  /* ─── Channel chip ─── */
  .channel-chip {
      display: inline-flex;
      align-items: center;
      gap: var(--space-2);
      padding: var(--space-1) var(--space-3);
      background: var(--color-surface-2);
      border: 1px solid var(--color-border);
      border-radius: var(--radius-full);
      font-size: var(--text-xs);
      font-weight: 500;
  }

  .channels-row {
      display: flex;
      flex-wrap: wrap;
      gap: var(--space-2);
      margin-bottom: var(--space-4);
      min-height: 36px;
  }

  .permission-state {
      display: flex;
      align-items: center;
      gap: var(--space-2);
      font-size: var(--text-sm);
  }

  /* ─── Responsive table ─── */
  .ref-table {
      width: 100%;
      border-collapse: collapse;
      font-size: var(--text-xs);
  }

  .ref-table thead {
      display: none;
  }

  @media (min-width: 600px) {
      .ref-table thead {
          display: table-header-group;
      }
  }

  .ref-table tbody tr {
      display: flex;
      flex-direction: column;
      padding: var(--space-3) 0;
      border-bottom: 1px solid var(--color-divider);
      gap: var(--space-1);
  }

  @media (min-width: 600px) {
      .ref-table tbody tr {
          display: table-row;
      }
  }

  .ref-table td {
      display: flex;
      align-items: center;
      gap: var(--space-2);
      padding: 2px 0;
      border: none;
  }

  @media (min-width: 600px) {
      .ref-table td {
          padding: var(--space-2) var(--space-3);
          display: table-cell;
      }
  }

  .ref-table td::before {
      content: attr(data-label);
      font-weight: 600;
      color: var(--color-text-muted);
      min-width: 80px;
      font-size: 10px;
      text-transform: uppercase;
      letter-spacing: 0.05em;
  }

  @media (min-width: 600px) {
      .ref-table td::before {
          display: none;
      }
  }

  .ref-table th {
      text-align: left;
      padding: var(--space-2) var(--space-3);
      color: var(--color-text-muted);
      font-weight: 500;
      border-bottom: 1px solid var(--color-divider);
  }