:root {
  color-scheme: light;
  --canvas: #f6f5f0;
  --panel: #fffefa;
  --ink: #232822;
  --muted: #555f55;
  --line: #dfdfd5;
  --dark: #25352e;
  --dark-line: #435149;
  --accent: #315744;
  --accent-strong: #244333;
  --tint: #edf2e9;
  --sand: #f4eada;
  --rust: #78502d;
  --error: #a0332b;
  --r: 14px;
  font: 16px/1.5 "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .58; cursor: wait; }
:focus-visible { outline: 3px solid #b38353; outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 3.2vw, 2.7rem); line-height: 1.17; letter-spacing: -.055em; font-weight: 780; }
h2 { font-size: 1.08rem; line-height: 1.35; font-weight: 750; }
p { line-height: 1.65; }
small { font-size: .8125rem; }
label { display: grid; gap: 7px; font-size: .9rem; font-weight: 650; }
input:is([type=text], [type=password], [type=number], [type=tel], [type=date], :not([type])) {
  inline-size: 100%; min-inline-size: 0; min-block-size: 43px;
  padding: .5rem .7rem; color: var(--ink); background: #fff;
  border: 1px solid #d5d9cf; border-radius: 8px;
}
input::placeholder { color: #687267; }
input:is([type=radio], [type=checkbox]) { accent-color: var(--accent); }
.button { border-radius: 9px; padding: .63rem 1rem; min-height: 43px; font-size: .925rem; font-weight: 700; }
.download-button { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.primary { border: 1px solid transparent; background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-strong); }
.secondary { border: 1px solid #cfd7cc; background: var(--panel); color: var(--accent-strong); }
.secondary:hover { background: var(--tint); }
.danger-button { color: #8c342b; border-color: #e7c7bf; }
.form-error { color: var(--error); font-size: .9rem; }
.success { color: var(--accent-strong); font-size: .9rem; }
.wordmark { font-size: 1.22rem; color: var(--dark); letter-spacing: .12em; font-weight: 880; white-space: nowrap; }
.wordmark span { font-size: .85rem; vertical-align: .08em; margin-left: .2rem; letter-spacing: .09em; font-weight: 650; }
.wordmark-light { color: #fff8e8; }
.entry { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.entry-photo { position: relative; background: var(--dark); min-height: 100%; overflow: hidden; }
.entry-photo img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: 48% center; filter: brightness(.82); }
.entry-photo .wordmark { position: absolute; left: clamp(1.3rem, 5vw, 4rem); top: 2rem; text-shadow: 0 2px 16px #1d211d; }
.entry-main { display: grid; place-items: center; padding: clamp(1.3rem, 5vw, 4rem); }
.entry-content { width: min(100%, 410px); }
.entry-content > .wordmark { display: inline-block; margin-bottom: 2.2rem; }
.entry-content > p { margin-top: .8rem; color: var(--muted); }
.entry-content form { display: grid; gap: 17px; margin-top: 1.6rem; }
.entry-password { display: grid; gap: 7px; }
.password-entry { display: flex; gap: 8px; }
.password-entry button { white-space: nowrap; }
.entry-content form .primary { margin-top: .35rem; justify-self: stretch; }
.entry-content form .hint { margin-top: -.25rem; }
.shell { display: grid; grid-template-columns: 215px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  min-height: 100vh; height: 100vh; align-self: start; position: sticky; top: 0;
  display: flex; flex-direction: column; background: var(--dark); color: #eef2e7; padding: 26px 17px 18px;
}
.brand { padding: 5px 11px 27px; display: grid; gap: .3rem; border-bottom: 1px solid var(--dark-line); }
.brand-caption { color: #d0d9ce; font-size: .86rem; }
.sidebar nav { display: grid; gap: .4rem; padding-top: 20px; }
.sidebar nav button {
  text-align: left; min-height: 43px; color: #dbe4d9; font-size: .92rem; font-weight: 650;
  border: 1px solid transparent; background: transparent; border-radius: 8px; padding: .62rem .83rem;
}
.sidebar nav button:hover { background: #34463c; }
.sidebar nav button[aria-current=page] { color: #fff8e9; background: #3e5545; border-color: #5d715f; }
.account-strip {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: .45rem;
  border-top: 1px solid var(--dark-line); margin-top: auto; padding: 15px 0 2px;
}
.account-strip > span:nth-child(2) { overflow: hidden; }
.account-strip strong, .account-strip small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-strip strong { font-size: .89rem; }
.account-strip small { color: #c6d3c8; }
.avatar { display: grid; align-items: center; justify-items: center; height: 32px; border-radius: 8px; background: #42594b; font-weight: 700; }
.account-strip button { background: transparent; color: #e8eee5; border: 0; padding: .25rem; font-size: .875rem; }
.content { width: 100%; max-width: 1530px; margin-inline: auto; padding: 34px clamp(21px, 4.1vw, 64px) 45px; }
.heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 23px; }
.heading p { color: var(--muted); margin-top: .65rem; font-size: .94rem; }
.status { background: var(--sand); color: var(--rust); border: 1px solid #ebe0d0; border-radius: 20px; padding: .3rem .72rem; white-space: nowrap; font-size: .84rem; font-weight: 700; }
.status.live { background: var(--tint); color: var(--accent-strong); border-color: #dce6d9; }
.grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(255px, 1fr); align-items: start; gap: 19px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.quote-form { padding: 18px 21px 20px; }
.quote-form section + section { border-top: 1px solid #ecebe2; margin-top: 16px; padding-top: 15px; }
.quote-form h2 { margin-bottom: .62rem; }
.quote-form select, .worksheet-price-selector select { min-width: 0; min-height: 43px; padding: .5rem .7rem; border: 1px solid #d5d9cf; border-radius: 8px; color: var(--ink); background: #fff; font: inherit; }
.segments, .dimensions, .woods, .options { display: grid; gap: 8px; }
.segments, .dimensions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.woods, .options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.height-pricing { margin-top: .85rem; }
.height-pricing h3 { font-size: .9rem; margin: 0 0 .45rem; }
.segment, .wood, .option { position: relative; display: flex; align-items: center; gap: .56rem; border: 1px solid #dddcd2; border-radius: 9px; min-height: 42px; color: var(--ink); background: #fff; }
.segment, .option { padding: .5rem .65rem; }
.segment:has(input:checked), .wood:has(input:checked), .option:has(input:checked) { background: var(--tint); border-color: #75907b; color: var(--accent-strong); }
.segment:has(input:focus-visible), .wood:has(input:focus-visible) { outline: 3px solid #b38353; outline-offset: 2px; }
.segment input, .wood input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.shape-option { min-height: 54px; }
.shape-option > span { line-height: 1.25; }
.shape-option small { display: block; color: var(--muted); font-weight: 500; margin-top: .22rem; }
.shape-icon { display: block; width: 28px; height: 23px; flex: 0 0 auto; background: #78958a; }
.shape-icon[data-shape=diamond] { clip-path: polygon(0 0, 100% 0, 100% 55%, 63% 100%, 0 100%); }
.shape-icon[data-shape=l-shape] { clip-path: polygon(0 0, 100% 0, 100% 54%, 63% 54%, 63% 100%, 0 100%); }
.shape-option:has(input:checked) .shape-icon { background: var(--accent); }
.cut-fields { display: grid; grid-template-columns: 114px minmax(0,1fr); align-items: center; gap: 14px; padding: .8rem; margin-top: .7rem; background: var(--tint); border-radius: 9px; }
.cut-fields .hint { margin: 0 0 .55rem; }
.shape-diagram { position: relative; width: 95px; height: 65px; margin-bottom: 15px; }
.shape-diagram .shape-outline { position: absolute; inset: 0; border: 1px dashed #5b7767; }
.shape-diagram .shape-icon { position: absolute; inset: 0; width: 100%; height: 100%; }
.shape-diagram span { position: absolute; color: var(--accent-strong); font-size: .85rem; line-height: 1; font-weight: 750; font-style: normal; }
.measure-a { left: 63%; width: 37%; bottom: -17px; text-align: center; border-top: 1px solid #6c8374; padding-top: 3px; }
.measure-b { left: calc(100% + 4px); height: 46%; top: 54%; display: grid; place-items: center; border-left: 1px solid #6c8374; padding-left: 3px; }
.cut-dimensions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.option input { flex: 0 0 auto; width: 1.05rem; height: 1.05rem; margin: 0; }
.option:has(input:disabled) { opacity: .5; cursor: default; }
.wood { min-height: 52px; padding: .32rem .53rem; }
.wood img { display: block; width: 35px; height: 35px; object-fit: cover; border-radius: 5px; flex: 0 0 auto; }
.wood span { overflow-wrap: anywhere; }
.option label, .segment span, .wood span { cursor: pointer; }
.dim-input { position: relative; display: block; }
.dim-input input { padding-right: 2.65rem; }
.dim-input span { position: absolute; top: 50%; right: .55rem; transform: translateY(-50%); color: var(--muted); font-size: .78rem; font-weight: 500; pointer-events: none; }
.hint { color: var(--muted); font-size: .83rem; margin-top: .45rem; }
.detail-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.detail-fields:not(:has(label:not([hidden]))) { display: none; }
.detail-fields label { margin-top: 10px; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 19px; }
.form-foot .primary { min-width: 142px; }
.form-foot .sub { margin-left: auto; color: var(--muted); font-size: .82rem; }
.quote-form .form-error { margin-top: .75rem; }
.result { overflow: hidden; }
.result-photo { width: 100%; height: clamp(105px, 13vw, 180px); object-fit: cover; object-position: 50% 53%; display: block; }
.result-main { padding: 19px 19px 21px; }
.result-main h2 { margin-bottom: 10px; }
.dry-room-grid .result { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.worksheet-series { margin-bottom: .85rem; }
.dry-options-group { margin-top: .6rem; border: 1px solid var(--line); border-radius: 8px; }
.dry-options-group summary { padding: .6rem .75rem; cursor: pointer; font-size: .9rem; font-weight: 650; }
.dry-options-group[open] summary { border-bottom: 1px solid var(--line); }
.dry-choice-count { float: right; color: var(--muted); }
.dry-options-list { display: grid; gap: 7px; padding: 7px; }
.dry-option-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(96px, .34fr); gap: 8px; align-items: center; }
.dry-option-row .option { grid-column: 1 / -1; }
.dry-option-row:has(.dry-option-quantity:not([hidden])) .option { grid-column: 1; align-self: stretch; }
.dry-option-quantity { gap: 3px; color: var(--muted); font-size: .8rem; }
.dry-option-quantity input { min-block-size: 34px; }
.dry-option-row .sub { color: var(--muted); font-weight: 450; }
.quote-total { font-size: clamp(1.8rem, 3vw, 2.6rem); color: var(--accent-strong); font-weight: 780; letter-spacing: -.04em; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; line-height: 1.2; margin: .65rem 0 .85rem; }
.quote-total.empty { color: #687268; font-size: 2.3rem; }
.result-main .hint { margin-top: 0; }
.summary { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .45rem 1rem; margin: .9rem 0 0; padding-top: .82rem; border-top: 1px solid var(--line); font-size: .88rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.summary .quote-code { font-variant-numeric: tabular-nums; }
.option-prices { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.option-prices ul { list-style: none; margin: .3rem 0 0; padding: 0; }
.option-prices li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); gap: .65rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .9rem; overflow-wrap: anywhere; }
.option-prices small { display: block; margin-top: .12rem; color: var(--muted); }
.comparison-link { color: var(--accent-strong); font-size: .875rem; font-weight: 650; text-underline-offset: .2em; }
.material-comparison { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); scroll-margin-top: 1rem; }
.result-main .material-comparison .hint { margin: .35rem 0 .7rem; }
.material-comparison tbody th { background: transparent; overflow-wrap: anywhere; }
.material-comparison .current-material { background: #e9efe5; }
.material-comparison td { white-space: nowrap; font-variant-numeric: tabular-nums; }
.material-comparison small { display: block; margin-top: .12rem; color: var(--muted); }
.callout { margin-top: .8rem; padding: .6rem .7rem; border-radius: 7px; background: var(--sand); color: var(--rust); font-size: .86rem; }
.wide-card { padding: 19px 20px; }
.wide-card + .wide-card { margin-top: 17px; }
.wide-card h2 { margin-bottom: 12px; }
.table-scroll { overflow-x: auto; }
.history-area summary { cursor: pointer; white-space: nowrap; }
.history-area[open] { min-width: 170px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
th { color: var(--muted); font-weight: 650; background: #f1f2ec; }
td, th { padding: .7rem .65rem; border-bottom: 1px solid #ebebe2; vertical-align: middle; }
td { min-width: 75px; white-space: normal; }
.number { font-variant-numeric: tabular-nums; }
.ip-value { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.audit-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: 13px; }
.numeric { text-align: right; }
.numeric input { text-align: right; }
.nowrap { white-space: nowrap; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(225px, 1fr); gap: 16px; }
.settings-layout .wide-card { align-self: start; }
.settings-layout .wide-card + .wide-card { margin-top: 0; }
.price-extra, .settings-foot, .account-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.account-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.settings-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.price-extra label { min-width: 0; }
.worksheet-price-selector select { max-width: 22rem; }
.worksheet-price-fields { min-width: 0; margin: 0; padding: 0; border: 0; }
.worksheet-price-fields label { align-content: end; }
.worksheet-price-actions { position: sticky; z-index: 1; bottom: 0; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.setting-check { display: flex; align-items: baseline; gap: 8px; margin-top: .75rem; }
.spaced { margin-top: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.actions .button { min-height: 36px; }
td .actions { margin: 0; }
td .actions button { padding: .27rem .57rem; font-size: .82rem; min-height: 32px; }
td .download-button { padding: .27rem .57rem; font-size: .82rem; min-height: 32px; }
.empty-state { color: var(--muted); padding: 19px 0; }
.dialog { background: var(--panel); padding: 23px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); width: min(430px, calc(100% - 28px)); }
.dialog::backdrop { background: #202a23aa; }
.dialog p, .dialog label { margin-top: 10px; }
.view-message { margin-top: 14px; font-size: .91rem; }
@media (max-width: 1080px) {
  .shell { grid-template-columns: 175px minmax(0, 1fr); }
  .content { padding-inline: 22px; }
  .grid { gap: 13px; }
  .quote-form { padding-inline: 15px; }
}
@media (max-width: 850px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-height: 0; height: auto; position: static; padding: 13px 16px; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
  .brand { padding: 0; border: none; }
  .sidebar nav { display: flex; grid-row: 2; grid-column: span 2; flex-wrap: wrap; gap: 6px; padding: 0; }
  .sidebar nav button { min-height: 37px; padding: .4rem .63rem; }
  .account-strip { grid-column: 2; grid-row: 1; border-top: none; padding: 0; margin: 0; }
  .content { padding-top: 23px; }
}
@media (max-width: 635px) {
  .grid, .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .dry-room-grid .result { position: static; max-height: none; }
  .worksheet-series { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #dry-body-form .woods { grid-template-columns: minmax(0, 1fr); }
  .content { padding-inline: 12px; }
  .heading { align-items: start; }
  .heading p { font-size: .88rem; }
  .entry { grid-template-columns: 1fr; min-height: auto; }
  .entry-photo { min-height: 205px; }
  .entry-photo img { object-position: 50% 62%; }
  .entry-photo .wordmark { top: 1rem; }
  .entry-main { padding: 1.7rem 1.2rem; }
  .entry-content > .wordmark { display: none; }
  .price-extra, .account-form, .detail-fields { grid-template-columns: 1fr 1fr; }
  .audit-filters { grid-template-columns: 1fr; }
  .shape-option { flex-direction: column; align-items: flex-start; gap: .25rem; }
  .cut-fields { grid-template-columns: 1fr; align-items: start; }
  .form-foot .sub { margin-left: 0; }
  .display-wide { min-width: 530px; }
  .personal-audit { min-width: 0; }
  .personal-audit :is(th, td) { min-width: 0; padding: .5rem .35rem; white-space: normal; }
}
