/* BOQ Studio — architectural drawing-sheet design system */
:root {
  --paper: #f3f0e9;
  --paper-2: #ebe6dc;
  --sheet: #fbfaf6;
  --ink: #161513;
  --ink-2: #47443e;
  --ink-3: #85807a;
  --line: #d9d3c7;
  --line-2: #bdb5a6;
  --accent: #9e3b26;
  --accent-ink: #7f2c1a;
  --accent-soft: #f2e2db;
  --slate: #2f4a5c;
  --ok: #3f7349;
  --warn: #a8701b;
  --err: #a23b2a;
  --shadow: 0 1px 0 rgba(22, 21, 19, .04), 0 12px 32px -18px rgba(22, 21, 19, .28);
  --f-serif: "Noto Serif Thai", "Cormorant Garamond", Georgia, serif;
  --f-latin: "Cormorant Garamond", "Noto Serif Thai", Georgia, serif;
  /* display numerals: modern lining figures (the serif's old-style digits looked uneven) */
  --f-num: "IBM Plex Sans Thai", "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-sans: "IBM Plex Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 2px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-sans); font-size: 15px; line-height: 1.6;
  font-weight: 400; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #fff; }

.mono { font-family: var(--f-mono); letter-spacing: .02em; }
.kicker { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.kicker b { color: var(--accent); font-weight: 500; }
.serif { font-family: var(--f-serif); }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; font-family: var(--f-mono); }
.hero-meta b, .specs b { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------------------------------------------------------- layout */
.wrap { width: min(1240px, 100% - 48px); margin-inline: auto; }
@media (max-width: 640px) { .wrap { width: calc(100% - 32px); } }

/* ---------------------------------------------------------------- top bar */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border: 1.5px solid var(--ink); position: relative; flex: none; }
.brand-mark::before { content: ""; position: absolute; inset: 5px 5px 11px 11px; background: var(--accent); }
.brand-mark::after { content: ""; position: absolute; left: -1.5px; right: -1.5px; top: 50%; border-top: 1.5px solid var(--ink); }
.brand-name { font-family: var(--f-latin); font-weight: 600; font-size: 22px; letter-spacing: .04em; line-height: 1; }
.brand-name small { display: block; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .22em; color: var(--ink-3); margin-top: 3px; font-weight: 400; }
.nav { display: flex; gap: 26px; margin-left: auto; font-size: 14px; }
.nav a { text-decoration: none; color: var(--ink-2); position: relative; padding: 4px 0; }
.nav a:hover { color: var(--ink); }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -2px; border-bottom: 1px solid var(--accent); transition: right .25s; }
.nav a:hover::after { right: 0; }
.badge-beta { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; border: 1px solid var(--accent); color: var(--accent); padding: 3px 8px; text-transform: uppercase; }
@media (max-width: 820px) { .nav { display: none; } .topbar .wrap { justify-content: space-between; } }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 46px; padding: 0 22px; border: 1px solid var(--ink); background: transparent;
  text-decoration: none; cursor: pointer; font-size: 14.5px; letter-spacing: .02em; border-radius: var(--r); transition: background .2s, color .2s, transform .15s; white-space: nowrap; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn-ghost { border-color: var(--line-2); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }
.arrow { display: inline-block; transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; padding: 72px 0 80px; }
.hero h1 { font-family: var(--f-serif); font-weight: 600; font-size: clamp(36px, 4.6vw, 60px); line-height: 1.18; margin: 18px 0 22px; letter-spacing: -.005em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 17px; color: var(--ink-2); max-width: 34em; margin: 0 0 34px; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; }
/* key figures: lining sans numerals, equal columns, hairline dividers, accent tick on the top rule */
.hero-meta { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 44px; border-top: 1px solid var(--ink); max-width: 540px; }
.hero-meta::before { content: ""; position: absolute; left: 0; top: -2px; width: 40px; height: 3px; background: var(--accent); }
.hero-meta div { padding: 18px 20px 2px; border-left: 1px solid var(--line); min-width: 0; }
.hero-meta div:first-child { padding-left: 0; border-left: 0; }
.hero-meta b { display: flex; align-items: baseline; font-family: var(--f-num); font-weight: 600; font-size: 34px; line-height: 1; letter-spacing: -.03em; color: var(--ink); }
.hero-meta b small { font-size: 17px; font-weight: 500; letter-spacing: 0; margin-left: 3px; color: var(--accent); }
.hero-meta span { display: block; margin-top: 9px; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
@media (max-width: 980px) { .hero .wrap { grid-template-columns: 1fr; padding: 48px 0 56px; gap: 36px; } }
@media (max-width: 520px) { .hero-meta div { padding: 16px 12px 2px; } .hero-meta b { font-size: 26px; } .hero-meta b small { font-size: 14px; } .hero-meta span { font-size: 11.5px; } }

/* drawing frame */
.drawing { position: relative; background: var(--sheet); border: 1px solid var(--ink); padding: 14px; box-shadow: var(--shadow); }
.drawing::before { content: ""; position: absolute; inset: 6px; border: .5px solid var(--line-2); pointer-events: none; }
.drawing svg.axo { width: 100%; height: auto; }
.axo .l { fill: none; stroke: var(--ink); stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; }
.axo .l2 { fill: none; stroke: var(--ink-2); stroke-width: .7; }
.axo .h { fill: none; stroke: var(--ink-3); stroke-width: .6; stroke-dasharray: 3 3; }
.axo .a { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.axo .roof { fill: #e8e2d6; stroke: var(--ink); stroke-width: 1.15; stroke-linejoin: round; }
.axo .roof2 { fill: #ddd6c8; stroke: var(--ink); stroke-width: 1.15; stroke-linejoin: round; }
.axo .wall { fill: #fbfaf6; stroke: var(--ink); stroke-width: 1.15; stroke-linejoin: round; }
.axo .wall2 { fill: #f1ede5; stroke: var(--ink); stroke-width: 1.15; stroke-linejoin: round; }
.axo .glass { fill: #d6dde0; stroke: var(--ink); stroke-width: .8; }
.axo .dim { fill: none; stroke: var(--accent); stroke-width: .7; }
.axo text { font-family: var(--f-mono); font-size: 9px; fill: var(--ink-2); letter-spacing: .04em; }
.axo text.acc { fill: var(--accent); }
.axo .bubble { fill: var(--sheet); stroke: var(--ink-2); stroke-width: .7; }
.axo .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(.6, .1, .2, 1) forwards; }
.axo .fade { opacity: 0; animation: fade .9s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .axo .draw { animation: none; stroke-dashoffset: 0; } .axo .fade { animation: none; opacity: 1; } }

.titleblock { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; border-top: 1px solid var(--ink); margin-top: 10px; font-size: 11px; }
.titleblock > div { padding: 7px 10px; border-right: 1px solid var(--line-2); }
.titleblock > div:last-child { border-right: 0; }
.titleblock small { display: block; font-family: var(--f-mono); font-size: 8.5px; letter-spacing: .14em; color: var(--ink-3); text-transform: uppercase; }
.titleblock b { font-weight: 500; font-family: var(--f-mono); font-size: 11.5px; }
@media (max-width: 520px) { .titleblock { grid-template-columns: 1fr 1fr; } .titleblock > div:nth-child(2) { border-right: 0; } }

/* ---------------------------------------------------------------- sections */
.section { padding: 96px 0; border-bottom: 1px solid var(--line); }
.section-head { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 32px; margin-bottom: 48px; align-items: end; }
.section-no { font-family: var(--f-num); font-size: 58px; line-height: .85; font-weight: 300; letter-spacing: -.04em; color: var(--line-2); font-variant-numeric: lining-nums tabular-nums; }
.section-head h2 { font-family: var(--f-serif); font-size: clamp(28px, 3vw, 40px); font-weight: 600; margin: 8px 0 0; line-height: 1.25; }
.section-head p { margin: 12px 0 0; color: var(--ink-2); max-width: 46em; }
.dimrule { position: relative; height: 14px; margin: 18px 0 0; border-bottom: 1px solid var(--ink); max-width: 240px; }
.dimrule::before, .dimrule::after { content: ""; position: absolute; bottom: -6px; height: 12px; border-left: 1px solid var(--ink); transform: skewX(-40deg); }
.dimrule::before { left: 0; } .dimrule::after { right: 0; }
@media (max-width: 760px) { .section { padding: 64px 0; } .section-head { grid-template-columns: 1fr; gap: 6px; } .section-no { font-size: 44px; } }

/* ---------------------------------------------------------------- import sheet */
.sheet { background: var(--sheet); border: 1px solid var(--ink); position: relative; box-shadow: var(--shadow); }
.sheet-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.sheet-main { padding: 36px; border-right: 1px solid var(--line); }
.sheet-side { padding: 36px 30px; background: linear-gradient(var(--paper-2), var(--paper-2)) padding-box; background: #f6f3ec; }
.sheet-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.sheet-label h3 { font-family: var(--f-serif); font-size: 21px; margin: 0; font-weight: 600; }
@media (max-width: 900px) { .sheet-grid { grid-template-columns: 1fr; } .sheet-main { border-right: 0; border-bottom: 1px solid var(--line); padding: 26px 20px; } .sheet-side { padding: 26px 20px; } }

.drop { position: relative; display: grid; place-items: center; text-align: center; min-height: 248px; padding: 30px 22px; border: 1px dashed var(--line-2); cursor: pointer;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 24px 24px; background-position: -1px -1px;
  background-color: #fdfcf9; transition: border-color .2s, background-color .2s; }
.drop::before { content: ""; position: absolute; inset: 0; background: radial-gradient(closest-side, #fdfcf9 55%, rgba(253, 252, 249, .55)); pointer-events: none; }
.drop > * { position: relative; }
.drop:hover, .drop.over { border-color: var(--accent); }
.drop.over { background-color: var(--accent-soft); }
.drop .ico { width: 58px; height: 58px; margin: 0 auto 14px; border: 1px solid var(--ink); display: grid; place-items: center; background: var(--sheet); }
.drop .ico svg { width: 26px; height: 26px; }
.drop h4 { margin: 0 0 4px; font-size: 18px; font-weight: 500; }
.drop p { margin: 0; color: var(--ink-3); font-size: 13.5px; }
.drop .types { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.tag { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; border: 1px solid var(--line-2); padding: 2px 8px; color: var(--ink-2); background: var(--sheet); text-transform: uppercase; }

.file-chip { display: none; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--ink); margin-top: 16px; background: #fff; }
.file-chip.on { display: flex; }
.ext { width: 44px; height: 52px; border: 1px solid var(--ink); display: grid; place-items: end center; padding-bottom: 6px; font-family: var(--f-mono); font-size: 10px; font-weight: 500; position: relative; flex: none; background: #fff; }
.ext::before { content: ""; position: absolute; top: -1px; right: -1px; width: 12px; height: 12px; background: var(--sheet); border-left: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.sheet-side .ext::before { background: #f6f3ec; }
.ext.pdf { color: var(--accent); border-color: var(--accent); }
.ext.pdf::before { border-color: var(--accent); }
.file-chip .fn { min-width: 0; flex: 1; }
.file-chip .fn b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip .fn span { font-size: 12.5px; color: var(--ink-3); }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line-2); background: transparent; cursor: pointer; flex: none; border-radius: var(--r); }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

.field { display: grid; gap: 6px; margin-top: 18px; }
.field label { font-size: 12px; font-family: var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.input { height: 44px; border: 1px solid var(--line-2); background: #fff; padding: 0 14px; border-radius: var(--r); width: 100%; outline: none; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(158, 59, 38, .12); }
select.input { padding-right: 8px; }
.gen-row { display: flex; gap: 14px; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.gen-row .btn { height: 54px; padding: 0 30px; font-size: 15.5px; }
.gen-note { font-size: 12.5px; color: var(--ink-3); flex: 1; min-width: 200px; }
details.adv { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
details.adv summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; }
details.adv summary::before { content: "+"; font-family: var(--f-mono); width: 16px; height: 16px; border: 1px solid var(--line-2); display: inline-grid; place-items: center; font-size: 12px; }
details.adv[open] summary::before { content: "−"; }
.adv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
@media (max-width: 560px) { .adv-grid { grid-template-columns: 1fr 1fr; } }

.sample { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.sample:first-of-type { border-top: 1px solid var(--line); }
.sample:hover .sample-t { color: var(--accent); }
.sample .ext { width: 40px; height: 46px; font-size: 9.5px; }
.sample-t { font-weight: 500; font-size: 14.5px; line-height: 1.35; transition: color .2s; }
.sample-s { font-size: 12px; color: var(--ink-3); }
.sample .go { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; color: var(--ink-2); border: 1px solid var(--line-2); padding: 4px 9px; white-space: nowrap; }
.sample:hover .go { border-color: var(--accent); color: var(--accent); }
.side-note { font-size: 12.5px; color: var(--ink-3); margin-top: 18px; line-height: 1.6; }

/* ---------------------------------------------------------------- steps */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--ink); }
.step { padding: 28px 26px 30px 0; border-right: 1px solid var(--line); margin-right: 26px; }
.step:last-child { border-right: 0; margin-right: 0; }
.step .n { font-family: var(--f-mono); font-size: 12px; color: var(--accent); letter-spacing: .12em; }
.step svg { width: 54px; height: 54px; margin: 18px 0; }
.step svg * { fill: none; stroke: var(--ink); stroke-width: 1.2; }
.step svg .acc { stroke: var(--accent); }
.step h3 { font-family: var(--f-serif); font-size: 20px; margin: 0 0 8px; font-weight: 600; }
.step p { margin: 0; color: var(--ink-2); font-size: 14px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } .step:nth-child(2) { border-right: 0; margin-right: 0; } .step { border-bottom: 1px solid var(--line); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } .step { border-right: 0; margin-right: 0; padding-right: 0; } }

.feat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--ink); background: var(--sheet); }
.feat > div { padding: 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feat > div:nth-child(3n) { border-right: 0; }
.feat > div:nth-last-child(-n+3) { border-bottom: 0; }
.feat .k { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; color: var(--ink-3); text-transform: uppercase; }
.feat h4 { margin: 10px 0 6px; font-size: 17px; font-weight: 600; }
.feat p { margin: 0; font-size: 14px; color: var(--ink-2); }
.swatches { display: flex; gap: 3px; margin-top: 14px; }
.swatches i { width: 18px; height: 8px; display: block; }
@media (max-width: 900px) { .feat { grid-template-columns: 1fr; } .feat > div { border-right: 0 !important; border-bottom: 1px solid var(--line) !important; } .feat > div:last-child { border-bottom: 0 !important; } }

/* ---------------------------------------------------------------- register table */
.register { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--sheet); border: 1px solid var(--ink); }
.register th { text-align: left; font-family: var(--f-mono); font-weight: 500; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: 12px 14px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.register td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.register tr:last-child td { border-bottom: 0; }
.register tbody tr { cursor: pointer; transition: background .15s; }
.register tbody tr:hover { background: #f4f0e7; }
.register .r { text-align: right; }
.register .t { font-weight: 500; }
.register .id { font-family: var(--f-mono); font-size: 12px; color: var(--accent); }
.empty { padding: 44px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line-2); background: var(--sheet); }
.table-scroll { overflow-x: auto; }
@media (max-width: 760px) { .register .hide-m { display: none; } }

/* ---------------------------------------------------------------- footer */
.foot { padding: 40px 0 56px; font-size: 13px; color: var(--ink-3); }
.foot .wrap { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- generate overlay */
.gen-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(243, 240, 233, .9); backdrop-filter: blur(6px); display: none; place-items: center; padding: 16px; }
.gen-overlay.on { display: grid; }
.gen-card { width: min(560px, 100%); background: var(--sheet); border: 1px solid var(--ink); box-shadow: var(--shadow); }
.gen-card header { padding: 22px 26px 18px; border-bottom: 1px solid var(--line); }
.gen-card header h3 { margin: 6px 0 0; font-family: var(--f-serif); font-size: 22px; font-weight: 600; }
.gen-steps { list-style: none; margin: 0; padding: 10px 26px 18px; }
.gen-steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px dashed var(--line); color: var(--ink-3); transition: color .3s; }
.gen-steps li:last-child { border-bottom: 0; }
.gen-steps .dot { width: 18px; height: 18px; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 10px; font-family: var(--f-mono); }
.gen-steps li.run { color: var(--ink); }
.gen-steps li.run .dot { border-color: var(--accent); }
.gen-steps li.run .dot::after { content: ""; width: 8px; height: 8px; background: var(--accent); animation: pulse 1s infinite alternate; }
.gen-steps li.done { color: var(--ink-2); }
.gen-steps li.done .dot { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.gen-steps li.done .dot::after { content: "✓"; }
.gen-steps .info { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); }
.gen-bar { height: 3px; background: var(--line); position: relative; overflow: hidden; }
.gen-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); transition: width .4s; }
.gen-err { display: none; margin: 0 26px 20px; padding: 12px 14px; border: 1px solid var(--err); color: var(--err); background: #fbefeb; font-size: 14px; }
.gen-err.on { display: block; }
.gen-foot { display: none; justify-content: flex-end; gap: 10px; padding: 0 26px 22px; }
.gen-foot.on { display: flex; }
@keyframes pulse { from { opacity: .35; } to { opacity: 1; } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: 11px 18px; font-size: 14px; opacity: 0; transition: .3s; z-index: 200; pointer-events: none; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translateX(-50%); }
.toast.err { background: var(--err); }
