/* Account menu (all pages), sign-in and settings */
.topnav a.locked { color: var(--faint); }
.topnav a.locked::after, .topnav .current.locked::after { content: "🔒"; font-size: 11px; margin-left: 4px; }
.topbar .spacer { flex: 1; }
.account { position: relative; display: flex; align-items: center; gap: 10px; margin-left: auto; }
.topbar .spacer + .account { margin-left: 0; }
.plan-pill { font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.account-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 4px 4px 4px 10px; border-radius: 999px; cursor: pointer; }
.account-btn:hover { background: var(--surface-2); }
.ws-name { font-weight: 600; font-size: 14px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: rgba(255, 255, 255, 0.96); backdrop-filter: saturate(180%) blur(20px); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.menu-head { display: flex; flex-direction: column; padding: 10px 12px 8px; }
.menu-head span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.menu-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); padding: 8px 12px 4px; }
.menu-item { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--accent); color: var(--accent-ink); outline: none; }
.menu-item:hover .menu-role { color: inherit; }
.menu-role { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.menu-sep { height: 1px; background: var(--border); margin: 6px 8px; }
@media (max-width: 720px) {
  .ws-name, .plan-pill { display: none; }
  .topbar { gap: 14px; padding: 0 16px; }
  .topnav { gap: 12px; overflow-x: auto; }
}

/* Sign in */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 32px 28px; }
.auth-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 22px; }
.auth-card h1 { font-size: 26px; margin-bottom: 4px; }
.auth-card .lede { margin-bottom: 22px; }
.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.auth-form .btn { display: flex; align-items: center; justify-content: center; height: 44px; font-size: 15px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--muted); }
.auth-switch button { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-weight: 500; }
.auth-error { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.invite-banner { background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 18px; }
.ws-choice { display: grid; gap: 8px; margin-bottom: 18px; }
.ws-choice button { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border); background: var(--surface); padding: 12px 14px; border-radius: 12px; cursor: pointer; text-align: left; }
.ws-choice button:hover { border-color: var(--accent); }

/* Settings */
.seg { display: inline-flex; background: var(--fill); border-radius: 10px; padding: 2px; gap: 2px; margin-bottom: 22px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 6px 16px; border-radius: 8px; font-weight: 500; font-size: 14px; cursor: pointer; color: var(--text); }
.seg button[aria-selected="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); font-weight: 600; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 18px; }
.panel h2 { margin-bottom: 4px; }
.panel .lede { font-size: 14px; margin-bottom: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .who { display: flex; align-items: center; gap: 10px; }
.table .who small { display: block; color: var(--muted); }
.table select { font: inherit; font-size: 13px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); }
.muted { color: var(--muted); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--fill); color: var(--muted); text-transform: capitalize; }
.tag.owner { background: var(--accent-soft); color: var(--accent); }
.tag.admin { background: var(--ok-soft); color: var(--ok); }
.tag.off { background: var(--bad-soft); color: var(--bad); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form .input { flex: 1 1 220px; }
.link-box { display: flex; gap: 8px; align-items: center; margin-top: 12px; background: var(--ok-soft); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.link-box code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: transparent; }
.meter { height: 8px; background: var(--fill); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.meter.over > span { background: var(--warn); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--surface-2); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-size: 22px; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 13px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.plan { border: 1.5px solid var(--border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.plan.current { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan h3 { margin: 0; font-size: 17px; }
.plan .price { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.plan .price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.plan ul { margin: 4px 0 8px; padding-left: 18px; font-size: 13px; color: var(--muted); display: grid; gap: 3px; }
.plan .btn { margin-top: auto; display: flex; align-items: center; justify-content: center; }
.addons { display: grid; gap: 10px; }
.addon { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.addon input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); }
.addon div { flex: 1; }
.addon p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.addon .price-tag { font-weight: 600; white-space: nowrap; }
.summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--border); margin-top: 18px; padding-top: 16px; }
.summary .total { font-size: 20px; font-weight: 700; }
.test-note { font-size: 12px; color: var(--warn); background: var(--warn-soft); padding: 4px 10px; border-radius: 8px; }
.connectors { display: grid; gap: 14px; }
.connector { border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.connector-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.connector-head h3 { margin: 0; font-size: 15px; }
.connector .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.connector label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.connector.locked { opacity: 0.6; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); margin-right: 6px; }
.dot.on { background: var(--ok); }
@media (max-width: 720px) {
  .table .hide-sm { display: none; }
  .panel { padding: 18px 16px; }
}
/* Processes page: only owners and admins change what Ovenbird follows */
body:not(.can-manage-processes) #addBtn,
body:not(.can-manage-processes) #routeBtn,
body:not(.can-manage-processes) .card-actions { display: none !important; }

/* Sign in with Google / Microsoft */
.sso { display: grid; gap: 10px; margin-bottom: 18px; }
.sso-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; text-decoration: none; font-size: 15px; font-weight: 500; color: var(--text); }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin-top: 4px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Design side: Studio ↔ Processes */
.subnav { display: flex; gap: 4px; padding: 8px 24px 0; background: var(--bg); }
.subnav a { text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 500; padding: 6px 12px; border-radius: 999px; }
.subnav a:hover { color: var(--text); background: var(--fill); }
.subnav a.on { background: var(--text); color: var(--bg); font-weight: 600; }
body.manage-page .topbar { background: #fbfbfa; }

/* Legal */
.auth-form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text); font-size: 13.5px; line-height: 1.4; }
.auth-form label.check input { margin-top: 3px; }
.auth-form label.check a { color: var(--accent); }
.legal-foot { text-align: center; margin: 22px 0 0; font-size: 12.5px; color: var(--faint); }
.legal-foot a { color: var(--faint); text-decoration: none; }
.legal-foot a:hover { color: var(--accent); }
.legal-list { margin: 0 0 18px; padding-left: 20px; font-size: 15px; display: grid; gap: 6px; }
.legal-list a { color: var(--accent); }
.ws-closed { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; display: grid; gap: 6px; margin-bottom: 14px; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text); margin: 14px 0 0; line-height: 1.4; }
.consent input { margin-top: 3px; }
.consent a { color: var(--accent); }
.tax-note { font-size: 12.5px; color: var(--faint); margin: 8px 0 0; }
.danger-zone { border: 1px solid var(--bad-soft); border-radius: 14px; padding: 16px 18px; margin-top: 18px; }
.danger-zone h3 { font-size: 15px; margin: 0 0 6px; color: var(--bad); }
.danger-zone p { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }

/* OAuth connections */
.oauth-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.oauth-row.connected { background: var(--ok-soft); }
.oauth-row p { margin: 4px 0 0; font-size: 13px; }
.oauth-row a[aria-disabled="true"] { pointer-events: none; opacity: 0.5; }
.alt-auth summary { cursor: pointer; font-size: 13px; color: var(--accent); margin: 6px 0 10px; }

/* Language */
.lang-switch { font: inherit; font-size: 13px; border: 1px solid var(--border); border-radius: 8px; padding: 3px 6px; background: var(--surface); color: var(--text); }
.lang-switch.small { font-size: 12px; padding: 1px 4px; color: var(--faint); border-color: transparent; }
.menu-lang { cursor: default; }
.menu-lang:hover { background: transparent; }
.ws-lang { margin-top: 16px; }
.ws-lang label { display: flex; align-items: center; gap: 10px; font-size: 14px; }

/* Integrations marketplace (Manage → Integrations) */
.mk .panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.mk-count { text-align: center; background: var(--surface-2); border-radius: 12px; padding: 8px 14px; min-width: 84px; }
.mk-count b { display: block; font-size: 22px; letter-spacing: -0.02em; }
.mk-count span { font-size: 12px; color: var(--muted); }
.mk-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0 6px; }
.mk-tools .input { max-width: 260px; }
.mk-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.mk-cats .chip { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--muted); }
.mk-cats .chip.on { background: var(--text); color: #fff; border-color: var(--text); }
.mk-group h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 18px 0 8px; }
.mk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.mk-card { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; gap: 4px 12px; align-items: start; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; cursor: pointer; font: inherit; color: var(--text); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.mk-card:hover, .mk-card:focus-visible { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.mk-card .mk-logo { grid-row: 1 / 3; }
.mk-card .mk-body { display: grid; gap: 2px; }
.mk-card b { font-size: 14.5px; }
.mk-lede { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.mk-card .mk-badge { grid-column: 2; justify-self: start; margin-top: 4px; }
.mk-card.st-on { border-color: var(--ok); }
.mk-logo { width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--tc, #555) 16%, #fff); color: color-mix(in srgb, var(--tc, #555) 45%, #000); display: grid; place-items: center; font-weight: 700; font-size: 14px; letter-spacing: -0.02em; flex-shrink: 0; }
.mk-logo.has-logo { background: #fff; box-shadow: 0 0 0 1px var(--border); }
.mk-logo img { width: 24px; height: 24px; }
.mk-badge { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; border-radius: 999px; padding: 2px 8px; background: var(--surface-2); color: var(--muted); }
.mk-badge.on { background: var(--ok-soft); color: #1a7f37; }
.mk-badge.soon { background: #fff4e0; color: #8a5a00; }
.mk-badge.locked { background: var(--fill); color: var(--muted); }
.mk-drawer[hidden] { display: none; }
.mk-drawer { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.28); z-index: 60; display: flex; justify-content: flex-end; }
.mk-sheet { width: min(560px, 100%); height: 100%; overflow-y: auto; background: var(--bg); padding: 24px 24px 40px; position: relative; box-shadow: -12px 0 40px rgba(0, 0, 0, 0.12); animation: mk-in 0.22s ease-out; }
@keyframes mk-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .mk-sheet { animation: none; } }
.mk-close { position: absolute; top: 16px; right: 16px; }
.mk-sheet-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.mk-sheet-head .mk-logo { width: 56px; height: 56px; font-size: 18px; }
.mk-sheet-head .mk-logo img { width: 30px; height: 30px; }
.mk-sheet-head h2 { margin: 0 0 4px; font-size: 22px; }
.mk-sheet-head .eyebrow { margin: 0 0 2px; font-size: 11.5px; }
.mk-sheet .lede { margin: 6px 0 12px; }
.mk-why { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.mk-why li { background: var(--surface); border-radius: 10px; padding: 8px 12px 8px 32px; font-size: 13.5px; position: relative; }
.mk-why li::before { content: "✓"; position: absolute; left: 12px; color: var(--ok); font-weight: 700; }
.mk-rw { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.mk-rw > div { background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.mk-rw h3 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.mk-rw ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--muted); }
.mk-rw li { margin: 2px 0; }
.mk-sheet .grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.mk-sheet label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.mk-sheet .oauth-row { flex-direction: column; align-items: flex-start; }
body.mk-open { overflow: hidden; }
@media (max-width: 600px) { .mk-rw { grid-template-columns: 1fr; } .mk-sheet { padding: 18px 16px 32px; } }
