:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  color: #23324b; background: #f6f8fc; font-synthesis: none;
  --ink: #1b2941; --muted: #69788e; --subtle: #8b97a9; --line: #e6ebf3; --soft-line: #eff2f7;
  --blue: #0755ff; --blue-soft: #edf3ff; --green: #188568; --green-soft: #e9f8f1; --red: #c7444a; --red-soft: #fff1f2;
  --panel: #fff; --shadow: 0 4px 18px #243b6405;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body { min-width: 320px; margin: 0; font-size: 13px; line-height: 1.65; }
body:has(dialog[open]) { overflow: hidden; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: #003dcc; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #8db2ff; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 30px; line-height: 1.35; letter-spacing: -.045em; color: var(--ink); }
h2 { font-size: 16px; line-height: 1.5; color: var(--ink); font-weight: 650; letter-spacing: -.025em; }
h3 { font-size: 14px; line-height: 1.5; color: var(--ink); }
p { color: var(--muted); margin-bottom: 14px; }
strong { font-weight: 650; }
.icon { width: 19px; height: 19px; flex-shrink: 0; vertical-align: middle; }
.eyebrow { font-size: 10px; font-weight: 650; letter-spacing: .15em; color: var(--subtle); margin-bottom: 8px; }
.muted, .field-hint { color: var(--muted); }
.success { color: var(--green); }
.error { color: var(--red); }
.pending { color: #a06c19; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -60px; left: 24px; z-index: 100; background: #fff; padding: 10px 16px; border: 1px solid var(--blue); border-radius: 8px; }
.skip-link:focus { top: 12px; }
/* Shared public pages */
body > header { height: 80px; max-width: 1280px; margin: auto; padding: 0 40px; display: flex; justify-content: space-between; align-items: center; }
body > header a, .brand { display: inline-flex; gap: 11px; align-items: center; color: var(--ink); font-size: 20px; font-weight: 750; letter-spacing: -.6px; }
body > header a img { width: 34px; height: 34px; }
body > header > span { color: var(--subtle); font-size: 12px; }
body > main { max-width: 1120px; margin: 0 auto; padding: 40px 28px 80px; }
body:has(.app-shell) > header { display: none; }
body:has(.app-shell) > main { max-width: none; padding: 0; margin: 0; }
.card { min-width: 0; margin-bottom: 22px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.card > p:last-child { margin-bottom: 0; }
.narrow { max-width: 520px; margin: 6vh auto; }
/* The workspace shell */
.app-shell { min-height: 100dvh; }
.sidebar { width: 238px; position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; flex-direction: column; padding: 30px 18px 16px; background: #fff; border-right: 1px solid var(--line); }
.brand { padding: 0 10px; margin-bottom: 32px; }
.brand > span { line-height: 1.3; }
.brand small { display: block; margin-top: 4px; font-size: 10px; font-weight: 450; letter-spacing: .04em; color: var(--subtle); }
.workspace-label { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 28px; color: var(--ink); font-size: 12px; }
.workspace-label small, .profile small, .private-note small { display: block; color: var(--subtle); font-size: 10px; }
.workspace-mark, .profile-avatar { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.workspace-dot { width: 6px; height: 6px; border-radius: 50%; background: #23a780; margin-left: auto; }
.nav-label { margin: 0 14px 10px; color: #9aa4b4; font-size: 10px; letter-spacing: .1em; }
.side-nav { display: grid; gap: 5px; margin-bottom: 30px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 13px; color: #68778f; border-radius: 8px; font-weight: 550; }
.side-nav a:hover { color: var(--ink); background: #f7f9fc; }
.side-nav a[aria-current="page"] { color: var(--blue); background: var(--blue-soft); }
.nav-count { margin-left: auto; min-width: 21px; padding: 0 5px; border: 1px solid #dfe7f3; border-radius: 5px; text-align: center; font-size: 10px; font-weight: 550; background: #fff8; }
.sidebar-bottom { margin-top: auto; }
.private-note { display: flex; align-items: center; gap: 10px; margin: 12px 10px 22px; font-size: 10px; color: var(--muted); }
.private-note .icon { color: var(--green); }
.profile { display: flex; align-items: center; gap: 10px; padding: 16px 4px 0; border-top: 1px solid var(--line); font-size: 12px; }
.profile > button { margin-left: auto; }
.profile-avatar { background: #fff2e9; color: #d9783c; }
.workspace { margin-left: 238px; min-width: 0; }
.topbar { height: 72px; display: flex; justify-content: space-between; align-items: center; padding: 0 38px; background: #ffffffb3; border-bottom: 1px solid var(--line); }
.breadcrumb { font-size: 12px; color: var(--muted); }
.breadcrumb span { margin: 0 12px; color: #c3cbd8; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.system-status { color: var(--muted); font-size: 11px; display: inline-flex; align-items: center; gap: 7px; }
.system-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #24a37c; box-shadow: 0 0 0 3px #24a37c13; }
.system-status.error::before { background: var(--red); }
.workspace-content { padding: 31px 38px 0; max-width: 1560px; margin: 0 auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 27px; }
.page-heading h1 { margin-bottom: 6px; font-size: 28px; }
.page-heading .eyebrow { margin-bottom: 5px; }
.page-heading p:last-child { margin: 0; font-size: 12px; }
.page-heading > .button { box-shadow: 0 4px 9px #0755ff12; }
.workspace-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; padding: 22px 0; border-top: 1px solid var(--line); font-size: 10px; color: #8a96a8; }
.footer-dot { margin: 0 6px; color: #bac4d1; }
/* Overview */
.welcome-banner { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 20px; overflow: hidden; min-height: 174px; padding: 26px 30px; border: 1px solid #dce6fb; border-radius: 14px; background: linear-gradient(112deg,#eef4ff,#f4f7ff 55%,#f2f6ff); margin-bottom: 24px; }
.welcome-tag { color: #8296bb; font-size: 9px; font-weight: 600; letter-spacing: .15em; }
.welcome-banner h2 { font-size: 25px; letter-spacing: -.04em; margin: 9px 0 7px; }
.welcome-banner p { color: #7c8ca6; margin-bottom: 13px; font-size: 12px; }
.welcome-banner a { font-size: 11px; font-weight: 600; }
.welcome-banner a .icon { width: 14px; margin-left: 6px; }
.connection-art { display: flex; align-items: center; justify-content: center; padding: 0 34px; flex-shrink: 0; }
.connection-art img { border: 1px solid #dbe6fa; border-radius: 16px; box-shadow: 0 10px 25px #3461a812; transform: rotate(-5deg); }
.art-client, .art-device { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid #dce5f6; background: #fff9; border-radius: 11px; color: #6a8ac4; }
.art-line { width: 38px; border-top: 2px dotted #bbccef; }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin-bottom: 24px; }
.stats article { padding: 20px 21px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.stat-label { display: flex; align-items: center; justify-content: space-between; color: #7b879b; font-size: 11px; }
.stat-label .icon { width: 17px; height: 17px; color: #8d9fbd; }
.stats strong { display: block; margin: 11px 0 5px; font-size: 32px; line-height: 1.15; letter-spacing: -.06em; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.stats article > span { color: #8c98a9; font-size: 10px; }
.stats b { font-weight: 500; }
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-title h2 { margin: 0; }
.section-title p { margin: 5px 0 0; font-size: 11px; }
.section-title > a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 11px; }
.section-title > a .icon { width: 13px; }
.overview-list { min-height: 140px; }
.overview-list > a, .overview-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-top: 1px solid var(--soft-line); color: var(--ink); }
.overview-list > a:first-child, .overview-item:first-child { border-top: 0; }
.overview-item strong { display: block; font-size: 12px; }
.overview-item p, .overview-item small { display: block; margin: 4px 0 0; color: var(--subtle); font-size: 10px; }
.overview-item > div { min-width: 0; }
.overview-item:hover { color: var(--blue); }
.connect-heading { display: flex; align-items: center; gap: 14px; }
.connect-heading h2 { margin: 0 0 3px; font-size: 14px; }
.connect-heading p { margin: 0; font-size: 11px; }
.feature-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--blue-soft); color: var(--blue); flex-shrink: 0; }
.endpoint-row { display: flex; align-items: center; gap: 12px; margin: 20px 0 15px; }
#endpoint { flex: 1; min-width: 0; padding: 12px 15px; background: #f6f8fc; border: 1px solid var(--line); border-radius: 8px; color: #4a6390; overflow-wrap: anywhere; font-size: 12px; }
.connect-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 10px; color: #8995a8; }
.connect-footer > span { display: inline-flex; align-items: center; gap: 6px; }
.connect-footer .icon { width: 13px; height: 13px; }
/* Devices, filters and onboarding */
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.toolbar-note { margin-left: auto; font-size: 10px; color: var(--subtle); }
.search-field { position: relative; width: 290px; max-width: 100%; }
.search-field > .icon { position: absolute; left: 12px; top: 12px; width: 16px; height: 16px; color: var(--subtle); }
.search-field input { padding-left: 37px !important; }
.filter-field { width: auto; min-width: 130px; }
.device-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,320px),1fr)); gap: 20px; }
.device { display: flex; flex-direction: column; min-width: 0; padding: 23px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow); }
.device:hover { border-color: #c8d7f3; }
.device-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.device-icon { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; background: #edf3ff; color: #5a7bb7; border-radius: 10px; font-size: 18px; }
.device-identity { flex: 1; min-width: 0; }
.device-name { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.device-platform { margin: 3px 0 0; color: var(--subtle); font-size: 10px; }
.device-id { font-size: 10px; color: var(--subtle); }
.device-projects { display: grid; gap: 8px; margin-bottom: 18px; }
.project-chip { display: flex; flex-direction: column; padding: 12px 13px; border: 1px solid #edf0f6; background: #fafbfe; border-radius: 8px; font-size: 12px; gap: 4px; }
.project-chip small, .device-meta { color: var(--subtle); font-size: 10px; }
.device-meta { margin: auto 0 14px; }
.device .actions, .device-actions { padding-top: 16px; border-top: 1px solid var(--soft-line); margin-top: auto; gap: 7px; }
.device-actions button, .device .actions button { font-size: 11px; min-height: 33px; padding: 7px 10px; }
.device .danger { background: #fff; }
.onboarding-card { padding: 20px 24px; border-color: #dce6fb; background: #f6f9ff; }
.onboarding-card > summary { display: flex; align-items: center; gap: 10px; color: #375a91; }
.onboarding-card > summary > span { margin-left: auto; color: #8a9cba; font-size: 11px; font-weight: 400; }
.onboarding-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 26px; padding: 24px 0 8px; }
.onboarding-steps h3 { font-size: 12px; margin: 10px 0 6px; }
.onboarding-steps p { font-size: 11px; }
.step-number { display: grid; place-items: center; width: 23px; height: 23px; font-size: 10px; color: var(--blue); background: #e4edff; border-radius: 50%; }
.onboarding-steps code { color: #42618f; background: #eaf0fc; padding: 6px 9px; border-radius: 5px; font-size: 11px; }
.pair-fallback { padding-top: 18px; margin-top: 12px; border-top: 1px solid #dde6f6; }
.pair-fallback summary { color: var(--muted); font-size: 11px; }
#pair { display: flex; align-items: end; max-width: 500px; margin-top: 16px; }
#pair label { flex: 1; }
#pairResult { margin-top: 12px; }
/* Forms and controls */
form { display: grid; gap: 17px; }
label { display: flex; flex-direction: column; gap: 7px; color: #53647d; font-size: 12px; font-weight: 500; }
input:not([type="checkbox"]):not([type="hidden"]), select, textarea { width: 100%; min-width: 0; max-width: 100%; min-height: 40px; padding: 9px 12px; color: var(--ink); font-size: 12px; background: #fff; border: 1px solid #dce3ee; border-radius: 7px; outline: none; transition: border-color 140ms,box-shadow 140ms; }
input::placeholder, textarea::placeholder { color: #a0aaba; }
input:not([type="checkbox"]):focus, select:focus, textarea:focus { border-color: #79a2fb; box-shadow: 0 0 0 3px #0755ff0b; }
input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--blue); flex-shrink: 0; margin: 0; cursor: pointer; }
textarea { min-height: 90px; resize: vertical; font-family: ui-monospace,SFMono-Regular,Consolas,monospace; }
button, a.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; width: fit-content; min-height: 39px; padding: 10px 15px; color: #fff; background: var(--blue); border: 1px solid var(--blue); border-radius: 7px; font-size: 12px; line-height: 1.4; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background 140ms,border-color 140ms; text-decoration: none; }
button:hover, a.button:hover { color: #fff; background: #0449df; border-color: #0449df; }
button:disabled { opacity: .45; cursor: not-allowed; }
button .icon, a.button .icon { width: 16px; height: 16px; }
.secondary, a.button.secondary { color: #53647e; background: #fff; border-color: #dfe5ee; }
.secondary:hover, a.button.secondary:hover { color: var(--blue); background: #f7faff; border-color: #bfceeb; }
.ghost { color: var(--muted); background: transparent; border-color: transparent; }
.ghost:hover { background: #f3f6fc; border-color: transparent; color: var(--blue); }
.danger { color: var(--red); background: var(--red-soft); border-color: #f3d8db; }
.danger:hover { background: #ffe7e9; color: #aa2830; border-color: #eab9bf; }
.icon-button { width: 34px; min-width: 34px; min-height: 34px; height: 34px; padding: 7px; font-size: 21px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.form-grid { display: grid; grid-template-columns: 1.3fr 120px 1fr; gap: 16px; }
.form-section-label { font-size: 12px; color: var(--ink); font-weight: 600; }
.form-submit { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding-top: 15px; border-top: 1px solid var(--line); }
.form-submit span { color: var(--subtle); font-size: 11px; }
fieldset { min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 9px; }
legend { padding: 0 7px; font-size: 11px; color: var(--muted); }
.field-hint { font-weight: 400; font-size: 11px; line-height: 1.65; }
.info-banner { display: flex; align-items: flex-start; gap: 13px; padding: 20px 22px; margin-bottom: 22px; background: var(--blue-soft); border: 1px solid #dce7ff; border-radius: 11px; color: #4a70b2; }
.info-banner > .icon { margin-top: 3px; }
.info-banner strong { font-size: 12px; }
.info-banner p { color: #7b91b5; font-size: 11px; margin: 5px 0 0; }
.info-banner > a { flex-shrink: 0; margin-left: auto; font-size: 11px; }
.token-create > summary { margin-bottom: 10px; }
summary { color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
summary > span { float: right; color: var(--subtle); font-size: 10px; font-weight: 400; }
/* Tables and execution output */
.table-card .scroll { margin: 0 -24px; }
.scroll { overflow: auto; max-width: 100%; overscroll-behavior-x: contain; }
table { width: 100%; min-width: 710px; border-collapse: collapse; text-align: left; font-size: 11px; }
th { padding: 12px 20px; color: #8190a5; font-size: 10px; font-weight: 500; background: #f8fafd; border-top: 1px solid var(--soft-line); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { max-width: 260px; padding: 17px 20px; border-bottom: 1px solid var(--soft-line); overflow-wrap: anywhere; color: #64748b; }
td button { min-height: 31px; padding: 6px 9px; font-size: 10px; }
td button + button { margin-left: 5px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
.table-footnote { margin: 18px 0 0; color: var(--subtle); font-size: 10px; }
.job-program { color: var(--ink); font-weight: 550; }
.job-id, .cell-subtitle { color: var(--subtle); font-size: 10px; margin-top: 4px; }
.scope-label { display: inline-block; font-size: 10px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; margin: 2px; }
code, pre { font-family: "SFMono-Regular",Consolas,"Liberation Mono",monospace; }
pre { min-width: 0; max-width: 100%; margin: 16px 0 0; padding: 22px; background: #172337; color: #d1e0f9; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 9px; font-size: 12px; line-height: 1.8; max-height: 480px; overflow: auto; }
.output-card .section-title { margin-bottom: 0; }
.output-card .actions { margin: 0; }
#newToken { color: #436291; background: #edf3fc; border: 1px dashed #c5d6f1; }
#newTokenPanel { margin-top: 20px; padding: 20px; border: 1px solid #c4e6d9; border-radius: 9px; background: #f5fcf9; }
.badge, .status-badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 3px 8px; font-size: 10px; line-height: 1.6; border-radius: 5px; color: #8190a7; background: #f0f3f8; white-space: nowrap; font-weight: 500; }
.status-badge::before { content: ''; width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.status-badge.online, .status-badge.success, .badge.online { background: #e9f7f1; color: #24896e; }
.status-badge.running { background: var(--blue-soft); color: var(--blue); }
.status-badge.failed { background: var(--red-soft); color: var(--red); }
.status-badge.paused { background: #fff5e6; color: #b27b24; }
.empty-state { grid-column: 1 / -1; padding: 40px 20px; text-align: center; color: #8a99ae; }
.empty-state strong { display: block; color: #647894; font-size: 13px; margin-bottom: 8px; }
.empty-state p { margin: 0 auto; max-width: 380px; font-size: 11px; color: var(--subtle); }
#notice:empty { display: none; }
#notice:not(:empty) { position: fixed; z-index: 80; right: 26px; top: 20px; max-width: min(440px,calc(100vw - 40px)); padding: 13px 18px; border: 1px solid #c6e6d7; background: #f4fcf7; color: var(--green); border-radius: 10px; box-shadow: 0 8px 30px #243b6420; font-size: 12px; }
#notice.error { background: #fff6f6; color: var(--red); border-color: #f0cdd2; }
/* Permission and confirmation dialogs */
dialog { border: 1px solid var(--line); color: var(--ink); }
dialog:not([open]) { display: none; }
dialog::backdrop { background: #182e5261; backdrop-filter: blur(3px); }
.editor-dialog { width: min(860px,calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 40px); margin: auto; padding: 0; border-radius: 15px; background: #f8fafd; box-shadow: 0 24px 100px #142d5333; }
.editor-dialog[open] { display: flex; flex-direction: column; }
.editor-header { display: flex; align-items: center; gap: 14px; padding: 23px 28px; background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.editor-header > div { flex: 1; min-width: 0; }
.editor-header .eyebrow { margin-bottom: 5px; }
.editor-header h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.editor-content { min-height: 0; padding: 24px 28px; overflow: auto; overscroll-behavior: contain; }
.editor-footer { flex-shrink: 0; padding: 17px 28px 21px; background: #fff; border-top: 1px solid var(--line); }
.editor-footer .actions { margin-top: 12px; }
.editor-status { margin: 0; font-size: 11px; overflow-wrap: anywhere; }
.editor-intro { font-size: 12px; margin: 0; }
.permission-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.permission-project { display: grid; min-width: 0; gap: 17px; padding: 22px; margin-bottom: 16px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.permission-project .section-title { margin: 0; }
.permission-project h3 { margin: 0; }
.permission-project .section-title button { font-size: 10px; min-height: 30px; }
.project-path-field { grid-column: 1 / -1; }
.permission-switch { flex-direction: row; align-items: center; gap: 9px; font-size: 12px; }
.permission-switch:has(.field-hint) { flex-wrap: wrap; }
.permission-switch .field-hint { flex-basis: 100%; }
.permission-project > .permission-switch { padding: 13px; border: 1px solid var(--line); background: #f9fbfe; border-radius: 7px; }
.permission-description, .permission-role-description { font-size: 11px; margin: 0; padding: 10px 13px; border-left: 2px solid #abc4f5; color: #6f85a8; background: #f5f8ff; border-radius: 0 5px 5px 0; }
.advanced-settings { padding-top: 16px; border-top: 1px solid var(--line); }
.advanced-settings summary { margin-bottom: 16px; color: #7b8ca7; font-size: 11px; }
.advanced-settings > label, .advanced-settings > fieldset, .advanced-settings > .permission-grid { margin: 14px 0; }
.permission-tools { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); width: 100%; max-height: 300px; gap: 11px; overflow: auto; margin-top: 16px; }
.project-targets, #tokenDevices { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); width: 100%; gap: 14px; }
.project-target { display: grid; gap: 10px; padding: 16px; background: #fafbfe; }
.project-target label { flex-direction: row; align-items: center; }
.project-target-heading { font-size: 12px; font-weight: 600; color: var(--ink); }
.project-target-heading label { color: var(--ink); }
.target-project-list { display: grid; gap: 12px; margin-top: 5px; }
.project-selection-count, .project-target-status { color: var(--subtle); font-size: 10px; margin: 0; }
.selection-summary { grid-column: 1 / -1; color: #6a80a3; font-size: 11px; margin: 0; }
.discard-confirmation { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 13px; padding: 12px; background: #fff8e8; border: 1px solid #efdfba; border-radius: 8px; color: #977027; font-size: 11px; }
.discard-confirmation > span { flex: 1; min-width: 150px; }
.confirm-dialog { width: min(440px,calc(100vw - 32px)); padding: 28px; border-radius: 14px; box-shadow: 0 24px 100px #142d5333; }
.confirm-dialog h2 { font-size: 20px; margin: 0; }
.confirm-dialog p { margin: 0; font-size: 12px; }
.confirm-dialog .actions { justify-content: flex-end; margin-top: 5px; }
.confirm-symbol { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--blue); background: var(--blue-soft); }
/* Login */
.login-page { display: grid; grid-template-columns: 1fr 430px; align-items: center; gap: 90px; min-height: calc(100dvh - 240px); }
.login-intro h1 { font-size: clamp(30px,3.3vw,45px); letter-spacing: -.055em; line-height: 1.5; margin-bottom: 18px; }
.login-brandmark { margin-bottom: 23px; border-radius: 17px; box-shadow: 0 9px 30px #0755ff0d; }
.login-intro > p:not(.eyebrow) { max-width: 360px; }
.login-points { list-style: none; margin: 28px 0; padding: 0; display: grid; gap: 20px; }
.login-points li { position: relative; padding-left: 23px; }
.login-points li::before { content: '✓'; position: absolute; left: 0; top: 0; font-size: 12px; color: var(--blue); }
.login-points strong { display: block; font-size: 12px; color: #425570; }
.login-points span { display: block; color: var(--subtle); font-size: 11px; margin-top: 3px; }
.login-note { color: var(--subtle); font-size: 10px; letter-spacing: .06em; }
.login-card { padding: 35px; background: #fff; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 15px 55px #2a47750a; }
.login-card h2 { font-size: 23px; margin-bottom: 8px; }
.login-description { margin-bottom: 28px; font-size: 12px; }
.login-card form { gap: 10px; }
.login-card form > button { margin-top: 10px; width: 100%; min-height: 43px; }
.password-field { display: flex; position: relative; }
.password-field input { padding-right: 64px !important; }
.password-toggle { position: absolute; right: 3px; top: 3px; min-height: 34px; padding: 6px 10px; border: 0; font-size: 11px; }
#passwordHelp, .xauth-help { font-size: 10px; margin: 0; }
.xauth-login-block { display: grid; gap: 8px; margin-bottom: 6px; }
.xauth-button { width: 100%; min-height: 43px; }
.login-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--subtle); font-size: 11px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.login-error { margin: 8px 0 0; padding: 10px 12px; border: 1px solid #f3d8db; border-radius: 8px; background: var(--red-soft); color: var(--red); font-size: 12px; }
.login-security { border-top: 1px solid var(--line); margin: 25px 0 0; padding-top: 18px; font-size: 10px; color: var(--subtle); }
/* Responsive workspace */
@media (min-width:1600px) { .workspace-content { padding-top: 42px; } .welcome-banner { min-height: 190px; } }
@media (max-width:1180px) { .sidebar { width: 208px; padding-inline: 12px; } .workspace { margin-left: 208px; } .workspace-content { padding: 26px 26px 0; } .topbar { padding-inline: 26px; } .connection-art { padding: 0; } .stats { gap: 12px; } .stats article { padding: 17px; } .overview-grid { gap: 16px; } .login-page { gap: 50px; } }
@media (max-width:960px) { .overview-grid { grid-template-columns: 1fr; gap: 0; } .connection-art { display: none; } .stats { grid-template-columns: repeat(2,minmax(0,1fr)); } .info-banner { flex-wrap: wrap; } .info-banner > div { flex: 1; } .info-banner > a { margin-left: 32px; } .login-page { grid-template-columns: 1fr 390px; gap: 35px; } .login-intro h1 { font-size: 29px; } }
@media (max-width:760px) {
  html { scrollbar-gutter: auto; }
  .sidebar { position: static; width: 100%; padding: 17px 18px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin-bottom: 14px; padding: 0; font-size: 18px; } .brand img { width: 32px; height: 32px; } .brand small { display: none; }
  .workspace-label, .nav-label, .sidebar-bottom { display: none; }
  .side-nav { display: flex; gap: 6px; margin: 0; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
  .side-nav:nth-of-type(2) { margin-top: 0; padding-bottom: 13px; }
  .side-nav a { padding: 8px 10px; gap: 6px; white-space: nowrap; font-size: 11px; }
  .side-nav .icon { width: 15px; height: 15px; } .nav-count { display: none; }
  .workspace { margin-left: 0; } .topbar { height: 53px; padding-inline: 20px; } .breadcrumb { font-size: 10px; } .topbar-actions { gap: 9px; } .system-status { font-size: 10px; }
  .workspace-content { padding: 24px 20px 0; } .page-heading { margin-bottom: 20px; align-items: flex-end; gap: 10px; } .page-heading h1 { font-size: 25px; } .page-heading .eyebrow { font-size: 9px; }
  .page-heading > .button { min-height: 35px; padding: 8px 11px; font-size: 10px; } .page-heading p:last-child { font-size: 11px; max-width: 240px; }
  .welcome-banner { padding: 22px; min-height: 165px; } .welcome-banner h2 { font-size: 22px; } .welcome-tag { font-size: 8px; }
  .stats { gap: 12px; margin-bottom: 20px; } .stats article { padding: 17px; } .stats strong { font-size: 28px; }
  .card { padding: 20px; margin-bottom: 18px; } .table-card .scroll { margin-inline: -20px; }
  .section-title { align-items: flex-start; gap: 10px; } .section-title h2 { font-size: 14px; } .section-title > a { font-size: 10px; }
  .connect-heading { align-items: flex-start; gap: 11px; } .connect-heading h2 { font-size: 13px; } .connect-heading p { font-size: 10px; }
  .connect-footer { flex-wrap: wrap; } .endpoint-row { flex-wrap: wrap; } .endpoint-row code { flex-basis: 100%; } .endpoint-row button { margin-left: auto; }
  .device-grid { grid-template-columns: 1fr; gap: 16px; } .device { padding: 20px; }
  .toolbar { gap: 10px; } .search-field { flex: 1; width: auto; min-width: 150px; } .toolbar-note { width: 100%; font-size: 10px; }
  .onboarding-steps { grid-template-columns: 1fr; gap: 20px; } .onboarding-card > summary { font-size: 11px; } .onboarding-card > summary > span { font-size: 9px; }
  .form-grid { grid-template-columns: 1fr 1fr; } .form-grid > label:first-child { grid-column: 1 / -1; }
  .form-submit { align-items: flex-start; } .form-submit > span { font-size: 10px; } .form-submit button { flex-shrink: 0; }
  .workspace-footer { flex-direction: column; gap: 3px; margin-top: 24px; padding: 18px 0; font-size: 9px; }
  .output-card .section-title { flex-wrap: wrap; } .output-card .actions { margin-top: 5px; }
  .editor-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 12px; }
  .editor-header { padding: 19px 20px; } .editor-header h2 { font-size: 17px; } .editor-content { padding: 20px; } .editor-footer { padding: 15px 20px; }
  .editor-footer .actions { gap: 6px; } .editor-footer button { font-size: 10px; padding: 8px 11px; }
  .permission-project { padding: 16px; } .permission-grid { grid-template-columns: 1fr; } .project-path-field { grid-column: auto; }
  body > header { height: 68px; padding-inline: 22px; } body > header > span { font-size: 10px; } body > main { padding: 24px 20px 50px; }
  .login-page { grid-template-columns: 1fr; min-height: auto; gap: 28px; max-width: 460px; margin: auto; }
  .login-intro h1 { font-size: 30px; } .login-intro h1 br { display: none; } .login-points, .login-note { display: none; } .login-intro > p { margin-bottom: 0; } .login-brandmark { width: 52px; height: 52px; margin-bottom: 18px; }
  .login-card { padding: 26px; } .login-security { margin-top: 20px; }
}
@media (prefers-reduced-motion:reduce) { html { scroll-behavior: auto; } *,*::before,*::after { transition: none !important; animation: none !important; } }
/* OAuth consent screens */
body:has(.consent-page) header {
  position: static;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
}

main:has(> .consent-page) {
  max-width: 760px;
  padding: 40px 24px 72px;
}

.consent-page {
  width: min(600px, 100%);
  margin: 0 auto;
}

.consent-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 22px;
  color: #fff;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  background: radial-gradient(120% 120% at 20% 0, #3d3d3d, #0a0a0a 72%);
  border: 1px solid #000;
  border-radius: 13px;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.consent-kicker {
  margin: 0 0 10px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.consent-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(24px, 4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.18;
}

.consent-lede {
  max-width: 48ch;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.consent-redirect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.consent-redirect span {
  flex: 0 0 auto;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 600;
}

.consent-redirect code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #525252;
  font-size: 11px;
}

.consent-card {
  margin-top: 24px;
  padding: 4px 26px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 26px 60px -28px rgba(0, 0, 0, 0.22);
}

.consent-card form { gap: 0; }

.consent-alert {
  margin: 20px 0 0;
  padding: 11px 13px;
  color: #a5342f;
  font-size: 12px;
  background: #fff5f5;
  border: 1px solid #f2d3d3;
  border-radius: 10px;
}

.consent-group {
  padding: 22px 0;
  border-top: 1px solid var(--soft-line);
}

.consent-group:first-of-type { border-top: 0; }

.consent-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.consent-group-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.consent-group-head span {
  color: var(--subtle);
  font-size: 11px;
}

.consent-options {
  display: grid;
  gap: 8px;
}

.consent-option {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.consent-option:hover {
  background: #fcfcfc;
  border-color: #d0d0d0;
}

.consent-option:has(input:checked) {
  background: #fbfbfb;
  border-color: #171717;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.consent-option input[type="checkbox"] {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background: #fff;
  border: 1.5px solid #c9c9c9;
  border-radius: 6px;
  transition: background 120ms ease, border-color 120ms ease;
}

.consent-option input[type="checkbox"]::after {
  position: absolute;
  top: 2px;
  left: 5.5px;
  width: 4px;
  height: 9px;
  content: "";
  border: solid #fff;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 120ms ease;
}

.consent-option input[type="checkbox"]:checked {
  background: #171717;
  border-color: #171717;
}

.consent-option input[type="checkbox"]:checked::after { transform: rotate(45deg) scale(1); }

.consent-option input[type="checkbox"]:focus-visible {
  outline: 2px solid #737373;
  outline-offset: 2px;
}

.consent-option-text {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.consent-option-text strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.consent-option-text small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.consent-option > code {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: var(--subtle);
  font-size: 10px;
  background: #f5f5f5;
  border-radius: 6px;
}

.consent-device + .consent-device { margin-top: 14px; }

.consent-device-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.consent-device-label span {
  font-weight: 500;
  letter-spacing: 0;
}

.consent-empty {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  background: #fafafa;
  border: 1px dashed #dcdcdc;
  border-radius: 10px;
}

.consent-empty code {
  color: var(--ink);
  font-size: 11px;
}

.consent-footer {
  padding-top: 18px;
  border-top: 1px solid var(--soft-line);
}

.consent-summary {
  margin: 0 0 6px;
  color: var(--subtle);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.consent-status {
  min-height: 16px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.consent-actions button {
  min-height: 40px;
  padding: 10px 18px;
  font-size: 13px;
  border-radius: 10px;
}

.consent-actions button:not(.secondary) {
  min-width: 132px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.consent-fineprint {
  margin: 14px 0 0;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.6;
}

.consent-footnote {
  margin: 18px 0 0;
  color: var(--subtle);
  font-size: 11px;
  text-align: center;
}

.consent-page-narrow { width: min(460px, 100%); }

.consent-result {
  padding: 44px 32px;
  text-align: center;
}

.consent-icon {
  position: relative;
  display: block;
  width: 46px;
  height: 46px;
  margin: 0 auto 20px;
  border-radius: 50%;
}

.consent-icon.ok {
  color: var(--green);
  background: var(--green-soft);
  border: 1px solid #c9eedc;
}

.consent-icon.no {
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #f2caca;
}

.consent-icon.neutral {
  color: var(--muted);
  background: #f2f2f2;
  border: 1px solid var(--line);
}

.consent-icon.ok::after {
  position: absolute;
  top: 12px;
  left: 17px;
  width: 10px;
  height: 17px;
  content: "";
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.consent-icon.no::before,
.consent-icon.no::after {
  position: absolute;
  top: 21px;
  left: 14px;
  width: 17px;
  height: 2px;
  content: "";
  background: currentColor;
  border-radius: 2px;
}

.consent-icon.no::before { transform: rotate(45deg); }
.consent-icon.no::after { transform: rotate(-45deg); }

.consent-icon.neutral::before {
  position: absolute;
  top: 21px;
  left: 14px;
  width: 17px;
  height: 2px;
  content: "";
  background: currentColor;
  border-radius: 2px;
}

.consent-result .consent-kicker { margin-bottom: 10px; }

.consent-result h1 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.consent-result p {
  max-width: 34ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.consent-result .consent-alert { margin-bottom: 14px; }

.consent-result .button {
  min-height: 40px;
  margin-top: 22px;
  padding: 10px 20px;
  font-size: 13px;
  border-radius: 10px;
}

.consent-result .consent-footnote { margin-top: 16px; }

@media (max-width: 620px) {
  main:has(> .consent-page) {
    padding: 24px 14px 56px;
  }

  .consent-card {
    padding: 2px 18px 20px;
    border-radius: 15px;
  }

  .consent-actions {
    flex-direction: column-reverse;
  }

  .consent-actions button {
    width: 100%;
  }

  .consent-result {
    padding: 34px 22px;
  }
}
/* Consent shares the workspace identity. */
.consent-avatar { color: var(--blue); background: var(--blue-soft); border-color: #dbe6fd; box-shadow: none; }
.consent-title { letter-spacing: -.035em; }
.consent-card { box-shadow: 0 10px 40px #294b7d08; border-color: var(--line); }
.consent-option:has(input:checked) { border-color: #c1d4ff; background: #f5f8ff; }
.consent-option input { accent-color: var(--blue); }
.consent-step { display: inline-block; margin-right: 8px; color: #88a0c8; font-size: 10px; }
.consent-summary { color: #6c86ac; }
.consent-actions button:not(.secondary) { background: var(--blue); border-color: var(--blue); }
.overview-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; border-top: 1px solid var(--soft-line); color: var(--ink); }
.overview-row:first-child { border-top: 0; }
.overview-row strong { display: block; font-size: 12px; font-weight: 550; }
.overview-row small { display: block; margin-top: 4px; color: var(--subtle); font-size: 10px; }
.overview-row:hover strong { color: var(--blue); }
.project-chip-main { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.device-details { margin-bottom: 18px; }
.device-details summary { font-size: 10px; color: var(--subtle); font-weight: 400; }
.device-details code, .device-details small { display: block; margin-top: 8px; overflow-wrap: anywhere; }
.consent-device.is-unavailable { opacity: .55; }
.cell-subtitle { display: block; }
.empty-state button { margin: 16px auto 0; }
@media (max-width:760px) {
  .sidebar { position: relative; }
  .sidebar-bottom { display: block; position: absolute; right: 20px; top: 16px; margin: 0; }
  .sidebar-bottom .private-note, .profile > span { display: none; }
  .profile { padding: 0; border: 0; }
}
#viewTitle:focus { outline: none; }
#notice { pointer-events: none; }
.device-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,320px),1fr)); }
.permission-project > .permission-grid > label:first-child { grid-column: 1; grid-row: 1; }
.permission-project > .permission-grid > label:last-child { grid-column: 2; grid-row: 1; }
.permission-project > .permission-grid > .project-path-field { grid-row: 2; }
@media (max-width:760px) {
  .sidebar { flex-flow: row wrap; gap: 4px; padding-bottom: 12px; }
  .sidebar .brand { width: 100%; margin-bottom: 10px; }
  .sidebar .side-nav { display: contents; }
  .sidebar .side-nav a { width: calc(33.333% - 3px); padding: 9px 6px; }
  #endpoint { flex: 1 0 100%; }
  .permission-project > .permission-grid > label:first-child,
  .permission-project > .permission-grid > label:last-child,
  .permission-project > .permission-grid > .project-path-field { grid-column: auto; grid-row: auto; }
}
.login-error:not(:empty) { padding: 10px 12px; margin: 2px 0; border: 1px solid #f0cdd2; border-radius: 7px; background: #fff6f6; color: var(--red); font-size: 11px; }
.login-error:empty { display: none; }
