:root {
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  color-scheme: light;
  font-size: 16px;
  font-synthesis: none;
  /* Titanium blue: neutral silver surfaces, deep-blue actions, mist-blue/sand parts. */
  --ink: #222e3d;
  --brand: #315b88;
  --brand-hover: #26476b;
  --brand-soft: #e7eef7;
  --brand-muted: #8298ae;
  --line: #dce2e8;
  --line-strong: #9cacbf;
  --muted: #667382;
  --canvas: #edf0f3;
  --surface-muted: #f7f9fb;
  --project-surface: #e2e9f1;
  --project-line: #cbd6e2;
  --focus: #527ca5;
  --control-bg: #f7f9fc;
  --control-border: #cbd5e1;
  --control-text: #5c6d80;
  --control-hover-bg: #eaf1f9;
  --control-hover-border: #9bafc5;
  --control-selected-bg: #dce8f6;
  --control-selected-border: #557ba6;
  --control-selected-text: #26476b;
  --control-selected-hover-bg: #cedff2;
  --control-pressed-bg: #bfd3eb;
  --control-disabled-bg: #f1f3f6;
  --control-disabled-text: #9aa5b2;
  --control-radius: 6px;
  --part-blue: #c2d1e2;
  --part-sand-edge: #bdb29f;
  --green: #287a4d;
}
/* Shared site shell: compact links keep every calculator one click away. */
a {
  color: inherit;
}
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.site-header {
  gap: 20px;
  min-height: 48px;
}
.site-header .brand-area {
  flex-shrink: 0;
}
.site-nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin-right: auto;
}
.site-nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  position: relative;
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--muted);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--brand);
}
.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}
.site-nav a:active {
  color: var(--brand-hover);
}
.site-compute {
  flex-shrink: 0;
}
.site-main {
  max-width: 1200px;
  margin: auto;
  padding: 0 32px;
}
.public-page {
  min-height: 100dvh;
  background: var(--surface-muted);
}
.hero {
  padding: 62px 0 34px;
  text-align: center;
}
.hero-kicker {
  display: block;
  color: var(--brand);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.25;
  letter-spacing: -1.5px;
  font-weight: 720;
  color: var(--ink);
}
.hero h1 em {
  font-style: normal;
  color: var(--brand);
}
.hero > p {
  color: var(--muted);
  margin-top: 20px;
}
.hero-pills {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.hero-pills .icon {
  color: #287a4d;
  width: 16px;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.tool-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand-muted);
  border-radius: 12px;
  background: white;
  text-decoration: none;
  box-shadow: 0 4px 16px #142e4b05;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px #142e4b12;
}
.tool-1d {
  border-top-color: var(--part-blue);
}
.tool-nesting {
  border-top-color: var(--part-sand-edge);
}
.tool-card-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 650;
}
.tool-card-label .icon {
  margin-right: 6px;
}
.tool-card-label small {
  color: var(--muted);
  font-size: 12px;
}
.tool-preview {
  display: block;
  width: 100%;
  margin: 18px 0;
}
.tool-card h2 {
  font-size: 15px;
}
.tool-card p {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 22px;
  min-height: 43px;
}
.tool-card-cta {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
}
.home-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  padding: 64px 10px;
}
.home-details h2 {
  font-size: 28px;
  line-height: 1.5;
  margin-bottom: 16px;
}
.home-details p {
  color: var(--muted);
  font-size: 14px;
}
.workflow {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 24px;
}
.workflow li {
  display: flex;
  gap: 18px;
}
.workflow b {
  color: var(--brand-muted);
  font-size: 20px;
}
.workflow h3 {
  font-size: 16px;
  margin-bottom: 6px;
}
.home-callout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 30px;
  border-radius: 12px;
  background: var(--brand-soft);
  margin-bottom: 48px;
}
.home-callout h2 {
  font-size: 20px;
  margin-bottom: 8px;
}
.home-callout p {
  font-size: 14px;
  color: var(--muted);
}
.home-callout .button {
  background: white;
  color: var(--brand);
}
a.button {
  text-decoration: none;
}
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 32px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.information-page {
  min-height: calc(100dvh - 150px);
  padding-bottom: 60px;
}
.page-heading {
  text-align: center;
  padding: 52px 0 36px;
}
.page-heading h1 {
  font-size: 32px;
  line-height: 1.4;
}
.page-heading p {
  margin: 16px 0;
  color: var(--muted);
}
.price-grid {
  max-width: 850px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.price-card {
  background: white;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.price-card.featured {
  border: 2px solid var(--brand-muted);
}
.plan-label {
  display: block;
  color: var(--brand);
  font-size: 13px;
  margin-bottom: 18px;
}
.price {
  font-size: 40px;
  font-weight: 650;
  margin: 24px 0 8px;
}
.price small {
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
}
.price-options {
  color: var(--muted);
  font-size: 13px;
}
.price-card ul {
  padding-left: 20px;
  line-height: 2.2;
  font-size: 14px;
  margin: 24px 0;
}
.plan-pending {
  display: block;
  padding: 12px;
  background: var(--brand-soft);
  border-radius: 6px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.pricing-note {
  max-width: 850px;
  margin: 32px auto 0;
  font-size: 14px;
  color: var(--muted);
}
.pricing-note h2 {
  margin-bottom: 10px;
}
.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.help-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}
.help-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 16px 0;
}
.help-card a {
  color: var(--brand);
  font-size: 14px;
}
.help-faq {
  max-width: 850px;
  margin: 44px auto 0;
}
.help-faq h2 {
  font-size: 24px;
  margin-bottom: 18px;
}
.help-faq details {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.help-faq summary {
  cursor: pointer;
}
.help-faq p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}
@media (max-width: 1100px) {
  .site-header .site-nav {
    min-width: 0;
    flex: 1 1 auto;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .site-header .site-nav a {
    padding: 8px;
  }
}
@media (max-width: 760px) {
  .site-main {
    padding-left: 18px;
    padding-right: 18px;
  }
  .site-header .site-nav {
    gap: 0;
  }
  .site-nav .icon {
    display: none;
  }
  .site-header .site-nav a {
    padding: 8px;
    font-size: 13px;
  }
  .tool-grid,
  .help-grid,
  .price-grid {
    grid-template-columns: 1fr;
  }
  .hero {
    padding-top: 36px;
  }
  .hero-pills {
    gap: 12px;
  }
  .tool-preview {
    max-height: 140px;
  }
  .home-details {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 0;
  }
  .home-callout {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }
  .page-heading h1 {
    font-size: 26px;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.project-dropdown {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  box-shadow:
    0 16px 36px #142e4b26,
    0 3px 8px #142e4b0a;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.project-dropdown::backdrop {
  background: transparent;
}
.project-dropdown-heading {
  padding: 8px 12px 10px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}
.project-dropdown-list {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.project-choice {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: center;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}
.project-choice:hover,
.project-choice.current {
  background: var(--brand-soft);
}
.project-choice-check {
  width: 18px;
  flex: 0 0 18px;
}
.project-choice > span:last-child {
  min-width: 0;
}
.project-choice strong {
  display: block;
  font-size: 15px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.project-choice small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}
.project-dropdown-actions {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 6px;
}
.project-dropdown-actions .button {
  width: 100%;
  justify-content: flex-start;
  padding: 12px;
  border-radius: 9px;
}
.project-dropdown-actions .button:first-child {
  background: var(--brand-soft);
}
.project-dropdown-actions .button:hover:not(:disabled) {
  background: var(--brand-soft);
}
.project-dropdown-empty {
  color: var(--muted);
  padding: 12px;
  font-size: 14px;
}
.project-dropdown-trash {
  font-size: 13px;
  padding: 10px 12px;
}
.project-dropdown-trash summary {
  cursor: pointer;
  color: var(--muted);
}
.project-dropdown-footnote {
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  padding: 12px 8px 4px;
  font-size: 12px;
  margin-top: 6px;
}
.project-title[aria-expanded="true"] .icon {
  transform: rotate(180deg);
}
.project-empty {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 22px;
  padding: 32px;
}
.project-empty h1 {
  font-size: 26px;
}
.project-empty p {
  color: var(--muted);
}
.project-context .new-project {
  color: var(--brand);
  border: 1px solid var(--line-strong);
  background: white;
}
.save-status {
  border: 0;
  background: none;
  font-size: 12px;
  color: #61796c;
  padding: 8px;
  cursor: default;
}
.save-status.save-error {
  color: #a13035;
  cursor: pointer;
  text-decoration: underline;
}
.project-more {
  font-weight: 700;
  font-size: 18px;
}
.project-entry {
  display: flex;
  align-items: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  margin: 10px 0;
}
.project-entry.current {
  border-color: var(--line-strong);
  background: var(--brand-soft);
}
.project-entry .saved-project {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  margin: 0;
  text-align: left;
}
.project-entry .saved-project strong {
  overflow-wrap: anywhere;
}
.project-entry .saved-project span {
  font-size: 12px;
}
.project-entry-menu {
  flex: 0 0 auto;
  border: 0;
}
.project-entry-menu summary {
  padding: 8px 12px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}
.project-entry-menu > div {
  display: flex;
  flex-direction: column;
}
.danger-text {
  color: #a13035;
}
.deleted-projects {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.deleted-projects summary {
  cursor: pointer;
  color: var(--muted);
}
.deleted-project {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding: 10px 0;
}
.deleted-project > span {
  overflow-wrap: anywhere;
}
#project-form .hint {
  margin: 14px 0;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
button,
input,
select,
textarea {
  color: inherit;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
button {
  touch-action: manipulation;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.4px;
}
h2 {
  font-size: 1rem;
  font-weight: 600;
}
p {
  line-height: 1.65;
}
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
}
.muted {
  color: var(--muted);
}
.loading {
  padding: 32px;
}
.topbar {
  min-height: 48px;
  background: var(--surface-muted);
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 6px 24px;
}
.brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.brand-logo {
  display: block;
  flex: 0 0 auto;
  width: 174px;
  height: 29px;
}
.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
}
@media (max-width: 420px) {
  .brand-logo {
    width: 32px;
  }
}
.header-separator {
  height: 22px;
  border-left: 1px solid var(--line);
  margin: 0 8px;
}
.project-title {
  background: none;
  border: 0;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.875rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
}
.button:hover:not(:disabled) {
  background: var(--brand-soft);
}
.button.primary,
.run-button {
  background: var(--brand);
  color: white;
  padding-left: 18px;
  padding-right: 18px;
}
.button.primary:hover:not(:disabled),
.button.run-button:hover:not(:disabled) {
  background: var(--brand-hover);
  color: #fff;
}
.stop-button {
  background: #fff;
  color: #8b3232;
}
.icon-only {
  padding: 8px;
  min-width: 36px;
}
.icon-button {
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 34px;
  border-radius: 5px;
}
.icon-button:hover {
  background: var(--brand-soft);
}
.mode-nav {
  display: flex;
  gap: 36px;
  padding: 0 26px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  align-items: stretch;
}
.mode-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  padding: 16px 2px 13px;
}
.mode-tab .icon {
  width: 21px;
  height: 21px;
}
.mode-tab strong {
  font-size: 0.9375rem;
  font-weight: 600;
  display: block;
}
.mode-tab small {
  display: block;
  font-size: 0.75rem;
  margin-top: 3px;
  color: var(--muted);
}
.mode-tab.active {
  border-bottom-color: var(--brand);
  color: var(--brand);
}
.local-note {
  margin-left: auto;
  align-self: center;
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  min-height: calc(100vh - 205px);
}
.canvas {
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.canvas-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}
.canvas-actions .button {
  color: var(--muted);
  white-space: nowrap;
}
.sheet-select {
  width: 150px;
  min-width: 0;
  max-width: 100%;
  background-color: #fff;
}
.result-banner {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}
.result-banner.valid .result-state {
  color: var(--green);
}
.drawing-area {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  isolation: isolate;
}
.drawing-viewport {
  min-height: 420px;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  position: relative;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.layout-svg {
  display: block;
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  overflow: hidden;
  font-family: inherit;
}
.layout-svg [data-shape] {
  cursor: pointer;
}
.stale .layout-svg {
  opacity: 0.55;
}
.empty-canvas {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
  max-width: 440px;
  padding: 20px;
}
.empty-art {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 18px;
  margin-bottom: 8px;
}
.empty-art .icon {
  width: 40px;
  height: 40px;
  stroke-width: 1.2;
}
.empty-canvas h2 {
  font-size: 1.25rem;
}
.empty-canvas p {
  font-size: 0.875rem;
  color: var(--muted);
}
.empty-canvas > span {
  font-size: 0.75rem;
  color: var(--muted);
}
.tool-group {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.tool-divider {
  height: 20px;
  border-left: 1px solid var(--line);
  margin: 0 3px;
}
.zoom-label {
  min-width: 42px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.canvas-summary {
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  display: grid;
  grid-template-columns: auto repeat(3, max-content) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.canvas-summary > span {
  white-space: nowrap;
}
.canvas-summary .run-button,
.canvas-summary .stop-button {
  min-width: 112px;
}
.canvas-summary strong {
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand);
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
}
.partial-warning {
  margin: 10px 24px 0;
  padding: 12px 15px;
  border: 1px solid #e7cf9f;
  border-radius: 6px;
  background: #fff7e7;
  color: #805b1d;
  font-size: 0.8125rem;
  line-height: 1.6;
}
.inspector {
  background: var(--surface-muted);
  border-left: 1px solid var(--line);
  min-width: 0;
}
.inspector-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 19px 8px;
}
.inspector-tabs {
  display: flex;
  padding: 0 18px;
  gap: 21px;
  border-bottom: 1px solid var(--line);
}
.inspector-tabs button {
  padding: 12px 0 11px;
  font-size: 0.875rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
}
.inspector-tabs button.active {
  border-bottom-color: var(--brand);
  color: var(--brand);
  font-weight: 600;
}
.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px 7px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.list-heading {
  flex-wrap: wrap;
}
.list-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}
.list-actions .button {
  color: var(--brand);
  background: var(--brand-soft);
  border-color: #bdcde0;
  padding: 7px 10px;
  box-shadow: 0 1px 2px #223e5d0a;
}
.list-actions .button:hover:not(:disabled) {
  color: var(--brand-hover);
  background: #dbe7f5;
  border-color: var(--brand);
}
.list-actions .button:active:not(:disabled) {
  background: #cfdfef;
  box-shadow: inset 0 1px 2px #223e5d1a;
}
.edit-row {
  padding: 12px 18px 17px;
  border-bottom: 1px solid var(--line);
}
.edit-row.highlight {
  background: var(--brand-soft);
}
.row-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}
.part-swatch {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  border-radius: 3px;
}
.name-input {
  border: 0 !important;
  background: transparent !important;
  padding: 6px 2px !important;
  min-width: 0;
  font-weight: 500;
}
.row-head .name-input {
  flex: 1;
  width: 100%;
}
.input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.input-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}
.field-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field-label > span {
  font-size: 0.8125rem;
  color: var(--muted);
}
.field-label input,
.field-label select,
.field-label textarea,
input:not([type="file"]):not([type="checkbox"]),
select {
  border: 1px solid var(--line);
  background: var(--surface-muted);
  border-radius: 5px;
  padding: 8px 9px;
  min-width: 0;
  width: 100%;
  font-size: 0.875rem;
}
input:focus,
textarea:focus,
select:focus {
  background: #fff;
}
.field-label textarea {
  resize: vertical;
  min-height: 110px;
  font:
    12px/1.6 Consolas,
    monospace;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m2 2 4 4 4-4' fill='none' stroke='%23667382' stroke-width='1.4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
details {
  margin-top: 12px;
}
summary {
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
}
details[open] summary {
  margin-bottom: 13px;
}
.advanced-fields {
  display: grid;
  gap: 13px;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}
.check input {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
}
.hint,
.panel-footnote {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.7;
}
.panel-footnote {
  padding: 17px 18px;
}
.settings-body {
  display: grid;
  gap: 20px;
  padding: 22px 19px;
}
.info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 15px 0;
  color: var(--muted);
  font-size: 0.8125rem;
  border-top: 1px solid var(--line);
  line-height: 1.65;
}
.info-box p {
  margin-top: 10px;
}
.cut-list {
  padding: 8px 18px 20px;
}
.cut-step {
  display: flex;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.cut-step {
  border-radius: 6px;
}
.cut-step.is-previewing {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 var(--brand);
}
.cut-step.is-previewing .step-number {
  color: #fff;
  background: var(--brand);
}
.cut-step:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.cut-preview {
  pointer-events: none;
}
.cut-preview-halo {
  stroke: #fff;
  stroke-width: 7px;
  opacity: 0.9;
}
.cut-preview-track {
  stroke: #e6b482;
  stroke-width: 3px;
}
.cut-preview-stroke {
  stroke: #bd5b12;
  stroke-width: 3px;
}
.step-number {
  font-size: 0.75rem;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 5px;
}
.cut-step strong {
  font-size: 0.875rem;
  font-weight: 500;
}
.cut-step p {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}
.empty-panel {
  padding: 24px 19px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.7;
}
.app-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 16px;
  background: #fff;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}
.app-footer .button {
  font-size: 0.75rem;
  min-height: 30px;
  padding: 4px 8px;
  gap: 5px;
}
.app-footer .icon-only {
  min-width: 30px;
  padding: 4px;
}
.app-footer .icon {
  width: 16px;
  height: 16px;
}
.app-footer > .button[data-action="help"] {
  margin-left: auto;
}
.notification {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  max-width: min(720px, calc(100% - 32px));
  padding: 13px 20px;
  background: var(--ink);
  color: white;
  border-radius: 8px;
  box-shadow: 0 8px 28px #142e4b33;
  font-size: 0.875rem;
  z-index: 20;
  line-height: 1.6;
  cursor: pointer;
}
.notification.error {
  background: #8a3039;
}
.notification[hidden] {
  display: none;
}
dialog {
  width: min(590px, calc(100% - 32px));
  max-height: 85vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 20px 80px #142e4b40;
}
dialog::backdrop {
  background: #142e4b70;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 15px;
}
.dialog-head h2 {
  font-size: 1.125rem;
}
dialog p {
  margin: 12px 0;
  font-size: 0.875rem;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}
dialog .button:not(.primary) {
  background: var(--brand-soft);
}
dialog hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}
dialog ol {
  padding-left: 23px;
  line-height: 1.85;
  font-size: 0.875rem;
}
.project-list {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}
.saved-project {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 6px;
  text-align: left;
}
.saved-project strong {
  font-size: 0.9375rem;
  font-weight: 500;
}
.saved-project span {
  font-size: 0.75rem;
  color: var(--muted);
}
@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 420px;
  }
  .topbar,
  .mode-nav {
    padding-left: 36px;
    padding-right: 36px;
  }
}
@media (max-width: 1100px) {
  .topbar {
    gap: 12px;
    padding: 6px 20px;
  }
  .header-actions {
    margin-left: auto;
    gap: 2px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
  .mode-nav {
    gap: 20px;
    padding: 0 20px;
  }
  .local-note {
    display: none;
  }
  .header-separator,
  .project-title {
    display: none;
  }
  .inspector-tabs {
    gap: 17px;
  }
  .input-grid {
    gap: 7px;
  }
  .edit-row {
    padding-left: 14px;
    padding-right: 14px;
  }
}
@media (max-width: 760px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .inspector {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .mode-nav {
    gap: 16px;
    justify-content: space-between;
    padding: 0 14px;
  }
  .mode-tab {
    gap: 7px;
    align-items: flex-start;
  }
  .mode-tab strong {
    font-size: 0.8125rem;
  }
  .mode-tab small {
    font-size: 0.75rem;
    max-width: 110px;
  }
  .mode-tab .icon {
    width: 17px;
    height: 17px;
    margin-top: 2px;
  }
  .header-actions {
    width: 100%;
    justify-content: space-between;
  }
  .header-actions .button {
    font-size: 0.8125rem;
    padding: 9px 7px;
  }
  .topbar {
    padding: 5px 14px;
  }
  .drawing-viewport {
    min-height: 310px;
  }
  .inspector-content {
    max-height: none;
  }
  .edit-row {
    padding: 16px 20px;
  }
  .input-grid {
    gap: 13px;
  }
}
@media (max-width: 420px) {
  .mode-tab {
    flex-direction: column;
    gap: 5px;
  }
  .mode-tab strong {
    font-size: 0.75rem;
  }
  .mode-nav {
    gap: 10px;
  }
  .header-actions .button .icon {
    width: 15px;
    height: 15px;
  }
  .header-actions .button {
    gap: 4px;
  }
  .header-actions [data-action="projects"] {
    font-size: 0;
  }
  .header-actions [data-action="projects"] .icon {
    width: 20px;
    height: 20px;
  }
  .canvas-summary strong {
    font-size: 0.9375rem;
  }
}
@media (pointer: coarse) {
  button,
  .button,
  .icon-button {
    min-height: 44px;
  }
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
  .part-swatch {
    width: 12px;
    height: 12px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition: background-color 0.15s ease;
  }
  .stale .layout-svg {
    transition: opacity 0.15s ease;
  }
}

.hybrid-controls {
  margin: 0 28px 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: 0.8125rem;
}
.hybrid-controls label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hybrid-controls select {
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface-muted);
}
.hybrid-controls > span {
  color: var(--muted);
}
.hybrid-summary,
.hybrid-warning {
  flex-basis: 100%;
  margin: 0;
  line-height: 1.6;
}
.hybrid-warning {
  color: #805b1d;
}
@media (max-width: 760px) {
  .hybrid-controls {
    margin: 0 14px 12px;
  }
}

/* Keep calculation beside the task modes, independently of the file toolbar. */
.mode-tabs {
  display: flex;
  align-items: stretch;
  gap: 36px;
  min-width: 0;
}
.mode-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}
.mode-actions .local-note {
  margin-left: 0;
}
.mode-actions .stop-button {
  border-color: #e3bbbb;
}
.mode-actions .stop-button:hover:not(:disabled) {
  background: #fff1f1;
}
@media (max-width: 1100px) {
  .mode-tabs {
    gap: 20px;
  }
}
@media (max-width: 760px) {
  .mode-nav {
    gap: 12px;
  }
  .mode-tabs {
    flex: 1;
    gap: 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  .mode-tabs .mode-tab {
    flex-shrink: 0;
  }
  .mode-actions {
    gap: 0;
  }
  .mode-actions .button {
    padding: 9px 10px;
    font-size: 0.8125rem;
  }
}
@media (max-width: 420px) {
  .mode-nav {
    gap: 8px;
  }
  .mode-tabs {
    gap: 12px;
  }
}

.optimization-offer {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 16px;
  right: 16px;
  max-height: calc(100% - 24px);
  overflow-y: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 18px rgb(34 46 61 / 8%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgb(231 238 247 / 82%);
  color: var(--brand-hover);
}
.optimization-offer > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}
.optimization-offer strong {
  font-size: 0.9375rem;
}
.optimization-offer p {
  margin: 5px 0 0;
  font-size: 0.8125rem;
  color: var(--muted);
}
.optimization-offer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.optimization-offer-actions .icon-button {
  color: var(--brand-hover);
}
.optimization-offer .button {
  flex-shrink: 0;
}
@container (max-width: 660px) {
  .optimization-offer {
    left: 8px;
    right: 8px;
    padding: 12px;
    gap: 10px;
    flex-wrap: wrap;
  }
  .optimization-offer-actions {
    margin-left: auto;
  }
}

/* Task type owns its project and file operations. */
.brand-caption {
  font-size: 0.8125rem;
  color: var(--muted);
}
.project-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  padding: 4px 24px;
  background: var(--project-surface);
  border-top: 1px solid var(--project-line);
  border-bottom: 1px solid var(--project-line);
  min-height: 42px;
}
.project-context {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.project-scope {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.project-divider {
  color: var(--muted);
}
.project-toolbar .project-title {
  display: flex;
  color: var(--ink);
  padding: 3px 0;
  min-width: 0;
  max-width: 320px;
}
.project-title > span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.project-actions .button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.8125rem;
  border-color: var(--project-line);
  background: var(--surface-muted);
}
.project-actions .button .icon {
  width: 16px;
  height: 16px;
}
.project-actions .save-status {
  padding: 4px 8px;
}
.project-context {
  flex: 1 1 auto;
}
.project-actions .project-more {
  min-width: 30px;
}
.project-actions .button:hover:not(:disabled) {
  background: #fff;
  border-color: var(--brand-muted);
}
@media (min-width: 1600px) {
  .project-toolbar {
    padding-left: 36px;
    padding-right: 36px;
  }
}
@media (max-width: 1100px) {
  .project-toolbar {
    padding-left: 20px;
    padding-right: 20px;
  }
}
@media (max-width: 760px) {
  .project-toolbar {
    flex-wrap: wrap;
    padding: 5px 14px;
    gap: 4px 12px;
  }
  .project-context {
    width: 100%;
  }
  .project-toolbar .project-title {
    flex: 1;
    max-width: none;
  }
  .project-actions {
    width: 100%;
    min-width: 0;
  }
  .project-actions .save-status {
    margin-right: auto;
    padding-left: 0;
    font-size: 11px;
  }
  .project-actions .button {
    padding: 5px 8px;
  }
  .brand-caption {
    font-size: 0.75rem;
  }
}
@media (pointer: coarse) {
  .project-actions .button,
  .project-actions .save-status,
  .project-toolbar .project-title {
    min-height: 44px;
  }
}

/* Settings scroll inside their own panel; scroll boundaries never move the canvas. */
.inspector {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.inspector-top,
.inspector-tabs {
  flex: 0 0 auto;
}
.inspector-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
}
@media (min-width: 761px) {
  #app.calculator-page {
    height: 100vh;
    height: 100dvh;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
  }
  .workspace {
    min-height: 0;
    overflow: hidden;
  }
  .canvas {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
  .canvas > * {
    flex-shrink: 0;
  }
  .drawing-viewport {
    min-height: 260px;
  }
}
@media (max-width: 760px) {
  .inspector {
    height: 70vh;
    height: 70dvh;
  }
}

/* Compact project-level unit selector; keep the existing titanium-blue hierarchy. */
.inspector-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.unit-switch {
  display: flex;
  padding: 3px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.unit-switch button {
  min-width: 38px;
  min-height: 28px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.unit-hint {
  flex: 0 0 auto;
  margin: 0;
  padding: 2px 19px 5px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

/* Keep status visible without squeezing the metrics on narrow canvases. */
.canvas {
  container-type: inline-size;
}
@container (max-width: 780px) {
  .canvas-summary {
    grid-template-columns: auto repeat(3, minmax(0, 1fr));
    column-gap: 12px;
    row-gap: 6px;
  }
  .result-banner {
    grid-column: 1 / 3;
    align-items: flex-start;
    text-align: left;
  }
  .canvas-actions {
    grid-column: 3 / -1;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
  }
  .sheet-select {
    width: 130px;
  }
}
@container (max-width: 480px) {
  .canvas-summary {
    column-gap: 8px;
    font-size: 0.75rem;
  }
  .canvas-summary .run-button,
  .canvas-summary .stop-button {
    min-width: 96px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .canvas-summary strong {
    margin-left: 3px;
    font-size: 0.875rem;
  }
  .result-banner {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
  }
  .canvas-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
  }
  .sheet-select {
    width: 175px;
  }
}

@media (max-width: 420px) {
  .project-actions .save-status {
    min-width: 0;
    flex: 1 1 0;
    text-align: left;
  }
}

/* Canvas controls share the persistent status bar instead of consuming drawing space. */
@media (max-width: 760px) {
  .app-footer {
    padding: 4px 10px;
    gap: 6px;
    justify-content: space-between;
  }
}
@media (max-width: 480px) {
  .app-footer > .button[data-action="help"] {
    font-size: 0;
    gap: 0;
  }
  .app-footer .tool-group .button:not(.icon-only) .icon {
    display: none;
  }
  .app-footer .tool-group .button {
    padding-left: 6px;
    padding-right: 6px;
  }
  .app-footer .zoom-label {
    min-width: 36px;
  }
}
@media (pointer: coarse) {
  .app-footer .button {
    min-height: 44px;
    min-width: 44px;
  }
}

/* A compact language control belongs to site navigation, not project settings. */
.language-switch {
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 8px;
}
.language-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.language-trigger > .icon:first-child {
  width: 17px;
  height: 17px;
}
.language-trigger > .icon:last-child {
  width: 13px;
  height: 13px;
}
.language-trigger:hover,
.language-trigger[aria-expanded="true"] {
  color: var(--brand);
  background: var(--brand-soft);
}
.language-trigger:focus-visible,
.language-option:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.language-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 6px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 28px #222e3d1f;
}
.language-menu::backdrop {
  background: transparent;
}
.language-heading {
  padding: 6px 10px 8px;
  color: var(--muted);
  font-size: 11px;
}
.language-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.language-option[aria-current="true"] {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}
.language-option:hover {
  background: var(--surface-muted);
}
.language-option .icon {
  width: 16px;
  height: 16px;
}
html[lang="en"] .inspector-tabs {
  gap: 0;
}
html[lang="en"] .inspector-tabs button {
  flex: 1;
  padding-inline: 5px;
  font-size: 12px;
}
html[lang="en"] .site-nav {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
@container (max-width: 480px) {
  html[lang="en"] .canvas-summary > span {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  html[lang="en"] .canvas-summary > span strong {
    margin-left: 0;
  }
}
@media (max-width: 700px) {
  .language-switch {
    padding-left: 2px;
  }
  .language-trigger {
    gap: 3px;
    padding-inline: 4px;
  }
  .language-trigger > .icon:first-child {
    display: none;
  }
}

.language-option {
  box-sizing: border-box;
  text-decoration: none;
}
.project-empty > p {
  max-width: 620px;
  margin-inline: auto;
}

.strategy-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px 7px;
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--muted);
}
.strategy-selector > span {
  flex-shrink: 0;
}
.strategy-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.strategy-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.25;
}
.strategy-option input[type="radio"] {
  appearance: auto;
  flex: 0 0 13px;
  width: 13px;
  height: 13px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.stock-material-price {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
}
.stock-cost {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

/* One state system for canvas toggles, optimization choices and units.
   Component rules above own geometry only; selection is distinct from hover. */
#app :is(.tool-group .button, .unit-switch button, .strategy-option) {
  border: 1px solid var(--control-border);
  border-radius: var(--control-radius);
  background: var(--control-bg);
  color: var(--control-text);
  box-shadow: none;
  font-weight: 500;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}
#app
  :is(
    .tool-group .button[aria-pressed="true"],
    .unit-switch button[aria-pressed="true"],
    .strategy-option:has(input:checked)
  ) {
  background: var(--control-selected-bg);
  border-color: var(--control-selected-border);
  color: var(--control-selected-text);
}
@media (hover: hover) {
  #app
    :is(.tool-group .button, .unit-switch button, .strategy-option):hover:not(:disabled):not(
      :has(input:disabled)
    ):not([aria-disabled="true"]) {
    background: var(--control-hover-bg);
    border-color: var(--control-hover-border);
    color: var(--brand);
  }
  #app
    :is(
      .tool-group .button[aria-pressed="true"],
      .unit-switch button[aria-pressed="true"],
      .strategy-option:has(input:checked)
    ):hover:not(:disabled):not(:has(input:disabled)):not([aria-disabled="true"]) {
    background: var(--control-selected-hover-bg);
    border-color: var(--brand);
    color: var(--control-selected-text);
  }
}
#app
  :is(.tool-group .button, .unit-switch button, .strategy-option):active:not(:disabled):not(
    :has(input:disabled)
  ):not([aria-disabled="true"]),
#app
  :is(
    .tool-group .button[aria-pressed="true"],
    .unit-switch button[aria-pressed="true"],
    .strategy-option:has(input:checked)
  ):active:not(:disabled):not(:has(input:disabled)):not([aria-disabled="true"]) {
  background: var(--control-pressed-bg);
  border-color: var(--brand);
  color: var(--control-selected-text);
}
#app :is(.tool-group .button, .unit-switch button, .strategy-option):focus-visible,
#app .strategy-option:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
#app .strategy-option input:focus-visible {
  outline: none;
}
#app
  :is(
    .tool-group .button:disabled,
    .unit-switch button:disabled,
    .strategy-option:has(input:disabled)
  ) {
  background: var(--control-disabled-bg);
  border-color: var(--line);
  color: var(--control-disabled-text);
  opacity: 1;
  cursor: not-allowed;
}
@media (prefers-reduced-motion: reduce) {
  #app :is(.tool-group .button, .unit-switch button, .strategy-option) {
    transition: none;
  }
}
