:root {
  --bg: #0b0e13;
  --bg-elev: #11161f;
  --bg-elev2: #171e29;
  --bg-elev3: #202939;
  --panel: #10151e;
  --border: #273143;
  --border-soft: #1c2431;
  --text: #e9edf5;
  --muted: #8b95a9;
  --muted-2: #667187;
  --accent: #ff7a1a;
  --accent-2: #ffb020;
  --accent-soft: rgba(255, 122, 26, 0.13);
  --teal: #21d4c4;
  --danger: #ff4d5e;
  --warning: #ffb020;
  --grad: linear-gradient(135deg, #ff7a1a, #ffb020);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.4);
  --topbar-h: 64px;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h2 {
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 0.92rem;
}

.muted {
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-thumb {
  background: #2b3548;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

:focus-visible {
  outline: 2px solid rgba(255, 138, 51, 0.7);
  outline-offset: 2px;
}

/* ---------- Buttons and common controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elev2);
  color: var(--text);
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 650;
  transition: 0.16s ease;
  white-space: nowrap;
}

.btn:hover {
  border-color: #3a465c;
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--grad);
  border-color: transparent;
  color: #1c1206;
  box-shadow: 0 7px 20px rgba(255, 122, 26, 0.25);
}

.btn--primary:hover {
  box-shadow: 0 9px 26px rgba(255, 122, 26, 0.36);
}

.btn--ghost {
  background: transparent;
}

.btn--sm {
  padding: 7px 11px;
  font-size: 0.8rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elev2);
  color: var(--text);
  transition: 0.15s ease;
  flex: none;
}

.icon-btn:hover:not(:disabled) {
  border-color: #3a465c;
  background: var(--bg-elev3);
}

.icon-btn:disabled {
  opacity: 0.38;
}

.icon-btn--tiny {
  width: 27px;
  height: 27px;
  border-radius: 7px;
  border-color: transparent;
  background: transparent;
}

.icon-btn--tiny:hover:not(:disabled) {
  border-color: var(--border);
  background: var(--bg-elev3);
}

.icon-btn--danger {
  color: #ff8b97;
}

.icon-btn--danger:hover:not(:disabled) {
  background: rgba(255, 77, 94, 0.14);
  border-color: rgba(255, 77, 94, 0.3);
}

/* ---------- Layout ---------- */
.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 358px minmax(0, 1fr) 336px;
}

.canvas-area {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #0b0e13;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 18px;
  background: rgba(14, 18, 26, 0.94);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(14px);
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 176px;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.1;
}

.brand__text b {
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.brand__text small {
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.project-name {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  min-width: 0;
  flex: 1;
  max-width: 430px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: 0.16s;
}

.project-name:hover,
.project-name:focus-within {
  background: var(--bg-elev);
  border-color: var(--border);
}

.project-name span {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  flex: none;
}

.project-name input {
  flex: 1;
  min-width: 80px;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0;
}

.topbar__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
}

.topbar__divider {
  width: 1px;
  height: 25px;
  background: var(--border);
  margin: 0 3px;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elev2);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 650;
  transition: 0.15s ease;
}

.topbar-btn:hover {
  border-color: #3a465c;
  background: var(--bg-elev3);
}

.topbar-new {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 122, 26, 0.28);
  background: rgba(255, 122, 26, 0.08);
  color: #ffae72;
  font-size: 0.78rem;
  font-weight: 650;
  transition: 0.15s ease;
}

.topbar-new:hover {
  background: rgba(255, 122, 26, 0.16);
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--border-soft);
}

.sidebar__mobile-head {
  display: none;
}

.settings-toggle {
  display: none;
}

.sidebar__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card__head {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.card__head p {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
  margin-top: 3px;
}

.step {
  width: 25px;
  height: 25px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: #ffad70;
  font-size: 0.72rem;
  font-weight: 750;
  border: 1px solid rgba(255, 122, 26, 0.2);
}

.badge {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--bg-elev3);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
}

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elev2);
  color: #aab4c5;
  font-size: 0.7rem;
  font-weight: 600;
  transition: 0.15s;
}

.tool-chip:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg-elev3);
}

.mini-empty {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px dashed #2d384b;
  border-radius: 11px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.mini-empty svg {
  flex: none;
  color: #ff9f5a;
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 238px;
  overflow-y: auto;
  padding-right: 2px;
}

.room-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px 7px 7px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.14s;
}

.room-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.room-row.is-selected {
  background: var(--accent-soft);
  border-color: rgba(255, 122, 26, 0.22);
}

.room-check {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 1px solid #3b465a;
  background: #0e131b;
  color: #1b1207;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
}

.room-check.is-on {
  background: var(--grad);
  border-color: transparent;
}

.room-row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.room-row__title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.room-row__title b {
  font-size: 0.79rem;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-row__area {
  font-size: 0.65rem;
  color: var(--muted-2);
  flex: none;
}

.room-row__meta {
  font-size: 0.64rem;
  color: var(--muted-2);
  display: flex;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
}

.room-row__status.is-stale {
  color: #ffb020;
}

.selection-note {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(110, 168, 255, 0.08);
  color: #9dbcf2;
  font-size: 0.7rem;
  line-height: 1.35;
}

.inspector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--border-soft);
  padding-top: 11px;
}

.inspector__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.inspector__close {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  padding: 2px;
  border-radius: 5px;
}

.inspector__close:hover {
  color: var(--text);
  background: var(--bg-elev3);
}

.inspector__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  font-size: 0.68rem;
  color: var(--muted);
}

.inspector__stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.window-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  border-radius: 9px;
  background: var(--bg-elev2);
  border: 1px solid var(--border-soft);
}

.window-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.69rem;
  color: #9fb4cc;
}

.window-list__head span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.window-row {
  display: grid;
  grid-template-columns: 1fr auto 25px;
  align-items: center;
  gap: 7px;
  font-size: 0.68rem;
  color: var(--muted);
}

.window-row span:nth-child(2) {
  color: #c9eaff;
}

.hint {
  font-size: 0.69rem;
  color: var(--muted-2);
  line-height: 1.4;
}

.window-list__state {
  font-size: 0.64rem;
  color: var(--muted-2);
  line-height: 1.35;
}

.window-list__state.is-on {
  color: #6ec8da;
}

.fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 35px;
}

.field__label {
  font-size: 0.75rem;
  color: #9da8ba;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.25;
}

.field__label--inline {
  color: var(--text);
}

.field__hint {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #39465a;
  color: var(--muted-2);
  font-size: 0.56rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  flex: none;
}

.field__control {
  display: flex;
  align-items: center;
  flex: none;
  min-width: 113px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #0e131b;
  color: var(--text);
  transition: 0.15s;
}

.field__control:focus-within {
  border-color: rgba(255, 122, 26, 0.55);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.08);
}

.field__control input,
.field__control select {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0 10px;
}

.field__control select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #6d788c 50%),
    linear-gradient(135deg, #6d788c 50%, transparent 50%);
  background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
}

.field__control select option {
  background: var(--bg-elev2);
  color: var(--text);
}

.field__unit {
  color: var(--muted-2);
  font-size: 0.7rem;
  padding-right: 9px;
  flex: none;
}

.inspector .field {
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.inspector .field__control {
  min-width: 0;
  width: 100%;
}

input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.segmented__item {
  border: 1px solid var(--border-soft);
  background: #0e131b;
  border-radius: 10px;
  color: var(--muted);
  padding: 9px;
  text-align: left;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1px 7px;
  transition: 0.16s;
}

.segmented__item:hover {
  border-color: var(--border);
  background: var(--bg-elev2);
}

.segmented__item.is-active {
  border-color: rgba(255, 122, 26, 0.45);
  background: var(--accent-soft);
  color: #ffd2b0;
  box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.08);
}

.pattern-preview {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  color: #ff9a58;
}

.segmented__item b {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
}

.segmented__item small {
  font-size: 0.58rem;
  line-height: 1.25;
  color: var(--muted-2);
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 2px;
  cursor: pointer;
}

.toggle-field > span:first-child {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.toggle-field__hint {
  font-size: 0.65rem;
  line-height: 1.35;
  color: var(--muted-2);
}

.toggle-field__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-field__track {
  width: 38px;
  height: 22px;
  border-radius: 99px;
  background: #2b3547;
  padding: 3px;
  flex: none;
  transition: 0.16s;
}

.toggle-field__thumb {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #8b95a9;
  transition: 0.16s;
}

.toggle-field__input:checked + .toggle-field__track {
  background: var(--grad);
}

.toggle-field__input:checked + .toggle-field__track .toggle-field__thumb {
  transform: translateX(16px);
  background: #fff6ec;
}

.toggle-field__input:focus-visible + .toggle-field__track {
  outline: 2px solid rgba(255, 138, 51, 0.7);
  outline-offset: 2px;
}

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

.link-btn {
  border: 0;
  background: transparent;
  color: #8b95a9;
  font-size: 0.67rem;
  padding: 2px 0;
  text-decoration: underline;
  text-decoration-color: #3b4659;
  text-underline-offset: 3px;
}

.link-btn:hover {
  color: #ffb27a;
}

.calc-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px 10px;
  border-radius: 9px;
  background: rgba(33, 212, 196, 0.055);
  border: 1px solid rgba(33, 212, 196, 0.13);
}

.calc-preview > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.67rem;
  color: var(--muted);
}

.calc-preview b {
  color: #9be9df;
  font-size: 0.7rem;
  font-weight: 700;
}

.disclaimer {
  font-size: 0.62rem;
  color: var(--muted-2);
  line-height: 1.4;
}

.build-dock {
  flex: none;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(16, 21, 30, 0.72), var(--panel) 45%);
}

/* ---------- Split build button ---------- */
.build-wrap {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.build-split {
  position: relative;
  display: flex;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(255, 122, 26, 0.16);
  isolation: isolate;
}

.build-split__main,
.build-split__toggle {
  border: 0;
  background: var(--grad);
  color: #1d1206;
  min-height: 54px;
  transition: 0.16s;
}

.build-split__main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px 0 0 12px;
  text-align: left;
}

.build-split__main:hover,
.build-split__toggle:hover {
  filter: brightness(1.05);
}

.build-split__main:active,
.build-split__toggle:active {
  filter: brightness(0.96);
}

.build-split__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(37, 22, 7, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.build-split__main b {
  display: block;
  font-size: 0.82rem;
  line-height: 1.15;
  font-weight: 750;
}

.build-split__main small {
  display: block;
  font-size: 0.62rem;
  opacity: 0.72;
  margin-top: 2px;
}

.build-split__toggle {
  width: 39px;
  border-radius: 0 12px 12px 0;
  border-left: 1px solid rgba(40, 23, 4, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.build-split.is-disabled {
  opacity: 0.48;
  box-shadow: none;
}

.build-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  border: 1px solid #3a465b;
  background: #18202c;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 5px;
  z-index: 50;
  animation: pop-in 0.14s ease;
}

.build-menu__item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.build-menu__item:hover:not(:disabled) {
  background: var(--bg-elev3);
}

.build-menu__item:disabled {
  opacity: 0.48;
}

.build-menu__check {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  flex: none;
  color: var(--accent-2);
}

.build-menu__item b {
  display: block;
  font-size: 0.75rem;
  line-height: 1.3;
}

.build-menu__item small {
  display: block;
  color: var(--muted);
  font-size: 0.63rem;
  margin-top: 3px;
}

.build-note {
  text-align: center;
  color: var(--muted-2);
  font-size: 0.65rem;
  line-height: 1.3;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Results panel ---------- */
.results {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-left: 1px solid var(--border-soft);
}

.results__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-soft);
  flex: none;
}

.eyebrow {
  display: block;
  color: var(--muted-2);
  font-size: 0.61rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.results__head h2 {
  font-size: 1.06rem;
}

.results__head-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(33, 212, 196, 0.08);
  color: #7fe2d8;
  font-size: 0.6rem;
  font-weight: 650;
  white-space: nowrap;
}

.live-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(33, 212, 196, 0.1);
}

.live-dot.is-off {
  background: rgba(139, 149, 169, 0.08);
  color: var(--muted-2);
}

.live-dot.is-off::before {
  background: var(--muted-2);
  box-shadow: none;
}

.results__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.results-empty {
  padding: 26px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 1px dashed #2b3547;
  border-radius: var(--radius);
  color: var(--muted);
}

.results-empty__icon {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ff9a58;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 122, 26, 0.2);
}

.results-empty h3 {
  color: var(--text);
  font-size: 0.9rem;
}

.results-empty p {
  font-size: 0.73rem;
  line-height: 1.5;
  max-width: 250px;
}

.results-empty__list {
  width: 100%;
  display: grid;
  gap: 6px;
  margin-top: 6px;
  text-align: left;
  font-size: 0.68rem;
}

.results-empty__list span {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  color: #9ba6b8;
}

.results-empty__list svg {
  color: var(--teal);
}

.stale-banner,
.partial-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 10px;
  font-size: 0.68rem;
  line-height: 1.4;
}

.stale-banner {
  background: rgba(255, 176, 32, 0.09);
  border: 1px solid rgba(255, 176, 32, 0.23);
  color: #e9c27c;
}

.stale-banner svg,
.partial-note svg {
  flex: none;
  margin-top: 1px;
}

.partial-note {
  background: rgba(110, 168, 255, 0.07);
  border: 1px solid rgba(110, 168, 255, 0.16);
  color: #a7c1ee;
}

.hero-metric {
  border-radius: 14px;
  padding: 16px;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(255, 122, 26, 0.24), rgba(255, 176, 32, 0.07));
  border: 1px solid rgba(255, 122, 26, 0.25);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-metric__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffc997;
  font-size: 0.7rem;
  margin-bottom: 4px;
}

.hero-metric > b {
  font-size: 1.95rem;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.hero-metric__sub {
  color: var(--muted);
  font-size: 0.66rem;
  margin-top: 3px;
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.metric {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  border-radius: 11px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.metric::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--metric-accent, var(--accent));
  opacity: 0.8;
}

.metric__icon {
  position: absolute;
  top: 9px;
  right: 9px;
  color: var(--metric-accent, var(--accent));
  opacity: 0.75;
}

.metric__label {
  color: var(--muted);
  font-size: 0.62rem;
  padding-right: 20px;
}

.metric__value {
  font-size: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.metric__sub {
  color: var(--muted-2);
  font-size: 0.58rem;
  line-height: 1.25;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
}

.detail-grid > div {
  background: var(--bg-elev);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-grid span {
  color: var(--muted-2);
  font-size: 0.58rem;
}

.detail-grid b {
  font-size: 0.72rem;
  font-weight: 650;
}

.warnings {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.warning-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(255, 176, 32, 0.07);
  border: 1px solid rgba(255, 176, 32, 0.15);
  color: #d9b36b;
  font-size: 0.65rem;
  line-height: 1.35;
}

.warning-row svg {
  flex: none;
  margin-top: 1px;
}

.ok-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(33, 212, 196, 0.06);
  border: 1px solid rgba(33, 212, 196, 0.13);
  color: #79d9ce;
  font-size: 0.66rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #c8d0dd;
  font-size: 0.74rem;
  font-weight: 650;
  margin-top: 2px;
}

.section-title small {
  color: var(--muted-2);
  font-size: 0.62rem;
}

.result-rooms {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.result-room {
  border-radius: 11px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}

.result-room__head {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  text-align: left;
}

.result-room__head:hover {
  background: rgba(255, 255, 255, 0.02);
}

.result-room__head b {
  display: block;
  font-size: 0.76rem;
}

.result-room__head small {
  display: block;
  color: var(--muted-2);
  font-size: 0.61rem;
  margin-top: 2px;
}

.result-room__power {
  color: #ffb27a;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.result-room__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  padding: 0 10px 8px;
  color: var(--muted);
  font-size: 0.62rem;
}

.result-room__stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.loop-list {
  border-top: 1px solid var(--border-soft);
  padding: 5px 7px 7px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.loop-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  font-size: 0.61rem;
  color: var(--muted);
  padding: 2px 3px;
}

.loop-row__num {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  color: #081013;
  font-weight: 800;
  font-size: 0.56rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.loop-row__kind {
  color: var(--muted-2);
}

.loop-row__length {
  color: #c2ccda;
  font-weight: 600;
}

.loop-row__power {
  color: var(--muted-2);
  font-size: 0.58rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  padding: 9px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 0.6rem;
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend__line {
  width: 17px;
  height: 0;
  border-top: 2px solid var(--teal);
  border-radius: 2px;
}

.legend__line--feed {
  border-top-style: dashed;
  border-top-color: #ff9f43;
}

.legend__manifold {
  color: var(--accent);
  display: inline-flex;
}

.results__disclaimer {
  padding-bottom: 2px;
}

.results.is-stale .results__scroll {
  opacity: 0.88;
}

/* ---------- Plan canvas ---------- */
.plan {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 122, 26, 0.03), transparent 45%),
    #0b0e13;
}

.plan__svg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  overflow: hidden;
}

.plan__svg.is-tool-select {
  cursor: default;
}

.plan__svg.is-tool-room,
.plan__svg.is-tool-polygon,
.plan__svg.is-tool-window,
.plan__svg.is-tool-manifold {
  cursor: crosshair;
}

.plan__svg.is-panning {
  cursor: grabbing;
}

.canvas-tools {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
  background: rgba(18, 23, 32, 0.9);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.canvas-tool {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8f9bb0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: 0.14s;
}

.canvas-tool:hover:not(:disabled) {
  background: var(--bg-elev3);
  color: var(--text);
}

.canvas-tool.is-active {
  background: var(--accent-soft);
  color: #ffa25f;
  box-shadow: inset 0 0 0 1px rgba(255, 122, 26, 0.25);
}

.canvas-tool.is-danger:hover:not(:disabled) {
  background: rgba(255, 77, 94, 0.12);
  color: #ff8b97;
}

.canvas-tool:disabled {
  opacity: 0.35;
}

.canvas-tools__divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 3px;
}

.canvas-zoom {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(18, 23, 32, 0.9);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  z-index: 10;
}

.canvas-zoom button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8f9bb0;
}

.canvas-zoom button:hover {
  color: var(--text);
  background: var(--bg-elev3);
}

.canvas-status {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 210px);
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--border-soft);
  background: rgba(14, 18, 26, 0.82);
  color: var(--muted-2);
  font-size: 0.6rem;
  backdrop-filter: blur(8px);
  z-index: 9;
  overflow: hidden;
  white-space: nowrap;
}

.canvas-status span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.canvas-status span:last-child {
  color: #93a0b4;
}

.canvas-stale {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(48, 32, 8, 0.92);
  border: 1px solid rgba(255, 176, 32, 0.35);
  color: #ffca7b;
  font-size: 0.68rem;
  z-index: 12;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
}

.canvas-hint {
  position: absolute;
  left: 50%;
  bottom: 62px;
  transform: translateX(-50%);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(18, 23, 32, 0.88);
  border: 1px solid var(--border);
  color: #aab6c9;
  font-size: 0.67rem;
  z-index: 9;
  pointer-events: none;
  backdrop-filter: blur(8px);
  max-width: 80%;
  text-align: center;
}

.onboarding {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(430px, calc(100% - 32px));
  padding: 26px 26px 22px;
  border-radius: 20px;
  background: rgba(17, 22, 31, 0.94);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-align: center;
  z-index: 8;
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.onboarding__actions {
  pointer-events: auto;
}

.onboarding__icon {
  width: 62px;
  height: 62px;
  border-radius: 19px;
  margin: 0 auto 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 122, 26, 0.22);
  color: #ff9f5a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding h2 {
  font-size: 1.16rem;
  margin-bottom: 7px;
}

.onboarding p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 15px;
}

.onboarding__actions {
  display: flex;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
}

.onboarding small {
  display: block;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted-2);
  font-size: 0.66rem;
  line-height: 1.4;
}

/* ---------- Modal and help ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 9, 0.72);
  backdrop-filter: blur(5px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  width: min(520px, 100%);
  max-height: min(760px, 92vh);
  background: #121822;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-in 0.18s ease;
}

.modal--wide {
  width: min(820px, 100%);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.modal__head h2 {
  font-size: 1.08rem;
}

.modal__body {
  padding: 18px;
  overflow-y: auto;
}

.help {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.help__steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.help-step {
  position: relative;
  display: flex;
  gap: 9px;
  padding: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
}

.help-step__num {
  width: 23px;
  height: 23px;
  border-radius: 7px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 122, 26, 0.22);
  color: #ffad70;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 750;
  flex: none;
}

.help-step b {
  font-size: 0.76rem;
}

.help-step p {
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.4;
  margin-top: 4px;
}

.help__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.help-card {
  padding: 12px;
  border-radius: 11px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
}

.help-card h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.77rem;
  margin-bottom: 4px;
}

.help-card h3 svg {
  color: #ff9f5a;
}

.help-card p {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.help__shortcuts {
  padding: 13px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border-soft);
}

.help__shortcuts h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 9px;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px 12px;
  color: var(--muted);
  font-size: 0.68rem;
}

.shortcut-grid span {
  display: flex;
  align-items: center;
  gap: 5px;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 4px;
  border-radius: 5px;
  border: 1px solid #3a465a;
  background: #0d121a;
  color: #c1ccdc;
  font-size: 0.6rem;
  font-family: inherit;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.help__note {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  padding: 10px;
  border-radius: 9px;
  background: rgba(33, 212, 196, 0.05);
  border: 1px solid rgba(33, 212, 196, 0.12);
  color: #86cfc7;
  font-size: 0.66rem;
  line-height: 1.4;
}

.help__note svg {
  flex: none;
  margin-top: 1px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(520px, calc(100vw - 28px));
  padding: 10px 14px;
  border-radius: 11px;
  background: #1a2330;
  border: 1px solid #354258;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.45);
  color: #dce4f0;
  font-size: 0.75rem;
  z-index: 2000;
  animation: toast-in 0.2s ease;
}

.toast__icon {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.toast--success .toast__icon {
  background: rgba(33, 212, 196, 0.12);
  color: #7fe2d8;
}

.toast--warning .toast__icon,
.toast--error .toast__icon {
  background: rgba(255, 176, 32, 0.12);
  color: #ffca7b;
}

.toast--error {
  border-color: rgba(255, 77, 94, 0.35);
}

.toast--error .toast__icon {
  background: rgba(255, 77, 94, 0.12);
  color: #ff8b97;
}

.toast--info .toast__icon {
  background: rgba(110, 168, 255, 0.12);
  color: #a7c1ee;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.results-toggle {
  display: none;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(5, 8, 12, 0.68);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}

.drop-overlay__card {
  width: min(430px, 100%);
  padding: 30px;
  border-radius: 20px;
  border: 1px dashed rgba(255, 176, 32, 0.55);
  background: rgba(22, 27, 37, 0.94);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: #ffc26f;
}

.drop-overlay__card svg {
  color: var(--accent);
  margin-bottom: 4px;
}

.drop-overlay__card b {
  font-size: 1rem;
  color: var(--text);
}

.drop-overlay__card span {
  font-size: 0.72rem;
  color: var(--muted);
}

.results__mobile-close {
  display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1420px) {
  .workspace {
    grid-template-columns: 338px minmax(0, 1fr) 316px;
  }
  .brand {
    min-width: 154px;
  }
}

@media (max-width: 1240px) {
  .workspace {
    grid-template-columns: 326px minmax(0, 1fr) 296px;
  }
  .topbar-btn span {
    display: none;
  }
  .topbar-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }
  .project-name {
    max-width: 320px;
  }
}

@media (max-width: 1090px) {
  .workspace {
    grid-template-columns: 326px minmax(0, 1fr);
  }
  .results {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    bottom: 0;
    width: min(340px, 90vw);
    z-index: 150;
    transform: translateX(102%);
    transition: transform 0.22s ease;
    box-shadow: -18px 0 48px rgba(0, 0, 0, 0.35);
  }
  .results.is-open {
    transform: none;
  }
  .results__mobile-close {
    display: inline-flex;
  }
  .results-toggle {
    position: fixed;
    right: 14px;
    top: calc(var(--topbar-h) + 14px);
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 122, 26, 0.3);
    background: rgba(24, 18, 12, 0.92);
    color: #ffb27a;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
  }
  .project-name {
    max-width: 260px;
  }
  .brand {
    min-width: 132px;
  }
  .brand__text small {
    display: none;
  }
}

@media (max-width: 860px) {
  .topbar {
    gap: 10px;
    padding: 0 10px;
  }
  .brand__text {
    display: none;
  }
  .brand {
    min-width: 36px;
  }
  .project-name {
    max-width: none;
  }
  .topbar__divider {
    display: none;
  }
  .topbar-new {
    display: none;
  }
  .workspace {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .sidebar__scroll {
    padding: 10px;
  }
  .sidebar__scroll .card {
    padding: 12px;
  }
  .canvas-status span:nth-child(2),
  .canvas-status span:nth-child(4) {
    display: none;
  }
}

@media (max-width: 700px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: min(340px, 90vw);
    z-index: 150;
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: 18px 0 48px rgba(0, 0, 0, 0.35);
  }
  .sidebar.is-open {
    transform: none;
  }
  .sidebar__mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 13px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex: none;
  }
  .toast {
    bottom: 76px;
  }
  .settings-toggle {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(18, 23, 32, 0.92);
    color: #c7d0de;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
  }
  .topbar__actions .icon-btn:nth-of-type(1),
  .topbar__actions .icon-btn:nth-of-type(2) {
    display: none;
  }
  .onboarding {
    padding: 20px;
  }
  .canvas-tools {
    top: 10px;
    left: 10px;
  }
  .canvas-tool {
    width: 31px;
    height: 31px;
  }
  .canvas-status {
    max-width: calc(100% - 28px);
    bottom: 58px;
  }
  .canvas-zoom {
    bottom: 10px;
    right: 10px;
  }
  .canvas-hint {
    bottom: 96px;
  }
  .help__steps,
  .help__grid {
    grid-template-columns: 1fr;
  }
  .shortcut-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Print ---------- */
@media print {
  html,
  body,
  #root {
    height: auto;
    background: #0b0e13;
    overflow: visible;
  }
  .topbar,
  .sidebar,
  .results,
  .canvas-tools,
  .canvas-zoom,
  .canvas-status,
  .canvas-hint,
  .canvas-stale,
  .onboarding,
  .toast,
  .results-toggle,
  .modal-backdrop {
    display: none !important;
  }
  .app,
  .workspace,
  .canvas-area,
  .plan {
    display: block;
    width: 100%;
    height: 100vh;
    overflow: hidden;
  }
  .plan__svg {
    width: 100%;
    height: 100%;
  }
}

/* ---------- Blazor host ---------- */
html,
body,
#app {
  height: 100%;
}

#app {
  overflow: hidden;
}

.is-hidden {
  display: none !important;
}

.plan__svg-host {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: transparent;
}

.boot-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 122, 26, 0.08), transparent 34%),
    var(--bg);
  color: var(--text);
}

.boot-screen b {
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.boot-screen span {
  color: var(--muted);
  font-size: 0.75rem;
}

.boot-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border-radius: 23px;
  background: var(--accent-soft);
  border: 1px solid rgba(255, 122, 26, 0.2);
  margin-bottom: 4px;
}

.boot-progress {
  width: 150px;
  height: 4px;
  border-radius: 99px;
  background: #1b2330;
  overflow: hidden;
  margin-top: 10px;
}

.boot-progress i {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: var(--grad);
  animation: boot-slide 1.1s ease-in-out infinite;
}

@keyframes boot-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(330%); }
}

#blazor-error-ui {
  color-scheme: dark;
  background: #2a1d12;
  color: #ffd2b0;
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  display: none;
  left: 0;
  padding: 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 3000;
  font-size: 0.78rem;
}

#blazor-error-ui .reload {
  color: #ffb020;
  margin-left: 8px;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.9rem;
  top: 0.55rem;
  font-size: 1rem;
}

.validation-message {
  color: var(--danger);
  font-size: 0.7rem;
}

@media print {
  .menu-backdrop,
  .boot-screen,
  #blazor-error-ui,
  .drop-overlay {
    display: none !important;
  }
}
