:root {
  font-family: 'Inter', 'Yu Gothic UI', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  color: #283e35;
  background: #f8f8f4;
  font-synthesis: none;
  --ink: #243f34;
  --muted: #647169;
  --paper: #f8f8f4;
  --line: #daddd4;
  --deep: #294b3c;
  --accent: #ab5135;
  --white: #fffefa;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
svg:focus-visible {
  outline: 3px solid #b96c43;
  outline-offset: 3px;
}
button {
  border: 0;
  background: none;
}
input,
select,
textarea {
  color: #263e33;
}
input[type='checkbox'],
input[type='range'] {
  accent-color: #3d6650;
}
button,
.tool-card {
  touch-action: manipulation;
}
button:disabled:hover {
  transform: none;
}
.icon {
  display: inline-block;
  flex: none;
  vertical-align: middle;
}
.skip {
  position: fixed;
  left: 10px;
  top: -80px;
  z-index: 10;
  background: white;
  padding: 10px;
  color: var(--ink);
}
.skip:focus {
  top: 10px;
}
#header {
  height: 78px;
  border-bottom: 1px solid var(--line);
  background: #fdfdf9;
}
.head-inner {
  max-width: 1472px;
  padding: 0 clamp(20px, 5%, 82px);
  height: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  gap: clamp(18px, 4.6vw, 85px);
}
.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  padding: 0;
  text-align: left;
  flex: none;
}
.brand img {
  width: 39px;
  height: 39px;
}
.brand b {
  display: block;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 31px;
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -1.35px;
  color: #253e31;
}
.brand small {
  display: block;
  margin-top: 5px;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.13em;
  font-weight: 600;
}
.head-inner nav {
  display: flex;
  align-self: stretch;
  gap: clamp(8px, 1.2vw, 23px);
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  font-size: 14px;
  font-weight: 600;
  color: #637066;
  white-space: nowrap;
}
.nav-item.current {
  color: #2e503e;
}
.nav-item.current:after {
  content: '';
  position: absolute;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #53725b;
  left: 5px;
  right: 5px;
}
.nav-item:hover,
.iconbtn:hover,
.text-btn:hover {
  background: #e9eee6;
}
.head-right {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}
.device {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #526b56;
  background: #edf2e8;
  padding: 6px 11px;
  border: 1px solid #dce5d6;
  border-radius: 30px;
  white-space: nowrap;
}
.iconbtn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 7px;
}
.mobile-menu {
  display: none;
}
.workspace {
  max-width: 1410px;
  padding: 34px clamp(28px, 6%, 92px) 56px;
  margin: auto;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 23px;
}
.page-heading h1 {
  font-size: clamp(26px, 2.32vw, 36px);
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 1.4;
  color: #253a30;
}
.today,
.sub {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #66736a;
  font-size: 13px;
  margin-top: 7px;
}
.btn,
.text-btn,
.buttons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn,
.text-btn {
  font-weight: 650;
}
.btn {
  border-radius: 7px;
  min-height: 41px;
  padding: 9px 16px;
  font-size: 14px;
  line-height: 1.4;
}
.primary {
  background: var(--accent);
  border: 1px solid #9e4a31;
  color: white;
  box-shadow: 0 1px 2px #63341919;
}
.primary:hover {
  background: #93422b;
}
.page-heading > .primary {
  min-height: 45px;
  padding: 10px 20px;
}
.ink {
  color: #fff;
  background: var(--deep);
  border: 1px solid var(--deep);
}
.ink:hover {
  background: #1f392d;
}
.secondary {
  border: 1px solid #cdd3c9;
  background: #fffef9;
}
.secondary:hover {
  background: #f0f3eb;
}
.text,
.text-btn {
  color: #45604c;
  min-height: 38px;
  border-radius: 5px;
}
.text-btn {
  font-size: 14px;
  padding: 6px 2px 6px 10px;
}
.tiny {
  background: #284c39;
  color: white;
  padding: 4px 8px;
  min-height: 30px;
  font-size: 12px;
}
.buttons {
  flex-wrap: wrap;
}
.hero {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  min-height: clamp(254px, 22.5vw, 324px);
  display: flex;
  align-items: center;
  border: 1px solid #d5d8ca;
  border-radius: 12px;
  background-color: #eeeede;
  background-image:
    linear-gradient(#b5b7a31c 1px, transparent 1px), linear-gradient(90deg, #b5b7a31c 1px, transparent 1px);
  background-size: 22px 22px;
}
.hero-art {
  position: absolute;
  inset: 0 0 0 36%;
  z-index: -1;
  background: #f7f2e6;
}
.hero-art img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: 50% 53%;
  mix-blend-mode: multiply;
}
.hero-art:before {
  content: '';
  position: absolute;
  z-index: 1;
  inset: 0 auto 0 0;
  width: 22%;
  background: linear-gradient(90deg, #eeeede 1%, #eeeede00);
}
.hero-copy {
  position: relative;
  width: 48%;
  padding: 30px 0 32px clamp(26px, 3.3vw, 54px);
  text-shadow: 0 1px 8px #f3f2e2;
}
.sample-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #c9d3be;
  border-radius: 5px;
  padding: 4px 9px;
  background: #f5f6ebd9;
  color: #53694d;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.025em;
}
.hero h2 {
  font-family: 'Yu Mincho', 'Hiragino Mincho ProN', 'MS PMincho', serif;
  font-weight: 600;
  font-size: clamp(32px, 3.25vw, 50px);
  line-height: 1.42;
  margin: 11px 0 9px;
  letter-spacing: 0.025em;
  color: #253e30;
}
.hero p {
  font-size: 14px;
  color: #4d5e4e;
  line-height: 1.85;
  font-weight: 500;
}
.hero .btn {
  margin-top: 22px;
  padding: 10px 18px;
}
.home-section {
  margin-top: 30px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  min-height: 29px;
}
.section-head h2 {
  line-height: 1.5;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.055em;
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.tool-card {
  background: var(--white);
  overflow: hidden;
  border: 1px solid #d5dbd2;
  border-radius: 10px;
  text-align: left;
  padding: 0;
  transition:
    box-shadow 0.18s,
    transform 0.18s,
    border-color 0.18s;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: #a4b29e;
  box-shadow: 0 4px 14px #34513a12;
}
.tool-picture {
  position: relative;
  height: clamp(107px, 10vw, 154px);
  overflow: hidden;
  border-bottom: 1px solid #d9ded1;
}
.tool-picture img {
  display: block;
  height: 100%;
  width: 100%;
  object-fit: cover;
}
.tool-code {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: absolute;
  top: 11px;
  left: 12px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  padding: 5px 7px;
  color: #42574a;
  background: #fffcf2d9;
  border: 1px solid #b9c4b3;
  border-radius: 4px;
}
.tool-card:nth-child(2) .tool-code {
  color: #795943;
  border-color: #cec0ad;
}
.tool-card:nth-child(3) .tool-code {
  color: #536068;
  border-color: #bfc8c9;
}
.tool-body {
  padding: 15px 17px 13px;
}
.tool-title {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}
.tool-title h3 {
  font-size: clamp(16px, 1.45vw, 21px);
  letter-spacing: 0.015em;
  color: #2f4135;
}
.tool-title .icon {
  color: #7b8a7b;
}
.tool-body > p {
  font-size: 13px;
  color: #69736b;
  line-height: 1.6;
  margin-top: 4px;
}
.phase-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #73776d;
  font-weight: 500;
  font-size: 11px;
  margin-top: 10px;
}
.phase-dot:before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aaaba1;
}
.phase-dot.available {
  color: #58704d;
}
.phase-dot.available:before {
  background: #6c865e;
}
.recent {
  margin-top: 26px;
}
.project-rows,
.empty {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fffefa;
  overflow: hidden;
}
.empty {
  display: flex;
  align-items: center;
  gap: 15px;
  min-height: 94px;
  padding: 18px 22px;
}
.empty-icon,
.row-thumb {
  flex: none;
  display: grid;
  place-items: center;
  background: #eaf0e6;
  color: #57715b;
  border-radius: 8px;
}
.empty-icon {
  width: 48px;
  height: 48px;
}
.empty strong {
  font-size: 14px;
  color: #4c5e4e;
}
.empty p,
.small-note {
  font-size: 13px;
  line-height: 1.75;
  color: #6a7269;
  margin: 3px 0 0;
}
.project-row {
  display: flex;
  align-items: center;
  text-align: left;
  width: 100%;
  gap: 16px;
  min-height: 74px;
  padding: 12px 18px;
}
.project-row + .project-row {
  border-top: 1px solid var(--line);
}
.project-row:hover {
  background: #f2f4ed;
}
.row-thumb {
  width: 50px;
  height: 44px;
  background-size: cover;
}
.with-cover {
  background-image: url('./assets/courtyard.jpg');
}
.row-title {
  flex: 1;
  min-width: 0;
}
.row-title > b,
.row-title > small {
  display: block;
  overflow-wrap: anywhere;
}
.row-title > small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}
.project-row time {
  color: var(--muted);
  font-size: 13px;
}
.tag {
  display: inline-block;
  border: 1px solid #d7e0cf;
  background: #eef2e7;
  color: #526549;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 12px;
}
.filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
}
.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #cbd3c6;
  border-radius: 7px;
  padding: 0 12px;
  background: var(--white);
}
.search input {
  border: none;
  min-width: 0;
  background: transparent;
  width: 100%;
  height: 43px;
}
dialog {
  width: min(480px, calc(100vw - 26px));
  max-height: 85dvh;
  overflow: auto;
  border: 1px solid #d0d5c8;
  background: #fdfdf8;
  color: var(--ink);
  padding: 23px;
  border-radius: 14px;
  box-shadow: 0 16px 80px #172d2522;
}
dialog::backdrop {
  background: #1a2b235f;
  backdrop-filter: blur(2px);
}
.modal-head,
.inspect-heading,
.tool-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head {
  margin-bottom: 18px;
}
.modal-head h2 {
  font-size: 21px;
}
.modal-head .iconbtn {
  margin: -7px -6px -7px 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 23px;
}
.field {
  font-size: 13px;
  font-weight: 650;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 13px 0;
}
.field input,
.field select,
.field textarea,
.filters select {
  background: #fffefa;
  border: 1px solid #cbd3c6;
  padding: 9px 10px;
  border-radius: 6px;
  font-weight: 450;
  min-width: 0;
  min-height: 40px;
}
.field textarea {
  resize: vertical;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.two-col .field {
  margin: 0;
}
.menu-list {
  display: grid;
  gap: 10px;
}
.menu-list > .btn {
  justify-content: flex-start;
  min-height: 46px;
}
.feature-intro p,
dialog > p {
  font-size: 15px;
  line-height: 1.85;
  margin: 12px 0;
}
.feature-intro ul {
  padding-left: 22px;
  line-height: 1.9;
  font-size: 14px;
}
.setting-info {
  border-block: 1px solid var(--line);
  margin: 20px 0 12px;
}
.setting-info > div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  font-size: 13px;
}
.setting-info strong {
  margin-left: auto;
}
.warning {
  padding: 12px;
  background: #fff2db;
  color: #7a432a;
  border: 1px solid #d8b991;
  border-radius: 6px;
  margin: 6px 0;
  font-size: 14px;
}
#toast {
  position: fixed;
  z-index: 30;
  max-width: calc(100% - 24px);
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 19px;
  background: #263f33;
  color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px #253c3029;
  font-size: 14px;
  pointer-events: none;
}
[hidden] {
  display: none !important;
}
.editor {
  height: calc(100dvh - 78px);
  min-height: 350px;
  display: flex;
  flex-direction: column;
}
.editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 18px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  min-height: 70px;
}
.editor-title,
.edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.editor-title {
  min-width: 0;
}
.editor-title > div {
  min-width: 0;
}
.editor-title h1 {
  font-size: 19px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editor-title small {
  color: #677368;
  font-size: 12px;
}
.editor-title small > span {
  margin-left: 4px;
}
.bad {
  color: #9b3c2a;
}
.divider {
  height: 24px;
  border-left: 1px solid var(--line);
}
.editor-layout {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 235px;
  min-height: 0;
  flex: 1;
}
.tools,
#inspector {
  background: #fbfcf7;
  min-height: 0;
  overflow: auto;
}
.tools {
  border-right: 1px solid var(--line);
  padding: 10px 8px;
}
.tool-caption {
  margin-bottom: 12px;
  padding-left: 5px;
  font-size: 13px;
}
.tool-caption .iconbtn {
  width: 30px;
  height: 32px;
}
.tools > button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  width: 100%;
  border-radius: 6px;
  font-size: 14px;
  text-align: left;
  min-height: 43px;
  margin-bottom: 4px;
}
.tools > button.on,
.floor-tabs .on {
  background: #dce8d8;
  color: #244a32;
  font-weight: bold;
}
.tools-folded .editor-layout {
  grid-template-columns: 52px minmax(0, 1fr) 235px;
}
.tools-folded .tools > button {
  padding: 10px 7px;
}
.tools-folded .tools > button span,
.tools-folded .tool-caption b {
  display: none;
}
.tools-folded .tool-caption {
  padding: 0;
}
.tools-folded .tool-caption svg {
  transform: rotate(180deg);
}
.board {
  position: relative;
  overflow: hidden;
  background: #fafaf4;
  min-height: 0;
  min-width: 0;
}
.board > svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  touch-action: none;
  user-select: none;
}
.floor-tabs,
.zoom-box,
.board-help {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 2px;
  background: #fffffbf7;
  border: 1px solid #d2d8cb;
  box-shadow: 0 2px 7px #354b3420;
  border-radius: 7px;
}
.floor-tabs {
  left: 14px;
  top: 14px;
  padding: 3px;
}
.floor-tabs button {
  font-size: 14px;
  height: 32px;
  border-radius: 4px;
  padding: 4px 13px;
}
.panel-toggle {
  position: absolute;
  right: 12px;
  top: 14px;
  display: none;
}
.board-help {
  left: 12px;
  bottom: 13px;
  max-width: calc(100% - 175px);
  padding: 7px 9px;
  gap: 4px;
  font-size: 12px;
  flex-wrap: wrap;
  pointer-events: auto;
}
.board-help .iconbtn {
  height: 30px;
  width: 30px;
}
.zoom-box {
  right: 12px;
  bottom: 13px;
  padding: 1px 3px;
  font-size: 12px;
}
.zoom-box .iconbtn {
  width: 30px;
  height: 33px;
}
.zoom-box span {
  min-width: 34px;
  text-align: center;
}
.zoom-box .icon {
  width: 16px;
}
.zoom-box button:last-child {
  border-left: 1px solid var(--line);
  border-radius: 0;
}
#inspector {
  border-left: 1px solid var(--line);
  padding: 10px 14px;
}
.inspect-heading h2 {
  font-size: 16px;
}
.inspect-heading .iconbtn {
  width: 30px;
  height: 30px;
}
.inspect-part {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.inspect-part h3 {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
}
.inspect-part h3 small {
  font: 600 11px Arial;
  margin-left: auto;
  color: #5e7361;
}
.inspect-part .field {
  margin: 8px 0;
}
.layer-row {
  margin: 7px 0 12px;
}
.layer-row > label:first-child,
.toggle-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.layer-row input[type='checkbox'],
.toggle-line input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.opacity {
  display: flex;
  align-items: center;
  margin: 3px 0 0 22px;
  gap: 7px;
}
.opacity input {
  width: 100%;
  min-width: 35px;
  height: 18px;
}
.opacity output {
  font-size: 11px;
  text-align: right;
  min-width: 29px;
}
.toggle-line {
  margin-top: 11px;
  min-height: 25px;
}
.fractions {
  display: flex;
  gap: 4px;
}
.fractions button {
  flex: 1;
  padding: 5px;
  background: #edf0e7;
  border: 1px solid #dce1d4;
  border-radius: 4px;
  font-size: 12px;
}
.room-area {
  margin-top: 8px;
  font-weight: 600;
}
.room-area small {
  font-size: 11px;
  color: #626f62;
}
.area-summary dl,.room-metrics {
  display:grid;
  grid-template-columns:minmax(0,auto) minmax(0,1fr);
  align-items:baseline;
  gap:5px 7px;
  margin:7px 0;
  font-size:13px;
  font-variant-numeric:tabular-nums;
}
.area-summary dd,.room-metrics strong { margin:0;text-align:right;overflow-wrap:anywhere; }
.area-summary .area-total { border-top:1px solid var(--line);padding-top:6px;font-weight:700; }
.area-summary .small-note strong {font-weight:500;}
.wall-editor form {margin:8px 0 12px;}
.wall-editor form .btn {margin-top:4px;min-height:34px;font-size:13px;}
.wall-editor input,.slab-editor select {width:100%;}
.joinery-panel select,.joinery-panel input[type=number],.joinery-panel input[type=text] {width:100%;min-width:0;}
.joinery-panel fieldset {border:0;margin:12px 0;padding:0;min-width:0;}
.joinery-panel legend {font-weight:650;padding:0 0 4px;}
.joinery-panel [hidden] {display:none!important;}
.joinery-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
.joinery-list {display:grid;gap:4px;margin:10px 0;}
.joinery-list button {display:flex;justify-content:space-between;align-items:center;gap:6px;padding:6px 8px;text-align:left;border:1px solid #d9ded3;border-radius:5px;background:#fff;}
.joinery-list button[aria-pressed=true] {border-color:#8c674d;background:#faf1e7;}
.joinery-list span {font-size:11px;color:#596858;}
.joinery-actions {display:flex;gap:5px;flex-wrap:wrap;}
.joinery-actions .btn {min-height:32px;font-size:12px;}
.joinery-lock {margin:1px 0 8px 14px;}
.wall-rooms>div {border-top:1px solid var(--line);padding:6px 0;font-size:13px;}
.room-metrics > span {color:var(--muted);}
.unit-readout [data-unit] {display:block;}
.unit-readout [data-unit] + [data-unit] {font-size:.94em;color:var(--muted);font-weight:500;}
.area-summary .area-breakdown {font-size:11px;color:var(--muted);}
.area-breakdown strong {font-weight:500;}
.tsubo-summary-action {display:flex;flex-wrap:wrap;align-items:center;gap:5px 9px;margin-top:12px;}
.tsubo-summary-action .btn {min-height:34px;font-size:12px;padding:5px 8px;}
.tsubo-summary-action small {font-size:11px;color:var(--muted);}
#tsubo-custom-field[hidden] {display:none;}
.tsubo-switches {width:100%;border-collapse:collapse;margin:17px 0;font-size:14px;}
.tsubo-switches caption {text-align:left;font-weight:650;margin-bottom:5px;}
.tsubo-switches th,.tsubo-switches td {border-bottom:1px solid var(--line);text-align:center;}
.tsubo-switches th:first-child {text-align:left;padding-left:7px;}
.tsubo-switches thead th {font-weight:500;font-size:12px;color:var(--muted);padding:6px 0;background:#f0f3e9;}
.tsubo-switches tbody th {font-weight:500;}
.tsubo-switches label {display:grid;min-height:38px;place-items:center;cursor:pointer;}
.tsubo-switches input,.tsubo-override-units input {width:17px;height:17px;}
#tsubo-overrides summary {cursor:pointer;font-weight:600;font-size:14px;padding:8px 0;}
.tsubo-override-units {display:flex;gap:19px;}
.tsubo-override-units label {display:flex;gap:5px;align-items:center;font-size:14px;min-height:38px;cursor:pointer;}
.tsubo-override-units input {margin:0;}
.slab-actions {display:flex;flex-wrap:wrap;gap:4px;margin:8px 0;}
.slab-actions .btn,.slab-editor .text {font-size:12px;padding:5px 8px;min-height:34px;}
@media(max-width:660px) {
  .editor .tools>[data-act=dxf]{display:none;}
  .editor .tools>button,.editor.tools-folded .tools>button{min-width:0;}
}
.panel-closed .editor-layout {
  grid-template-columns: 132px minmax(0, 1fr);
}
.panel-closed.tools-folded .editor-layout {
  grid-template-columns: 52px minmax(0, 1fr);
}
.panel-closed #inspector {
  display: none;
}
.panel-closed .panel-toggle {
  display: flex;
}
.editor .warning {
  margin: 0;
}
@media (min-width: 1600px) {
  .workspace {
    padding-inline: 72px;
  }
  .head-inner {
    padding-inline: 86px;
  }
}
@media (max-width: 1020px) {
  .head-inner {
    padding: 0 22px;
    gap: 24px;
  }
  .head-inner nav {
    gap: 1px;
  }
  .nav-item {
    font-size: 13px;
    padding-inline: 8px;
    gap: 5px;
  }
  .head-right {
    gap: 8px;
  }
  .workspace {
    padding: 26px 27px 46px;
  }
  .tool-grid {
    gap: 12px;
  }
  .tool-body {
    padding: 12px;
  }
  .editor-layout {
    grid-template-columns: 102px minmax(0, 1fr) 208px;
  }
  .tools {
    padding-inline: 5px;
  }
  .tools > button {
    padding-inline: 7px;
  }
  .hero-copy {
    padding-left: 28px;
  }
  .editor-top {
    min-height: 58px;
  }
  .head-inner nav .icon {
    width: 15px;
  }
}
@media (max-width: 800px) {
  #header {
    height: 62px;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  .brand b {
    font-size: 26px;
  }
  .head-inner {
    gap: 14px;
  }
  .nav-item {
    font-size: 12px;
    padding: 0 8px;
  }
  .nav-item .icon {
    display: none;
  }
  .device {
    font-size: 11px;
    padding: 5px 8px;
  }
  .head-right {
    gap: 4px;
  }
  .hero-copy {
    width: 50%;
  }
  .hero p {
    font-size: 13px;
  }
  .tool-code {
    font-size: 10px;
  }
  .tool-body > p {
    font-size: 12px;
  }
  .section-head h2 {
    font-size: 20px;
  }
  .editor {
    height: calc(100dvh - 62px);
  }
  .editor-layout,
  .tools-folded .editor-layout,
  .panel-closed .editor-layout,
  .panel-closed.tools-folded .editor-layout {
    grid-template-columns: 54px minmax(0, 1fr);
  }
  .tools > button {
    justify-content: center;
  }
  .tools > button span,
  .tool-caption {
    display: none;
  }
  .editor-layout {
    position: relative;
  }
  #inspector {
    display: none;
  }
  .panel-toggle {
    display: flex;
  }
  .panel-open #inspector {
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(270px, 84%);
    z-index: 4;
    box-shadow: -5px 0 20px #24382422;
  }
  .tool-grid {
    gap: 9px;
  }
  .tool-picture {
    height: 105px;
  }
  .tool-title h3 {
    font-size: 15px;
  }
  .tool-title .icon {
    width: 13px;
  }
}
@media (max-width: 660px) {
  .head-inner {
    padding: 0 16px;
  }
  .head-inner nav {
    display: none;
  }
  .mobile-menu {
    display: grid;
  }
  .head-right {
    gap: 2px;
  }
  .head-right > .iconbtn {
    width: 36px;
  }
  .device {
    margin-right: 5px;
  }
  .workspace {
    padding: 24px 16px 36px;
  }
  .page-heading {
    margin-bottom: 17px;
    gap: 7px;
  }
  .page-heading h1 {
    font-size: 25px;
  }
  .today {
    font-size: 12px;
  }
  .page-heading > .primary {
    min-height: 40px;
    padding: 8px 13px;
  }
  .hero {
    display: flex;
    align-items: flex-end;
    min-height: 0;
    padding-top: clamp(157px, 45vw, 265px);
    background: #f1f0e2;
  }
  .hero-art {
    inset: 0 0 auto;
    height: clamp(185px, 53vw, 314px);
    background: #f5f0e3;
  }
  .hero-art img {
    object-fit: cover;
    object-position: center 52%;
  }
  .hero-art:before {
    inset: auto 0 0;
    width: 100%;
    height: 26%;
    background: linear-gradient(0deg, #f1f0e2, #f1f0e200);
  }
  .hero-copy {
    width: 100%;
    padding: 8px 20px 19px;
  }
  .sample-label {
    font-size: 11px;
  }
  .hero h2 {
    font-size: 31px;
    margin: 7px 0 5px;
  }
  .hero p {
    font-size: 13px;
    line-height: 1.7;
  }
  .hero .btn {
    margin-top: 13px;
    min-height: 39px;
  }
  .home-section {
    margin-top: 23px;
  }
  .tool-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .tool-card {
    display: grid;
    grid-template-columns: 30% minmax(0, 1fr);
    align-items: stretch;
  }
  .tool-picture {
    height: 100%;
    min-height: 91px;
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }
  .tool-picture img {
    position: absolute;
    inset: 0;
    object-fit: cover;
    transform: scale(0.99);
  }
  .tool-code {
    display: none;
  }
  .tool-title h3 {
    font-size: 16px;
  }
  .tool-body {
    padding: 11px 12px;
  }
  .tool-body > p {
    font-size: 12px;
    line-height: 1.5;
  }
  .phase-dot {
    margin-top: 5px;
  }
  .section-head {
    margin-bottom: 10px;
  }
  .section-head h2 {
    font-size: 19px;
  }
  .empty {
    padding: 14px;
    gap: 10px;
  }
  .empty p {
    font-size: 12px;
  }
  .project-row {
    padding: 10px;
    gap: 9px;
    flex-wrap: wrap;
  }
  .project-row time {
    display: none;
  }
  .page-heading .buttons {
    gap: 4px;
  }
  .page-heading .buttons .btn {
    font-size: 12px;
    padding: 8px;
  }
  .filters {
    gap: 5px;
  }
  .filters select {
    max-width: 105px;
  }
  .editor-top {
    padding: 6px 5px;
    gap: 2px;
  }
  .editor-title,
  .edit-actions {
    gap: 1px;
  }
  .editor-title h1 {
    font-size: 16px;
  }
  .editor-title small {
    font-size: 10px;
  }
  .edit-actions .btn {
    font-size: 12px;
    min-height: 34px;
    padding: 6px 9px;
  }
  .editor-top .iconbtn {
    width: 30px;
    height: 36px;
  }
  .edit-actions .divider {
    margin: 0 3px;
  }
  .editor-layout,
  .tools-folded .editor-layout,
  .panel-closed .editor-layout,
  .panel-closed.tools-folded .editor-layout {
    display: flex;
    flex-direction: column;
  }
  .board {
    flex: 1;
    order: 0;
  }
  .tools {
    order: 1;
    display: flex;
    justify-content: space-around;
    flex: none;
    border: 0;
    border-top: 1px solid var(--line);
    padding: 3px 3px max(3px, env(safe-area-inset-bottom));
    overflow: visible;
  }
  .tools > button,
  .tools-folded .tools > button {
    width: auto;
    flex: 1;
    min-height: 48px;
    margin: 0 2px;
    flex-direction: column;
    gap: 3px;
    padding: 4px;
    font-size: 11px;
  }
  .tools > button span,
  .tools-folded .tools > button span {
    display: block;
  }
  .board-help {
    bottom: 56px;
    left: 8px;
    max-width: calc(100% - 16px);
    font-size: 11px;
  }
  .floor-tabs {
    left: 8px;
    top: 8px;
  }
  .panel-toggle {
    top: 8px;
    right: 8px;
    min-height: 37px;
  }
  .zoom-box {
    bottom: 10px;
    right: 8px;
  }
  .panel-open #inspector {
    bottom: 54px;
  }
  .editor {
    min-height: 270px;
  }
  .tools .icon {
    width: 18px;
    height: 18px;
  }
  .modal-actions .btn {
    font-size: 13px;
  }
}
@media (max-height: 540px) and (orientation: landscape) {
  body:has(.editor) #header {
    display: none;
  }
  .editor {
    height: 100dvh;
  }
  .editor-top {
    min-height: 48px;
    padding-block: 3px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
@media (max-width: 350px) {
  .device {
    display: none;
  }
  .hero-copy {
    padding-inline: 15px;
  }
  .tool-title h3 {
    font-size: 14px;
  }
}
@media (max-height: 540px) and (orientation: landscape) and (pointer: coarse) {
  .editor-layout,
  .tools-folded .editor-layout,
  .panel-closed .editor-layout,
  .panel-closed.tools-folded .editor-layout {
    position: relative;
    display: flex;
    flex-direction: column;
  }
  .editor .board {
    flex: 1;
    order: 0;
  }
  .editor .tools {
    display: flex;
    order: 1;
    flex: none;
    justify-content: center;
    border: 0;
    border-top: 1px solid var(--line);
    padding: 1px;
    overflow: visible;
  }
  .editor .tools > button {
    margin: 0 2px;
    min-height: 37px;
    width: auto;
    padding: 5px 14px;
    justify-content: center;
    gap: 6px;
  }
  .editor .tools > button span {
    display: block;
  }
  .editor .tool-caption {
    display: none;
  }
  .editor #inspector {
    display: none;
  }
  .editor .panel-toggle {
    display: flex;
  }
  .editor.panel-open #inspector {
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 40px;
    width: min(300px, 48%);
    z-index: 4;
    box-shadow: -5px 0 20px #24382422;
  }
  .board-help,
  .zoom-box {
    bottom: 7px;
  }
  .floor-tabs,
  .panel-toggle {
    top: 6px;
  }
}
.modal-error {
  margin-top: 12px;
  color: #90391f;
  background: #fcf0df;
  padding: 9px 12px;
  border-radius: 5px;
  font-size: 14px;
}
.cover-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; }
.cover-fields input { min-width: 0; width: 100%; }
.cover-offset { margin: 7px 0 18px; }
.cover-offset summary { cursor: pointer; margin-bottom: 9px; }
.cover-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 5px; margin: 7px 0; }
.cover-row > span { font-size: 12px; color: var(--muted); }
.cover-row .btn { min-width: 0; overflow-wrap: anywhere; }
.covering-panel > .btn { margin-top: 5px; }
.cover-library { list-style: none; margin: 0 0 15px; padding: 0; }
.cover-library li { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cover-library small { display: block; color: var(--muted); }
#cover-style-form [data-layout][hidden], [data-material-terms][hidden] { display: none; }
#floor-material-form fieldset { margin: 12px 0; border: 1px solid var(--line); border-radius: 6px; padding: 12px; }

.pwa-panel h3 { border-top: 1px solid var(--line); margin: 18px 0 8px; padding-top: 12px; }
.pwa-panel dl { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 6px 14px; margin: 8px 0 12px; font-size: 14px; }
.pwa-panel dt { color: var(--muted); }
.pwa-panel dd { margin: 0; overflow-wrap: anywhere; }
.pwa-panel .buttons { flex-wrap: wrap; justify-content: flex-start; }
.pwa-panel [hidden] { display: none; }
.pwa-panel a { color: var(--ink); text-underline-offset: 3px; }
@media (max-width: 480px) {
  .pwa-panel dl { grid-template-columns: 1fr; gap: 2px; }
  .pwa-panel dd { margin-bottom: 5px; }
}
