:root {
  color-scheme: light;
  --paper: #f6f5f0;
  --surface: #fdfcf9;
  --ink: #21392e;
  --muted: #59675f;
  --forest: #294a3b;
  --forest-dark: #1e382c;
  --sage: #dfe8dd;
  --line: #d4dacd;
  --terracotta: #9d543c;
  --serif: "Iowan Old Style", Baskerville, "Baskerville Old Face", "Palatino Linotype", Georgia, serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --gutter: clamp(1rem, 4.6vw, 4.25rem);
}
* { box-sizing: border-box; }
html { min-width: 0; scrollbar-gutter: stable; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font: 400 1rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
a { color: var(--forest); }
button { color: inherit; cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #9f563c; outline-offset: 3px; }
::selection { background: #cadbc6; color: #172d23; }
.app-header {
  min-height: 4.85rem;
  padding: .85rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #fcfbf7;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .78rem; text-decoration: none; color: var(--ink); }
.brand-mark {
  flex: 0 0 2.55rem;
  width: 2.55rem;
  height: 2.55rem;
  display: inline-flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding-bottom: .65rem;
  background: var(--forest);
  color: #eee4c9;
  border-radius: .36rem;
}
.brand-mark i { width: 5px; height: 11px; border: 1px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; }
.brand-mark i:nth-child(2) { height: 19px; }
.brand-mark i:nth-child(3) { height: 14px; }
.brand-mark svg { width: 1.55rem; height: 1.55rem; align-self: center; margin-top: .55rem; }
.brand-name { font: 500 clamp(1.15rem, 2.1vw, 1.53rem)/1.15 var(--serif); letter-spacing: -.035em; }
.brand-name small { display: block; margin-top: .18rem; color: var(--muted); font: 500 .8rem/1.25 var(--sans); letter-spacing: .015em; }
.home-link, .crumb { color: var(--muted); font-size: .9rem; font-weight: 550; text-underline-offset: 3px; }
.home-link { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; }
.home-link:hover, .crumb:hover { color: var(--ink); text-decoration: underline; }
main#studio { max-width: 94rem; padding: 0 var(--gutter) clamp(3rem, 7vw, 6rem); margin: 0 auto; }
.project-heading, .workspace-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  column-gap: 1.5rem;
  row-gap: .9rem;
}
.project-heading { padding: clamp(2.5rem, 6.7vw, 6rem) 0 clamp(1.5rem, 3.2vw, 2.9rem); }
.workspace-head { padding: clamp(1.6rem, 4.6vw, 4rem) 0 clamp(1.25rem, 2vw, 2rem); }
.project-heading > div:first-child, .workspace-head > div:first-child { min-width: 0; }
.eyebrow, .kicker {
  color: #576757;
  font-size: .79rem;
  font-weight: 690;
  line-height: 1.4;
  letter-spacing: .115em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: .6rem; margin: 0 0 .7rem; }
.eyebrow::before { content: ""; width: 1.35rem; height: 2px; flex: none; background: var(--terracotta); }
.kicker { display: block; margin: 0 0 .4rem; }
h1, h2, h3, p { overflow-wrap: break-word; }
.project-heading h1, .workspace-head h1 {
  max-width: 22ch;
  margin: 0;
  color: var(--ink);
  font: 400 clamp(2.5rem, 5vw, 4.9rem)/1.02 var(--serif);
  letter-spacing: -.055em;
}
.workspace-head h1 { font-size: clamp(2.1rem, 4.2vw, 3.65rem); }
.lead { max-width: 58ch; color: var(--muted); margin: .8rem 0 0; font-size: clamp(1rem, 1.55vw, 1.115rem); }
.button, .scope-toggle button, .tabs button {
  min-height: 2.65rem;
  padding: .62rem 1.03rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid #c2cbbb;
  border-radius: .42rem;
  background: var(--surface);
  color: var(--ink);
  font: 600 .92rem/1.32 var(--sans);
  text-decoration: none;
  text-align: center;
}
.button:hover:not(:disabled), .scope-toggle button:hover:not(:disabled), .tabs button:hover:not(:disabled) { background: #edf1e8; border-color: #9fae9b; }
.button.primary { border-color: var(--forest); background: var(--forest); color: #fffdf6; }
.button.primary:hover:not(:disabled) { border-color: var(--forest-dark); background: var(--forest-dark); }
.button.quiet { border-color: transparent; background: transparent; }
.button svg, .home-link svg, .crumb svg, .tabs svg { flex: none; width: 1.05rem; height: 1.05rem; }
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: clamp(1rem, 2vw, 1.6rem);
  padding-top: clamp(1rem, 2vw, 1.65rem);
  border-top: 1px solid var(--line);
  align-items: start;
}
.project-card { min-width: 0; background: var(--surface); border: 1px solid #d3d8cb; border-radius: .72rem; overflow: hidden; }
.card-link { display: block; color: inherit; text-decoration: none; }
.project-card:has(.card-link:hover) { border-color: #93a28e; box-shadow: 0 3px 14px #253d2c0c; }
.card-link:focus-visible { outline-offset: -4px; }
.cover, .plan-thumbnail {
  background-color: #e6ebe1;
  display: block;
  width: 100%;
  aspect-ratio: 1.78;
  object-fit: cover;
  overflow: hidden;
  border-bottom: 1px solid #d8ded2;
}
.cover img, .plan-thumbnail img { width: 100%; height: 100%; display: block; object-fit: cover; }
.plan-thumbnail { object-fit: contain; background-color: #f0f1e9; }
.plan-thumbnail img { object-fit: contain; }
.reference-card .cover, .reference-card .cover img { object-position: 53% 43%; }
.card-body { padding: 1rem 1.22rem 1.16rem; }
.card-body h2 { margin: 0; font: 400 clamp(1.6rem, 2.35vw, 2.12rem)/1.12 var(--serif); letter-spacing: -.036em; }
.meta { color: var(--muted); font-size: .9rem; line-height: 1.5; margin: .45rem 0 0; }
.workspace-layout { display: grid; grid-template-columns: minmax(15.5rem, 20.5rem) minmax(0, 1fr); gap: clamp(1rem, 2.2vw, 2rem); align-items: start; }
.workspace-layout > * { min-width: 0; }
.inspector { display: grid; align-content: start; gap: 1rem; }
.panel { padding: clamp(1rem, 2.2vw, 1.5rem); background: var(--surface); border: 1px solid var(--line); border-radius: .7rem; }
.panel h2, .inspector h2 { margin: 0 0 .85rem; font: 400 1.55rem/1.18 var(--serif); letter-spacing: -.035em; }
.panel h3 { margin: 0 0 .7rem; font-size: 1.02rem; font-weight: 640; }
.panel p { margin: .55rem 0; }
.work-surface { min-width: 0; }
.field { display: grid; gap: .36rem; margin: 0 0 1rem; }
.field > label, label.field > span { color: var(--ink); font-size: .9rem; font-weight: 620; }
.field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .field textarea {
  width: 100%;
  min-width: 0;
  min-height: 2.65rem;
  padding: .55rem .72rem;
  color: var(--ink);
  border: 1px solid #b9c2b4;
  background: #fffefa;
  border-radius: .38rem;
}
.field input[type=file] { overflow: hidden; font-size: .875rem; }
.field input[type=file]::file-selector-button { font: inherit; padding: .4rem .6rem; color: var(--ink); border: 1px solid var(--line); background: #edf1e8; border-radius: .25rem; margin-right: .5rem; cursor: pointer; }
.field textarea { min-height: 5.5rem; resize: vertical; }
.field small, .inspector .hint { color: var(--muted); font-size: .86rem; }
.scope-toggle { display: flex; align-items: stretch; gap: .35rem; }
.scope-toggle button { flex: 1; min-width: 0; padding-inline: .62rem; }
.scope-toggle button[aria-pressed=true], .tabs button[aria-selected=true], .tabs button[aria-pressed=true] { background: #dae5d8; border-color: #71876f; color: #203c2c; }
.actions, .toolbar, .tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.actions { margin-top: 1rem; }
.toolbar, .tabs { margin-bottom: 1rem; }
.tabs { border-bottom: 1px solid var(--line); padding-bottom: .65rem; }
.notice, .error, .loading { margin: .85rem 0; font-size: .92rem; line-height: 1.45; }
.notice, .error { padding: .7rem .85rem; background: #edf2e9; color: #314637; border: 1px solid #c6d5c2; border-radius: .4rem; }
.error { background: #fff1e9; color: #763524; border-color: #dfb8a8; }
.loading { color: var(--muted); }
@media (max-width: 55rem) {
  .workspace-layout { grid-template-columns: minmax(13.5rem, 16rem) minmax(0, 1fr); gap: .8rem; }
}
@media (max-width: 44rem) {
  html { scrollbar-gutter: auto; }
  .app-header { min-height: 4rem; }
  .brand { gap: .55rem; }
  .brand-mark { flex-basis: 2.15rem; width: 2.15rem; height: 2.15rem; padding-bottom: .43rem; }
  .home-link { font-size: .87rem; }
  .project-heading { padding-top: 2.2rem; }
  .project-heading > .button, .workspace-head > .button { align-self: start; }
  .workspace-layout { grid-template-columns: minmax(0, 1fr); }
  .project-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
  .button, .scope-toggle button, .tabs button { min-height: 2.75rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .project-card, .button { transition: background-color .16s, border-color .16s, box-shadow .16s; }
}
img.brand-mark{padding:0;}
.upload-zone{display:grid;gap:.35rem;border:1px dashed #8d9e8b;border-radius:.55rem;padding:.85rem;background:#f4f7ef;}
.upload-zone input{width:100%;max-width:100%;font-size:.9rem}
.upload-zone input::file-selector-button{border:1px solid #bac9b7;border-radius:.3rem;background:white;color:#294a3b;padding:.4rem .6rem;margin-right:.4rem}
#save-status:not(:empty){margin:.7rem 0} .workspace-layout .inspector{align-self:start;}
.sheet-detail{min-width:0} .sheet-detail h2{margin:.15rem 0 .65rem;font:400 1.7rem/1.15 var(--serif)}
.sheet-detail ul{padding-left:1.2rem}.sheet-detail .field{margin-bottom:1rem}
.flat-plan{display:block;width:100%;max-height:75vh;object-fit:contain;background:white;border:1px solid var(--line)}
a.card-link .plan-thumbnail{object-fit:contain;background:#fff}
#model-notes{white-space:pre-wrap}
.reference-input { margin:.25rem 0 1rem; }
.reference-files,.saved-references { padding:0; list-style:none; }
.reference-files { margin:0; }
.reference-files li { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:.25rem .45rem; margin-bottom:.8rem; padding:.7rem; background:#f2f4ed; border-radius:.38rem; }
.reference-files li > small { grid-column:1/-1; color:var(--muted); overflow-wrap:anywhere; }
.reference-files .field { margin:0; }
.reference-files .button { padding-inline:.35rem; font-size:.85rem; }
.reference-error,.plan-identity-hint { color:var(--muted); font-size:.86rem; }
.reference-error { color:#763524; }
.reference-error:empty,.plan-identity-hint:empty { display:none; }
.saved-references { margin:0 0 1rem; }
.saved-references li + li { margin-top:.65rem; }
.saved-references li a,.saved-references li small { overflow-wrap:anywhere; }
.saved-references li small { display:block;color:var(--muted); }
.project-details { max-width:37rem; }
