:root {
  --accent: #5c5c5c;
  --accent-dark: #4a4a4a;
  --accent-soft: #ededed;
  --accent-line: #adadad;
  --accent-rgb: 92 92 92;
  --accent-text: #5c5c5c;
  --accent-tint: #f7f7f7;
  --green: var(--accent);
  --green-dark: var(--accent-dark);
  --mint: var(--accent-soft);
  --ink: #262626;
  --text: #444444;
  --muted: #8a8a8a;
  --line: #dcdcdc;
  --panel: #fafafa;
  --white: #fff;
  --soft: #f2f2f2;
  --shadow: 0 4px 24px #213b3210;
  font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color: var(--text);
  font-size: 12px;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html,body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--app-bg, #f3f3f3);
}
button,input,select,textarea {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background .12s,color .12s;
}
button:hover {
  background: #ececec;
  color: var(--green-dark);
}
button:active {
  background: #e3e3e3;
}
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:disabled {
  opacity: .4;
  cursor: default;
}
button svg,[data-icon] svg {
  flex: none;
  vertical-align: middle;
}
a {
  color: inherit;
  text-decoration: none;
}
input,select,textarea {
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 4px;
  min-width: 0;
}
input,select {
  height: 30px;
  padding: 4px 8px;
}
input[type=checkbox] {
  width: 15px;
  height: 15px;
  accent-color: var(--green);
}
input[type=color] {
  width: 36px;
  padding: 3px;
}
select {
  cursor: pointer;
}
kbd {
  font-family: inherit;
  font-size: 10px;
  color: #969696;
  border: 1px solid #e1e1e1;
  padding: 2px 4px;
  border-radius: 3px;
  background: #fcfdfb;
}
h1,h2,h3,p {
  margin: 0;
}
button [data-icon] {
  display: inline-flex;
}
#app {
  height: var(--app-h, 100dvh);
  display: flex;
  flex-direction: column;
  min-width: 900px;
}
.titlebar {
  height: 53px;
  min-height: 53px;
  display: flex;
  align-items: center;
  padding: 0 18px 0 17px;
  gap: 16px;
  background: #fff;
  border-bottom: 1px solid #eeeeee;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 620;
  letter-spacing: -.7px;
  color: #202020;
}
.brand-mark {
  width: 33px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border-radius: 7px;
}
.brand-sub {
  font-size: 9px;
  letter-spacing: 1.8px;
  font-weight: 650;
  margin-left: 8px;
  color: #8b8b8b;
  vertical-align: middle;
}
.header-divider {
  width: 1px;
  height: 20px;
  background: var(--line);
  margin-left: 7px;
}
.quick-actions {
  display: flex;
  gap: 3px;
}
.quick-actions button {
  width: 29px;
  height: 29px;
  border-radius: 4px;
  color: #818181;
}
.quick-actions svg {
  width: 16px;
  height: 16px;
}
.project-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 12px;
  color: #444444;
}
.project-separator {
  color: #c0c0c0;
}
.project-discipline {
  color: #949494;
}
.saved-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: 1px;
}
.saved-dot.dirty {
  background: #c49c47;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-left: auto;
}
.text-button {
  font-size: 11px;
  color: #939393;
  gap: 6px;
  padding: 6px;
}
.text-button svg {
  width: 16px;
  height: 16px;
}
.export-button {
  height: 29px;
  border: 1px solid #dddddd;
  border-radius: 5px;
  padding: 0 10px;
  color: var(--accent-dark);
  background: #fdfefd;
  font-size: 11px;
}
.export-button svg {
  width: 14px;
  height: 14px;
}
.avatar {
  background: #ebebeb;
  border: 1px solid #e1e1e1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 10px;
  letter-spacing: .4px;
  color: var(--accent-dark);
}
.ribbon-tabs {
  height: 30px;
  min-height: 30px;
  display: flex;
  align-items: stretch;
  gap: 3px;
  background: #fff;
  padding: 0 16px;
  border-bottom: 1px solid #e8e8e8;
}
.ribbon-tabs>button {
  padding: 0 15px;
  font-size: 11px;
  color: #6d6d6d;
  border-bottom: 2px solid transparent;
}
.ribbon-tabs>button.active {
  color: var(--accent-dark);
  font-weight: 650;
  border-bottom-color: var(--accent);
  background: var(--accent-soft);
}
.ribbon-tabs .file-tab {
  padding: 0 17px;
  margin-right: 7px;
  color: var(--accent-dark);
  font-weight: 600;
}
.ribbon-tabs .modify-tab {
  color: var(--accent-dark);
  margin-left: 10px;
}
.ribbon-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.ribbon-right button {
  padding: 3px;
}
.ribbon-right svg {
  width: 14px;
  height: 14px;
  color: #9f9f9f;
}
.project-stage {
  font-size: 8px;
  letter-spacing: 1.25px;
  color: #9e9e9e;
}
.ribbon {
  display: flex;
  align-items: stretch;
  min-height: 68px;
  height: 68px;
  border-bottom: 1px solid #e0e0e0;
  background: linear-gradient(#fdfefb,#f6f6f6);
  padding: 4px 12px 2px;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.ribbon-group {
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e2e2e2;
  padding: 0 13px;
  flex: none;
}
.ribbon-group:first-child {
  padding-left: 0;
}
.ribbon-group:last-child {
  border-right: 0;
}
.ribbon-buttons {
  display: flex;
  align-items: stretch;
  gap: 3px;
  flex: 1;
}
.ribbon-button {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  min-width: 50px;
  height: 58px;
  padding: 4px 7px 3px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 10px;
  color: #5d5d5d;
}
.ribbon-button svg {
  width: 25px;
  height: 25px;
  color: #7c7c7c;
  stroke-width: 1.35;
}
.ribbon-button.active {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent-dark);
}
.ribbon-button.active svg {
  color: var(--accent-text);
}
.ribbon-button .ribbon-arrow {
  font-size: 7px;
  margin-left: 4px;
  color: #858585;
}
.ribbon-group-label {
  height: 19px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #a5a5a5;
  letter-spacing: .15px;
}
.ribbon-small {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: flex-start;
  max-height: 62px;
  justify-content: center;
  gap: 1px;
  padding: 1px 2px;
}
.ribbon-small button {
  justify-content: flex-start;
  height: 20px;
  padding: 2px 6px;
  font-size: 10px;
  gap: 7px;
  border-radius: 3px;
}
.ribbon-small svg {
  width: 16px;
  height: 16px;
  color: #8b8b8b;
}
button[data-action="delete"] svg {
  color: #dc2626 !important;
  stroke: #dc2626 !important;
}
.options-bar {
  height: 30px;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 19px;
  background: #f3f3f3;
  border-bottom: 1px solid #dedede;
  font-size: 10px;
  color: #848484;
}
.tool-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 93px;
  color: var(--accent-dark);
}
.tool-indicator svg {
  width: 15px;
  height: 15px;
}
.tool-indicator strong {
  font-weight: 600;
}
.options-separator {
  height: 15px;
  width: 1px;
  background: #dadada;
}
.options-bar label {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* The contextual Reference must disappear for unrelated tools and selections. */
.options-bar #context-reference-wrap[hidden] { display: none; }
.options-bar select {
  height: 23px;
  font-size: 10px;
  background: #fcfcfc;
  border-color: #dadada;
  min-width: 133px;
  max-width: 255px;
  color: #656565;
  padding: 1px 20px 1px 7px;
}
.options-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 9px;
  color: #949494;
}
.mini-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
.workspace {
  display: grid;
  grid-template-columns: 233px minmax(330px,1fr) 340px;
  min-height: 0;
  flex: 1;
  background: #fff;
}
.panel {
  background: #fafbf8;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.browser-panel {
  border-right: 1px solid #e2e2e2;
}
.panel-title {
  height: 39px;
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid #e7e7e7;
}
.panel-title h2 {
  font-size: 11px;
  font-weight: 600;
  color: #636363;
}
.panel-title button {
  padding: 5px;
  color: #9d9d9d;
}
.panel-title svg {
  width: 13px;
  height: 13px;
}
.browser-search {
  height: 29px;
  margin: 13px 12px 12px;
  border: 1px solid #e2e2e2;
  border-radius: 4px;
  display: flex;
  align-items: center;
  background: #fff;
  padding: 0 7px;
  gap: 6px;
}
.browser-search input {
  border: 0;
  width: 100%;
  padding: 0;
  height: 26px;
  font-size: 10px;
  background: transparent;
  outline: 0;
}
.browser-search input::placeholder {
  color: #aaaaaa;
}
.browser-search svg {
  width: 13px;
  height: 13px;
  color: #a2a2a2;
}
.browser-search kbd {
  border: 0;
  font-size: 12px;
}
.browser-project {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 1px 16px 17px;
}
.project-icon {
  color: #858585;
}
.project-icon svg {
  width: 23px;
  height: 23px;
}
.browser-project strong {
  font-weight: 600;
  font-size: 11px;
  color: #5b5b5b;
  display: block;
}
.browser-project small {
  font-size: 9px;
  color: #a8a8a8;
  display: block;
  margin-top: 4px;
}
.browser-tree {
  flex: 1;
  overflow: auto;
  padding: 0 8px 12px;
}
.browser-tree details {
  margin: 3px 0;
}
.browser-tree summary {
  height: 28px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: #696969;
  padding: 0 8px;
  font-size: 10px;
  font-weight: 550;
  user-select: none;
}
.browser-tree summary::before {
  content: '›';
  font-size: 13px;
  color: #a6a6a6;
  width: 8px;
}
.browser-tree details[open]>summary::before {
  transform: rotate(90deg);
}
.browser-tree summary .count {
  margin-left: auto;
  color: #aaaaaa;
  font-size: 9px;
  font-weight: 400;
}
.browser-tree summary svg {
  width: 14px;
  height: 14px;
  color: #959595;
}
.browser-row {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  min-height: 28px;
  padding: 5px 8px 5px 36px;
  border-radius: 4px;
  position: relative;
  font-size: 10px;
  color: #8a8a8a;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser-row svg {
  width: 13px;
  height: 13px;
  color: #a7a7a7;
}
.browser-row.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 550;
}
.browser-row.active:before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.browser-row.active svg {
  color: var(--accent-text);
}
.browser-section-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: #afafaf;
  margin: 17px 8px 7px;
}
.browser-bottom {
  border-top: 1px solid #e7e7e7;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px;
  padding: 15px 3px 17px;
  flex: none;
}
.tiny-logo {
  color: var(--accent-text);
  border: 1px solid var(--accent-line);
  display: grid;
  place-items: center;
  width: 27px;
  height: 29px;
  border-radius: 6px;
  font-size: 17px;
}
.browser-bottom strong {
  display: block;
  font-size: 9px;
  font-weight: 500;
  color: #929292;
}
.browser-bottom span:not(.tiny-logo) {
  display: block;
  font-size: 8px;
  color: #b4b4b4;
  margin-top: 4px;
}
.center-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  background: #fff;
}
.view-tabs {
  height: 37px;
  min-height: 37px;
  display: flex;
  align-items: stretch;
  background: #f3f3f3;
  border-bottom: 1px solid #e2e2e2;
  overflow-x: auto;
  overflow-y: hidden;
  padding-left: 1px;
}
.view-tab {
  font-size: 10px;
  gap: 7px;
  color: #9a9a9a;
  border-right: 1px solid #e6e6e6;
  border-top: 2px solid transparent;
  min-width: 125px;
  padding: 0 13px;
  flex: none;
}
.view-tab svg {
  width: 13px;
  height: 13px;
  color: #9b9b9b;
}
.view-tab.active {
  background: #fff;
  color: var(--accent-dark);
  border-top-color: var(--accent);
  border-bottom: 1px solid white;
  margin-bottom: -1px;
}
.view-tab.active svg {
  color: var(--accent-text);
}
.view-tab .tab-close {
  font-size: 14px;
  color: #b7b7b7;
  margin-left: 13px;
  line-height: 15px;
  border-radius: 3px;
}
.view-tab .tab-close:hover {
  color: #636363;
  background: #e9e9e9;
}
.add-view {
  min-width: 34px;
  color: #a7a7a7;
}
.add-view svg {
  width: 14px;
  height: 14px;
}
.viewport-header {
  height: 41px;
  min-height: 41px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid #ececec;
  background: #fff;
}
.view-breadcrumb {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  overflow: hidden;
}
.view-breadcrumb>span:first-child {
  font-size: 8px;
  letter-spacing: 1.3px;
  color: #ababab;
}
.breadcrumb-slash {
  font-size: 12px;
  color: #d5d5d5;
}
.view-breadcrumb strong {
  font-size: 10px;
  font-weight: 500;
  color: #828282;
}
.viewport-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.viewport-actions button {
  width: 26px;
  height: 26px;
  color: #a1a1a1;
  border-radius: 3px;
}
.viewport-actions svg {
  width: 15px;
  height: 15px;
}
.viewport-actions button.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.toolbar-divider {
  height: 15px;
  width: 1px;
  background: #e7e7e7;
  margin: 0 5px;
}
.view-area {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  outline: none;
  touch-action: none;
  background: #eaeaea;
}
#gpu-canvas,.fallback-canvas,#overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
#overlay-canvas {
  pointer-events: none;
  z-index: 2;
}
.drawing-view {
  position: absolute;
  inset: 0;
  background: #fff;
}
.drawing-view>svg {
  width: 100%;
  height: 100%;
  display: block;
}
.view-label {
  position: absolute;
  top: 21px;
  left: 23px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #888888;
  font-size: 8px;
  letter-spacing: 1px;
  pointer-events: none;
  z-index: 3;
}
.view-label-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.view-label-divider {
  width: 1px;
  height: 10px;
  background: #cfcfcf;
  margin: 0 2px;
}
#view-detail-label {
  letter-spacing: 0;
  color: #a4a4a4;
  font-size: 9px;
}
.viewcube {
  width: 112px;
  height: 128px;
  position: absolute;
  right: 12px;
  top: 30px;
  z-index: 3;
  user-select: none;
}
.viewcube .vc-scene {
  position: absolute;
  left: 0;
  top: 0;
  width: 112px;
  height: 112px;
  perspective: 420px;
  cursor: grab;
  touch-action: none;
}
.viewcube .vc-world {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}
.viewcube .vc-face {
  position: absolute;
  left: -22px;
  top: -22px;
  width: 44px;
  height: 44px;
  box-sizing: border-box;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  font: 600 9px/1 system-ui, sans-serif;
  letter-spacing: .4px;
  color: #686868;
  background: linear-gradient(145deg, #fcfcfc, #e6e6e6);
  border: 1px solid #bcbcbc;
  cursor: pointer;
}
.viewcube .vc-face.vc-bottom {
  background: #d8d8d8;
  cursor: default;
}
.viewcube .vc-face:not(:disabled):hover {
  background: #ffe6d3;
  color: var(--accent-text);
  border-color: var(--accent);
}
.viewcube .vc-ring {
  position: absolute;
  left: -64px;
  top: -64px;
  width: 128px;
  height: 128px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 9px solid #c9d3c3aa;
  pointer-events: none;
  backface-visibility: hidden;
}
.viewcube .vc-dir {
  position: absolute;
  font: 700 10px/1 system-ui, sans-serif;
  color: #686868;
}
.viewcube .vc-n { left: 50%; top: -8px; transform: translateX(-50%); color: var(--accent-text); }
.viewcube .vc-s { left: 50%; bottom: -8px; transform: translateX(-50%); }
.viewcube .vc-e { right: -8px; top: 50%; transform: translateY(-50%); }
.viewcube .vc-w { left: -8px; top: 50%; transform: translateY(-50%); }
.viewcube .cube-home {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #787878;
  z-index: 2;
}
.viewcube .cube-home:hover {
  color: var(--accent-text);
}
.viewcube .cube-home svg {
  width: 18px;
  height: 18px;
  stroke-width: 1;
}
html.dark-theme .viewcube .vc-face {
  background: linear-gradient(145deg, #2c2c2c, var(--panel));
  border-color: #4a4a4a;
  color: #E5E5E5;
}
html.dark-theme .viewcube .vc-face.vc-bottom {
  background: #151515;
}
html.dark-theme .viewcube .vc-face:not(:disabled):hover {
  background: #3a2a1e;
  color: var(--accent-text);
  border-color: var(--accent);
}
html.dark-theme .viewcube .vc-ring {
  border-color: #3c3c3caa;
}
html.dark-theme .viewcube .vc-dir {
  color: #bdbdbd;
}
html.dark-theme .viewcube .vc-n {
  color: var(--accent-text);
}
html.dark-theme .viewcube .cube-home {
  color: #bdbdbd;
}
.nav-tools {
  position: absolute;
  right: 19px;
  top: 124px;
  background: #f8faf5dd;
  border: 1px solid #d8d8d8;
  border-radius: 5px;
  padding: 5px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 8px #4c614607;
  z-index: 3;
}
.nav-tools button {
  width: 26px;
  height: 29px;
  color: #888888;
  border-radius: 3px;
}
.nav-tools svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.3;
}
.nav-tools>span {
  height: 1px;
  background: #dcdcdc;
  margin: 3px;
}
.model-note {
  position: absolute;
  left: 25px;
  bottom: 23px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  pointer-events: none;
}
.note-rule {
  width: 23px;
  height: 1px;
  background: #a0a0a0;
  margin-bottom: 2px;
}
.model-note strong {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 2px;
  color: #8e8e8e;
}
.model-note>span:last-child {
  font-size: 9px;
  color: #a8a8a8;
}
.view-controls {
  height: 33px;
  min-height: 33px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  background: #fbfbfb;
  border-top: 1px solid #e0e0e0;
}
.controls-left {
  display: flex;
  align-items: center;
  gap: 5px;
}
.view-controls button {
  width: 24px;
  height: 23px;
  color: #969696;
  border-radius: 3px;
}
.view-controls button.active {
  color: var(--accent-text);
}
.view-controls svg {
  width: 14px;
  height: 14px;
}
.view-controls select {
  font-size: 9px;
  height: 23px;
  background: transparent;
  border: 0;
  color: #8b8b8b;
  width: 69px;
  padding-left: 3px;
}
.control-divider {
  width: 1px;
  height: 12px;
  background: #dfdfdf;
  margin: 0 5px;
}
.controls-right {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #aaaaaa;
  font-size: 8px;
}
.engine-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 3px;
  padding: 4px 6px;
  font-size: 8px;
  font-weight: 550;
}
.engine-badge i {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}
.properties-panel {
  border-left: 1px solid #e2e2e2;
}
.properties-content {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.property-hero {
  display: flex;
  gap: 12px;
  margin: 16px 14px;
  align-items: center;
}
.property-hero-icon {
  width: 40px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 5px;
  color: var(--accent-text);
}
.property-hero-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.2;
}
.property-hero h3 {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-dark);
  margin-bottom: 5px;
}
.property-hero p {
  font-size: 9px;
  color: #a7a7a7;
  line-height: 1.5;
}
.property-type {
  margin: 0 14px 16px;
  display: flex;
  gap: 7px;
}
.property-type select {
  width: 100%;
  font-size: 10px;
  color: #868686;
  background: #fff;
  height: 30px;
}
.property-type button {
  flex: none;
  padding: 0 8px;
  font-size: 9px;
  border: 1px solid #dddddd;
  border-radius: 4px;
  color: #828282;
}
.property-section {
  border-top: 1px solid #e4e4e4;
  margin-top: 8px;
  padding-bottom: 8px;
}
.property-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 35px;
  padding: 0 15px;
  color: #868686;
  font-size: 9px;
  font-weight: 600;
}
.property-section-title span:last-child {
  font-size: 12px;
  color: #a8a8a8;
  font-weight: 400;
}
.property-row {
  min-height: 31px;
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 5px;
  align-items: center;
  padding: 3px 14px;
  font-size: 9px;
  color: #a6a6a6;
}
.property-row>label {
  line-height: 1.5;
}
.property-row input:not([type=checkbox]),.property-row select {
  width: 100%;
  height: 25px;
  font-size: 10px;
  border: 1px solid #e4e4e4;
  border-radius: 3px;
  padding: 3px 6px;
  color: #6f6f6f;
  background: #fff;
}
.property-row input[readonly] {
  background: #f2f2f2;
  border-color: transparent;
  color: #939393;
}
.property-row .property-value {
  font-size: 10px;
  color: #7c7c7c;
  line-height: 1.5;
  word-break: break-word;
}
.property-row .monospace {
  font-family: ui-monospace,Consolas,monospace;
  font-size: 8px;
}
.property-actions {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  flex-wrap: wrap;
}
.property-actions button {
  border: 1px solid #dbdbdb;
  border-radius: 4px;
  padding: 6px 9px;
  font-size: 9px;
  color: #868686;
}
.property-actions svg {
  width: 12px;
  height: 12px;
}
.property-note {
  padding: 0 16px 13px;
  line-height: 1.7;
  font-size: 9px;
  color: #a5a5a5;
}
.model-summary {
  margin: 0 13px 13px;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  background: #f6f6f6;
  padding: 13px 11px;
  flex: none;
}
.summary-title {
  font-size: 9px;
  font-weight: 600;
  color: #8a8a8a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.summary-title span:last-child {
  font-size: 8px;
  font-weight: 400;
  color: #aeaeae;
}
.summary-grid {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.summary-stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.summary-stat strong {
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -.4px;
  color: #868686;
}
.summary-stat small {
  font-size: 8px;
  color: #a9a9a9;
}
.summary-foot {
  border-top: 1px solid #e3e3e3;
  margin-top: 13px;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  font-size: 8px;
  color: #a5a5a5;
}
.summary-foot strong {
  font-weight: 500;
  color: #7e7e7e;
}
.statusbar {
  height: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f2f2f2;
  border-top: 1px solid #dddddd;
  padding: 0 13px;
  font-size: 9px;
  color: #939393;
  gap: 15px;
}
.status-message {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}
.status-message>span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-message svg {
  width: 12px;
  height: 12px;
  color: #a0a0a0;
}
.status-right {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
}
.status-toggle {
  font-size: 8px;
  color: #a4a4a4;
  padding: 3px 5px;
  border-radius: 3px;
  gap: 4px;
}
.status-toggle svg {
  width: 11px;
  height: 11px;
}
.status-toggle.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
}
.status-divider {
  width: 1px;
  height: 11px;
  background: #dbdbdb;
}
.health-button {
  padding: 0;
  font-size: 8px;
  color: #989898;
  gap: 5px;
}
#health-dot {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}
#coordinates {
  font-size: 8px;
  word-spacing: 4px;
  font-variant-numeric: tabular-nums;
}
.sketch-help {
  position: absolute;
  bottom: calc(20px + var(--qat-lift, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 12px;
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  background: #fff9f6f5;
  box-shadow: 0 5px 24px #3d241d1c;
  display: flex;
  align-items: center;
  gap: 13px;
  white-space: nowrap;
  color: var(--accent-dark);
  z-index: 4;
  font-size: 10px;
}
.sketch-help button {
  font-size: 10px;
  padding: 5px;
  border-radius: 3px;
}
.sketch-help button:first-of-type {
  background: var(--accent);
  color: white;
  padding: 6px 9px;
}
.sketch-help kbd {
  font-size: 8px;
  background: transparent;
  color: inherit;
  border-color: var(--accent-line);
}
.selection-badge {
  position: absolute;
  left: 20px;
  bottom: calc(22px + var(--qat-lift, 0px));
  z-index: 4;
  background: #fff;
  border: 1px solid var(--accent-line);
  box-shadow: var(--shadow);
  border-radius: 4px;
  color: var(--accent-dark);
  padding: 8px 12px;
  font-size: 10px;
}
.schedule-view {
  position: absolute;
  inset: 0;
  background: #fff;
  overflow: auto;
  padding: 24px;
}
.schedule-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.schedule-heading h2 {
  font-size: 19px;
  font-weight: 500;
  color: var(--accent-dark);
}
.schedule-heading p {
  font-size: 11px;
  color: #989898;
  margin-top: 8px;
}
.schedule-heading button {
  padding: 8px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  color: var(--accent-dark);
  font-size: 10px;
}
.schedule-heading svg {
  width: 15px;
  height: 15px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.data-table th {
  text-align: left;
  padding: 11px 9px;
  background: #f3f3f3;
  border-bottom: 1px solid #e0e0e0;
  color: #898989;
  font-weight: 500;
  white-space: nowrap;
  font-size: 10px;
}
.data-table td {
  border-bottom: 1px solid #efefef;
  padding: 10px 9px;
  color: #6b6b6b;
  white-space: nowrap;
}
.data-table tr {
  cursor: pointer;
}
.data-table tr:hover td {
  background: #f6f6f6;
}
.data-table tr.selected td {
  background: var(--accent-soft);
}
.data-table input {
  width: 100%;
  min-width: 90px;
  border: 1px solid transparent;
  font-size: 10px;
  padding: 2px 4px;
  height: 24px;
  background: transparent;
}
.data-table input:hover,.data-table input:focus {
  background: #fff;
  border-color: #d4d4d4;
}
.schedule-footer {
  padding: 17px 8px;
  color: #959595;
  font-size: 10px;
  display: flex;
  gap: 28px;
}
.sheet-view {
  position: absolute;
  inset: 0;
  overflow: hidden;   /* the sheet is panned / zoomed like any view (wheel, Pan, Fit); viewports may sit off the paper */
  touch-action: none;   /* one finger / pen drags a viewport; two fingers pinch-zoom (handled by the canvas), never native scrolling */
  background: #e9e9e9;
  padding: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.sheet-view>svg {
  overflow: visible;   /* a viewport dragged off the paper stays visible */
  width: min(100%,1400px);
  height: auto;
  box-shadow: 0 5px 20px #2a442414;
  background: #fff;
  flex: none;
}
.sheet-view .sheet-actions {
  position: sticky;
  right: 0;
  top: 0;
}
dialog {
  border: 1px solid #dddddd;
  border-radius: 9px;
  box-shadow: 0 16px 80px #203c2940;
  padding: 0;
  width: min(620px,calc(100vw - 40px));
  max-height: 85vh;
  color: #646464;
  background: #fcfcfc;
}
dialog::backdrop {
  background: #1b342a3d;
  backdrop-filter: blur(3px);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 21px;
  border-bottom: 1px solid #e7e7e7;
  background: #f8f8f8;
}
.modal-header h2 {
  font-size: 16px;
  font-weight: 500;
  color: #585858;
}
.modal-header button {
  color: #a3a3a3;
}
.modal-header svg {
  width: 17px;
  height: 17px;
}
#modal-body {
  padding: 22px;
  overflow: auto;
  max-height: calc(85vh - 70px);
}
.modal-intro {
  font-size: 12px;
  line-height: 1.8;
  color: #959595;
  margin-bottom: 19px;
}
.dialog-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.dialog-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  color: #929292;
}
.dialog-form label.full {
  grid-column: 1/-1;
}
.dialog-form input,.dialog-form select {
  height: 35px;
  font-size: 12px;
  color: #626262;
}
.dialog-form textarea {
  min-height: 120px;
  padding: 10px;
  font-family: ui-monospace,monospace;
  font-size: 11px;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}
.dialog-footer button {
  padding: 9px 14px;
  background: #efefef;
  border: 1px solid #dcdcdc;
  border-radius: 4px;
  color: #848484;
  font-size: 11px;
}
.dialog-footer button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.dialog-footer button.danger {
  background: #ad6049;
  color: white;
  border-color: #ad6049;
}
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.menu-card {
  display: flex;
  align-items: flex-start;
  text-align: left;
  gap: 12px;
  white-space: normal;
  border: 1px solid #e3e3e3;
  border-radius: 5px;
  padding: 16px;
  background: #fff;
}
.menu-card svg {
  color: #9c9c9c;
  width: 25px;
  height: 25px;
}
.menu-card strong {
  display: block;
  font-size: 12px;
  color: #707070;
  font-weight: 550;
  margin-bottom: 6px;
}
.menu-card small {
  font-size: 10px;
  line-height: 1.6;
  color: #a5a5a5;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 22px;
}
.shortcut-grid>div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #e8e8e8;
  font-size: 11px;
  color: #8e8e8e;
}
.help-section {
  font-size: 12px;
  font-weight: 600;
  color: #7c7c7c;
  margin: 18px 0 8px;
}
.diagnostic-line {
  font-size: 11px;
  line-height: 1.8;
  padding: 9px;
  border-bottom: 1px solid #e6e6e6;
  color: #868686;
}
.diagnostic-line strong {
  color: #6c6c6c;
  font-weight: 550;
}
.checkbox-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 6px 0;
}
.checkbox-list label {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: #848484;
}
#toasts {
  position: fixed;
  bottom: var(--qat-toast-bottom, 46px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  max-width: min(600px,90vw);
  background: #3f3f3f;
  color: #f6f6f6;
  border: 1px solid #c4c4c4;
  border-radius: 5px;
  padding: 12px 18px;
  font-size: 11px;
  line-height: 1.6;
  box-shadow: 0 5px 30px #1f3a2020;
  animation: toast-in .15s ease-out;
}
.toast.error {
  background: #8b5547;
  color: #fff7ef;
  border-color: #d8ad9a;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
[hidden] {
  display: none!important;
}
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-thumb {
  background: #d6d6d6;
  border-radius: 3px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
@media(min-width:1700px) {
  .workspace {
    grid-template-columns: 250px minmax(330px,1fr) 300px;
  }
  .ribbon-button {
    min-width: 62px;
  }
  .ribbon-group {
    padding: 0 18px;
  }
  .property-row {
    grid-template-columns: 108px 1fr;
  }
}
@media(max-width:1200px) {
  .workspace {
    grid-template-columns: 205px minmax(300px,1fr) 260px;
  }
  .ribbon-button {
    min-width: 45px;
    padding: 4px 6px;
  }
  .ribbon-group {
    padding: 0 8px;
  }
  .project-stage {
    display: none;
  }
  .project-title {
    position: static;
    transform: none;
    margin-left: 5px;
  }
  .project-discipline,.project-separator {
    display: none;
  }
  .property-row {
    grid-template-columns: 82px 1fr;
    padding-left: 11px;
    padding-right: 11px;
  }
  .ribbon-tabs>button {
    padding: 0 11px;
  }
  .model-summary {
    margin: 0 9px 9px;
  }
  .view-label {
    left: 15px;
    font-size: 7px;
  }
  .controls-right {
    gap: 6px;
  }
  #render-stats {
    font-size: 7px;
  }
}
@media(max-width:960px) {
  #app {
    min-width: 650px;
  }
  .workspace {
    grid-template-columns: 180px minmax(350px,1fr);
  }
  .properties-panel {
    display: none;
  }
  .ribbon-tabs {
    padding: 0 6px;
  }
  .ribbon-tabs>button {
    padding: 0 9px;
  }
  .brand-sub,.header-divider,.text-button,.project-stage {
    display: none;
  }
  .titlebar {
    padding: 0 11px;
    gap: 9px;
  }
  .brand {
    font-size: 20px;
  }
  .quick-actions {
    gap: 0;
  }
  .options-right {
    display: none;
  }
  .browser-row {
    font-size: 9px;
    padding-left: 30px;
  }
  .status-right {
    gap: 4px;
  }
  #coordinates {
    display: none;
  }
  .statusbar {
    font-size: 8px;
  }
  .status-message {
    max-width: 50%;
  }
  .ribbon-right {
    display: none;
  }
  .ribbon {
    padding-left: 8px;
  }
  .options-bar {
    padding-left: 11px;
    gap: 10px;
  }
  .viewcube {
    right: 12px;
  }
  .project-title {
    font-size: 10px;
  }
}
@media(max-height:740px) {
  .model-summary {
    padding: 10px;
  }
  .summary-title {
    margin-bottom: 8px;
  }
  .summary-stat strong {
    font-size: 18px;
  }
  .summary-foot {
    margin-top: 8px;
    padding-top: 8px;
  }
  .browser-bottom {
    padding: 9px 3px;
  }
  .property-hero {
    margin: 13px;
  }
  .model-note {
    bottom: 17px;
  }
  .viewcube {
    top: 27px;
  }
}
@media print {
  body {
    overflow: visible;
    background: white;
  }
  #app,#modal,#toasts {
    display: none;
  }
  .print-sheet {
    display: block!important;
    width: 100%;
  }
  .print-sheet svg {
    width: 100%;
    height: auto;
  }
  @page {
    size: A3 landscape;
    margin: 0;
  }
}

/* ==========================================================================
   AH-Revora Dark Mode Theme
   ========================================================================== */
.theme-toggle-btn {
  width: 29px;
  height: 29px;
  border-radius: 4px;
  color: #818181;
  padding: 0;
}
.theme-toggle-btn:hover {
  background: #ececec;
  color: var(--green-dark);
}
.theme-toggle-btn svg {
  width: 16px;
  height: 16px;
}

html.dark-theme {
  --accent: #8f8f8f;
  --accent-dark: #666666;
  --accent-soft: #353535;
  --accent-line: #565656;
  --accent-rgb: 143 143 143;
  --accent-text: #8f8f8f;
  --accent-tint: #202020;
  --green: var(--accent);
  --green-dark: var(--accent-dark);
  --mint: var(--accent-soft);
  --ink: #FFFFFF;
  --text: #E5E5E5;
  --muted: #9E9E9E;
  --line: #353535;
  --panel: #1C1C1C;
  --white: #202020;
  --soft: #141414;
  --shadow: 0 4px 24px #000000aa;
}

html.dark-theme,
html.dark-theme body {
  background: var(--soft);
  color: var(--text);
}

html.dark-theme button:hover {
  background: #2a2a2a;
  color: #FFFFFF;
}
html.dark-theme button:active {
  background: #333333;
}
html.dark-theme button:focus-visible,
html.dark-theme input:focus-visible,
html.dark-theme select:focus-visible,
html.dark-theme summary:focus-visible {
  outline-color: var(--accent);
}

html.dark-theme input,
html.dark-theme select,
html.dark-theme textarea {
  background: var(--panel);
  border-color: var(--line);
  color: #E5E5E5;
}
html.dark-theme input::placeholder {
  color: #737373;
}
html.dark-theme kbd {
  background: var(--soft);
  border-color: var(--line);
  color: #9E9E9E;
}

/* Header & Titlebar */
html.dark-theme .titlebar {
  background: #202020;
  border-bottom: 1px solid #353535;
}
html.dark-theme .brand {
  color: #E5E5E5;
}
html.dark-theme .brand-mark {
  background: var(--accent);
  color: #fff;
}
html.dark-theme .brand-sub {
  color: #9E9E9E;
}
html.dark-theme .header-divider {
  background: var(--line);
}
html.dark-theme .quick-actions button {
  color: #9E9E9E;
}
html.dark-theme .quick-actions button:hover {
  background: #2a2a2a;
  color: var(--accent-text);
}
html.dark-theme .project-title {
  color: #E5E5E5;
}
html.dark-theme .project-separator {
  color: #555555;
}
html.dark-theme .project-discipline {
  color: #9E9E9E;
}
html.dark-theme .saved-dot {
  background: var(--accent);
}
html.dark-theme .text-button {
  color: #BDBDBD;
}
html.dark-theme .text-button:hover {
  background: #2a2a2a;
  color: #FFFFFF;
}
html.dark-theme .theme-toggle-btn {
  color: var(--accent-text);
}
html.dark-theme .theme-toggle-btn:hover {
  background: #2a2a2a;
  color: #ff9a59;
}
html.dark-theme .export-button {
  background: var(--white);
  border-color: var(--line);
  color: #E5E5E5;
}
html.dark-theme .export-button:hover {
  background: #2a2a2a;
  color: var(--accent-text);
  border-color: var(--accent);
}
html.dark-theme .avatar {
  background: #262626;
  border-color: var(--line);
  color: var(--accent-text);
}

/* Ribbon Tabs & Ribbon */
html.dark-theme .ribbon-tabs {
  background: #202020;
  border-bottom: 1px solid #353535;
}
html.dark-theme .ribbon-tabs>button {
  color: #9E9E9E;
}
html.dark-theme .ribbon-tabs>button:hover {
  background: #2a2a2a;
  color: #FFFFFF;
}
html.dark-theme .ribbon-tabs>button.active {
  background: var(--panel);
  color: var(--accent-text);
  border-bottom-color: var(--accent);
}
html.dark-theme .ribbon-tabs .file-tab {
  color: var(--accent-text);
}
html.dark-theme .ribbon-tabs .modify-tab {
  color: var(--accent-text);
}
html.dark-theme .project-stage {
  color: #757575;
}
html.dark-theme .ribbon-right svg {
  color: #9E9E9E;
}
html.dark-theme .ribbon {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
html.dark-theme .ribbon-group {
  border-right: 1px solid var(--line);
}
html.dark-theme .ribbon-button {
  color: #E5E5E5;
}
html.dark-theme .ribbon-button svg {
  color: #BDBDBD;
}
html.dark-theme .ribbon-button:hover {
  background: #2a2a2a;
  color: #FFFFFF;
}
html.dark-theme .ribbon-button:hover svg {
  color: var(--accent-text);
}
html.dark-theme .ribbon-button.active {
  background: rgb(var(--accent-rgb) / 0.16);
  border-color: rgb(var(--accent-rgb) / 0.45);
  color: var(--accent-text);
}
html.dark-theme .ribbon-button.active svg {
  color: var(--accent-text);
}
html.dark-theme .ribbon-button .ribbon-arrow {
  color: #757575;
}
html.dark-theme .ribbon-group-label {
  color: #757575;
}
html.dark-theme .ribbon-small svg {
  color: #BDBDBD;
}
html.dark-theme .ribbon-small button:hover {
  background: #2a2a2a;
  color: #FFFFFF;
}
html.dark-theme .ribbon-small button:hover svg {
  color: var(--accent-text);
}

/* Options Bar */
html.dark-theme .options-bar {
  background: #202020;
  border-bottom: 1px solid #353535;
  color: #9E9E9E;
}
html.dark-theme .tool-indicator {
  color: var(--accent-text);
}
html.dark-theme .tool-indicator svg {
  color: var(--accent-text);
}
html.dark-theme .options-separator {
  background: var(--line);
}
html.dark-theme .options-bar select {
  background: var(--panel);
  border-color: var(--line);
  color: #E5E5E5;
}
html.dark-theme .options-right {
  color: #757575;
}
html.dark-theme .mini-dot {
  background: var(--accent);
}

/* Workspace & Project Browser */
html.dark-theme .workspace {
  background: #141414;
}
html.dark-theme .panel {
  background: var(--panel);
}
html.dark-theme .browser-panel {
  border-right: 1px solid var(--line);
}
html.dark-theme .panel-title {
  border-bottom: 1px solid var(--line);
}
html.dark-theme .panel-title h2 {
  color: #E5E5E5;
}
html.dark-theme .panel-title button {
  color: #9E9E9E;
}
html.dark-theme .panel-title button:hover {
  background: #2a2a2a;
  color: var(--accent-text);
}
html.dark-theme .browser-search {
  background: var(--soft);
  border-color: var(--line);
}
html.dark-theme .browser-search input {
  color: #E5E5E5;
}
html.dark-theme .browser-search svg {
  color: #757575;
}
html.dark-theme .browser-search kbd {
  background: var(--panel);
  border-color: var(--line);
  color: #9E9E9E;
}
html.dark-theme .project-icon {
  color: var(--accent-text);
}
html.dark-theme .browser-project strong {
  color: #E5E5E5;
}
html.dark-theme .browser-project small {
  color: #9E9E9E;
}
html.dark-theme .browser-tree summary {
  color: #BDBDBD;
}
html.dark-theme .browser-tree summary:hover {
  background: #242424;
  color: #FFFFFF;
}
html.dark-theme .browser-tree summary::before {
  color: #757575;
}
html.dark-theme .browser-tree summary .count {
  color: #757575;
}
html.dark-theme .browser-tree summary svg {
  color: #9E9E9E;
}
html.dark-theme .browser-row {
  color: #BDBDBD;
}
html.dark-theme .browser-row:hover {
  background: #242424;
  color: #FFFFFF;
}
html.dark-theme .browser-row svg {
  color: #9E9E9E;
}
html.dark-theme .browser-row.active {
  background: rgb(var(--accent-rgb) / 0.16);
  color: var(--accent-text);
}
html.dark-theme .browser-row.active:before {
  background: var(--accent);
}
html.dark-theme .browser-row.active svg {
  color: var(--accent-text);
}
html.dark-theme .browser-section-label {
  color: #757575;
}
html.dark-theme .browser-bottom {
  border-top: 1px solid var(--line);
}
html.dark-theme .tiny-logo {
  color: var(--accent-text);
  border-color: var(--accent);
  background: rgb(var(--accent-rgb) / 0.15);
}
html.dark-theme .browser-bottom strong {
  color: #E5E5E5;
}
html.dark-theme .browser-bottom span:not(.tiny-logo) {
  color: #757575;
}

/* Center Panel & Viewports */
html.dark-theme .center-panel {
  background: #141414;
}
html.dark-theme .view-tabs {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
html.dark-theme .view-tab {
  color: #9E9E9E;
  border-right: 1px solid var(--line);
}
html.dark-theme .view-tab:hover {
  background: #262626;
  color: #FFFFFF;
}
html.dark-theme .view-tab svg {
  color: #9E9E9E;
}
html.dark-theme .view-tab.active {
  background: var(--soft);
  color: var(--accent-text);
  border-top-color: var(--accent);
  border-bottom: 1px solid var(--soft);
}
html.dark-theme .view-tab.active svg {
  color: var(--accent-text);
}
html.dark-theme .view-tab .tab-close {
  color: #757575;
}
html.dark-theme .view-tab .tab-close:hover {
  background: #2a2a2a;
  color: #FFFFFF;
}
html.dark-theme .add-view {
  color: #9E9E9E;
}
html.dark-theme .add-view:hover {
  background: #262626;
  color: var(--accent-text);
}
html.dark-theme .viewport-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
html.dark-theme .view-breadcrumb>span:first-child {
  color: #757575;
}
html.dark-theme .breadcrumb-slash {
  color: #454545;
}
html.dark-theme .view-breadcrumb strong {
  color: #E5E5E5;
}
html.dark-theme .viewport-actions button {
  color: #9E9E9E;
}
html.dark-theme .viewport-actions button:hover {
  background: #2a2a2a;
  color: var(--accent-text);
}
html.dark-theme .viewport-actions button.active {
  background: rgb(var(--accent-rgb) / 0.16);
  color: var(--accent-text);
}
html.dark-theme .toolbar-divider {
  background: var(--line);
}

/* 3D & 2D Drawing Workspace - Exact #141414 CAD Canvas */
html.canvas-dark .view-area {
  background: #141414 !important;
}
html.canvas-dark #gpu-canvas,
html.canvas-dark .fallback-canvas {
  background: #141414 !important;
}
html.canvas-dark #overlay-canvas {
  background: transparent !important;
  pointer-events: none;
}

/* Floating View HUD & Overlays */
html.dark-theme .view-label {
  color: #9E9E9E;
}
html.dark-theme .view-label-dot {
  background: var(--accent);
}
html.dark-theme .view-label-divider {
  background: var(--line);
}
html.dark-theme #view-detail-label {
  color: #757575;
}
html.dark-theme .nav-tools {
  background: #1C1C1Cf2;
  border-color: var(--line);
}
html.dark-theme .nav-tools button {
  color: #BDBDBD;
}
html.dark-theme .nav-tools button:hover {
  background: #2a2a2a;
  color: var(--accent-text);
}
html.dark-theme .nav-tools>span {
  background: var(--line);
}
html.dark-theme .model-note strong {
  color: #BDBDBD;
}
html.dark-theme .model-note>span:last-child {
  color: #757575;
}
html.dark-theme .note-rule {
  background: var(--line);
}

/* View Controls & Statusbar */
html.dark-theme .view-controls {
  background: #202020;
  border-top: 1px solid #353535;
}
html.dark-theme .view-controls button {
  color: #9E9E9E;
}
html.dark-theme .view-controls button:hover {
  background: #2a2a2a;
  color: #FFFFFF;
}
html.dark-theme .view-controls button.active {
  color: var(--accent-text);
}
html.dark-theme .view-controls select {
  background: var(--panel);
  border-color: var(--line);
  color: #E5E5E5;
}
html.dark-theme .control-divider {
  background: var(--line);
}
html.dark-theme .controls-right {
  color: #757575;
}
html.dark-theme .engine-badge {
  background: rgb(var(--accent-rgb) / 0.15);
  color: var(--accent-text);
}
html.dark-theme .engine-badge i {
  background: var(--accent);
}
html.dark-theme .statusbar {
  background: var(--white);
  border-top: 1px solid var(--line);
  color: #9E9E9E;
}
html.dark-theme .status-message svg {
  color: #9E9E9E;
}
html.dark-theme .status-toggle {
  color: #9E9E9E;
}
html.dark-theme .status-toggle:hover {
  background: #2a2a2a;
  color: #FFFFFF;
}
html.dark-theme .status-toggle.active {
  color: var(--accent-text);
  background: rgb(var(--accent-rgb) / 0.16);
}
html.dark-theme .status-divider {
  background: var(--line);
}
html.dark-theme .health-button {
  color: #BDBDBD;
}
html.dark-theme #health-dot {
  background: var(--accent);
}

/* Properties Panel */
html.dark-theme .properties-panel {
  background: #1C1C1C;
  border-left: 1px solid #353535;
}
html.dark-theme .property-hero-icon {
  background: #242424;
  border-color: var(--line);
  color: var(--accent-text);
}
html.dark-theme .property-hero h3 {
  color: #E5E5E5;
}
html.dark-theme .property-hero p {
  color: #9E9E9E;
}
html.dark-theme .property-type select {
  background: #242424;
  border-color: var(--line);
  color: #E5E5E5;
}
html.dark-theme .property-type button {
  background: #242424;
  border-color: var(--line);
  color: #BDBDBD;
}
html.dark-theme .property-type button:hover {
  background: #2e2e2e;
  color: var(--accent-text);
}
html.dark-theme .property-section {
  border-top: 1px solid var(--line);
}
html.dark-theme .property-section-title {
  color: #E5E5E5;
}
html.dark-theme .property-section-title span:last-child {
  color: #757575;
}
html.dark-theme .property-row {
  color: #9E9E9E;
}
html.dark-theme .property-row input:not([type=checkbox]),
html.dark-theme .property-row select {
  background: #242424;
  border-color: var(--line);
  color: #E5E5E5;
}
html.dark-theme .property-row input[readonly] {
  background: #181818;
  border-color: transparent;
  color: #757575;
}
html.dark-theme .property-row .property-value {
  color: #E5E5E5;
}
html.dark-theme .property-actions button {
  background: #242424;
  border-color: var(--line);
  color: #BDBDBD;
}
html.dark-theme .property-actions button:hover {
  background: #2e2e2e;
  color: var(--accent-text);
}
html.dark-theme .property-note {
  color: #757575;
}
html.dark-theme .model-summary {
  background: #222222;
  border-color: var(--line);
}
html.dark-theme .summary-title {
  color: #E5E5E5;
}
html.dark-theme .summary-title span:last-child {
  color: #757575;
}
html.dark-theme .summary-stat strong {
  color: var(--accent-text);
}
html.dark-theme .summary-stat small {
  color: #9E9E9E;
}
html.dark-theme .summary-foot {
  border-top: 1px solid var(--line);
  color: #9E9E9E;
}
html.dark-theme .summary-foot strong {
  color: var(--accent-text);
}

/* Overlays & Badges */
html.dark-theme .selection-badge {
  background: #1C1C1C;
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 4px 20px #000000aa;
}
html.dark-theme .sketch-help {
  background: #1C1C1Cf8;
  border-color: var(--line);
  color: #E5E5E5;
  box-shadow: 0 5px 24px #000000aa;
}
html.dark-theme .sketch-help button:first-of-type {
  background: var(--accent);
  color: #fff;
}
html.dark-theme .sketch-help kbd {
  border-color: var(--line);
  color: inherit;
}

/* Dialogs & Modals */
html.dark-theme dialog {
  background: #1C1C1C;
  border-color: #353535;
  color: #E5E5E5;
  box-shadow: 0 16px 80px #000000cc;
}
html.dark-theme dialog::backdrop {
  background: #000000aa;
}
html.dark-theme .modal-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
html.dark-theme .modal-header h2 {
  color: #E5E5E5;
}
html.dark-theme .modal-header button {
  color: #9E9E9E;
}
html.dark-theme .modal-header button:hover {
  background: #2a2a2a;
  color: #FFFFFF;
}
html.dark-theme .modal-intro {
  color: #9E9E9E;
}
html.dark-theme .dialog-form label {
  color: #BDBDBD;
}
html.dark-theme .dialog-form input,
html.dark-theme .dialog-form select,
html.dark-theme .dialog-form textarea {
  background: #242424;
  border-color: var(--line);
  color: #E5E5E5;
}
html.dark-theme .dialog-footer button {
  background: #242424;
  border-color: var(--line);
  color: #BDBDBD;
}
html.dark-theme .dialog-footer button:hover {
  background: #2e2e2e;
  color: #FFFFFF;
}
html.dark-theme .dialog-footer button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
html.dark-theme .dialog-footer button.primary:hover {
  background: var(--accent-dark);
}
html.dark-theme .menu-card {
  background: #222222;
  border-color: var(--line);
}
html.dark-theme .menu-card:hover {
  background: #292929;
  border-color: var(--accent);
}
html.dark-theme .menu-card svg {
  color: var(--accent-text);
}
html.dark-theme .menu-card strong {
  color: #E5E5E5;
}
html.dark-theme .menu-card small {
  color: #9E9E9E;
}
html.dark-theme .shortcut-grid>div {
  border-bottom: 1px solid var(--line);
  color: #BDBDBD;
}
html.dark-theme .help-section {
  color: var(--accent-text);
}
html.dark-theme .diagnostic-line {
  border-bottom: 1px solid var(--line);
  color: #BDBDBD;
}
html.dark-theme .diagnostic-line strong {
  color: var(--accent-text);
}
html.dark-theme .checkbox-list label {
  color: #BDBDBD;
}

/* Schedules & Tables */
html.dark-theme .schedule-view {
  background: #141414;
}
html.dark-theme .schedule-heading h2 {
  color: #E5E5E5;
}
html.dark-theme .schedule-heading p {
  color: #9E9E9E;
}
html.dark-theme .schedule-heading button {
  background: var(--white);
  border-color: var(--line);
  color: #E5E5E5;
}
html.dark-theme .schedule-heading button:hover {
  background: #2a2a2a;
  color: var(--accent-text);
}
html.dark-theme .data-table th {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  color: #BDBDBD;
}
html.dark-theme .data-table td {
  border-bottom: 1px solid #282828;
  color: #E5E5E5;
}
html.dark-theme .data-table tr:hover td {
  background: var(--white);
}
html.dark-theme .data-table tr.selected td {
  background: rgb(var(--accent-rgb) / 0.18);
  color: #FFFFFF;
}
html.dark-theme .data-table input:hover,
html.dark-theme .data-table input:focus {
  background: #242424;
  border-color: var(--accent);
  color: #FFFFFF;
}
html.dark-theme .schedule-footer {
  color: #9E9E9E;
}

/* ==========================================================================
   CAD / Drafting Drawing Board in Dark Mode (#141414 Canvas & Crisp Lines)
   ========================================================================== */
html.canvas-dark .drawing-view,
html.canvas-dark .drawing-view svg {
  background: #141414 !important;
}
html.canvas-dark .drawing-view svg rect.drawing-background,
html.canvas-dark .drawing-view svg rect[width="100%"],
html.canvas-dark .drawing-view svg > rect:first-of-type,
html.canvas-dark .drawing-view > svg > rect {
  fill: #141414 !important;
}

/* Floor Plan: Grid Lines - Subtle dark gray */
html.canvas-dark .drawing-view svg line[stroke="#edf0ee"] {
  stroke: #252525 !important;
}

/* Floor Plan: Slabs */
html.canvas-dark .drawing-view svg polygon[fill="#f5f5f0"] {
  fill: #1a1a1a !important;
  stroke: #353535 !important;
}
html.canvas-dark .drawing-view svg polygon[fill="#cdeadd"],
html.canvas-dark .drawing-view svg polygon[fill="#fae2d5"] {
  fill: rgba(232, 121, 50, 0.22) !important;
  stroke: #E87932 !important;
}

/* Floor Plan: Walls - Deep fill with crisp white architectural outlines */
/* Wall fills must NEVER draw an individual outline. Those old per-wall
   white strokes caused visible T/L dividers even after geometric union.
   Only .joined-wall-outlines draws the combined external silhouette. */
html.canvas-dark .drawing-view svg polygon[fill="#c2c6bf"] {
  fill: #262626 !important;
  stroke: none !important;
  stroke-width: 0 !important;
}
html.canvas-dark .drawing-view svg .joined-wall-outlines line {
  stroke: #E5E5E5 !important;
  stroke-width: 1.5px !important;
}
html.canvas-dark .drawing-view svg polygon[fill="#9fcebb"],
html.canvas-dark .drawing-view svg polygon[fill="#fbdcd0"] {
  fill: rgba(232, 121, 50, 0.25) !important;
  stroke: #E87932 !important;
  stroke-width: 2px !important;
}
html.canvas-dark .drawing-view svg polygon[stroke="#566367"] {
  stroke: #E5E5E5 !important;
}
html.canvas-dark .drawing-view svg polygon[stroke="#128767"],
html.canvas-dark .drawing-view svg polygon[stroke="var(--accent)"] {
  stroke: #E87932 !important;
}/* Door and Window Openings in Walls */
html.canvas-dark .drawing-view svg polygon[fill="#fff"],
/* Door and Window Openings in Walls */
html.canvas-dark .drawing-view svg polygon[fill="#ffffff"] {
  fill: #141414 !important;
}
html.canvas-dark .drawing-view svg line[stroke="#566367"] {
  stroke: #E5E5E5 !important;
}
html.canvas-dark .drawing-view svg line[stroke="#739296"] {
  stroke: #79d7e3 !important;
}
html.canvas-dark .drawing-view svg line[stroke="#128767"],
html.canvas-dark .drawing-view svg line[stroke="var(--accent)"] {
  stroke: #E87932 !important;
}
html.canvas-dark .drawing-view svg path[stroke="#98a6a6"] {
  stroke: #E5E5E5 !important;
}
html.canvas-dark .drawing-view svg path[stroke="#128767"],
html.canvas-dark .drawing-view svg path[stroke="var(--accent)"] {
  stroke: #E87932 !important;
}

/* Dimensions: Crisp white lines and dark text backgrounds */
html.canvas-dark .drawing-view svg line[stroke="#82928e"] {
  stroke: #E5E5E5 !important;
}html.canvas-dark .drawing-view svg g[transform] rect[fill="#fff"],
html.canvas-dark .drawing-view svg g[transform] rect[fill="#ffffff"] {
  fill: #141414 !important;
}

/* Structural Grids */
html.canvas-dark .drawing-view svg line[stroke="#b0bfba"] {
  stroke: #555555 !important;
}html.canvas-dark .drawing-view svg circle[fill="#fff"],
html.canvas-dark .drawing-view svg circle[fill="#ffffff"] {
  fill: #1C1C1C !important;
  stroke: #E5E5E5 !important;
}
html.canvas-dark .drawing-view svg circle[stroke="#128767"],
html.canvas-dark .drawing-view svg circle[stroke="var(--accent)"] {
  stroke: #E87932 !important;
}

/* Texts across 2D Drawings (Rooms, Dimensions, Grids, Sections) */
html.canvas-dark .drawing-view svg text {
  fill: #E5E5E5 !important;
}
html.canvas-dark .drawing-view svg text[fill="#7b898a"] {
  fill: #9E9E9E !important;
}
html.canvas-dark .drawing-view svg text[fill="#6c8076"] {
  fill: #E5E5E5 !important;
}
html.canvas-dark .drawing-view svg text[fill="#a46d25"] {
  fill: #E87932 !important;
}

/* Section Line & Indicators in Plan */
html.canvas-dark .drawing-view svg line[stroke="#6f8f8c"] {
  stroke: #E87932 !important;
}

/* Elevation & Section Drawings */
html.canvas-dark .drawing-view svg line[stroke="#60786c"] {
  stroke: #E5E5E5 !important;
  stroke-width: 1.8px !important;
}
html.canvas-dark .drawing-view svg line[stroke="#5d706d"] {
  stroke: #E5E5E5 !important;
}
html.canvas-dark .drawing-view svg line[stroke="#3c5350"] {
  stroke: #E5E5E5 !important;
  stroke-width: 2.2px !important;
}
html.canvas-dark .drawing-view svg line[stroke="#bcc9c3"] {
  stroke: #555555 !important;
}
html.canvas-dark .drawing-view svg polygon[fill="#e9ede9"] {
  fill: #222222 !important;
}
html.canvas-dark .drawing-view svg polygon[fill="#aadac6"] {
  fill: rgba(232, 121, 50, 0.25) !important;
  stroke: #E87932 !important;
}

/* Documentation Sheet View */
html.dark-theme .sheet-view {
  background: #0d0d0d !important;
}
html.dark-theme .sheet-view svg {
  background: var(--soft) !important;
  box-shadow: 0 8px 32px #000000cc;
}
html.dark-theme .sheet-view svg rect.drawing-background,
html.dark-theme .sheet-view svg rect[width="100%"],
html.dark-theme .sheet-view svg > rect:first-of-type,
html.dark-theme .sheet-view > svg > rect {
  fill: #141414 !important;
}
html.dark-theme .sheet-view svg rect[stroke="#46524c"] {
  stroke: #E5E5E5 !important;
}
html.dark-theme .sheet-view svg line[stroke="#46524c"] {
  stroke: #454545 !important;
}
html.dark-theme .sheet-view svg text {
  fill: #E5E5E5 !important;
}
html.dark-theme .sheet-view svg text[fill="#76857b"],
html.dark-theme .sheet-view svg text[fill="#7a877e"],
html.dark-theme .sheet-view svg text[fill="#7d8980"] {
  fill: #9E9E9E !important;
}

/* Scrollbars in Dark Mode */
html.dark-theme ::-webkit-scrollbar-thumb {
  background: #353535;
}
html.dark-theme ::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}

/* Arabic interface: only application chrome flows RTL. CAD canvas, view axes and tool order remain LTR. */
html[data-ui-lang="ar"] {
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  direction: rtl;
}
html[data-ui-lang="ar"] .titlebar,
html[data-ui-lang="ar"] .ribbon-tabs,
html[data-ui-lang="ar"] .ribbon,
html[data-ui-lang="ar"] .workspace,
html[data-ui-lang="ar"] .options-bar,
html[data-ui-lang="ar"] .view-tabs,
html[data-ui-lang="ar"] .viewport-header,
html[data-ui-lang="ar"] .view-controls,
html[data-ui-lang="ar"] .statusbar,
html[data-ui-lang="ar"] .view-area,
html[data-ui-lang="ar"] .viewcube,
html[data-ui-lang="ar"] .nav-tools {
  direction: ltr;
}
html[data-ui-lang="ar"] .browser-panel,
html[data-ui-lang="ar"] .properties-panel,
html[data-ui-lang="ar"] .browser-search,
html[data-ui-lang="ar"] .properties-content,
html[data-ui-lang="ar"] .property-hero,
html[data-ui-lang="ar"] .panel-title,
html[data-ui-lang="ar"] .modal-header,
html[data-ui-lang="ar"] #modal,
html[data-ui-lang="ar"] #toasts {
  direction: rtl;
  text-align: right;
}
html[data-ui-lang="ar"] .ribbon-button span,
html[data-ui-lang="ar"] .ribbon-group-label,
html[data-ui-lang="ar"] .options-bar label,
html[data-ui-lang="ar"] .header-actions .language-toggle,
html[data-ui-lang="ar"] .ribbon-tabs button,
html[data-ui-lang="ar"] .status-message,
html[data-ui-lang="ar"] .status-toggle,
html[data-ui-lang="ar"] .project-discipline {
  direction: rtl;
}
html[data-ui-lang="ar"] .property-value.monospace,
html[data-ui-lang="ar"] #coordinates,
html[data-ui-lang="ar"] .view-label,
html[data-ui-lang="ar"] .view-scale,
html[data-ui-lang="ar"] #view-scale,
html[data-ui-lang="ar"] kbd,
html[data-ui-lang="ar"] input[type="number"] {
  direction: ltr;
  unicode-bidi: isolate;
}
html[data-ui-lang="ar"] .dialog-form input[type="text"] { direction: auto; }
html[data-ui-lang="ar"] .modal-header h2,
html[data-ui-lang="ar"] .modal-intro,
html[data-ui-lang="ar"] .dialog-form label { text-align: right; }
html[data-ui-lang="ar"] .view-area svg,
html[data-ui-lang="ar"] .view-area canvas { direction: ltr; }
.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 11px;
}
.language-toggle select {
  max-width: 105px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 5px 6px;
  cursor: pointer;
}

/* PDF export: existing modal, with a dedicated structured settings surface. */
.pdf-export-dialog { width: 100%; }
#modal:has(.pdf-export-dialog) { width: min(880px, 96vw); max-height: 94vh; }
#modal:has(.pdf-export-dialog) #modal-body { max-height: 82vh; overflow: hidden; padding: 0; }
.pdf-export-dialog .dialog-form { grid-template-columns: repeat(2, minmax(0,1fr)); }
.pdf-export-dialog .dialog-form > .full { grid-column: 1 / -1; }
.pdf-prev-head .pdf-section-head { gap: 8px; justify-content: flex-start; }
.pdf-section-head { font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; padding: 5px 0 8px; }
.pdf-candidates { max-height: 168px; overflow: auto; border: 1px solid var(--line); background: var(--panel); border-radius: 4px; padding: 8px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.pdf-candidate { display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; min-width: 0; white-space: normal; }
.pdf-candidate input { flex: none; }
.pdf-candidate[hidden], #pdf-selection[hidden] { display: none !important; }
.pdf-set-controls { display: flex; align-items: end; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 8px; }
.pdf-set-controls label { min-width: 180px; flex: 1; }
.pdf-set-controls button, .pdf-export-dialog .dialog-footer button { border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; }
.pdf-advanced { border-top: 1px solid var(--line); padding-top: 8px; }
.pdf-advanced > summary { font-weight: 650; cursor: pointer; }
.pdf-advanced .dialog-form { padding-top: 10px; }
.pdf-print-preview { height: 100%; width: 100%; overflow: hidden; background: #949494; display: flex; align-items: center; justify-content: center; padding: 12px; }
.pdf-paper { background: #fff; max-width: 100%; max-height: 100%; width: auto; height: auto; box-shadow: 0 3px 14px #0005; overflow: hidden; }
@media(max-width:690px) { .pdf-export-dialog .dialog-form,.pdf-candidates { grid-template-columns: 1fr; } }

/* Print window: setup row on top, settings on the left, live preview on the right. */
.pdf-export-dialog { display: flex; flex-direction: column; height: min(700px, 80vh); }
.pdf-top { padding: 8px 16px; border-bottom: 1px solid var(--line); }
.pdf-top .pdf-set-controls { border-top: 0; padding-top: 0; }
.pdf-main { flex: 1; display: flex; min-height: 0; }
.pdf-left { width: 400px; flex: none; overflow-y: auto; border-inline-end: 1px solid var(--line); padding: 0 16px 12px; }
.pdf-right { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 10px 16px; background: var(--panel); }
.pdf-band { grid-column: 1 / -1; margin: 6px -16px 0; padding: 7px 16px; background: var(--soft, var(--panel)); border-block: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.pdf-left .pdf-band:first-child { margin-top: 0; border-top: 0; }
.pdf-hint[hidden], .pdf-left label[hidden] { display: none !important; }
.pdf-dim { opacity: .5; }
.pdf-prev-head { display: flex; align-items: center; gap: 10px; }
.pdf-meta { margin-inline-start: auto; display: flex; gap: 6px; }
.pdf-meta i { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.pdf-stage { position: relative; flex: 1; min-height: 0; display: flex; }
.pdf-stage .pdf-print-preview { border-radius: 6px; }
.pdf-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--white, #fff); font-size: 20px; line-height: 1; cursor: pointer; }
.pdf-nav.prev { inset-inline-start: 10px; } .pdf-nav.next { inset-inline-end: 10px; }
.pdf-nav:disabled { opacity: .35; cursor: default; }
.pdf-pageno { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 600; padding: 2px 12px; border-radius: 999px; background: var(--white, #fff); border: 1px solid var(--line); }
.pdf-export-dialog .dialog-footer { padding: 10px 16px; border-top: 1px solid var(--line); }
@media(max-width:900px) { .pdf-main { flex-direction: column; overflow-y: auto; } .pdf-left { width: auto; border-inline-end: 0; overflow: visible; } .pdf-stage { min-height: 280px; } }

/* In-canvas touch gestures only: normal UI retains scrolling and tapping. */
#view-area { touch-action: none; }
.scene-context-menu {
  position:absolute;
  z-index:30;
  display:flex;
  flex-direction:column;
  min-width:148px;
  max-width:min(220px,85vw);
  background:var(--panel, #fff);
  color:var(--text, #202f30);
  border:1px solid var(--line, #d5d5d5);
  box-shadow:0 8px 22px #0004;
  border-radius:7px;
  padding:5px;
  touch-action:manipulation;
}
.scene-context-menu button {
  display:block;
  width:100%;
  padding:9px 12px;
  border:0;
  border-radius:4px;
  background:transparent;
  text-align:start;
  color:inherit;
  cursor:pointer;
  font:inherit;
}
.scene-context-menu button:hover,
.scene-context-menu button:focus-visible {
  background:var(--panel-hover, #e2e2e2);
}
.scene-context-menu button:disabled,
.scene-context-menu button[aria-disabled="true"] {
  opacity:.4;
  cursor:default;
  pointer-events:auto;
  background:transparent;
}

/* Precision Tracking: compact angular increment control; UI status only. */
#polar-increment { width: 65px; min-width: 65px; height: 24px; font-size: 11px; padding: 0 3px; border-radius: 4px; }
#polar-increment[hidden] { display: none !important; }
.snap-preview-symbol,.snap-preview-tooltip,.snap-tracking-guide { pointer-events: none; }

/* Extend existing contextual options bar, never another ribbon. */
.options-bar #context-tool-options[hidden] { display: none; }
.options-bar #context-tool-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  font-size: 11px;
}
.options-bar #context-tool-options input,
.options-bar #context-tool-options select {
  min-width: 0;
  max-width: 120px;
  height: 25px;
  font-size: 11px;
  border-radius: 4px;
}
.options-bar #context-tool-options button {
  padding: 4px 7px;
  border: 1px solid var(--line, #d0d0d0);
  border-radius: 5px;
  background: var(--panel, #f9faf8);
  color: inherit;
  cursor: pointer;
}
html.dark-theme .options-bar #context-tool-options input,
html.dark-theme .options-bar #context-tool-options select,
html.dark-theme .options-bar #context-tool-options button {
  background: #293332;
  border-color: #516260;
  color: #f1f1f1;
}
@media(max-width: 960px){
  .options-bar #context-tool-options{gap:4px;}
  .options-bar #context-tool-options input,
  .options-bar #context-tool-options select{max-width:90px;}
}

/* Immediate accessible tooltips for actions; works in both colour themes. */
.reva-immediate-tooltip{position:fixed;z-index:100000;pointer-events:none;max-width:280px;min-width:100px;background:#252c30;color:#fff;border:1px solid #46535a;border-radius:7px;box-shadow:0 6px 22px #0003;padding:8px 10px;font:12px/1.4 Inter,Segoe UI,Arial,sans-serif;text-align:start}
.reva-immediate-tooltip strong{font-weight:650;display:block;white-space:normal}
.reva-immediate-tooltip .reva-tooltip-name{display:block;line-height:1.45}
.reva-immediate-tooltip small{display:block;font-size:11px;opacity:.85;margin-top:4px;line-height:1.5}


/* Revit-inspired contextual Draw methods in the existing ribbon. */
#draw-ribbon-tools{display:flex;align-items:center;flex-wrap:wrap;gap:7px;max-width:100%;padding:3px 8px;border-inline:1px solid var(--border,#cbd5d8)}
#draw-ribbon-tools .draw-panel-heading{font-size:11px;font-weight:700;line-height:1.2;white-space:nowrap;display:flex;flex-direction:column;gap:3px;padding-inline:5px}
#draw-ribbon-tools .draw-panel-heading span{font-size:9px;font-weight:400;opacity:.65}
#draw-ribbon-tools .draw-panel-tools{display:flex;flex-wrap:wrap;gap:3px;align-items:center}
#draw-ribbon-tools .draw-panel-tool{appearance:none;border:1px solid transparent;background:transparent;color:inherit;cursor:pointer;border-radius:5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:52px;min-height:49px;padding:4px 6px;touch-action:manipulation}
#draw-ribbon-tools .draw-panel-tool:hover,#draw-ribbon-tools .draw-panel-tool:focus-visible{background:rgba(120,145,155,.15);border-color:rgba(120,145,155,.3)}
#draw-ribbon-tools .draw-panel-tool.active{background:rgb(var(--accent-rgb) / .14);border-color:var(--accent)}
#draw-ribbon-tools .draw-panel-glyph{font-size:25px;line-height:26px}
#draw-ribbon-tools .draw-panel-name{font-size:9px;white-space:nowrap}
#draw-ribbon-tools .draw-panel-sides{display:flex;align-items:center;gap:4px;font-size:11px}
#draw-ribbon-tools .draw-panel-sides input{width:52px;box-sizing:border-box;padding:4px;background:var(--panel,#fff);color:inherit;border:1px solid #9aa8aa;border-radius:4px}
html.dark-theme #draw-ribbon-tools .draw-panel-sides input{background:#28323b;color:#f6f7f8}
@media(max-width:720px){#draw-ribbon-tools .draw-panel-tool{min-width:45px;min-height:46px}#draw-ribbon-tools .draw-panel-name{font-size:8px}}

html:not(.dark-theme) .reva-immediate-tooltip{background:#fff;color:#202b33;border-color:#adbcc6;box-shadow:0 6px 20px #0002}
html.dark-theme .reva-immediate-tooltip{background:#242b32;color:#f4f7f9;border-color:#56616a}

/* Contextual Revit-style drawing ribbon: one tool panel, no duplicate options bar. */
.ribbon-tabs .contextual-create-tab:not([hidden]){
  display:inline-flex;align-items:center;justify-content:center;
  background:#dadada;color:#393939;border-bottom:3px solid #797979;
  font-weight:700;white-space:nowrap;padding-inline:14px;
}
html.dark-theme .ribbon-tabs .contextual-create-tab:not([hidden]){
  background:#5a5a5a;color:#fff;border-bottom-color:#b1b1b1;
}
#draw-ribbon-tools{display:flex;align-items:center;justify-content:center;padding:2px 3px;gap:7px;border:0;max-width:none;}
#draw-ribbon-tools .context-draw-grid{
  display:grid;grid-template-columns:repeat(5,34px);grid-auto-rows:30px;gap:2px;
  align-content:center;justify-items:stretch;min-height:64px;
}
#draw-ribbon-tools .context-draw-tool{
  display:flex;align-items:center;justify-content:center;min-width:32px;min-height:28px;
  padding:2px;border:1px solid transparent;border-radius:3px;
  color:#405b64;background:transparent;cursor:pointer;touch-action:manipulation;
}
#draw-ribbon-tools .context-draw-tool svg{width:22px;height:22px;stroke-width:1.6;}
#draw-ribbon-tools .context-draw-tool:hover,#draw-ribbon-tools .context-draw-tool:focus-visible{
  background:#e6e6e6;border-color:#c1c1c1;
}
#draw-ribbon-tools .context-draw-tool.active{background:#e7f2f8;border:1px solid #378ac2;color:#14669b;}
html.dark-theme #draw-ribbon-tools .context-draw-tool{color:#d1dbdf;}
html.dark-theme #draw-ribbon-tools .context-draw-tool:hover{background:#465462;border-color:#697e87;}
html.dark-theme #draw-ribbon-tools .context-draw-tool.active{background:#26516e;border-color:#80badf;color:#fff;}
#draw-ribbon-tools .draw-panel-sides{display:flex;gap:4px;flex-direction:column;align-items:center;font-size:9px;}
#draw-ribbon-tools .draw-panel-sides input{width:48px;padding:4px;border:1px solid #b8c7ce;border-radius:3px;background:transparent;color:inherit;}
@media(max-width:720px){#draw-ribbon-tools .context-draw-grid{grid-template-columns:repeat(5,34px)}.ribbon-tabs .contextual-create-tab:not([hidden]){font-size:10px;padding-inline:8px;}}

/* Contextual sketch ribbon: Revit-inspired hierarchy, existing app theme. */
.ribbon:has(.reva-context-grid){gap:0;padding-inline:8px;min-height:68px;height:68px}
.ribbon:has(.reva-context-grid) .ribbon-group{padding-inline:9px}
.ribbon:has(.reva-context-grid) .ribbon-group:last-child{margin-inline-start:auto;border-inline-end:0}
.reva-context-grid{display:grid;grid-auto-flow:row;grid-template-rows:repeat(2,42px);grid-template-columns:repeat(5,minmax(54px,auto));gap:2px 3px;align-content:center;align-items:stretch}
.ribbon-group:has(.reva-context-grid):nth-child(2) .reva-context-grid,
.ribbon-group:has(.reva-context-grid):nth-child(3) .reva-context-grid,
.ribbon-group:has(.reva-context-grid):last-child .reva-context-grid{grid-template-columns:repeat(2,minmax(62px,auto))}
.reva-context-command{display:flex;align-items:center;flex-direction:column;justify-content:center;gap:3px;
 min-width:54px;min-height:38px;max-height:42px;color:inherit;border:1px solid transparent;border-radius:4px;
 padding:2px 5px;touch-action:manipulation}
.reva-context-command svg{width:19px;height:19px;flex:none}
.reva-context-command span{font-size:9px;line-height:1.1;white-space:nowrap}
.reva-context-command:hover,.reva-context-command:focus-visible{background:rgba(113,147,165,.17);border-color:rgba(113,147,165,.35)}
#draw-ribbon-tools .context-draw-grid{
 display:grid;grid-template-columns:repeat(6,minmax(49px,auto));grid-template-rows:repeat(2,42px);
 grid-auto-flow:row;grid-auto-rows:42px;gap:2px 3px;min-height:84px
}
#draw-ribbon-tools .context-draw-tool{display:flex;flex-direction:column;gap:2px;min-width:48px;min-height:40px;
 padding:2px 4px;justify-content:center;align-items:center}
#draw-ribbon-tools .context-draw-tool svg{width:20px;height:20px;flex:none}
#draw-ribbon-tools .context-draw-tool span{font-size:9px;line-height:1.1;white-space:nowrap}
html.dark-theme .reva-context-command{color:#d5e3e9}
html.dark-theme .reva-context-command:hover{background:#405262;border-color:#688192}
html.dark-theme #draw-ribbon-tools .context-draw-tool{color:#d5e3e9}
@media(max-width:950px){.ribbon:has(.reva-context-grid){overflow-x:auto}
#draw-ribbon-tools .context-draw-grid{grid-template-columns:repeat(5,minmax(48px,auto))}
.reva-context-grid{grid-template-columns:repeat(5,minmax(50px,auto))}}

/* Selection count belongs to the status bar; the drawing area remains clear. */
.status-selection-count{font-size:10px;white-space:nowrap;font-variant-numeric:tabular-nums;color:var(--accent-text)}
.status-selection-count[hidden],#selection-status-divider[hidden]{display:none!important}
.selection-filter-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(155px,1fr));gap:7px;
 max-height:45vh;overflow-y:auto;margin:14px 0}
.selection-filter-item{display:flex;align-items:center;gap:9px;padding:8px 9px;
 border:1px solid var(--border,#6d8088);border-radius:5px}
.selection-filter-item input{width:17px;height:17px;accent-color:#159eb5;flex:none}
.selection-filter-item span{flex:1}
.selection-filter-item strong{font-variant-numeric:tabular-nums}


/* Modify ribbon: compact two-row commands grouped as Select / Modify / Create / Constraints.
   Scoped to Modify only; all other ribbon tabs retain their established layout. */
#ribbon.modify-compact {
  padding: 5px 10px 0;
}
#ribbon.modify-compact .ribbon-group {
  padding: 0 7px;
}
#ribbon.modify-compact .ribbon-group:first-child {
  padding-left: 0;
}
#ribbon.modify-compact .ribbon-buttons {
  display: grid;
  grid-template-rows: repeat(2, 32px);
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-content: center;
  align-items: center;
  gap: 2px 3px;
}
#ribbon.modify-compact .ribbon-button {
  display: inline-flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  box-sizing: border-box;
  gap: 4px;
  min-width: 0;
  width: 100%;
  height: 31px;
  padding: 3px 6px;
  font-size: 10px;
  white-space: nowrap;
}
#ribbon.modify-compact .ribbon-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}
#ribbon.modify-compact .ribbon-group-label {
  height: 17px;
}
@media (max-width: 1200px) {
  #ribbon.modify-compact .ribbon-group { padding: 0 5px; }
  #ribbon.modify-compact .ribbon-button { padding: 3px 4px; font-size: 9px; gap: 3px; }
  #ribbon.modify-compact .ribbon-button svg { width: 16px; height: 16px; flex-basis: 16px; }
}

/* Navigation Pan shares the dimensions and icon style of existing zoom controls. */
.nav-tools button[data-action="toggle-pan"].active {
  color: var(--accent-text);
  background: var(--accent-soft);
}
#view-area.pan-mode { cursor: grab; }
#view-area.pan-mode:active { cursor: grabbing; }
#view-area.pan-mode svg, #view-area.pan-mode canvas { cursor: inherit; }

/* Project browser: level rows, add buttons, nested family categories */
.browser-row-pair { display: flex; align-items: center; gap: 2px; }
.browser-row-pair .browser-row { flex: 1; min-width: 0; }
.browser-open-plan { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 4px; color: #a7a7a7; }
.browser-open-plan:hover, .browser-open-plan.active { background: var(--accent-soft); color: var(--accent-dark); }
.browser-add { margin-left: 6px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 4px; font-size: 15px; line-height: 1; color: #8a8a8a; cursor: pointer; }
.browser-add:hover { background: var(--accent-soft); color: var(--accent-dark); }
.browser-empty { padding: 5px 8px 8px 36px; font-size: 10px; color: #a7a7a7; }
.browser-tree details details { margin-left: 14px; }
.browser-tree details details .browser-row { padding-left: 30px; }
@media (pointer: coarse) { .browser-row, .browser-open-plan, .browser-add { min-height: 40px; } .browser-open-plan { width: 40px; height: 40px; } .browser-add { width: 36px; height: 36px; } }

/* ===== Adaptive workspace: Quick Access Toolbar and Normal / Compact / Focus modes ===== */
#app { position: relative; }
#toolbars { display: contents; }
.center-main { min-width: 0; min-height: 0; flex: 1; display: flex; flex-direction: column; }
.workspace > .browser-panel { grid-column: 1; }
.workspace > .center-panel { grid-column: 2; }
.workspace > .properties-panel { grid-column: 3; }
.workspace { position: relative; }

.qat { position: absolute; z-index: 20; display: flex; align-items: center; gap: 1px; padding: 4px; background: #fffffff2; border: 1px solid #e2e2e2; border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.14); max-width: calc(100% - 24px); max-height: calc(100% - 24px); touch-action: none; }
.qat[data-pos="left"] { left: 10px; top: 64px; max-height: calc(100% - 76px); }
.qat[data-pos="right"] { right: 10px; top: 64px; max-height: calc(100% - 76px); }
.qat[data-pos="top"] { top: 10px; left: 50%; transform: translateX(-50%); }
.qat[data-pos="bottom"] { bottom: 10px; left: 50%; transform: translateX(-50%); }
.qat.vertical { flex-direction: column; overflow-y: auto; }
.qat:not(.vertical) { overflow-x: auto; }
.qat.collapsed { padding: 2px; background: #ffffffd9; }
.qat-button { position: relative; width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 7px; color: #6d6d6d; }
.qat-button:hover { background: var(--accent-soft); color: var(--accent-dark); }
.qat-button.active { background: var(--accent-soft); color: var(--accent-dark); box-shadow: inset 0 0 0 1px var(--accent); }
.qat-num { position: absolute; top: 1px; left: 4px; font-size: 9px; line-height: 1; color: #9f9f9f; pointer-events: none; }
.qat-separator { width: 1px; height: 22px; margin: 0 4px; background: #e2e2e2; flex: none; }
.qat.vertical .qat-separator { width: 22px; height: 1px; margin: 4px 0; }
.qat-grip { width: 20px; height: 34px; flex: none; display: grid; place-items: center; color: #a7a7a7; cursor: grab; touch-action: none; }
.qat.vertical .qat-grip { width: 34px; height: 18px; }
.qat.moving { box-shadow: 0 0 0 2px var(--accent); }
.qat-fold { width: 28px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 6px; color: #8a8a8a; }
.qat.vertical .qat-fold { width: 36px; }
.qat:not(.vertical) .qat-fold { height: 34px; width: 22px; }
.qat-fold:hover { background: var(--accent-soft); color: var(--accent-dark); }
.qat-chevron { width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; display: block; }
.qat-chevron.left { transform: rotate(135deg); margin-left: 3px; }
.qat-chevron.right { transform: rotate(-45deg); margin-right: 3px; }
.qat-chevron.up { transform: rotate(-135deg); margin-top: 3px; }
.qat-chevron.down { transform: rotate(45deg); margin-bottom: 3px; }

.qat-pop { position: fixed; z-index: 400; min-width: 230px; max-width: calc(100vw - 12px); max-height: calc(100dvh - 12px); overflow: auto; background: #fff; border: 1px solid #e2e2e2; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 8px; font-size: 12px; color: #3d3d3d; }
.qat-pop-title { font-weight: 650; font-size: 11px; margin: 4px 4px 6px; color: #6d6d6d; }
.qat-pop-title small { font-weight: 400; color: #9f9f9f; }
.qat-pop-row { display: flex; gap: 4px; margin-bottom: 8px; }
.qat-pop-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; min-height: 36px; }
.qat-pop-row .qat-pop-item { text-align: center; padding: 8px 4px; }
.qat-pop-item:hover { background: var(--accent-soft); }
.qat-pop-item.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 650; }
.qat-reset { margin-top: 6px; border-top: 1px solid #efefef; border-radius: 0 0 6px 6px; color: #6d6d6d; }
.qat-list { display: flex; flex-direction: column; }
.qat-item { display: flex; align-items: center; min-height: 36px; border-radius: 6px; }
.qat-item.dragging { background: var(--accent-soft); box-shadow: 0 4px 14px rgba(0,0,0,.18); position: relative; z-index: 1; transform: scale(1.02); }
.qat-item.on { cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.qat-item.dragging, .qat-item.dragging * { cursor: grabbing; }
.qat-item label { display: flex; align-items: center; gap: 8px; flex: 1; padding: 6px 4px; cursor: pointer; }
.qat-handle { width: 26px; text-align: center; cursor: grab; touch-action: none; color: #9f9f9f; font-size: 16px; user-select: none; }

/* collapsed side panels: a thin full-height strip with an icon and a vertical label (docked), a small floating tab (overlay modes) */
.edge-tab { grid-row: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; background: #fafbf8; color: #6d6d6d; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; z-index: 30; }
.edge-tab .edge-label { writing-mode: vertical-rl; }
.edge-tab:hover { background: var(--accent-soft); color: var(--accent-dark); }
.edge-left { grid-column: 1; border-right: 1px solid #e2e2e2; }
.edge-right { grid-column: 3; border-left: 1px solid #e2e2e2; }
.edge-right .edge-label { transform: rotate(180deg); }
.edge-tab[hidden] { display: none; }
.ws-overlay .edge-tab { position: absolute; top: 40%; grid-row: auto; padding: 14px 5px; background: #fff; border: 1px solid #e2e2e2; }
.ws-overlay .edge-left { left: 0; border-left: 0; border-radius: 0 8px 8px 0; }
.ws-overlay .edge-right { right: 0; border-right: 0; border-radius: 8px 0 0 8px; }

/* panel visibility (docked) */
.workspace.ws-bh { grid-template-columns: 30px minmax(330px, 1fr) 340px !important; }
.workspace.ws-ph { grid-template-columns: 233px minmax(330px, 1fr) 30px !important; }
.workspace.ws-bh.ws-ph { grid-template-columns: 30px minmax(330px, 1fr) 30px !important; }
.workspace.ws-bh > .browser-panel, .workspace.ws-ph > .properties-panel { display: none; }
.properties-panel { display: flex; }

/* overlay panels: float above the canvas instead of shrinking it */
.ws-overlay .workspace, .ws-overlay .workspace.ws-bh, .ws-overlay .workspace.ws-ph, .ws-overlay .workspace.ws-bh.ws-ph { grid-template-columns: minmax(0, 1fr) !important; }
.ws-overlay .workspace > .center-panel { grid-column: 1; }
.ws-overlay .workspace > .browser-panel, .ws-overlay .workspace > .properties-panel { display: flex; position: absolute; top: 0; bottom: 0; z-index: 40; width: min(340px, 88vw); background: #fafbf8; box-shadow: 0 0 30px rgba(0,0,0,.25); }
.ws-overlay .workspace > .browser-panel { left: 0; }
.ws-overlay .workspace > .properties-panel { right: 0; }
.ws-overlay .workspace.ws-bh > .browser-panel, .ws-overlay .workspace.ws-ph > .properties-panel { display: none; }
.ws-overlay .workspace.ws-scrim-on > .center-panel::after { content: ""; position: absolute; inset: 0; z-index: 35; background: rgba(0,0,0,.12); }

/* Compact: one slim row of icon-only tools */
.ws-compact .options-bar { height: 30px; min-height: 30px; }
.ws-compact .browser-bottom, .ws-compact .model-note { display: none; }

/* Toolbars hidden / floating (Show / Hide Toolbars) */
.ws-toolbars-hidden #toolbars, .ws-focus-hidden #toolbars { display: none; }
.ws-toolbars-float #toolbars { display: block; position: absolute; top: 0; left: 0; right: 0; z-index: 60; max-height: 80dvh; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.22); background: #fff; }

/* touch and pen: bigger targets */
@media (pointer: coarse) {
  .qat-button, .qat-grip { min-width: 44px; min-height: 44px; }
  .workspace.ws-bh, .workspace.ws-ph, .workspace.ws-bh.ws-ph { --edge: 40px; }
  .qat-grip { width: 28px; }
  .qat.vertical .qat-grip { width: 44px; height: 28px; }
  .edge-tab { padding: 18px 8px; font-size: 12px; }
  .qat-pop-item, .qat-item { min-height: 44px; }
}
@media (max-width: 960px) { .ws-overlay .properties-panel { display: flex; } }

/* dark theme */
html.dark-theme .qat, html.dark-theme .qat-pop, html.dark-theme .edge-tab, html.dark-theme .ws-toolbars-float #toolbars { background: #1c1c1c; border-color: #353535; color: #cfcfcf; }
html.dark-theme .qat-button, html.dark-theme .qat-fold, html.dark-theme .qat-pop-title { color: #b0b0b0; }
html.dark-theme .qat { background: #1c1c1cf2; }
html.dark-theme .qat-button:hover, html.dark-theme .qat-button.active, html.dark-theme .qat-pop-item:hover, html.dark-theme .qat-pop-item.active, html.dark-theme .edge-tab:hover, html.dark-theme .qat-item.dragging { background: #2a1d13; color: var(--accent-text); }
html.dark-theme .qat-separator { background: var(--line); }
html.dark-theme .edge-tab { background: var(--panel); }
html.dark-theme .ws-overlay .workspace > .browser-panel, html.dark-theme .ws-overlay .workspace > .properties-panel { background: #181818; }

/* One constant ribbon height: contextual sketch commands scroll sideways in a single row instead of making the canvas jump when the tool changes. */
.ribbon:has(.reva-context-grid){overflow-x:auto;overflow-y:hidden;align-items:center}
.reva-context-grid,.ribbon-group:has(.reva-context-grid):nth-child(2) .reva-context-grid,.ribbon-group:has(.reva-context-grid):nth-child(3) .reva-context-grid,.ribbon-group:has(.reva-context-grid):last-child .reva-context-grid{grid-template-rows:42px;grid-auto-flow:column;grid-template-columns:none;grid-auto-columns:minmax(54px,auto)}
#draw-ribbon-tools .context-draw-grid{grid-template-rows:42px;grid-auto-rows:auto;grid-auto-flow:column;grid-template-columns:none;grid-auto-columns:minmax(49px,auto);min-height:0}

/* Overlay panels cover the canvas, so the floating palette rides on the open panel's edge and moves with it. */
.qat { transition: left .18s ease, right .18s ease; }
.ws-overlay .workspace:not(.ws-bh) .qat[data-pos="left"] { left: calc(min(340px, 88vw) - 20px); }
.ws-overlay .workspace:not(.ws-ph) .qat[data-pos="right"] { right: calc(min(340px, 88vw) - 20px); }

/* Palette on the right sits flush against the panel edge; the view cube and zoom buttons step inward beside it. */
#view-area:has(.qat[data-pos="right"]:not(.collapsed)) .viewcube { right: 77px; }
#view-area:has(.qat[data-pos="right"]:not(.collapsed)) .nav-tools { right: 75px; }
@media (max-height: 900px) and (pointer: fine) { .qat.vertical .qat-button { width: 34px; height: 30px; min-height: 0; } .qat.vertical .qat-button svg { width: 18px; height: 18px; } .qat.vertical { padding: 4px; gap: 1px; } }

/* Palette rows: tools live in .qat-tools so they can run in one or two rows (columns when vertical); drag scrolls the rest into view. */
.qat-tools { display: flex; gap: 1px; flex: none; }
.qat.vertical .qat-tools { flex-direction: column; }
.qat[data-rows="2"]:not(.vertical) .qat-tools { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); }
.qat[data-rows="2"].vertical .qat-tools { display: grid; grid-template-columns: repeat(2, auto); }
.qat.vertical { overflow-y: auto; scrollbar-width: none; }
.qat:not(.vertical) { scrollbar-width: none; }
#view-area:has(.qat[data-pos="right"][data-rows="2"]:not(.collapsed)) .viewcube { right: 117px; }
#view-area:has(.qat[data-pos="right"][data-rows="2"]:not(.collapsed)) .nav-tools { right: 115px; }

/* Focus / tablet-Compact: a collapsed panel leaves the same full-height strip as Normal mode (the canvas keeps clear of it);
   an opened panel overlays the drawing. The palette therefore sits exactly as it does in Normal mode. */
.ws-overlay .workspace > .center-panel { grid-column: 2; }
.ws-overlay .workspace, .ws-overlay .workspace.ws-bh, .ws-overlay .workspace.ws-ph, .ws-overlay .workspace.ws-bh.ws-ph { grid-template-columns: 30px minmax(0, 1fr) 30px !important; } /* constant, so opening a panel never resizes the canvas */
.ws-overlay .edge-tab { position: static; top: auto; grid-row: 1; padding: 12px 0; background: #fafbf8; border: 0; border-radius: 0; }
.ws-overlay .edge-left { grid-column: 1; border-right: 1px solid #e2e2e2; }
.ws-overlay .edge-right { grid-column: 3; border-left: 1px solid #e2e2e2; }
html.dark-theme .ws-overlay .edge-tab { background: #181818; }

/* "Model at a glance" is a small closing note at the very end of the Properties list, reached by scrolling, not a fixed block. */
.properties-panel { overflow-y: auto; }
.properties-panel > .properties-content { overflow: visible; flex: none; min-height: auto; }
.properties-panel > .panel-title { position: sticky; top: 0; z-index: 3; background: inherit; }
.properties-panel > .model-summary { margin: 10px 13px 13px; padding: 7px 10px; }
.properties-panel .summary-title { margin-bottom: 4px; }
.properties-panel .summary-grid { gap: 6px; }
.properties-panel .summary-stat { flex-direction: row; align-items: baseline; gap: 4px; }
.properties-panel .summary-stat strong { font-size: 13px; }
.properties-panel .summary-stat small { font-size: 9px; }
.properties-panel .summary-foot { margin-top: 6px; padding-top: 5px; }
.properties-panel > .model-summary { flex: none; }

/* ---- Compact top: one header row (brand + ribbon tabs + actions), no breadcrumb row, status bar carries the view controls ---- */
.titlebar { height: 40px; min-height: 40px; gap: 12px; padding: 0 12px; border-bottom: 1px solid #e8e8e8; }
.titlebar .brand { font-size: 17px; gap: 7px; letter-spacing: -.5px; flex: none; }
.titlebar .brand-mark svg { width: 20px; height: 21px; }
.titlebar .ribbon-tabs { height: 100%; min-height: 0; flex: 1 1 auto; min-width: 0; border: 0; padding: 0; overflow-x: auto; scrollbar-width: none; gap: 2px; }
.titlebar .ribbon-tabs > button { white-space: nowrap; flex: none; }
.titlebar .ribbon-right .project-stage { display: none; }
.titlebar .project-title { flex: none; font-size: 11px; }
.titlebar .header-actions { flex: none; gap: 6px; }
.titlebar .language-toggle > span, .titlebar .header-actions .text-button:not(.theme-toggle-btn) > span:last-child { display: none; }
@media (max-width: 1280px) { .titlebar .project-title { display: none; } }
.viewport-header { display: none; }
.view-quick { position: absolute; top: 8px; right: 19px; z-index: 6; display: flex; gap: 1px; padding: 2px 4px; background: #f8faf5e6; border: 1px solid #d8d8d8; border-radius: 8px; }
.view-quick .toolbar-divider { height: 16px; }
.viewcube { top: 52px; }
.nav-tools { top: 146px; }
html.dark-theme .view-quick { background: #1c1c1ce6; border-color: #3d3d3d; }
.statusbar .view-controls { flex: 1 1 auto; min-width: 0; height: auto; min-height: 0; padding: 0; background: none; border: 0; justify-content: flex-start; gap: 14px; }
.statusbar .view-controls .controls-right { display: flex; gap: 10px; margin-inline-start: auto; }
.statusbar .status-message { flex: 0 1 28%; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
@media (max-width: 1100px) { .statusbar #render-stats { display: none; } }
.options-bar.auto-hidden { display: none; }
.titlebar .project-title { margin-inline-start: 18px; padding-inline-start: 14px; border-inline-start: 1px solid #e8e8e8; }

/* The options bar floats over the top-left of the drawing, so showing or hiding it never resizes or shifts the canvas. */
#view-area > .options-bar { position: absolute; z-index: 8; top: 40px; left: 10px; right: 200px; width: fit-content; max-width: calc(100% - 130px); height: 32px; min-height: 32px; padding: 0 12px; gap: 12px; border: 1px solid #d8d8d8; border-radius: 8px; background: #f1f5ece8; overflow-x: auto; scrollbar-width: none; }
#view-area > .options-bar .options-right { display: none; }
#view-area > .options-bar.auto-hidden { display: none; }
.qat[data-pos="left"], .qat[data-pos="right"] { top: 78px; max-height: calc(100% - 90px); }
html.dark-theme #view-area > .options-bar { background: #1c1c1ce8; border-color: #3d3d3d; }
.titlebar .project-title > :not(#saved-state) { display: none; }
.titlebar .project-title { margin: 0; padding: 0; border: 0; }
#view-area > .options-bar { height: auto; flex-wrap: wrap; padding: 3px 12px; row-gap: 2px; overflow: visible; }
#view-area > .options-bar label, #view-area > .options-bar .tool-indicator { white-space: nowrap; }
#view-area > .options-bar { height: 34px; min-height: 34px; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding: 0 12px; }
#view-area > .options-bar .context-tool-options:not([hidden]) { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 10px; white-space: nowrap; flex: none; }
#view-area > .options-bar .context-tool-options label { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
#view-area > .options-bar > * { flex: none; }

/* Horizontal tool scrollers: 3 px, invisible until hovered or scrolled; the mouse wheel scrolls them sideways (see app.js). */
.ribbon, .titlebar .ribbon-tabs, #view-area > .options-bar { scrollbar-width: auto; }
.ribbon::-webkit-scrollbar, .titlebar .ribbon-tabs::-webkit-scrollbar, #view-area > .options-bar::-webkit-scrollbar { height: 3px; background: transparent; }
.ribbon::-webkit-scrollbar-track, .titlebar .ribbon-tabs::-webkit-scrollbar-track, #view-area > .options-bar::-webkit-scrollbar-track { background: transparent; }
.ribbon::-webkit-scrollbar-thumb, .titlebar .ribbon-tabs::-webkit-scrollbar-thumb, #view-area > .options-bar::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; transition: background .2s; }
.ribbon:hover::-webkit-scrollbar-thumb, .ribbon.scrolling::-webkit-scrollbar-thumb,
.titlebar .ribbon-tabs:hover::-webkit-scrollbar-thumb, .titlebar .ribbon-tabs.scrolling::-webkit-scrollbar-thumb,
#view-area > .options-bar:hover::-webkit-scrollbar-thumb, #view-area > .options-bar.scrolling::-webkit-scrollbar-thumb { background: #b4b4b4; }
@supports not selector(::-webkit-scrollbar) {
  .ribbon, .titlebar .ribbon-tabs, #view-area > .options-bar { scrollbar-width: thin; scrollbar-color: transparent transparent; }
  .ribbon:hover, .ribbon.scrolling, .titlebar .ribbon-tabs:hover, .titlebar .ribbon-tabs.scrolling, #view-area > .options-bar:hover, #view-area > .options-bar.scrolling { scrollbar-color: #b4b4b4 transparent; }
}
html.dark-theme .ribbon:hover::-webkit-scrollbar-thumb, html.dark-theme .ribbon.scrolling::-webkit-scrollbar-thumb { background: #5f5f5f; }

/* Multi-selection: the Filter command stands out in the Modify tab. */
.ribbon-button.filter-prominent { background: var(--accent); color: #fff; border-radius: 8px; }
.ribbon-button.filter-prominent svg { stroke: currentColor; }
.ribbon-button.filter-prominent:hover { filter: brightness(1.08); }

/* Curtain Wall Configurator */
.cc { display: flex; flex-direction: column; gap: 10px; width: min(960px, 92vw); }
.cc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cc-head label { display: flex; align-items: center; gap: 6px; }
.cc-scope { display: flex; gap: 12px; margin-inline-start: auto; }
.cc-main { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 12px; min-height: 360px; }
.cc-form { max-height: 62vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding-inline-end: 4px; }
.cc-tabs { display: flex; gap: 4px; flex-wrap: wrap; position: sticky; top: 0; background: var(--panel, #fff); padding-bottom: 4px; z-index: 1; }
.cc-tabs button { padding: 4px 10px; border: 1px solid #cccccc; border-radius: 6px; background: transparent; }
.cc-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.cc fieldset { border: 1px solid #dadada; border-radius: 8px; display: grid; gap: 6px; padding: 8px 10px; }
.cc legend { font-weight: 600; padding: 0 4px; }
.cc fieldset label { display: grid; grid-template-columns: 1fr 120px; align-items: center; gap: 8px; }
.cc fieldset label.cc-check { grid-template-columns: auto 1fr; }
.cc input[type=number], .cc input[type=text], .cc select { width: 100%; min-width: 0; }
.cc-row { display: grid; grid-template-columns: 1fr auto 1fr auto auto; gap: 4px; align-items: center; }
.cc-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.cc-note { margin: 0; opacity: .75; font-size: 12px; }
.cc-preview { background: #f6f6f6; border: 1px solid #dadada; border-radius: 8px; padding: 6px; display: flex; flex-direction: column; }
.cc-stats { font-size: 12px; opacity: .8; padding: 2px 6px; }
html.dark-theme .cc-preview { background: #1d201d; border-color: #3d3d3d; }
@media (max-width: 760px) { .cc-main { grid-template-columns: 1fr; } .cc-scope { margin-inline-start: 0; } }
#modal:has(.cc) { width: min(1000px, 96vw); max-width: min(1000px, 96vw); }
.cc { width: 100%; }

/* Curtain Wall Edit Type dialog (Revit-style header, Lapin-style preview) */
#modal:has(.cc) { width: min(1200px, 97vw); max-width: min(1200px, 97vw); }
.cc-head { display: grid; gap: 8px; }
.cc-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cc-line label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cc-line select { min-width: 220px; }
.cc-mode { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; border-bottom: 1px solid #dadada; padding-bottom: 6px; }
.cc-mode button { padding: 6px 14px; border: 1px solid #cccccc; border-radius: 6px 6px 0 0; background: transparent; font-weight: 600; }
.cc-mode button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cc-mode .cc-note { margin-inline-start: 12px; }
.cc-nameeditor { display: flex; align-items: center; gap: 8px; background: #fff7ef; border: 1px solid var(--accent); border-radius: 8px; padding: 6px 10px; }
.cc-nameeditor label { display: flex; align-items: center; gap: 8px; flex: 1; }
.cc-nameeditor input { flex: 1; min-width: 0; }
.cc-main { grid-template-columns: minmax(330px, 400px) 1fr; min-height: 480px; }
.cc-form { max-height: 66vh; }
.cc-preview { min-height: 480px; }
.cc-preview svg { flex: 1; min-height: 440px; }
.cc fieldset label.cc-over { color: #c4561a; font-weight: 600; }
.cc fieldset label.cc-over::before { content: "●"; margin-inline-end: 4px; }
.cc-reset { margin-inline-start: auto; font-size: 12px; }
.cc small { opacity: .65; margin-inline-start: 4px; }
.cc-line button, .cc-mode button, .cc-presets button { cursor: pointer; }
#modal:has(.cc) { max-height: 96vh; display: flex; flex-direction: column; }
#modal:has(.cc) #modal-body { overflow: auto; min-height: 0; }
.cc .dialog-footer { position: sticky; bottom: 0; background: inherit; padding-top: 8px; }
.cc-form { max-height: 56vh; }
.cc-preview, .cc-main { min-height: 400px; }
.cc-preview svg { min-height: 360px; }

/* Curtain Wall type dialog: compact size */
#modal:has(.cc) { width: min(880px, 94vw); max-width: min(880px, 94vw); max-height: 88vh; }
.cc { gap: 8px; }
.cc-main { grid-template-columns: minmax(250px, 300px) 1fr; min-height: 300px; }
.cc-form { max-height: 46vh; }
.cc-preview, .cc-main { min-height: 300px; }
.cc-preview svg { min-height: 270px; }

/* Curtain Wall dialog: the whole preview fits the screen; the property list scrolls (wheel, touch, pen, drag bar) */
#modal:has(.cc) { width: min(860px, 96vw); max-width: min(860px, 96vw); max-height: 96vh; }
#modal:has(.cc) #modal-body { overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.cc { min-height: 0; flex: 1; }
.cc-main { height: clamp(250px, calc(100vh - 290px), 460px); min-height: 0; grid-template-columns: minmax(230px, 290px) 1fr; }
.cc-form { max-height: none; height: 100%; min-height: 0; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: auto; scrollbar-gutter: stable; }
.cc-form::-webkit-scrollbar { width: 12px; }
.cc-form::-webkit-scrollbar-thumb { background: #bfbfbf; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
.cc-form::-webkit-scrollbar-thumb:hover { background: #999999; background-clip: content-box; }
.cc-preview { min-height: 0; height: 100%; overflow: hidden; }
.cc-preview svg { flex: 1; min-height: 0; height: 100%; width: 100%; }
@media (max-width: 760px) { .cc-main { height: auto; } .cc-form { max-height: 42vh; } .cc-preview { height: 300px; } }

/* Layered Wall / Floor Type dialog (shares the Curtain Wall dialog frame) */
#modal:has(.lt) { width: min(920px, 96vw); max-width: min(920px, 96vw); max-height: 96vh; }
#modal:has(.lt) #modal-body { overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.lt .cc-main { grid-template-columns: minmax(380px, 1fr) minmax(260px, 340px); }
.lt-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.lt-table th { text-align: left; font-weight: 600; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: #757575; padding: 4px 4px; }
.lt-table td { padding: 3px 3px; vertical-align: middle; }
.lt-table input[type="text"], .lt-table input[type="number"], .lt-table select { width: 100%; min-width: 0; padding: 5px 6px; border: 1px solid var(--line, #d7d7d7); border-radius: 4px; background: #fff; font: inherit; }
.lt-n { width: 22px; color: #757575; }
.lt-num { white-space: nowrap; width: 112px; } .lt-num input { width: 70px; text-align: right; } .lt-num small { margin-left: 3px; color: #757575; }
.lt-act { white-space: nowrap; text-align: right; } .lt-act button { padding: 3px 6px; min-width: 24px; }
.lt-total { font-weight: 700; text-align: right; padding-right: 10px !important; }
.lt-section { width: 100%; height: 100%; display: block; }
.lt-lab { font-size: 11.5px; fill: #363636; } .lt-cap { font-size: 12px; fill: #545454; font-weight: 600; } .lt-dim { font-size: 12px; fill: var(--accent); font-weight: 700; }
@media (max-width: 760px) { .lt .cc-main { grid-template-columns: 1fr; } }
.schedule-tools { display: flex; gap: 8px; }
.schedule-tools button { padding: 8px 12px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 4px; color: var(--accent-dark); font-size: 11px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.schedule-footer { display: flex; gap: 18px; margin-top: 12px; font-size: 11px; color: #6b6b6b; }
.sched-scroll { overflow: auto; max-width: 100%; }
.sched-table { table-layout: auto; border-collapse: collapse; }
.sched-table th, .sched-table td { border: var(--sg-w, 1px) solid var(--sg-c, #dddddd); }
.sched-table th { position: relative; user-select: none; touch-action: none; }
.sched-table th.dragging { opacity: .5; }
.sched-table th.drop-target { outline: 2px solid var(--accent-dark); outline-offset: -2px; }
.sched-table td.num { text-align: end; font-variant-numeric: tabular-nums; }
.sched-table .col-grip { cursor: grab; opacity: .5; margin-inline-end: 6px; padding: 4px; touch-action: none; }
.sched-table .col-resize { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: 10px; cursor: col-resize; touch-action: none; }
.sched-table .col-resize:hover { background: rgba(207, 98, 30, .35); }
.sched-table tr.sched-total td { font-weight: 600; background: #f3f3f3; }
.schedule-back { position: absolute; top: 12px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 20; padding: 8px 14px; border-radius: 18px; cursor: pointer; }
.sd-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 10px; }
.sd-top label { display: grid; gap: 3px; font-size: 11px; }
.sd-tabs { display: flex; gap: 2px; border-bottom: 1px solid #e0e0e0; margin-bottom: 12px; flex-wrap: wrap; }
.sd-tabs button { padding: 8px 14px; border: 0; background: transparent; cursor: pointer; border-bottom: 2px solid transparent; }
.sd-tabs button.active { border-bottom-color: var(--accent-dark); color: var(--accent-dark); font-weight: 600; }
.sd-body { min-height: 240px; max-height: 52vh; overflow: auto; }
.sd-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.sd-cat { display: flex; gap: 8px; align-items: center; padding: 10px; border: 1px solid #e0e0e0; border-radius: 6px; cursor: pointer; }
.sd-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sd-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 8px; border-bottom: 1px solid #efefef; }
.sd-act { display: inline-flex; gap: 4px; }
.sd-filter { display: grid; grid-template-columns: 1.2fr .8fr 1fr auto; gap: 6px; margin-bottom: 6px; }
.sd-sort, .sd-totals, .sd-format { display: grid; gap: 10px; max-width: 420px; }
.sd-format label { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
@media (max-width: 720px) { .sd-fields { grid-template-columns: 1fr; } .sd-filter { grid-template-columns: 1fr 1fr; } }
body[data-view-kind="schedule"] .options-bar { display: none; }
.sd-group { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.sd-group label { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.pp-list { display: grid; gap: 6px; }
.pp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid #e0e0e0; border-radius: 6px; }
.pp-row.active { border-color: var(--accent-dark); background: #fdf8f3; }
.pp-name { display: grid; gap: 2px; }
.pp-name small { color: #898989; }
.pp-badge { display: inline-block; margin-inline-start: 8px; padding: 1px 7px; border-radius: 10px; background: var(--accent-dark); color: #fff; font-size: 10px; }
.pp-badge.alt { background: var(--accent-dark); }
.pp-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.pp-actions button { padding: 5px 9px; font-size: 11px; cursor: pointer; }
.pp-shared { margin: 10px 2px; font-size: 11px; color: #898989; }
.proposal-chip { position: absolute; top: 10px; inset-inline-start: 12px; z-index: 15; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-dark); border-radius: 16px; font-size: 11px; cursor: pointer; }
.proposal-chip small { opacity: .8; }
.sched-proposal { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #6b6b6b; }
.sched-cell { width: 100%; min-width: 60px; background: transparent; border: 1px solid transparent; border-radius: 4px; color: inherit; font: inherit; padding: 2px 4px; }
.sched-cell:hover, .sched-cell:focus { border-color: #9f9f9f; background: rgba(255,255,255,.06); }

/* View Styles dialog */
[data-vs-dialog] { max-width: min(980px, 92vw); }
.vs-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.vs-tabs button { padding: 6px 12px; border-radius: 6px; border: 1px solid #d0d0d0; background: transparent; color: inherit; cursor: pointer; }
.vs-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.vs-current { font-size: 12px; margin: 4px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; max-height: 52vh; overflow: auto; padding: 2px; }
.vs-card { border: 1px solid #d3d3d3; border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,.04); }
.vs-card.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.vs-thumb svg { width: 100%; height: auto; border-radius: 6px; display: block; }
.vs-name { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.vs-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.vs-actions button, .vs-row button, .vs-io button, .vs-multi button { min-height: 32px; padding: 4px 10px; }
.vs-sub { margin: 12px 0 6px; font-size: 12px; opacity: .8; }
.vs-multi, .vs-io { margin-top: 10px; }
.vs-viewlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 28vh; overflow: auto; margin: 6px 0; font-size: 12px; }
.vs-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.vs-pick { display: flex; gap: 8px; align-items: center; font-size: 12px; }
.vs-customize { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 16px; align-items: start; }
.vs-live { position: sticky; top: 0; }
.vs-live svg { width: 100%; height: auto; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.vs-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 12px; }
.vs-color { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; }
.vs-color input[type=color] { width: 44px; height: 30px; padding: 0; border: 1px solid #d0d0d0; border-radius: 6px; background: none; }
.vs-range { display: grid; grid-template-columns: 130px 1fr 44px; gap: 8px; align-items: center; font-size: 12px; margin: 4px 0; }
.vs-range input[type=range] { width: 100%; min-height: 28px; }
[data-vs-name] { flex: 1; min-width: 140px; }
@media (max-width: 760px) { .vs-customize { grid-template-columns: 1fr; } .vs-live { position: static; } }

.type-preview{display:flex;justify-content:center;padding:8px;margin:6px 0;border:1px solid var(--border,#d0d0d0);border-radius:6px;background:var(--panel,transparent)}
#delete-parking-type{color:#b3261e;border-color:#b3261e}

/* Callout / crop view: the frame must stay unfilled and the mask follows the dark canvas */
html.canvas-dark .drawing-view svg .crop-frame { fill: none !important; }
html.canvas-dark .drawing-view svg .crop-mask { fill: #141414 !important; }

.browser-count{opacity:.6;margin-inline-start:6px}

.view-context-menu { z-index: 2000; min-width: 190px; }
.view-context-menu .vm-title { padding: 6px 12px 2px; font-size: 11px; opacity: .6; text-transform: uppercase; letter-spacing: .04em; }
.view-context-menu .vm-sub { padding-inline-start: 24px; }
.view-context-menu hr { border: 0; border-top: 1px solid var(--line, #d5d5d5); margin: 4px 0; }
.view-context-menu button:disabled { opacity: .4; cursor: default; }

/* Visibility / Graphics dialog */
#modal:has([data-vg-dialog]) { width: min(1040px, 96vw); max-width: min(1040px, 96vw); max-height: 94vh; }
[data-vg-dialog] { width: 100%; }
.vg-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.vg-tabs { display: inline-flex; border: 1px solid var(--line, #cecece); border-radius: 8px; overflow: hidden; }
.vg-tabs button { border: 0; background: transparent; padding: 7px 18px; min-height: 36px; cursor: pointer; font-weight: 600; }
.vg-tabs button.active { background: var(--accent); color: #fff; }
.vg-search { flex: 1 1 180px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line, #cecece); border-radius: 8px; background: transparent; color: inherit; }
.vg-styled { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; white-space: nowrap; }
.vg-view, .vg-note { margin: 2px 0 8px; font-size: 12px; opacity: .8; }
.vg-scroll { max-height: min(56vh, 520px); overflow: auto; border: 1px solid var(--line, #d9d9d9); border-radius: 8px; }
.vg-table { width: 100%; border-collapse: collapse; font-size: 12px; direction: ltr; }
.vg-table th, .vg-table td { padding: 4px 8px; border-bottom: 1px solid var(--line, #e5e5e5); text-align: start; white-space: nowrap; }
.vg-table thead th { position: sticky; top: 0; background: var(--panel, #f5f5f5); z-index: 1; font-weight: 600; }
.vg-table tbody th { font-weight: 600; }
.vg-group td { background: rgba(120, 140, 120, .12); font-weight: 700; letter-spacing: .3px; }
.vg-show { text-align: center !important; width: 52px; }
.vg-table input[type="color"] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line, #cecece); border-radius: 4px; background: none; vertical-align: middle; }
.vg-table input[type="number"] { width: 58px; min-height: 28px; }
.vg-table input[type="range"] { width: 84px; vertical-align: middle; }
.vg-table select { min-height: 28px; max-width: 108px; }
.vg-table output { display: inline-block; min-width: 36px; text-align: end; font-variant-numeric: tabular-nums; }
.vg-c.set { background: rgb(var(--accent-rgb) / .1); }
.vg-na { opacity: .35; }
.vg-na * { pointer-events: none; }
.vg-hidden-row th, .vg-hidden-row td:not(.vg-show) { opacity: .45; }
.vg-x, .vg-reset { border: 0; background: transparent; cursor: pointer; padding: 0 5px; min-width: 24px; min-height: 24px; color: var(--accent-text); font-size: 14px; line-height: 1; }
.vg-empty { text-align: center !important; padding: 18px !important; opacity: .7; }
@media (pointer: coarse) {
  .vg-tabs button, .vg-search, .vg-table select, .vg-table input[type="number"] { min-height: 42px; }
  .vg-table input[type="color"] { width: 44px; height: 36px; }
  .vg-table input[type="range"] { width: 110px; height: 30px; }
  .vg-table input[type="checkbox"] { width: 22px; height: 22px; }
  .vg-x, .vg-reset { min-width: 36px; min-height: 36px; font-size: 18px; }
}
html.dark-theme .vg-tabs, html.dark-theme .vg-search, html.dark-theme .vg-scroll { border-color: #46535a; }
html.dark-theme .vg-table th, html.dark-theme .vg-table td { border-color: #3a454b; }
html.dark-theme .vg-table thead th { background: #242b32; }
html.dark-theme .vg-group td { background: rgba(255, 255, 255, .06); }

/* Library Groups dialog */
.lib-group-row{display:flex;align-items:center;gap:10px;padding:8px 4px;border-bottom:1px solid var(--line,#d9d6cf);grid-column:1/-1}
.lib-group-row b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lib-group-actions{display:flex;gap:6px;flex:none}

/* Object Manager tabs */
.om-tabs{display:flex;gap:4px;border-bottom:1px solid var(--line,#d9d6cf);margin:-4px 0 12px;overflow-x:auto;-webkit-overflow-scrolling:touch}
.om-tab{appearance:none;background:none;border:0;border-bottom:3px solid transparent;padding:10px 14px;min-height:44px;font:inherit;color:inherit;cursor:pointer;white-space:nowrap;display:inline-flex;align-items:center;gap:8px;touch-action:manipulation;opacity:.75}
.om-tab small{font-size:11px;opacity:.7}
.om-tab:hover{opacity:1}
.om-tab.active{border-bottom-color:var(--accent);opacity:1;font-weight:600}
.om-tab:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.om-body{min-height:240px}

/* Panel behaviour: Pinned / Collapsed / Auto-hide (floats open while the pointer is on the edge tab or the panel) */
.workspace > .browser-panel.ws-auto-open, .workspace > .properties-panel.ws-auto-open { display: flex; position: absolute; top: 0; bottom: 0; z-index: 45; background: #fafbf8; box-shadow: 0 0 28px rgba(0,0,0,.24); animation: ws-auto-in .14s ease-out; }
.workspace > .browser-panel.ws-auto-open { left: 0; width: 233px; border-right: 1px solid #e2e2e2; }
.workspace > .properties-panel.ws-auto-open { right: 0; width: 340px; border-left: 1px solid #e2e2e2; }
@keyframes ws-auto-in { from { opacity: .4; transform: translateX(var(--ws-from, -12px)); } to { opacity: 1; transform: none; } }
.workspace > .properties-panel.ws-auto-open { --ws-from: 12px; }
.edge-tab.ws-auto { border-style: dashed; }
.panel-mode-item { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.panel-mode-item small { opacity: .65; font-size: 11px; white-space: normal; }
.panel-mode-item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
html[data-ui-lang="ar"] .panel-mode-item { text-align: right; }
html.dark-theme .workspace > .browser-panel.ws-auto-open, html.dark-theme .workspace > .properties-panel.ws-auto-open { background: #1d2124; border-color: #2c3236; }
@media (pointer: coarse) { [data-panel-menu] { min-width: 36px; min-height: 36px; } .panel-mode-item { min-height: 52px; } }
@media (prefers-reduced-motion: reduce) { .workspace > .browser-panel.ws-auto-open, .workspace > .properties-panel.ws-auto-open { animation: none; } }

/* Sheets: viewports, drag preview and the "on a sheet" mark */
#sheet-view .sheet-viewport:hover .vp-outline[visibility="hidden"] { visibility: visible; stroke-opacity: .45; }
.sheet-drag-ghost { position: fixed; z-index: 900; pointer-events: none; padding: 6px 10px; background: #fff; border: 1px solid var(--accent); border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,.2); font-size: 12px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-drag-ghost[data-hint]:not([data-hint=""])::after { content: " · " attr(data-hint); opacity: .7; }
.sheet-drag-ghost.blocked { border-color: #c0392b; color: #c0392b; }
.sheet-drop-preview { position: absolute; z-index: 20; pointer-events: none; border: 2px dashed var(--accent); background: rgb(var(--accent-rgb) / .08); border-radius: 3px; display: flex; align-items: flex-start; justify-content: flex-start; }
.sheet-drop-preview::before { content: attr(data-label); margin: 6px 8px; font-size: 12px; font-weight: 600; color: #b9531a; }
body.sheet-dragging, body.sheet-dragging * { cursor: grabbing !important; user-select: none; }
.browser-row[data-drag-view] { touch-action: pan-y; }
.sheet-mark { display: inline-block; flex: none; width: 14px; height: 14px; margin-inline-start: auto; border-radius: 3px; background: var(--accent) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='white' stroke-width='1.6' d='M3 2.5h7l3 3V13.5H3z M10 2.5v3h3 M5.5 8.5h5 M5.5 11h5'/></svg>") center/12px no-repeat; position: relative; cursor: pointer; }
.sheet-mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sheet-mark::after { content: attr(data-tip); position: absolute; z-index: 300; inset-inline-end: 0; top: 18px; padding: 5px 8px; border-radius: 6px; background: #343434; color: #fff; font-size: 11px; white-space: nowrap; pointer-events: none; opacity: 0; transform: translateY(-2px); transition: opacity .12s, transform .12s; }
.sheet-mark:hover::after, .sheet-mark:focus-visible::after { opacity: 1; transform: none; }
.browser-row { position: relative; }
.sheet-vp-row { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.sheet-vp-row:hover { background: var(--accent-soft); }
.sheet-vp-row.active { border-color: var(--accent); background: var(--accent-soft); }
.sheet-vp-row > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-vp-remove { min-width: 28px; min-height: 28px; border-radius: 6px; }
.sheet-add { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 12px; }
@media (pointer: coarse) { .sheet-vp-row { min-height: 44px; } .sheet-vp-remove { min-width: 44px; min-height: 44px; } .sheet-mark { width: 22px; height: 22px; background-size: 16px; } }
html.dark-theme .sheet-drag-ghost { background: #272727; color: #ececec; }

/* Project Browser context menu: the row it belongs to stays marked, and a long press never selects text or opens the system callout */
.browser-row.ctx-target, summary.ctx-target { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.browser-tree { -webkit-touch-callout: none; }
.browser-tree .browser-row, .browser-tree summary { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.view-context-menu button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (pointer: coarse) { .view-context-menu button { min-height: 44px; } }

/* tools that do not belong in the current view (a drafting view is plain 2D drawing space) */
.ribbon-button.unavailable { opacity: .38; }

/* ---- Notes (Review) ---- */
#modal:has(.notes-dialog) { width: min(980px, 95vw); max-width: min(980px, 95vw); max-height: 92vh; }
#modal:has(.notes-dialog) #modal-body { max-height: 74vh; overflow: auto; }
.notes-dialog .nm-scope { margin: 0 0 10px; font-size: 13px; color: var(--muted, #686868); }
.notes-dialog .nm-badge { font-size: 11px; padding: 1px 6px; border-radius: 9px; background: #e9e4d6; color: #6a5a2a; }
.nm-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.nm-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.nm-form .full, .nm-form .dialog-footer { grid-column: 1 / -1; }
.nm-form textarea, .nm-form input, .nm-form select { font: inherit; }
.nm-attach ul { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.nm-attach li { display: flex; align-items: center; gap: 6px; border: 1px solid #d8d8d8; border-radius: 6px; padding: 3px 6px; font-size: 12px; }
.nm-attach li img { width: 28px; height: 28px; object-fit: cover; border-radius: 3px; }
.nm-attach-btn { cursor: pointer; color: var(--accent-text); font-weight: 600; }
.nm-attach-btn input { display: none; }
.nm-tabs { display: flex; gap: 4px; border-bottom: 1px solid #d8d8d8; margin-bottom: 8px; flex-wrap: wrap; }
.nm-tabs button { border: 0; background: transparent; padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; font: inherit; }
.nm-tabs button.active { border-bottom-color: var(--accent); font-weight: 700; }
.nm-count { display: inline-block; min-width: 18px; text-align: center; font-size: 11px; background: #f0f0f0; border-radius: 9px; padding: 0 5px; }
.nm-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.nm-toolbar input[type=search] { flex: 1 1 160px; min-width: 130px; }
.nm-date { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.nm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nm-table th { text-align: start; font-size: 11px; color: #717171; padding: 4px 6px; border-bottom: 1px solid #d8d8d8; }
.nm-table td { padding: 6px; border-bottom: 1px solid #efefef; vertical-align: middle; }
.nm-table tr.closed td:not(.nm-actions) { opacity: .6; }
.nm-table tr.archived td { font-style: italic; }
.nm-title { border: 0; background: transparent; cursor: pointer; font: inherit; font-weight: 600; padding: 0; text-align: start; color: inherit; }
.nm-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.nm-actions { white-space: nowrap; text-align: end; }
.nm-actions button { border: 1px solid transparent; background: transparent; cursor: pointer; border-radius: 4px; min-width: 28px; min-height: 28px; }
.nm-actions button:hover { background: #f0f0f0; }
.nm-empty { padding: 24px; text-align: center; color: #818181; }
.nm-print { margin-inline-end: auto; display: flex; gap: 6px; align-items: center; font-size: 12px; }
.nm-types { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.nm-types li { display: flex; gap: 8px; align-items: center; }
.nm-types li input { flex: 1; }
.nm-newtype { display: flex; gap: 8px; }
.nm-newtype input { flex: 1; }
.nm-msg { color: #b3402f; min-height: 1.2em; margin: 4px 0; font-size: 12px; }
#notes-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
#notes-layer .nl-leaders { position: absolute; inset: 0; }
.note-bubble { position: absolute; pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 0 8px; border: 1.5px solid; border-radius: 8px; background: #fffdf5; color: #313131; font-size: 12px; box-shadow: 0 2px 6px #0002; cursor: pointer; overflow: hidden; text-align: start; }
.note-bubble i { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.note-bubble span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html.dark-theme .note-bubble { background: #2e2e2e; color: #eaeaea; }
.note-pin { position: absolute; pointer-events: auto; width: 16px; height: 16px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 4px; background: #e08a1e; color: #fff; cursor: pointer; box-shadow: 0 1px 3px #0003; }
.note-pin.closed { background: #919191; }
@media (pointer: coarse) { .note-pin { width: 24px; height: 24px; } }

/* ---- Welcome screen & Home button ------------------------------------------------------------------------------------------------------ */
.home-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-inline: 2px 8px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: inherit; cursor: pointer; flex: none; }
.home-btn:hover, .home-btn:focus-visible { background: rgb(var(--accent-rgb) / .14); border-color: var(--accent); outline: none; }
body.welcome-open #app { display: none; }
#welcome { --wl-bg: #f6f4f1; --wl-surface: #fff; --wl-text: #202020; --wl-muted: #6f6f6f; --wl-line: #e3dfda; --wl-accent: var(--accent);
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--wl-bg); color: var(--wl-text); font-family: inherit; overflow: hidden; }
#welcome[hidden] { display: none; }
html.dark-theme #welcome { --wl-bg: #161616; --wl-surface: var(--white); --wl-text: #e5e5e5; --wl-muted: #9e9e9e; --wl-line: var(--line); }
.wl-top { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 20px; background: var(--wl-surface); border-bottom: 1px solid var(--wl-line); flex: none; }
.wl-logo { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 620; letter-spacing: -.5px; }
.wl-logo svg { background: var(--wl-accent); color: #fff; border-radius: 7px; padding: 5px; width: 32px; height: 33px; box-sizing: border-box; }
.wl-top-actions { display: flex; align-items: center; gap: 6px; }
.wl-icon { position: relative; display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--wl-text); cursor: pointer; font: inherit; font-weight: 600; }
.wl-icon:hover, .wl-icon:focus-visible { background: rgb(var(--accent-rgb) / .14); outline: none; }
.wl-badge { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--wl-accent); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 3px; }
.wl-avatar { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #3b3b3b; color: #fff; font-weight: 650; cursor: pointer; }
.wl-shell { flex: 1; display: flex; min-height: 0; }
.wl-nav { width: 220px; flex: none; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; background: var(--wl-surface); border-inline-end: 1px solid var(--wl-line); overflow: auto; }
.wl-nav button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--wl-text); font: inherit; text-align: start; cursor: pointer; }
.wl-nav button:hover { background: rgba(127, 127, 127, .12); }
.wl-nav button.on { background: rgb(var(--accent-rgb) / .16); color: var(--wl-accent); font-weight: 620; }
.wl-main { flex: 1; min-width: 0; overflow: auto; padding: 28px clamp(16px, 4vw, 48px) 48px; }
.wl-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.wl-hero h1 { margin: 0 0 4px; font-size: 26px; } .wl-hero p, .wl-muted { margin: 0; color: var(--wl-muted); }
.wl-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.wl-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid var(--wl-line); border-radius: 8px; background: var(--wl-surface); color: var(--wl-text); font: inherit; cursor: pointer; }
.wl-btn:hover { border-color: var(--wl-accent); }
.wl-btn.primary { background: var(--wl-accent); border-color: var(--wl-accent); color: #fff; font-weight: 620; }
.wl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.wl-head h2, #welcome h3 { margin: 0; font-size: 18px; } #welcome h3 { margin: 22px 0 10px; font-size: 15px; color: var(--wl-muted); }
.wl-link { border: 0; background: none; color: var(--wl-accent); font: inherit; cursor: pointer; }
.wl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.wl-card { position: relative; background: var(--wl-surface); border: 1px solid var(--wl-line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.wl-card:hover, .wl-card:focus-visible { box-shadow: 0 6px 20px rgba(0, 0, 0, .14); transform: translateY(-2px); outline: none; border-color: var(--wl-accent); }
.wl-thumb { aspect-ratio: 8 / 5; background: #fff; display: grid; place-items: center; border-bottom: 1px solid var(--wl-line); }
.wl-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; } .wl-thumb-empty { color: #b9b4ad; }
.wl-meta { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; } .wl-meta strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .wl-meta span { font-size: 12px; color: var(--wl-muted); }
.wl-pin { position: absolute; top: 8px; inset-inline-end: 8px; display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; cursor: pointer; opacity: .75; }
.wl-pin:hover, .wl-card:hover .wl-pin { opacity: 1; } .wl-pin.on { background: var(--wl-accent); opacity: 1; }
.wl-row .wl-pin { position: static; background: transparent; color: var(--wl-muted); } .wl-row .wl-pin.on { background: transparent; color: var(--wl-accent); }
.wl-tools { display: flex; gap: 8px; } .wl-tools input, .wl-tools select, .wl-field input, .wl-dialog input { padding: 8px 10px; border: 1px solid var(--wl-line); border-radius: 8px; background: var(--wl-surface); color: var(--wl-text); font: inherit; }
.wl-list { display: flex; flex-direction: column; gap: 8px; }
.wl-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--wl-surface); border: 1px solid var(--wl-line); border-radius: 10px; cursor: pointer; } .wl-row:hover { border-color: var(--wl-accent); }
.wl-rowthumb { width: 64px; height: 40px; border-radius: 6px; background: #fff; border: 1px solid var(--wl-line); overflow: hidden; flex: none; } .wl-rowthumb img { width: 100%; height: 100%; object-fit: cover; }
.wl-rowname { flex: 1; min-width: 0; display: flex; flex-direction: column; } .wl-rowname span { font-size: 12px; color: var(--wl-muted); }
.wl-panel { background: var(--wl-surface); border: 1px solid var(--wl-line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; max-width: 760px; } .wl-panel p { margin: 0; }
.wl-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--wl-line); background: none; color: var(--wl-text); font: inherit; text-align: start; cursor: pointer; } .wl-item:last-child { border-bottom: 0; } .wl-item:hover { color: var(--wl-accent); } .wl-item span { font-size: 12px; color: var(--wl-muted); }
.wl-news { background: var(--wl-surface); border: 1px solid var(--wl-line); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; } .wl-news small { color: var(--wl-accent); } .wl-news p { margin: 0; color: var(--wl-muted); }
.wl-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--wl-muted); }
.wl-bar { height: 8px; border-radius: 4px; background: var(--wl-line); overflow: hidden; } .wl-bar i { display: block; height: 100%; background: var(--wl-accent); }
.wl-empty { max-width: 460px; margin: 8vh auto 0; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; } .wl-empty p { margin: 0; color: var(--wl-muted); } .wl-empty h2 { margin: 0; font-size: 24px; } .wl-empty .wl-actions { justify-content: center; margin-top: 8px; }
.wl-empty-mark svg { background: var(--wl-accent); color: #fff; border-radius: 12px; padding: 12px; width: 60px; height: 62px; box-sizing: border-box; }
.wl-dialog-wrap { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(0, 0, 0, .45); }
.wl-dialog { width: min(420px, 92vw); padding: 20px; border-radius: 12px; background: #fff; color: #202020; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 16px 48px rgba(0, 0, 0, .35); }
html.dark-theme .wl-dialog { background: var(--white); color: #e5e5e5; } .wl-dialog h3 { margin: 0; font-size: 17px; } .wl-dialog p { margin: 0; opacity: .8; }
.wl-dialog .wl-btn { background: transparent; color: inherit; } .wl-dialog .wl-btn.primary { background: var(--accent); color: #fff; } .wl-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }
@media (max-width: 900px) { .wl-nav { width: 64px; padding: 10px 6px; } .wl-nav button span { display: none; } .wl-nav button { justify-content: center; } .wl-main { padding: 20px 16px 40px; } }
@media (max-width: 600px) { .wl-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); } .wl-top { padding: 0 12px; } }

/* ---- Reva Board ------------------------------------------------------------------------------------------------------------------------------- */
#board-app { --bd-bg: #e9e6e1; --bd-panel: #fff; --bd-text: #202020; --bd-muted: #6f6f6f; --bd-line: #dcd8d2; --bd-acc: var(--accent); --bd-stage: #d8d4ce;
  position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: var(--bd-bg); color: var(--bd-text); font-family: inherit; font-size: 13px; }
#board-app[hidden] { display: none; }
#board-app.dark { --bd-bg: #161616; --bd-panel: #202020; --bd-text: #e5e5e5; --bd-muted: #9e9e9e; --bd-line: #353535; --bd-stage: #101010; }
.bd-top { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: var(--bd-panel); border-bottom: 1px solid var(--bd-line); flex: none; flex-wrap: wrap; }
.bd-grow { flex: 1; }
.bd-ib { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--bd-text); cursor: pointer; font: inherit; position: relative; }
.bd-ib.sm { min-width: 24px; height: 24px; padding: 0 3px; border-radius: 6px; }
.bd-ib:hover:not(:disabled) { background: rgb(var(--accent-rgb) / .14); }
.bd-ib:disabled { opacity: .35; cursor: default; }
.bd-ib.on { background: rgb(var(--accent-rgb) / .22); color: var(--bd-acc); border-color: rgb(var(--accent-rgb) / .5); }
.bd-ib.off { opacity: .4; }
.bd-linkbtn b { position: absolute; top: 1px; inset-inline-end: 1px; min-width: 14px; font-size: 10px; background: var(--bd-acc); color: #fff; border-radius: 7px; text-align: center; }
.bd-linkbtn b:empty { display: none; }
#bd-name { width: 200px; padding: 6px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--bd-text); font: inherit; font-weight: 620; }
#bd-name:hover, #bd-name:focus { border-color: var(--bd-line); background: var(--bd-bg); outline: none; }
.bd-saved { font-size: 11px; color: var(--bd-muted); min-width: 56px; } .bd-saved.bad { color: #d33; }
.bd-seg { display: inline-flex; border: 1px solid var(--bd-line); border-radius: 8px; overflow: hidden; }
.bd-seg button { display: inline-flex; gap: 5px; align-items: center; padding: 6px 10px; border: 0; background: transparent; color: var(--bd-text); cursor: pointer; font: inherit; }
.bd-seg button.on { background: var(--bd-acc); color: #fff; }
.bd-zoom { display: inline-flex; align-items: center; } .bd-zl { min-width: 52px; border: 0; background: transparent; color: var(--bd-text); cursor: pointer; font: inherit; }
.bd-options { display: flex; gap: 14px; align-items: center; padding: 5px 12px; background: var(--bd-panel); border-bottom: 1px solid var(--bd-line); flex: none; }
.bd-options[hidden] { display: none; }
.bd-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--bd-muted); } .bd-opt input[type=color] { width: 30px; height: 24px; padding: 0; border: 1px solid var(--bd-line); background: none; }
.bd-opt select, .bd-f input, .bd-f select, .bd-f textarea, .bd-pick-search, .bd-mrow input:not([type=color]) { padding: 5px 7px; border: 1px solid var(--bd-line); border-radius: 6px; background: var(--bd-bg); color: var(--bd-text); font: inherit; min-width: 0; }
.bd-sw { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--bd-line); cursor: pointer; } .bd-sw.on { border-color: var(--bd-acc); }
.bd-body { flex: 1; display: flex; min-height: 0; }
.bd-tools { width: 48px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; background: var(--bd-panel); border-inline-end: 1px solid var(--bd-line); overflow-y: auto; }
.bd-tools hr { width: 26px; border: 0; border-top: 1px solid var(--bd-line); margin: 4px 0; }
.bd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bd-stagewrap { flex: 1; position: relative; min-height: 0; display: grid; grid-template-columns: 22px 1fr; grid-template-rows: 22px 1fr; }
.bd-stagewrap canvas { display: block; } #bd-ruler-h { grid-column: 2; grid-row: 1; width: 100%; height: 22px; } #bd-ruler-v { grid-column: 1; grid-row: 2; width: 22px; height: 100%; cursor: crosshair; } #bd-ruler-h { cursor: crosshair; }
.bd-corner { background: var(--bd-panel); }
#board-app.no-rulers .bd-stagewrap { grid-template-columns: 0 1fr; grid-template-rows: 0 1fr; } #board-app.no-rulers #bd-ruler-h, #board-app.no-rulers #bd-ruler-v, #board-app.no-rulers .bd-corner { display: none; }
.bd-stage { grid-column: 2; grid-row: 2; position: relative; overflow: hidden; background: var(--bd-stage); touch-action: none; }
#board-app.no-rulers .bd-stage { grid-column: 2; grid-row: 2; }
#bd-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; }
.bd-edit { position: absolute; z-index: 5; border: 1.5px solid var(--bd-acc); border-radius: 2px; resize: none; outline: none; font-family: Arial, 'Noto Sans Arabic', Tahoma, sans-serif; overflow: hidden; transform-origin: center; }
.bd-float { position: absolute; top: 10px; inset-inline-start: 10px; width: 250px; max-height: 70%; overflow: auto; background: var(--bd-panel); border: 1px solid var(--bd-line); border-radius: 10px; padding: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); z-index: 6; }
.bd-float[hidden] { display: none; }
.bd-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; } .bd-tabs button { padding: 3px 8px; border: 1px solid var(--bd-line); border-radius: 12px; background: transparent; color: var(--bd-text); cursor: pointer; font-size: 11px; } .bd-tabs button.on { background: var(--bd-acc); border-color: var(--bd-acc); color: #fff; }
.bd-stkgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; } .bd-stk { aspect-ratio: 1; padding: 4px; border: 1px solid var(--bd-line); border-radius: 8px; background: #fff; cursor: pointer; display: grid; place-items: center; } .bd-stk:hover { border-color: var(--bd-acc); } .bd-stk svg, .bd-stk img { width: 100%; height: 100%; object-fit: contain; }
.bd-pages { display: none; align-items: center; gap: 10px; padding: 6px 10px; background: var(--bd-panel); border-top: 1px solid var(--bd-line); flex: none; }
#board-app .bd-pages { display: flex; }
.bd-pagelist { flex: 1; display: flex; gap: 8px; overflow-x: auto; padding: 2px; } .bd-page { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; } .bd-page small { color: var(--bd-muted); }
.bd-thumb { border: 2px solid var(--bd-line); border-radius: 4px; background: #fff; overflow: hidden; line-height: 0; } .bd-page.on .bd-thumb { border-color: var(--bd-acc); }
.bd-pageact { display: flex; align-items: center; gap: 4px; } .bd-pageact select { padding: 5px; border: 1px solid var(--bd-line); border-radius: 6px; background: var(--bd-bg); color: var(--bd-text); font: inherit; }
.bd-side { width: 280px; flex: none; display: flex; flex-direction: column; overflow-y: auto; background: var(--bd-panel); border-inline-start: 1px solid var(--bd-line); }
#board-app:not(.layers-open) #bd-layers { display: none; }
.bd-ph { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; }
#bd-layers { border-bottom: 1px solid var(--bd-line); max-height: 45%; overflow-y: auto; flex: none; }
.bd-layer { display: flex; align-items: center; gap: 1px; padding: 2px 6px; cursor: pointer; border-inline-start: 3px solid transparent; } .bd-layer.active { background: rgb(var(--accent-rgb) / .12); border-inline-start-color: var(--bd-acc); } .bd-layer.dim .bd-lname { opacity: .5; } .bd-layer.drop { outline: 2px dashed var(--bd-acc); }
.bd-lname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; } .bd-lrename { flex: 1; min-width: 0; padding: 2px 4px; border: 1px solid var(--bd-acc); border-radius: 4px; background: var(--bd-bg); color: var(--bd-text); font: inherit; }
.bd-count { font-size: 10px; color: var(--bd-muted); padding: 0 4px; }
.bd-litem { padding: 3px 10px 3px 38px; font-size: 12px; cursor: pointer; border-radius: 4px; margin: 0 6px; } .bd-litem:hover { background: rgba(127, 127, 127, .12); } .bd-litem.sel { background: rgba(47, 111, 228, .2); } .bd-litem.dim { opacity: .5; }
#bd-props { padding-bottom: 20px; } #bd-props .bd-f, .bd-dlg-body .bd-f { display: flex; flex-direction: column; gap: 3px; margin: 6px 12px; font-size: 12px; color: var(--bd-muted); }
.bd-dlg-body .bd-f { margin: 6px 0; } .bd-f.bd-inline { flex-direction: row; align-items: center; gap: 6px; }
.bd-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 4px; } #bd-props .bd-grid2 { margin: 0 6px; } .bd-dlg-body .bd-grid2 { gap: 0 10px; }
.bd-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 12px; } #bd-props .wl-btn, .bd-dlg-body .wl-btn { color: var(--bd-text); }
#board-app .wl-btn { background: var(--bd-panel); color: var(--bd-text); border-color: var(--bd-line); } #board-app .wl-btn.primary { background: var(--bd-acc); border-color: var(--bd-acc); color: #fff; } .wl-btn.sm { padding: 4px 9px; font-size: 12px; }
#board-app .wl-muted, .bd-dlg-body .wl-muted { color: var(--bd-muted); margin: 6px 12px; font-size: 12px; } .bd-dlg-body .wl-muted { margin: 6px 0; }
.bd-dlg .wl-dialog { background: #fff; } .wl-dialog.wide { width: min(560px, 94vw); max-height: 88vh; overflow: auto; } .bd-dlg-body { max-height: 62vh; overflow: auto; } .bd-dlg-body h4 { margin: 14px 0 6px; font-size: 13px; }
.bd-dlg-err { color: #d33; margin: 6px 0 0; }
.bd-pick-list { max-height: 300px; overflow: auto; margin-top: 8px; display: flex; flex-direction: column; } .bd-pick { display: flex; gap: 8px; align-items: center; padding: 7px 4px; border-bottom: 1px solid rgba(127, 127, 127, .2); cursor: pointer; } .bd-pick-search { width: 100%; box-sizing: border-box; }
.bd-linklist { display: flex; flex-direction: column; } .bd-linkrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px; border-bottom: 1px solid rgba(127, 127, 127, .2); }
.bd-mrow { display: grid; grid-template-columns: 34px 1.2fr 1fr 1fr 28px; gap: 6px; margin: 6px 0; align-items: center; } .bd-mrow input[type=color] { width: 34px; height: 30px; padding: 0; border: 1px solid #ccc; }
html.dark-theme .bd-dlg .wl-dialog { background: var(--white); }
.wl-cardact { position: absolute; top: 6px; inset-inline-start: 6px; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; background: rgba(0, 0, 0, .55); border-radius: 8px; } .wl-card:hover .wl-cardact, .wl-card:focus-within .wl-cardact { opacity: 1; } .wl-cardact .wl-icon { color: #fff; min-width: 28px; height: 28px; }
@media (hover: none) { .wl-cardact { opacity: 1; } }
body.board-open { overflow: hidden; }
#board-app.present .bd-top, #board-app.present .bd-options, #board-app.present .bd-tools, #board-app.present .bd-side, #board-app.present .bd-pages, #board-app.present #bd-ruler-h, #board-app.present #bd-ruler-v, #board-app.present .bd-corner { display: none; }
#board-app.present .bd-stagewrap { grid-template-columns: 0 1fr; grid-template-rows: 0 1fr; } #board-app.present .bd-stage { background: #000; }
@media (max-width: 900px) { .bd-side { width: 220px; } #bd-name { width: 120px; } }
@media (max-width: 700px) { .bd-side { position: absolute; inset-inline-end: 0; top: 98px; bottom: 0; z-index: 8; width: 240px; box-shadow: -4px 0 16px rgba(0, 0, 0, .25); } }

#bd-props .bd-f input:not([type=checkbox]):not([type=range]):not([type=color]), #bd-props .bd-f select, #bd-props .bd-f textarea { width: 100%; box-sizing: border-box; }
#bd-props .bd-f input[type=color] { width: 100%; height: 28px; padding: 0; border: 1px solid var(--bd-line); background: none; }
#bd-props .bd-f.bd-inline { flex-direction: row; align-items: center; gap: 6px; color: var(--bd-text); }
#bd-props .bd-grid2 .bd-f { margin: 4px 6px; }

/* ---- Reva Board V2 ---- */
.bd-quick { position: absolute; z-index: 55; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; max-width: min(96%, 640px); padding: 4px 6px; background: var(--bd-panel); border: 1px solid var(--bd-line); border-radius: 10px; box-shadow: 0 6px 22px rgba(0,0,0,.22); }
.bd-quick[hidden] { display: none; }
.bd-quick .bd-ib.sm { width: 32px; height: 32px; } .bd-quick select { height: 28px; padding: 2px 4px; border: 1px solid var(--bd-line); border-radius: 6px; background: var(--bd-bg); color: var(--bd-text); font: inherit; font-size: 12px; max-width: 86px; }
.bd-qc { display: inline-flex; } .bd-qc input[type=color] { width: 28px; height: 28px; padding: 0; border: 1px solid var(--bd-line); border-radius: 6px; background: none; cursor: pointer; }
.bd-qr input[type=range] { width: 70px; vertical-align: middle; }
.bd-danger:not(:disabled):hover { color: #d33; } #bd-del:disabled { opacity: .35; }
.bd-addpage { flex: none; white-space: nowrap; }
.bd-page small { max-width: 116px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-annot { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); }
.bd-bgopts { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; } .bd-bgopt { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 12px; cursor: pointer; } .bd-bgopt svg { border: 2px solid var(--bd-line); border-radius: 4px; background: #fff; } .bd-bgopt input { position: absolute; opacity: 0; } .bd-bgopt:has(input:checked) svg { border-color: var(--bd-acc); }
.bd-hud { display: none; position: fixed; inset-block-end: 16px; inset-inline: 0; margin-inline: auto; width: max-content; z-index: 10; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 22px; background: rgba(0,0,0,.55); color: #fff; opacity: .35; transition: opacity .2s; }
.bd-hud:hover, .bd-hud:focus-within { opacity: 1; } .bd-hud button { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #fff; font-size: 22px; cursor: pointer; } .bd-hud button:hover { background: rgba(255,255,255,.2); }
#board-app.present .bd-hud { display: flex; } #board-app.present .bd-quick { display: none; }
@media (pointer: coarse) { .bd-quick .bd-ib.sm { width: 40px; height: 40px; } .bd-qc input[type=color] { width: 36px; height: 36px; } .bd-quick select { height: 36px; } }

.bd-main { min-height: 0; } .bd-stagewrap { grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: 22px minmax(0, 1fr); overflow: hidden; } .bd-stage, #bd-ruler-v { min-height: 0; }
#board-app.no-rulers .bd-stagewrap, #board-app.present .bd-stagewrap { grid-template-columns: 0 minmax(0, 1fr); grid-template-rows: 0 minmax(0, 1fr); }

/* Project Tracker */
.wl-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--wl-line); margin-bottom: 12px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.wl-tabs button { flex: none; display: inline-flex; gap: 6px; align-items: center; padding: 9px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--wl-muted); font: inherit; cursor: pointer; white-space: nowrap; }
.wl-tabs button b { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: var(--wl-line); color: var(--wl-text); }
.wl-tabs button.on { color: var(--wl-accent); border-bottom-color: var(--wl-accent); font-weight: 620; } .wl-tabs button:hover { color: var(--wl-text); }
.wl-tablewrap { overflow-x: auto; border: 1px solid var(--wl-line); border-radius: 12px; background: var(--wl-surface); }
.wl-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 900px; } .wl-table td.notes { min-width: 70px; }
.wl-table th { text-align: start; padding: 10px 12px; font-size: 12px; font-weight: 620; color: var(--wl-muted); background: color-mix(in srgb, var(--wl-line) 35%, transparent); border-bottom: 1px solid var(--wl-line); white-space: nowrap; user-select: none; }
.wl-table th[data-tsort] { cursor: pointer; } .wl-table th.on { color: var(--wl-text); }
.wl-table td { padding: 8px 9px; border-bottom: 1px solid var(--wl-line); vertical-align: middle; } .wl-table tbody tr:last-child td { border-bottom: 0; } .wl-table tbody tr:hover { background: color-mix(in srgb, var(--wl-line) 25%, transparent); }
.wl-table td.num { white-space: nowrap; font-variant-numeric: tabular-nums; } .wl-table td.notes { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wl-muted); } .wl-table td.empty { text-align: center; padding: 28px; }
.wl-table td.act { white-space: nowrap; text-align: end; } .wl-table td.act .wl-btn { padding: 5px 10px; font-size: 12px; }
.wl-table select { padding: 5px 8px; border: 1px solid var(--wl-line); border-radius: 6px; background: var(--wl-surface); color: var(--wl-text); font: inherit; max-width: 128px; }
.wl-form, .wl-lists { max-height: 90vh; overflow: auto; } .wl-form .wl-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; } .wl-form input, .wl-form select, .wl-form textarea { padding: 8px 10px; border: 1px solid var(--wl-line, #ccc); border-radius: 8px; background: transparent; color: inherit; font: inherit; }
.wl-err { color: #d33; margin: 0; } .wl-lists h4 { margin: 10px 0 6px; font-size: 13px; opacity: .7; } .wl-optrow { display: flex; gap: 6px; margin-bottom: 6px; } .wl-optrow input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid rgba(128,128,128,.4); border-radius: 8px; background: transparent; color: inherit; font: inherit; }
@media (max-width: 760px) { .wl-tools { flex-wrap: wrap; } .wl-table td, .wl-table th { padding: 8px; } .wl-tabs button { padding: 10px 12px; } }

/* Board: toolbar placement, focus mode, home / language, eraser */
.bd-topwrap { flex: none; display: flex; flex-direction: column; z-index: 40; }
.bd-work { flex: 1; min-width: 0; min-height: 0; display: flex; position: relative; }
#board-app .bd-main { position: relative; }
.bd-lang { font-weight: 700; font-size: 13px; min-width: 34px; }
/* toolbar: a grid so it can be 1 or 2 rows / columns, docked on any side or floating */
#board-app .bd-body { flex-direction: row; }
#board-app[data-dock="end"] .bd-body { flex-direction: row-reverse; }
#board-app[data-dock="top"] .bd-body { flex-direction: column; }
#board-app[data-dock="bottom"] .bd-body { flex-direction: column-reverse; }
#board-app .bd-tools { display: grid; gap: 2px; padding: 6px; align-content: start; justify-content: start; width: auto; height: auto; overflow: auto; scrollbar-width: thin; }
#board-app .bd-tools hr { display: none; }
#board-app .bd-tools .bd-ib { width: 100%; height: 100%; min-width: 0; padding: 0; }
#board-app .bd-tools .bd-ib.bd-grip { cursor: grab; touch-action: none; opacity: .6; } #board-app .bd-tools .bd-ib.bd-grip:active { cursor: grabbing; }
#board-app:is([data-dock="start"], [data-dock="end"], [data-dock="float"]) .bd-tools { grid-template-columns: repeat(var(--bd-lines, 1), 38px); grid-auto-rows: 38px; }
#board-app:is([data-dock="start"], [data-dock="end"], [data-dock="float"]) .bd-tools .bd-grip { grid-column: 1 / -1; height: 20px; }
#board-app:is([data-dock="top"], [data-dock="bottom"]) .bd-tools { grid-auto-flow: column; grid-template-rows: repeat(var(--bd-lines, 1), 38px); grid-auto-columns: 38px; }
#board-app:is([data-dock="top"], [data-dock="bottom"]) .bd-tools .bd-grip { grid-row: 1 / -1; width: 22px; height: 100%; }
#board-app[data-dock="end"] .bd-tools { border-inline-end: 0; border-inline-start: 1px solid var(--bd-line); }
#board-app[data-dock="top"] .bd-tools { border-inline-end: 0; border-bottom: 1px solid var(--bd-line); }
#board-app[data-dock="bottom"] .bd-tools { border-inline-end: 0; border-top: 1px solid var(--bd-line); }
#board-app[data-dock="float"] .bd-tools { position: absolute; z-index: 50; max-height: calc(100% - 16px); gap: 1px; padding: 4px; background: color-mix(in srgb, var(--bd-panel) 94%, transparent); border: 1px solid var(--bd-line); border-radius: 10px; box-shadow: 0 4px 16px rgba(0, 0, 0, .18); backdrop-filter: blur(6px); }
.bd-snapzone { position: absolute; z-index: 49; background: rgb(var(--accent-rgb) / .22); border: 2px dashed var(--bd-acc); border-radius: 8px; pointer-events: none; } .bd-snapzone[hidden] { display: none; }
/* focus mode */
.bd-pill, .bd-edge { display: none; }
#board-app:not([data-focus="pinned"]) .bd-pill { display: flex; position: absolute; z-index: 56; top: 8px; inset-inline-end: 8px; gap: 2px; padding: 3px; background: var(--bd-panel); border: 1px solid var(--bd-line); border-radius: 10px; box-shadow: 0 4px 16px rgba(0, 0, 0, .2); opacity: .85; } .bd-pill:hover, .bd-pill:focus-within { opacity: 1; }
#board-app[data-focus="auto"].rv-top .bd-pill { display: none; }
#board-app[data-focus="hidden"] .bd-topwrap, #board-app[data-focus="hidden"] .bd-side, #board-app[data-focus="hidden"] .bd-pages { display: none; }
#board-app[data-focus="auto"] .bd-topwrap { position: absolute; inset-inline: 0; top: 0; z-index: 55; transform: translateY(-100%); transition: transform .15s; box-shadow: 0 6px 20px rgba(0, 0, 0, .22); }
#board-app[data-focus="auto"].rv-top .bd-topwrap { transform: none; }
#board-app[data-focus="auto"] .bd-side { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; z-index: 45; transform: translateX(100%); transition: transform .15s; box-shadow: -6px 0 20px rgba(0, 0, 0, .2); }
#board-app[data-focus="auto"][dir="rtl"] .bd-side { transform: translateX(-100%); box-shadow: 6px 0 20px rgba(0, 0, 0, .2); }
#board-app[data-focus="auto"].rv-side .bd-side, #board-app[data-focus="auto"][dir="rtl"].rv-side .bd-side { transform: none; }
#board-app[data-focus="auto"] .bd-pages { position: absolute; inset-inline: 0; bottom: 0; z-index: 45; transform: translateY(100%); transition: transform .15s; box-shadow: 0 -6px 20px rgba(0, 0, 0, .2); }
#board-app[data-focus="auto"].rv-bottom .bd-pages { transform: none; }
#board-app[data-focus="auto"] .bd-edge { display: block; position: absolute; z-index: 54; border: 0; padding: 0; background: transparent; cursor: pointer; }
#board-app[data-focus="auto"] .bd-edge::after { content: ""; position: absolute; background: var(--bd-acc); opacity: .55; border-radius: 3px; transition: opacity .12s; } #board-app[data-focus="auto"] .bd-edge:hover::after { opacity: 1; }
#board-app[data-focus="auto"] .bd-edge[data-edge="top"] { top: 0; left: 50%; width: 120px; height: 14px; transform: translateX(-50%); } #board-app .bd-edge[data-edge="top"]::after { left: 20px; right: 20px; top: 2px; height: 4px; }
#board-app[data-focus="auto"] .bd-edge[data-edge="bottom"] { bottom: 0; left: 50%; width: 120px; height: 14px; transform: translateX(-50%); } #board-app .bd-edge[data-edge="bottom"]::after { left: 20px; right: 20px; bottom: 2px; height: 4px; }
#board-app[data-focus="auto"] .bd-edge[data-edge="side"] { inset-inline-end: 0; top: 50%; width: 14px; height: 120px; transform: translateY(-50%); } #board-app .bd-edge[data-edge="side"]::after { top: 20px; bottom: 20px; inset-inline-end: 2px; width: 4px; }
#board-app.rv-top .bd-edge[data-edge="top"], #board-app.rv-side .bd-edge[data-edge="side"], #board-app.rv-bottom .bd-edge[data-edge="bottom"] { display: none; }
#board-app.present .bd-pill, #board-app.present .bd-edge, #board-app.present .bd-snapzone { display: none !important; }
#board-app.present .bd-topwrap, #board-app.present .bd-work > .bd-side { display: none; }
.bd-menu { position: absolute; z-index: 70; width: 280px; padding: 6px; display: flex; flex-direction: column; gap: 2px; background: var(--bd-panel); color: var(--bd-text); border: 1px solid var(--bd-line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .3); }
.bd-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; padding: 9px 12px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.bd-menu button small { color: var(--bd-muted); white-space: normal; } .bd-menu button:hover { background: rgb(var(--accent-rgb) / .12); } .bd-menu button.on { background: rgb(var(--accent-rgb) / .2); box-shadow: inset 3px 0 0 var(--bd-acc); }
[dir="rtl"] .bd-menu button.on { box-shadow: inset -3px 0 0 var(--bd-acc); }
@media (pointer: coarse) { #board-app:is([data-dock="start"], [data-dock="end"], [data-dock="float"]) .bd-tools { grid-template-columns: repeat(var(--bd-lines, 1), 44px); grid-auto-rows: 44px; } #board-app:is([data-dock="top"], [data-dock="bottom"]) .bd-tools { grid-template-rows: repeat(var(--bd-lines, 1), 44px); grid-auto-columns: 44px; } .bd-menu button { min-height: 52px; } }
@media (prefers-reduced-motion: reduce) { #board-app .bd-topwrap, #board-app .bd-side, #board-app .bd-pages { transition: none !important; } }

/* Welcome V2: Home layout, quick actions, unified search, Suggestions & Reports */
.wl-welcome { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 8px 0 24px; text-align: center; }
.wl-welcome h1 { margin: 0; font-size: clamp(26px, 3.4vw, 38px); letter-spacing: -.5px; }
.wl-bigsearch { display: flex; align-items: center; gap: 10px; width: min(720px, 100%); padding: 0 16px; height: 50px; background: var(--wl-surface); border: 1px solid var(--wl-line); border-radius: 14px; color: var(--wl-muted); box-shadow: 0 2px 10px rgba(0, 0, 0, .05); }
.wl-bigsearch:focus-within { border-color: var(--wl-accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .2); color: var(--wl-accent); }
.wl-bigsearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--wl-text); font: inherit; font-size: 16px; } .wl-bigsearch input::-webkit-search-cancel-button { cursor: pointer; }
.wl-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 34px; }
.wl-qcard, .wl-fbkind { display: flex; align-items: center; justify-content: flex-start; gap: 14px; padding: 18px 20px; background: var(--wl-surface); border: 1px solid var(--wl-line); border-radius: 14px; color: var(--wl-text); font: inherit; text-align: start; cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.wl-qcard:hover, .wl-qcard:focus-visible, .wl-fbkind:hover, .wl-fbkind:focus-visible { border-color: var(--wl-accent); box-shadow: 0 6px 20px rgba(0, 0, 0, .12); transform: translateY(-2px); outline: none; } .wl-fbkind.on { border-color: var(--wl-accent); background: rgb(var(--accent-rgb) / .1); }
.wl-qicon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: rgb(var(--accent-rgb) / .15); color: var(--wl-accent); }
.wl-qtext { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .wl-qtext strong { font-size: 16px; } .wl-qtext small { color: var(--wl-muted); font-size: 12.5px; white-space: normal; }
.wl-sec { margin-bottom: 34px; } .wl-sec > .wl-head { margin-bottom: 16px; }
.wl-emptybox { padding: 26px; text-align: center; color: var(--wl-muted); background: var(--wl-surface); border: 1px dashed var(--wl-line); border-radius: 14px; } .wl-emptybox p { margin: 0; }
.wl-newsgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.wl-fbkinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 900px; margin: 14px 0; }
.wl-lead { margin: -4px 0 8px; } .wl-fbform { max-width: 900px; margin-top: 8px; gap: 14px; }
.wl-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.wl-fbform input[name], .wl-fbform select, .wl-fbform textarea { min-height: 38px; padding: 9px 11px; border: 1px solid var(--wl-line); border-radius: 8px; background: var(--wl-bg); color: var(--wl-text); font: inherit; resize: vertical; } .wl-fbform :is(input, select, textarea):focus { outline: 2px solid var(--wl-accent); outline-offset: -1px; }
.wl-fbimg { display: flex; align-items: center; gap: 10px; } .wl-fbimg img { height: 64px; max-width: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--wl-line); } .wl-fbimg span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--wl-muted); }
.wl-fbattach { align-self: flex-start; }
.wl-ok { display: flex; flex-direction: column; gap: 2px; max-width: 900px; padding: 12px 16px; margin: 4px 0 8px; border: 1px solid #2e9e5b; background: rgba(46, 158, 91, .12); border-radius: 10px; } .wl-ok strong { display: flex; align-items: center; gap: 6px; color: #2e9e5b; } .wl-ok span { color: var(--wl-muted); font-size: 12.5px; }
.wl-fblist { display: flex; flex-direction: column; gap: 8px; max-width: 900px; margin-bottom: 10px; }
.wl-fbitem { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--wl-surface); border: 1px solid var(--wl-line); border-radius: 10px; }
.wl-fbtag { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 12px; font-size: 12px; background: rgb(var(--accent-rgb) / .15); color: var(--wl-accent); } .wl-fbtag.problem { background: rgba(214, 51, 51, .14); color: #d63333; }
.wl-fbtext { flex: 1; min-width: 0; display: flex; flex-direction: column; } .wl-fbtext strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wl-fbtext span { font-size: 12px; color: var(--wl-muted); }
@media (max-width: 900px) { .wl-quick { gap: 10px; } .wl-qcard { padding: 14px; gap: 10px; } .wl-qicon { width: 40px; height: 40px; } .wl-newsgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .wl-quick, .wl-newsgrid, .wl-fbkinds { grid-template-columns: 1fr; } }
#board-app[data-dock="float"] .bd-tools { grid-template-columns: repeat(var(--bd-lines, 1), 34px); grid-auto-rows: 34px; }
@media (pointer: coarse) { #board-app[data-dock="float"] .bd-tools { grid-template-columns: repeat(var(--bd-lines, 1), 44px); grid-auto-rows: 44px; } }
#board-app[data-dock="float"] .bd-tools .bd-grip { height: 18px; grid-auto-rows: auto; }
#board-app[data-dock="float"] .bd-float { inset-inline-start: 62px; }   /* the stickers panel opens next to the floating toolbar, not under it */

/* ---- Split View: the open views side by side, each side with its own tabs ---- */
body.split-on #view-tabs { display: none; }
.sv-host { flex: 1; min-height: 0; min-width: 0; display: flex; direction: ltr; background: #e2e2e2; }
.sv-host[data-mode="v"] { flex-direction: row; }
.sv-host[data-mode="h"] { flex-direction: column; }
.sv-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fff; position: relative; }
.sv-pane .sv-tabs { height: 37px; min-height: 37px; display: flex; align-items: stretch; background: #f3f3f3; border-bottom: 1px solid #e2e2e2; overflow-x: auto; overflow-y: hidden; touch-action: pan-x; scrollbar-width: none; }
.sv-pane .sv-tabs .view-tab { min-width: 100px; touch-action: none; user-select: none; }
.sv-pane:not(.on) .sv-tabs .view-tab.active { color: #818181; border-top-color: #cecece; }
.sv-pane.on .sv-tabs { box-shadow: inset 0 -2px 0 var(--accent); }
.sv-body { flex: 1; min-height: 0; min-width: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.sv-body > .view-area { flex: 1; }
.sv-pane:not(.on) .sv-body { cursor: pointer; }
.sv-mirror { position: absolute; inset: 0; background: #eaeaea; overflow: hidden; }
.sv-mirror .drawing-view, .sv-mirror .sheet-view, .sv-mirror .schedule-view { pointer-events: none; }
.sv-mirror .sv-shot { width: 100%; height: 100%; display: block; object-fit: contain; }
.sv-mirror .sv-empty { margin: 24px; color: #888888; font-size: 13px; }
.sv-mirror::after { content: ""; position: absolute; inset: 0; background: #ffffff00; transition: background .12s; pointer-events: none; }
.sv-pane:not(.on) .sv-body:hover .sv-mirror::after { background: rgb(var(--accent-rgb) / 0.06); box-shadow: inset 0 0 0 2px rgb(var(--accent-rgb) / 0.33); }
.sv-divider { flex: none; background: #d3d3d3; position: relative; z-index: 4; touch-action: none; transition: background .12s; }
.sv-host[data-mode="v"] > .sv-divider { width: 6px; cursor: col-resize; }
.sv-host[data-mode="h"] > .sv-divider { height: 6px; cursor: row-resize; }
.sv-divider::before { content: ""; position: absolute; inset: -6px; }   /* a wider grab area for fingers and pens */
.sv-divider:hover, .sv-divider:focus-visible, .sv-host.sv-resizing > .sv-divider { background: var(--accent); outline: none; }
.sv-host.sv-resizing, .sv-host.sv-dragging { user-select: none; }
.sv-host.sv-resizing .sv-body { pointer-events: none; }
.sv-host.sv-dragging { cursor: grabbing; }
.sv-host.sv-denied, .sv-host.sv-denied * { cursor: not-allowed; }
.sv-pane.drop .sv-body { box-shadow: inset 0 0 0 3px rgb(var(--accent-rgb) / 0.67); }
.sv-pane.drop .sv-tabs { background: var(--accent-soft); }
.sv-tabs .view-tab.drop-before { box-shadow: inset 3px 0 0 var(--accent); }
.sv-ghost { position: fixed; z-index: 9999; pointer-events: none; display: flex; align-items: center; gap: 7px; padding: 7px 12px; font-size: 11px; background: #fff; color: var(--accent-dark); border: 1px solid var(--accent); border-radius: 6px; box-shadow: 0 6px 18px #0003; }
.sv-ghost svg { width: 13px; height: 13px; }
.split-menu { position: absolute; z-index: 30; min-width: 190px; padding: 5px; display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid #d8d8d8; border-radius: 8px; box-shadow: 0 8px 24px #0003; }
.split-menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: auto; padding: 8px 10px; border-radius: 6px; text-align: start; color: #565656; }
.split-menu button span { display: flex; flex-direction: column; }
.split-menu button strong { font-size: 12px; font-weight: 600; }
.split-menu button small { font-size: 10px; color: #929292; }
.split-menu button:hover { background: var(--accent-soft); color: var(--accent-dark); }
.split-menu button.on { background: var(--accent-soft); color: var(--accent-dark); }
.nav-tools button[data-split-btn].active { background: var(--accent-soft); color: var(--accent-dark); }
html.dark-theme .sv-host { background: #2a2a2a; }
html.dark-theme .sv-pane { background: var(--soft); }
html.dark-theme .sv-pane .sv-tabs { background: var(--white); border-bottom-color: var(--line); }
html.dark-theme .sv-pane:not(.on) .sv-tabs .view-tab.active { color: #8a8a8a; border-top-color: #4a4a4a; }
html.dark-theme .sv-mirror { background: #1a1a1a; }
html.dark-theme .sv-divider { background: #3a3a3a; }
html.dark-theme .sv-pane.drop .sv-tabs { background: #3a2a1e; }
html.dark-theme .sv-ghost, html.dark-theme .split-menu { background: var(--white); border-color: #3a3a3a; color: #e0e0e0; }
html.dark-theme .split-menu button { color: #cfcfcf; }
html.dark-theme .split-menu button:hover, html.dark-theme .split-menu button.on { background: #3a2a1e; color: var(--accent-text); }
html[dir="rtl"] .sv-pane .sv-tabs { direction: rtl; }

/* Reva Settings window */
#modal:has(.st-window) { width: min(880px, 96vw); max-width: min(880px, 96vw); }
.st-window { display: grid; grid-template-columns: 200px 1fr; gap: 0; min-height: 420px; max-height: 70vh; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--white); }
.st-nav { display: flex; flex-direction: column; gap: 2px; padding: 10px; background: var(--soft); border-inline-end: 1px solid var(--line); }
.st-nav button { justify-content: flex-start; padding: 10px 12px; border-radius: 7px; text-align: start; color: var(--text); font-weight: 500; min-height: 40px; }
.st-nav button:hover { background: var(--accent-soft); }
.st-nav button[aria-current="true"] { background: var(--accent-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--accent); }
html[dir="rtl"] .st-nav button[aria-current="true"] { box-shadow: inset -3px 0 0 var(--accent); }
.st-body { padding: 16px 20px; overflow-y: auto; }
.st-page h2 { margin: 0 0 12px; font-size: 16px; color: var(--ink); }
.st-page h3 { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.st-page h4 { margin: 12px 0 4px; font-size: 12px; color: var(--ink); }
.st-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.st-theme { justify-content: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); min-height: 44px; }
.st-theme small { margin-inline-start: auto; color: var(--muted); }
.st-theme:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.st-theme[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.st-dot { width: 18px; height: 18px; border-radius: 50%; display: inline-block; flex: none; border: 1px solid rgb(0 0 0 / .15); }
.st-accents { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-accent { width: 38px; height: 38px; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.st-accent .st-dot { width: 24px; height: 24px; }
.st-accent[aria-pressed="true"] { border-color: var(--accent); }
.st-accent:focus-visible, .st-theme:focus-visible, .st-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.st-accent-default { width: auto; border-radius: 19px; padding: 0 14px; border: 1px solid var(--line); }
.st-accent-default[aria-pressed="true"] { border: 2px solid var(--accent); }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 10px; }
.st-grid label { display: flex; flex-direction: column; gap: 5px; color: var(--text); }
.st-grid select { min-height: 38px; }
.st-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.st-seg button { padding: 9px 18px; min-height: 38px; border-radius: 0; }
.st-seg button + button { border-inline-start: 1px solid var(--line); }
.st-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.st-note { color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.st-scope { display: inline-block; margin: 0 0 6px; padding: 2px 9px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.st-check { display: flex; align-items: center; gap: 9px; margin: 8px 0; min-height: 34px; }
.st-check input { accent-color: var(--accent); width: 18px; height: 18px; }
.st-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.st-actions button { padding: 9px 14px; border: 1px solid var(--line); border-radius: 7px; min-height: 38px; }
.st-actions button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.st-actions button:disabled { opacity: .5; cursor: not-allowed; }
.st-search input { width: 100%; padding: 10px; min-height: 40px; }
.st-sc-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 7px 2px; border-bottom: 1px solid var(--line); }
.st-sc-row[hidden], .st-sc-group[hidden] { display: none; }
.st-sc-row kbd { font: 600 11px ui-monospace, monospace; padding: 3px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--soft); color: var(--ink); direction: ltr; }
@media (max-width: 640px) {
  .st-window { grid-template-columns: 1fr; max-height: 74vh; overflow-y: auto; }
  .st-nav { flex-direction: row; overflow-x: auto; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .st-nav button { white-space: nowrap; }
}
/* the account menu in the title bar */
.account-menu { position: fixed; z-index: 5000; min-width: 190px; padding: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); }
.account-menu button { width: 100%; justify-content: flex-start; padding: 10px 12px; border-radius: 6px; min-height: 40px; }
.account-menu button:hover, .account-menu button:focus-visible { background: var(--accent-soft); color: var(--ink); }

/* Accent presence: one calm step beyond the active tab */
.panel-title { background: var(--accent-tint); }
.titlebar { border-bottom-color: var(--accent-line); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); }
.ribbon-button:hover, .ribbon-small button:hover { background: var(--accent-soft); }

/* Reva Classic: the look the program had before themes (orange accent, greenish-gray surfaces). Only active under data-theme="classic". */
html[data-theme="classic"]:not(.dark-theme) { --ink: #293a35; --text: #46524e; --muted: #8b9690; --line: #dfe4df; --panel: #fbfcfa; --soft: #f3f5f1; }
html[data-theme="classic"]:not(.dark-theme), html[data-theme="classic"]:not(.dark-theme) body { background: #f6f7f3; }
html[data-theme="classic"]:not(.dark-theme),
html[data-theme="classic"]:not(.dark-theme) body { background: #f6f7f3; }
html[data-theme="classic"]:not(.dark-theme) button:hover { background: #e8eee8; }
html[data-theme="classic"]:not(.dark-theme) button:active { background: #dce8df; }
html[data-theme="classic"]:not(.dark-theme) input,
html[data-theme="classic"]:not(.dark-theme) select,
html[data-theme="classic"]:not(.dark-theme) textarea { border: 1px solid #dfe5df; }
html[data-theme="classic"]:not(.dark-theme) kbd { color: #8d9b92; border: 1px solid #dde4de; }
html[data-theme="classic"]:not(.dark-theme) .titlebar { border-bottom: 1px solid #edf0ea; }
html[data-theme="classic"]:not(.dark-theme) .brand-sub { color: #829086; }
html[data-theme="classic"]:not(.dark-theme) .quick-actions button { color: #78867d; }
html[data-theme="classic"]:not(.dark-theme) .project-title { color: #374c40; }
html[data-theme="classic"]:not(.dark-theme) .project-separator { color: #bac4bb; }
html[data-theme="classic"]:not(.dark-theme) .project-discipline { color: #8c998f; }
html[data-theme="classic"]:not(.dark-theme) .text-button { color: #8c978f; }
html[data-theme="classic"]:not(.dark-theme) .export-button { border: 1px solid #d8e1d9; }
html[data-theme="classic"]:not(.dark-theme) .avatar { background: #e8eee5; border: 1px solid #dce5d8; }
html[data-theme="classic"]:not(.dark-theme) .ribbon-tabs { border-bottom: 1px solid #e5eae3; }
html[data-theme="classic"]:not(.dark-theme) .ribbon-tabs>button { color: #647268; }
html[data-theme="classic"]:not(.dark-theme) .ribbon-right svg { color: #98a399; }
html[data-theme="classic"]:not(.dark-theme) .project-stage { color: #98a492; }
html[data-theme="classic"]:not(.dark-theme) .ribbon { border-bottom: 1px solid #dce3d9; background: linear-gradient(#fdfefb,#f5f7f2); }
html[data-theme="classic"]:not(.dark-theme) .ribbon-group { border-right: 1px solid #dfe5d9; }
html[data-theme="classic"]:not(.dark-theme) .ribbon-button { color: #536356; }
html[data-theme="classic"]:not(.dark-theme) .ribbon-button svg { color: #6e8474; }
html[data-theme="classic"]:not(.dark-theme) .ribbon-button .ribbon-arrow { color: #7a8d7d; }
html[data-theme="classic"]:not(.dark-theme) .ribbon-group-label { color: #a0aa9a; }
html[data-theme="classic"]:not(.dark-theme) .ribbon-small svg { color: #82927c; }
html[data-theme="classic"]:not(.dark-theme) .options-bar { background: #f1f5ec; border-bottom: 1px solid #dae2d4; color: #7a8d73; }
html[data-theme="classic"]:not(.dark-theme) .options-separator { background: #d5dfce; }
html[data-theme="classic"]:not(.dark-theme) .options-bar select { background: #fbfdf8; border-color: #d5dfcf; color: #5b6f50; }
html[data-theme="classic"]:not(.dark-theme) .options-right { color: #8d9c80; }
html[data-theme="classic"]:not(.dark-theme) .browser-panel { border-right: 1px solid #dfe5da; }
html[data-theme="classic"]:not(.dark-theme) .panel-title { border-bottom: 1px solid #e5e9e0; }
html[data-theme="classic"]:not(.dark-theme) .panel-title h2 { color: #586b54; }
html[data-theme="classic"]:not(.dark-theme) .panel-title button { color: #97a38e; }
html[data-theme="classic"]:not(.dark-theme) .browser-search { border: 1px solid #e0e5da; }
html[data-theme="classic"]:not(.dark-theme) .browser-search input::placeholder { color: #a5af9d; }
html[data-theme="classic"]:not(.dark-theme) .browser-search svg { color: #9aaa91; }
html[data-theme="classic"]:not(.dark-theme) .project-icon { color: #769074; }
html[data-theme="classic"]:not(.dark-theme) .browser-project strong { color: #50644c; }
html[data-theme="classic"]:not(.dark-theme) .browser-project small { color: #a3ad9c; }
html[data-theme="classic"]:not(.dark-theme) .browser-tree summary { color: #607154; }
html[data-theme="classic"]:not(.dark-theme) .browser-tree summary::before { color: #a0ac93; }
html[data-theme="classic"]:not(.dark-theme) .browser-tree summary .count { color: #a5b097; }
html[data-theme="classic"]:not(.dark-theme) .browser-tree summary svg { color: #8b9e7d; }
html[data-theme="classic"]:not(.dark-theme) .browser-row { color: #839176; }
html[data-theme="classic"]:not(.dark-theme) .browser-row svg { color: #a1ad96; }
html[data-theme="classic"]:not(.dark-theme) .browser-section-label { color: #aab49f; }
html[data-theme="classic"]:not(.dark-theme) .browser-bottom { border-top: 1px solid #e5e9e0; }
html[data-theme="classic"]:not(.dark-theme) .browser-bottom strong { color: #8a9b7c; }
html[data-theme="classic"]:not(.dark-theme) .browser-bottom span:not(.tiny-logo) { color: #afbaa5; }
html[data-theme="classic"]:not(.dark-theme) .view-tabs { background: #f2f5ee; border-bottom: 1px solid #dfe5d8; }
html[data-theme="classic"]:not(.dark-theme) .view-tab { color: #94a187; border-right: 1px solid #e4e9de; }
html[data-theme="classic"]:not(.dark-theme) .view-tab svg { color: #93a383; }
html[data-theme="classic"]:not(.dark-theme) .view-tab .tab-close { color: #b2bda6; }
html[data-theme="classic"]:not(.dark-theme) .view-tab .tab-close:hover { color: #596d4a; background: #e4eddf; }
html[data-theme="classic"]:not(.dark-theme) .add-view { color: #a0ae92; }
html[data-theme="classic"]:not(.dark-theme) .viewport-header { border-bottom: 1px solid #ebeee5; }
html[data-theme="classic"]:not(.dark-theme) .view-breadcrumb>span:first-child { color: #a5b298; }
html[data-theme="classic"]:not(.dark-theme) .breadcrumb-slash { color: #d1dac6; }
html[data-theme="classic"]:not(.dark-theme) .view-breadcrumb strong { color: #788c68; }
html[data-theme="classic"]:not(.dark-theme) .viewport-actions button { color: #98aa86; }
html[data-theme="classic"]:not(.dark-theme) .toolbar-divider { background: #e4ebdc; }
html[data-theme="classic"]:not(.dark-theme) .view-area { background: #e8ece8; }
html[data-theme="classic"]:not(.dark-theme) .view-label { color: #799278; }
html[data-theme="classic"]:not(.dark-theme) .view-label-divider { background: #c8d4c7; }
html[data-theme="classic"]:not(.dark-theme) #view-detail-label { color: #9aac97; }
html[data-theme="classic"]:not(.dark-theme) .viewcube .vc-face { color: #5f6f5f; background: linear-gradient(145deg, #fbfdf8, #e3eadd); border: 1px solid #b4c3ae; }
html[data-theme="classic"]:not(.dark-theme) .viewcube .vc-face.vc-bottom { background: #d4ddcd; }
html[data-theme="classic"]:not(.dark-theme) .viewcube .vc-dir { color: #5f6f5f; }
html[data-theme="classic"]:not(.dark-theme) .viewcube .cube-home { color: #6f7f6f; }
html[data-theme="classic"]:not(.dark-theme) .nav-tools { border: 1px solid #d2ddcc; }
html[data-theme="classic"]:not(.dark-theme) .nav-tools button { color: #7e9273; }
html[data-theme="classic"]:not(.dark-theme) .nav-tools>span { background: #d8e1d1; }
html[data-theme="classic"]:not(.dark-theme) .note-rule { background: #94aa8c; }
html[data-theme="classic"]:not(.dark-theme) .model-note strong { color: #82977b; }
html[data-theme="classic"]:not(.dark-theme) .model-note>span:last-child { color: #a0b098; }
html[data-theme="classic"]:not(.dark-theme) .view-controls { background: #fafcf7; border-top: 1px solid #dce5d4; }
html[data-theme="classic"]:not(.dark-theme) .view-controls button { color: #8c9f7f; }
html[data-theme="classic"]:not(.dark-theme) .view-controls select { color: #809574; }
html[data-theme="classic"]:not(.dark-theme) .control-divider { background: #dbe4d1; }
html[data-theme="classic"]:not(.dark-theme) .controls-right { color: #a3b196; }
html[data-theme="classic"]:not(.dark-theme) .properties-panel { border-left: 1px solid #dfe6d8; }
html[data-theme="classic"]:not(.dark-theme) .property-hero p { color: #a0af92; }
html[data-theme="classic"]:not(.dark-theme) .property-type select { color: #7c9168; }
html[data-theme="classic"]:not(.dark-theme) .property-type button { border: 1px solid #d9e2cf; color: #758f5e; }
html[data-theme="classic"]:not(.dark-theme) .property-section { border-top: 1px solid #e2e8d9; }
html[data-theme="classic"]:not(.dark-theme) .property-section-title { color: #7c9266; }
html[data-theme="classic"]:not(.dark-theme) .property-section-title span:last-child { color: #a0b18b; }
html[data-theme="classic"]:not(.dark-theme) .property-row { color: #a0ae90; }
html[data-theme="classic"]:not(.dark-theme) .property-row input:not([type=checkbox]),
html[data-theme="classic"]:not(.dark-theme) .property-row select { border: 1px solid #e2e8d9; color: #647c4d; }
html[data-theme="classic"]:not(.dark-theme) .property-row input[readonly] { background: #f0f4e9; color: #8a9d76; }
html[data-theme="classic"]:not(.dark-theme) .property-row .property-value { color: #718859; }
html[data-theme="classic"]:not(.dark-theme) .property-actions button { border: 1px solid #d6e2c8; color: #77965c; }
html[data-theme="classic"]:not(.dark-theme) .property-note { color: #9fac90; }
html[data-theme="classic"]:not(.dark-theme) .model-summary { border: 1px solid #dce5ce; background: #f5f8ee; }
html[data-theme="classic"]:not(.dark-theme) .summary-title { color: #7f9763; }
html[data-theme="classic"]:not(.dark-theme) .summary-title span:last-child { color: #a5b793; }
html[data-theme="classic"]:not(.dark-theme) .summary-stat strong { color: #79955d; }
html[data-theme="classic"]:not(.dark-theme) .summary-stat small { color: #a2b38c; }
html[data-theme="classic"]:not(.dark-theme) .summary-foot { border-top: 1px solid #dfe8d2; color: #9daf87; }
html[data-theme="classic"]:not(.dark-theme) .summary-foot strong { color: #6f8f51; }
html[data-theme="classic"]:not(.dark-theme) .statusbar { background: #f1f5e9; border-top: 1px solid #d8e2cc; color: #8a9e76; }
html[data-theme="classic"]:not(.dark-theme) .status-message svg { color: #97ab80; }
html[data-theme="classic"]:not(.dark-theme) .status-toggle { color: #9dad8b; }
html[data-theme="classic"]:not(.dark-theme) .status-divider { background: #d6e1c7; }
html[data-theme="classic"]:not(.dark-theme) .health-button { color: #8fa374; }
html[data-theme="classic"]:not(.dark-theme) .schedule-heading p { color: #90a182; }
html[data-theme="classic"]:not(.dark-theme) .data-table th { background: #f1f5ea; border-bottom: 1px solid #dbe6d0; color: #7e956a; }
html[data-theme="classic"]:not(.dark-theme) .data-table td { border-bottom: 1px solid #edf1e7; color: #60764f; }
html[data-theme="classic"]:not(.dark-theme) .data-table tr:hover td { background: #f5f8ef; }
html[data-theme="classic"]:not(.dark-theme) .data-table input:hover,
html[data-theme="classic"]:not(.dark-theme) .data-table input:focus { border-color: #cbddbb; }
html[data-theme="classic"]:not(.dark-theme) .schedule-footer { color: #8ca078; }
html[data-theme="classic"]:not(.dark-theme) .sheet-view { background: #e7ece3; }
html[data-theme="classic"]:not(.dark-theme) dialog { border: 1px solid #d7e3cb; color: #596e4c; background: #fcfdf9; }
html[data-theme="classic"]:not(.dark-theme) .modal-header { border-bottom: 1px solid #e4eadc; background: #f7faf2; }
html[data-theme="classic"]:not(.dark-theme) .modal-header h2 { color: #466738; }
html[data-theme="classic"]:not(.dark-theme) .modal-header button { color: #9bab8b; }
html[data-theme="classic"]:not(.dark-theme) .modal-intro { color: #8d9e7d; }
html[data-theme="classic"]:not(.dark-theme) .dialog-form label { color: #879d72; }
html[data-theme="classic"]:not(.dark-theme) .dialog-form input,
html[data-theme="classic"]:not(.dark-theme) .dialog-form select { color: #55703e; }
html[data-theme="classic"]:not(.dark-theme) .dialog-footer button { background: #ecf2e5; border: 1px solid #d6e4c6; color: #759459; }
html[data-theme="classic"]:not(.dark-theme) .menu-card { border: 1px solid #dfe8d4; }
html[data-theme="classic"]:not(.dark-theme) .menu-card svg { color: #8fa977; }
html[data-theme="classic"]:not(.dark-theme) .menu-card strong { color: #647e4a; }
html[data-theme="classic"]:not(.dark-theme) .menu-card small { color: #9dad8d; }
html[data-theme="classic"]:not(.dark-theme) .shortcut-grid>div { border-bottom: 1px solid #e5ecdc; color: #849a6b; }
html[data-theme="classic"]:not(.dark-theme) .help-section { color: #6d8c50; }
html[data-theme="classic"]:not(.dark-theme) .diagnostic-line { border-bottom: 1px solid #e2ebd5; color: #7a9460; }
html[data-theme="classic"]:not(.dark-theme) .diagnostic-line strong { color: #5c7c45; }
html[data-theme="classic"]:not(.dark-theme) .checkbox-list label { color: #769358; }
html[data-theme="classic"]:not(.dark-theme) .toast { background: #294c37; color: #f4f9ed; border: 1px solid #b9cfaa; }
html[data-theme="classic"]:not(.dark-theme) ::-webkit-scrollbar-thumb { background: #d0dcc4; }
html[data-theme="classic"]:not(.dark-theme) .theme-toggle-btn { color: #78867d; }
html[data-theme="classic"]:not(.dark-theme) .theme-toggle-btn:hover { background: #e8eee8; }
html[data-theme="classic"]:not(.dark-theme) .pdf-print-preview { background: #8d9793; }
html[data-theme="classic"]:not(.dark-theme) .scene-context-menu { border: 1px solid var(--line, #ced9d2); }
html[data-theme="classic"]:not(.dark-theme) .scene-context-menu button:hover,
html[data-theme="classic"]:not(.dark-theme) .scene-context-menu button:focus-visible { background: var(--panel-hover, #dce6df); }
html[data-theme="classic"]:not(.dark-theme) .options-bar #context-tool-options button { border: 1px solid var(--line, #cbd4ca); }
html.dark-theme[data-theme="classic"] .options-bar #context-tool-options input,
html.dark-theme[data-theme="classic"] .options-bar #context-tool-options select,
html.dark-theme[data-theme="classic"] .options-bar #context-tool-options button { color: #f0f2ed; }
html[data-theme="classic"]:not(.dark-theme) .ribbon-tabs .contextual-create-tab:not([hidden]) { background: #d1e4c0; color: #24472b; border-bottom: 3px solid #638d4a; }
html.dark-theme[data-theme="classic"] .ribbon-tabs .contextual-create-tab:not([hidden]) { background: #466b35; border-bottom-color: #9ac875; }
html[data-theme="classic"]:not(.dark-theme) #draw-ribbon-tools .context-draw-tool:hover,
html[data-theme="classic"]:not(.dark-theme) #draw-ribbon-tools .context-draw-tool:focus-visible { background: #e0eae1; border-color: #b4c9b8; }
html[data-theme="classic"]:not(.dark-theme) .browser-open-plan { color: #a1ad96; }
html[data-theme="classic"]:not(.dark-theme) .browser-add { color: #839176; }
html[data-theme="classic"]:not(.dark-theme) .browser-empty { color: #a1ad96; }
html[data-theme="classic"]:not(.dark-theme) .qat { border: 1px solid #dfe5da; }
html[data-theme="classic"]:not(.dark-theme) .qat-button { color: #647268; }
html[data-theme="classic"]:not(.dark-theme) .qat-num { color: #98a399; }
html[data-theme="classic"]:not(.dark-theme) .qat-separator { background: #dfe5da; }
html[data-theme="classic"]:not(.dark-theme) .qat-grip { color: #a1ad96; }
html[data-theme="classic"]:not(.dark-theme) .qat-fold { color: #839176; }
html[data-theme="classic"]:not(.dark-theme) .qat-pop { border: 1px solid #dfe5da; color: #33433a; }
html[data-theme="classic"]:not(.dark-theme) .qat-pop-title { color: #647268; }
html[data-theme="classic"]:not(.dark-theme) .qat-pop-title small { color: #98a399; }
html[data-theme="classic"]:not(.dark-theme) .qat-reset { border-top: 1px solid #eef1ea; color: #647268; }
html[data-theme="classic"]:not(.dark-theme) .qat-handle { color: #98a399; }
html[data-theme="classic"]:not(.dark-theme) .edge-tab { color: #647268; }
html[data-theme="classic"]:not(.dark-theme) .edge-left { border-right: 1px solid #dfe5da; }
html[data-theme="classic"]:not(.dark-theme) .edge-right { border-left: 1px solid #dfe5da; }
html[data-theme="classic"]:not(.dark-theme) .ws-overlay .edge-tab { border: 1px solid #dfe5da; }
html[data-theme="classic"]:not(.dark-theme) .ws-overlay .edge-left { border-right: 1px solid #dfe5da; }
html[data-theme="classic"]:not(.dark-theme) .ws-overlay .edge-right { border-left: 1px solid #dfe5da; }
html[data-theme="classic"]:not(.dark-theme) .titlebar { border-bottom: 1px solid #e5eae3; }
html[data-theme="classic"]:not(.dark-theme) .view-quick { border: 1px solid #d2ddcc; }
html.dark-theme[data-theme="classic"] .view-quick { border-color: #3a3f3a; }
html[data-theme="classic"]:not(.dark-theme) .titlebar .project-title { border-inline-start: 1px solid #e5eae3; }
html[data-theme="classic"]:not(.dark-theme) #view-area > .options-bar { border: 1px solid #d2ddcc; }
html.dark-theme[data-theme="classic"] #view-area > .options-bar { border-color: #3a3f3a; }
html[data-theme="classic"]:not(.dark-theme) .ribbon:hover::-webkit-scrollbar-thumb,
html[data-theme="classic"]:not(.dark-theme) .ribbon.scrolling::-webkit-scrollbar-thumb,
html[data-theme="classic"]:not(.dark-theme) .titlebar .ribbon-tabs:hover::-webkit-scrollbar-thumb,
html[data-theme="classic"]:not(.dark-theme) .titlebar .ribbon-tabs.scrolling::-webkit-scrollbar-thumb,
html[data-theme="classic"]:not(.dark-theme) #view-area > .options-bar:hover::-webkit-scrollbar-thumb,
html[data-theme="classic"]:not(.dark-theme) #view-area > .options-bar.scrolling::-webkit-scrollbar-thumb { background: #aeb9a8; }
html.dark-theme[data-theme="classic"] .ribbon:hover::-webkit-scrollbar-thumb,
html.dark-theme[data-theme="classic"] .ribbon.scrolling::-webkit-scrollbar-thumb { background: #5b625a; }
html[data-theme="classic"]:not(.dark-theme) .cc-tabs button { border: 1px solid #c8d0c4; }
html[data-theme="classic"]:not(.dark-theme) .cc fieldset { border: 1px solid #d6ddd2; }
html[data-theme="classic"]:not(.dark-theme) .cc-preview { background: #f4f7f2; border: 1px solid #d6ddd2; }
html.dark-theme[data-theme="classic"] .cc-preview { border-color: #3a3f3a; }
html[data-theme="classic"]:not(.dark-theme) .cc-mode { border-bottom: 1px solid #d6ddd2; }
html[data-theme="classic"]:not(.dark-theme) .cc-mode button { border: 1px solid #c8d0c4; }
html[data-theme="classic"]:not(.dark-theme) .cc-form::-webkit-scrollbar-thumb { background: #b8c4b6; }
html[data-theme="classic"]:not(.dark-theme) .cc-form::-webkit-scrollbar-thumb:hover { background: #8fa08d; }
html[data-theme="classic"]:not(.dark-theme) .lt-table th { color: #6d7a70; }
html[data-theme="classic"]:not(.dark-theme) .lt-table input[type="text"],
html[data-theme="classic"]:not(.dark-theme) .lt-table input[type="number"],
html[data-theme="classic"]:not(.dark-theme) .lt-table select { border: 1px solid var(--line, #d6d9cf); }
html[data-theme="classic"]:not(.dark-theme) .lt-n { color: #6d7a70; }
html[data-theme="classic"]:not(.dark-theme) .lt-num small { color: #6d7a70; }
html[data-theme="classic"]:not(.dark-theme) .lt-lab { fill: #2f3a35; }
html[data-theme="classic"]:not(.dark-theme) .lt-cap { fill: #4a5a50; }
html[data-theme="classic"]:not(.dark-theme) .schedule-footer { color: #60764f; }
html[data-theme="classic"]:not(.dark-theme) .sched-table th,
html[data-theme="classic"]:not(.dark-theme) .sched-table td { border: var(--sg-w, 1px) solid var(--sg-c, #d9dfdb); }
html[data-theme="classic"]:not(.dark-theme) .sched-table tr.sched-total td { background: #f1f5ea; }
html[data-theme="classic"]:not(.dark-theme) .sd-tabs { border-bottom: 1px solid #dbe6d0; }
html[data-theme="classic"]:not(.dark-theme) .sd-cat { border: 1px solid #dbe6d0; }
html[data-theme="classic"]:not(.dark-theme) .sd-item { border-bottom: 1px solid #edf1e7; }
html[data-theme="classic"]:not(.dark-theme) .pp-row { border: 1px solid #dbe6d0; }
html[data-theme="classic"]:not(.dark-theme) .pp-name small { color: #7e956a; }
html[data-theme="classic"]:not(.dark-theme) .pp-shared { color: #7e956a; }
html[data-theme="classic"]:not(.dark-theme) .sched-proposal { color: #60764f; }
html[data-theme="classic"]:not(.dark-theme) .sched-cell:hover,
html[data-theme="classic"]:not(.dark-theme) .sched-cell:focus { border-color: #8fae7a; }
html[data-theme="classic"]:not(.dark-theme) .vs-tabs button { border: 1px solid #c9d3cf; }
html[data-theme="classic"]:not(.dark-theme) .vs-card { border: 1px solid #cdd6d2; }
html[data-theme="classic"]:not(.dark-theme) .vs-color input[type=color] { border: 1px solid #c9d3cf; }
html[data-theme="classic"]:not(.dark-theme) .view-context-menu hr { border-top: 1px solid var(--line, #ced9d2); }
html[data-theme="classic"]:not(.dark-theme) .vg-tabs { border: 1px solid var(--line, #c9d3c3); }
html[data-theme="classic"]:not(.dark-theme) .vg-search { border: 1px solid var(--line, #c9d3c3); }
html[data-theme="classic"]:not(.dark-theme) .vg-scroll { border: 1px solid var(--line, #d5ddd0); }
html[data-theme="classic"]:not(.dark-theme) .vg-table th,
html[data-theme="classic"]:not(.dark-theme) .vg-table td { border-bottom: 1px solid var(--line, #e3e8df); }
html[data-theme="classic"]:not(.dark-theme) .vg-table thead th { background: var(--panel, #f4f6f1); }
html[data-theme="classic"]:not(.dark-theme) .vg-table input[type="color"] { border: 1px solid var(--line, #c9d3c3); }
html[data-theme="classic"]:not(.dark-theme) .workspace > .browser-panel.ws-auto-open { border-right: 1px solid #dfe5da; }
html[data-theme="classic"]:not(.dark-theme) .workspace > .properties-panel.ws-auto-open { border-left: 1px solid #dfe5da; }
html[data-theme="classic"]:not(.dark-theme) .sheet-mark::after { background: #2b3a31; }
html.dark-theme[data-theme="classic"] .sheet-drag-ghost { background: #222a26; color: #e6efe9; }
html[data-theme="classic"]:not(.dark-theme) .notes-dialog .nm-scope { color: var(--muted, #5f6d62); }
html[data-theme="classic"]:not(.dark-theme) .nm-attach li { border: 1px solid #d5dccf; }
html[data-theme="classic"]:not(.dark-theme) .nm-tabs { border-bottom: 1px solid #d5dccf; }
html[data-theme="classic"]:not(.dark-theme) .nm-count { background: #eef2ea; }
html[data-theme="classic"]:not(.dark-theme) .nm-table th { color: #6a766c; border-bottom: 1px solid #d5dccf; }
html[data-theme="classic"]:not(.dark-theme) .nm-table td { border-bottom: 1px solid #eef1ea; }
html[data-theme="classic"]:not(.dark-theme) .nm-actions button:hover { background: #eef2ea; }
html[data-theme="classic"]:not(.dark-theme) .nm-empty { color: #7a867c; }
html[data-theme="classic"]:not(.dark-theme) .note-bubble { color: #2c342d; }
html.dark-theme[data-theme="classic"] .note-bubble { background: #2b302b; color: #e8ece6; }
html[data-theme="classic"]:not(.dark-theme) .note-pin.closed { background: #8a968c; }
html[data-theme="classic"]:not(.dark-theme) .sv-host { background: #dfe5d8; }
html[data-theme="classic"]:not(.dark-theme) .sv-pane .sv-tabs { background: #f2f5ee; border-bottom: 1px solid #dfe5d8; }
html[data-theme="classic"]:not(.dark-theme) .sv-pane:not(.on) .sv-tabs .view-tab.active { color: #7a8870; border-top-color: #c9d3bd; }
html[data-theme="classic"]:not(.dark-theme) .sv-mirror { background: #e8ece8; }
html[data-theme="classic"]:not(.dark-theme) .sv-mirror .sv-empty { color: #7e9273; }
html[data-theme="classic"]:not(.dark-theme) .sv-divider { background: #cfd8c6; }
html[data-theme="classic"]:not(.dark-theme) .split-menu { border: 1px solid #d2ddcc; }
html[data-theme="classic"]:not(.dark-theme) .split-menu button { color: #4c5e44; }
html[data-theme="classic"]:not(.dark-theme) .split-menu button small { color: #8a9a80; }
@supports not selector(::-webkit-scrollbar) {
html[data-theme="classic"]:not(.dark-theme) .ribbon:hover,
html[data-theme="classic"]:not(.dark-theme) .ribbon.scrolling,
html[data-theme="classic"]:not(.dark-theme) .titlebar .ribbon-tabs:hover,
html[data-theme="classic"]:not(.dark-theme) .titlebar .ribbon-tabs.scrolling,
html[data-theme="classic"]:not(.dark-theme) #view-area > .options-bar:hover,
html[data-theme="classic"]:not(.dark-theme) #view-area > .options-bar.scrolling { scrollbar-color: #aeb9a8 transparent; }
}
html[data-theme="classic"]:not(.dark-theme) .titlebar { border-bottom-color: #e8e8e8; }
html[data-theme="classic"] .panel-title { background: transparent; }

/* Stronger accent cues: active tab underline and selected rows */
.ribbon-tabs>button.active { box-shadow: inset 0 -3px 0 var(--accent); }
html[data-theme="classic"] .ribbon-tabs>button.active { box-shadow: none; }


/* @theme-classic-derived begin (generated by tools/theme-classic.mjs, do not edit) */
html:not([data-theme="classic"]):not(.dark-theme) button:hover { background: hsl(from #e8eee8 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) button:active { background: hsl(from #dce8df var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) input,
html:not([data-theme="classic"]):not(.dark-theme) select,
html:not([data-theme="classic"]):not(.dark-theme) textarea { border: 1px solid hsl(from #dfe5df var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) kbd { color: hsl(from #8d9b92 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border: 1px solid hsl(from #dde4de var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .titlebar { border-bottom: 1px solid hsl(from #edf0ea var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .brand-sub { color: hsl(from #829086 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .quick-actions button { color: hsl(from #78867d var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .project-title { color: hsl(from #374c40 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .project-separator { color: hsl(from #bac4bb var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .project-discipline { color: hsl(from #8c998f var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .text-button { color: hsl(from #8c978f var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .export-button { border: 1px solid hsl(from #d8e1d9 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .avatar { background: hsl(from #e8eee5 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border: 1px solid hsl(from #dce5d8 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ribbon-tabs { border-bottom: 1px solid hsl(from #e5eae3 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ribbon-tabs>button { color: hsl(from #647268 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ribbon-right svg { color: hsl(from #98a399 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .project-stage { color: hsl(from #98a492 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ribbon { border-bottom: 1px solid hsl(from #dce3d9 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); background: linear-gradient(#fdfefb,hsl(from #f5f7f2 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .ribbon-group { border-right: 1px solid hsl(from #dfe5d9 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ribbon-button { color: hsl(from #536356 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ribbon-button svg { color: hsl(from #6e8474 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ribbon-button .ribbon-arrow { color: hsl(from #7a8d7d var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ribbon-group-label { color: hsl(from #a0aa9a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ribbon-small svg { color: hsl(from #82927c var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .options-bar { background: hsl(from #f1f5ec var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border-bottom: 1px solid hsl(from #dae2d4 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #7a8d73 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .options-separator { background: hsl(from #d5dfce var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .options-bar select { background: #fbfdf8; border-color: hsl(from #d5dfcf var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #5b6f50 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .options-right { color: hsl(from #8d9c80 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-panel { border-right: 1px solid hsl(from #dfe5da var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .panel-title { border-bottom: 1px solid hsl(from #e5e9e0 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .panel-title h2 { color: hsl(from #586b54 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .panel-title button { color: hsl(from #97a38e var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-search { border: 1px solid hsl(from #e0e5da var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-search input::placeholder { color: hsl(from #a5af9d var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-search svg { color: hsl(from #9aaa91 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .project-icon { color: hsl(from #769074 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-project strong { color: hsl(from #50644c var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-project small { color: hsl(from #a3ad9c var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-tree summary { color: hsl(from #607154 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-tree summary::before { color: hsl(from #a0ac93 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-tree summary .count { color: hsl(from #a5b097 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-tree summary svg { color: hsl(from #8b9e7d var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-row { color: hsl(from #839176 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-row svg { color: hsl(from #a1ad96 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-section-label { color: hsl(from #aab49f var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-bottom { border-top: 1px solid hsl(from #e5e9e0 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-bottom strong { color: hsl(from #8a9b7c var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-bottom span:not(.tiny-logo) { color: hsl(from #afbaa5 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-tabs { background: hsl(from #f2f5ee var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border-bottom: 1px solid hsl(from #dfe5d8 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-tab { color: hsl(from #94a187 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border-right: 1px solid hsl(from #e4e9de var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-tab svg { color: hsl(from #93a383 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-tab .tab-close { color: hsl(from #b2bda6 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-tab .tab-close:hover { color: hsl(from #596d4a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); background: hsl(from #e4eddf var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .add-view { color: hsl(from #a0ae92 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .viewport-header { border-bottom: 1px solid hsl(from #ebeee5 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-breadcrumb>span:first-child { color: hsl(from #a5b298 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .breadcrumb-slash { color: hsl(from #d1dac6 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-breadcrumb strong { color: hsl(from #788c68 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .viewport-actions button { color: hsl(from #98aa86 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .toolbar-divider { background: hsl(from #e4ebdc var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-area { background: hsl(from #e8ece8 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-label { color: hsl(from #799278 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-label-divider { background: hsl(from #c8d4c7 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) #view-detail-label { color: hsl(from #9aac97 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .viewcube .vc-face { color: hsl(from #5f6f5f var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); background: linear-gradient(145deg, #fbfdf8, hsl(from #e3eadd var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); border: 1px solid hsl(from #b4c3ae var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .viewcube .vc-face.vc-bottom { background: hsl(from #d4ddcd var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .viewcube .vc-dir { color: hsl(from #5f6f5f var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .viewcube .cube-home { color: hsl(from #6f7f6f var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .nav-tools { border: 1px solid hsl(from #d2ddcc var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .nav-tools button { color: hsl(from #7e9273 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .nav-tools>span { background: hsl(from #d8e1d1 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .note-rule { background: hsl(from #94aa8c var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .model-note strong { color: hsl(from #82977b var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .model-note>span:last-child { color: hsl(from #a0b098 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-controls { background: #fafcf7; border-top: 1px solid hsl(from #dce5d4 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-controls button { color: hsl(from #8c9f7f var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-controls select { color: hsl(from #809574 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .control-divider { background: hsl(from #dbe4d1 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .controls-right { color: hsl(from #a3b196 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .properties-panel { border-left: 1px solid hsl(from #dfe6d8 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .property-hero p { color: hsl(from #a0af92 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .property-type select { color: hsl(from #7c9168 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .property-type button { border: 1px solid hsl(from #d9e2cf var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #758f5e var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .property-section { border-top: 1px solid hsl(from #e2e8d9 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .property-section-title { color: hsl(from #7c9266 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .property-section-title span:last-child { color: hsl(from #a0b18b var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .property-row { color: hsl(from #a0ae90 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .property-row input:not([type=checkbox]),
html:not([data-theme="classic"]):not(.dark-theme) .property-row select { border: 1px solid hsl(from #e2e8d9 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #647c4d var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .property-row input[readonly] { background: hsl(from #f0f4e9 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #8a9d76 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .property-row .property-value { color: hsl(from #718859 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .property-actions button { border: 1px solid hsl(from #d6e2c8 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #77965c var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .property-note { color: hsl(from #9fac90 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .model-summary { border: 1px solid hsl(from #dce5ce var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); background: hsl(from #f5f8ee var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .summary-title { color: hsl(from #7f9763 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .summary-title span:last-child { color: hsl(from #a5b793 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .summary-stat strong { color: hsl(from #79955d var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .summary-stat small { color: hsl(from #a2b38c var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .summary-foot { border-top: 1px solid hsl(from #dfe8d2 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #9daf87 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .summary-foot strong { color: hsl(from #6f8f51 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .statusbar { background: hsl(from #f1f5e9 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border-top: 1px solid hsl(from #d8e2cc var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #8a9e76 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .status-message svg { color: hsl(from #97ab80 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .status-toggle { color: hsl(from #9dad8b var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .status-divider { background: hsl(from #d6e1c7 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .health-button { color: hsl(from #8fa374 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .schedule-heading p { color: hsl(from #90a182 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .data-table th { background: hsl(from #f1f5ea var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border-bottom: 1px solid hsl(from #dbe6d0 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #7e956a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .data-table td { border-bottom: 1px solid hsl(from #edf1e7 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #60764f var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .data-table tr:hover td { background: hsl(from #f5f8ef var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .data-table input:hover,
html:not([data-theme="classic"]):not(.dark-theme) .data-table input:focus { border-color: hsl(from #cbddbb var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .schedule-footer { color: hsl(from #8ca078 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sheet-view { background: hsl(from #e7ece3 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) dialog { border: 1px solid hsl(from #d7e3cb var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #596e4c var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); background: #fcfdf9; }
html:not([data-theme="classic"]):not(.dark-theme) .modal-header { border-bottom: 1px solid hsl(from #e4eadc var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); background: hsl(from #f7faf2 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .modal-header h2 { color: hsl(from #466738 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .modal-header button { color: hsl(from #9bab8b var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .modal-intro { color: hsl(from #8d9e7d var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .dialog-form label { color: hsl(from #879d72 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .dialog-form input,
html:not([data-theme="classic"]):not(.dark-theme) .dialog-form select { color: hsl(from #55703e var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .dialog-footer button { background: hsl(from #ecf2e5 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border: 1px solid hsl(from #d6e4c6 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #759459 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .menu-card { border: 1px solid hsl(from #dfe8d4 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .menu-card svg { color: hsl(from #8fa977 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .menu-card strong { color: hsl(from #647e4a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .menu-card small { color: hsl(from #9dad8d var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .shortcut-grid>div { border-bottom: 1px solid hsl(from #e5ecdc var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #849a6b var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .help-section { color: hsl(from #6d8c50 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .diagnostic-line { border-bottom: 1px solid hsl(from #e2ebd5 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #7a9460 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .diagnostic-line strong { color: hsl(from #5c7c45 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .checkbox-list label { color: hsl(from #769358 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .toast { background: hsl(from #294c37 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: #f4f9ed; border: 1px solid hsl(from #b9cfaa var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) ::-webkit-scrollbar-thumb { background: hsl(from #d0dcc4 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .theme-toggle-btn { color: hsl(from #78867d var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .theme-toggle-btn:hover { background: hsl(from #e8eee8 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .pdf-print-preview { background: hsl(from #8d9793 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .scene-context-menu { border: 1px solid var(--line, hsl(from #ced9d2 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .scene-context-menu button:hover,
html:not([data-theme="classic"]):not(.dark-theme) .scene-context-menu button:focus-visible { background: var(--panel-hover, hsl(from #dce6df var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .options-bar #context-tool-options button { border: 1px solid var(--line, hsl(from #cbd4ca var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html.dark-theme:not([data-theme="classic"]) .options-bar #context-tool-options input,
html.dark-theme:not([data-theme="classic"]) .options-bar #context-tool-options select,
html.dark-theme:not([data-theme="classic"]) .options-bar #context-tool-options button { color: hsl(from #f0f2ed var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ribbon-tabs .contextual-create-tab:not([hidden]) { background: hsl(from #d1e4c0 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #24472b var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border-bottom: 3px solid hsl(from #638d4a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html.dark-theme:not([data-theme="classic"]) .ribbon-tabs .contextual-create-tab:not([hidden]) { background: hsl(from #466b35 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border-bottom-color: hsl(from #9ac875 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) #draw-ribbon-tools .context-draw-tool:hover,
html:not([data-theme="classic"]):not(.dark-theme) #draw-ribbon-tools .context-draw-tool:focus-visible { background: hsl(from #e0eae1 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border-color: hsl(from #b4c9b8 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-open-plan { color: hsl(from #a1ad96 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-add { color: hsl(from #839176 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .browser-empty { color: hsl(from #a1ad96 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .qat { border: 1px solid hsl(from #dfe5da var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .qat-button { color: hsl(from #647268 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .qat-num { color: hsl(from #98a399 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .qat-separator { background: hsl(from #dfe5da var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .qat-grip { color: hsl(from #a1ad96 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .qat-fold { color: hsl(from #839176 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .qat-pop { border: 1px solid hsl(from #dfe5da var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #33433a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .qat-pop-title { color: hsl(from #647268 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .qat-pop-title small { color: hsl(from #98a399 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .qat-reset { border-top: 1px solid hsl(from #eef1ea var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #647268 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .qat-handle { color: hsl(from #98a399 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .edge-tab { color: hsl(from #647268 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .edge-left { border-right: 1px solid hsl(from #dfe5da var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .edge-right { border-left: 1px solid hsl(from #dfe5da var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ws-overlay .edge-tab { border: 1px solid hsl(from #dfe5da var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ws-overlay .edge-left { border-right: 1px solid hsl(from #dfe5da var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ws-overlay .edge-right { border-left: 1px solid hsl(from #dfe5da var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .titlebar { border-bottom: 1px solid hsl(from #e5eae3 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-quick { border: 1px solid hsl(from #d2ddcc var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html.dark-theme:not([data-theme="classic"]) .view-quick { border-color: hsl(from #3a3f3a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .titlebar .project-title { border-inline-start: 1px solid hsl(from #e5eae3 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) #view-area > .options-bar { border: 1px solid hsl(from #d2ddcc var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html.dark-theme:not([data-theme="classic"]) #view-area > .options-bar { border-color: hsl(from #3a3f3a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .ribbon:hover::-webkit-scrollbar-thumb,
html:not([data-theme="classic"]):not(.dark-theme) .ribbon.scrolling::-webkit-scrollbar-thumb,
html:not([data-theme="classic"]):not(.dark-theme) .titlebar .ribbon-tabs:hover::-webkit-scrollbar-thumb,
html:not([data-theme="classic"]):not(.dark-theme) .titlebar .ribbon-tabs.scrolling::-webkit-scrollbar-thumb,
html:not([data-theme="classic"]):not(.dark-theme) #view-area > .options-bar:hover::-webkit-scrollbar-thumb,
html:not([data-theme="classic"]):not(.dark-theme) #view-area > .options-bar.scrolling::-webkit-scrollbar-thumb { background: hsl(from #aeb9a8 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html.dark-theme:not([data-theme="classic"]) .ribbon:hover::-webkit-scrollbar-thumb,
html.dark-theme:not([data-theme="classic"]) .ribbon.scrolling::-webkit-scrollbar-thumb { background: hsl(from #5b625a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .cc-tabs button { border: 1px solid hsl(from #c8d0c4 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .cc fieldset { border: 1px solid hsl(from #d6ddd2 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .cc-preview { background: hsl(from #f4f7f2 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border: 1px solid hsl(from #d6ddd2 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html.dark-theme:not([data-theme="classic"]) .cc-preview { border-color: hsl(from #3a3f3a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .cc-mode { border-bottom: 1px solid hsl(from #d6ddd2 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .cc-mode button { border: 1px solid hsl(from #c8d0c4 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .cc-form::-webkit-scrollbar-thumb { background: hsl(from #b8c4b6 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .cc-form::-webkit-scrollbar-thumb:hover { background: hsl(from #8fa08d var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .lt-table th { color: hsl(from #6d7a70 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .lt-table input[type="text"],
html:not([data-theme="classic"]):not(.dark-theme) .lt-table input[type="number"],
html:not([data-theme="classic"]):not(.dark-theme) .lt-table select { border: 1px solid var(--line, hsl(from #d6d9cf var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .lt-n { color: hsl(from #6d7a70 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .lt-num small { color: hsl(from #6d7a70 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .lt-lab { fill: hsl(from #2f3a35 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .lt-cap { fill: hsl(from #4a5a50 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .schedule-footer { color: hsl(from #60764f var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sched-table th,
html:not([data-theme="classic"]):not(.dark-theme) .sched-table td { border: var(--sg-w, 1px) solid var(--sg-c, hsl(from #d9dfdb var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .sched-table tr.sched-total td { background: hsl(from #f1f5ea var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sd-tabs { border-bottom: 1px solid hsl(from #dbe6d0 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sd-cat { border: 1px solid hsl(from #dbe6d0 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sd-item { border-bottom: 1px solid hsl(from #edf1e7 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .pp-row { border: 1px solid hsl(from #dbe6d0 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .pp-name small { color: hsl(from #7e956a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .pp-shared { color: hsl(from #7e956a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sched-proposal { color: hsl(from #60764f var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sched-cell:hover,
html:not([data-theme="classic"]):not(.dark-theme) .sched-cell:focus { border-color: hsl(from #8fae7a var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .vs-tabs button { border: 1px solid hsl(from #c9d3cf var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .vs-card { border: 1px solid hsl(from #cdd6d2 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .vs-color input[type=color] { border: 1px solid hsl(from #c9d3cf var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .view-context-menu hr { border-top: 1px solid var(--line, hsl(from #ced9d2 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .vg-tabs { border: 1px solid var(--line, hsl(from #c9d3c3 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .vg-search { border: 1px solid var(--line, hsl(from #c9d3c3 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .vg-scroll { border: 1px solid var(--line, hsl(from #d5ddd0 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .vg-table th,
html:not([data-theme="classic"]):not(.dark-theme) .vg-table td { border-bottom: 1px solid var(--line, hsl(from #e3e8df var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .vg-table thead th { background: var(--panel, hsl(from #f4f6f1 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .vg-table input[type="color"] { border: 1px solid var(--line, hsl(from #c9d3c3 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .workspace > .browser-panel.ws-auto-open { border-right: 1px solid hsl(from #dfe5da var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .workspace > .properties-panel.ws-auto-open { border-left: 1px solid hsl(from #dfe5da var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sheet-mark::after { background: hsl(from #2b3a31 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html.dark-theme:not([data-theme="classic"]) .sheet-drag-ghost { background: hsl(from #222a26 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #e6efe9 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .notes-dialog .nm-scope { color: var(--muted, hsl(from #5f6d62 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l)); }
html:not([data-theme="classic"]):not(.dark-theme) .nm-attach li { border: 1px solid hsl(from #d5dccf var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .nm-tabs { border-bottom: 1px solid hsl(from #d5dccf var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .nm-count { background: hsl(from #eef2ea var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .nm-table th { color: hsl(from #6a766c var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border-bottom: 1px solid hsl(from #d5dccf var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .nm-table td { border-bottom: 1px solid hsl(from #eef1ea var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .nm-actions button:hover { background: hsl(from #eef2ea var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .nm-empty { color: hsl(from #7a867c var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .note-bubble { color: hsl(from #2c342d var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html.dark-theme:not([data-theme="classic"]) .note-bubble { background: hsl(from #2b302b var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); color: hsl(from #e8ece6 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .note-pin.closed { background: hsl(from #8a968c var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sv-host { background: hsl(from #dfe5d8 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sv-pane .sv-tabs { background: hsl(from #f2f5ee var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border-bottom: 1px solid hsl(from #dfe5d8 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sv-pane:not(.on) .sv-tabs .view-tab.active { color: hsl(from #7a8870 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); border-top-color: hsl(from #c9d3bd var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sv-mirror { background: hsl(from #e8ece8 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sv-mirror .sv-empty { color: hsl(from #7e9273 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .sv-divider { background: hsl(from #cfd8c6 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .split-menu { border: 1px solid hsl(from #d2ddcc var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .split-menu button { color: hsl(from #4c5e44 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
html:not([data-theme="classic"]):not(.dark-theme) .split-menu button small { color: hsl(from #8a9a80 var(--theme-hue, 0) calc(s * var(--theme-sat, 0)) l); }
/* @theme-classic-derived end */

/* Themes: where the accent shows (not in Reva Classic, which keeps its original look). Open views and selected items read as one soft accent fill with accent text. */
html:not([data-theme="classic"]) .ribbon-tabs>button.active { color: var(--accent-text); }
html:not([data-theme="classic"]) .ribbon-button.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
html:not([data-theme="classic"]) .browser-row.active, html:not([data-theme="classic"]) .browser-row.open { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
html:not([data-theme="classic"]) .view-tab.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; border-top-color: transparent; border-bottom: 0; margin-bottom: 0; box-shadow: inset 0 -2px 0 var(--accent); }
html:not([data-theme="classic"]) .view-tab.active svg, html:not([data-theme="classic"]) .view-tab.active .tab-close { color: var(--accent-text); }
html:not([data-theme="classic"]) .engine-badge, html:not([data-theme="classic"]) .status-toggle.active { background: var(--accent-soft); color: var(--accent-text); }
html:not([data-theme="classic"]) .theme-toggle-btn { color: var(--accent-text); }
html:not([data-theme="classic"]) #draw-ribbon-tools .draw-panel-tool.active { background: var(--accent-soft); border-color: var(--accent-line); }

/* Objects Library: takes the place of the Project Browser content while the Object tool is active */
.browser-panel.lib-open > :not(.object-library) { display: none; }
.object-library { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.object-library[hidden] { display: none; }
.ol-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 6px; }
.ol-head h2 { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: .01em; color: var(--ink); }
.ol-head button { border: 0; background: transparent; color: var(--muted); border-radius: 6px; width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; }
.ol-head button:hover { background: var(--soft); color: var(--ink); }
.ol-search { position: relative; margin: 4px 12px 8px; }
.ol-search input { width: 100%; box-sizing: border-box; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); padding-inline: 30px 8px; font: inherit; font-size: 12px; }
.ol-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.ol-search-icon { position: absolute; inset-inline-start: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); display: grid; pointer-events: none; }
.ol-nav { display: flex; align-items: center; gap: 10px; margin: 0 12px 6px; font-size: 12px; }
.ol-all { border: 1px solid var(--line); background: var(--white); color: var(--accent-text); border-radius: 7px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.ol-all:hover { background: var(--accent-tint); }
.ol-nav strong { color: var(--ink); font-weight: 650; }
.ol-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 12px 14px; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.ol-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ol-cat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--text); cursor: pointer; font: inherit; }
.ol-cat:hover { border-color: var(--accent-line); background: var(--accent-tint); }
.ol-cat svg { color: var(--accent-text); }
.ol-cat strong { font-size: 12px; font-weight: 600; text-align: center; }
.ol-cat small { color: var(--muted); font-size: 10.5px; }
.ol-group h3 { margin: 12px 0 7px; font-size: 11.5px; font-weight: 650; color: var(--ink); }
.ol-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ol-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px 7px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--text); cursor: pointer; font: inherit; min-width: 0; }
.ol-item:hover { border-color: var(--accent-line); }
.ol-item.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.ol-thumb { display: block; width: 100%; aspect-ratio: 1; max-width: 86px; background: #f7f6f2; border-radius: 6px; padding: 3px; box-sizing: border-box; }
.ol-name { font-size: 10.5px; line-height: 1.25; text-align: center; overflow-wrap: anywhere; }
.ol-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 22px 6px; line-height: 1.6; }
@media (pointer: coarse) { .ol-head button { width: 40px; height: 40px; } .ol-search input { height: 40px; } .ol-all { padding: 8px 12px; } .ol-item { padding: 8px 4px; } }

/* Smart Mass — contextual Ribbon fields (large enough for finger and pen) */
.mass-field{display:flex;flex-direction:column;gap:2px;font-size:11px;min-width:64px;align-self:center}
.mass-field input{width:68px;min-height:30px;padding:2px 6px;font-size:13px;border:1px solid var(--line,#bbb);border-radius:6px;background:var(--panel,#fff);color:inherit}
.mass-type{display:flex;flex-direction:column;gap:3px;align-self:center}
.mass-type button{min-height:30px;min-width:64px;padding:2px 10px;border:1px solid var(--line,#bbb);border-radius:6px;background:var(--panel,#fff);color:inherit}
.mass-type button.active{background:#E87932;color:#fff;border-color:#E87932}
.mass-plane-label{padding:6px 10px;font-weight:600;align-self:center}
@media (pointer:coarse){.mass-field input,.mass-type button{min-height:40px;font-size:15px}.ribbon-button{min-width:56px}}

/* ===== Properties panel: Essentials / All, folding sections, stat tiles, docked actions =====
   Every colour comes from the theme tokens (--ink, --text, --muted, --line, --white, --soft, --panel, --accent-*), so the panel follows every theme in light and dark.
   Rules are scoped by #properties-content so they win over the older per-theme overrides above. */
#properties-content { --prop-label: color-mix(in srgb, var(--muted) 65%, var(--ink)); --prop-hair: color-mix(in srgb, var(--line) 55%, var(--white)); --prop-field: var(--white); }
html.dark-theme #properties-content { --prop-field: var(--soft); }
#properties-content .property-hero { margin: 14px 14px 12px; gap: 12px; }
#properties-content .property-hero-icon { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
#properties-content .property-hero h3 { font-size: 15px; font-weight: 650; color: var(--ink); margin: 0 0 2px; }
#properties-content .property-hero p { font-size: 11.5px; color: var(--prop-label); }
#properties-content .property-type { margin: 0 14px 12px; flex-wrap: wrap; }
#properties-content .property-type select { flex: 1 1 100%; width: 100%; min-width: 0; }
#properties-content .property-type button { flex: 1 1 0; min-width: 0; padding: 0 6px; font-size: 12px; }
#properties-content .property-type select, #properties-content .property-type button { height: 36px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--prop-field); color: var(--ink); }
#properties-content .property-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 14px 12px; }
#properties-content .property-stats[data-count="1"] { grid-template-columns: minmax(0, 1fr); }
#properties-content .property-stats[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#properties-content .property-stat { min-width: 0; padding: 6px 7px; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-tint); }
#properties-content .property-stat span { display: block; font-size: 10.5px; color: var(--prop-label); }
#properties-content .property-stat b { display: block; font-size: 12.5px; font-weight: 600; text-align: start; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#properties-content .property-mode { margin: 0 14px 6px; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border-radius: 9px; background: var(--soft); }
#properties-content .property-mode button { height: 28px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--prop-label); background: transparent; }
#properties-content .property-mode button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .18), 0 0 0 1px var(--line); }
#properties-content .property-mode button[aria-pressed="false"]:hover { background: transparent; color: var(--ink); }
#properties-content .property-section { margin-top: 0; padding-bottom: 4px; border-top: 1px solid var(--prop-hair); }
#properties-content .property-section-title { height: auto; min-height: 42px; gap: 8px; padding: 0 14px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); cursor: pointer; user-select: none; }
#properties-content .property-section-title:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
#properties-content .property-section-title > span:last-child { margin-inline-start: auto; font-size: 14px; color: var(--prop-label); transform: rotate(180deg); transition: transform .15s; }
#properties-content .property-summary { margin-inline-start: auto; max-width: 52%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--prop-label); }
#properties-content .property-summary + span { margin-inline-start: 0; }
#properties-content .property-section.folded { padding-bottom: 0; }
#properties-content .property-section.folded > :not(.property-section-title) { display: none; }
#properties-content .property-section.folded > .property-section-title > span:last-child { transform: rotate(90deg); }
html[data-ui-lang="ar"] #properties-content .property-section.folded > .property-section-title > span:last-child { transform: rotate(-90deg); }
#properties-content .property-row { min-height: 38px; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; padding: 3px 14px; font-size: 12px; color: var(--prop-label); border-bottom: 1px solid var(--prop-hair); }
#properties-content .property-row:last-child { border-bottom: 0; }
#properties-content .property-row > label { font-size: 12px; line-height: 1.35; color: var(--prop-label); }
#properties-content .property-row input:not([type=checkbox]), #properties-content .property-row select, #properties-content .property-row textarea { height: 32px; padding: 0 9px; font-size: 13px; color: var(--ink); background: var(--prop-field); border: 1px solid var(--line); border-radius: 7px; }
#properties-content .property-row textarea { height: auto; min-height: 60px; padding: 7px 9px; }
#properties-content .property-row input:not([type=checkbox]):hover, #properties-content .property-row select:hover { border-color: var(--accent-line); }
#properties-content .property-row input:not([type=checkbox]):focus, #properties-content .property-row select:focus, #properties-content .property-row textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .18); }
#properties-content .property-row input[readonly] { padding-inline: 0; color: var(--text); background: transparent; border-color: transparent; box-shadow: none; }
#properties-content .property-row .property-value { font-size: 13px; color: var(--text); }
#properties-content .property-row input[type=checkbox] { appearance: none; -webkit-appearance: none; position: relative; justify-self: start; width: 38px; height: 22px; margin: 0; border: 0; border-radius: 999px; background: var(--line); cursor: pointer; transition: background .15s; }
#properties-content .property-row input[type=checkbox]::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .35); transition: inset-inline-start .15s; }
#properties-content .property-row input[type=checkbox]:checked { background: var(--accent); }
#properties-content .property-row input[type=checkbox]:checked::after { inset-inline-start: 19px; }
#properties-content .property-row input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#properties-content .property-note { padding: 0 14px 12px; font-size: 11px; line-height: 1.6; color: var(--prop-label); }
#properties-content .property-actions { gap: 6px; padding: 8px 14px; }
#properties-content .property-actions button { padding: 7px 10px; font-size: 11.5px; color: var(--text); background: var(--prop-field); border: 1px solid var(--line); border-radius: 8px; }
#properties-content .property-actions.dock { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(46px, 1fr)); gap: 6px; padding: 10px 12px; background: var(--panel); border-top: 1px solid var(--line); }
#properties-content .property-actions.dock button { height: 52px; padding: 0 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10.5px; font-weight: 550; }
#properties-content .property-actions.dock svg { width: 16px; height: 16px; }
#properties-content .property-actions.dock button[data-action="delete"] { color: #c0392b; }
@media (pointer: coarse) {
  #properties-content .property-row { min-height: 46px; }
  #properties-content .property-row input:not([type=checkbox]), #properties-content .property-row select { height: 40px; font-size: 14px; }
  #properties-content .property-section-title { min-height: 48px; }
  #properties-content .property-mode button { height: 36px; }
  #properties-content .property-actions.dock button { height: 58px; }
}

/* Material Manager (Manage ▸ Material Manager) */
#modal:has(.mm) { width: min(980px, 96vw); max-width: min(980px, 96vw); max-height: 96vh; }
#modal:has(.mm) #modal-body { overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.mm { display: flex; flex-direction: column; gap: 10px; min-height: 0; flex: 1; }
.mm-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); }
.mm-tabs button { min-height: 40px; padding: 6px 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.mm-tabs button[aria-selected="true"] { border-bottom-color: var(--accent); font-weight: 700; }
.mm-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mm-bar input[type="search"] { flex: 1 1 200px; min-height: 40px; padding: 6px 10px; }
.mm-bar select, .mm-bar button { min-height: 40px; }
.mm-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 320px); gap: 12px; height: clamp(300px, calc(100vh - 300px), 520px); min-height: 0; }
.mm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; align-content: start; overflow-y: auto; padding: 2px; touch-action: pan-y; overscroll-behavior: contain; }
.mm-card { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; text-align: start; cursor: pointer; min-height: 96px; }
.mm-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.mm-name { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-meta { font-size: 11px; opacity: .7; }
.mm-sw { position: relative; display: block; height: 44px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(0,0,0,.25); background: repeating-conic-gradient(#c9c9c9 0 25%, #fff 0 50%) 0 0 / 12px 12px; }
.mm-sw::after { content: ''; position: absolute; inset: 0; background: var(--c); opacity: var(--a); }
.mm-sw.gloss::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(115deg, rgba(255,255,255,.55) 0 22%, rgba(255,255,255,0) 40%); }
.mm-detail { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-inline-end: 4px; touch-action: pan-y; overscroll-behavior: contain; }
.mm-detail label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.mm-detail input[type="text"], .mm-detail select, .mm-detail textarea { min-height: 38px; padding: 5px 8px; width: 100%; box-sizing: border-box; }
.mm-detail input[type="color"] { min-height: 38px; width: 100%; padding: 2px; }
.mm-detail input[type="range"] { min-height: 32px; }
.mm-preview .mm-sw { height: 72px; }
.mm-colorrow { display: grid; grid-template-columns: 76px 1fr; gap: 8px; align-items: end; }
.mm-id, .mm-use, .mm-facts { font-size: 11.5px; opacity: .8; }
.mm-id code { font-size: 10.5px; word-break: break-all; }
.mm-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; }
.mm-facts dt { opacity: .7; } .mm-facts dd { margin: 0; }
.mm-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.mm-actions button { min-height: 40px; }
.mm-replace { border: 1px solid var(--line); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.mm-replace p { margin: 0; font-size: 12px; }
.mm-empty { opacity: .7; font-size: 12.5px; padding: 8px; grid-column: 1 / -1; }
@media (max-width: 760px) { .mm-main { grid-template-columns: 1fr; height: auto; } .mm-grid { max-height: 34vh; } .mm-detail { max-height: 40vh; } }
.lt-mat { display: flex; gap: 4px; } .lt-mat input { flex: 1 1 auto; } .lt-mat select { flex: 0 0 38%; }

/* ===== Title bar v2 (design phase 1): Home, File menu, grouped right-hand actions ===== */
.titlebar .tb-sep { width: 1px; height: 20px; background: var(--line); flex: none; margin: 0 2px; }
.titlebar .file-btn { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 600; flex: none; cursor: pointer; }
.titlebar .file-btn svg { width: 12px; height: 12px; color: var(--muted); }
.titlebar .file-btn:hover, .titlebar .file-btn[aria-expanded="true"] { background: var(--accent-soft); color: var(--accent-text); }
.titlebar .file-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.titlebar .home-btn { margin-inline: 0; }
.titlebar .header-actions { gap: 2px; align-items: center; }
.titlebar .tb-btn, .titlebar .header-actions .text-button { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.titlebar .tb-btn svg, .titlebar .header-actions .text-button svg { width: 18px; height: 18px; }
.titlebar .tb-btn:hover, .titlebar .header-actions .text-button:hover { background: var(--accent-soft); color: var(--accent-text); }
.titlebar .tb-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.titlebar .tb-btn.active { background: var(--accent-soft); color: var(--accent-text); }
.titlebar .tb-div { width: 1px; height: 18px; background: var(--line); margin: 0 6px; flex: none; }
.titlebar .language-toggle select { width: auto; height: 28px; max-width: none; padding: 0 6px; font-size: 12px; font-weight: 650; border-radius: 7px; }
.titlebar .avatar { margin-inline-start: 4px; flex: none; }
.file-dropdown { position: fixed; z-index: 5000; min-width: 250px; padding: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px #00000033; }
.file-dropdown button { width: 100%; display: flex; align-items: center; gap: 12px; justify-content: flex-start; min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 550; text-align: start; cursor: pointer; }
.file-dropdown button svg { color: var(--muted); flex: none; }
.file-dropdown button:hover, .file-dropdown button:focus-visible { background: var(--accent-soft); color: var(--accent-text); outline: none; }
.file-dropdown button:hover svg, .file-dropdown button:focus-visible svg { color: var(--accent-text); }
.file-dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 5px 6px; }
html.dark-theme .file-dropdown { background: #1f1f1f; border-color: #3d3d3d; }
html.dark-theme .file-dropdown button { color: #e6e6e6; }
html.dark-theme .titlebar .file-btn { color: #e6e6e6; }
@media (max-width: 1300px) {
  .titlebar .brand > span:last-child { display: none; }
  .titlebar .ribbon-tabs > button { padding: 0 11px; }
}
.titlebar .tb-btn svg, .titlebar .header-actions .text-button svg, .titlebar .home-btn svg, .titlebar .avatar svg { stroke-width: 1.7; }
.titlebar .avatar { display: inline-grid; place-items: center; background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.titlebar .avatar svg { width: 17px; height: 17px; }
.titlebar .home-btn svg { width: 18px; height: 18px; }

/* ===== Ribbon v2 (design phase 2): group labels, dropdown buttons ===== */
.ribbon { height: 100px; min-height: 100px; padding-top: 6px; padding-bottom: 0; }
.ribbon-group-label { display: flex; height: 18px; font-size: 10px; color: var(--muted, #8a8a8a); }
.ribbon-group { padding: 0 11px; }
.ribbon-buttons { align-items: center; }
.ribbon-button { height: 64px; min-width: 52px; gap: 5px; align-items: center; justify-content: flex-start; }
.ribbon-button.has-menu { position: relative; }
.ribbon-button.has-menu > svg:last-child { width: 10px; height: 10px; margin-top: -3px; color: #8a8a8a; }
.ribbon-dropdown { position: fixed; z-index: 1000; min-width: 170px; padding: 5px; background: var(--panel, #fff); border: 1px solid var(--line, #dcdcdc); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.16); display: flex; flex-direction: column; gap: 2px; }
.ribbon-dropdown button { display: flex; align-items: center; justify-content: flex-start; width: 100%; gap: 9px; height: 30px; padding: 0 10px; border-radius: 6px; font-size: 12px; text-align: start; }
.ribbon-dropdown button:hover { background: var(--accent-soft); }
html.dark-theme .ribbon-dropdown { background: #26282c; border-color: #3a3d42; }
.ws-compact .ribbon { height: 52px; min-height: 52px; padding-top: 0; }
.ws-compact .ribbon-button.has-menu > svg:last-child { display: none; }
.ws-compact .ribbon .ribbon-button { height: 40px; }
.ribbon-group:first-child .ribbon-group-label { visibility: hidden; }
.ribbon:not(.modify-compact):not(:has(.reva-context-grid)) .ribbon-small { max-height: 72px; }
.ws-compact .ribbon-small { max-height: none; }

/* ===== Properties panel v2 (design phase 3) ===== */
#properties-content .property-hero { align-items: center; }
#properties-content .property-hero > div { flex: 1; min-width: 0; }
#properties-content .property-count { flex: none; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 650; white-space: nowrap; }
#properties-content .property-stats { margin: 12px 14px 14px; }
#properties-content .property-stat b { font-size: 15px; font-weight: 700; }
#properties-content .property-actions.dock button.danger, #properties-content .property-actions.dock button[data-action="delete"] { color: #dc2626; }
#properties-content .property-actions.dock { grid-template-columns: repeat(5, minmax(0, 1fr)); }
#properties-content .property-actions.dock button { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 52px; justify-content: center; }
#properties-content .property-actions.dock svg { width: 16px; height: 16px; }
@media (max-width: 700px) { #properties-content .property-actions.dock { display: none; } }

/* Properties v2.1: design proportions (340px panel, 104px label column, 16px gutters) */
#properties-content .property-hero { margin: 16px 16px 12px; }
#properties-content .property-hero h3 { font-size: 16px; }
#properties-content .property-type { margin: 0 16px 12px; }
#properties-content .property-row { grid-template-columns: 104px minmax(0, 1fr); gap: 10px; padding: 3px 16px; }
#properties-content .property-section-title { min-height: 44px; padding: 0 16px; }
#properties-content .property-stats { margin: 12px 16px 14px; gap: 8px; }
#properties-content .property-note { padding: 0 16px 12px; }
#properties-content .property-row input:not([type=checkbox]), #properties-content .property-row select { height: 30px; border-radius: 7px; font-size: 12.5px; }
/* Modify tab: the Select button is the same big dropdown button as on every other tab */
#ribbon.modify-compact .ribbon-button.has-menu { grid-row: 1 / 3; flex-direction: column; justify-content: center; align-items: center; width: 52px; height: 64px; padding: 4px 6px; gap: 5px; font-size: 10px; }
#ribbon.modify-compact .ribbon-button.has-menu svg:first-child { width: 26px; height: 26px; flex-basis: auto; }
#ribbon.modify-compact .ribbon-button.has-menu > svg:last-child { width: 10px; height: 10px; flex-basis: auto; }

/* ===== Status bar v2 (design phase 4) ===== */
.statusbar { height: 28px; min-height: 28px; gap: 18px; padding: 0 14px; font-size: 12px; color: var(--muted); background: var(--panel); border-top: 1px solid var(--line); }
.statusbar .status-message { flex: 0 1 auto; max-width: 34%; gap: 6px; }
.statusbar .status-message svg { width: 14px; height: 14px; }
.statusbar .view-controls { gap: 4px; }
.statusbar .view-controls .controls-left { gap: 4px; }
.statusbar .view-controls button { width: 24px; height: 22px; border-radius: 6px; color: var(--muted); }
.statusbar .view-controls button:hover { background: var(--soft); }
.statusbar .view-controls button.active { background: var(--accent-soft); color: var(--accent-text); }
.statusbar .view-controls svg { width: 14px; height: 14px; }
.statusbar .view-controls select { height: 22px; width: auto; padding: 0 6px 0 8px; font-size: 12px; font-weight: 550; color: var(--ink); background: var(--field, var(--white)); border: 1px solid var(--line); border-radius: 6px; }
.statusbar .control-divider { height: 14px; margin: 0 6px; background: var(--line); }
.statusbar .controls-right { gap: 8px; color: var(--muted); font-size: 12px; margin-inline-start: auto; }
.statusbar .engine-badge { height: 20px; padding: 0 8px; gap: 6px; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 11px; font-weight: 600; }
.statusbar .engine-badge i { width: 7px; height: 7px; background: #2f9e6e; }
.statusbar .status-right { gap: 8px; }
.statusbar .status-selection-count { font-size: 12px; font-weight: 650; color: var(--accent-text); }
.statusbar .status-toggle { display: flex; align-items: center; height: 22px; padding: 0 8px; gap: 5px; border-radius: 6px; font-size: 12px; font-weight: 550; color: var(--muted); }
.statusbar .status-toggle svg { width: 14px; height: 14px; }
.statusbar .status-toggle.active { background: var(--accent-soft); color: var(--accent-text); }
.statusbar .status-divider { height: 14px; margin: 0 4px; background: var(--line); }
.statusbar #coordinates { font-size: 12px; word-spacing: 0; color: var(--muted); }
.statusbar .health-button { font-size: 12px; gap: 6px; color: var(--muted); }
.statusbar #health-dot { width: 7px; height: 7px; }
.statusbar #health-dot { background: #2f9e6e; }

/* Ribbon: no group names, a slimmer bar (design) */
.ribbon .ribbon-group-label, #ribbon.modify-compact .ribbon-group-label { display: none; }
.ribbon { height: 80px; min-height: 80px; padding-top: 6px; padding-bottom: 6px; }
.ribbon-group { justify-content: center; }
.ribbon-buttons { flex: none; }
.ws-compact .ribbon { height: 52px; min-height: 52px; padding-top: 0; padding-bottom: 0; }

/* ===== Options bar docked under the ribbon + view tabs (design) ===== */
body > .app > .options-bar, #ribbon + .options-bar { position: static; width: auto; max-width: none; height: 36px; min-height: 36px; padding: 0 16px; gap: 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--white); font-size: 12px; color: var(--muted); overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; flex: none; }
#ribbon + .options-bar > * { flex: none; }
#ribbon + .options-bar .options-right { display: none; }
#ribbon + .options-bar .tool-indicator { min-width: 0; font-weight: 700; color: var(--accent-text); font-size: 13px; gap: 8px; }
#ribbon + .options-bar .tool-indicator svg { width: 16px; height: 16px; }
#ribbon + .options-bar .options-separator { display: none; }
#ribbon + .options-bar label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
#ribbon + .options-bar select, #ribbon + .options-bar input:not([type=checkbox]) { height: 24px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--field, var(--white)); color: var(--ink); font-size: 12px; }
#ribbon + .options-bar .context-tool-options:not([hidden]), #ribbon + .options-bar #wall-placement-options { display: flex; align-items: center; gap: 12px; white-space: nowrap; flex: none; }
#ribbon + .options-bar.auto-hidden { display: none; }
html.dark-theme #ribbon + .options-bar { background: var(--panel); border-color: var(--line); }

.view-tabs { height: 32px; min-height: 32px; align-items: flex-end; gap: 2px; padding: 0 12px; background: var(--soft); border-bottom: 1px solid var(--line); }
.view-tab { height: 28px; min-width: 0; padding: 0 12px; gap: 7px; font-size: 12px; font-weight: 550; color: var(--muted); border: 1px solid transparent; border-bottom: 0; border-radius: 7px 7px 0 0; }
.view-tab svg { width: 14px; height: 14px; color: var(--muted); }
.view-tab.active { height: 29px; margin-bottom: -1px; background: var(--white); color: var(--ink); font-weight: 650; border-color: var(--line); border-top-color: var(--line); box-shadow: inset 0 2px 0 var(--accent); }
.view-tab .tab-close { margin-left: 6px; font-size: 15px; color: var(--muted); }

/* Ribbon sizes per design: 22px / 16px icons at stroke 1.7, icon-only grids */
#ribbon svg { stroke-width: 1.7; }
.ribbon-button svg { width: 22px; height: 22px; }
.ribbon-small button svg { width: 16px; height: 16px; }
.ribbon-icons { display: grid; grid-template-rows: repeat(var(--rows, 1), 40px); grid-auto-flow: column; grid-auto-columns: 40px; gap: 0 2px; align-content: center; }
.ribbon-icons button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--text); }
.ribbon-icons button:hover { background: var(--soft); }
.ribbon-icons button.active { background: var(--accent-soft); color: var(--accent-text); }
.ribbon-icons button:disabled, .ribbon-small button:disabled, .ribbon-button:disabled { opacity: .4; cursor: not-allowed; }
.ribbon-vsep { width: 1px; align-self: stretch; background: var(--hair, var(--line)); margin: 4px 6px; }
.ribbon-buttons { align-items: center; }
.ribbon-icons.compact { gap: 2px 2px; grid-template-rows: repeat(var(--rows, 1), 26px); grid-auto-columns: 36px; align-content: center; }
.ribbon-icons.compact button { width: 36px; height: 26px; border-radius: 7px; }
.ribbon-icons button.danger { color: #c0392b; }
/* Draw modes: icon-only, three rows per column (design) */
#draw-ribbon-tools .context-draw-grid { display: grid !important; grid-template-rows: repeat(3, 26px) !important; grid-auto-flow: column !important; grid-template-columns: none !important; grid-auto-columns: 36px !important; gap: 2px !important; align-content: center; }
#draw-ribbon-tools .context-draw-tool { width: 36px !important; min-width: 0 !important; height: 26px !important; min-height: 0 !important; padding: 0 !important; border-radius: 7px !important; display: flex !important; align-items: center; justify-content: center; }
#draw-ribbon-tools .context-draw-tool svg { width: 16px !important; height: 16px !important; }
#draw-ribbon-tools .context-draw-tool.active { background: var(--accent-soft) !important; border-color: var(--accent-line) !important; color: var(--accent-text) !important; }
.ribbon .ribbon-group:last-child { margin-inline-start: 0 !important; }


/* ===== Workspace modes v2 (Compact / Focus) — Layout-compact.dc / Layout-focus.dc ===== */
/* Compact: the same ribbon, labelled, at a smaller scale; denser bars. */
.ws-compact .titlebar { height: 36px; min-height: 36px; }
.ws-compact .titlebar .ribbon-tabs { height: 35px; }
.ws-compact #ribbon { height: 66px; min-height: 66px; }
.ws-compact .ribbon .ribbon-button { min-width: 50px; height: 54px; font-size: 10.5px; gap: 2px; padding: 2px 3px; }
.ws-compact .ribbon .ribbon-button svg { width: 19px; height: 19px; }
.ws-compact .ribbon .ribbon-small button { height: 24px; font-size: 10.5px; gap: 5px; padding: 0 4px; }
.ws-compact .ribbon .ribbon-small button svg { width: 14px; height: 14px; }
.ws-compact .ribbon .ribbon-icons button { width: 32px; height: 28px; }
.ws-compact .ribbon .ribbon-icons button svg { width: 20px; height: 20px; }
.ws-compact .ribbon .ribbon-icons { grid-template-rows: repeat(var(--rows, 1), 28px); grid-auto-columns: 32px; }
.ws-compact .ribbon .ribbon-icons.compact { grid-template-rows: repeat(var(--rows, 1), 20px); grid-auto-columns: 28px; }
.ws-compact .ribbon .ribbon-icons.compact button { width: 28px; height: 20px; }
.ws-compact .ribbon .ribbon-icons.compact button svg { width: 14px; height: 14px; }
.ws-compact .options-bar { height: 24px; min-height: 24px; }
.ws-compact:not(.ws-overlay) .workspace:not(.ws-bh):not(.ws-ph) { grid-template-columns: 236px minmax(330px, 1fr) 300px; }
.ws-compact .statusbar, .ws-focus .statusbar { height: 22px; min-height: 22px; font-size: 11px; }
.ws-compact .statusbar *, .ws-focus .statusbar * { font-size: 11px; }
/* Focus: header strip + options bar + view tabs stay; the ribbon opens as a pop-down from its tab; rails are 40px. */
.ws-focus #toolbars, .ws-focus.ws-toolbars-float #toolbars, .ws-focus.ws-focus-hidden #toolbars { display: block; position: relative; top: auto; left: auto; right: auto; max-height: none; overflow: visible; box-shadow: none; background: transparent; }
.ws-focus #ribbon { display: none; }
.ws-focus.ws-toolbars-float #ribbon { display: flex; position: absolute; left: 0; right: 0; top: 38px; z-index: 60; background: var(--panel, #fff); box-shadow: 0 10px 24px rgba(0,0,0,.18); border-bottom: 1px solid var(--line); }
.ws-focus .titlebar { height: 38px; min-height: 38px; }
.ws-focus .titlebar .ribbon-tabs { height: 37px; }
.ws-focus .titlebar .brand > span:last-child, .ws-focus .titlebar .project-title { display: none; }
.ws-focus .titlebar .header-actions > :not([data-action="undo"]) { display: none; }
.ws-focus .options-bar { height: 26px; min-height: 26px; }
.ws-focus .view-tabs { height: 28px; min-height: 28px; }
.ws-focus .workspace, .ws-focus .workspace.ws-bh, .ws-focus .workspace.ws-ph, .ws-focus .workspace.ws-bh.ws-ph { grid-template-columns: 40px minmax(0, 1fr) 40px !important; }
.ws-focus .edge-tab { gap: 14px; padding: 14px 0; font-size: 10px; letter-spacing: .16em; }
/* Pop-down ribbon (Focus, tablet Compact): header strip + options bar + view tabs stay; the ribbon opens as a pop-down from its tab; rails are 40px. */
.ws-popribbon #toolbars, .ws-popribbon.ws-toolbars-float #toolbars, .ws-popribbon.ws-focus-hidden #toolbars { display: block; position: relative; top: auto; left: auto; right: auto; max-height: none; overflow: visible; box-shadow: none; background: transparent; }
.ws-popribbon #ribbon { display: none; }
.ws-popribbon.ws-toolbars-float #ribbon { display: flex; position: absolute; left: 0; right: 0; top: 38px; z-index: 60; background: var(--panel, #fff); box-shadow: 0 10px 24px rgba(0,0,0,.18); border-bottom: 1px solid var(--line); }
.ws-popribbon .titlebar { height: 38px; min-height: 38px; }
.ws-popribbon .titlebar .ribbon-tabs { height: 37px; }
.ws-popribbon .titlebar .brand > span:last-child, .ws-popribbon .titlebar .project-title { display: none; }
.ws-focus .titlebar .header-actions > :not([data-action="undo"]), .ws-compact.ws-popribbon .titlebar .header-actions > :not([data-action="undo"]):not([data-action="redo"]):not([data-action="save"]):not(#tb-3d):not([data-action="account-menu"]) { display: none; }
.ws-popribbon .options-bar { height: 26px; min-height: 26px; }
.ws-popribbon .view-tabs { height: 28px; min-height: 28px; }
.ws-popribbon .workspace, .ws-popribbon .workspace.ws-bh, .ws-popribbon .workspace.ws-ph, .ws-popribbon .workspace.ws-bh.ws-ph { grid-template-columns: 40px minmax(0, 1fr) 40px !important; }
.ws-popribbon .edge-tab { gap: 14px; padding: 14px 0; font-size: 10px; letter-spacing: .16em; }
html.dark-theme .ws-focus.ws-toolbars-float #ribbon { background: #1c1c1c; }


/* ===== Phase 6: phone layout (portrait ≤700px) — Layout-mobile.dc: bottom nav + bottom sheets ===== */
.mobile-nav { display: none; }
@media (max-width: 700px) {
  #app { min-width: 0; }
  .center-panel, .center-main, .workspace { min-width: 0; }
  #app .titlebar { height: 52px; min-height: 52px; padding: 0 8px; gap: 4px; }
  #app .titlebar .ribbon-tabs, #app .titlebar .project-title, #app .titlebar .tb-sep, #app .titlebar .brand > span:last-child { display: none; }
  #app .titlebar .header-actions > :not([data-action="undo"]):not([data-action="redo"]):not(#tb-3d):not([data-action="account-menu"]) { display: none; }
  #app .titlebar .header-actions { margin-inline-start: auto; }
  #app .titlebar .file-btn { font-size: 16px; }
  #ribbon { display: none; }
  .options-bar { overflow-x: auto; flex-wrap: nowrap; height: 44px; min-height: 44px; white-space: nowrap; }
  .edge-tab, .workspace > .edge-tab { display: none !important; }
  #app .workspace, #app .workspace.ws-bh, #app .workspace.ws-ph, #app .workspace.ws-bh.ws-ph { grid-template-columns: minmax(0, 1fr) !important; }
  #app .workspace > .center-panel { grid-column: 1 !important; }
  .view-controls, .status-message, #coordinates, .status-divider, .health-button { display: none !important; }
  .statusbar { height: 36px; min-height: 36px; justify-content: space-between; padding: 0 10px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; height: 64px; padding: 6px 10px 18px; background: var(--panel, #fff); border-top: 1px solid var(--line); order: 99; }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 14px; font-size: 11px; font-weight: 600; color: var(--muted, #666); background: transparent; border: 0; }
  .mobile-nav button.active { background: var(--accent-soft); color: var(--accent-text, var(--accent)); }
  #app .workspace > .browser-panel, #app .workspace > .properties-panel, #app #ribbon, #app .titlebar .ribbon-tabs { }
  /* sheets */
  #app[data-sheet="browser"] .workspace > .browser-panel, #app[data-sheet="props"] .workspace > .properties-panel { display: flex !important; position: fixed; left: 0; right: 0; bottom: 64px; top: auto; width: auto; height: 62dvh; z-index: 80; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.2); background: var(--panel, #fff); overflow-y: auto; }
  #app[data-sheet="tools"] #ribbon { display: flex; flex-wrap: wrap; position: fixed; left: 0; right: 0; bottom: 64px; height: 62dvh; min-height: 0; z-index: 80; padding: 64px 12px 12px; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.2); background: var(--panel, #fff); overflow-y: auto; align-content: flex-start; gap: 10px; }
  #app[data-sheet="tools"] .titlebar .ribbon-tabs { display: flex; position: fixed; left: 0; right: 0; bottom: calc(64px + 62dvh - 52px); z-index: 81; padding: 8px 12px; overflow-x: auto; height: 52px; gap: 6px; background: var(--panel, #fff); border-radius: 18px 18px 0 0; }
  #app[data-sheet="tools"] .titlebar .ribbon-tabs button { border-radius: 999px; padding: 6px 14px; background: var(--soft); height: 34px; white-space: nowrap; }
  #app[data-sheet="tools"] .titlebar .ribbon-tabs button.active { background: var(--accent-soft); color: var(--accent-text, var(--accent)); }
  #app[data-sheet="tools"] .ribbon .ribbon-group { border: 0; height: auto; padding: 0; flex-wrap: wrap; }
  #app[data-sheet]:not([data-sheet=""]) .qat { display: none; }
  .qat[data-pos="bottom"] { bottom: calc(var(--qat-lift-base, 0px) + 8px); max-width: calc(100vw - 16px); overflow-x: auto; }
}

/* Phone landscape — Layout-land.dc: header strip, left rail (Browser / Tools / Properties), popover sheets */
@media (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  #app { min-width: 0; padding-left: 64px; }
  .center-panel, .center-main, .workspace { min-width: 0; }
  #app .titlebar { height: 44px; min-height: 44px; margin-left: -64px; padding-left: 12px; }
  #app .titlebar .ribbon-tabs, #app .titlebar .project-title, #app .titlebar .tb-sep, #app .titlebar .brand > span:last-child { display: none; }
  #app .titlebar .header-actions > :not([data-action="undo"]):not([data-action="redo"]):not(#tb-3d):not([data-action="account-menu"]) { display: none; }
  #app .titlebar .header-actions { margin-inline-start: auto; }
  #ribbon { display: none; }
  .edge-tab, .workspace > .edge-tab { display: none !important; }
  #app .workspace, #app .workspace.ws-bh, #app .workspace.ws-ph, #app .workspace.ws-bh.ws-ph { grid-template-columns: minmax(0, 1fr) !important; }
  #app .workspace > .center-panel { grid-column: 1 !important; }
  .view-controls, .status-message, #coordinates, .status-divider, .health-button { display: none !important; }
  .statusbar { height: 30px; min-height: 30px; justify-content: space-between; padding: 0 10px; }
  .mobile-nav { display: flex; flex-direction: column; gap: 6px; position: fixed; left: 0; top: 44px; bottom: 30px; width: 64px; height: auto; padding: 8px 6px; background: var(--panel, #fff); border-right: 1px solid var(--line); z-index: 70; justify-content: center; }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 12px; font-size: 10px; font-weight: 600; color: var(--muted, #666); background: transparent; border: 0; padding: 8px 0; }
  .mobile-nav button.active { background: var(--accent-soft); color: var(--accent-text, var(--accent)); }
  #app[data-sheet="browser"] .workspace > .browser-panel, #app[data-sheet="props"] .workspace > .properties-panel { display: flex !important; position: fixed; left: 72px; top: 50px; bottom: 36px; width: 340px; height: auto; z-index: 80; border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); background: var(--panel, #fff); overflow-y: auto; }
  #app[data-sheet="tools"] #ribbon { display: flex; flex-wrap: wrap; position: fixed; left: 72px; top: 96px; bottom: 36px; width: 340px; z-index: 80; padding: 8px 12px; border-radius: 0 0 14px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); background: var(--panel, #fff); overflow-y: auto; align-content: flex-start; gap: 10px; height: auto; }
  #app[data-sheet="tools"] .titlebar .ribbon-tabs { display: flex; position: fixed; left: 72px; top: 50px; width: 340px; height: 46px; z-index: 81; padding: 6px 10px; overflow-x: auto; gap: 6px; background: var(--panel, #fff); border-radius: 14px 14px 0 0; }
  #app[data-sheet="tools"] .titlebar .ribbon-tabs button { border-radius: 999px; padding: 4px 12px; background: var(--soft); height: 32px; white-space: nowrap; }
  #app[data-sheet="tools"] .titlebar .ribbon-tabs button.active { background: var(--accent-soft); color: var(--accent-text, var(--accent)); }
  #app[data-sheet="tools"] .ribbon .ribbon-group { border: 0; height: auto; padding: 0; flex-wrap: wrap; }
  #app[data-sheet]:not([data-sheet=""]) .qat { display: none; }
}

/* ===== Resizable side panels ===== */
.panel-resizer { position: absolute; width: 10px; z-index: 40; cursor: col-resize; touch-action: none; background: transparent; }
.panel-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 2px; background: transparent; transition: background .12s; }
.panel-resizer:hover::after, .panel-resizer:focus-visible::after, .panel-resizer.dragging::after { background: var(--accent); }
.panel-resizer:focus-visible { outline: none; }
.panel-resizer[hidden] { display: none; }
body.panel-resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
body.panel-resizing canvas, body.panel-resizing .center-panel { pointer-events: none; }
@media (pointer: coarse) { .panel-resizer { width: 22px; margin-left: -6px; } .panel-resizer::after { left: 10px; width: 3px; } }
.ws-overlay .workspace > .browser-panel { width: min(var(--bw, 340px), 88vw); } .ws-overlay .workspace > .properties-panel { width: min(var(--pw, 340px), 88vw); }
@media (min-width: 701px) {
  #app:not(.ws-overlay) .workspace.ws-sized:not(.ws-bh):not(.ws-ph) { grid-template-columns: var(--bw, 233px) minmax(330px, 1fr) var(--pw, 340px); }
  #app:not(.ws-overlay) .workspace.ws-sized.ws-bh:not(.ws-ph) { grid-template-columns: 30px minmax(330px, 1fr) var(--pw, 340px) !important; }
  #app:not(.ws-overlay) .workspace.ws-sized.ws-ph:not(.ws-bh) { grid-template-columns: var(--bw, 233px) minmax(330px, 1fr) 30px !important; }
}
@media (max-width: 700px) { .panel-resizer { display: none; } }

/* ===== Floating toolbar (QAT) — Ribbon-qat-layouts.dc ===== */
#app .qat { padding: 6px; gap: 4px; background: #fff; border: 1px solid #dcdcdc; border-radius: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
#app .qat-tools { gap: 4px; }
#app .qat-button { width: 38px; height: 36px; border-radius: 9px; color: #444; }
#app .qat-button svg { width: 20px; height: 20px; stroke-width: 1.7; }
#app .qat-num { top: 3px; right: 4px; left: auto; font-size: 10px; font-style: normal; color: #6b6b6b; }
#app .qat-grip { width: 24px; height: 36px; border-radius: 8px; background: #f2f2f2; display: grid; grid-template-columns: repeat(2, 4px); grid-auto-rows: 4px; gap: 4px; padding: 8px 6px; place-content: center; box-sizing: border-box; }
#app .qat-grip i { width: 4px; height: 4px; border-radius: 50%; background: #6b6b6b; }
#app .qat.vertical .qat-grip { width: 100%; height: 24px; grid-template-columns: repeat(3, 4px); padding: 6px 8px; }
#app .qat-separator { width: 1px; height: 24px; background: #dcdcdc; margin: 0 2px; }
#app .qat.vertical .qat-separator { width: 24px; height: 1px; margin: 2px 0; }
#app .qat-fold { color: #444; }
html.dark-theme #app .qat { background: #1c1c1c; border-color: #353535; }
html.dark-theme #app .qat-grip { background: #2a2a2a; }
html.dark-theme #app .qat-grip i { background: #9a9a9a; }
html.dark-theme #app .qat-button, html.dark-theme #app .qat-fold { color: #cfcfcf; }
#app .qat-button[data-action="delete"] { color: #444; } html.dark-theme #app .qat-button[data-action="delete"] { color: #cfcfcf; }

/* Phone: the drawing is the main thing — only the essentials float over it (Layout-mobile.dc) */
@media (max-width: 700px), (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  #app .viewport-header, #app .view-quick, #app .viewcube, #app .model-note, #app .view-label { display: none !important; }
  #app .nav-tools { top: 10px; bottom: auto; right: 10px; transform: none; flex-direction: column; }
  #app .nav-tools button:not([data-action="fit"]):not([data-action="zoom-out"]) { display: none; }
  #app .nav-tools button[data-action="zoom-out"] { order: 0; } #app .nav-tools button[data-action="fit"] { order: 1; }
  #app .options-bar label:has(#active-level) { display: none; }
  #app .options-bar { gap: 8px; padding: 0 10px; }
  /* one slim palette row at the bottom: header already has undo / redo */
  #app .qat[data-rows="2"] .qat-tools { display: flex; }
  #app .qat .qat-mode, #app .qat .qat-num,
  #app .qat .qat-button[data-action="undo"], #app .qat .qat-button[data-action="redo"] { display: none !important; }
  #app .qat { left: calc(50% + var(--qat-mx, 0px)) !important; right: auto !important; top: auto !important; bottom: calc(var(--qat-lift-base, 0px) + 10px); transform: translateX(-50%); flex-direction: row; max-width: calc(100% - 16px); padding: 6px 8px; border-radius: 16px; }
  #app .qat.vertical .qat-tools { flex-direction: row; }
  /* drag handle: a small tab on top of the palette (six dots) — slide it left or right */
  #app .qat .qat-grip { position: absolute; left: 50%; top: -15px; transform: translateX(-50%); width: 44px; height: 16px; min-width: 0; min-height: 0; border-radius: 9px 9px 0 0; background: var(--white, #fff); border: 1px solid var(--line, #dcdcdc); border-bottom: 0; grid-template-columns: repeat(3, 3px); grid-template-rows: repeat(2, 3px); grid-auto-rows: 3px; gap: 3px; padding: 0; place-content: center; touch-action: none; }
  #app .qat .qat-grip i { width: 3px; height: 3px; }
  #app .qat .qat-grip::after { content: ""; position: absolute; inset: -14px -14px 0; }
  #app .qat .qat-separator { display: block; height: 26px; margin: 0 3px; }
  #app .qat:not(.vertical) { overflow: visible; transition: none; } #app .qat .qat-tools { flex: 0 1 auto; min-width: 0; max-width: 182px; } /* about four tools show; the rest scroll — leaves room to slide the palette */
  #app .qat-button { width: 44px; height: 44px; }
  #app .qat-button svg { width: 22px; height: 22px; }
  #app .qat .qat-tools { overflow-x: auto; scrollbar-width: none; }
  #app .sketch-help { bottom: 72px; font-size: 12px; max-width: calc(100% - 16px); }
}
@media (max-width: 700px), (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  #app .sketch-help { left: 8px !important; right: 8px !important; transform: none !important; width: auto; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px 10px; }
  #app .sketch-help kbd { display: none; }
  #app .nav-tools button { color: #444; opacity: 1; }
}
@media (max-width: 1300px) { .ws-popribbon .controls-right, .ws-popribbon #coordinates { display: none; } .ws-popribbon .statusbar { white-space: nowrap; } }
@media (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  #app .qat-button { width: 38px; height: 38px; } #app .qat { padding: 4px 6px; bottom: 6px; border-radius: 14px; }
  #app .sketch-help { bottom: 56px; }
}
.statusbar .qat-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; padding: 0; }
.statusbar .qat-toggle svg { width: 16px; height: 16px; }
.statusbar .qat-toggle.active { background: var(--accent-soft); color: var(--accent-text, var(--accent)); }

/* Phone: slimmer bars = more drawing (Layout-mobile / Layout-land) */
@media (max-width: 700px) and (orientation: portrait) {
  #app .titlebar { height: 44px; min-height: 44px; }
  #app .options-bar { height: 38px; min-height: 38px; }
  #app .view-tabs { height: 34px; min-height: 34px; }
  #app .statusbar { height: 30px; min-height: 30px; }
  #app .mobile-nav { height: 54px; padding: 4px 10px 10px; }
  #app[data-sheet="browser"] .workspace > .browser-panel, #app[data-sheet="props"] .workspace > .properties-panel { bottom: 54px; }
  #app[data-sheet="tools"] #ribbon { bottom: 54px; }
  #app[data-sheet="tools"] .titlebar .ribbon-tabs { bottom: calc(54px + 62dvh - 52px); }
}
@media (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  #app .titlebar .view-tabs { flex: 1 1 auto; min-width: 0; height: 100%; min-height: 0; border: 0; background: transparent; overflow-x: auto; scrollbar-width: none; align-self: stretch; margin: 0 6px; }
  #app .options-bar { height: 34px; min-height: 34px; }
  #app .statusbar { height: 26px; min-height: 26px; }
  .mobile-nav { top: 44px; bottom: 26px; }
}
@media (max-width: 700px), (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  #app .sketch-help { top: 8px !important; bottom: auto !important; right: 64px !important; left: 8px !important; padding: 6px 10px; font-size: 12px; }
}
@media (max-width: 700px), (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  #app .sketch-help { flex-wrap: nowrap !important; justify-content: space-between !important; }
  #app .sketch-help > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #app .sketch-help button { flex: none; }
}

@media (max-height: 500px) and (max-width: 1000px) and (orientation: landscape) {
  #app .mobile-nav { top: 44px; bottom: 26px; height: auto; width: 64px; padding: 8px 6px; overflow: hidden; align-content: center; grid-template-columns: none; }
  #app .titlebar { height: 44px; min-height: 44px; }
  #app .options-bar { height: 34px; min-height: 34px; }
}

/* Reva Board: smart nodes (pop-in of a new node / connector; the slide of moved nodes is done in JS) */
@keyframes bdpop { from { opacity: 0; transform: scale(.55); } to { opacity: 1; transform: scale(1); } }
#board-app .bd-pop { animation: bdpop .22s cubic-bezier(.2, .8, .3, 1.2) both; transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: reduce) { #board-app .bd-pop { animation: none; } }
.bd-quick { max-width: min(96%, 760px); }
.bd-quick select[data-q="nstyle"] { max-width: 112px; }

/* Reva Board: mini map */
.bd-mini { position: absolute; z-index: 40; bottom: 10px; inset-inline-end: 10px; padding: 4px; background: var(--bd-panel); border: 1px solid var(--bd-line); border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.18); touch-action: none; cursor: crosshair; line-height: 0; }
.bd-mini svg { display: block; border-radius: 6px; background: var(--bd-bg, transparent); }
#board-app.present .bd-mini { display: none; }

/* Reva Board: library panel (stickers, cards, templates) */
.bd-libq { width: 100%; box-sizing: border-box; margin: 6px 0; padding: 6px 8px; border: 1px solid var(--bd-line); border-radius: 8px; background: var(--bd-bg, transparent); color: inherit; font: inherit; }
#bd-stickers .bd-tabs { flex-wrap: wrap; gap: 2px; }
.bd-tplw { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; width: 76px; }
.bd-tplw .bd-tpl { width: 76px; height: 56px; padding: 3px; }
.bd-tplw small { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; opacity: .75; }
.bd-tpl-x { position: absolute; top: 1px; inset-inline-end: 1px; width: 16px; height: 16px; line-height: 16px; text-align: center; font-size: 10px; border-radius: 50%; background: var(--bd-panel); border: 1px solid var(--bd-line); cursor: pointer; opacity: 0; }
.bd-tplw:hover .bd-tpl-x, .bd-tpl-x:focus { opacity: 1; }

/* Reva Board: resizable, movable side panel */
.bd-side[hidden], .bd-sidegrip[hidden] { display: none; }
#board-app .bd-side { position: relative; max-width: 60%; }
#board-app[data-side="left"] .bd-side { border-inline-start: 0; border-right: 1px solid var(--bd-line); }
#board-app[data-side="right"] .bd-side { border-inline-start: 0; border-left: 1px solid var(--bd-line); }
.bd-sidegrip { flex: none; width: 6px; margin: 0 -3px; z-index: 5; cursor: col-resize; touch-action: none; background: transparent; position: relative; }
.bd-sidegrip:hover, .bd-sidegrip:focus-visible, .bd-sidegrip:active { background: var(--bd-accent, #2563eb); opacity: .55; outline: none; }
.bd-sidehead { display: flex; justify-content: flex-end; gap: 2px; padding: 4px 6px 0; position: sticky; top: 0; z-index: 2; background: var(--bd-panel); }
#board-app.present .bd-sidegrip { display: none; }
#board-app[data-focus="hidden"] .bd-sidegrip { display: none; }
@media (max-width: 700px) { #board-app .bd-side { position: absolute; top: 98px; bottom: 0; z-index: 8; } #board-app[data-side="right"] .bd-side { inset-inline-end: auto; right: 0; left: auto; } #board-app[data-side="left"] .bd-side { left: 0; right: auto; } .bd-sidegrip { display: none; } }

/* Reva Welcome: folders */
.wl-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: 0 0 14px; font-size: 14px; }
.wl-crumb { padding: 4px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--wl-accent, var(--accent)); font: inherit; cursor: pointer; }
.wl-crumb:hover, .wl-crumb:focus-visible { background: rgb(var(--accent-rgb) / .12); outline: none; } .wl-crumb.cur { color: var(--wl-text); font-weight: 600; cursor: default; padding: 4px 8px; }
.wl-sep { color: var(--wl-muted); } #welcome[dir="rtl"] .wl-sep { transform: scaleX(-1); display: inline-block; }
.wl-fnote { margin: -4px 0 14px; font-size: 12.5px; }
.wl-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 8px; }
.wl-fcard { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--wl-surface); border: 1px solid var(--wl-line); border-radius: 12px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.wl-fcard:hover, .wl-fcard:focus-visible { border-color: var(--wl-accent, var(--accent)); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); outline: none; }
.wl-fico { color: var(--wl-accent, var(--accent)); flex: none; } .wl-fmeta { display: flex; flex-direction: column; min-width: 0; flex: 1; } .wl-fmeta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wl-fmeta span { font-size: 12px; color: var(--wl-muted); } .wl-fpath { opacity: .85; }
.wl-fact { position: absolute; top: 4px; inset-inline-end: 4px; display: flex; gap: 0; opacity: 0; transition: opacity .15s; background: var(--wl-surface); border: 1px solid var(--wl-line); border-radius: 8px; } .wl-fact .wl-icon { min-width: 30px; height: 30px; } .wl-fcard:hover .wl-fact, .wl-fcard:focus-within .wl-fact { opacity: 1; } @media (hover: none) { .wl-fact { opacity: 1; } }
.wl-frow { user-select: none; -webkit-user-select: none; }
.wl-dropon { outline: 2px dashed var(--wl-accent, var(--accent)); outline-offset: 2px; background: rgb(var(--accent-rgb) / .12) !important; border-radius: 8px; }
.wl-dragging { opacity: .45; } .wl-dragmode, .wl-dragmode * { cursor: grabbing !important; }
.wl-ghost { position: fixed; z-index: 500; pointer-events: none; max-width: 240px; padding: 6px 12px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-pick { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.wl-pickrow { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; padding-inline-start: calc(10px + var(--d, 0) * 18px); border: 1px solid transparent; border-radius: 8px; background: transparent; color: inherit; font: inherit; text-align: start; cursor: pointer; }
.wl-pickrow:hover, .wl-pickrow:focus-visible { background: rgb(var(--accent-rgb) / .12); outline: none; } .wl-pickrow.on { border-color: var(--accent); }

/* Welcome: card options on Recent */
@media (hover: none) { .wl-cardact { opacity: 1; } }
.wl-card .wl-cardact .wl-icon { color: #fff; }

/* Board toolbar: labelled tools, grouped Shapes / Lines with a pop-out menu, panel and toolbar side by side */
.bd-tl { display: none; }
#board-app .bd-tools .bd-ib { position: relative; }
#board-app .bd-grp { display: contents; }
.bd-gc { position: absolute; right: 4px; bottom: 4px; width: 0; height: 0; border-left: 5px solid transparent; border-bottom: 5px solid currentColor; opacity: .5; pointer-events: none; }
#board-app:is([data-dock="start"], [data-dock="end"], [data-dock="float"]) .bd-tools { grid-template-columns: repeat(var(--bd-lines, 1), 60px); grid-auto-rows: 48px; }
#board-app:is([data-dock="start"], [data-dock="end"], [data-dock="float"]) .bd-tools .bd-grip { grid-column: 1 / -1; height: 20px; }
#board-app:is([data-dock="start"], [data-dock="end"], [data-dock="float"]) .bd-tools .bd-ib:not(.bd-grip) { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 2px; }
#board-app:is([data-dock="start"], [data-dock="end"], [data-dock="float"]) .bd-tl { display: block; font-size: 9.5px; line-height: 1.1; font-weight: 600; white-space: nowrap; }
#board-app[data-merge] .bd-body > .bd-work { display: contents; }
.bd-fly { position: fixed; z-index: 300; min-width: 190px; padding: 6px; display: flex; flex-direction: column; gap: 2px; background: var(--bd-panel); color: var(--bd-text); border: 1px solid var(--bd-line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.bd-fly h5 { margin: 2px 8px 4px; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; opacity: .65; }
.bd-fi { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-align: start; }
.bd-fi:hover { background: rgb(var(--accent-rgb) / .14); }
.bd-fi.on { background: rgb(var(--accent-rgb) / .22); color: var(--bd-acc); border-color: rgb(var(--accent-rgb) / .5); }
.bd-fi kbd { margin-inline-start: auto; font: inherit; font-size: 11px; opacity: .6; }

/* Board library: docked in the side panel (tabs, search, two-column templates) */
.bd-lib { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto; }
.bd-lib .bd-ph { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--bd-line); }
.bd-lib .bd-phb { display: inline-flex; align-items: center; gap: 4px; }
.bd-ltabs { display: flex; gap: 0; padding: 4px 6px 0; overflow: hidden; border-bottom: 1px solid var(--bd-line); }
.bd-ltabs button { height: 34px; padding: 0 8px; font-size: 12.5px; flex: 1; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--bd-text); font: inherit; font-weight: 600; cursor: pointer; opacity: .7; }
.bd-ltabs button.on { color: var(--bd-acc); border-bottom-color: var(--bd-acc); opacity: 1; }
.bd-lsearch { display: flex; align-items: center; gap: 8px; padding: 12px 14px 0; }
.bd-lsearch .bd-libq { margin: 0; flex: 1; }
.bd-lib .bd-tabs { padding: 0 14px; }
.bd-lib .bd-stkgrid { padding: 12px 14px; }
.bd-lib .bd-stkgrid.tpls { grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.bd-lib .tpls .bd-tplw { width: auto; align-items: stretch; }
.bd-lib .tpls .bd-tplw .bd-tpl { width: 100%; height: 92px; }
.bd-lib .tpls .bd-tplw small { max-width: none; font-size: 12px; font-weight: 600; opacity: .9; }
.bd-side:has(#bd-stickers:not([hidden])) :is(#bd-layers, #bd-props) { display: none; }

/* Project Tracker: dashboard strip */
.wl-dash { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.wl-kc { --k: var(--wl-accent); --kb: color-mix(in srgb, var(--wl-accent) 14%, transparent); background: var(--wl-surface); border: 1px solid var(--wl-line); border-radius: 12px; padding: 12px 14px; }
.wl-kc.act { --k: #2f6fb5; } .wl-kc.dn { --k: #2a7d4f; } .wl-kc.od { --k: #b4452f; }
.wl-kc.act, .wl-kc.dn, .wl-kc.od { --kb: color-mix(in srgb, var(--k) 12%, transparent); }
.wl-kt { display: flex; align-items: center; gap: 10px; color: var(--wl-muted); font-size: 12px; font-weight: 600; }
.wl-ki { width: 30px; height: 30px; border-radius: 9px; background: var(--kb); color: var(--k); display: inline-grid; place-items: center; }
.wl-kn { margin-top: 8px; font-size: 28px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; } .wl-kc.od .wl-kn { color: var(--k); }
.wl-kb { margin-top: 10px; height: 6px; border-radius: 999px; background: var(--wl-line); overflow: hidden; } .wl-kb i { display: block; height: 100%; border-radius: 999px; background: var(--k); }
@media (max-width: 760px) { .wl-dash { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Pen options bar (matches the design) */
.bd-ptitle { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent-text); font-size: 13px; }
.bd-pctl { position: relative; display: inline-flex; align-items: center; }
.bd-psw { position: relative; width: 22px; height: 22px; padding: 0; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .18); cursor: pointer; }
.bd-psw.on { outline: 2px solid var(--bd-acc); outline-offset: 2px; }
.bd-psw.on::after, .bd-pw.on::after { content: ""; position: absolute; bottom: -9px; left: 50%; margin-left: -3px; width: 6px; height: 6px; border-right: 1.5px solid var(--accent-text); border-bottom: 1.5px solid var(--accent-text); transform: rotate(45deg); }
.bd-pdiv { width: 1px; height: 22px; background: var(--bd-line); }
.bd-pw { position: relative; width: 44px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--bd-line); border-radius: 8px; background: var(--bd-panel); color: var(--bd-text); cursor: pointer; }
.bd-pw i { display: block; width: 26px; border-radius: 3px; background: currentColor; }
.bd-pw.on { border-color: var(--bd-acc); background: rgb(var(--accent-rgb) / .22); color: var(--accent-text); }
.bd-pgrow { flex: 1; }
.bd-pop { position: absolute; top: 36px; inset-inline-start: -8px; z-index: 30; width: 244px; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--bd-panel); border: 1px solid var(--bd-line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.bd-pop h4 { margin: 0; display: flex; justify-content: space-between; font-size: 12px; font-weight: 650; } .bd-pop h4 span + span { font-weight: 500; color: var(--bd-muted); }
.bd-ptabs { display: flex; } .bd-ptabs button { flex: 1; justify-content: center; }
.bd-pgrid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; } .bd-pgrid .bd-sw { width: 100%; height: 24px; border-width: 1px; }
.bd-pgrid .bd-sw.on { outline: 2px solid var(--bd-acc); outline-offset: 2px; }
.bd-pspec { width: 100%; height: 120px; padding: 0; border: 1px solid var(--bd-line); border-radius: 8px; background: none; cursor: pointer; }
.bd-phex { display: flex; gap: 8px; align-items: center; } .bd-phex input { flex: 1; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid var(--bd-line); border-radius: 8px; background: var(--bd-bg); color: var(--bd-text); font: inherit; }

.bd-openlib { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; font-size: 12px; }
/* Smart Mass: Finish / Cancel stack, and the options bar under the ribbon (matches the Modify | Smart Mass design) */
.mass-mode-stack{display:flex;flex-direction:column;gap:4px;align-self:center}
.mass-mode{display:flex;align-items:center;gap:8px;min-height:38px;min-width:96px;padding:0 12px;border-radius:8px;border:1px solid transparent;background:transparent;color:inherit;font-weight:650}
.mass-mode.finish{background:var(--accent-soft,#cfddec);color:var(--accent-text,#3d5f86);border-color:var(--accent-line,#aac2de)}
.mass-mode.cancel{color:#c0392b}
.options-bar .mass-opt-title{display:flex;align-items:center;gap:8px;font-weight:700}
.options-bar .mass-field{flex-direction:row;align-items:center;gap:6px;min-width:0}
.options-bar .mass-type{flex-direction:row}
.options-bar .mass-del{color:#c0392b;display:flex;align-items:center;gap:6px}
.options-bar .mass-opt-hint{margin-inline-start:auto;font-size:12px;opacity:.7}
.options-bar .mass-type button.active{background:#E87932;color:#fff;border-color:#E87932}

/* ===== Properties palette: group bands and a label column (Claude Design ▸ Menus ▸ Properties · Wall). Theme tokens only. ===== */
#properties-content .property-section { border-top: 0; padding-bottom: 0; }
#properties-content .property-section-title { min-height: 40px; gap: 10px; padding: 0 16px; background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#properties-content .property-section-title > span:last-child { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); font-size: 13px; line-height: 1; }
#properties-content .property-section.folded .property-section-title { border-bottom-color: transparent; }
#properties-content .property-section.property-frequent .property-section-title { background: var(--accent-soft); color: var(--accent-text); }
#properties-content .property-section.property-frequent .property-section-title::before { content: "★"; font-size: 12px; letter-spacing: 0; color: var(--accent-text); }
#properties-content .property-row { grid-template-columns: 128px minmax(0, 1fr); gap: 0; padding: 0; min-height: 40px; }
#properties-content .property-row > label { align-self: stretch; display: flex; align-items: center; padding: 0 12px 0 16px; background: var(--panel); border-inline-end: 1px solid var(--prop-hair); }
#properties-content .property-row > :not(label) { margin: 4px 12px; min-width: 0; }
#properties-content .property-row input[type=checkbox] { margin-inline-start: 12px; }
#properties-content .property-row .property-value { padding-inline: 10px; }
#properties-content .property-row input[readonly] { padding-inline: 10px; }
#properties-content .property-note { padding: 8px 16px 10px; }
#properties-content .property-row .property-value { display: flex; align-items: center; min-height: 32px; background: var(--soft); border: 1px solid var(--prop-hair); border-radius: 7px; }
#properties-content .property-row > :not(label):not([type=checkbox]) { width: calc(100% - 24px); box-sizing: border-box; }

/* ===== Panel title bars, side swap, compact property rows and Project Browser bands (Claude Design ▸ Menus) ===== */
.panel-title { gap: 2px; padding: 0 8px 0 16px; height: 40px; min-height: 40px; background: var(--panel); border-bottom: 1px solid var(--line); }
.panel-title h2 { margin-inline-end: auto; font-size: 12px; font-weight: 650; color: var(--ink); }
.panel-title button { width: 30px; height: 30px; padding: 0; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.panel-title button:hover { background: var(--accent-soft); color: var(--accent-text); }
.panel-title svg { width: 16px; height: 16px; }
/* Swap sides: a right-to-left grid puts column 1 (Project Browser) on the right and column 3 (Properties) on the left; every child keeps its own direction */
html .workspace.ws-swap { direction: rtl; }
html .workspace.ws-swap > .center-panel { direction: ltr; }
html:not([data-ui-lang="ar"]) .workspace.ws-swap > .browser-panel, html:not([data-ui-lang="ar"]) .workspace.ws-swap > .properties-panel { direction: ltr; }
.workspace.ws-swap > .browser-panel { border-right: 0; border-left: 1px solid var(--line); }
.workspace.ws-swap > .properties-panel { border-left: 0; border-right: 1px solid var(--line); }
.ws-overlay .workspace.ws-swap > .browser-panel { left: auto; right: 0; }
.ws-overlay .workspace.ws-swap > .properties-panel { right: auto; left: 0; }
.workspace.ws-swap > .edge-left { border-right: 0; border-left: 1px solid #e2e2e2; }
.workspace.ws-swap > .edge-right { border-left: 0; border-right: 1px solid #e2e2e2; }
.ws-overlay .workspace.ws-swap > .edge-left { left: auto; right: 0; border-radius: 8px 0 0 8px; }
.ws-overlay .workspace.ws-swap > .edge-right { right: auto; left: 0; border-radius: 0 8px 8px 0; }
/* Compact property rows (touch keeps its larger targets) */
#properties-content .property-row { grid-template-columns: 116px minmax(0, 1fr); min-height: 32px; }
#properties-content .property-row > :not(label):not([type=checkbox]) { margin: 3px 12px; width: calc(100% - 24px); }
#properties-content .property-row input:not([type=checkbox]), #properties-content .property-row select { height: 26px; font-size: 12.5px; padding: 0 9px; }
#properties-content .property-row .property-value { min-height: 26px; font-size: 12.5px; }
#properties-content .property-section-title { min-height: 32px; }
#properties-content .property-section-title > span:last-child { width: 20px; height: 20px; }
#properties-content .property-row input[type=checkbox] { width: 34px; height: 20px; margin-block: 0; }
#properties-content .property-row input[type=checkbox]::after { width: 14px; height: 14px; }
#properties-content .property-row input[type=checkbox]:checked::after { inset-inline-start: 17px; }
@media (pointer: coarse) {
  #properties-content .property-row { min-height: 40px; }
  #properties-content .property-row input:not([type=checkbox]), #properties-content .property-row select { height: 32px; }
  #properties-content .property-section-title { min-height: 40px; }
}
/* Project Browser: a band per group, 32 px rows */
.browser-project { margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.browser-search { margin: 10px 16px; }
.browser-tree { padding: 0; border-top: 1px solid var(--line); }
.browser-tree details { margin: 0; }
.browser-tree summary { height: 32px; padding: 0 12px 0 16px; gap: 10px; background: var(--soft); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.browser-tree details + details > summary { border-top: 1px solid var(--line); }
.browser-tree summary::before { content: '›'; display: grid; place-items: center; width: 20px; height: 20px; flex: none; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--muted); font-size: 13px; line-height: 1; letter-spacing: 0; }
.browser-tree summary { color: var(--ink); }
.browser-tree summary svg { color: var(--muted); }
.browser-tree summary .count { margin-inline-start: auto; min-width: 24px; padding: 0 8px; text-align: center; font-size: 11px; letter-spacing: 0; color: var(--muted); background: var(--white); border: 1px solid var(--line); border-radius: 999px; }
.browser-tree summary .browser-add { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); letter-spacing: 0; font-size: 14px; line-height: 1; }
.browser-tree .browser-row { min-height: 32px; padding: 0 16px 0 20px; border-radius: 0; border-bottom: 1px solid var(--prop-hair, var(--line)); align-items: center; font-size: 12.5px; color: var(--text); }
.browser-tree .browser-row svg { color: var(--muted); width: 15px; height: 15px; }
.browser-tree .browser-row.active, .browser-tree .browser-row.open { background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.browser-tree .browser-row.active svg, .browser-tree .browser-row.open svg { color: var(--accent-text); }
.browser-tree .browser-row.active:before { display: none; }
.browser-state { margin-inline-start: auto; font-style: normal; font-size: 10.5px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); border-radius: 999px; padding: 1px 8px; }
@media (pointer: coarse) { .browser-tree .browser-row { min-height: 40px; } .browser-tree summary { height: 40px; } }
.panel-title h2 { white-space: nowrap; }
.browser-tree summary { white-space: nowrap; letter-spacing: .04em; gap: 8px; }

/* ===== Tighter vertical rhythm (second pass): 28 px rows, 28 px bands, slimmer hero and type selector ===== */
.panel-title { height: 36px; min-height: 36px; }
.panel-title button { width: 28px; height: 28px; }
#properties-content .property-hero { margin: 8px 14px 8px; gap: 10px; }
#properties-content .property-hero-icon { width: 36px; height: 36px; border-radius: 10px; }
#properties-content .property-hero h3 { font-size: 14px; margin: 0; }
#properties-content .property-hero p { font-size: 11px; line-height: 1.25; }
#properties-content .property-type { margin: 0 14px 8px; gap: 6px; flex-wrap: nowrap; }
#properties-content .property-type select { flex: 1 1 auto; width: auto; height: 28px; font-size: 12px; }
#properties-content .property-type button { flex: none; height: 28px; padding: 0 10px; font-size: 11.5px; }
#properties-content .property-section-title { min-height: 28px; padding-block: 0; }
#properties-content .property-section-title > span:last-child { width: 18px; height: 18px; font-size: 12px; }
#properties-content .property-row { min-height: 28px; grid-template-columns: 112px minmax(0, 1fr); }
#properties-content .property-row > label { font-size: 11.5px; padding-block: 2px; }
#properties-content .property-row > :not(label):not([type=checkbox]) { margin: 2px 12px; }
#properties-content .property-row input:not([type=checkbox]), #properties-content .property-row select { height: 22px; font-size: 12px; padding: 0 8px; border-radius: 6px; }
#properties-content .property-row .property-value { min-height: 22px; font-size: 12px; border-radius: 6px; }
#properties-content .property-row input[type=checkbox] { width: 30px; height: 18px; }
#properties-content .property-row input[type=checkbox]::after { top: 2px; width: 14px; height: 14px; }
#properties-content .property-row input[type=checkbox]:checked::after { inset-inline-start: 14px; }
#properties-content .property-actions.dock { padding: 6px 10px; }
#properties-content .property-actions.dock button { height: 42px; gap: 2px; }
.browser-project { padding: 6px 16px; }
.browser-search { margin: 6px 16px; }
.browser-tree summary { height: 28px; }
.browser-tree summary::before { width: 18px; height: 18px; }
.browser-tree .browser-row { min-height: 28px; font-size: 12px; }
@media (pointer: coarse) {
  .panel-title { height: 44px; }
  #properties-content .property-row { min-height: 40px; }
  #properties-content .property-row input:not([type=checkbox]), #properties-content .property-row select { height: 32px; }
  #properties-content .property-section-title { min-height: 40px; }
  #properties-content .property-type select, #properties-content .property-type button { height: 36px; }
  .browser-tree .browser-row { min-height: 40px; } .browser-tree summary { height: 40px; }
}
#properties-content .property-row { grid-template-columns: 124px minmax(0, 1fr); }
#properties-content .property-row > label { white-space: nowrap; }
.browser-tree summary .browser-add { flex: none; }
.browser-tree summary .count { flex: none; }

/* Names column: one line with an ellipsis, width set by dragging the divider (--prop-label-w) */
#properties-content .property-row { grid-template-columns: var(--prop-label-w, 124px) minmax(0, 1fr); }
#properties-content .property-row > label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 28px; min-width: 0; }
#properties-content .property-row .property-value { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 22px; padding-block: 0; }
#properties-content .property-row select, #properties-content .property-row input:not([type=checkbox]) { text-overflow: ellipsis; }
#properties-content.prop-resizable, #properties-content.prop-resizable * { cursor: col-resize !important; }
#properties-content.prop-resizing { user-select: none; }
.prop-resize-hint { position: fixed; z-index: 500; width: 2px; pointer-events: none; }
.prop-resize-hint i { position: absolute; inset: 0; background: var(--accent); opacity: .55; }
.prop-resize-hint b { position: absolute; left: -2px; width: 6px; height: 22px; border-radius: 3px; background: var(--accent); }
.prop-resize-hint[hidden] { display: none; }

/* Board: bottom pen bar (pens · colours · sizes) */
.bd-penbar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: calc(100% - 24px); }
.bd-penbar[hidden] { display: none; }
.bd-pbar { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px; background: var(--bd-panel); border: 1px solid var(--bd-line); border-radius: 16px; box-shadow: 0 6px 22px rgba(0, 0, 0, .18); overflow-x: auto; }
.bd-pk { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; padding: 4px 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.bd-pk small { font-size: 10px; opacity: .8; }
.bd-pk.on { border-color: var(--bd-acc); background: rgb(var(--accent-rgb) / .18); transform: translateY(-4px); }
.bd-penpop { position: static; width: 240px; display: flex; flex-direction: column; gap: 8px; }
.bd-penpop input[type=range] { width: 100%; }
.bd-bsw { position: relative; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .18); cursor: pointer; }
.bd-bsw.on { outline: 2px solid var(--bd-acc); outline-offset: 2px; }
.bd-bpw { width: 40px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--bd-line); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.bd-bpw i { display: block; width: 24px; border-radius: 3px; background: currentColor; }
.bd-bpw.on { border-color: var(--bd-acc); background: rgb(var(--accent-rgb) / .22); color: var(--accent-text); }

/* Print dialog (compact): options band under both panes */
.pdf-combine { align-self: end; display: flex !important; flex-direction: row !important; align-items: center; gap: 8px; min-height: 30px; }
.pdf-options { border-top: 1px solid var(--line); }
.pdf-options .pdf-band { margin: 0; border-top: 0; }
.pdf-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 18px; padding: 10px 18px 12px; }
.pdf-opts label { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.pdf-left .dialog-form { gap: 8px 10px; }
.pdf-left .dialog-form label { gap: 3px; }
.pdf-selection .pdf-set-controls { margin-top: 6px; }

/* ===== Reva Board: transforming tool rail, slim top bar, canvas bar ================================================================= */
#board-app .bd-rail { position: absolute; z-index: 50; top: 12px; inset-inline-start: 12px; width: 68px; max-height: calc(100% - 24px); overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; background: var(--bd-panel); border: 1px solid var(--bd-line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .16); }
#board-app .bd-rail::-webkit-scrollbar { display: none; }
.bd-rb { width: 52px; height: 48px; flex: none; border: 0; border-radius: 14px; background: transparent; color: var(--bd-text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.bd-rb:hover { background: rgb(var(--accent-rgb) / .1); } .bd-rb.on { background: rgb(var(--accent-rgb) / .2); color: var(--bd-acc); }
.bd-rb:focus-visible, .bd-pn:focus-visible, .bd-ct:focus-visible, .bd-cd:focus-visible, .bd-ln:focus-visible, .bd-tx:focus-visible { outline: 2px solid var(--bd-acc); outline-offset: 1px; }
.bd-sp { width: 46px; flex: none; border: 0; border-top: 1px solid var(--bd-line); margin: 6px 0; }
.bd-cd { width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0; margin: 3px 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); position: relative; }
.bd-cd.on { box-shadow: 0 0 0 2px var(--bd-panel), 0 0 0 4px var(--bd-acc); }
.bd-cd.bd-cust { background: conic-gradient(#e0455a, #f2c94c, #188038, #1a73e8, #7b3fe4, #e0455a); overflow: hidden; } .bd-cd.bd-cust input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.bd-ln { width: 46px; height: 28px; flex: none; border: 0; border-radius: 10px; background: color-mix(in srgb, var(--bd-text) 7%, transparent); display: grid; place-items: center; cursor: pointer; padding: 0; margin: 1px 0; }
.bd-ln i { display: block; width: 26px; background: var(--bd-text); border-radius: 4px; } .bd-ln.on { background: rgb(var(--accent-rgb) / .2); box-shadow: 0 0 0 2px var(--bd-acc); } .bd-ln.on i { background: var(--bd-acc); }
.bd-tx { width: 38px; height: 38px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--bd-text); font: 700 15px/1 inherit; cursor: pointer; } .bd-tx.on { background: rgb(var(--accent-rgb) / .2); color: var(--bd-acc); }
.bd-pn { width: 62px; height: 38px; flex: none; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--bd-text) 7%, transparent); display: grid; place-items: center; cursor: pointer; padding: 0; margin: 1px 0; } .bd-pn.on { background: rgb(var(--accent-rgb) / .2); box-shadow: 0 0 0 2px var(--bd-acc); }
.bd-ct { width: 60px; height: 42px; flex: none; border: 0; border-radius: 10px; background: transparent; display: grid; place-items: center; cursor: pointer; padding: 3px 6px; } .bd-ct:hover { background: rgb(var(--accent-rgb) / .1); } .bd-ct svg { width: 100%; height: 100%; }
.bd-gl { display: grid; place-items: center; width: 26px; height: 26px; } .bd-gl svg { width: 100%; height: 100%; }
.bd-step { display: flex; flex-direction: column; align-items: center; gap: 2px; } .bd-step button { width: 38px; height: 30px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--bd-text) 7%, transparent); color: var(--bd-text); font-size: 18px; cursor: pointer; } .bd-step b { font-size: 16px; } .bd-step small { font-size: 10px; color: var(--bd-muted); }
.bd-railpop { position: absolute; z-index: 56; top: 12px; inset-inline-start: 88px; } .bd-railpop .bd-pop { position: static; }
.bd-iconpanel { position: absolute; z-index: 56; top: 12px; inset-inline-start: 88px; width: 300px; max-height: calc(100% - 24px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--bd-panel); border: 1px solid var(--bd-line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .16); }
.bd-iconpanel[hidden], .bd-railpop[hidden] { display: none; } .bd-ih { padding: 9px 12px; border-radius: 8px; background: var(--bd-acc); color: #fff; font-weight: 700; text-align: center; }
.bd-iconpanel .bd-lsearch { padding: 0; } .bd-iconpanel .bd-stkgrid { padding: 0; }
/* top bar */
.bd-dv { width: 1px; height: 20px; background: var(--bd-line); margin: 0 4px; flex: none; }
.bd-dd { position: relative; display: inline-flex; }
.bd-menu[hidden] { display: none; }
.bd-ddm { top: calc(100% + 6px); inset-inline-start: 0; width: 230px; }
.bd-ddm.end { inset-inline-start: auto; inset-inline-end: 0; }
.bd-menu hr { width: 100%; border: 0; border-top: 1px solid var(--bd-line); margin: 3px 0; }
.bd-menu button.bd-mi { flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px; width: 100%; }
.bd-mi span { flex: 1; } .bd-mi kbd { font: 11px inherit; color: var(--bd-muted); } .bd-mi .bd-lg { width: 17px; text-align: center; }
.bd-mi .bd-ck { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--bd-line); flex: none; } .bd-mi.on .bd-ck { background: var(--bd-acc); border-color: var(--bd-acc); box-shadow: inset 0 0 0 2px var(--bd-panel); }
.bd-mi:disabled { opacity: .4; cursor: default; } .bd-mi.bd-danger { color: #c62828; }
/* canvas bar */
.bd-cvb { position: absolute; z-index: 45; bottom: 12px; inset-inline-start: 12px; display: flex; align-items: center; gap: 2px; padding: 4px 6px; background: color-mix(in srgb, var(--bd-panel) 82%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--bd-line); border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
.bd-cvb .bd-ib { width: 30px; height: 30px; } .bd-cvb .bd-ib.on { background: rgb(var(--accent-rgb) / .2); color: var(--bd-acc); } .bd-cvb .bd-zl { min-width: 46px; font-weight: 650; }
#board-app.present .bd-cvb, #board-app.present .bd-rail, #board-app.present .bd-iconpanel, #board-app.present .bd-railpop { display: none; }
.bd-mini { inset-inline-end: 10px; }
/* page strip: only in Slides mode, and smaller */
#board-app .bd-pages { display: none; }
#board-app.mode-slides .bd-pages { display: flex; padding: 4px 10px; gap: 8px; }
#board-app.mode-slides .bd-page .bd-thumb svg { width: 84px; height: auto; } #board-app.mode-slides .bd-page small { max-width: 84px; font-size: 10px; }
#board-app.mode-slides .bd-addpage { padding: 4px 8px; font-size: 11px; }

/* resizable page strip */
.bd-pages { position: relative; } .bd-pgrip { position: absolute; inset-inline: 0; top: -4px; height: 9px; cursor: ns-resize; z-index: 3; touch-action: none; } .bd-pgrip::after { content: ""; position: absolute; left: 50%; top: 3px; width: 44px; height: 3px; margin-left: -22px; border-radius: 3px; background: var(--bd-line); } .bd-pgrip:hover::after { background: var(--bd-acc); }
#board-app.mode-slides .bd-page .bd-thumb svg { width: var(--pgw, 84px); } #board-app.mode-slides .bd-page small { max-width: var(--pgw, 84px); }
#board-app.mode-slides .bd-pgmini .bd-page small, #board-app.mode-slides .bd-pgmini .bd-pageact select, #board-app.mode-slides .bd-pgmini .bd-addpage span { display: none; }

/* side panel tabs (Layers / Projects / Boards) */
#board-app .bd-stabs { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 6px 0 8px; border-bottom: 1px solid var(--bd-line); flex: none; }
#board-app .bd-st { height: 44px; padding: 0 10px; display: flex; align-items: center; gap: 6px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--bd-muted); font: inherit; font-weight: 650; font-size: 13px; cursor: pointer; }
#board-app .bd-st span { display: none; } #board-app .bd-st.on span { display: inline; } #board-app .bd-st.on { color: var(--bd-acc); border-bottom-color: var(--bd-acc); } #board-app .bd-sp1 { flex: 1; }
#board-app #bd-side { display: flex; flex-direction: column; min-height: 0; } #board-app #bd-layers, #board-app #bd-projects, #board-app #bd-boards { flex: 1; min-height: 0; overflow: auto; } #board-app #bd-projects, #board-app #bd-boards { display: flex; flex-direction: column; } #board-app #bd-projects[hidden], #board-app #bd-boards[hidden], #board-app #bd-layers[hidden] { display: none; }
.bd-pad { padding: 14px; } .bd-pjsearch { padding: 10px 12px 6px; } .bd-pjsearch input { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--bd-line); border-radius: 8px; background: var(--bd-bg); color: var(--bd-text); font: inherit; font-size: 12.5px; }
.bd-pjhead { display: flex; align-items: center; gap: 8px; padding: 10px 12px 0; } .bd-pjhead > div { flex: 1; display: flex; flex-direction: column; } .bd-pjhead small { color: var(--bd-muted); font-size: 11px; }
.bd-pjlist { flex: 1; overflow: auto; padding: 4px 8px; } .bd-pjfoot { padding: 10px 12px; border-top: 1px solid var(--bd-line); display: flex; gap: 8px; }
.bd-pgh, .bd-bfh { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 4px; border-radius: 8px; cursor: pointer; font-size: 12.5px; } .bd-pgh b, .bd-bfh b { flex: 1; font-weight: 650; } .bd-pgh em, .bd-bfh em { font-style: normal; font-size: 11px; color: var(--bd-muted); }
.bd-pgh svg:first-child, .bd-bfh svg:first-child { transform: rotate(90deg); transition: transform .12s; } .bd-pg.shut .bd-pgh svg:first-child, .bd-bfh:not(.o) svg:first-child { transform: none; } .bd-pg.shut .bd-pi { display: none; }
.bd-pi { display: flex; align-items: center; gap: 6px; padding: 2px 4px 2px 26px; border-radius: 8px; font-size: 12.5px; } .bd-pi:hover { background: rgb(var(--accent-rgb) / .08); } .bd-pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-bin { margin-inline-start: 14px; padding-inline-start: 8px; border-inline-start: 1px solid var(--bd-line); } .bd-cap { margin: 10px 6px 4px; font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--bd-muted); font-weight: 700; }
.bd-bi { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; } .bd-bi:hover { background: rgb(var(--accent-rgb) / .08); } .bd-bi.cur { background: rgb(var(--accent-rgb) / .12); border-color: rgb(var(--accent-rgb) / .35); }
.bd-bth { width: 44px; height: 32px; flex: none; display: grid; place-items: center; border: 1px solid var(--bd-line); border-radius: 6px; background: #fff; color: #888; overflow: hidden; } .bd-bth img { width: 100%; height: 100%; object-fit: cover; }
.bd-bx { flex: 1; min-width: 0; display: flex; flex-direction: column; } .bd-bx b { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bd-bx small { font-size: 11.5px; color: var(--bd-muted); }
.bd-now { font-size: 10.5px; font-weight: 700; color: var(--bd-acc); background: rgb(var(--accent-rgb) / .15); border-radius: 999px; padding: 2px 8px; }
/* properties: floating panel over the canvas, only while something is selected */
.bd-fprops { position: absolute; z-index: 50; top: 12px; inset-inline-end: 12px; width: 250px; max-height: calc(100% - 90px); overflow: auto; padding: 8px 10px 10px; background: var(--bd-panel); border: 1px solid var(--bd-line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0,0,0,.24); }
.bd-fprops[hidden] { display: none; } #board-app.present .bd-fprops { display: none; }
.bd-topwrap { position: relative; z-index: 120; }
.bd-pjsw { padding: 10px 12px 4px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--bd-line); } .bd-pjrows { display: flex; flex-direction: column; gap: 2px; }
.bd-pjrow { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--bd-text); font: inherit; font-size: 12.5px; cursor: pointer; text-align: start; } .bd-pjrow b { flex: 1; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bd-pjrow:hover { background: rgb(var(--accent-rgb) / .08); } .bd-pjrow.on { background: rgb(var(--accent-rgb) / .12); border-color: rgb(var(--accent-rgb) / .35); }
.bd-pjsearch { display: flex; gap: 6px; align-items: center; }
.bd-qname { font-size: 12px; font-weight: 650; padding: 0 6px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* collapsed side panel stays as a slim strip with the toggle and the tab icons */
#board-app .bd-side.collapsed { width: 52px !important; min-width: 52px; max-width: 52px; overflow: hidden; }
#board-app .bd-side.collapsed .bd-stabs { flex-direction: column; height: auto; padding: 8px 0; gap: 4px; border-bottom: 0; }
#board-app .bd-side.collapsed .bd-st { width: 40px; height: 40px; padding: 0; justify-content: center; border-bottom: 0; border-radius: 10px; } #board-app .bd-side.collapsed .bd-st span { display: none; } #board-app .bd-side.collapsed .bd-st.on { background: rgb(var(--accent-rgb) / .14); }
#board-app .bd-side.collapsed .bd-sp1, #board-app .bd-side.collapsed #bd-sidemove, #board-app .bd-side.collapsed #bd-layers, #board-app .bd-side.collapsed #bd-projects, #board-app .bd-side.collapsed #bd-boards { display: none; }
#board-app .bd-side.collapsed #bd-sideclose { order: -1; margin-bottom: 4px; transform: rotate(180deg); }
[dir="rtl"] #board-app .bd-side.collapsed #bd-sideclose, #board-app[dir="rtl"] .bd-side.collapsed #bd-sideclose { transform: none; }

/* slimmer top bar */
#board-app .bd-top { padding: 3px 8px; gap: 4px; min-height: 0; } #board-app .bd-top .bd-ib { width: 30px; height: 30px; } #board-app .bd-top .wl-btn.sm { height: 28px; padding: 0 9px; font-size: 12px; } #board-app .bd-top #bd-name { height: 28px; font-size: 13px; }
#board-app .bd-top .bd-seg button { height: 26px; padding: 0 9px; font-size: 12px; } #board-app .bd-top .bd-lg { font-size: 13px; font-weight: 700; }
.bd-pjline { display: flex; align-items: center; gap: 2px; } .bd-pjline .bd-pjrow { flex: 1; min-width: 0; } .bd-unl { color: var(--bd-muted); } .bd-unl:hover { color: #c4382f; }

.browser-boardrow { display: flex; align-items: center; gap: 2px; } .browser-boardrow .browser-row { flex: 1; min-width: 0; }
.browser-unlink { flex: none; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--muted, #888); cursor: pointer; opacity: 0; } .browser-boardrow:hover .browser-unlink, .browser-unlink:focus-visible { opacity: 1; } .browser-unlink:hover { background: rgba(200, 60, 50, .14); color: #c4382f; }
@media (pointer: coarse) { .browser-unlink { opacity: 1; width: 32px; height: 32px; } }

/* the tool rail and its panels travel with the side panel */
#board-app[data-side="right"] .bd-rail { inset-inline-start: auto; left: auto; right: 12px; }
#board-app[data-side="right"] .bd-railpop, #board-app[data-side="right"] .bd-iconpanel { inset-inline-start: auto; left: auto; right: 88px; }
#board-app[data-side="left"] .bd-rail { right: auto; left: 12px; } #board-app[data-side="left"] .bd-railpop, #board-app[data-side="left"] .bd-iconpanel { right: auto; left: 88px; }
.bd-snappanel { width: 320px; } .bd-snaphead { display: flex; align-items: center; justify-content: space-between; padding: 0 2px; } .bd-snapbody { display: flex; flex-direction: column; min-height: 0; overflow: auto; }

/* Welcome: notifications bell next to the account avatar */
.wl-bellwrap { position: relative; display: inline-flex; }
.wl-bell svg { width: 20px; height: 20px; }
.wl-badge { position: absolute; top: 2px; inset-inline-end: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #e5484d; color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.wl-notif { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60; width: min(360px, 92vw); max-height: 70vh; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--wl-surface); color: var(--wl-text); border: 1px solid var(--wl-line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .22); }
.wl-notif h4 { margin: 0; font-size: 14px; }
.wl-notif-list { overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.wl-notif article { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--wl-line); }
.wl-notif article.new { border-color: rgb(var(--accent-rgb) / .6); background: rgb(var(--accent-rgb) / .08); }
.wl-notif small { color: var(--wl-muted, #888); } .wl-notif strong { display: block; font-size: 13px; } .wl-notif p { margin: 2px 0 0; font-size: 12px; opacity: .85; }

/* North indicator (plan views): Project North fixed up, True North draggable */
.north-widget { position: absolute; right: 12px; top: 58px; height: 96px; width: 96px; z-index: 3; user-select: none; touch-action: none; display: flex; flex-direction: column; align-items: center; }
.north-widget[hidden] { display: none; }
.north-widget svg { display: block; overflow: visible; }
.north-widget .ring { fill: color-mix(in srgb, var(--panel, #fff) 82%, transparent); stroke: var(--line, #d6d6d6); stroke-width: 1; }
.north-widget .hub { fill: var(--ink, #263941); }
.north-widget .pn { stroke: var(--ink, #263941); fill: var(--ink, #263941); }
.north-widget .pn-label { fill: var(--ink, #263941); }
.north-widget .tn { stroke: #d9552b; fill: #d9552b; }
.north-widget .tn-label { fill: #d9552b; }
.north-widget .tn-handle { fill: #d9552b; stroke: #fff; stroke-width: 1.6; cursor: grab; }
.north-widget .tn-handle.on { stroke-width: 2.2; }
.north-angle { white-space: nowrap; position: absolute; top: 34px; right: 100px; display: flex; align-items: center; gap: 2px; margin-top: 2px; padding: 2px 6px; border: 1px solid #d9552b; border-radius: 8px; background: var(--panel, #fff); font-size: 12px; color: var(--ink, #263941); }
.north-angle[hidden] { display: none; }
.north-angle input { width: 52px; border: 0 !important; box-shadow: none !important; background: transparent !important; color: inherit; font: inherit; text-align: right; outline: none; padding: 2px 0; min-height: 0; }

/* Image reference: the "Keep proportions" toggle is drawn as a chain link (linked = orange, unlinked = grey and slashed) */
#properties-content .property-row input[data-prop="lockRatio"] { background-size: 16px 16px !important; background-repeat: no-repeat !important; background-position: center !important; appearance: none; -webkit-appearance: none; width: 28px; height: 22px; margin: 0; border: 1px solid var(--line, #cfd8dc); justify-self: start; border-radius: 6px; background: var(--panel, #fff) center / 16px 16px no-repeat; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23889aa0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3Cpath d='M4 4l16 16' stroke='%23889aa0'/%3E%3C/svg%3E"); }
#properties-content .property-row input[data-prop="lockRatio"]:checked { border-color: #d9552b; background-color: #fdeee8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9552b' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E"); }
#properties-content .property-row input[data-prop="lockRatio"]::after { content: none; }
#properties-content .property-row input[data-prop="lockRatio"]:checked { background-color: #fdeee8; }
.image-handle { pointer-events: all; }
body.file-drag::after { content: attr(data-drop-hint); position: fixed; inset: 8px; z-index: 9999; display: flex; align-items: center; justify-content: center; border: 3px dashed #d9552b; border-radius: 14px; background: rgba(255,255,255,.82); color: #d9552b; font-size: 20px; font-weight: 600; pointer-events: none; }

/* Edit Type dialog (Door, Window, Opening, Column, Component, Stair, Parking) */
#modal:has(.td) { width: min(860px, 96vw); }
#modal:has(.td) #modal-body { padding: 0; }
.td { display: flex; flex-direction: column; font-size: 12.5px; color: var(--text); }
.td-head { display: flex; align-items: flex-end; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.td-f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.td-f > span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.td-f.td-type { flex: 1; max-width: 360px; }
.td-in { height: 32px; display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--muted); }
.td-f select, .td-row input:not([type=color]), .td-row select { height: 28px; font-size: 12px; }
.td-f select { height: 32px; }
.td-actions { margin-inline-start: auto; display: flex; gap: 8px; }
.td-actions .dup-type-btn { height: 32px; padding: 0 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; cursor: pointer; }
.td-main { display: flex; min-height: 0; }
.td-ps { flex: 1; min-width: 0; }
.td-band { height: 28px; display: flex; align-items: center; padding: 0 14px; background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink); }
.td-band:first-child { border-top: 0; }
.td-row { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.td-row label { width: 120px; flex: none; font-size: 12px; color: var(--text); }
.td-row input, .td-row select { flex: 1; max-width: 190px; min-width: 0; }
.td-row input[type=color] { flex: none; width: 46px; padding: 2px; height: 26px; }
.td-pv { width: 300px; flex: none; border-inline-start: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; }
.td-pvt { height: 36px; display: flex; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--white); font-weight: 650; color: var(--ink); }
.td-stage { flex: 1; display: flex; align-items: center; justify-content: center; margin: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); overflow: hidden; min-height: 200px; }
.td-use { margin: 0 12px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.td-use b { color: var(--ink); }
.td-delete { padding: 8px 14px; }
#modal:has(.td) .dialog-footer { margin: 0; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel); }

/* View Styles: the picture and name of a style card apply it */
.vs-card .vs-thumb, .vs-card .vs-name { cursor: pointer; }
.vs-card:not(.current):hover { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #4a7) 55%, transparent); }

/* View Styles: a chosen card shows a check mark; Apply sits under the list */
.vs-thumb { position: relative; }
.vs-check { position: absolute; left: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent, #2f8f6b); color: #fff; font-size: 14px; font-weight: 700; line-height: 22px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.35); display: none; z-index: 1; }
.vs-card.selected .vs-check { display: block; }
.vs-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.vs-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(128,128,128,.25); }
.vs-footer .vs-picked { font-size: 13px; opacity: .85; }
.vs-footer button { min-height: 36px; padding: 6px 22px; }
.vs-footer button[disabled] { opacity: .45; cursor: not-allowed; }
.vs-footer button[data-vs-act="apply-selected"]:not([disabled]) { background: var(--accent, #2f8f6b); color: #fff; border-color: var(--accent, #2f8f6b); font-weight: 600; }

/* Tool Cursor Indicator: the active tool's icon beside the pointer; never takes a click */
#tool-cursor{position:absolute;left:0;top:0;z-index:25;pointer-events:none;display:flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:5px;background:rgba(255,255,255,.94);border:1px solid #9fb6bf;color:#1e343c;box-shadow:0 1px 3px #0002}
#tool-cursor[hidden]{display:none}
#tool-cursor b{position:absolute;right:-5px;top:-7px;font:700 12px/1 system-ui,sans-serif;color:#1a9fc1}
.canvas-dark #tool-cursor{background:rgba(36,43,48,.94);border-color:#4f6670;color:#e8f0f2}
/* Legend dialog: mode, categories, columns and (manual mode) the type list */
.legend-dialog fieldset { grid-column: 1/-1; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px 8px; margin: 0; min-width: 0; }
.legend-dialog fieldset > legend { font-weight: 600; padding: 0 4px; font-size: 12px; }
.legend-dialog .legend-cats, .legend-dialog .legend-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 10px; }
.legend-dialog .legend-mode label, .legend-dialog label.legend-check { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 12px; color: inherit; margin: 2px 0; }
.legend-dialog .legend-mode input, .legend-dialog .legend-check input { height: auto; width: auto; margin: 0; flex: none; }
.legend-dialog .legend-mode small { color: var(--muted); }
.legend-dialog .legend-types { max-height: 240px; overflow: auto; }
.legend-pick-group h4 { margin: 8px 0 2px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.legend-pick-group b { min-width: 42px; display: inline-block; }
.legend-update { color: var(--accent); font-weight: 700; }
.legend-dialog .legend-layout { display: flex; gap: 18px; }
.legend-dialog .legend-layout label { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 12px; color: inherit; }
.legend-dialog .legend-layout input { height: auto; width: auto; margin: 0; }
#dialog-form .dialog-footer .legend-cat-all:first-child { margin-inline-start: 0; margin-inline-end: 0; }
#dialog-form .dialog-footer .legend-cat-all + .legend-cat-all { margin-inline-end: auto; }
/* Legend symbols keep their lines readable on the dark sheet */
html.dark-theme .sheet-view svg .legend-body [stroke="#3c5350"] { stroke: #cfd6d2 !important; }
