* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-size: 13px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
.exterior-app { display: grid; grid-template-rows: auto minmax(0, 1fr) 30px; height: 100vh; height: 100dvh; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.brand { display: flex; flex-direction: column; margin-right: 8px; line-height: 1.4; }
.brand b { font-size: 13px; letter-spacing: .3px; }
.brand span { color: var(--muted); font-size: 11px; }
.grp { display: flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.btn { border: 0; background: transparent; padding: 5px 9px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f2ece2; }
.btn.active { background: var(--ink); color: #fff; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #9f5530; }
.btn.bordered { border: 1px solid var(--line); background: #fff; }
main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; overflow: hidden; }
.viewer { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--paper); }
#scene { height: 100%; width: 100%; touch-action: none; }
#scene canvas { display: block; width: 100%; height: 100%; outline: none; }
.scene-label { position: absolute; left: 16px; top: 16px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: rgba(255, 253, 249, .94); border-radius: 8px; padding: 7px 11px; pointer-events: none; }
.scene-dot { width: 6px; height: 6px; background: var(--teal); border-radius: 50%; }
.scene-label small { border-left: 1px solid var(--line); padding-left: 8px; color: var(--muted); font-size: 11px; }
.hint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px; background: rgba(255, 253, 249, .94); color: var(--muted); font-size: 12px; white-space: nowrap; pointer-events: none; }
.touch-hint { display: none; }
#loading { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: var(--paper); padding: 30px; z-index: 3; color: var(--muted); }
#loading[hidden] { display: none; }
aside { background: var(--panel); border-left: 1px solid var(--line); overflow: auto; }
.panel-section { padding: 16px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: 1.5px; }
h1 { margin: 6px 0 8px; font-size: 19px; font-weight: 600; }
h2 { margin: 0 0 10px; font-size: 13px; }
.intro { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.8; }
.scheme { display: flex; align-items: center; gap: 10px; width: 100%; margin: 6px 0; padding: 10px; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.scheme:hover { border-color: var(--accent); }
.scheme.active { border-color: var(--accent); background: var(--accent-soft); }
.scheme i { width: 36px; height: 36px; flex: none; border-radius: 7px; background: linear-gradient(135deg, var(--a) 65%, var(--b) 65%); border: 1px solid rgba(43, 40, 36, .12); }
.scheme b { font-size: 12px; font-weight: 600; }
.scheme small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.colors { margin-top: 14px; padding-top: 8px; border-top: 1px dashed var(--line); }
.colors label { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; font-size: 12px; }
input[type="color"] { width: 48px; height: 30px; border: 1px solid var(--line); padding: 2px; background: #fff; border-radius: 6px; cursor: pointer; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: 11px 0; cursor: pointer; }
.toggle input { margin: 0; accent-color: var(--accent); width: 16px; height: 16px; }
.range { display: block; font-size: 12px; margin-top: 18px; }
.range output { float: right; color: var(--accent); }
.range input { display: block; width: 100%; margin: 10px 0 0; accent-color: var(--accent); }
.reset { width: 100%; margin-top: 16px; }
details { font-size: 12px; color: var(--muted); }
summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details p { margin: 12px 0 0; line-height: 1.8; }
.references { margin-top: 20px; }
.references a { display: inline-block; color: var(--teal); font-size: 11px; margin: 0 12px 4px 0; text-underline-offset: 3px; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 14px; background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; overflow: hidden; white-space: nowrap; }
footer b { color: var(--ink); font-weight: 500; }
@media (max-width: 1100px) {
  main { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 700px) {
  .exterior-app { grid-template-rows: auto minmax(0, 1fr) 30px; }
  main { display: block; overflow-y: auto; }
  .viewer { height: 56dvh; min-height: 340px; }
  aside { overflow: visible; border-left: 0; border-top: 1px solid var(--line); }
  #schemes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .scheme { display: flex; flex-direction: column; align-items: flex-start; margin: 0; padding: 8px; }
  .scheme small { font-size: 10px; }
  .scheme b { font-size: 11px; }
  .hint { max-width: calc(100% - 24px); white-space: normal; text-align: center; }
  footer > span:last-child { display: none; }
}
@media (pointer: coarse) {
  .btn { min-height: 38px; padding: 8px 12px; }
  .colors label, .toggle { min-height: 36px; }
  input[type="color"] { height: 38px; }
  .mouse-hint { display: none; }
  .touch-hint { display: inline; }
}

.part-label { position: absolute; z-index: 2; transform: translate(-50%, -100%); padding: 6px 12px; border: 1px solid var(--accent); border-radius: 7px; background: var(--panel); color: var(--accent); box-shadow: 0 4px 16px rgba(43, 40, 36, .12); font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.part-label[hidden] { display: none; }
.part-label::after { content: ""; position: absolute; bottom: -4px; left: calc(50% - 3px); width: 6px; height: 6px; border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); background: var(--panel); transform: rotate(45deg); }
