:root {
  color-scheme: dark;
  --ink: #eff7ff;
  --muted: #8da1b8;
  --bg: #050b13;
  --panel: rgba(12, 24, 39, 0.76);
  --panel-strong: rgba(16, 31, 49, 0.95);
  --line: rgba(151, 196, 221, 0.13);
  --cyan: #55e7d4;
  --blue: #61a9ff;
  --amber: #ffc857;
  --danger: #ff6b7a;
  --success: #62e29b;
  --radius: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: radial-gradient(circle at 70% 0%, #102c3c 0, transparent 34%), linear-gradient(160deg, #07111f 0%, #04080e 58%, #08111b 100%); }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.sr-only { position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.glass { background: var(--panel); border: 1px solid var(--line); box-shadow: 0 22px 70px rgba(0, 0, 0, .28); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.ambient { position: fixed; pointer-events: none; width: 36rem; height: 36rem; filter: blur(120px); opacity: .13; border-radius: 50%; }
.ambient-one { background: var(--cyan); left: -18rem; top: 18%; }
.ambient-two { background: var(--blue); right: -20rem; bottom: -14rem; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 460px); border-radius: 32px; padding: 40px 34px 30px; position: relative; overflow: hidden; }
.login-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, transparent, var(--cyan), var(--blue), transparent); }
.login-card h1 { margin: 16px 0; font-size: clamp(2.45rem, 10vw, 4rem); line-height: .98; letter-spacing: -.065em; }
.login-copy { color: var(--muted); line-height: 1.7; margin-bottom: 30px; }
.brand-mark { display: flex; gap: 5px; width: 50px; height: 50px; align-items: flex-end; padding: 10px; border-radius: 15px; background: linear-gradient(145deg, rgba(85, 231, 212, .18), rgba(97, 169, 255, .12)); border: 1px solid rgba(85, 231, 212, .22); }
.brand-mark span { width: 7px; border-radius: 5px; background: linear-gradient(to top, var(--blue), var(--cyan)); box-shadow: 0 0 16px rgba(85, 231, 212, .35); }
.brand-mark span:nth-child(1) { height: 45%; }.brand-mark span:nth-child(2) { height: 82%; }.brand-mark span:nth-child(3) { height: 62%; }
.brand-mark-small { width: 38px; height: 38px; border-radius: 12px; padding: 8px; }
.eyebrow { color: var(--cyan); font-size: .68rem; letter-spacing: .18em; font-weight: 800; margin: 14px 0 6px; }
.button { border: 0; border-radius: 14px; min-height: 49px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; color: var(--ink); cursor: pointer; font-weight: 750; transition: transform .15s ease, filter .15s ease, border-color .15s ease; }
.button:active { transform: scale(.98); }.button:hover { filter: brightness(1.08); }
.button-primary { color: #031314; background: linear-gradient(135deg, var(--cyan), #9df3d7); box-shadow: 0 12px 30px rgba(85, 231, 212, .16); }
.button-secondary { background: rgba(97, 169, 255, .12); border: 1px solid rgba(97, 169, 255, .24); color: #cfe5ff; }
.button-danger { background: rgba(255, 107, 122, .15); border: 1px solid rgba(255, 107, 122, .35); color: #ffcbd1; }
.button-google { width: 100%; background: #f7fbff; color: #152231; }
.google-g { display: grid; place-items: center; color: #4285f4; background: white; border-radius: 7px; width: 28px; height: 28px; font-weight: 900; box-shadow: 0 1px 4px #a9b5c5; }
.compact { min-height: 42px; padding-inline: 15px; font-size: .86rem; }
.security-note { margin: 20px 0 0; display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--muted); font-size: .75rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }.status-ok { background: var(--success); box-shadow: 0 0 12px var(--success); }.status-warn { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.alert { padding: 12px 14px; border-radius: 12px; font-size: .86rem; }.alert-danger { background: rgba(255, 107, 122, .1); border: 1px solid rgba(255, 107, 122, .24); color: #ffb8c0; }

.app-shell { min-height: 100vh; padding-bottom: calc(98px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; height: calc(70px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left)); display: flex; align-items: center; justify-content: space-between; border-width: 0 0 1px; background: rgba(5, 11, 19, .78); }
.brand-inline { display: flex; align-items: center; gap: 11px; }.brand-inline strong { display: block; letter-spacing: -.02em; }.brand-inline small { color: var(--muted); text-transform: uppercase; font-size: .62rem; letter-spacing: .14em; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }.live-pill { padding: 6px 9px; border: 1px solid rgba(98, 226, 155, .18); border-radius: 999px; color: var(--success); font-size: .62rem; font-weight: 800; letter-spacing: .1em; }.live-pill i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; background: var(--success); box-shadow: 0 0 10px var(--success); }.live-pill.offline { color: var(--amber); }.live-pill.offline i { background: var(--amber); }
.icon-button { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--muted); cursor: pointer; }
.page-wrap { width: min(1180px, 100%); margin: 0 auto; padding: 30px 22px; }
.view { display: none; }.view.active { display: block; animation: reveal .22s ease; } @keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
.hero-row, .section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 26px; }.hero-row h1, .section-heading h1 { margin: 4px 0; font-size: clamp(1.8rem, 6vw, 3.1rem); letter-spacing: -.05em; }.muted { color: var(--muted); line-height: 1.55; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }.metric-card { border-radius: var(--radius); padding: 20px; }.metric-card span { display: block; color: var(--muted); font-size: .77rem; }.metric-card strong { display: block; font-size: 2.15rem; letter-spacing: -.05em; margin: 10px 0 4px; }.metric-card small { color: #60758b; font-size: .65rem; }
.content-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; }.panel { border-radius: var(--radius); padding: 22px; }.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }.panel-header h2 { margin: 3px 0; font-size: 1.25rem; }.text-button { border: 0; background: transparent; color: var(--cyan); cursor: pointer; }
.badge { display: inline-flex; align-items: center; min-height: 27px; padding: 0 10px; border-radius: 999px; font-size: .65rem; font-weight: 800; letter-spacing: .05em; white-space: nowrap; }.badge-neutral { color: var(--muted); border: 1px solid var(--line); background: rgba(255,255,255,.025); }.badge-safe, .badge-success { color: var(--success); background: rgba(98,226,155,.08); border: 1px solid rgba(98,226,155,.16); }.badge-warning { color: var(--amber); background: rgba(255,200,87,.08); border: 1px solid rgba(255,200,87,.17); }.badge-danger { color: #ff9aa5; background: rgba(255,107,122,.08); border: 1px solid rgba(255,107,122,.17); }
.stack-list { display: grid; gap: 10px; }.stack-list.large { gap: 13px; }.list-row { display: flex; align-items: center; gap: 13px; min-width: 0; padding: 14px; border-radius: 15px; border: 1px solid var(--line); background: rgba(255,255,255,.024); cursor: pointer; }.list-row:hover { border-color: rgba(85,231,212,.22); }.list-row-main { min-width: 0; flex: 1; }.list-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }.list-row small { color: var(--muted); font-size: .7rem; }.status-orb { width: 11px; height: 11px; flex: 0 0 auto; border-radius: 50%; background: #64778c; }.orb-running { background: var(--blue); box-shadow: 0 0 12px var(--blue); }.orb-awaiting_approval, .orb-queued { background: var(--amber); box-shadow: 0 0 12px rgba(255,200,87,.5); }.orb-succeeded { background: var(--success); }.orb-failed, .orb-cancelled { background: var(--danger); }
.account-card { min-height: 100px; }.account-line { display: flex; align-items: center; gap: 13px; padding: 12px 0; }.account-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(145deg, rgba(85,231,212,.16), rgba(97,169,255,.13)); color: var(--cyan); font-weight: 900; }.account-line strong { display:block; }.account-line small { color: var(--muted); }
.notification-settings { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }.notification-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }.notification-heading h2 { margin:3px 0; font-size:1.05rem; }.notification-heading .eyebrow { margin-top:0; }.notification-settings .muted { margin:10px 0 15px; font-size:.76rem; }.notification-settings .button { width:100%; }
.form-panel { width: min(800px, 100%); }.form-panel label, .modal label { display: grid; gap: 8px; margin-bottom: 20px; color: #cbd8e7; font-size: .8rem; font-weight: 700; } input, textarea { width: 100%; color: var(--ink); border: 1px solid var(--line); background: rgba(3,9,16,.66); border-radius: 13px; padding: 14px; outline: none; resize: vertical; }.form-panel input:focus, .form-panel textarea:focus, .modal input:focus { border-color: rgba(85,231,212,.52); box-shadow: 0 0 0 3px rgba(85,231,212,.07); } fieldset { border: 0; padding: 0; margin: 8px 0 22px; } legend { font-size: .8rem; color: #cbd8e7; font-weight: 700; margin-bottom: 10px; }.choice-card { position: relative; display: flex !important; grid-template-columns: auto 1fr auto; flex-direction: row; align-items: center; gap: 12px !important; padding: 14px; margin-bottom: 9px !important; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }.choice-card:has(input:checked) { border-color: rgba(85,231,212,.35); background: rgba(85,231,212,.055); }.choice-card input { width: auto; accent-color: var(--cyan); }.choice-card span { flex: 1; }.choice-card strong, .choice-card small { display: block; }.choice-card small { color: var(--muted); margin-top: 3px; font-weight: 400; }.choice-card em { color: var(--cyan); font-size: .62rem; font-style: normal; }
.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 18px; }.service-card { border-radius: var(--radius); padding: 20px; }.service-name { display: flex; justify-content: space-between; gap: 12px; }.service-name h3 { margin: 0 0 5px; font-size: 1rem; }.service-name small { color: var(--muted); }.service-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 18px 0; }.service-meta div { padding: 10px; border-radius: 11px; background: rgba(255,255,255,.025); }.service-meta span, .service-meta strong { display: block; }.service-meta span { color: var(--muted); font-size: .62rem; }.service-meta strong { font-size: .75rem; margin-top: 3px; }.service-actions { display: flex; gap: 7px; flex-wrap: wrap; }.service-actions button { min-height: 35px; padding: 0 11px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: #c9d6e5; font-size: .7rem; cursor: pointer; }.operations-panel { margin-top: 18px; }
.fitness-metrics { display:grid; grid-template-columns:repeat(3, 1fr); gap:14px; margin-bottom:18px; }
.fitness-grid { display:grid; grid-template-columns:1.35fr 1fr; gap:18px; align-items:start; }
.fitness-chat-panel, .fitness-upload-panel { min-height:500px; }
.fitness-messages { height:340px; overflow:auto; display:flex; flex-direction:column; gap:10px; padding:4px 3px 14px; overscroll-behavior:contain; }
.fitness-message { width:fit-content; max-width:86%; padding:11px 13px; border-radius:15px; white-space:pre-wrap; overflow-wrap:anywhere; font-size:.84rem; line-height:1.5; }
.fitness-message small { display:block; margin-top:5px; color:var(--muted); font-size:.6rem; }
.fitness-message-user { align-self:flex-end; background:rgba(85,231,212,.13); border:1px solid rgba(85,231,212,.19); border-bottom-right-radius:5px; }
.fitness-message-assistant { align-self:flex-start; background:rgba(97,169,255,.10); border:1px solid rgba(97,169,255,.16); border-bottom-left-radius:5px; }
.fitness-chat-form { display:grid; grid-template-columns:1fr auto auto; align-items:end; gap:9px; padding-top:13px; border-top:1px solid var(--line); }
.fitness-chat-form textarea { min-height:50px; max-height:150px; resize:vertical; }
.fitness-attach-button { width:44px; height:44px; display:grid; place-items:center; margin:0 0 3px !important; border:1px solid var(--line); border-radius:13px; background:rgba(97,169,255,.1); cursor:pointer; font-size:1.1rem; }
.fitness-attach-button input { display:none; }
.fitness-attach-button[aria-disabled="true"] { opacity:.5; pointer-events:none; }
.fitness-help { margin:10px 0 0; font-size:.68rem; }
.upload-form { display:grid; gap:12px; margin-top:20px; }
.upload-drop { min-height:155px; border:1px dashed rgba(85,231,212,.32); border-radius:17px; background:rgba(85,231,212,.035); display:grid; place-items:center; align-content:center; gap:8px; text-align:center; cursor:pointer; padding:20px; }
.upload-drop:hover { border-color:rgba(85,231,212,.6); }
.upload-drop input { display:none; }
.upload-drop span { color:#dceaf6; font-weight:750; }
.upload-drop small { color:var(--muted); }
.upload-form progress { width:100%; accent-color:var(--cyan); }
.privacy-note { margin-top:18px; padding:12px; border-radius:12px; color:#b6c8d9; background:rgba(255,200,87,.055); border:1px solid rgba(255,200,87,.15); font-size:.7rem; line-height:1.5; }
.fitness-files-panel { margin-top:18px; }
.fitness-file-row { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px; border:1px solid var(--line); border-radius:15px; background:rgba(255,255,255,.024); }
.fitness-file-main { min-width:0; }
.fitness-file-main strong, .fitness-file-main small { display:block; }
.fitness-file-main strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.84rem; }
.fitness-file-main small { color:var(--muted); font-size:.68rem; margin-top:4px; }
.fitness-file-actions { flex:0 0 auto; display:flex; align-items:center; gap:9px; }
.timeline { display: grid; gap: 0; }.timeline-row { position: relative; display: grid; grid-template-columns: 15px 1fr; gap: 14px; padding-bottom: 20px; }.timeline-row::before { content:""; position:absolute; left: 7px; top: 14px; bottom: -2px; width: 1px; background: var(--line); }.timeline-row:last-child::before { display:none; }.timeline-dot { width: 15px; height: 15px; margin-top: 3px; border-radius:50%; background: var(--panel-strong); border: 3px solid var(--cyan); box-shadow: 0 0 12px rgba(85,231,212,.24); }.timeline-content { padding: 0 0 4px; }.timeline-content strong { display:block; font-size:.84rem; }.timeline-content small { color: var(--muted); font-size:.68rem; }
.bottom-nav { position: fixed; z-index: 25; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(680px, calc(100% - 24px)); min-height: 68px; border-radius: 23px; display: grid; grid-template-columns: repeat(6, 1fr); padding: 7px; background: rgba(8,17,29,.91); }.bottom-nav button { border:0; border-radius: 16px; background:transparent; color:#6f849b; display:grid; place-items:center; align-content:center; gap:2px; font-size:.58rem; cursor:pointer; }.bottom-nav button span { font-size:1.15rem; }.bottom-nav button.active { color:var(--cyan); background:rgba(85,231,212,.07); }
.modal { width: min(680px, calc(100% - 24px)); max-height: min(86vh, 840px); color: var(--ink); padding: 0; border-radius: 25px; overflow:auto; }.modal::backdrop { background: rgba(0,5,10,.78); backdrop-filter: blur(8px); }.modal-shell { position:relative; padding: 28px; }.modal-close { position:absolute; top:14px; right:14px; width:36px; height:36px; border-radius:11px; border:1px solid var(--line); background:rgba(255,255,255,.04); color:var(--muted); cursor:pointer; }.oauth-shell { text-align:center; }.device-code, .confirm-phrase { display:block; margin:22px 0; padding:16px; border-radius:13px; border:1px dashed rgba(85,231,212,.35); background:rgba(0,0,0,.22); color:var(--cyan); font-size:1.45rem; letter-spacing:.14em; user-select:all; }.confirm-phrase { font-size:.9rem; letter-spacing:.04em; color:var(--amber); }.job-detail-head h2 { margin:5px 36px 4px 0; }.job-output { white-space:pre-wrap; overflow-wrap:anywhere; max-height:45vh; overflow:auto; padding:15px; border-radius:13px; background:rgba(0,0,0,.25); color:#cbd8e7; font: .76rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }.approval-card { margin-top:13px; padding:15px; border-radius:14px; border:1px solid rgba(255,200,87,.22); background:rgba(255,200,87,.055); }.approval-card pre { white-space:pre-wrap; overflow-wrap:anywhere; max-height:180px; overflow:auto; color:#b8c6d6; font-size:.68rem; }.approval-actions { display:flex; gap:8px; flex-wrap:wrap; }.approval-actions button { min-height:38px; }.event-feed { display:grid; gap:8px; max-height:300px; overflow:auto; }.event-row { border-left:2px solid var(--line); padding:5px 10px; }.event-row strong { display:block; font-size:.7rem; }.event-row small { color:var(--muted); font-size:.63rem; }
.toast-region { position:fixed; z-index:60; right:18px; top:82px; width:min(340px, calc(100% - 36px)); display:grid; gap:8px; }.toast { padding:13px 15px; border-radius:13px; border:1px solid var(--line); background:var(--panel-strong); color:#dce8f5; box-shadow:0 15px 40px rgba(0,0,0,.34); font-size:.78rem; animation:toast-in .18s ease; } @keyframes toast-in { from { opacity:0; transform:translateY(-6px); } }
.skeleton { height:60px; border-radius:14px; background:linear-gradient(90deg, rgba(255,255,255,.025), rgba(255,255,255,.07), rgba(255,255,255,.025)); background-size:200% 100%; animation:shimmer 1.3s infinite; }.skeleton.short { width:72%; } @keyframes shimmer { to { background-position:-200% 0; } }
.empty-state { padding:30px 15px; text-align:center; color:var(--muted); border:1px dashed var(--line); border-radius:15px; font-size:.8rem; }

@media (max-width: 780px) {
  .page-wrap { padding: 25px 15px; }.metric-grid { grid-template-columns: repeat(2, 1fr); }.content-grid, .service-grid, .fitness-grid { grid-template-columns: 1fr; }.fitness-metrics { grid-template-columns:repeat(2, 1fr); }.fitness-metrics .metric-card:last-child { grid-column:1 / -1; }.fitness-chat-panel, .fitness-upload-panel { min-height:0; }.fitness-file-row { align-items:flex-start; flex-direction:column; }.fitness-file-actions { width:100%; justify-content:space-between; }.hero-row { align-items:flex-start; flex-direction:column; }.hero-row .button { width:100%; }.metric-card { padding:16px; }.metric-card strong { font-size:1.8rem; }.panel { padding:18px; }
}
@media (min-width: 900px) { .app-shell { padding-left: 0; }.bottom-nav { bottom:22px; }.page-wrap { padding-top:40px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; } }
