:root {
  color-scheme: light;
  font-family: "Inter", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 16px;
  color: #252c28;
  background: #f7f8f5;
  --ink: #252c28;
  --muted: #5e6860;
  --line: #d9dfd7;
  --green: #254c3e;
  --terracotta: #9d512b;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select { font: inherit; color: inherit; }
button, input, select { min-height: 2.75rem; border-radius: 5px; border: 1px solid #bac5bb; }
button { background: #fff; cursor: pointer; padding: .55rem 1rem; font-size: .9rem; font-weight: 600; }
button:hover { border-color: #73907d; background-color: #f1f5f0; }
button:disabled, select:disabled { cursor: wait; opacity: .55; }
input, select { background-color: #fff; min-width: 0; padding: .55rem .7rem; }
input:focus-visible, button:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #b2663c; outline-offset: 2px; }
select { cursor: pointer; appearance: none; padding-right: 2.15rem; background-image: linear-gradient(45deg, transparent 50%,#55665a 50%), linear-gradient(135deg,#55665a 50%,transparent 50%); background-position: calc(100% - 15px) 51%,calc(100% - 10px) 51%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
label, legend { font-size: .9rem; font-weight: 600; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
h1,h2,p,figure { margin: 0; }
h1 { font-size: clamp(1.7rem,3vw,2.65rem); line-height: 1.25; letter-spacing: -.045em; font-weight: 650; }
h2 { font-size: 1.08rem; letter-spacing: .01em; }
.muted, .message { color: var(--muted); font-size: .93rem; line-height: 1.65; }
.message { font-size: .88rem; }
.message:empty,.error:empty,.global-error:empty { display: none; }
.error,.global-error,.message.failure { color: #9e301e; font-size: .9rem; line-height: 1.6; }
.global-error { max-width: 62rem; margin: 1rem auto; padding: .75rem 1rem; background: #fff1ea; border-radius: 5px; }
[hidden] { display: none !important; }
.sr,.skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 10; top: 4px; left: 4px; padding: .5rem; color: #fff; background: var(--green); }
.site-header { min-height: 4.65rem; border-bottom: 1px solid #dce1db; display: flex; align-items: center; justify-content: space-between; gap: 1.2rem; padding: .8rem clamp(1rem,4vw,4rem); background: #fff; }
.brand { display: flex; align-items: center; gap: .7rem; white-space: nowrap; }
.brand strong { font-family: "Barlow","Arial",sans-serif; font-size: 1.47rem; letter-spacing: .12em; }
.brand > span:last-child { font-size: .95rem; color: #48564b; }
.brand-divider { height: 1.2rem; width: 1px; background: var(--line); margin: 0 .15rem; }
.mark { position: relative; width: 1.65rem; height: 1.65rem; background: linear-gradient(90deg,transparent 54%,white 54% 61%,transparent 61%) top/100% 49% no-repeat,linear-gradient(90deg,transparent 31%,white 31% 38%,transparent 38%) bottom/100% 46% no-repeat,linear-gradient(to bottom,var(--green) 48%,white 48% 55%,var(--green) 55%); border-radius: 2px; }
#session-bar,.project-actions,.export { display: flex; align-items: center; gap: .55rem; }
#session-name { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.quiet,.link { min-height: 2.4rem; border: 0; color: var(--green); background: transparent; padding: .4rem .45rem; }
.link { text-decoration: underline; text-underline-offset: .22em; }
.full { width: 100%; }
.primary { color: #fff; background: var(--green); border-color: var(--green); }
.primary:hover { color: #fff; background: #193a2e; border-color: #193a2e; }
.boot,.state-card { max-width: 35rem; margin: 12vh auto; padding: 2rem; }
.state-card { background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.state-card p { margin: .8rem 0 1.5rem; }
.auth { display: grid; grid-template-columns: minmax(0,1.32fr) minmax(22rem,.8fr); max-width: 82rem; width: calc(100% - clamp(2rem,9vw,9rem)); min-height: min(39rem,calc(100vh - 10rem)); margin: clamp(2rem,7vh,5rem) auto; background: #fff; border: 1px solid #d8ded6; border-radius: 10px; overflow: hidden; box-shadow: 0 16px 45px #2731240a; }
.showroom { min-height: 27rem; position: relative; overflow: hidden; background: #453a30; }
.showroom img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; }
.showroom::after { content: ""; position: absolute; inset: 62% 0 0; background: linear-gradient(transparent,#181b15b3); }
.showroom figcaption { position: absolute; left: clamp(1.5rem,3vw,3rem); bottom: 2rem; z-index: 1; color: #fff; display: flex; gap: .8rem; align-items: baseline; font-size: 1.12rem; font-weight: 600; }
.showroom figcaption span { font-size: .84rem; font-weight: 400; color: #e2e6da; }
.access-card { max-width: 32rem; width: 100%; padding: clamp(1.8rem,4.5vw,4.6rem); align-self: center; justify-self: center; }
.access-card h1 { font-size: clamp(1.8rem,2.7vw,2.55rem); }
.access-card > p { margin: .7rem 0 2rem; }
#access-form { display: grid; gap: .55rem; }
#access-form label:not(:first-child) { margin-top: .7rem; }
#access-form .primary { margin-top: 1.15rem; min-height: 2.95rem; }
.switch-access { margin-top: 1.4rem; display: flex; align-items: center; gap: .25rem; color: var(--muted); font-size: .88rem; }
.studio { max-width: 103rem; margin: auto; padding: 0 clamp(1rem,4vw,4rem) 2rem; }
.views { display: flex; gap: 1.6rem; border-bottom: 1px solid var(--line); }
.views button { background: transparent; border: 0; border-radius: 0; padding: .95rem 0; border-bottom: 3px solid transparent; color: var(--muted); }
.views button[aria-current="page"] { border-color: var(--green); color: var(--green); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.8rem 0 1.4rem; }
.page-heading p { margin-top: .4rem; }
.project-actions select { max-width: min(22rem,34vw); font-size: .9rem; }
.workspace { display: grid; grid-template-columns: minmax(17rem,20rem) minmax(0,1fr); gap: 1.25rem; align-items: start; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.card-heading,.sheet-footer { min-height: 3.75rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.2rem; }
.card-heading { border-bottom: 1px solid var(--line); }
.form-content { display: flex; flex-direction: column; padding: 1.15rem; gap: .45rem; }
.form-content > label:not(:first-child),.form-content fieldset,.form-content .primary { margin-top: .8rem; }
.unit { font-size: .83rem; font-weight: 400; color: var(--muted); margin-left: .2rem; }
.dimensions { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: end; gap: .5rem; margin-top: .4rem; }
.dimensions > span { align-self: end; line-height: 2.65rem; color: #718076; }
.dimensions label { font-weight: 400; color: var(--muted); font-size: .85rem; }
.dimensions input { display: block; margin-top: .25rem; width: 100%; }
.joined { display: flex; gap: .5rem; }
.joined input { flex: 1; }
.drawing-area { position: relative; min-height: 27rem; height: min(57vh,46rem); display: grid; place-items: center; padding: 1.1rem; background-color: #edf1ec; background-image: radial-gradient(#bfcbc0 .8px,transparent .9px); background-size: 14px 14px; }
.drawing-area[aria-busy=true] { opacity: .68; }
#preview-image { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
#empty-preview { text-align: center; color: #4c5e50; font-size: .96rem; }
.wall-icon { width: 4.2rem; height: 2.8rem; margin: 0 auto .8rem; border: 2px solid #95aa9c; background: linear-gradient(#95aa9c,#95aa9c) 0 50% / 100% 2px no-repeat,linear-gradient(#95aa9c,#95aa9c) 66% 0 / 2px 50% no-repeat,linear-gradient(#95aa9c,#95aa9c) 37% 100% / 2px 50% no-repeat; }
.sheet-footer { border-top: 1px solid var(--line); flex-wrap: wrap; }
.export { margin-left: auto; flex-wrap: wrap; }
.preview-heading select,.export select { font-size: .88rem; }
.user-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th,td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: middle; }
th { background: #f0f3ef; color: #415247; }
tr:last-child td { border-bottom: 0; }
.user-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.user-actions button { min-height: 2.4rem; }
.pill { display: inline-block; border-radius: 3px; color: #465249; background: #edf0ec; padding: .2rem .45rem; white-space: nowrap; }
.pill.active { color: #20533b; background: #e0f0e3; }
.pill.pending { color: #79400c; background: #f7ead5; }
.danger { color: #913823; }
#admin-message { margin-bottom: .85rem; }
@media (max-width: 800px) {
  .auth { grid-template-columns: minmax(0,1fr) minmax(20rem,1fr); width: calc(100% - 2rem); }
  .workspace { grid-template-columns: minmax(15rem,.7fr) minmax(0,1fr); gap: .8rem; }
  .sheet-footer .export { margin-left: 0; }
}
@media (max-width: 650px) {
  .site-header { min-height: 3.8rem; padding: .65rem 1rem; flex-wrap: wrap; }
  .brand { gap: .48rem; } .brand strong { font-size: 1.15rem; }
  .brand > span:last-child { font-size: .86rem; }
  #session-bar { margin-left: auto; } #session-name { max-width: 7rem; }
  .auth { grid-template-columns: 1fr; margin: 1rem auto; }
  .showroom { min-height: 0; height: clamp(8rem,23vh,13rem); }
  .showroom img { object-position: 50% 55%; }
  .showroom figcaption { left: 1rem; bottom: .8rem; }
  .access-card { max-width: 100%; padding: 1.6rem; }
  .access-card > p { margin-bottom: 1.25rem; }
  .workspace { grid-template-columns: 1fr; }
  .page-heading { flex-wrap: wrap; padding: 1.2rem 0; }
  .project-actions { width: 100%; } .project-actions select { max-width: 100%; flex: 1; }
  .drawing-area { min-height: 18rem; height: 49vh; padding: .4rem; }
  .state-card { margin: 2rem 1rem; }
  th,td { padding: .65rem; } table { min-width: 37rem; }
}
