:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-soft: #f8f9f7;
  --ink: #17201c;
  --muted: #667069;
  --line: #e2e6e1;
  --accent: #1f6b4f;
  --accent-soft: #e8f3ed;
  --online: #31a66a;
  --warning: #c58a1a;
  --danger: #c34d4d;
  --shadow: 0 18px 55px rgba(26, 40, 32, .07);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, a { font: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(31, 107, 79, .25); outline-offset: 2px; }
[hidden] { display: none !important; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 730; letter-spacing: -.02em; }
.brand-mark { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: var(--ink); color: #fff; font-size: 14px; }
.badge { margin-left: 4px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .02em; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 11px; font-weight: 760; letter-spacing: .12em; }
.muted { margin: 7px 0 0; color: var(--muted); }
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: radial-gradient(circle at 30% 20%, #eef5f0 0, transparent 38%), var(--bg); }
.login-card { width: min(100%, 530px); padding: 42px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.login-card .brand { margin-bottom: 55px; }
.login-card h1 { max-width: 440px; margin: 0; font-size: clamp(30px, 5vw, 42px); line-height: 1.08; letter-spacing: -.045em; }
.lead { margin: 20px 0 28px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.fineprint { margin: 20px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; height: 68px; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
.account { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.text-button { padding: 6px 0 6px 9px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.content { width: min(1200px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 70px; }
.heading-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.heading-row h1 { margin: 0; font-size: clamp(28px, 4vw, 38px); letter-spacing: -.04em; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 680; text-decoration: none; cursor: pointer; }
.button.primary { background: var(--ink); color: #fff; }
.button.secondary, .button.compact { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button.compact { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button[aria-disabled="true"] { pointer-events: none; opacity: .55; }
.button.wide { width: 100%; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 14px; margin-bottom: 14px; }
.metric, .panel { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 8px 30px rgba(28, 39, 33, .035); }
.metric { display: flex; min-height: 125px; flex-direction: column; justify-content: center; padding: 22px; }
.metric-label { margin-bottom: 9px; color: var(--muted); font-size: 12px; font-weight: 650; }
.metric strong { display: flex; align-items: center; gap: 8px; font-size: 24px; letter-spacing: -.025em; }
.metric small { margin-top: 5px; color: var(--muted); }
.status-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #aab2ad; }
.status-dot.online { background: var(--online); box-shadow: 0 0 0 4px rgba(49, 166, 106, .11); }
.status-dot.warning { background: var(--warning); }
.pulse { animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(49, 166, 106, 0); } }
.panel { padding: 24px; }
.flow-panel { margin-bottom: 14px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.flow-node { display: flex; min-width: 0; align-items: center; gap: 12px; }
.flow-node strong, .flow-node small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-node small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.node-icon, .connection-icon { display: grid; flex: 0 0 auto; place-items: center; border-radius: 10px; background: #ecefeb; color: #48524c; font-size: 11px; font-weight: 800; }
.node-icon { width: 38px; height: 38px; }
.node-icon.accent { background: var(--ink); color: white; }
.node-icon.wp { background: #e9f0f7; color: #2b5d86; }
.flow-arrow { color: #9ca49f; font-size: 20px; }
.two-column { display: grid; grid-template-columns: 1.06fr .94fr; gap: 14px; margin-bottom: 14px; }
.connection-list { border-top: 1px solid var(--line); }
.connection { display: flex; min-height: 67px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.connection:last-child { border-bottom: 0; }
.connection-icon { width: 36px; height: 36px; }
.connection-icon.github { background: #222; color: #fff; }
.connection-icon.wordpress { background: #e9f0f7; color: #2b5d86; }
.connection-copy { min-width: 0; flex: 1; }
.connection-copy strong, .connection-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-copy small { color: var(--muted); }
.state { display: inline-flex; align-items: center; gap: 7px; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 680; }
.state.connected { background: var(--accent-soft); color: var(--accent); }
.state.attention { background: #fff6df; color: #8a6217; }
.empty-state { display: flex; min-height: 190px; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--ink); }
.empty-state small { margin-top: 4px; }
.checkmark { display: grid; width: 36px; height: 36px; margin-bottom: 12px; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 18px; }
.approval { padding: 14px 0; border-top: 1px solid var(--line); }
.approval:first-child { border-top: 0; }
.approval-header { display: flex; justify-content: space-between; gap: 10px; }
.risk { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.risk.high, .risk.break_glass { color: var(--danger); }
.risk.medium { color: var(--warning); }
.approval p { margin: 5px 0 12px; color: var(--muted); font-size: 13px; }
.approval-actions { display: flex; gap: 8px; }
.approve { background: var(--accent); color: #fff; }
.reject { border-color: var(--line); background: #fff; color: var(--muted); }
.proposal { max-height: 320px; overflow: auto; margin: 12px 0 0; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #18211c; color: #e8f0eb; font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.permission-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.permission { padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.permission strong, .permission small { display: block; }
.permission small { margin-top: 5px; color: var(--muted); }
.permission-profile { display: inline-block; margin-top: 12px; padding: 4px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; }
.empty-permissions { padding: 24px; border: 1px dashed #ccd2cd; border-radius: 11px; color: var(--muted); text-align: center; }
.lower-grid { margin-top: 14px; }
.plan-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan-option { position: relative; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.plan-option.current { border-color: rgba(31, 107, 79, .45); background: var(--accent-soft); }
.plan-option-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-option-heading span { font-weight: 730; }
.plan-option small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.45; }
.current-plan { display: inline-block; margin-top: 11px; padding: 3px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 750; text-transform: uppercase; }
.plan-footnote { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.activity-list { border-top: 1px solid var(--line); }
.activity { display: flex; min-height: 64px; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.activity:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--warning); }
.activity-dot.applied, .activity-dot.approved, .activity-dot.connected, .activity-dot.executed { background: var(--online); }
.activity-dot.failed, .activity-dot.rejected { background: var(--danger); }
.activity-copy { min-width: 0; flex: 1; }
.activity-copy strong, .activity-copy small, .activity-meta span, .activity-meta time { display: block; }
.activity-copy small, .activity-meta { color: var(--muted); font-size: 11px; }
.activity-copy strong, .activity-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-meta { flex: 0 0 auto; text-align: right; }
.activity-meta span { color: var(--ink); font-weight: 650; }
.compact-empty { min-height: 150px; }
.loading { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--bg); color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid #d8ddd9; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 22px; background: rgba(21, 29, 25, .55); backdrop-filter: blur(5px); }
.modal { width: min(100%, 510px); padding: 30px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: var(--shadow); }
.modal h2 { margin: 0; font-size: 26px; letter-spacing: -.035em; }
.modal > p:not(.eyebrow, .pair-note, .error-text) { color: var(--muted); }
.pair-details { margin: 22px 0; border: 1px solid var(--line); border-radius: 11px; }
.pair-details div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pair-details div:last-child { border-bottom: 0; }
.pair-details dt { color: var(--muted); }
.pair-details dd { overflow: hidden; margin: 0; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.pair-note { padding: 12px; border-radius: 9px; background: var(--surface-soft); color: var(--muted); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.error-text { margin: 12px 0 0; color: var(--danger); font-size: 13px; }
@media (max-width: 800px) {
  .topbar { padding: 0 18px; }
  .badge, .account > .status-dot { display: none; }
  .content { width: min(100% - 28px, 720px); padding-top: 30px; }
  .metrics, .two-column, .permission-list, .plan-options { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); text-align: center; }
  .heading-row { align-items: start; flex-direction: column; }
  .login-card { padding: 30px 24px; }
}
