:root {
  --bg: #f7f7f7;
  --ink: #020101;
  --muted: #4f5976;
  --line: #d3d3d3;
  --panel: #ffffff;
  --accent: #f8b323;
  --accent-dark: #142247;
  --roof: #f8f8f8;
  --roof-line: #292929;
  --zone: rgba(248, 179, 35, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg) 42%, #eeeeee 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1760px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar p,
h1,
h2 {
  margin: 0;
}

.topbar p {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 760;
  text-transform: uppercase;
}

h1 {
  margin-top: 5px;
  font-size: clamp(1.55rem, 2.2vw, 2.35rem);
  line-height: 1.04;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(247, 247, 247, 0.92);
  backdrop-filter: blur(8px);
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(20, 34, 71, 0.16);
  padding: 24px;
}

.auth-card p {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-card h2 {
  margin-bottom: 18px;
  font-size: 1.45rem;
}

.auth-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

.auth-card input {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px 12px;
  color: var(--ink);
}

.auth-card button {
  width: 100%;
  margin-top: 14px;
}

.auth-message {
  min-height: 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.account-shell {
  width: min(980px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.account-header {
  margin-bottom: 20px;
}

.account-header p {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.account-email {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 650;
}

.account-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.account-project-list {
  display: grid;
  gap: 12px;
}

.account-project,
.account-empty {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(20, 34, 71, 0.08);
  padding: 18px;
}

.account-project-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.account-project h2 {
  margin: 0;
  font-size: 1.1rem;
}

.account-project p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-open,
.account-versions a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--accent-dark);
  padding: 8px 12px;
  font-weight: 780;
  text-decoration: none;
}

.account-project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.account-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--accent);
  color: var(--ink);
  padding: 8px 12px;
  font-weight: 780;
  cursor: pointer;
}

.account-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.account-versions a {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 0.86rem;
}

.account-empty {
  color: var(--muted);
  font-weight: 700;
}

.offer-request-icon {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: #fff7df;
  border: 1px solid #243934;
  box-shadow: inset 0 0 0 2px #f8b323;
}

.offer-request-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  width: 15px;
  height: 19px;
  border: 2px solid #243934;
  border-radius: 2px;
  background: #ffffff;
}

.offer-request-icon::after {
  content: "";
  position: absolute;
  left: 12px;
  top: 13px;
  width: 13px;
  height: 7px;
  border-left: 3px solid #f8b323;
  border-bottom: 3px solid #f8b323;
  transform: rotate(-45deg);
}

h2 {
  font-size: 1rem;
  margin-bottom: 14px;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 3px;
  background: var(--accent);
  color: #020101;
  padding: 10px 14px;
  font-weight: 760;
  cursor: pointer;
}

button:hover {
  background: #ffbc7d;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

.workbench {
  position: relative;
  display: grid;
  grid-template-columns: var(--left-column-width, 420px) 10px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.panel,
.canvas-panel {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(20, 34, 71, 0.08);
}

.panel {
  padding: 18px;
}

.left-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.planning-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.column-resizer {
  align-self: stretch;
  min-height: calc(100vh - 128px);
  border-radius: 3px;
  background: linear-gradient(90deg, transparent 0, transparent 3px, var(--line) 3px, var(--line) 7px, transparent 7px);
  cursor: col-resize;
  touch-action: none;
}

.column-resizer:hover,
.column-resizer.active {
  background: linear-gradient(90deg, transparent 0, transparent 3px, var(--accent) 3px, var(--accent) 7px, transparent 7px);
}

.floating-area {
  position: relative;
  min-height: calc(100vh - 128px);
  min-width: 0;
  overflow: auto;
}

.fixed-planner {
  position: relative;
  width: 100%;
  min-height: 650px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(20, 34, 71, 0.08);
  padding: 10px;
}

.floating-window {
  position: absolute;
  display: grid;
  gap: 10px;
  min-width: 360px;
  min-height: 260px;
  max-width: 100%;
  max-height: 100%;
  resize: both;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(20, 34, 71, 0.08);
  padding: 10px;
}

.window-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  cursor: move;
  user-select: none;
}

.window-header h2 {
  margin: 0;
}

.window-header span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
  text-transform: uppercase;
}

.window-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #ffffff;
  color: var(--accent-dark);
  padding: 0;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  position: relative;
  z-index: 2;
  touch-action: manipulation;
}

.window-close:hover {
  background: #fff5da;
}

.static-header {
  cursor: default;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.input-action-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
}

.input-action-row button {
  min-height: 36px;
  padding: 8px 12px;
}

.project-action-row {
  gap: 6px;
}

.project-action-row .panel-tool {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
}

.project-action-row .icon-tool > .tool-sprite {
  width: 26px;
  height: 26px;
  background-size: 174px 174px;
}

.project-action-row .icon-tool > .tool-sprite.new-icon {
  background-position: -9px -13px;
}

.project-action-row .icon-tool > .tool-sprite.folder-icon {
  background-position: -48px -17px;
}

.project-action-row .icon-tool > .tool-sprite.save-icon {
  background-position: -90px -16px;
}

.inline-overview {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fffdf7;
  padding: 10px;
}

.inline-overview-list {
  display: grid;
  gap: 8px;
}

.inline-project {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid rgba(20, 34, 71, 0.12);
  padding-bottom: 8px;
}

.inline-project:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.inline-project button {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  text-align: left;
}

.inline-project-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: center;
}

.inline-project-open {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--accent-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-project-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inline-project-share {
  justify-self: end;
  width: 34px !important;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--accent);
  color: var(--ink);
  padding: 0;
  text-align: center;
}

.share-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.share-icon-button::before {
  content: "";
  width: 18px;
  height: 16px;
  background:
    radial-gradient(circle at 3px 8px, currentColor 0 2px, transparent 2.5px),
    radial-gradient(circle at 15px 3px, currentColor 0 2px, transparent 2.5px),
    radial-gradient(circle at 15px 13px, currentColor 0 2px, transparent 2.5px),
    linear-gradient(25deg, transparent 0 45%, currentColor 46% 54%, transparent 55%),
    linear-gradient(-25deg, transparent 0 45%, currentColor 46% 54%, transparent 55%);
}

.inline-project-versions button {
  width: auto;
  min-height: 30px;
  border: 1px solid var(--line);
  background: #ffffff !important;
  color: var(--accent-dark) !important;
  font-size: 0.8rem;
}

.input-page[hidden] {
  display: none;
}

.input-pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.input-page-dot {
  width: 10px;
  height: 10px;
  min-width: 10px;
  min-height: 10px;
  padding: 0;
  border: 1px solid var(--accent-dark);
  border-radius: 50%;
  background: #ffffff;
}

.input-page-dot.active {
  background: var(--accent);
}

label {
  display: grid;
  gap: 5px;
  min-height: 62px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

label:has(input[type="text"]),
label:has(input[type="email"]),
label:has(select) {
  grid-column: span 2;
}

.input-section {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(20, 34, 71, 0.12);
  border-radius: 3px;
  background: rgba(248, 250, 249, 0.72);
}

.input-section h3 {
  grid-column: span 2;
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.82rem;
  line-height: 1.2;
}

.input-section label:has(select) {
  grid-column: auto;
}

.secondary-action {
  grid-column: span 2;
  min-height: 38px;
  border: 1px solid var(--accent);
  background: #fff8e4;
  color: var(--accent-dark);
  padding: 8px 10px;
  font-size: 0.78rem;
}

.secondary-action:hover {
  background: #ffe8ab;
}

.input-hint {
  grid-column: span 2;
  min-height: 1.2em;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

input[readonly] {
  color: var(--muted);
  background: #f3f5f4;
  cursor: default;
}

.check {
  grid-template-columns: 22px 1fr;
  align-items: center;
  min-height: 48px;
}

.check input {
  min-height: 22px;
  width: 22px;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

input[readonly],
.readonly-email {
  background: #f4f4f4;
  color: var(--muted);
  cursor: default;
}

.palette {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(20, 34, 71, 0.08);
  padding: 12px;
}

.tool-palette {
  display: grid;
  grid-template-columns: auto minmax(190px, 260px) 1fr;
  align-items: center;
  gap: 10px;
}

.tool-palette h2 {
  margin: 0 6px 0 0;
}

.tool-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mode-tool-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 3px;
  border: 1px solid transparent;
  border-radius: 5px;
}

.mode-tool-group[hidden],
.panel-tool[hidden] {
  display: none !important;
}

.mode-tool-group:has(> .panel-tool.active) {
  border-color: rgba(248, 179, 35, 0.95);
  background: rgba(255, 243, 207, 0.38);
  box-shadow: 0 0 0 2px rgba(248, 179, 35, 0.18);
}

.panel-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  background: #ffffff;
  color: var(--accent-dark);
  border: 1px solid var(--line);
  padding: 0;
  font-size: 0;
  text-align: center;
}

.help-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--accent-dark);
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.panel-tool:hover {
  background: #fff5da;
}

.zoom-tools {
  display: grid;
  grid-template-columns: 32px 48px 32px;
  gap: 4px;
  min-height: 38px;
}

.zoom-tools button {
  min-width: 0;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--accent-dark);
  padding: 0;
  font-size: 0.78rem;
  font-weight: 850;
}

.zoom-tools button:hover {
  background: #fff5da;
}

.roof-zone-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(34px, 1fr));
  gap: 4px;
  width: 116px;
}

.roof-zone-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.roof-zone-key.dz1 {
  color: rgba(142, 34, 28, 0.95);
  background: rgba(196, 61, 48, 0.2);
}

.roof-zone-key.dz2 {
  color: rgba(139, 86, 10, 0.95);
  background: rgba(248, 179, 35, 0.18);
}

.roof-zone-key.dz3 {
  color: rgba(38, 87, 145, 0.95);
  background: rgba(53, 136, 201, 0.13);
}

.roof-zone-key.dz4 {
  color: rgba(10, 91, 78, 0.95);
  background: rgba(11, 118, 101, 0.12);
}

.cleanup-icon {
  position: relative;
  display: inline-block;
  width: 17px;
  height: 18px;
  border: 2px solid var(--accent-dark);
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

.cleanup-icon::before {
  content: "";
  position: absolute;
  left: -4px;
  top: -6px;
  width: 21px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent-dark);
}

.cleanup-icon::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 7px;
  height: 10px;
  border-left: 2px solid var(--accent-dark);
  border-right: 2px solid var(--accent-dark);
}

.panel-icon {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 34px;
  border: 2px solid #263a34;
  border-radius: 4px;
  background:
    repeating-linear-gradient(0deg, transparent 0 7px, rgba(122, 181, 205, 0.30) 7px 8px),
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(122, 181, 205, 0.34) 10px 11px),
    linear-gradient(90deg, rgb(13, 33, 47) 0%, rgb(16, 42, 59) 70%, rgb(34, 76, 98) 100%);
}

.planner-toolbar {
  justify-content: flex-start;
  padding: 0 2px 2px;
}

.tool-gap {
  width: 14px;
  height: 1px;
}

.wind-shadow-directions {
  display: inline-grid;
  grid-template-columns: repeat(4, 28px);
  gap: 4px;
  align-items: center;
  min-height: 38px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.86);
}

.wind-shadow-directions[hidden] {
  display: none;
}

.wind-ballast-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 38px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.86);
}

.wind-ballast-tools[hidden] {
  display: none;
}

.wind-shadow-directions button {
  min-width: 0;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 900;
}

.wind-shadow-directions button.active {
  border-color: var(--accent);
  background: #fff3cf;
  box-shadow: inset 0 0 0 2px rgba(248, 179, 35, 0.22);
}

.roof-canvas-panel {
  position: relative;
}

.canvas-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  display: grid;
  justify-items: stretch;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(20, 34, 71, 0.14);
}

.canvas-controls .panel-tool {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  min-height: 38px;
}

.roof-edit-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.roof-edit-tools[hidden] {
  display: none !important;
}

.roof-tool-dialog[hidden] {
  display: none !important;
}

.roof-tool-dialog {
  position: absolute;
  z-index: 35;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  gap: 9px;
  width: min(260px, 82vw);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 34px rgba(20, 34, 71, 0.18);
}

.roof-tool-dialog label {
  min-height: 0;
}

.roof-tool-dialog .menu-check {
  align-items: center;
}

.compact-tool {
  width: 38px;
  min-width: 38px;
}

.plus-icon {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 22px;
}

.plus-icon::before,
.plus-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent-dark);
  transform: translate(-50%, -50%);
}

.plus-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.floating-window.hidden {
  display: none;
}

.results-panel[hidden] {
  display: none !important;
}

.panel-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  border-left: 2px solid #263a34;
}

.panel-icon.single {
  width: 18px;
  height: 26px;
  background:
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(122, 181, 205, 0.34) 6px 7px),
    linear-gradient(90deg, rgb(13, 33, 47) 0%, rgb(34, 76, 98) 100%);
}

.panel-icon.single::after {
  content: none;
}

.obstacle-icon {
  display: inline-block;
  width: 25px;
  height: 18px;
  border: 2px solid #5b6260;
  border-radius: 4px;
  background: #b8bfbd;
}

.roof-plus-icon {
  position: relative;
  display: inline-block;
  width: 25px;
  height: 20px;
  border: 2px solid #292929;
  border-radius: 3px;
  background: #ffffff;
}

.roof-plus-icon::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-left: 2px solid #292929;
  border-bottom: 2px solid #292929;
  background: var(--panel);
  transform: rotate(45deg);
}

.slope-icon {
  position: relative;
  display: inline-block;
  width: 25px;
  height: 25px;
}

.slope-icon::before {
  content: "";
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 18px;
  height: 18px;
  clip-path: polygon(0 100%, 0 0, 100% 100%);
  background: #ffffff;
  border-left: 2px solid #292929;
  border-bottom: 2px solid #292929;
}

.slope-icon::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  width: 17px;
  height: 2px;
  background: #f8b323;
  transform: rotate(45deg);
  transform-origin: left center;
}

.new-icon {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 24px;
  border: 2px solid var(--accent-dark);
  border-radius: 3px;
  background: #ffffff;
}

.new-icon::before,
.new-icon::after {
  content: "";
  position: absolute;
}

.new-icon::before {
  right: -2px;
  top: -2px;
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--accent-dark);
  border-bottom: 2px solid var(--accent-dark);
  background: #f2f4f3;
}

.new-icon::after {
  left: 4px;
  right: 4px;
  top: 11px;
  height: 2px;
  background: var(--accent-dark);
}

.icon-tool {
  justify-content: center;
  padding: 7px;
}

.planner-toolbar .icon-tool {
  width: 82px;
  height: 102px;
  min-height: 102px;
  padding: 0;
  border: 0;
  background: transparent;
}

.planner-toolbar .icon-tool:hover {
  background: transparent;
}

.undo-icon {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 22px;
}

.undo-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 14px;
  height: 11px;
  border: 2px solid var(--accent-dark);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 10px 0 0;
}

.undo-icon::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 9px solid var(--accent-dark);
}

.folder-icon {
  position: relative;
  display: inline-block;
  width: 25px;
  height: 18px;
  border: 2px solid var(--accent-dark);
  border-radius: 3px;
  background: #ffffff;
}

.folder-icon::before {
  content: "";
  position: absolute;
  left: 2px;
  top: -7px;
  width: 10px;
  height: 7px;
  border: 2px solid var(--accent-dark);
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
  background: #ffffff;
}

.folder-icon::after {
  content: "";
  position: absolute;
  left: -3px;
  right: -3px;
  top: 6px;
  height: 11px;
  border: 2px solid var(--accent-dark);
  border-radius: 3px;
  background: #fff5da;
  transform: skewX(-12deg);
}

.save-icon {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 24px;
  border: 2px solid var(--accent-dark);
  border-radius: 3px;
  background: #ffffff;
}

.save-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 3px;
  height: 6px;
  border: 2px solid var(--accent-dark);
  background: #f2f4f3;
}

.save-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 3px;
  height: 7px;
  border: 2px solid var(--accent-dark);
  background: #fff5da;
}

.results-icon {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 22px;
  border: 2px solid var(--accent-dark);
  border-radius: 3px;
  background: #ffffff;
}

.results-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  top: 5px;
  height: 2px;
  background: var(--accent-dark);
  box-shadow: 0 5px 0 var(--accent-dark), 0 10px 0 var(--accent-dark);
}

.results-icon::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 5px 0 var(--accent), 0 10px 0 var(--accent);
}

.report-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 23px;
  border: 2px solid var(--accent-dark);
  border-radius: 3px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 0;
}

.report-icon::before {
  content: "</>";
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
}

.report-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 4px;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 -5px 0 var(--accent);
}

.debug-json-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 26px;
  border: 2px solid var(--accent-dark);
  border-radius: 3px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 9px;
  font-weight: 950;
  line-height: 1;
}

.debug-json-icon::before {
  content: "{}";
}

.debug-json-icon::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 9px;
  height: 9px;
  background: linear-gradient(135deg, #ffffff 0 45%, var(--accent-dark) 46% 100%);
  border-left: 2px solid var(--accent-dark);
  border-bottom: 2px solid var(--accent-dark);
}

.map-icon {
  position: relative;
  display: inline-block;
  width: 25px;
  height: 25px;
  border: 2px solid #292929;
  background:
    linear-gradient(90deg, transparent 48%, #d3d3d3 48% 54%, transparent 54%),
    linear-gradient(0deg, transparent 48%, #d3d3d3 48% 54%, transparent 54%),
    #ffffff;
}

.map-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 8px 0 -2px var(--accent-dark);
}

.panel-tool.active {
  border-color: var(--accent-dark);
  background: var(--accent);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px rgba(2, 1, 1, 0.12), 0 4px 10px rgba(248, 179, 35, 0.24);
}

.values-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--accent-dark);
  border-radius: 50%;
  font-size: 0;
}

.values-icon::before {
  content: "123";
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0;
}

.wind-shadow-icon {
  position: relative;
  display: inline-block;
  width: 25px;
  height: 22px;
  border-left: 3px solid var(--accent-dark);
  border-bottom: 3px solid var(--accent-dark);
}

.wind-shadow-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 15px;
  height: 12px;
  background:
    repeating-linear-gradient(90deg, rgba(20, 32, 28, 0.65) 0 2px, transparent 2px 5px),
    linear-gradient(90deg, rgba(29, 111, 216, 0.30), rgba(248, 179, 35, 0.22));
  transform: skewX(-18deg);
}

.wind-shadow-icon::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -1px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid var(--accent-dark);
}

.load-icon {
  display: inline-block;
  width: 23px;
  height: 23px;
  border: 2px solid var(--accent-dark);
  border-radius: 4px;
  background:
    linear-gradient(90deg, transparent 31%, rgba(20, 32, 28, 0.55) 32% 35%, transparent 36% 64%, rgba(20, 32, 28, 0.55) 65% 68%, transparent 69%),
    linear-gradient(0deg, transparent 31%, rgba(20, 32, 28, 0.55) 32% 35%, transparent 36% 64%, rgba(20, 32, 28, 0.55) 65% 68%, transparent 69%),
    linear-gradient(135deg, rgba(22, 154, 109, 0.26), rgba(248, 179, 35, 0.45));
}

.auto-ballast-icon {
  display: inline-block;
  width: 38px;
  height: 38px;
  background-image: url("assets/Auto%20Ballast.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.planner-toolbar .auto-ballast-icon {
  width: 82px;
  height: 102px;
}

.attika-icon {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(30, 45, 42, 0.16);
}

.planner-toolbar .attika-icon {
  width: 82px;
  height: 102px;
  box-shadow: none;
}

.auto-ballast-progress {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(140px, 260px) auto;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(20, 32, 28, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(20, 32, 28, 0.10);
}

.auto-ballast-progress[hidden] {
  display: none;
}

.auto-ballast-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(20, 32, 28, 0.14);
}

.auto-ballast-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #f8b323);
  transition: width 0.16s ease;
}

.auto-ballast-progress button {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(20, 32, 28, 0.24);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.auto-ballast-progress button:hover {
  border-color: var(--accent-dark);
}

.id-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 22px;
  border: 2px solid var(--accent-dark);
  border-radius: 4px;
  font-size: 0;
}

.id-icon::before {
  content: "#";
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.icon-tool > .tool-sprite {
  display: inline-block;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url("assets/PanelOnRoof_user.png");
  background-repeat: no-repeat;
  background-size: 226px 226px;
  box-shadow: none;
}

.planner-toolbar .icon-tool > .tool-sprite {
  width: 82px;
  height: 102px;
  background-size: 410px 410px;
}

.planner-toolbar .offer-request-icon {
  width: 82px;
  height: 102px;
  border: 0;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(20, 34, 71, 0.18);
  pointer-events: none;
}

.planner-toolbar .offer-request-icon::before {
  left: 24px;
  top: 14px;
  width: 34px;
  height: 43px;
  border-width: 3px;
  border-radius: 4px;
}

.planner-toolbar .offer-request-icon::after {
  left: 30px;
  top: 30px;
  width: 31px;
  height: 17px;
  border-left-width: 6px;
  border-bottom-width: 6px;
}

.planner-toolbar .offer-request-tool {
  position: relative;
}

.planner-toolbar .offer-request-tool::after {
  content: "Angebot";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 11px;
  color: #020101;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.icon-tool > .tool-sprite::before,
.icon-tool > .tool-sprite::after {
  content: none !important;
}

.icon-tool > .tool-sprite.new-icon {
  background-position: -12px -17px;
}

.planner-toolbar .icon-tool > .tool-sprite.new-icon {
  background-position: -11px -26px;
}

.icon-tool > .tool-sprite.folder-icon {
  background-position: -62px -22px;
}

.planner-toolbar .icon-tool > .tool-sprite.folder-icon {
  background-position: -107px -26px;
}

.icon-tool > .tool-sprite.save-icon {
  background-position: -117px -20px;
}

.planner-toolbar .icon-tool > .tool-sprite.save-icon {
  background-position: -203px -26px;
}

.icon-tool > .tool-sprite.map-icon {
  background-position: -170px -20px;
}

.planner-toolbar .icon-tool > .tool-sprite.map-icon {
  background-position: -299px -26px;
}

.icon-tool > .tool-sprite.roof-plus-icon,
.icon-tool > .tool-sprite.slope-icon {
  background-position: -9px -87px;
}

.planner-toolbar .icon-tool > .tool-sprite.roof-plus-icon,
.planner-toolbar .icon-tool > .tool-sprite.slope-icon {
  background-position: -11px -153px;
}

.planner-toolbar .icon-tool > .tool-sprite.slope-icon {
  background-position: -299px -281px;
}

.icon-tool > .tool-sprite.panel-icon {
  background-position: -63px -87px;
}

.planner-toolbar .icon-tool > .tool-sprite.panel-icon {
  background-position: -107px -153px;
}

.icon-tool > .tool-sprite.wind-shadow-icon {
  background-position: -167px -89px;
}

.planner-toolbar .icon-tool > .tool-sprite.wind-shadow-icon {
  background-position: -299px -153px;
}

.icon-tool > .tool-sprite.values-icon {
  background-position: -114px -89px;
}

.planner-toolbar .icon-tool > .tool-sprite.values-icon {
  background-position: -203px -153px;
}

.icon-tool > .tool-sprite.load-icon {
  background-position: -6px -159px;
}

.planner-toolbar .icon-tool > .tool-sprite.load-icon {
  background-position: -11px -281px;
}

.icon-tool > .tool-sprite.id-icon {
  background-position: -115px -163px;
}

.planner-toolbar .icon-tool > .tool-sprite.id-icon {
  background-position: -203px -281px;
}

.icon-tool > .tool-sprite.values-icon[style] {
  font-size: 0;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 720;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.legend-bar {
  display: inline-block;
  width: 54px;
  height: 8px;
  border-radius: 2px;
  border: 1px solid currentColor;
}

.legend-bar.panel-fix-102 {
  width: 76px;
  background: #f08a3c;
  color: #7a3c0d;
}

.legend-bar.panel-fix-101 {
  background: #f4c542;
  color: #6d5309;
}

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid rgba(11, 118, 101, 0.18);
  border-color: var(--accent);
}

.canvas-panel {
  padding: 14px;
  overflow: auto;
  min-width: 0;
}

.iso-panel {
  min-width: 0;
}

.fixed-iso-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.fixed-iso-panel .window-header {
  min-height: 24px;
}

.floating-window > .canvas-panel,
.fixed-planner > .canvas-panel,
.floating-window.palette {
  box-shadow: none;
}

.results-panel {
  align-content: start;
  min-height: 220px;
  z-index: 5;
}

.result-pages {
  min-height: 0;
  overflow: auto;
}

.result-page {
  display: none;
}

.result-page.active {
  display: grid;
}

.result-list {
  gap: 8px;
  margin: 0;
}

.result-pagination {
  display: flex;
  justify-content: center;
  gap: 9px;
  padding: 4px 0 2px;
}

.result-dot {
  width: 11px;
  height: 11px;
  min-height: 0;
  border-radius: 50%;
  border: 1px solid var(--accent-dark);
  background: #ffffff;
  padding: 0;
}

.result-dot.active {
  background: var(--accent);
  border-color: var(--accent);
}

.result-list div {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.result-list dt {
  color: var(--muted);
  font-weight: 720;
}

.result-list dd {
  margin: 0;
  color: var(--accent-dark);
  font-size: 1.35rem;
  font-weight: 860;
  text-align: right;
}

canvas {
  display: block;
  width: 100%;
  min-width: 0;
  height: auto;
  border-radius: 6px;
  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
}

.context-menu {
  position: fixed;
  z-index: 20;
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(20, 34, 71, 0.18);
  padding: 8px;
}

.panel-menu-preview {
  display: grid;
  place-items: center;
  min-height: 184px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(11, 118, 101, 0.05) 1px, transparent 1px),
    linear-gradient(0deg, rgba(11, 118, 101, 0.05) 1px, transparent 1px),
    #f9fbfa;
  background-size: 18px 18px;
  overflow: hidden;
}

.panel-menu-preview svg {
  display: block;
  width: 252px;
  height: 176px;
}

.preview-hit {
  cursor: pointer;
}

.preview-hit:hover,
.preview-hit:focus {
  outline: none;
}

.preview-hit:hover .preview-target,
.preview-hit:focus .preview-target {
  stroke: var(--accent);
  stroke-width: 3;
}

.preview-label {
  font: 800 9px Inter, Segoe UI, sans-serif;
  fill: #14201c;
  pointer-events: none;
}

.panel-menu-status {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
}

.panel-menu-status:empty {
  display: none;
}

.panel-menu-status-icon {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-image: url("assets/PanelOnRoof_Status.png");
  background-repeat: no-repeat;
  background-size: 162px 162px;
}

.panel-menu-status-icon.ok {
  background-position: -15px -62px;
}

.panel-menu-status-icon.ballast {
  background-position: -62px -62px;
}

.panel-menu-status-icon.fail {
  background-position: -109px -62px;
}

.panel-menu-status-icon.pending {
  background-image: none;
  background-color: #2687d8;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.85);
}

.panel-menu-status strong {
  display: block;
  color: var(--accent-dark);
  font-size: 0.9rem;
  line-height: 1.2;
}

.panel-menu-status small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.25;
}

.panel-ballast-popover {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fffdf6;
  box-shadow: inset 0 0 0 1px rgba(248, 179, 35, 0.22);
}

.panel-ballast-popover[hidden] {
  display: none;
}

.panel-ballast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--accent-dark);
}

.panel-ballast-head strong {
  font-size: 0.88rem;
}

.mini-close {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #ffffff;
  color: var(--accent-dark);
  font-weight: 900;
  touch-action: manipulation;
}

.panel-ballast-value {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 860;
}

.panel-ballast-popover input[type="range"] {
  width: 100%;
  min-height: 34px;
  accent-color: var(--accent);
}

.context-menu fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px 0 0;
  padding: 8px 0 0;
}

.context-menu fieldset:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.context-menu legend {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 780;
  padding: 0 4px;
  text-transform: uppercase;
}

.menu-check {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 8px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.9rem;
}

.menu-check:hover {
  background: #fff5da;
}

.menu-check input {
  width: 18px;
  min-height: 18px;
}

.menu-field.compact {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 8px;
  margin: 7px 8px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 680;
}

.menu-field.compact input {
  width: 100%;
  min-height: 30px;
  padding: 4px 7px;
}

.menu-button {
  display: block;
  width: 100%;
  min-height: 36px;
  margin-top: 6px;
  background: #ffffff;
  color: var(--accent-dark);
  border: 1px solid var(--line);
  text-align: left;
}

.menu-button:hover {
  background: #fff5da;
}

.menu-field {
  display: grid;
  gap: 7px;
  min-height: 0;
  padding: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
}

.menu-field input {
  min-height: 42px;
}

.map-dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(2, 1, 1, 0.42);
  padding: 24px;
}

.map-dialog[hidden] {
  display: none;
}

.map-card {
  width: min(1240px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto auto minmax(320px, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 24px 60px rgba(2, 1, 1, 0.22);
  padding: 14px;
}

.map-header,
.map-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.map-header {
  justify-content: space-between;
}

.map-header h2 {
  margin: 0;
}

.map-close {
  min-width: 42px;
  padding: 8px 12px;
}

.map-controls {
  flex-wrap: wrap;
}

.map-controls input[type="search"] {
  width: min(420px, 100%);
}

.map-rotate {
  min-height: 0;
  grid-template-columns: auto 34px 260px 34px;
  display: grid;
  align-items: center;
  gap: 8px;
}

.map-rotate button {
  position: relative;
  z-index: 1;
  min-width: 0;
  width: 34px;
  min-height: 34px;
  padding: 0;
  font-size: 1rem;
  font-weight: 900;
  touch-action: manipulation;
}

.map-stage {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f7f7f7;
}

.map-rotator,
#mapCanvas,
#mapOverlay {
  position: absolute;
  inset: 0;
}

.map-rotator {
  transform-origin: center;
  z-index: 1;
}

#mapCanvas {
  width: 100%;
  height: 100%;
}

#mapOverlay {
  z-index: 5;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: auto;
  cursor: default;
  background: transparent;
}

#mapOverlay.selecting {
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
}

.map-controls button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-dark);
}

.map-readout {
  margin: 0;
  color: var(--muted);
  font-weight: 720;
}

#isoCanvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: auto;
  cursor: default;
}

@media (max-width: 980px) {
  .workbench {
    display: flex;
    flex-direction: column;
  }

  .column-resizer {
    display: none;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .iso-panel {
    grid-column: auto;
  }

  .floating-area {
    order: 1;
  }

  .left-stack {
    order: 2;
  }

  .results-panel {
    order: 3;
  }

  .floating-area {
    min-height: 1100px;
  }

  .tool-palette {
    grid-template-columns: 1fr;
  }

  .legend {
    justify-content: flex-start;
  }
}

@media (max-width: 760px), (pointer: coarse) and (max-width: 980px) {
  body {
    background: #f7f7f7;
    overscroll-behavior: none;
  }

  body.roof-edit-active {
    overflow: hidden;
  }

  body.roof-edit-active .workbench {
    max-height: 100vh;
    overflow: hidden;
  }

  body.roof-edit-active .floating-area {
    min-height: 0;
  }

  .shell {
    width: 100%;
    padding: 8px;
  }

  .topbar {
    gap: 8px;
    margin-bottom: 8px;
  }

  .topbar p {
    font-size: 0.72rem;
  }

  h1 {
    font-size: 1.25rem;
    line-height: 1.12;
  }

  .fixed-planner,
  .panel,
  .canvas-panel {
    border-radius: 3px;
    box-shadow: 0 6px 18px rgba(20, 34, 71, 0.08);
  }

  .fixed-planner {
    min-height: 0;
    padding: 8px;
  }

  .planner-toolbar {
    position: sticky;
    top: 0;
    z-index: 7;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    padding: 6px 0;
  }

  .tool-buttons {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  .roof-edit-tools {
    flex: 0 0 auto;
  }

  .wind-ballast-tools {
    flex: 0 0 auto;
    min-height: 44px;
  }

  .panel-tool {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .planner-toolbar .panel-tool {
    width: 82px;
    height: 102px;
    min-height: 102px;
  }

  .tool-gap {
    flex: 0 0 8px;
    width: 8px;
  }

  .wind-shadow-directions {
    flex: 0 0 auto;
    grid-template-columns: repeat(4, 34px);
    min-height: 44px;
  }

  .wind-shadow-directions button {
    min-height: 34px;
    font-size: 1rem;
  }

  .auto-ballast-progress {
    grid-template-columns: 1fr auto;
  }

  .auto-ballast-progress-track {
    grid-column: 1 / -1;
    order: 3;
  }

  .roof-canvas-panel {
    padding: 6px;
    overflow: hidden;
  }

  #roofCanvas {
    min-height: 68vh;
    max-height: 78vh;
    object-fit: contain;
    touch-action: none;
  }

  .canvas-controls {
    top: 62px;
    right: 10px;
    flex-direction: column;
    align-items: stretch;
    padding: 4px;
  }

  .zoom-tools {
    display: none;
  }

  .left-stack {
    gap: 10px;
  }

  .panel {
    padding: 12px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  label {
    min-height: 58px;
    font-size: 0.72rem;
  }

  input,
  select {
    min-height: 42px;
    padding: 8px;
    font-size: 16px;
  }

  .fixed-iso-panel {
    max-height: 38vh;
    overflow: hidden;
  }

  #isoCanvas {
    max-height: 32vh;
    object-fit: contain;
  }

  .results-panel {
    position: fixed !important;
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    top: auto !important;
    width: auto !important;
    min-width: 0;
    max-height: 46vh;
    min-height: 0;
    z-index: 25;
    resize: none;
    overflow: auto;
    padding: 10px;
  }

  .results-panel .window-header {
    cursor: default;
    min-height: 28px;
  }

  .window-close {
    width: 44px;
    height: 44px;
    min-height: 44px;
    font-size: 1.15rem;
  }

  .result-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-list div {
    min-width: 0;
  }

  .context-menu {
    left: 8px !important;
    right: 8px;
    top: auto !important;
    bottom: 8px;
    max-height: 72vh;
    min-width: 0;
    overflow: auto;
    z-index: 35;
  }

  .panel-menu-preview svg {
    width: min(252px, calc(100vw - 38px));
  }

  .panel-ballast-popover input[type="range"] {
    min-height: 44px;
  }

  .map-dialog {
    padding: 8px;
  }

  .map-card {
    width: 100%;
    max-height: 96vh;
  }

  .map-stage {
    min-height: 58vh;
  }

  .map-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-controls input[type="search"],
  .map-rotate,
  .map-readout {
    grid-column: span 2;
  }

  .map-rotate {
    grid-template-columns: auto 38px minmax(0, 1fr) 38px;
  }
}

@media (max-width: 430px) {
  .grid {
    grid-template-columns: 1fr;
  }

  label:has(input[type="text"]),
  label:has(input[type="email"]),
  label:has(select) {
    grid-column: span 1;
  }

  .result-list {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 1.08rem;
  }
}
