:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #6f7890;
  --line: #e1e5ee;
  --surface: #ffffff;
  --soft: #f5f7fb;
  --navy: #172a4a;
  --blue: #315ee7;
  --violet: #7567e8;
  --teal: #2da6a0;
  --amber: #d89532;
  --danger: #c94f63;
  --shadow: 0 14px 40px rgba(31, 47, 81, .10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 980px;
  height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 76px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(105deg, #14223b, #1b335b);
  box-shadow: 0 2px 12px rgba(10, 20, 40, .25);
}

.brand, .top-actions, .panel-heading, .graph-toolbar {
  display: flex;
  align-items: center;
}

.brand { gap: 12px; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.35); border-radius: 11px;
  font-family: Georgia, serif; font-size: 22px;
  background: rgba(255,255,255,.08);
}
.brand strong { display: block; font-family: Georgia, serif; font-size: 20px; letter-spacing: .2px; }
.brand span { display: block; margin-top: 2px; color: #aebbd2; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.top-actions { gap: 9px; min-width:0; overflow-x:auto; padding:7px 0; scrollbar-width:thin; }
.command-group {
  position:relative; display:flex; align-items:center; gap:5px; flex:0 0 auto;
  padding:15px 7px 4px; border-left:1px solid rgba(255,255,255,.14);
}
.command-group:first-child { border-left:0; }
.command-group > span {
  position:absolute; top:0; left:9px; color:#91a2bf;
  font-size:8px; font-weight:800; letter-spacing:.13em; text-transform:uppercase;
}

button, .file-button {
  border: 0; border-radius: 8px; padding: 10px 16px;
  font-weight: 650; transition: .18s ease;
}
.file-button, button.secondary {
  color: #263650; background: #fff; border: 1px solid #dfe4ed;
}
.topbar .file-button { color: #e8edfa; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.22); }
.topbar .top-button { color:#e8edfa; background:transparent; border:1px solid rgba(255,255,255,.22); }
.topbar .top-button, .topbar .file-button { padding:7px 10px; font-size:10px; white-space:nowrap; }
.topbar .command-primary { background:#315ee7; border-color:#6282ed; }
.account-command-group { padding-left:12px; }
.account-identity { min-width:105px; max-width:165px; line-height:1.15; }
.account-identity strong, .account-identity small {
  display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.account-identity strong { color:#fff; font-size:10px; }
.account-identity small { margin-top:3px; color:#aebbd2; font-size:9px; }
button.primary { color: #fff; background: var(--blue); box-shadow: 0 5px 15px rgba(49,94,231,.35); }
button:hover, .file-button:hover { transform: translateY(-1px); filter: brightness(1.04); }
button:disabled { cursor:not-allowed; opacity:.48; transform:none; filter:none; }
#fileInput { display: none; }

.workspace { display:grid; grid-template-rows:auto minmax(0,1fr); height:calc(100vh - 76px); }
.workspace-panel, .result-panel { min-width: 0; min-height: 0; }
.workspace-panel {
  background:#e8eef8; border-bottom:1px solid #c9d4e5;
}
.workspace-documents { display:flex; align-items:center; gap:12px; min-height:48px; padding:7px 18px; background:#e8eef8; }
.workspace-title { flex:0 0 auto; padding-right:12px; border-right:1px solid var(--line); }
.workspace-title .eyebrow { display:block; margin-bottom:2px; }
.workspace-title strong { color:var(--muted); font-size:10px; font-weight:650; }
.document-tabs { display:flex; flex:1 1 auto; gap:7px; min-width:0; overflow-x:auto; scrollbar-width:thin; }
.document-tab {
  display:flex; align-items:center; gap:7px; flex:0 1 230px; min-width:130px; max-width:260px;
  padding:7px 8px 7px 10px; color:#536078; background:#fff;
  border:1px solid var(--line); border-radius:7px; font-size:11px; font-weight:600;
}
.document-tab.active { color:var(--blue); border-color:#aebcf1; background:#eef2ff; }
.document-tab .document-name { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:left; }
.document-tab .close-document {
  display:grid; place-items:center; width:18px; height:18px; padding:0;
  color:#8490a6; background:transparent; border-radius:4px; font-size:14px;
}
.document-tab .close-document:hover { color:var(--danger); background:#fff; transform:none; }
.workspace-empty { color:var(--muted); font-size:11px; }
.panel-heading { justify-content: space-between; padding: 22px 24px 14px; }
.eyebrow { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.panel-heading h1 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 21px; }
.icon-button { padding: 8px 11px; color: var(--muted); background: var(--soft); }
#sourceEditor {
  width:100%; height:calc(100vh - 350px); min-height:430px; resize:vertical; outline:none;
  border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 22px 24px; color: #28334a; background: #fbfcfe;
  font: 14px/1.75 "Cascadia Code", Consolas, monospace;
  tab-size: 2;
}
#sourceEditor:focus { box-shadow: inset 3px 0 0 var(--blue); }
.syntax-help { padding: 12px 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.syntax-help span { padding: 5px 8px; color: #67718a; background: #f2f4f8; border-radius: 5px; font-size: 10px; }
.source-toolbar { display:flex; align-items:center; justify-content:space-between; padding:14px 0 10px; }
.source-toolbar strong { display:block; margin-top:4px; font:18px Georgia,serif; }
.source-actions { display:flex; align-items:center; gap:8px; }

.result-panel { position:relative; overflow:auto; padding:14px 18px 18px; }
.welcome { height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.welcome h2 { margin: 28px 0 8px; color: var(--ink); font: 26px Georgia, serif; }
.welcome p { margin: 0; }
.welcome-orbit { position: relative; width: 140px; height: 140px; border: 1px solid #dfe4f2; border-radius: 50%; }
.welcome-orbit::before { content:""; position:absolute; inset:22px; border:1px dashed #c8d1e8; border-radius:50%; }
.welcome-orbit b { position:absolute; inset:43px; display:grid; place-items:center; border-radius:50%; color:#fff; background:linear-gradient(145deg,var(--blue),var(--violet)); font:30px Georgia,serif; box-shadow:0 12px 30px rgba(73,86,202,.3); }
.welcome-orbit i { position:absolute; width:14px; height:14px; border:3px solid #fff; border-radius:50%; background:var(--teal); box-shadow:0 2px 7px #9ca7bc; }
.welcome-orbit i:nth-child(1){left:8px;top:58px}.welcome-orbit i:nth-child(2){right:14px;top:28px;background:var(--amber)}.welcome-orbit i:nth-child(3){right:22px;bottom:18px;background:var(--violet)}
.hidden { display: none !important; }

.summary-grid { display:grid; grid-template-columns:repeat(4,minmax(108px,1fr)); gap:10px; }
.graph-summary { padding-top:14px; margin-bottom:10px; }
.active-profile { display:flex; align-items:center; gap:8px; margin-bottom:9px; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.08em; }
.active-profile strong { padding:4px 8px; color:var(--blue); background:#edf1ff; border-radius:7px; font-size:10px; letter-spacing:0; text-transform:none; }
.project-file-status {
  margin-left:auto; padding:4px 8px; color:#55715d; background:#edf8f0;
  border-radius:7px; font-size:10px; letter-spacing:0; text-transform:none;
}
.project-file-status.dirty { color:#8b6420; background:#fff5dd; }
.summary-card { min-width: 0; padding: 14px 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 3px 12px rgba(25,43,75,.04); }
.summary-card span { display:block; color:var(--muted); font-size:10px; font-weight:750; letter-spacing:.08em; text-transform:uppercase; white-space:nowrap; }
.summary-card strong { display:block; margin-top:5px; font:25px Georgia,serif; }
.summary-card em { float:right; width:7px; height:7px; margin-top:8px; border-radius:50%; background:var(--blue); }

.tabs { display:flex; gap:4px; overflow-x:auto; border-bottom:1px solid var(--line); scrollbar-width:thin; }
.tabs::-webkit-scrollbar, .document-tabs::-webkit-scrollbar { height:5px; }
.tab { padding:11px 14px; color:var(--muted); background:transparent; border-radius:0; border-bottom:2px solid transparent; }
.tab.active { color:var(--blue); border-color:var(--blue); }
.tab span { margin-left:5px; padding:1px 6px; color:#fff; background:var(--danger); border-radius:10px; font-size:10px; }
.tab .count-badge { color:#58657c; background:#e8ebf2; }
.view { display:none; }
.view.active { display:block; }

.document-toolbar {
  display:flex; align-items:center; justify-content:space-between; padding:13px 0 0;
}
.document-toolbar strong { display:block; margin-top:3px; font:16px Georgia,serif; }
.document-layout { display:grid; grid-template-columns:minmax(0,1fr) 310px; gap:14px; padding-top:14px; align-items:start; }
.structured-document { display:flex; flex-direction:column; gap:12px; min-width:0; }
.document-section { overflow:hidden; background:#fff; border:1px solid var(--line); border-radius:11px; }
.document-section > header { display:flex; align-items:center; justify-content:space-between; padding:13px 16px; background:#f7f8fb; border-bottom:1px solid var(--line); }
.document-section h3 { margin:2px 0 0; font:17px Georgia,serif; }
.section-level { color:var(--blue); font-size:9px; font-weight:800; letter-spacing:.1em; text-transform:uppercase; }
.section-count { color:var(--muted); font-size:10px; }
.document-units { padding:5px; }
.document-unit { display:grid; grid-template-columns:48px minmax(0,1fr) 18px; gap:10px; width:100%; padding:10px 11px; color:var(--ink); background:transparent; border:1px solid transparent; border-radius:8px; text-align:left; }
.document-unit:hover { transform:none; filter:none; background:#f7f9fd; }
.document-unit.selected { background:#edf2ff; border-color:#b9c7f4; }
.unit-line { padding-top:2px; color:var(--muted); font:10px "Cascadia Code",Consolas,monospace; }
.unit-main { min-width:0; }
.unit-main strong { display:block; margin-bottom:4px; color:var(--blue); font-size:10px; letter-spacing:.06em; }
.unit-main > span { display:block; overflow:hidden; color:#465269; font:11px/1.5 "Cascadia Code",Consolas,monospace; text-overflow:ellipsis; white-space:nowrap; }
.unit-arrow { color:#9ba6ba; font-size:20px; }
.section-empty { padding:18px; color:var(--muted); font-size:11px; }
.unit-inspector { position:sticky; top:0; min-height:220px; max-height:calc(100vh - 250px); overflow:auto; padding:16px; background:#fff; border:1px solid var(--line); border-radius:11px; box-shadow:var(--shadow); }
.unit-inspector h3 { margin:7px 0 2px; font:19px Georgia,serif; }
.unit-inspector-heading p { margin:0 0 13px; color:var(--muted); font-size:10px; }
.canonical-line { margin-top:12px; padding:11px; background:#f5f7fb; border-radius:8px; }
.canonical-line b { display:block; margin-bottom:7px; color:var(--muted); font-size:9px; letter-spacing:.08em; text-transform:uppercase; }
.canonical-line code { display:block; overflow-wrap:anywhere; color:#34415a; font-size:10px; line-height:1.6; white-space:pre-wrap; }
.unit-action { width:100%; margin-top:12px; }
.unit-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px; }
.file-button.disabled { pointer-events:none; opacity:.65; }
.unit-edit-form { display:flex; flex-direction:column; gap:10px; }
.unit-field span {
  display:block; margin-bottom:4px; color:var(--muted);
  font-size:9px; font-weight:750; letter-spacing:.08em; text-transform:uppercase;
}
.unit-field input, .unit-field textarea {
  width:100%; padding:9px 10px; outline:none; color:var(--ink);
  background:#fbfcfe; border:1px solid var(--line); border-radius:7px;
  font:11px/1.45 "Cascadia Code",Consolas,monospace;
}
.unit-field input:focus, .unit-field textarea:focus {
  border-color:#9eafea; box-shadow:0 0 0 3px rgba(49,94,231,.09);
}
.unit-field textarea { resize:vertical; }
.unit-edit-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:14px; }

.studio-dialog {
  width:min(480px,calc(100vw - 40px)); padding:0; color:var(--ink);
  background:#fff; border:0; border-radius:14px; box-shadow:0 24px 80px rgba(16,28,52,.28);
}

.auth-dialog {
  width:min(880px,calc(100vw - 48px)); max-width:none; padding:0;
  overflow:hidden; border:0; border-radius:18px; background:#fff;
  box-shadow:0 28px 90px rgba(9,20,42,.32);
}
.auth-dialog::backdrop { background:rgba(9,18,36,.72); backdrop-filter:blur(5px); }
.auth-layout { display:grid; grid-template-columns:minmax(280px,.9fr) minmax(390px,1.1fr); min-height:540px; }
.auth-introduction {
  display:flex; flex-direction:column; justify-content:center; padding:52px;
  color:#fff; background:
    radial-gradient(circle at 25% 20%,rgba(117,103,232,.5),transparent 36%),
    linear-gradient(145deg,#14223b,#1b335b 65%,#244579);
}
.auth-brand-mark {
  display:grid; place-items:center; width:52px; height:52px; margin-bottom:18px;
  border:1px solid rgba(255,255,255,.38); border-radius:15px;
  background:rgba(255,255,255,.09); font:28px Georgia,serif;
}
.auth-product { color:#b9c8e1; font-size:11px; font-weight:800; letter-spacing:.16em; text-transform:uppercase; }
.auth-introduction h1 { margin:15px 0 12px; font:32px/1.15 Georgia,serif; }
.auth-introduction p { margin:0; color:#c6d1e4; font-size:14px; line-height:1.65; }
.auth-panel { padding:38px 46px; }
.auth-tabs { display:flex; gap:5px; margin-bottom:34px; padding:4px; background:#f2f4f8; border-radius:10px; }
.auth-tabs button { flex:1; padding:9px 12px; color:var(--muted); background:transparent; font-size:11px; }
.auth-tabs button:hover { transform:none; }
.auth-tabs button.active { color:var(--blue); background:#fff; box-shadow:0 2px 8px rgba(25,43,75,.09); }
#authForm { display:flex; flex-direction:column; gap:3px; }
#authForm h2 { margin:5px 0 5px; font:27px Georgia,serif; }
#authSubtitle { margin:0 0 22px; color:var(--muted); font-size:12px; }
.auth-remember { display:flex; align-items:center; gap:8px; margin:1px 0 13px; color:#536078; font-size:11px; }
.auth-remember input { width:15px; height:15px; accent-color:var(--blue); }
.auth-error { margin:0 0 10px; padding:10px 12px; color:#9e3045; background:#fff0f3; border:1px solid #f1c7d0; border-radius:8px; font-size:11px; line-height:1.45; }
.auth-submit { width:100%; margin-top:2px; }
body.auth-pending .topbar, body.auth-pending .workspace { visibility:hidden; }

@media (max-width:760px) {
  .auth-layout { grid-template-columns:1fr; }
  .auth-introduction { display:none; }
  .auth-panel { padding:34px; }
}
.studio-dialog::backdrop { background:rgba(15,25,45,.48); backdrop-filter:blur(2px); }
.wide-dialog { width:min(680px,calc(100vw - 40px)); }
.project-dialog { width:min(780px,calc(100vw - 40px)); }
.project-form-scroll { max-height:68vh; overflow:auto; padding-right:5px; }
.project-form-section {
  margin:4px 0 16px; padding:14px; background:#f8faff;
  border:1px solid var(--line); border-radius:10px;
}
.project-form-section h3 { margin:0 0 12px; font-size:13px; }
.project-section-title {
  display:flex; align-items:flex-start; justify-content:space-between; gap:14px;
  margin-bottom:10px;
}
.project-section-title h3 { margin-bottom:3px; }
.project-section-title p { margin:0; color:var(--muted); font-size:10px; line-height:1.45; }
.project-section-title button { flex:none; padding:7px 10px; }
.metadata-editor { display:grid; gap:7px; }
.metadata-editor:empty::after {
  content:"Aucune information complémentaire."; padding:10px;
  color:var(--muted); text-align:center; font-size:10px;
  border:1px dashed var(--line); border-radius:8px;
}
.metadata-row { display:grid; grid-template-columns:minmax(130px,.7fr) minmax(180px,1.3fr) 32px; gap:7px; }
.metadata-row input {
  width:100%; min-width:0; padding:8px 9px; outline:none; color:var(--ink);
  background:#fff; border:1px solid var(--line); border-radius:7px;
}
.metadata-row input:focus { border-color:#9eafea; box-shadow:0 0 0 3px rgba(49,94,231,.09); }
.metadata-remove { width:32px; height:32px; padding:0; color:#a23d3d; background:#fff1f1; }
.studio-dialog form { padding:20px; }
.studio-dialog header { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:18px; }
.studio-dialog h2 { margin:4px 0 0; font:23px Georgia,serif; }
.dialog-close {
  width:32px; height:32px; padding:0; color:var(--muted);
  background:var(--soft); border-radius:8px; font-size:20px;
}
.dialog-close:hover { transform:none; }
.dialog-field { display:block; margin-bottom:13px; }
.dialog-field > span {
  display:block; margin-bottom:5px; color:var(--muted);
  font-size:9px; font-weight:800; letter-spacing:.09em; text-transform:uppercase;
}
.dialog-field input, .dialog-field select, .dialog-field textarea {
  width:100%; min-width:0; padding:10px 11px; outline:none; color:var(--ink);
  background:#fbfcfe; border:1px solid var(--line); border-radius:8px;
}
.dialog-field input:focus, .dialog-field select:focus, .dialog-field textarea:focus {
  border-color:#9eafea; box-shadow:0 0 0 3px rgba(49,94,231,.09);
}
.dialog-field textarea { resize:vertical; }
.dialog-note {
  margin:4px 0 14px; padding:10px 11px; color:var(--muted); background:var(--soft);
  border-radius:8px; font-size:11px; line-height:1.55;
}
.dialog-note code { color:#44516a; font-family:"Cascadia Code",Consolas,monospace; }
.dialog-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.add-unit-fields {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 12px;
  max-height:48vh; overflow:auto; padding-right:3px;
}
.add-unit-fields > * { min-width:0; }
.dialog-checkbox-field {
  display:grid; grid-template-columns:1fr auto; align-items:center;
  min-height:58px; padding:7px 10px; background:#fbfcfe;
  border:1px solid var(--line); border-radius:8px;
}
.dialog-checkbox-field > span { margin:0; }
.dialog-checkbox-field input[type="checkbox"] {
  width:17px; height:17px; min-width:17px; padding:0; margin:0;
  accent-color:var(--blue);
}
.calculation-sequence { padding:10px; background:#f7f9fd; border:1px solid var(--line); border-radius:9px; }
.calculation-sequence-picker { display:grid; grid-template-columns:1fr auto; gap:7px; }
.calculation-sequence-picker select { width:100%; min-width:0; }
.calculation-sequence-picker button { padding:8px 11px; }
.calculation-sequence-items { display:grid; gap:5px; margin-top:8px; }
.calculation-sequence-item {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:6px 7px 6px 10px; background:#fff; border:1px solid var(--line); border-radius:7px;
}
.calculation-sequence-item strong { font-size:11px; }
.calculation-sequence-item label {
  display:flex; align-items:center; gap:6px; margin-left:auto;
  color:var(--muted); font-size:9px;
}
.calculation-sequence-item label input {
  width:90px; padding:5px 7px; text-align:right; font-size:10px;
}
.calculation-sequence-item span { display:flex; gap:3px; }
.calculation-sequence-item button {
  width:25px; height:25px; padding:0; border-radius:5px; font-size:12px;
}
.calculation-sequence-item .sequence-remove { color:#a23d3d; background:#fff1f1; }
.calculation-sequence small { display:block; margin-top:7px; color:var(--muted); font-size:9px; }
.studio-dialog footer {
  display:flex; justify-content:flex-end; gap:9px; margin-top:8px;
  padding-top:16px; border-top:1px solid var(--line);
}

@media (max-width:620px) {
  .dialog-grid, .add-unit-fields { grid-template-columns:1fr; }
  .metadata-row { grid-template-columns:1fr 32px; }
  .metadata-row .metadata-value { grid-column:1 / -1; grid-row:2; }
  .metadata-row .metadata-remove { grid-column:2; grid-row:1; }
}

.graph-toolbar { gap:9px; padding:12px 0; }
.search-box { flex:1; display:flex; align-items:center; gap:7px; padding:0 11px; border:1px solid var(--line); border-radius:8px; background:#fff; }
.search-box input, .table-toolbar input { width:100%; padding:9px 0; border:0; outline:0; background:transparent; }
select { min-width:155px; padding:9px 28px 9px 10px; color:#3d4960; background:#fff; border:1px solid var(--line); border-radius:8px; }
.graph-stage { position:relative; height:calc(100vh - 250px); min-height:430px; overflow:hidden; background:#fff; border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow); }
#graphCanvas { display:block; width:100%; height:100%; cursor:grab; }
#graphCanvas.dragging { cursor:grabbing; }
#sketchCanvas { display:block; width:100%; height:100%; cursor:grab; background-color:#fbfcff; background-image:linear-gradient(#edf0f6 1px,transparent 1px),linear-gradient(90deg,#edf0f6 1px,transparent 1px); background-size:24px 24px; }
#sketchCanvas.dragging { cursor:grabbing; }
.sketch-stage { background:#fbfcff; }
.sketch-stat { flex:1; color:var(--muted); font-size:12px; }
.sketch-stat strong { color:var(--ink); font:17px Georgia,serif; }
.sketch-stat span { margin:0 8px; color:#b0b7c5; }
.sketch-calculation-picker { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:11px; }
.sketch-calculation-picker select { min-width:230px; max-width:330px; }
.sketch-inspector-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:14px; padding-top:12px; border-top:1px solid #edf0f5; }
.sketch-inspector-actions button { flex:1; min-width:95px; padding:8px 10px; }
.sketch-inspector-actions button:disabled { opacity:.55; cursor:not-allowed; }
.calculation-point-list { display:flex; flex-wrap:wrap; gap:5px; margin-top:6px; }
.calculation-point-list span { padding:3px 7px; color:#754313; background:#fff1df; border:1px solid #f0c38f; border-radius:6px; font-size:10px; font-weight:700; }
.sketch-legend i { border:2px solid #fff; box-shadow:0 0 0 1px #cbd2df; }
.sketch-legend .known-point { background:var(--blue); }
.sketch-legend .adopted-point { background:#27945b; }
.sketch-legend .propagated-point { background:var(--amber); }
.sketch-legend .unplaced-measure { width:14px; height:2px; border:0; border-radius:0; background:#b7bfce; box-shadow:none; vertical-align:middle; }
.inspector {
  position:absolute; top:12px; right:12px; bottom:12px; width:268px;
  overflow-x:hidden; overflow-y:auto; overscroll-behavior:contain;
  padding:16px; background:rgba(255,255,255,.96);
  border:1px solid var(--line); border-radius:10px;
  box-shadow:0 10px 28px rgba(27,43,73,.15); backdrop-filter:blur(8px);
  scrollbar-width:thin; scrollbar-color:#b9c3d7 transparent;
}
.inspector::-webkit-scrollbar { width:7px; }
.inspector::-webkit-scrollbar-thumb { background:#b9c3d7; border-radius:8px; }
.empty-inspector { padding:20px 7px; text-align:center; color:var(--muted); font-size:12px; }
.empty-inspector span { font-size:26px; color:#aab3c7; }
.inspector h3 { margin:0 0 4px; font:19px Georgia,serif; overflow-wrap:anywhere; }
.inspector .node-type { display:inline-block; margin:4px 0 12px; padding:3px 7px; color:var(--blue); background:#edf1ff; border-radius:5px; font-size:10px; font-weight:700; }
.detail-row { padding:8px 0; border-top:1px solid #edf0f5; }
.detail-row b { display:block; margin-bottom:3px; color:var(--muted); font-size:9px; letter-spacing:.1em; text-transform:uppercase; }
.detail-row span { display:block; max-width:100%; font-size:12px; line-height:1.5; overflow-wrap:anywhere; word-break:break-word; white-space:pre-wrap; }
.candidate-list { margin-top:15px; }
.candidate-list h4 { margin:0 0 8px; color:#34425b; font-size:11px; letter-spacing:.04em; text-transform:uppercase; }
.coordinate-candidate { margin:7px 0; padding:9px 10px; color:#526078; background:#f7f8fb; border:1px solid #e2e6ee; border-radius:8px; font-size:11px; line-height:1.55; }
.coordinate-candidate.adopted-candidate { color:#244b38; background:#eff9f3; border-color:#a8d7bb; }
.candidate-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:7px; }
.candidate-heading strong { color:#2d3a52; overflow-wrap:anywhere; }
.candidate-heading span { flex:none; padding:2px 5px; color:#287548; background:#d9f1e2; border-radius:5px; font-size:9px; font-weight:700; text-transform:uppercase; }
.coordinate-candidate small { display:block; margin:1px 0 5px; color:#7c879b; }
.inspector-note { margin-top:13px; padding:9px; color:#756029; background:#fff8e8; border:1px solid #f0ddb0; border-radius:8px; font-size:11px; line-height:1.45; }
@media (max-width:900px) {
  .sketch-calculation-picker { order:3; width:100%; }
  .sketch-calculation-picker select { flex:1; max-width:none; }
}
.legend { position:absolute; left:14px; bottom:12px; display:flex; flex-wrap:wrap; gap:10px; max-width:calc(100% - 300px); padding:7px 9px; background:rgba(255,255,255,.9); border-radius:7px; color:var(--muted); font-size:10px; }
.legend i { display:inline-block; width:8px; height:8px; margin-right:4px; border-radius:50%; }

.table-toolbar { padding:12px 0; }
.table-toolbar input { padding:10px 12px; background:#fff; border:1px solid var(--line); border-radius:8px; }
.data-table, .list-panel { margin-top:12px; overflow:auto; background:#fff; border:1px solid var(--line); border-radius:11px; }
.data-table table { width:100%; border-collapse:collapse; }
.data-table th { position:sticky; top:0; z-index:2; padding:11px 14px; color:var(--muted); background:#f7f8fb; border-bottom:1px solid var(--line); text-align:left; font-size:10px; letter-spacing:.08em; text-transform:uppercase; }
.data-table td { padding:12px 14px; border-bottom:1px solid #edf0f4; font-size:12px; vertical-align:top; }
.data-table tr:last-child td { border-bottom:0; }
.data-table tbody tr[data-topography-row-kind] { cursor:pointer; transition:background-color .15s ease; }
.data-table tbody tr[data-topography-row-kind]:hover td { background:#f7faff; }
.data-table tbody tr[data-topography-row-kind]:focus { outline:none; }
.data-table tbody tr.topography-row-selected td { background:#eaf1ff; box-shadow:inset 0 1px #9ab5e0, inset 0 -1px #9ab5e0; }
.data-table tbody tr.topography-row-selected td:first-child { box-shadow:inset 3px 0 var(--blue), inset 0 1px #9ab5e0, inset 0 -1px #9ab5e0; }
.data-table td:last-child { white-space:nowrap; }
.data-table tr.listing-focus-row td {
  background:#fff3df;
  box-shadow:inset 0 1px #efb55f, inset 0 -1px #efb55f;
  transition:background-color .2s ease;
}
.data-table tr.listing-focus-row td:first-child { box-shadow:inset 3px 0 #e27b24, inset 0 1px #efb55f, inset 0 -1px #efb55f; }
.pill { display:inline-block; margin:1px 3px 1px 0; padding:3px 7px; color:#4d5e7a; background:#edf1f7; border-radius:8px; font-size:10px; }
.list-item { display:grid; grid-template-columns:110px 1fr; gap:14px; padding:14px 16px; border-bottom:1px solid #edf0f4; }
.list-item:last-child { border:0; }
.list-item .status { font-size:10px; font-weight:800; text-transform:uppercase; }
.list-item h4 { margin:0 0 4px; font-size:13px; }
.list-item p { margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
.status.Warning { color:var(--amber); }.status.Error { color:var(--danger); }.status.Information { color:var(--blue); }
.empty-state { display:flex; align-items:flex-start; gap:13px; min-height:110px; padding:24px; color:var(--muted); }
.empty-state > span { display:grid; place-items:center; flex:0 0 34px; height:34px; color:var(--blue); background:#edf1ff; border-radius:50%; font-size:20px; }
.empty-state strong { display:block; margin:1px 0 5px; color:var(--ink); font-size:13px; }
.empty-state p { max-width:660px; margin:0; font-size:12px; line-height:1.55; }
.event-description { margin-top:6px !important; color:#3f4b61 !important; }
.event-metadata { margin-top:7px; }
.coownership-summary, .business-summary { display:grid; grid-template-columns:repeat(5,minmax(80px,1fr)); gap:10px; padding:12px 0 2px; }
.business-summary.topo-summary-navigation { grid-template-columns:repeat(7,minmax(0,1fr)); }
.coownership-summary { grid-template-columns:repeat(3,minmax(150px,1fr)); }
.coownership-summary article, .business-summary article { display:flex; align-items:center; gap:10px; padding:13px 15px; background:#fff; border:1px solid var(--line); border-radius:10px; }
.coownership-summary strong, .business-summary strong { color:var(--blue); font:24px Georgia,serif; }
#topoCalculationMode { font:700 14px/1.2 Inter,system-ui,sans-serif; }
.coownership-summary span, .business-summary span { color:var(--muted); font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; }
.topo-summary-navigation article[data-topo-target] { cursor:pointer; transition:border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.topo-summary-navigation article[data-topo-target]:hover,
.topo-summary-navigation article[data-topo-target]:focus-visible { background:#f7faff; border-color:#9ab5e0; box-shadow:0 4px 14px rgba(36,75,135,.10); outline:none; }
.topography-subtabs { display:flex; align-items:center; gap:4px; margin:14px 0 0; padding:5px; overflow-x:auto; background:#eef2f8; border:1px solid var(--line); border-radius:11px; }
.topography-subtabs button { flex:0 0 auto; padding:9px 13px; border:0; border-radius:8px; background:transparent; color:#60708a; font-size:11px; font-weight:750; }
.topography-subtabs button:hover { background:#fff; color:var(--blue); }
.topography-subtabs button.active { background:#fff; color:var(--blue); box-shadow:0 2px 8px rgba(28,57,105,.12); }
.topography-panel { display:none; margin-top:12px; }
.topography-panel.active { display:block; }
.topography-panel-heading { display:flex; align-items:center; flex-wrap:wrap; gap:8px; padding:13px 15px; border-bottom:1px solid var(--line); }
.topography-panel-heading > div { flex:1 1 220px; }
.topography-panel-heading h3 { margin:3px 0 0; color:#263854; font-size:14px; }
.topography-panel-heading .summary-action { margin-left:0; }
.business-group .topography-panel-heading h3 { margin:3px 0 0; font:600 14px Inter,Arial,sans-serif; }
.reading-mode-toolbar {
  display:flex; align-items:center; justify-content:space-between; gap:18px;
  margin-top:12px; padding:12px 14px;
  background:#f7f8fb; border:1px solid var(--line); border-radius:10px;
}
.reading-mode-toolbar > div:first-child { display:grid; gap:3px; min-width:0; }
.reading-mode-toolbar strong { color:var(--ink); font-size:12px; }
.reading-mode-toolbar span { color:var(--muted); font-size:11px; line-height:1.4; }
.reading-mode-actions { display:flex; flex:0 0 auto; gap:6px; padding:3px; background:#e9edf5; border-radius:8px; }
.reading-mode-actions button {
  padding:7px 10px; color:#5c687d; background:transparent; border:0; border-radius:6px;
  cursor:pointer; font-size:11px; font-weight:750;
}
.reading-mode-actions button:hover { color:var(--blue); background:rgba(255,255,255,.65); }
.reading-mode-actions button.active { color:#fff; background:var(--blue); box-shadow:0 2px 7px rgba(39,65,126,.18); }
.reading-mode-actions button:focus-visible { outline:2px solid rgba(61,88,192,.3); outline-offset:2px; }
.coownership-group h3, .business-group h3 { margin:18px 0 7px; font:17px Georgia,serif; }
.collapsible-group { margin-top:12px; }
.collapsible-group > summary {
  position:relative; z-index:1; width:100%; box-sizing:border-box;
  display:flex; align-items:center; gap:10px; min-height:22px;
  padding:10px 4px 9px; color:var(--ink); cursor:pointer;
  font:17px Georgia,serif; list-style:none; user-select:none;
}
.collapsible-group > summary::-webkit-details-marker { display:none; }
.collapsible-group > summary::before {
  content:""; flex:0 0 8px; width:8px; height:8px;
  border-right:2px solid #7d899e; border-bottom:2px solid #7d899e;
  transform:rotate(-45deg); transition:transform .16s ease;
}
.collapsible-group[open] > summary::before { transform:rotate(45deg) translate(-2px,-2px); }
.collapsible-group > summary:hover { color:var(--blue); }
.collapsible-group > summary:focus-visible {
  outline:2px solid rgba(61,88,192,.28); outline-offset:3px; border-radius:5px;
}
.collapsible-group > summary .plan-state { margin-left:auto; font-family:Inter,Arial,sans-serif; }
.collapsible-group:not([open]) > summary { border-bottom:1px solid var(--line); }
.group-title-row { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:18px; }
.group-title-row h3 { margin:0 0 7px; }
.plan-state, .plan-status {
  display:inline-block; padding:4px 8px; border-radius:7px;
  font-size:10px; font-weight:800; letter-spacing:.04em; text-transform:uppercase;
}
.plan-ready, .plan-status.plan-ready { color:#26724d; background:#e7f6ee; }
.plan-warning, .plan-status.plan-blocked, .plan-status.plan-invalid {
  color:#9a5c12; background:#fff2dc;
}
.plan-status.plan-invalid { color:var(--danger); background:#fff0f0; }
.execution-state {
  display:inline-block;
  padding:4px 8px;
  border-radius:7px;
  color:#58657c;
  background:#edf1f7;
  font-size:10px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
  white-space:nowrap;
}
.execution-valid, .execution-completed, .execution-success {
  color:#26724d;
  background:#e7f6ee;
}
.execution-ready { color:#3158a4; background:#e9f0ff; }
.execution-blocked, .execution-pending {
  color:#9a5c12;
  background:#fff2dc;
}
.execution-invalid, .execution-failed {
  color:var(--danger);
  background:#fff0f0;
}
.coownership-group .data-table, .business-group .data-table { margin-top:0; }
.topography-diagnostics-list {
  margin-top:0;
  overflow:hidden;
  background:#fff;
  border:1px solid var(--line);
  border-radius:11px;
}
.topography-diagnostic {
  display:grid;
  grid-template-columns:90px minmax(0,1fr);
  gap:14px;
  padding:13px 15px;
  border-bottom:1px solid #edf0f4;
}
.topography-diagnostic:last-child { border-bottom:0; }
.topography-diagnostic .status {
  font-size:10px;
  font-weight:800;
  text-transform:uppercase;
}
.topography-diagnostic h4 { margin:0 0 4px; font-size:13px; }
.topography-diagnostic p {
  margin:0;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}
.topography-diagnostic small {
  display:block;
  margin-top:5px;
  color:var(--muted);
  font-size:10px;
}
.traverse-details { margin-top:14px; }
@media (max-width:760px) {
  .reading-mode-toolbar { align-items:stretch; flex-direction:column; }
  .reading-mode-actions { align-self:flex-start; }
}
.traverse-detail {
  margin-top:10px;
  padding:0 12px 12px;
  background:#fbfcfe;
  border:1px solid var(--line);
  border-radius:11px;
}
.traverse-detail > summary { padding-left:2px; padding-right:2px; }
.traverse-control-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin:2px 0 14px;
}
.traverse-control-card {
  padding:13px 15px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
}
.traverse-control-card h4, .traverse-subtitle {
  margin:0 0 10px;
  color:var(--ink);
  font:15px Georgia,serif;
}
.traverse-control-card dl { margin:0; }
.traverse-control-card dl div {
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:5px 0;
  border-bottom:1px solid #edf0f4;
}
.traverse-control-card dl div:last-child { border-bottom:0; }
.traverse-control-card dt { color:var(--muted); font-size:11px; }
.traverse-control-card dd { margin:0; color:var(--ink); font-size:11px; font-weight:700; text-align:right; }
.traverse-subtitle { margin-top:15px; }
.property-chip { display:inline-flex; gap:5px; margin:2px 4px 2px 0; padding:4px 7px; color:#495a75; background:#f0f3f8; border-radius:7px; font-size:10px; }
.property-chip b { color:#263650; }
.calculation-link {
  padding:0; color:var(--blue); background:none; border:0; cursor:pointer;
  font:700 12px Inter,system-ui,sans-serif; text-decoration:underline;
  text-decoration-color:transparent; text-underline-offset:3px;
}
.calculation-link:hover, .calculation-link:focus-visible {
  text-decoration-color:currentColor;
}
.calculation-selection {
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  margin:3px 0 12px; padding:12px 14px;
  background:#f3f6ff; border:1px solid #d9e1fb; border-radius:10px;
}
.calculation-selection.hidden { display:none; }
.calculation-selection strong { display:block; margin-bottom:3px; font-size:13px; }
.calculation-selection p { margin:0; color:var(--muted); font-size:11px; }
.calculation-selection button {
  flex:0 0 auto; padding:8px 11px; color:#fff; background:var(--blue);
  border:0; border-radius:8px; cursor:pointer; font-size:11px; font-weight:700;
}
.calculation-selection button:hover { filter:brightness(.94); }
.summary-action {
  margin-left:auto;
  padding:6px 10px;
  border:1px solid #bfd0ee;
  border-radius:7px;
  background:#fff;
  color:#285aa0;
  font-size:11px;
  font-weight:700;
}
.summary-action:hover { background:#eef5ff; transform:none; }
.row-action {
  padding:5px 9px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  color:#285aa0;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
.row-action:hover { background:#eef5ff; transform:none; }
.row-action-primary {
  color:#fff;
  background:var(--blue);
  border-color:var(--blue);
}
.row-action-primary:hover { color:#fff; background:#244b8f; }
.data-table tr.calculation-selected td { background:#f3f6ff; }
.calculation-trace-focus { animation:calculation-trace-focus 3.2s ease-out; }
.traverse-detail.calculation-trace-focus {
  border-color:#7f9ee0;
  box-shadow:0 0 0 4px rgba(61,88,192,.13);
}
tr.calculation-trace-focus td { animation:calculation-trace-cell 3.2s ease-out; }
@keyframes calculation-trace-focus {
  0%,35% { background:#edf2ff; box-shadow:0 0 0 4px rgba(61,88,192,.16); }
  100% { background:#fbfcfe; box-shadow:none; }
}
@keyframes calculation-trace-cell {
  0%,35% { background:#e8efff; }
  100% { background:transparent; }
}

#toast { position:fixed; left:50%; bottom:24px; z-index:20; transform:translate(-50%,20px); opacity:0; pointer-events:none; padding:11px 16px; color:#fff; background:#17233a; border-radius:8px; box-shadow:var(--shadow); transition:.2s ease; font-size:12px; }
#toast.show { opacity:1; transform:translate(-50%,0); }

.import-intro { margin-bottom:14px; color:var(--muted); font-size:12px; }
.import-intro p { margin:4px 0; }
.import-summary { margin:14px 0 8px; padding:10px 12px; border:1px solid #cdd9ef; border-radius:8px; background:#f3f7ff; color:#34527f; font-size:12px; }
.import-preview { max-height:320px; overflow:auto; border-radius:8px; }
.import-preview table { width:100%; border-collapse:collapse; font-size:11px; }
.import-preview th, .import-preview td { padding:7px 9px; border-bottom:1px solid var(--line); text-align:left; }
.import-preview th { position:sticky; top:0; background:#f6f8fb; color:var(--muted); }
.import-dialog .dialog-inline-error { max-height:180px; overflow:auto; }
.import-dialog .dialog-inline-error ul { margin:7px 0 0; padding-left:20px; }
.project-import-sections { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:8px; margin:12px 0; }
.project-import-section { display:flex; gap:9px; align-items:flex-start; padding:10px; border:1px solid var(--line); border-radius:8px; background:#f9fbfd; cursor:pointer; }
.project-import-section input { margin-top:2px; }
.project-import-section span { display:grid; gap:2px; }
.project-import-section small { color:var(--muted); }

@media (max-width: 1150px) {
  .traverse-control-grid { grid-template-columns:1fr; }
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .graph-stage { height: calc(100vh - 320px); }
  .document-layout { grid-template-columns:minmax(0,1fr) 270px; }
}
.calculation-selector-version {
  grid-column: 1 / -1;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf0ff;
  color: #315ee7;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.dialog-inline-error {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid #dc8a8a;
  border-radius: 8px;
  background: #fff1f1;
  color: #922b2b;
  font-size: 0.92rem;
}

.field-invalid {
  border-color: #c53c3c !important;
  box-shadow: 0 0 0 2px rgba(197, 60, 60, 0.14);
}
.unit-validation {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.unit-validation.valid {
  color: #166534;
  background: #dcfce7;
}

.unit-validation.invalid {
  color: #991b1b;
  background: #fee2e2;
  cursor: help;
}

.unit-validation.computed {
  color: #475569;
  background: #e2e8f0;
}

.diagnostic-action {
  margin-top: 8px;
  padding: 5px 9px;
  border: 1px solid #f0b5b5;
  border-radius: 6px;
  background: #fff;
  color: #991b1b;
  font-size: 11px;
  font-weight: 700;
}

.diagnostic-action:hover,
.diagnostic-action:focus-visible {
  background: #fff1f1;
  transform: none;
}

.data-table tr.diagnostic-target td,
table tr.diagnostic-target td {
  background: #fff1c7;
  box-shadow: inset 0 2px #e3a008, inset 0 -2px #e3a008;
  transition: background .2s ease;
}
.server-projects-list {
  display: grid;
  gap: 10px;
  max-height: 55vh;
  overflow: auto;
  padding: 4px 0;
}

.server-project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border-color, #d7e0ea);
  border-radius: 10px;
  background: #f8fafc;
}

.server-project-row > div {
  display: grid;
  gap: 3px;
}

.server-project-row span,
.server-project-row small {
  color: #64748b;
}

.member-create-form {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--border-color, #d7e0ea);
  border-radius: 10px;
  background: #f8fafc;
}

.member-create-actions {
  display: flex;
  justify-content: flex-end;
}

.member-row-actions {
  display: flex !important;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px !important;
}

.member-row-actions select {
  min-width: 135px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 7px 9px;
  background: #fff;
}

.member-inactive {
  opacity: .62;
}
.account-role {
  color: #2563eb;
  font-weight: 700;
}

.role-viewer #newProjectButton,
.role-viewer #saveProjectButton,
.role-viewer #saveAsProjectButton,
.role-viewer #editProjectButton,
.role-viewer #importCoordinatesButton,
.role-viewer #importSdrButton,
.role-viewer #importProjectButton,
.role-viewer #addUnitButton,
.role-viewer #reanalyzeButton,
.role-viewer #sampleButton {
  display: none !important;
}

.role-viewer #sourceEditor {
  background: #f8fafc;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.dashboard-cards article {
  display: grid;
  gap: 5px;
  padding: 18px;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  background: linear-gradient(145deg, #f8fafc, #eef4ff);
}

.dashboard-cards strong { font-size: 1.65rem; color: #1d4ed8; }
.dashboard-cards span { color: #64748b; font-size: .86rem; }
.dashboard-subtitle { margin: 0 0 12px; color: #1e293b; }

#dashboardDialog {
  max-height: min(820px, calc(100vh - 40px));
  overflow: hidden;
}

.dashboard-dialog-shell {
  display: flex;
  flex-direction: column;
  max-height: min(820px, calc(100vh - 40px));
  padding: 20px;
}

#dashboardContent {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

#dashboardContent .server-projects-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

#platformAdminDialog {
  width: min(1080px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
}

#platformAdminContent {
  min-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.platform-dashboard-cards {
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.platform-table-wrap {
  overflow-x: auto;
  border: 1px solid #d6e0ef;
  border-radius: 12px;
}

.platform-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}

.platform-table th,
.platform-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e4eaf3;
  text-align: left;
  vertical-align: middle;
}

.platform-table th {
  color: #64748b;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: #f8fafc;
}

.platform-table td small {
  display: block;
  margin-top: 3px;
  color: #64748b;
}

.status-pill {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}

.status-pill.active { color: #166534; background: #dcfce7; }
.status-pill.inactive { color: #991b1b; background: #fee2e2; }

.subscription-pill { color: #1d4ed8; background: #dbeafe; }
.account-subscription {
  color: #1d4ed8;
  font-weight: 700;
  max-width: 260px;
  line-height: 1.25;
}
.account-subscription.subscription-blocked { color: #b42318; }

body.subscription-readonly .command-primary,
body.subscription-readonly #editProjectButton,
body.subscription-readonly #saveAsProjectButton,
body.subscription-readonly #importCoordinatesButton,
body.subscription-readonly #importSdrButton,
body.subscription-readonly #importProjectButton,
body.subscription-readonly #addUnitButton,
body.subscription-readonly #reanalyzeButton,
body.subscription-readonly #sampleButton,
body.subscription-readonly [data-edit-unit-line],
body.subscription-readonly #editUnitButton,
body.subscription-readonly [data-edit-calculation],
body.subscription-readonly [data-edit-constraint] {
  display: none !important;
}

.platform-subscription-button {
  white-space: nowrap;
  padding: 7px 11px;
}

.subscription-dialog { width: min(620px, calc(100vw - 36px)); }

.subscription-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 8px 0 18px;
}

.subscription-form-grid label {
  display: grid;
  gap: 7px;
  color: #475569;
  font-size: .86rem;
  font-weight: 700;
}

.subscription-form-grid input,
.subscription-form-grid select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
}

@media (max-width: 760px) {
  .platform-dashboard-cards { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .subscription-form-grid { grid-template-columns: 1fr; }
}

.invoice-create-form { padding: 8px 0 22px; border-bottom: 1px solid #e4eaf3; margin-bottom: 18px; }
.invoice-table select { min-width: 115px; padding: 7px; border: 1px solid #cbd5e1; border-radius: 7px; }
.status-pill.invoice-issued { color: #1d4ed8; background: #dbeafe; }
.status-pill.invoice-paid { color: #166534; background: #dcfce7; }
.status-pill.invoice-partiallypaid { color: #854d0e; background: #fef9c3; }
.status-pill.invoice-overdue { color: #92400e; background: #fef3c7; }
.status-pill.invoice-cancelled { color: #475569; background: #e2e8f0; }
.payment-history { margin-top: 8px; }
.payment-history summary { cursor: pointer; color: #315eea; font-size: 12px; font-weight: 700; }
.payment-history small { display: block; margin-top: 4px; white-space: nowrap; }
.invoice-table td:last-child { display: flex; gap: 7px; align-items: center; }
.compact-button { padding: 7px 10px; white-space: nowrap; }
