    :root {
      --bg: #0a0c10;
      --surface: #111318;
      --surface2: #181c23;
      --border: #1e2330;
      --accent: #2dd4bf;
      --accent2: #818cf8;
      --green: #34d399;
      --red: #f87171;
      --yellow: #fbbf24;
      --blue: #60a5fa;
      --text: #e2e8f0;
      --muted: #64748b;
      --mono: 'IBM Plex Mono', monospace;
      --sans: 'IBM Plex Sans', sans-serif;
    }

    * { margin: 0; padding: 0; box-sizing: border-box; }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: var(--sans);
      min-height: 100vh;
      visibility: hidden;
    }

    /* Grid noise texture */
    body::before {
      content: '';
      position: fixed;
      inset: 0;
      background-image:
        linear-gradient(rgba(45,212,191,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45,212,191,0.015) 1px, transparent 1px);
      background-size: 40px 40px;
      pointer-events: none;
      z-index: 0;
    }

    .container { max-width: 1200px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

    /* Header */
    header {
      border-bottom: 1px solid var(--border);
      padding: 20px 0;
      margin-bottom: 40px;
    }

    .header-inner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
    }

    .logo {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .logo-mark {
      width: 36px; height: 36px;
      object-fit: contain;
      border-radius: 8px;
      display: flex; align-items: center; justify-content: center;
      font-family: var(--mono);
      font-weight: 600;
      font-size: 14px;
      color: #000;
    }

    .logo-text {
      font-size: 16px;
      font-weight: 500;
      letter-spacing: -0.3px;
    }

    .logo-sub {
      font-size: 12px;
      color: var(--muted);
      font-family: var(--mono);
    }

    .live-badge {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      font-family: var(--mono);
      color: var(--green);
      background: rgba(52,211,153,0.08);
      border: 1px solid rgba(52,211,153,0.2);
      padding: 4px 10px;
      border-radius: 4px;
    }

    .live-dot {
      width: 6px; height: 6px;
      background: var(--green);
      border-radius: 50%;
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.3; }
    }

    /* Stats row */
    .stats-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px;
      margin-bottom: 32px;
    }

    .stat-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 20px 24px;
      position: relative;
      overflow: hidden;
    }

    .stat-card::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 2px;
    }
    .stat-card.green::before { background: var(--green); }
    .stat-card.red::before { background: var(--red); }
    .stat-card.blue::before { background: var(--blue); }

    .stat-label {
      font-size: 11px;
      font-family: var(--mono);
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-bottom: 8px;
    }

    .stat-value {
      font-size: 32px;
      font-family: var(--mono);
      font-weight: 600;
      line-height: 1;
    }

    .stat-card.green .stat-value { color: var(--green); }
    .stat-card.red .stat-value { color: var(--red); }
    .stat-card.blue .stat-value { color: var(--blue); }

    .stat-sub {
      font-size: 11px;
      color: var(--muted);
      margin-top: 6px;
      font-family: var(--mono);
    }

    /* Section */
    .section { margin-bottom: 32px; }

    .section-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
    }

    .section-title {
      font-size: 12px;
      font-family: var(--mono);
      font-weight: 500;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.1em;
    }

    /* Companies */
    .companies-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px;
    }

    .company-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 20px;
      transition: border-color 0.2s;
    }

    .company-card.connected {
      border-color: rgba(52,211,153,0.25);
    }

    .company-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 12px;
    }

    .company-name {
      font-size: 14px;
      font-weight: 500;
    }

    .company-role {
      font-size: 10px;
      font-family: var(--mono);
      color: var(--accent);
      background: rgba(45,212,191,0.08);
      border: 1px solid rgba(45,212,191,0.2);
      padding: 2px 6px;
      border-radius: 3px;
    }

    .status-chip {
      font-size: 10px;
      font-family: var(--mono);
      padding: 3px 8px;
      border-radius: 3px;
      font-weight: 500;
    }

    .status-chip.connected {
      color: var(--green);
      background: rgba(52,211,153,0.1);
      border: 1px solid rgba(52,211,153,0.2);
    }

    .status-chip.disconnected {
      color: var(--muted);
      background: rgba(100,116,139,0.1);
      border: 1px solid rgba(100,116,139,0.2);
    }

    .company-detail {
      font-size: 11px;
      color: var(--muted);
      font-family: var(--mono);
      margin-bottom: 14px;
      min-height: 30px;
    }

    .btn {
      font-family: var(--mono);
      font-size: 11px;
      font-weight: 500;
      padding: 7px 14px;
      border-radius: 5px;
      border: none;
      cursor: pointer;
      transition: all 0.15s;
      text-decoration: none;
      display: inline-block;
    }

    .btn-primary {
      background: var(--accent);
      color: #000;
    }

    .btn-primary:hover { background: #14b8a6; }

    .btn-danger {
      background: rgba(248,113,113,0.1);
      color: var(--red);
      border: 1px solid rgba(248,113,113,0.2);
    }

    .btn-danger:hover { background: rgba(248,113,113,0.2); }

    .btn-ghost {
      background: var(--surface2);
      color: var(--muted);
      border: 1px solid var(--border);
    }

    .btn-ghost:hover { color: var(--text); border-color: var(--muted); }

    /* Webhook info */
    .webhook-box {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 20px 24px;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 16px;
    }

    .webhook-label {
      font-size: 11px;
      color: var(--muted);
      font-family: var(--mono);
      white-space: nowrap;
    }

    /* Settings was the one page with real horizontal overflow on a phone (88px):
       the header row and the webhook row were both non-wrapping flex lines, so
       "Sign Out" and the Copy button were pushed off the right edge. */
    @media (max-width: 600px) {
      .container { padding-left: 16px; padding-right: 16px; }
      header { margin-bottom: 28px; }
      .header-inner { align-items: flex-start; }
      .webhook-label { white-space: normal; }
      .webhook-box { padding: 16px; }
      .section-header { flex-wrap: wrap; gap: 10px; }
      /* Touch pass. The "Send test" button sits beside every recipient box, so
         there are 20+ of them on this page and they were all under 32px. */
      .btn { min-height: 38px; }
      input, select, textarea { font-size: 16px; }
      label, .status-chip, .company-role { font-size: 11px; }
    }

    .webhook-url {
      min-width: 0;
      overflow-wrap: anywhere;
      font-family: var(--mono);
      font-size: 12px;
      color: var(--accent2);
      background: var(--surface2);
      border: 1px solid var(--border);
      padding: 8px 14px;
      border-radius: 5px;
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      cursor: pointer;
      transition: border-color 0.15s;
    }

    .webhook-url:hover { border-color: var(--accent2); }

    /* Test sync */
    .test-panel {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 20px 24px;
    }

    .test-row {
      display: flex;
      gap: 10px;
      align-items: flex-end;
    }

    .field {
      display: flex;
      flex-direction: column;
      gap: 6px;
      flex: 1;
    }

    .field label {
      font-size: 10px;
      font-family: var(--mono);
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    .field select, .field input {
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text);
      font-family: var(--mono);
      font-size: 12px;
      padding: 8px 12px;
      border-radius: 5px;
      outline: none;
      transition: border-color 0.15s;
    }

    .field select:focus, .field input:focus {
      border-color: var(--accent);
    }

    /* Logs */
    .logs-container {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
    }

    .logs-header {
      padding: 14px 20px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .logs-title {
      font-size: 11px;
      font-family: var(--mono);
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    .log-list { max-height: 400px; overflow-y: auto; }

    .log-list::-webkit-scrollbar { width: 4px; }
    .log-list::-webkit-scrollbar-track { background: transparent; }
    .log-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

    .log-entry {
      display: grid;
      grid-template-columns: 20px 140px 1fr;
      gap: 12px;
      align-items: start;
      padding: 10px 20px;
      border-bottom: 1px solid var(--border);
      font-family: var(--mono);
      font-size: 11px;
      transition: background 0.1s;
    }

    .log-entry:last-child { border-bottom: none; }
    .log-entry:hover { background: var(--surface2); }

    .log-dot {
      width: 6px; height: 6px;
      border-radius: 50%;
      margin-top: 3px;
      flex-shrink: 0;
    }

    .log-dot.success { background: var(--green); }
    .log-dot.error { background: var(--red); }
    .log-dot.warning { background: var(--yellow); }
    .log-dot.info { background: var(--blue); }

    .log-time { color: var(--muted); }
    .log-message { color: var(--text); line-height: 1.5; }

    .log-empty {
      padding: 40px;
      text-align: center;
      color: var(--muted);
      font-family: var(--mono);
      font-size: 12px;
    }

    /* Toast */
    .toast {
      position: fixed;
      bottom: 24px;
      right: 24px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 12px 18px;
      font-family: var(--mono);
      font-size: 12px;
      color: var(--text);
      z-index: 100;
      transform: translateY(80px);
      opacity: 0;
      transition: all 0.25s ease;
    }

    .toast.show { transform: translateY(0); opacity: 1; }
    .toast.success { border-color: rgba(52,211,153,0.3); color: var(--green); }
    .toast.error { border-color: rgba(248,113,113,0.3); color: var(--red); }

    /* Responsive */
    @media (max-width: 768px) {
      .stats-row, .companies-grid { grid-template-columns: 1fr; }
      .test-row { flex-direction: column; }
    }
    .email-field-row { margin-bottom: 12px; }
    .email-field-row:last-child { margin-bottom: 0; }
    .email-label { display: block; font-size: 11px; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 5px; }
    .email-input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 12px; color: var(--text); font-size: 13px; font-family: var(--mono); outline: none; transition: border-color 0.15s; }
    .email-input:focus { border-color: rgba(52,211,153,0.5); }
