/* Rep app. shadcn-style: neutral zinc surfaces, 1px borders, 8px radius, brand green as the accent. */
:root {
  --bg: #ffffff; --bg2: #fafafa; --fg: #09090b; --mut: #71717a; --mut2: #a1a1aa;
  --line: #e4e4e7; --line2: #f4f4f5; --acc: #f4f4f5;
  --pri: #18181b; --pri-fg: #fafafa;
  --g: #4d7c0f; --g2: #65a30d; --gl: #f7fee7; --gb: #d9f99d; --gd: #202714;
  --red: #dc2626; --amber: #b45309; --blue: #2563eb;
  --ring: 0 0 0 3px rgba(101,163,13,.22);
  --r: 8px; --sh: 0 1px 2px rgba(0,0,0,.05);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg2); color: var(--fg); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 16px; height: 16px; flex: none; }
a { color: inherit; }
.hidden { display: none !important; }
b, strong { font-weight: 600; }
small { font-size: 12.5px; color: var(--mut); }
.mono { font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hint { font-size: 13px; color: var(--mut); }

/* ---------- layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sb { width: 256px; flex: none; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 50; }
.sb-top { display: flex; align-items: center; gap: 10px; padding: 6px 6px 12px; }
.sb-top img { height: 30px; width: auto; }
.sb-top > div { border-left: 1px solid var(--line); padding-left: 10px; }
.sb-top b { display: block; font-size: 14px; line-height: 1.2; } .sb-top small { font-size: 12px; }
.sb-new { width: 100%; margin: 4px 0 14px; }
.nav { display: grid; gap: 1px; }
.nav-h { font-size: 12px; font-weight: 500; color: var(--mut); padding: 14px 8px 6px; }
.nav-i { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 8px; border-radius: 6px; text-decoration: none; color: #3f3f46; font-weight: 500; font-size: 14px; }
.nav-i svg { color: var(--mut); }
.nav-i:hover { background: var(--acc); color: var(--fg); }
.nav-i.on { background: #fff; color: var(--fg); box-shadow: 0 0 0 1px var(--line), var(--sh); }
.nav-i.on svg { color: var(--g); }
.nav-i span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-i em { font-style: normal; font-size: 12px; color: var(--mut); font-variant-numeric: tabular-nums; }
.sb-foot { margin-top: auto; display: flex; align-items: center; gap: 6px; padding: 10px 4px 2px; border-top: 1px solid var(--line); }
.ws { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.ws-av { width: 32px; height: 32px; border-radius: 8px; background: var(--gd); color: #d9f99d; display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.ws b { display: block; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ws small { font-size: 12px; }
.sb-bg { display: none; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.hd { position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 24px; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); }
.hd .sb-tog { display: none; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--mut); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a { text-decoration: none; } .crumbs a:hover { color: var(--fg); }
.crumbs .sep { color: var(--mut2); } .crumbs .cur { color: var(--fg); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.hd-r { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.save-state { font-size: 12.5px; color: var(--mut); white-space: nowrap; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 24px 120px; }
.narrow { max-width: 760px; }

/* page header */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.sub-h { color: var(--mut); margin: 4px 0 0; font-size: 14px; }
.ttl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- primitives ---------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh); padding: 20px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card > h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.card > h2 .r { margin-left: auto; font-weight: 400; font-size: 13px; }
.card-h { margin-bottom: 16px; } .card-h h3 { margin: 0; font-size: 15px; font-weight: 600; } .card-h p { margin: 2px 0 0; color: var(--mut); font-size: 13.5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font-weight: 500; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: var(--sh); transition: background .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--acc); }
.btn:focus-visible, .icon-btn:focus-visible, .rg-i:focus-visible, .nav-i:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.pri { background: var(--pri); border-color: var(--pri); color: var(--pri-fg); }
.btn.pri:hover { background: #27272a; }
.btn.dark { background: var(--gd); border-color: var(--gd); color: #fff; }
.btn.outline { background: var(--bg); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--acc); }
.btn.danger { color: var(--red); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 6px; }
.btn.lg { height: 42px; padding: 0 18px; font-size: 14.5px; }
.btn.icon-only { padding: 0; width: 32px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 6px; display: inline-grid; place-items: center; cursor: pointer; color: var(--mut); }
.icon-btn:hover { background: var(--acc); color: var(--fg); }

label.f { display: block; margin-bottom: 14px; min-width: 0; }
label.f > span { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 6px; }
.in, select.in, textarea.in { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); padding: 0 11px; outline: none; box-shadow: var(--sh); transition: border-color .12s, box-shadow .12s; font-size: 14px; }
select.in { appearance: none; padding-right: 30px; background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 9px center; }
textarea.in { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.in:focus { border-color: var(--g2); box-shadow: var(--ring); }
.in::placeholder, input::placeholder, textarea::placeholder { color: var(--mut2); }
.in[disabled] { background: var(--bg2); color: var(--mut); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 99px; height: 30px; padding: 0 12px; font-size: 13px; cursor: pointer; font-weight: 500; }
.chip.on { background: var(--pri); border-color: var(--pri); color: #fff; }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13.5px; font-weight: 500; }
.toggle input { display: none; }
.toggle .sw { width: 36px; height: 20px; border-radius: 99px; background: #e4e4e7; position: relative; transition: background .15s; flex: none; }
.toggle .sw::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.toggle input:checked + .sw { background: var(--g); }
.toggle input:checked + .sw::after { transform: translateX(16px); }
.warn, .alert { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13.5px; background: var(--bg); margin-bottom: 16px; }
.warn { border-color: #fde68a; background: #fffbeb; color: #78350f; }
.alert svg { margin-top: 2px; color: var(--mut); } .alert.ok { border-color: var(--gb); background: var(--gl); } .alert.ok svg { color: var(--g); }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.b-draft { background: var(--acc); color: #3f3f46; }
.b-sent { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.b-viewed { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.b-signed { background: var(--gl); color: #3f6212; border-color: var(--gb); }
.b-outline { border-color: var(--line); color: var(--mut); text-transform: capitalize; font-size: 11px; height: 20px; }
.av { width: 36px; height: 36px; border-radius: 50%; background: var(--acc); color: #3f3f46; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; border: 1px solid var(--line); }
.av.sm { width: 30px; height: 30px; font-size: 11.5px; }
.av.muted svg { color: var(--mut); }
.tagx { font-size: 11px; background: var(--acc); border-radius: 5px; padding: 1px 6px; color: var(--mut); white-space: nowrap; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.12); border-top-color: var(--fg); border-radius: 50%; animation: sp .7s linear infinite; display: inline-block; }
.spin.light { border-color: rgba(255,255,255,.3); border-top-color: #fff; }
@keyframes sp { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 48px 20px; color: var(--mut); }
.empty-state b { color: var(--fg); display: block; margin-bottom: 2px; }
.empty-state p { margin: 0 0 14px; }
.empty-state .big-ico { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--mut); }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: var(--bg); box-shadow: var(--sh); }
.st-h { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; font-weight: 500; }
.st-h svg { color: var(--mut); }
.st-v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.st-n { font-size: 12.5px; color: var(--mut); }
.tbar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.search svg { position: absolute; left: 10px; top: 10px; color: var(--mut); }
.search .in { padding-left: 34px; }
.sel-s { width: auto !important; min-width: 170px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; color: var(--mut); font-size: 13px; height: 40px; padding: 0 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-href] { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--bg2); }
.tbl td small { display: block; }
.tbl .r { text-align: right; }
.tc { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tc b { display: block; font-weight: 500; }
.thumb-s { width: 36px; height: 36px; border-radius: 6px; background: var(--acc) center/cover; border: 1px solid var(--line); flex: none; }
.tabs { display: inline-flex; background: var(--acc); border-radius: 8px; padding: 3px; margin-bottom: 14px; gap: 2px; }
.tab { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 6px; font-weight: 500; font-size: 13.5px; color: var(--mut); cursor: pointer; }
.tab.on { background: var(--bg); color: var(--fg); box-shadow: var(--sh); }

/* ---------- new document ---------- */
.new-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.new-grid .card { margin: 0; }
.rg { display: grid; gap: 8px; }
.rg-i { display: grid; grid-template-columns: 16px 32px 1fr; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 11px 14px; cursor: pointer; transition: border-color .12s, background .12s; }
.rg-i:hover { background: var(--bg2); }
.rg-i.on { border-color: var(--g2); background: var(--gl); box-shadow: 0 0 0 1px var(--g2); }
.rd { width: 16px; height: 16px; border-radius: 50%; border: 1px solid #a1a1aa; position: relative; background: #fff; }
.rg-i.on .rd { border-color: var(--g); } .rg-i.on .rd::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--g); }
.rg-ico { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); display: grid; place-items: center; color: #52525b; }
.rg-i.on .rg-ico { color: var(--g); border-color: var(--gb); }
.rg-t b { display: block; font-weight: 500; font-size: 14px; } .rg-t small { display: block; line-height: 1.35; }
.cmd { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--sh); }
.cmd-in { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); height: 44px; }
.cmd-in svg { color: var(--mut); }
.cmd-in input { flex: 1; border: 0; outline: none; height: 100%; background: transparent; font-size: 14px; }
.cmd-list { max-height: 380px; overflow-y: auto; padding: 4px; }
.cmd-grp { font-size: 12px; color: var(--mut); font-weight: 500; padding: 8px 8px 4px; }
.cmd-i { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.cmd-i > div { flex: 1; min-width: 0; } .cmd-i b { display: block; font-weight: 500; } .cmd-i small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-i.hi, .cmd-i:hover { background: var(--acc); }
.cmd-empty { padding: 24px; text-align: center; color: var(--mut); font-size: 13.5px; }
.picked { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.picked > div { flex: 1; min-width: 0; } .picked b { display: block; font-weight: 500; } .picked small { display: block; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

/* result rows (link contact sheet) */
.results { display: grid; gap: 4px; margin-top: 10px; }
.res { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: center; background: var(--bg); border: 0; border-radius: 6px; padding: 8px; cursor: pointer; text-align: left; width: 100%; }
.res:hover { background: var(--acc); }
.res .n { font-weight: 500; } .res .m { font-size: 12.5px; color: var(--mut); }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--bg2); }
.login .box { width: 100%; max-width: 360px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px; box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 10px 30px rgba(0,0,0,.05); }
.login img { height: 52px; display: block; margin: 0 auto 16px; }
.login h1 { text-align: center; font-size: 20px; }
.login p { text-align: center; color: var(--mut); margin: 4px 0 20px; }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* ---------- editor ---------- */
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.ed-title { margin-bottom: 16px; }
.side { position: sticky; top: 76px; }
.side .card > h2 { font-size: 14px; }
.otabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.otab { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 6px 12px; cursor: pointer; text-align: left; min-width: 104px; box-shadow: var(--sh); }
.otab.on { border-color: var(--g2); background: var(--gl); box-shadow: 0 0 0 1px var(--g2); }
.otab b { display: block; font-size: 13.5px; font-weight: 500; } .otab small { font-size: 12px; font-variant-numeric: tabular-nums; }
.opt-head { display: grid; grid-template-columns: 1fr 1fr 150px; gap: 0 12px; }
.adders { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; }
.lines-ed { display: grid; gap: 8px; }
.lrow { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.lrow.tier { box-shadow: inset 3px 0 0 var(--g2); }
.l1 { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.lname { font-weight: 500; border: 0; padding: 3px 0; width: 100%; outline: none; background: transparent; font-size: 14px; }
.lname:focus { box-shadow: 0 1px 0 var(--g2); }
.l2 { display: grid; grid-template-columns: 112px 112px 1fr auto; gap: 10px; align-items: center; margin-top: 6px; }
.numf { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; height: 34px; overflow: hidden; background: var(--bg); box-shadow: var(--sh); }
.numf:focus-within { border-color: var(--g2); box-shadow: var(--ring); }
.numf input { border: 0; outline: none; width: 100%; height: 100%; padding: 0 9px; text-align: right; min-width: 0; font-variant-numeric: tabular-nums; background: transparent; }
.numf em { font-style: normal; font-size: 12px; color: var(--mut); padding: 0 8px; white-space: nowrap; background: var(--bg2); height: 100%; display: grid; place-items: center; border-left: 1px solid var(--line); }
.numf em.pre { order: -1; border-left: 0; border-right: 1px solid var(--line); }
.lamt { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.lmeta { display: flex; gap: 4px 12px; align-items: center; flex-wrap: wrap; }
.lmeta .hint b { color: var(--g); font-weight: 500; }
.ldesc { margin-top: 8px; } .ldesc textarea { min-height: 60px; font-size: 13px; }
.tierbar { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.tierbar span { font-size: 11.5px; padding: 2px 7px; border-radius: 5px; background: var(--acc); color: var(--mut); font-variant-numeric: tabular-nums; }
.tierbar span.on { background: var(--gl); color: #3f6212; box-shadow: inset 0 0 0 1px var(--gb); font-weight: 600; }
.disc-row { display: grid; grid-template-columns: 1fr auto 130px auto; gap: 8px; align-items: center; margin-top: 8px; }
.seg { display: inline-flex; background: var(--acc); border-radius: 7px; padding: 3px; height: 34px; }
.seg button { border: 0; background: transparent; padding: 0 11px; cursor: pointer; font-weight: 500; border-radius: 5px; color: var(--mut); }
.seg button.on { background: var(--bg); color: var(--fg); box-shadow: var(--sh); }
.tot .tr { display: flex; justify-content: space-between; padding: 3px 0; font-variant-numeric: tabular-nums; }
.tot .grand { font-size: 18px; font-weight: 600; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; }
.tot .optline { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line2); font-variant-numeric: tabular-nums; }
.side .acts { display: grid; gap: 8px; margin-top: 16px; }
.status-box { font-size: 13px; color: var(--mut); display: grid; gap: 4px; margin-top: 14px; }
.status-box b { color: var(--fg); font-weight: 500; }
.status-box a { color: var(--g); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.thumb { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); position: relative; }
.thumb .ti { height: 104px; background: var(--acc) center/cover no-repeat; display: grid; place-items: center; color: var(--mut); }
.thumb input { border: 0; border-top: 1px solid var(--line); width: 100%; padding: 7px 9px; font-size: 12.5px; outline: none; }
.thumb .x { position: absolute; top: 6px; right: 6px; background: rgba(9,9,11,.6); color: #fff; }
.drop { border: 1px dashed #d4d4d8; border-radius: 10px; padding: 16px; text-align: center; color: var(--mut); cursor: pointer; display: grid; place-items: center; gap: 4px; min-height: 104px; font-size: 13px; }
.drop b { color: var(--fg); font-weight: 500; }
.drop:hover, .drop.over { border-color: var(--g2); background: var(--gl); }

/* ---------- dialogs ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 80; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--bg); width: 100%; max-width: 820px; max-height: 92vh; border-radius: 14px 14px 0 0; display: flex; flex-direction: column; animation: up .18s ease-out; border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0,0,0,.18); }
.sheet.full { max-width: 1000px; height: 96vh; max-height: none; }
@media (min-width: 900px) { .sheet-bg { align-items: center; } .sheet { border-radius: 14px; max-height: 88vh; } .sheet.full { height: 92vh; } }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sheet-h h3 { margin: 0; font-size: 16px; font-weight: 600; flex: 1; }
.sheet-b { overflow: auto; padding: 18px; flex: 1; -webkit-overflow-scrolling: touch; }
.sheet-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes up { from { transform: translateY(16px); opacity: 0; } } @keyframes fade { from { opacity: 0; } }
.fam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.fam { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); cursor: pointer; text-align: left; padding: 0; box-shadow: var(--sh); }
.fam:hover { border-color: #d4d4d8; } .fam.on { border-color: var(--g2); box-shadow: 0 0 0 1px var(--g2); }
.fam .fi { height: 88px; background: linear-gradient(135deg, #84cc16, #3f6212) center/cover no-repeat; position: relative; }
.fam .fl { position: absolute; left: 6px; top: 6px; background: rgba(255,255,255,.92); color: var(--fg); font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 5px; }
.fam .fb { padding: 8px 10px 10px; } .fam b { display: block; font-size: 13.5px; font-weight: 500; } .fam small { font-size: 12px; }
.sqft-box { border: 1px solid var(--line); background: var(--bg2); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.sqft-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.bignum { font-size: 20px !important; font-weight: 600; }
.sqft-row .numf { height: 46px !important; }
.tier-out { margin-top: 10px; font-size: 14px; font-variant-numeric: tabular-nums; }
.tier-out b { font-weight: 600; }
.prod-list { display: grid; gap: 2px; }
.prod { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; border: 0; border-radius: 7px; padding: 9px 10px; background: transparent; cursor: pointer; text-align: left; width: 100%; text-decoration: none; color: inherit; }
.prod:hover { background: var(--acc); }
.prod .pn { font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 8px; } .prod .pd { font-size: 12.5px; color: var(--mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 560px; }
.prod .pp { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; } .prod .pu { font-size: 12px; color: var(--mut); }
.cat-bar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.cat-bar .chip { flex: none; }
.pv-wrap { background: var(--bg2); padding: 20px; }
.pv-wrap .doc { box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 30px rgba(0,0,0,.06); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.link-box { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 4px 4px 4px 12px; background: var(--bg2); }
.link-box input { flex: 1; border: 0; background: transparent; outline: none; font-size: 13.5px; min-width: 0; }
.share-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.share-grid .btn { justify-content: flex-start; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--bg); color: var(--fg); border: 1px solid var(--line); padding: 12px 16px; border-radius: 10px; z-index: 95; font-weight: 500; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.12); animation: up .18s; max-width: calc(100% - 40px); }
.toast.bad { border-color: #fecaca; color: var(--red); }

/* ---------- responsive ---------- */
.mbar { display: none; }
@media (max-width: 1100px) {
  .stats { grid-template-columns: 1fr 1fr; } .ed { grid-template-columns: 1fr; } .side { position: static; display: none; } .new-grid { grid-template-columns: 1fr; }
  .mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--bg); border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 8px; align-items: center; }
  .mbar .mt { flex: 1; min-width: 0; } .mbar .mt small { display: block; font-size: 12px; } .mbar .mt b { font-size: 16px; font-variant-numeric: tabular-nums; }
  .mbar .btn { height: 40px; }
}
@media (max-width: 860px) {
  .sb { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s ease; background: var(--bg); visibility: hidden; }
  body.nav-open .sb { transform: none; visibility: visible; box-shadow: 0 10px 40px rgba(0,0,0,.2); }
  body.nav-open .sb-bg { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 45; }
  .hd .sb-tog { display: inline-grid; margin-left: -6px; }
  .hd { padding: 0 14px; }
  .wrap { padding: 18px 14px 120px; }
  .toast { left: 14px; right: 14px; bottom: 84px; }
}
@media (max-width: 640px) {
  h1 { font-size: 21px; }
  .stats { gap: 10px; } .stat { padding: 12px 14px; } .st-v { font-size: 21px; }
  .hide-s { display: none !important; }
  .grid2, .grid3, .opt-head { grid-template-columns: 1fr; }
  .l2 { grid-template-columns: 1fr 1fr; }
  .l2 .lmeta { grid-column: 1 / -1; order: 3; }
  .l2 .lamt { order: 2; grid-column: 1 / -1; text-align: left; }
  .disc-row { grid-template-columns: 1fr auto; }
  .share-grid, .sqft-row { grid-template-columns: 1fr; }
  .pv-wrap { padding: 0; }
  .search { max-width: none; }
  .crumbs a, .crumbs .sep { display: none; }
  .form-foot .btn { flex: 1; }
  .tbl.docs thead { display: none; }
  .tbl.docs tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 14px; border-bottom: 1px solid var(--line2); }
  .tbl.docs td { padding: 0; border: 0; background: none !important; }
  .tbl.docs td:nth-child(1) { grid-column: 1; grid-row: 1; } .tbl.docs td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  .tbl.docs td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--mut); font-size: 13px; } .tbl.docs td:nth-child(2) div, .tbl.docs td:nth-child(2) small { display: inline; } .tbl.docs td:nth-child(2) small::before { content: ' '; }
  .tbl.docs td:nth-child(5) { grid-column: 2; grid-row: 2; }
  .tbl.docs .av { display: none; }
}
