:root {
  color-scheme: light;
  --page: #f6f7fb;
  --surface: #fff;
  --surface-subtle: #fafaff;
  --ink: #202237;
  --muted: #697087;
  --muted-light: #8990a4;
  --line: #e4e7f0;
  --line-strong: #d4d8e5;
  --purple: #6955d9;
  --purple-dark: #5140b7;
  --purple-soft: #f0edff;
  --blue: #3977d5;
  --green: #159a72;
  --green-soft: #e8f7f1;
  --amber: #a56b12;
  --amber-soft: #fff6e5;
  --red: #b74444;
  --red-soft: #fff0ef;
  --shadow: 0 12px 36px rgb(29 36 69 / 6%);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--page); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--page); }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid rgb(105 85 217 / 38%); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.muted, .helper, .field-help { color: var(--muted); }
.helper { margin: 7px 0 0; font-size: 13px; line-height: 1.45; }
.field-help { display: inline; font-size: 12px; font-weight: 400; }
.eyebrow { margin: 0 0 8px; color: #747a91; font-size: 11px; font-weight: 700; letter-spacing: .12em; line-height: 1.35; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(29px, 3vw, 36px); font-weight: 720; letter-spacing: -.045em; line-height: 1.12; }
h2 { margin-bottom: 5px; font-size: 20px; font-weight: 680; letter-spacing: -.025em; line-height: 1.25; }
h3 { margin-bottom: 5px; font-size: 17px; font-weight: 680; line-height: 1.3; }
.lead { margin: 0; color: var(--muted); font-size: 15px; }

.auth-shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; place-items: center; padding: 32px 18px; background: radial-gradient(ellipse at top, #eeecff 0, var(--page) 45%); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 24px; font-size: 17px; font-weight: 720; letter-spacing: -.025em; }
.auth-card { width: calc(100vw - 36px); max-width: 440px; min-width: 0; padding: 36px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 24px 70px rgb(29 36 69 / 10%); }
.auth-card h1 { font-size: 28px; }
.auth-card > .muted { margin: 0 0 26px; }
.brand-mark { display: inline-grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: var(--purple); color: #fff; font-size: 19px; font-weight: 750; box-shadow: 0 5px 12px rgb(105 85 217 / 24%); }
.form-stack, .form-grid { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: #42475b; font-size: 13px; font-weight: 620; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); color: var(--ink); }
input, select { min-height: 44px; padding: 9px 12px; }
textarea { padding: 11px 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9ba1b2; }
input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; background: #f4f5f8; }
.form-error { min-height: 0; margin: 0; color: var(--red); font-size: 13px; line-height: 1.4; }
.form-error:empty { display: none; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 650; text-align: center; text-decoration: none; transition: background .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.button:disabled { cursor: wait; opacity: .6; }
.button:not(:disabled):active { transform: translateY(1px); }
.primary { background: var(--purple); color: #fff; box-shadow: 0 4px 10px rgb(105 85 217 / 15%); }
.primary:hover { background: var(--purple-dark); }
.secondary { border-color: #d8d3f4; background: var(--purple-soft); color: var(--purple-dark); }
.secondary:hover { border-color: #bdb4ed; background: #e8e3ff; }
.quiet { border-color: var(--line); background: var(--surface); color: #43485c; }
.quiet:hover { border-color: var(--line-strong); background: #fafaff; }
.danger { border-color: #f1d8d6; background: var(--red-soft); color: var(--red); }
.danger-quiet { min-height: 34px; padding: 6px 9px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--red); cursor: pointer; font-size: 12px; font-weight: 620; }
.danger-quiet:hover { background: var(--red-soft); }
.text-button { padding: 4px 0; border: 0; background: transparent; color: var(--purple-dark); cursor: pointer; font-size: 13px; font-weight: 620; }
.text-button:hover { text-decoration: underline; }
.invite-accept { display: grid; gap: 14px; margin-top: 22px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; display: flex; width: 244px; flex-direction: column; padding: 24px 16px 17px; border-right: 1px solid var(--line); background: var(--surface); }
.sidebar-backdrop { display: none; }
.brand { display: flex; align-items: center; gap: 11px; padding: 1px 5px 30px; color: var(--ink); font-size: 16px; font-weight: 720; letter-spacing: -.025em; text-decoration: none; }
.workspace-label { padding: 0 10px 10px; color: #8790a5; font-size: 10px; font-weight: 730; letter-spacing: .13em; }
.main-nav { display: grid; gap: 4px; }
.nav-link { display: flex; min-height: 43px; align-items: center; gap: 11px; padding: 8px 11px; border: 0; border-radius: 9px; background: transparent; color: #555b70; cursor: pointer; font-size: 13px; font-weight: 570; text-align: left; }
.nav-link:hover { background: #f7f6fc; color: var(--ink); }
.nav-link.is-active { background: var(--purple-soft); color: var(--purple-dark); font-weight: 670; }
.nav-icon { display: grid; width: 19px; place-items: center; color: #7c8297; font-size: 17px; }
.nav-link.is-active .nav-icon { color: var(--purple); }
.nav-count { margin-left: auto; color: var(--muted-light); font-size: 12px; }
.sidebar-bottom { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 12px 8px 2px; color: #555b70; font-size: 12px; }
.sidebar-bottom strong, .sidebar-bottom small { display: block; }
.sidebar-bottom small { overflow: hidden; max-width: 178px; color: var(--muted-light); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.connection-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #36bd91; box-shadow: 0 0 0 4px #e4f7ef; }
.main-column { min-height: 100vh; margin-left: 244px; }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; height: 66px; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 4vw, 48px); border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 92%); backdrop-filter: blur(14px); }
.breadcrumbs { color: #7a8093; font-size: 12px; }
.breadcrumbs span { padding: 0 8px; color: #b4b8c5; }
.account-menu-wrap { position: relative; }
.account-menu { display: flex; align-items: center; gap: 9px; padding: 4px 5px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; text-align: left; }
.account-menu:hover { background: #f7f7fb; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #edeaff; color: var(--purple-dark); font-size: 13px; font-weight: 700; }
.account-menu-label strong, .account-menu-label small { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-label strong { font-size: 12px; font-weight: 650; }
.account-menu-label small { color: var(--muted); font-size: 11px; }
.account-popover { position: absolute; top: calc(100% + 7px); right: 0; z-index: 35; width: 210px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
.account-popover button { display: block; width: 100%; padding: 10px; border: 0; border-radius: 7px; background: transparent; cursor: pointer; font-size: 13px; text-align: left; }
.account-popover button:hover { background: #f7f6fc; }
.main-content { width: min(100%, 1480px); margin: 0 auto; padding: 35px clamp(20px, 4vw, 48px) 64px; }
.mobile-menu { display: none !important; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 28px; }
.page-heading .button { flex: 0 0 auto; }
.heading-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.group-color { width: 13px; height: 13px; flex: 0 0 auto; border-radius: 50%; background: var(--purple); }
.notice { position: sticky; z-index: 25; top: 75px; margin: 0 0 17px; padding: 12px 15px; border: 1px solid #d5eade; border-radius: 10px; background: #eff9f3; color: #28694c; font-size: 13px; box-shadow: var(--shadow); }
.notice[data-type="error"] { border-color: #f0d4d2; background: var(--red-soft); color: #8d3434; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 39px; }
.metric-card { display: flex; min-height: 94px; align-items: center; gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 5px 18px rgb(29 36 69 / 3%); }
.metric-symbol { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 11px; font-size: 19px; }
.metric-symbol.purple { background: var(--purple-soft); color: var(--purple); }
.metric-symbol.blue { background: #eaf2ff; color: var(--blue); }
.metric-symbol.green { background: var(--green-soft); color: var(--green); }
.metric-card span:not(.metric-symbol) { display: block; color: var(--muted); font-size: 12px; }
.metric-card strong { display: block; margin-top: 2px; font-size: 23px; font-weight: 720; letter-spacing: -.035em; line-height: 1.1; }
.section-heading, .detail-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-heading { margin-bottom: 13px; }
.section-heading h2, .detail-section-heading h2 { margin-bottom: 2px; }
.section-heading .muted, .detail-section-heading .muted { margin: 2px 0 0; font-size: 13px; }
.section-heading > .text-button { flex: 0 0 auto; }
.project-list { display: grid; gap: 9px; }
.project-row { display: flex; width: 100%; min-width: 0; align-items: center; gap: 15px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; text-align: left; box-shadow: 0 4px 14px rgb(29 36 69 / 2%); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.project-row:focus-visible { outline: 3px solid rgb(105 85 217 / 38%); outline-offset: 2px; }
.project-row:hover { transform: translateY(-1px); border-color: #cfc9f1; box-shadow: var(--shadow); }
.project-monogram { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: var(--purple-soft); color: var(--purple-dark); font-size: 16px; font-weight: 700; }
.project-row-main { min-width: 0; flex: 1; }
.project-row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.project-row-title strong { font-size: 15px; font-weight: 690; }
.project-summary { display: block; max-width: 85ch; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.project-row-meta { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 8px; color: #767d92; font-size: 11px; }
.row-arrow { flex: 0 0 auto; color: #858ba0; font-size: 19px; }
.pill { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 8px; border-radius: 99px; font-size: 10px; font-weight: 650; }
.pill-blue { background: #eaf2ff; color: #386ab7; }
.pill-neutral { background: #f0f1f5; color: #666c7f; }
.empty-panel { display: grid; min-height: 260px; place-items: center; align-content: center; padding: 36px; border: 1px dashed #d7d9e7; border-radius: 14px; background: rgb(255 255 255 / 56%); text-align: center; }
.empty-panel p { max-width: 55ch; margin: 0 auto 19px; color: var(--muted); font-size: 14px; }
.empty-illustration { display: grid; width: 50px; height: 50px; place-items: center; margin-bottom: 14px; border-radius: 16px; background: var(--purple-soft); color: var(--purple); font-size: 22px; font-weight: 750; }
.toolbar { display: flex; gap: 10px; margin: -7px 0 18px; }
.search-box, .select-box { display: flex; min-height: 42px; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: #868ba0; }
.search-box { width: min(100%, 440px); }
.search-box input, .select-box select { min-height: 40px; padding: 6px; border: 0; outline: 0; box-shadow: none; }
.search-box input:focus-visible, .select-box select:focus-visible { outline: none; }
.select-box select { min-width: 145px; }
.detail-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 8px 0 12px; }
.detail-heading h1 { overflow-wrap: anywhere; }
.detail-heading .lead { font-size: 13px; }
.detail-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.back-link { margin: 0 0 8px; padding: 0; border: 0; background: transparent; color: var(--purple-dark); cursor: pointer; font-size: 13px; font-weight: 620; }
.back-link:hover { text-decoration: underline; }
.permission-label { padding: 7px 10px; border-radius: 7px; background: #f0f1f5; color: #60667b; font-size: 12px; }
.sync-line { display: flex; align-items: center; gap: 9px; margin: 0 0 21px; color: #626a7d; font-size: 12px; }
.sync-line .connection-dot { width: 7px; height: 7px; box-shadow: 0 0 0 3px #e4f7ef; }
.surface { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 5px 18px rgb(29 36 69 / 3%); }
.project-summary-panel { display: grid; grid-template-columns: minmax(130px, .33fr) minmax(0, 1fr); gap: 4px 24px; padding: 22px 24px; }
.project-summary-panel > div:first-child { grid-row: span 2; }
.project-summary-panel h2 { font-size: 18px; }
.project-description { margin: 0; color: #4f5569; font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.structural-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.structural-tags span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; color: #61687d; font-size: 11px; }
.ai-review-panel { display: grid; gap: 14px; margin-top: 14px; padding: 20px 23px; border-color: #ded9f7; background: linear-gradient(125deg, #fff 0, #fbfaff 100%); }
.ai-review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ai-review-heading .eyebrow { color: var(--purple-dark); }
.ai-review-heading .muted { max-width: 75ch; margin: 4px 0 0; font-size: 12px; }
.ai-review-heading .button { flex: 0 0 auto; }
.ai-summary { margin: 0; color: #41475b; font-size: 14px; line-height: 1.65; }
.ai-facts { padding-top: 10px; border-top: 1px solid var(--line); }
.ai-facts summary { cursor: pointer; color: var(--purple-dark); font-size: 12px; font-weight: 650; }
.ai-facts ul { display: grid; gap: 9px; padding-left: 18px; }
.ai-facts li { color: var(--ink); font-size: 12px; }
.ai-facts small { display: block; margin-top: 2px; color: var(--muted); }
.ai-server-proposals { display: grid; gap: 8px; }
.ai-server-proposals h3 { margin: 0; font-size: 14px; }
.ai-server-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.ai-server-row > div { display: grid; min-width: 0; gap: 2px; }
.ai-server-row strong { font-size: 13px; }
.ai-server-row span, .ai-server-row small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.ai-server-row .ai-evidence { color: #777e91; }
.host-actions { display: flex; gap: 9px; margin-left: auto; }
.host-actions .text-button:last-child { color: var(--red); }
.detail-section-heading { margin: 29px 0 13px; }
.detail-section-heading .button { flex: 0 0 auto; }
.infrastructure-list, .deployment-list { display: grid; gap: 12px; }
.environment-subheading { margin: 15px 0 -4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.infrastructure-card, .deployment-card { padding: 19px 21px; }
.infrastructure-heading { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.server-icon, .device-glyph { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: #eef3ff; color: var(--blue); font-size: 19px; }
.infrastructure-heading > div { min-width: 0; }
.infrastructure-heading .eyebrow { margin-bottom: 2px; font-size: 9px; }
.infrastructure-heading h3 { margin-bottom: 1px; }
.host-name { overflow-wrap: anywhere; }
.source-chip { margin-left: auto; padding: 4px 8px; border-radius: 6px; background: #f3f4f8; color: #697087; font-size: 10px; white-space: nowrap; }
.mono, code { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; font-variant-numeric: tabular-nums; }
.fact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px 22px; margin: 17px 0 0; }
.fact-grid > div { min-width: 0; }
.fact-grid dt { margin-bottom: 3px; color: #798097; font-size: 11px; }
.fact-grid dd { margin: 0; color: var(--ink); font-size: 13px; font-weight: 560; overflow-wrap: anywhere; }
.deploy-section { margin-top: 4px; }
.deploy-section .detail-section-heading { margin-bottom: 7px; }
.optional-ai { margin-top: 24px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfd; }
.optional-ai > summary { width: fit-content; color: #555c70; cursor: pointer; font-size: 13px; font-weight: 650; }
.optional-ai[open] { display: grid; gap: 12px; }
.optional-ai > .helper { margin: 0; }
.optional-ai .ai-review-panel { margin-top: 0; }
.ai-action-group { display: flex; gap: 8px; }
.status-badge { display: inline-flex; min-height: 23px; align-items: center; padding: 4px 9px; border-radius: 99px; background: var(--amber-soft); color: var(--amber); font-size: 11px; font-weight: 650; }
.status-good { background: var(--green-soft); color: #167650; }
.deployment-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.deployment-header h3 { margin: 10px 0 0; }
.deployment-facts { margin-top: 16px; }
.missing-fields { margin: 14px 0 0; color: #656b80; font-size: 12px; }
.credentials-disclosure { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.credentials-disclosure summary, .context-disclosure summary { width: fit-content; color: #555c70; cursor: pointer; font-size: 12px; font-weight: 650; }
.credentials-disclosure ul { display: grid; gap: 6px; padding: 0; list-style: none; }
.credentials-disclosure li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.credentials-disclosure code { overflow-wrap: anywhere; color: var(--ink); }
.empty-inline { display: grid; gap: 5px; padding: 17px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 13px; }
.empty-inline strong { color: var(--ink); font-size: 14px; }
.context-disclosure { margin-top: 19px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; background: #fbfbfd; }
.context-disclosure pre { max-height: 380px; overflow: auto; padding: 13px; border-radius: 8px; background: #f4f5f9; color: #51576b; font: 12px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.share-section { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding: 18px 2px; border-top: 1px solid var(--line); }
.share-section h2 { margin-bottom: 3px; font-size: 16px; }
.share-section p:last-child { margin-bottom: 0; }
.progress-track { height: 5px; overflow: hidden; margin: 11px 0 14px; border-radius: 99px; background: #ebe9f5; }
.progress-track span { display: block; width: 35%; height: 100%; border-radius: inherit; background: var(--purple); animation: progress-slide 1.3s ease-in-out infinite alternate; }
@keyframes progress-slide { from { transform: translateX(-10%); } to { transform: translateX(200%); } }

.extension-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(310px, .92fr); gap: 16px; }
.extension-card { display: flex; align-items: flex-start; gap: 20px; padding: 25px; }
.extension-icon { display: grid; width: 49px; height: 49px; flex: 0 0 auto; place-items: center; border-radius: 14px; background: var(--purple-soft); color: var(--purple); font-size: 24px; }
.extension-copy { min-width: 0; }
.extension-copy h2 { margin-bottom: 8px; font-size: 21px; }
.extension-copy > p:not(.eyebrow):not(.helper) { max-width: 55ch; margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.extension-copy .helper { margin-top: 9px; }
.steps-card { padding: 24px; }
.steps-card h2 { margin-bottom: 17px; }
.install-steps { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.install-steps li { display: flex; gap: 12px; }
.install-steps li > span { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple-dark); font-size: 11px; font-weight: 700; }
.install-steps strong { display: block; font-size: 13px; }
.install-steps p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.pairing-section, .devices-section { margin-top: 17px; padding: 22px 24px; }
.pairing-result { margin-top: 14px; padding: 13px 15px; border: 1px solid #dad5f5; border-radius: 9px; background: #faf9ff; }
.pairing-result p { margin: 0 0 7px; color: #555b70; font-size: 13px; }
.device-row, .account-row { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.device-row > div, .account-row > div { min-width: 0; flex: 1; }
.device-row strong, .device-row small, .account-row strong, .account-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-row strong, .account-row strong { font-size: 13px; }
.device-row small, .account-row small { color: var(--muted); font-size: 11px; }

.settings-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: -3px 0 17px; border-bottom: 1px solid var(--line); }
.settings-tab { position: relative; min-height: 39px; padding: 7px 12px; border: 0; background: transparent; color: #6c7286; cursor: pointer; font-size: 13px; font-weight: 600; }
.settings-tab:hover { color: var(--purple-dark); }
.settings-tab.is-active { color: var(--purple-dark); }
.settings-tab.is-active::after { position: absolute; right: 10px; bottom: -1px; left: 10px; height: 2px; background: var(--purple); content: ""; }
.settings-panel { display: grid; gap: 16px; }
.settings-card { padding: 23px 25px; }
.settings-card h2 { margin-bottom: 5px; }
.settings-card .section-heading { margin-bottom: 20px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.form-grid > label:has(textarea), .form-grid > fieldset, .form-grid > .form-actions, .form-grid > .form-error { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.form-actions .helper { flex-basis: 100%; }
.preference-row { display: flex; max-width: 460px; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.preference-row select { width: min(230px, 55%); }
.project-role-choices { min-width: 0; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.project-role-choices legend { padding: 0 6px; color: #42475b; font-size: 13px; font-weight: 650; }
.role-option { display: flex; min-height: 43px; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid #f0f1f5; }
.role-option:last-child { border: 0; }
.role-option > span { display: flex; align-items: center; gap: 9px; }
.role-option input { width: 16px; min-height: 16px; accent-color: var(--purple); }
.role-option strong { color: var(--ink); font-size: 12px; }
.role-option select { width: 115px; min-height: 34px; padding: 5px 8px; font-size: 12px; }
.invite-created { margin-top: 18px; padding: 16px; border: 1px solid #cfe8db; border-radius: 10px; background: #f3fbf6; }
.invite-created > strong { color: #216747; font-size: 14px; }
.invite-created p { margin: 6px 0 10px; color: #557063; font-size: 12px; }
.invite-link-row { display: flex; gap: 8px; }
.invite-link-row input { background: #fff; font-size: 12px; }

.dialog { width: min(calc(100% - 24px), 610px); max-height: min(88vh, 850px); padding: 0; overflow: auto; border: 0; border-radius: 16px; background: transparent; color: var(--ink); box-shadow: 0 24px 90px rgb(22 27 49 / 27%); }
.dialog::backdrop { background: rgb(30 34 55 / 47%); backdrop-filter: blur(3px); }
.dialog-card { display: grid; gap: 16px; padding: 25px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 2px; }
.dialog-heading h2 { font-size: 22px; }
.icon-button { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: #656b7f; cursor: pointer; font-size: 20px; }
.icon-button:hover { background: #f6f5fb; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; }
.project-access-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px 12px; margin: -12px 0 20px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 13px; }
.project-access-summary strong { color: var(--ink); }
.project-access-summary.is-shared { border-color: #ecd4ae; background: var(--amber-soft); }
.detail-subsection { margin: 26px 0 34px; }
.local-copy-list { display: grid; gap: 10px; }
.local-copy-card { min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.local-copy-card code { display: block; overflow-wrap: anywhere; color: var(--ink); font-size: 13px; }
.local-copy-card .eyebrow { margin-bottom: 5px; }
.local-copy-note { margin: 8px 2px 0; }
.structural-tags span { display: inline-flex; margin: 4px 6px 0 0; padding: 5px 9px; border-radius: 999px; background: var(--surface-subtle); color: var(--muted); font-size: 12px; }
.key-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 12px; }
.key-facts > div { min-width: 0; padding: 12px; border-radius: 9px; background: var(--surface-subtle); }
.key-facts dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.key-facts dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 14px; font-weight: 650; }
.deployment-primary { margin-top: 12px; }
.credential-warning { margin-top: 12px; padding: 10px 12px; border-left: 3px solid #d39037; border-radius: 5px; background: var(--amber-soft); color: var(--ink); font-size: 12px; }
.credential-warning strong { display: block; margin-bottom: 3px; }
.visibility-help { margin: -6px 0 3px; padding: 10px 12px; border-radius: 8px; background: var(--amber-soft); color: var(--ink); font-size: 12px; }
.visibility-help:empty { display: none; }
.sidebar-backdrop[hidden] { display: none; }
@media (max-width: 760px) {
  .sidebar-backdrop:not([hidden]) { position: fixed; z-index: 29; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: rgb(18 20 30 / 42%); }
  .key-facts { grid-template-columns: 1fr; }
}

html[data-theme="dark"] { color-scheme: dark; --page: #181a23; --surface: #222530; --surface-subtle: #292c38; --ink: #eef0f7; --muted: #b0b5c5; --muted-light: #9299ac; --line: #363a49; --line-strong: #494e60; --purple-soft: #302c4f; --green-soft: #203b34; --amber-soft: #413624; --red-soft: #422b2d; --shadow: 0 12px 36px rgb(0 0 0 / 18%); }
html[data-theme="dark"] .sidebar, html[data-theme="dark"] .topbar { background: var(--surface); }
html[data-theme="dark"] .nav-link, html[data-theme="dark"] .detail-heading .lead, html[data-theme="dark"] .project-description, html[data-theme="dark"] .fact-grid dd { color: var(--ink); }
html[data-theme="dark"] .project-row:hover, html[data-theme="dark"] .account-menu:hover, html[data-theme="dark"] .nav-link:hover { background: var(--surface-subtle); }
html[data-theme="dark"] .context-disclosure, html[data-theme="dark"] .context-disclosure pre { background: var(--surface-subtle); color: var(--ink); }
html[data-theme="dark"] input, html[data-theme="dark"] textarea, html[data-theme="dark"] select { color: var(--ink); }
html[data-theme="dark"] .project-monogram, html[data-theme="dark"] .avatar { background: #39345f; color: #d1caff; }
html[data-theme="system"] { color-scheme: light dark; }
@media (prefers-color-scheme: dark) { html[data-theme="system"] { color-scheme: dark; --page:#181a23;--surface:#222530;--surface-subtle:#292c38;--ink:#eef0f7;--muted:#b0b5c5;--muted-light:#9299ac;--line:#363a49;--line-strong:#494e60;--purple-soft:#302c4f;--green-soft:#203b34;--amber-soft:#413624;--red-soft:#422b2d;--shadow:0 12px 36px rgb(0 0 0 / 18%); } html[data-theme="system"] .sidebar, html[data-theme="system"] .topbar { background: var(--surface); } }
html[data-density="compact"] .project-row { padding-block: 12px; }
html[data-density="compact"] .metric-card { min-height: 80px; padding-block: 13px; }

@media (max-width: 1050px) {
  .sidebar { width: 220px; }
  .main-column { margin-left: 220px; }
  .main-content { padding-inline: 26px; }
  .extension-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-101%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: translateX(0); }
  .main-column { margin-left: 0; }
  .topbar { height: 58px; padding-inline: 14px; }
  .mobile-menu { display: grid !important; width: 34px; height: 34px; }
  .breadcrumbs { margin-right: auto; margin-left: 10px; }
  .account-menu-label { display: none; }
  .main-content { padding: 26px 18px 48px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-heading .button { width: 100%; }
  .heading-actions { width: 100%; flex-direction: column; }
  .heading-actions .button { width: 100%; }
  .metric-grid { grid-template-columns: 1fr; gap: 8px; margin-bottom: 29px; }
  .metric-card { min-height: 75px; }
  .section-heading, .detail-section-heading { align-items: flex-start; flex-direction: column; }
  .section-heading > .text-button { align-self: flex-start; }
  .project-row { align-items: flex-start; padding: 14px; }
  .project-monogram { width: 36px; height: 36px; }
  .project-summary { white-space: normal; }
  .project-row-meta { display: grid; gap: 4px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box, .select-box { width: 100%; }
  .detail-heading { align-items: flex-start; flex-direction: column; }
  .detail-actions { width: 100%; }
  .detail-actions .button { flex: 1; }
  .ai-review-heading { align-items: stretch; flex-direction: column; }
  .ai-review-heading .button { width: 100%; }
  .ai-server-row { align-items: stretch; flex-direction: column; }
  .project-summary-panel { grid-template-columns: 1fr; gap: 8px; padding: 18px; }
  .project-summary-panel > div:first-child { grid-row: auto; }
  .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .deployment-header { flex-direction: column; }
  .extension-card { flex-direction: column; padding: 20px; }
  .extension-copy .button { width: 100%; }
  .pairing-section, .devices-section, .settings-card { padding: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > * { grid-column: 1 !important; }
  .device-row { flex-wrap: wrap; }
  .device-row > .helper { flex-basis: 100%; padding-left: 51px; }
  .auth-card { padding: 27px 22px; }
}
@media (max-width: 460px) {
  h1 { font-size: 28px; }
  .main-content { padding-inline: 14px; }
  .fact-grid { grid-template-columns: 1fr 1fr; gap: 12px 10px; }
  .infrastructure-card, .deployment-card { padding: 15px; }
  .source-chip { max-width: 125px; overflow: hidden; text-overflow: ellipsis; }
  .share-section { align-items: flex-start; flex-direction: column; }
  .invite-link-row { flex-direction: column; }
  .invite-link-row .button { width: 100%; }
  .role-option { align-items: flex-start; flex-direction: column; padding: 9px 0; }
  .role-option select { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
