/* Telepath cloud portal. Tokens and layout follow the 2026-09-29 design handoff. */
:root {
  --bg: #070914; --panel: rgba(16,21,36,.86); --panel-solid: #111626; --line: rgba(255,255,255,.08);
  --text: #f8fbff; --muted: #9fa9bd; --faint: #5f6b82;
  --blue: #7dd3fc; --green: #86efac; --violet: #c4b5fd; --amber: #fde68a; --red: #f87171; --soft: #dbeafe;
  --primary: linear-gradient(135deg, #7dd3fc, #86efac);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif; color: var(--text); }
a { color: var(--blue); text-decoration: none; } a:hover { color: #bae6fd; }
button { font-family: inherit; cursor: pointer; border: 0; color: inherit; background: none; }
input, select { font-family: inherit; }
input::placeholder { color: var(--faint); }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
@keyframes tpPulse { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes tpFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.bg { min-height: 100vh; position: relative; overflow: hidden;
  background: radial-gradient(900px 520px at 12% -10%, rgba(125,211,252,.16), transparent 60%), radial-gradient(700px 480px at 100% 110%, rgba(134,239,172,.10), transparent 60%), var(--bg); }

/* Shared controls */
.input, input[type="email"], input[type="password"], input[type="text"] { font-size: 1rem; padding: 13px 15px; border-radius: 14px; border: 1px solid rgba(255,255,255,.1); background: rgba(0,0,0,.28); color: var(--text); outline: none; width: 100%; }
input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(125,211,252,.18); }
.primary { padding: 14px; border-radius: 14px; font-size: .95rem; font-weight: 900; color: #061018; background: var(--primary); }
.primary:hover { filter: brightness(1.08); }
.primary:disabled { opacity: .7; cursor: wait; filter: none; }
.secondary { padding: 13px 16px; border-radius: 14px; font-size: .9rem; font-weight: 800; color: var(--soft); background: rgba(255,255,255,.08); }
.secondary:hover { background: rgba(255,255,255,.13); }
.danger-btn { padding: 11px 16px; border-radius: 12px; font-size: .86rem; font-weight: 900; color: #1a0606; background: var(--red); }
.link { padding: 7px 0; color: var(--blue); font-size: .86rem; font-weight: 600; text-align: left; }
.link:hover { color: #bae6fd; }
.row { display: flex; gap: 10px; flex-wrap: wrap; } .row.end { justify-content: flex-end; } .grow { flex: 1; }
.msg { padding: 11px 13px; border-radius: 12px; font-size: .84rem; font-weight: 600; color: var(--amber); background: rgba(253,230,138,.1); }
.msg.ok { color: var(--green); background: rgba(134,239,172,.1); }
.eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--blue); }
.foot { font-size: .8rem; color: var(--faint); }
.empty { color: var(--muted); padding: 18px; font-size: .9rem; }
.label { font-size: .78rem; font-weight: 800; color: var(--muted); }

/* Brand */
.brand { display: flex; align-items: center; gap: 14px; }
.brand.small { gap: 12px; }
.wordmark { font-size: 1.5rem; font-weight: 900; letter-spacing: -.06em; }
.brand.small .wordmark { font-size: 1.35rem; }
.brand-sep { width: 1px; height: 22px; background: rgba(255,255,255,.14); }
.logo { width: 118px; height: auto; display: block; opacity: .9; }
.brand.small .logo { width: 96px; opacity: .85; }
.pulse { position: relative; width: 10px; height: 10px; display: inline-block; }
.pulse-ring, .pulse-dot { position: absolute; inset: 0; border-radius: 999px; background: var(--green); }
.pulse-ring { animation: tpPulse 1.8s ease-out infinite; }

/* Sign-in split */
.auth { min-height: 100vh; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.auth-left { padding: 48px clamp(24px, 6vw, 80px); display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.hero { display: flex; flex-direction: column; gap: 18px; max-width: 520px; }
.eyebrow-live { display: flex; gap: 10px; align-items: center; font-size: .72rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--green); }
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.02; font-weight: 900; letter-spacing: -.055em; text-wrap: balance; }
.hero p { font-size: 1rem; line-height: 1.6; color: var(--muted); max-width: 440px; text-wrap: pretty; }
.domain { font-size: .78rem; color: var(--faint); }
.auth-right { display: flex; align-items: center; justify-content: center; padding: 32px clamp(20px, 5vw, 64px); }
.auth-card { width: 100%; max-width: 420px; padding: 30px; border-radius: 26px; background: var(--panel); border: 1px solid rgba(255,255,255,.09); box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.panel { display: flex; flex-direction: column; gap: 20px; }
.panel h2 { font-size: 1.5rem; font-weight: 900; letter-spacing: -.04em; }
.panel-head { display: flex; flex-direction: column; gap: 8px; }
.panel-head p { font-size: .9rem; line-height: 1.55; color: var(--muted); text-wrap: pretty; }
.panel-head b { color: var(--text); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-size: .78rem; font-weight: 800; color: var(--muted); }
.form .primary { margin-top: 4px; }
.links { display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.07); }
.tile { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 1.5rem; }
.tile.blue { background: rgba(125,211,252,.14); color: var(--blue); }
.tile.amber { background: rgba(253,230,138,.14); color: var(--amber); font-size: 1.4rem; }
.tile.float { animation: tpFloat 3s ease-in-out infinite; }

/* App shell */
.app { max-width: 1180px; margin: 0 auto; padding: 22px clamp(16px, 4vw, 40px) 64px; display: flex; flex-direction: column; gap: 34px; }
.app-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.app-head-left { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.05); }
.tab { padding: 9px 16px; border-radius: 11px; font-size: .86rem; font-weight: 800; color: var(--muted); }
.tab.on { color: #061018; background: #e8f4ff; }
a.tab.link { text-decoration: none; display: inline-block; line-height: normal; }
.me { position: relative; }
.me-pill { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--text); }
.me-pill:hover { background: rgba(255,255,255,.1); }
.avatar { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; font-size: .8rem; font-weight: 900; color: #061018; background: var(--primary); }
.me-email { font-size: .84rem; font-weight: 600; }
.role-chip { font-size: .66rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.role-admin { color: var(--violet); background: rgba(196,181,253,.14); }
.role-operator { color: var(--blue); background: rgba(125,211,252,.14); }
.role-viewer { color: var(--green); background: rgba(134,239,172,.12); }
.role-pending { color: var(--muted); background: rgba(255,255,255,.05); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 240px; padding: 8px; border-radius: 16px; background: var(--panel-solid); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 20px 50px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 2px; }
.menu-org { padding: 10px 12px; font-size: .78rem; color: var(--muted); }
.menu-item { padding: 10px 12px; border-radius: 10px; text-align: left; font-size: .86rem; font-weight: 600; color: var(--soft); }
.menu-item:hover { background: rgba(255,255,255,.06); }
.menu-item.danger { color: #fca5a5; font-weight: 700; }
.menu-item.danger:hover { background: rgba(248,113,113,.1); }
.tabpage { display: flex; flex-direction: column; gap: 26px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-title { display: flex; flex-direction: column; gap: 8px; }
.page-title h1 { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 900; letter-spacing: -.05em; }
.page-title p { font-size: .95rem; color: var(--muted); }
.page-title p.wide { max-width: 620px; text-wrap: pretty; }
.stats { display: flex; gap: 10px; }
.stat { padding: 12px 18px; border-radius: 16px; background: rgba(255,255,255,.04); display: flex; flex-direction: column; gap: 2px; }
.stat.green { background: rgba(134,239,172,.08); }
.stat-n { font-size: 1.6rem; font-weight: 900; letter-spacing: -.04em; }
.stat.green .stat-n { color: var(--green); }
.stat-l { font-size: .72rem; font-weight: 800; color: var(--muted); }

/* Robot cards */
.robot-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.robot { display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: transform .2s, border-color .2s; }
.robot:hover { transform: translateY(-3px); border-color: rgba(125,211,252,.3); }
.robot-tile { position: relative; height: 132px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.02)); }
.robot.fresh .robot-tile.t0 { background: linear-gradient(135deg, rgba(125,211,252,.28), rgba(125,211,252,.04)); }
.robot.fresh .robot-tile.t1 { background: linear-gradient(135deg, rgba(134,239,172,.24), rgba(134,239,172,.04)); }
.robot.fresh .robot-tile.t2 { background: linear-gradient(135deg, rgba(196,181,253,.24), rgba(196,181,253,.04)); }
.robot.fresh .robot-tile.t3 { background: linear-gradient(135deg, rgba(253,230,138,.2), rgba(253,230,138,.03)); }
.robot-tile-top { display: flex; justify-content: space-between; align-items: center; }
.state-badge { display: flex; align-items: center; gap: 8px; padding: 5px 11px 5px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; color: var(--muted); background: rgba(7,9,20,.55); }
.robot.fresh .state-badge { color: var(--green); }
.state-badge .pulse { width: 8px; height: 8px; }
.state-badge .pulse-ring, .state-badge .pulse-dot { background: currentColor; }
.robot:not(.fresh) .state-badge .pulse-ring { display: none; }
.robot-id { font-size: .72rem; font-weight: 700; color: rgba(248,251,255,.6); font-family: ui-monospace, monospace; }
.robot-serial { font-size: 3.2rem; line-height: .9; font-weight: 900; letter-spacing: -.06em; color: rgba(248,251,255,.28); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.robot-serial.long { font-size: 1.9rem; letter-spacing: -.04em; }
.robot-serial.verylong { font-size: 1.35rem; letter-spacing: -.03em; }
.robot.fresh .robot-serial { color: rgba(248,251,255,.92); }
.robot-body { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.robot-name { font-size: 1.12rem; font-weight: 900; letter-spacing: -.03em; }
.robot-addr { font-size: .8rem; color: var(--muted); font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.robot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.robot-actions .open { flex: 1 1 100%; padding: 11px 12px; border-radius: 13px; font-size: .88rem; font-weight: 900; color: #061018; background: var(--primary); text-align: center; }
.robot-actions .open small { display: block; font-size: .68rem; font-weight: 800; opacity: .72; margin-top: 2px; }
.robot-actions .open.alt { flex: 1 1 auto; color: var(--soft); background: rgba(255,255,255,.06); }
.robot-actions .open.alt:hover { background: rgba(255,255,255,.1); filter: none; }
.robot-actions .open:hover { filter: brightness(1.08); }
.robot-actions .open.off { font-weight: 800; color: var(--muted); background: rgba(255,255,255,.06); }
.robot-actions .open.off:hover { background: rgba(255,255,255,.1); filter: none; }
.robot-actions .open.wait { cursor: default; color: var(--faint); }
.robot-actions .details { padding: 12px 14px; border-radius: 13px; font-size: .88rem; font-weight: 800; color: var(--soft); background: rgba(255,255,255,.06); }
.robot-actions .details:hover { background: rgba(255,255,255,.1); }

/* People */
.invite { padding: 20px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.invite-row { display: flex; gap: 10px; flex-wrap: wrap; }
.invite-row input { flex: 1; min-width: 240px; width: auto; }
.invite-row .primary { padding: 13px 22px; font-size: .92rem; }
.role-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.role-card { padding: 14px; border-radius: 16px; text-align: left; display: flex; flex-direction: column; gap: 5px; color: var(--text); background: rgba(255,255,255,.04); }
.role-card b { font-size: .9rem; font-weight: 900; color: var(--soft); }
.role-card span { font-size: .8rem; line-height: 1.4; color: var(--muted); }
.role-card.on.role-admin b { color: var(--violet); } .role-card.on.role-operator b { color: var(--blue); } .role-card.on.role-viewer b { color: var(--green); }
.role-card.on.role-admin { background: rgba(196,181,253,.14); box-shadow: inset 0 0 0 1.5px var(--violet); }
.role-card.on.role-operator { background: rgba(125,211,252,.14); box-shadow: inset 0 0 0 1.5px var(--blue); }
.role-card.on.role-viewer { background: rgba(134,239,172,.12); box-shadow: inset 0 0 0 1.5px var(--green); }
.people { display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); }
.person { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.06); }
.person:first-child { border-top: 0; }
.person .avatar { width: 38px; height: 38px; font-size: .9rem; }
.person .avatar.role-admin { color: var(--violet); background: rgba(196,181,253,.14); }
.person .avatar.role-operator { color: var(--blue); background: rgba(125,211,252,.14); }
.person .avatar.role-viewer { color: var(--green); background: rgba(134,239,172,.12); }
.person .avatar.role-pending { color: var(--muted); background: rgba(255,255,255,.05); }
.person-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.person-email { font-size: .95rem; font-weight: 800; overflow-wrap: anywhere; }
.person-meta { font-size: .78rem; color: var(--muted); }
.person-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.role-select { padding: 9px 12px; border-radius: 11px; border: 0; font-size: .82rem; font-weight: 800; }
.role-fixed { padding: 7px 12px; border-radius: 11px; font-size: .78rem; font-weight: 800; text-transform: capitalize; }
.remove { padding: 9px 12px; border-radius: 11px; font-size: .8rem; font-weight: 800; color: #fca5a5; background: rgba(248,113,113,.08); }
.remove:hover { background: rgba(248,113,113,.16); }

/* Drawer */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(3,5,12,.6); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(460px, 94vw); padding: 26px; overflow: auto; background: #0c1020; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer-head > div { display: flex; flex-direction: column; gap: 6px; }
.drawer-head .eyebrow { letter-spacing: .16em; color: var(--muted); } .drawer-head .eyebrow.fresh { color: var(--green); }
.drawer-head h2 { font-size: 1.6rem; font-weight: 900; letter-spacing: -.04em; }
.icon-btn { width: 36px; height: 36px; border-radius: 12px; font-size: 1rem; color: var(--soft); background: rgba(255,255,255,.07); }
.icon-btn:hover { background: rgba(255,255,255,.12); }
.facts { display: flex; flex-direction: column; gap: 1px; border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.06); }
.fact { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 12px 14px; background: #0f1426; }
.fact-k { font-size: .78rem; font-weight: 700; color: var(--muted); }
.fact-v { font-size: .84rem; font-weight: 600; font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.drawer-block { display: flex; flex-direction: column; gap: 12px; }
.drawer-block input { font-size: .95rem; padding: 12px 14px; border-radius: 13px; }
.drawer-block input.mono { font-size: .9rem; }
.drawer-block .primary { padding: 12px; font-size: .88rem; border-radius: 13px; }
.audit { display: flex; flex-direction: column; gap: 8px; }
.audit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 11px 13px; border-radius: 13px; background: rgba(255,255,255,.04); }
.audit-row div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.audit-who { font-size: .84rem; font-weight: 700; overflow-wrap: anywhere; }
.audit-what, .audit-at { font-size: .74rem; color: var(--muted); }

/* Confirm + toast */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(3,5,12,.7); }
.modal { width: 100%; max-width: 400px; padding: 24px; border-radius: 22px; background: var(--panel-solid); border: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 14px; }
.modal h3 { font-size: 1.15rem; font-weight: 900; letter-spacing: -.03em; }
.modal p { font-size: .88rem; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.modal .secondary { padding: 11px 16px; border-radius: 12px; font-size: .86rem; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 70; padding: 12px 18px; border-radius: 14px; font-size: .86rem; font-weight: 700; color: #061018; background: var(--green); box-shadow: 0 14px 40px rgba(0,0,0,.4); }

.keys-title { margin-top: 34px; }
.keys-title h2 { font-size: 1.25rem; margin: 0 0 4px; }
.keybox { width: 100%; margin-top: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: inherit; font-size: .8rem; resize: vertical; }
.key-fp { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .74rem; color: var(--muted); }
.key-status { padding: 6px 10px; border-radius: 999px; font-size: .74rem; font-weight: 800; }
.key-status.pending { background: rgba(251,191,36,.14); color: #fcd34d; }
.key-status.approved { background: rgba(74,222,128,.12); color: #86efac; }
.key-status.revoked { background: rgba(248,113,113,.1); color: #fca5a5; }
.key-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.approve { padding: 9px 12px; border-radius: 11px; font-size: .8rem; font-weight: 800; color: #86efac; background: rgba(74,222,128,.1); }
.small { padding: 8px 12px; font-size: .8rem; }
.support-toggle { display: inline-flex; gap: 6px; align-items: center; font-size: .78rem; color: var(--muted); }

.invite-row.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.invite-row.three select { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: inherit; font: inherit; }
.claim { margin: 14px 0; padding: 16px 18px; border-radius: 16px; border: 1px solid rgba(74,222,128,.35); background: rgba(74,222,128,.08); }
.claim b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.4rem; letter-spacing: .06em; user-select: all; }
.claim .foot { display: block; margin-top: 6px; }

/* Setup card (admins only) and organization people, inside the Sensori list */
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px; }
.facts .card-actions .mini, .facts .fact-v .mini { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line, #2a2f3a); background: rgba(255,255,255,.06); color: inherit; font: inherit; font-size: .85rem; cursor: pointer; }
.facts .card-actions .mini[disabled] { opacity: .6; cursor: default; }
.org-people { grid-column: 1 / -1; flex-basis: 100%; width: 100%; margin: 4px 0 10px 44px; padding: 10px 12px; border: 1px solid var(--line, #2a2f3a); border-radius: 10px; }
.org-people .invite { margin-bottom: 8px; }
.org-people .person { padding-left: 0; }
.org-card { grid-column: 1 / -1; flex-basis: 100%; margin: 4px 0 10px 44px; }
.person { flex-wrap: wrap; }

/* fleet table (Sensori) */
.fleet { overflow-x: auto; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 14px; }
.fleet table { width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 760px; }
.fleet th, .fleet td { text-align: left; padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.06); vertical-align: top; }
.fleet th { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-top: 0; font-weight: 700; }
.fleet td.mono { font-family: ui-monospace, monospace; font-size: .76rem; }
.fleet .ok { color: var(--green); } .fleet .warn { color: #fbbf24; } .fleet .bad { color: #f87171; }
.fleet select { font-size: .76rem; padding: 4px 6px; border-radius: 8px; }
.audit-row .audit-what.sensori { color: var(--violet); }
.support-fact .fact-v { font-family: inherit; font-weight: 500; } .support-fact small { color: var(--muted); } .support-fact .mini { margin-top: 6px; }

/* recovery image upload */
.progress { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.progress progress { flex: 1; height: 8px; accent-color: var(--blue); }
.rec-link { display: block; margin-top: 6px; word-break: break-all; }
