/* Square Footage Calculator Plus. Colors are variables so dark mode only swaps the palette. */
:root {
  --bg: #F6F7F9; --card: #FFFFFF; --ink: #1B2430; --onink: #FFFFFF; --mute: #5B6675; --line: #DDE2E8; --line2: #EDF0F3; --field: #C3CAD3;
  --seg: #E4E8ED; --sub: #F1F3F6; --blue: #8A5D0C; --blue-d: #6E4A08; --blue-l: #FBF1DC; --blue-b: #EBC77F; --topbg: #D9981A; --topmute: #4A3609;
  --logo: #D9981A; --topink: #1E1608; --tophover: rgba(30,22,8,.12); --acc-fill: #D9981A; --acc-fill-d: #C2850F; --onacc: #1E1608; --avbg: #1E1608; --avink: #E9B04A;
  --cut: #C62828; --pen: #2E7D32; --err-bg: #FBEAE8; --err: #8C1D18; --err-b: #E5B8B4; --flash: #FFF6D6; --flash-b: #EAD48A;
  --canvas: #FBFCFD; --grid: #EDF0F3; --banner-bg: #FFF3C4; --banner-ink: #5C4400; --chip-bg: #E9ECF0; --chip-ink: #3A4553; --hover: #FAFBFC;
  --shadow: 0 20px 60px rgba(0, 0, 0, .25);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0F141A; --card: #18202A; --ink: #E6EAF0; --onink: #0F141A; --mute: #9AA6B4; --line: #2A3441; --line2: #222B36; --field: #3A4656;
  --seg: #222B36; --sub: #1E2731; --blue: #E3A73A; --blue-d: #EDBB5E; --blue-l: #2E230F; --blue-b: #6B4E16; --topbg: #17130C; --topmute: #B8A783;
  --topink: #E9B04A; --tophover: rgba(233,176,74,.14); --acc-fill: #E3A73A; --acc-fill-d: #EDBB5E; --onacc: #15120C; --avbg: #D9981A; --avink: #15120C;
  --cut: #FF6B6B; --pen: #5CCB6E; --err-bg: #3A1E1C; --err: #F2A49C; --err-b: #6B3430; --flash: #3A3420; --flash-b: #6B5E2E;
  --canvas: #131A22; --grid: #1F2832; --banner-bg: #3A3216; --banner-ink: #F3E3A8; --chip-bg: #2A3441; --chip-ink: #C9D1DB; --hover: #1D2631;
  --shadow: 0 20px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; font-size: 13px; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); } a:hover { color: var(--blue-d); }
[hidden] { display: none !important; }
.loading { padding: 40px; color: var(--mute); }

/* top bar */
.topbar { background: var(--topbg); color: var(--topink); padding: 0 16px; min-height: 52px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; position: relative; z-index: 5; }
.brand { font-weight: 700; font-size: 15px; }
.topnav { display: flex; gap: 16px; }
.navlink { background: none; border: 0; color: var(--topmute); padding: 15px 0; border-bottom: 2px solid transparent; font-weight: 500; }
.navlink.on { color: var(--topink); font-weight: 600; border-bottom-color: var(--topink); }
.topright { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ver { color: var(--topmute); font-size: 12px; margin-right: 4px; }
.topicon { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--topmute); display: inline-flex; align-items: center; justify-content: center; }
.topicon:hover, .topicon[aria-expanded="true"] { background: var(--tophover); color: var(--topink); }
#themeBtn .i-sun { display: none; } html[data-theme="dark"] #themeBtn .i-sun { display: block; } html[data-theme="dark"] #themeBtn .i-moon { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid transparent; padding: 0; background: var(--avbg); color: var(--avink); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.avatar:hover, .avatar[aria-expanded="true"] { border-color: var(--topink); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu { position: absolute; right: 12px; top: 50px; min-width: 240px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 20; }
.menu .mhead { padding: 10px 12px; border-bottom: 1px solid var(--line2); margin-bottom: 4px; }
.menu .mhead b { display: block; font-size: 14px; }
.menu button { width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 6px; display: flex; align-items: center; gap: 10px; }
.menu button:hover { background: var(--sub); }
.banner { background: var(--banner-bg); color: var(--banner-ink); padding: 8px 16px; font-size: 13px; font-weight: 500; }

/* segmented controls */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 3px; background: var(--seg); border-radius: 9px; }
.seg button { min-height: 30px; border: 0; border-radius: 7px; font-weight: 600; font-size: 12px; background: transparent; color: var(--ink); padding: 0 8px; }
.seg button.on { background: var(--ink); color: var(--onink); }
.seg-wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); }

/* buttons, fields */
.btn { min-height: 34px; font-size: 13px; padding: 0 14px; border-radius: 6px; font-weight: 600; border: 1px solid var(--field); background: var(--card); color: var(--ink); display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.btn.primary { background: var(--acc-fill); border-color: var(--acc-fill); color: var(--onacc); }
.btn.primary:hover:not(:disabled) { background: var(--acc-fill-d); border-color: var(--acc-fill-d); }
.btn.primary:hover { background: var(--blue-d); border-color: var(--blue-d); }
html[data-theme="dark"] .btn.primary { color: #0F141A; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--onink); }
.btn.danger { color: var(--err); border-color: var(--err-b); }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--field); border-radius: 6px; background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 600; line-height: 1; }
.icon-btn.plain { border: 0; background: transparent; }
.ico-blue { color: var(--blue); } .ico-mute { color: var(--mute); } .ico-err { color: var(--err); }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; min-width: 0; }
.fld input, .fld select, .fld textarea, .inp { font-weight: 400; font-size: 13px; min-height: 32px; padding: 0 9px; border: 1px solid var(--field); border-radius: 6px; width: 100%; background: var(--card); color: var(--ink); }
.fld textarea { padding: 7px 9px; min-height: 56px; resize: vertical; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .inp:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
.fld input[readonly] { background: var(--bg); border-style: dashed; font-weight: 600; }
.chk { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 13px; }
.chk input { width: 16px; height: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; align-items: end; }
.cap { font-size: 10.5px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; }
.hint { font-size: 11px; color: var(--mute); font-weight: 400; }
.sub { padding: 8px; background: var(--sub); border-radius: 8px; }

/* page frame */
.page { padding: 12px 16px 16px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.bar { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bar h1 { font-size: 17px; margin: 0; font-weight: 600; }
.crumb { font-size: 14px; } .crumb b { font-weight: 600; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }

/* list view */
.search { flex: 1 1 280px; display: flex; justify-content: center; }
.search label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--field); border-radius: 6px; padding: 0 12px; min-height: 36px; width: 100%; max-width: 440px; background: var(--card); color: var(--mute); }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; background: transparent; color: var(--ink); }
.tbl-wrap { overflow-x: auto; }
.tbl-wrap.open { overflow: visible; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--mute); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.tbl td { padding: 5px 12px; height: 40px; border-bottom: 1px solid var(--line2); }
.tbl .num { text-align: right; }
.tbl tbody tr.click { cursor: pointer; } .tbl tbody tr.click:hover { background: var(--hover); }
.tbl td.calc { background: var(--bg); color: var(--mute); }
.tbl tr.flash td { background: var(--flash); }
.empty { padding: 32px; text-align: center; color: var(--mute); }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--chip-bg); color: var(--chip-ink); }
.copytag { margin-top: 3px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--blue-l); color: var(--blue-d); font-size: 12px; font-weight: 600; white-space: nowrap; }

/* list view, Odoo-style */
.bar.ctrl { gap: 10px 16px; }
.ctrl-l { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; min-width: 0; }
.ctrl-r { display: flex; justify-content: flex-end; flex: 1 1 200px; }
.bar.ctrl .search { flex: 2 1 320px; }
.selpill { display: inline-flex; align-items: center; gap: 2px; padding: 0 2px 0 10px; border-radius: 6px; background: var(--blue-l); color: var(--blue-d); font-weight: 600; min-height: 34px; }
.selpill .icon-btn { width: 28px; height: 28px; color: inherit; }
.pager { display: flex; align-items: center; gap: 4px; color: var(--mute); white-space: nowrap; }
.pager span { margin-right: 6px; color: var(--ink); }
.pager .icon-btn { width: 30px; height: 30px; font-size: 18px; }
.pager .icon-btn:disabled { opacity: .4; cursor: default; }
.listwrap { background: var(--card); border-bottom: 1px solid var(--line); }
table.olist { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 13px; }
.olist thead th { position: sticky; top: 0; background: var(--card); border-bottom: 1px solid var(--line); padding: 0; text-align: left; font-weight: 700; white-space: nowrap; z-index: 1; }
.olist thead th button { width: 100%; min-height: 36px; padding: 0 12px; border: 0; background: transparent; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; text-align: inherit; }
.olist thead th.num button { justify-content: flex-end; }
.olist thead th button:hover { background: var(--hover); }
.olist thead th > span { display: block; padding: 0 12px; line-height: 36px; }
.olist thead th.selc { padding: 0 0 0 14px; }
.sorti { width: 10px; height: 10px; display: inline-flex; color: var(--mute); }
.olist thead th button:hover .sorti:not(.on)::before { content: ""; width: 0; height: 0; margin: 2px auto 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--field); }
.sorti.on { color: var(--ink); }
.olist td { padding: 0 12px; height: 34px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
.olist .num { text-align: right; }
.olist td.dim { color: var(--mute); }
.olist tbody tr.click { cursor: pointer; }
.olist tbody tr:hover td { background: var(--hover); }
.olist tbody tr.sel td { background: var(--blue-l); }
.olist .selc { width: 40px; padding: 0 0 0 14px; }
.olist .selc input { width: 15px; height: 15px; vertical-align: middle; }
.olist td.wrap { white-space: normal; min-width: 220px; max-width: 360px; padding-top: 6px; padding-bottom: 6px; }
.olist tbody tr.flash td { background: var(--flash); }
.lbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); min-height: 50px; }
.olist th.coltog { width: 36px; position: relative; text-align: right; }
.olist th.coltog > button { width: 36px; justify-content: center; color: var(--mute); padding: 0; }
.colmenu { position: absolute; right: 4px; top: 36px; z-index: 6; min-width: 200px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 6px 10px; font-weight: 400; text-align: left; }
.colmenu .chk { min-height: 30px; white-space: nowrap; }
.olist tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--line); height: 34px; }

/* form */
.tabs { display: flex; justify-content: center; gap: 4px; border-bottom: 1px solid var(--field); }
.tabs button { min-height: 36px; padding: 0 16px; font-size: 13px; border: 0; background: transparent; font-weight: 600; color: var(--mute); border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--blue); }
.notice { display: flex; align-items: center; gap: 12px; padding: 4px 6px 4px 14px; border-radius: 8px; background: var(--blue-l); border: 1px solid var(--blue-b); color: var(--blue-d); font-weight: 600; }
.notice div { flex: 1; }
.totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 14px; }
.total { flex: 0 1 220px; padding: 14px 18px; } .total b { display: block; font-size: 24px; margin-top: 4px; color: var(--mute); }
.total.dark { background: var(--ink); color: var(--onink); border-color: var(--ink); } .total.dark .cap { color: var(--onink); opacity: .75; } .total.dark b { color: var(--onink); }
.editing { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--flash); border: 1px solid var(--flash-b); font-weight: 600; font-size: 13px; }

/* cover editor: left two thirds = Line card over the Cover card; right third = Flat Pattern View, full height */
.ed-cards { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.ed-cards .leftcol { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; }
.ed-cards .leftcol > .card { overflow-y: auto; }
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 0 -2px; }
.btn.small { min-height: 28px; padding: 0 10px; font-size: 12px; }
.linegrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px 12px; align-content: start; }
.linegrid .g-quote { grid-column: 1 / span 2; } .linegrid .g-cust { grid-column: span 6; } .linegrid .g-pl { grid-column: span 4; }
.linegrid .g-sn { grid-column: 1 / span 1; } .linegrid .g-prod { grid-column: span 4; } .linegrid .g-descr { grid-column: span 7; }
.linegrid .g-loc { grid-column: 1 / span 8; } .linegrid .g-qty { grid-column: span 2; } .linegrid .g-msrp { grid-column: span 2; }
.g-msrp .sqused { height: 36px; min-height: 0; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--sub); justify-content: flex-end; gap: 6px; font-variant-numeric: tabular-nums; }
.sfld .sicon { position: relative; display: block; } .sfld .sicon svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--mute); pointer-events: none; }
.sfld input { width: 100%; padding-left: 30px; }
.linegrid .lrow1 { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; }
.combo { min-height: 0; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.combo-head { padding: 10px 14px; border-bottom: 1px solid var(--line2); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.combo-head .seg { flex: 1 1 320px; max-width: 480px; }
.combo-body { display: flex; flex-wrap: wrap; padding: 10px 0; row-gap: 12px; }
.combo-body > section { flex: 1 1 240px; min-width: 0; padding: 0 14px; display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--line2); margin-left: -1px; }
.endrow { display: flex; flex-direction: column; gap: 5px; }
.endrow + .endrow { border-top: 1px solid var(--line2); padding-top: 8px; }
.endname { font-size: 12px; font-weight: 600; }

/* flat pattern view */
.flat { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.flat-top { padding: 10px 14px; border-bottom: 1px solid var(--line2); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.flat-title { font-size: 14px; font-weight: 600; flex: 1 1 auto; }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.legend i { display: inline-block; width: 18px; border-top: 3px solid var(--cut); }
.legend i.pen { border-top-color: var(--pen); }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; flex: 1 1 100%; }
.tools .grp { display: flex; align-items: center; gap: 4px; }
.tools .val { font-weight: 600; min-width: 58px; }
.canvas { flex: 1; min-height: 0; overflow: auto; padding: 14px; display: flex; align-items: center; justify-content: center;
  background-color: var(--canvas); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; }
.canvas .zoom { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; transform-origin: center; transition: transform .15s; }
.canvas #flatOut { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.canvas svg { display: block; width: 100%; height: 100%; }
.canvas svg .cut { stroke: var(--cut); } .canvas svg .pen { stroke: var(--pen); } .canvas svg .lbl { fill: var(--pen); font-family: inherit; font-weight: 500; }
.splitnote { margin: 0; padding: 8px 14px; background: var(--flash); border-bottom: 1px solid var(--flash-b); font-size: 12px; line-height: 1.45; }
.flat { position: relative; }
.sm-check { padding: 8px 10px; border-radius: 8px; font-size: 12px; line-height: 1.45; }
.sm-check.bad { background: var(--flash); } .sm-check.good { background: rgba(46,125,50,.10); }
.sm-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 8px; font-weight: 600; font-size: 12px; }
.sm-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.splitok { font-size: 12px; color: var(--pen); font-weight: 600; white-space: normal; }
.splitnote.fits { background: rgba(46,125,50,.10); border-bottom-color: rgba(46,125,50,.3); }
.splitbtn.warn { color: var(--err); border-color: var(--err-b); }
.splitbtn.on { background: var(--ink); color: var(--onink); border-color: var(--ink); }
.splittag { display: inline-block; font-size: 12px; color: var(--err); font-weight: 600; white-space: normal; }
.canvas .err { max-width: 460px; padding: 14px 16px; border-radius: 8px; background: var(--err-bg); color: var(--err); font-weight: 600; text-align: center; }
.flat-foot { padding: 10px 14px; border-top: 1px solid var(--line2); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.flat-foot .hint { flex: 1 1 200px; }

@media (max-width: 1000px) {
  .ed-cards { display: flex; flex-direction: column; height: auto !important; }
  .canvas { min-height: 380px; }
}

/* sign-in screens: clean and bright, brand and cover tiles on the left, a white card on the right (follows dark mode) */
body.signedout .topbar, body.signedout .banner { display: none; }
.auth { min-height: 100vh; display: flex; flex-wrap: wrap; background: linear-gradient(135deg, #F6F4EF 0%, #FBF1DC 100%); color: #1E1608;
  --a-ink: #1E1608; --a-mute: #5B6675; --a-card: #FFFFFF; --a-line: #E1E5EA; --a-field: #C9D0D9; --a-seg: #EEF1F5; --a-tint: #FBF1DC; --a-acc: #D9981A; --a-acc-ink: #8A5D0C; --a-shadow: 0 1px 2px rgba(20,32,46,.06), 0 20px 50px rgba(20,32,46,.10); }
html[data-theme="dark"] .auth { background: linear-gradient(135deg, #0F141A 0%, #1A1812 100%); color: #E6EAF0;
  --a-ink: #E6EAF0; --a-mute: #9AA6B4; --a-card: #18202A; --a-line: #2A3441; --a-field: #3A4656; --a-seg: #222B36; --a-tint: #2E230F; --a-acc: #E3A73A; --a-acc-ink: #EDBB5E; --a-shadow: 0 20px 50px rgba(0,0,0,.45); }
.auth-brand { flex: 1 1 600px; display: flex; flex-direction: column; padding: 44px 64px; }
.auth-logo { display: flex; align-items: center; gap: 12px; }
.auth-mark { width: 44px; height: 44px; object-fit: contain; border-radius: 0; background: none; color: var(--a-card); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.auth-logo b { display: block; font-size: 17px; font-weight: 700; color: var(--a-ink); }
.auth-logo span { display: block; font-size: 13px; color: var(--a-mute); margin-top: 2px; }
.auth-copy { margin: auto 0; max-width: 640px; padding: 40px 0; }
.auth-pill { display: inline-flex; padding: 6px 12px; border-radius: 999px; background: var(--a-tint); color: var(--a-acc-ink); font-size: 13px; font-weight: 600; }
.auth-copy h1 { margin: 18px 0 0; font-size: 48px; line-height: 1.06; font-weight: 800; letter-spacing: -.015em; color: var(--a-ink); }
.auth-copy p { margin: 18px 0 0; font-size: 17px; line-height: 1.55; color: var(--a-mute); max-width: 520px; }
.auth-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
.auth-tile { padding: 16px; border-radius: 14px; background: var(--a-card); box-shadow: var(--a-shadow); display: flex; align-items: center; justify-content: center; }
.auth-ti { width: 42px; height: 42px; border-radius: 12px; background: var(--a-tint); color: var(--a-acc); display: flex; align-items: center; justify-content: center; }
.auth-tile b { font-size: 15px; color: var(--a-ink); }
.auth-tile span { font-size: 13px; line-height: 1.4; color: var(--a-mute); }
.auth-side { flex: 1 1 460px; display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.auth-card { width: 100%; max-width: 430px; padding: 34px; border-radius: 18px; background: var(--a-card); box-shadow: var(--a-shadow); display: flex; flex-direction: column; gap: 16px; color: var(--a-ink); }
.auth-card h2 { margin: 0; font-size: 26px; font-weight: 700; }
.auth-sub { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--a-mute); }
.auth-google { min-height: 46px; border-radius: 10px; border: 1px solid var(--a-field); background: var(--a-card); color: var(--a-ink); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; }
.auth-google:hover { background: var(--a-seg); }
.auth-or { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--a-mute); }
.auth-or i { flex: 1; height: 1px; background: var(--a-line); }
.auth-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 10px; background: var(--a-seg); }
.auth-tabs button { min-height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--a-ink); font-weight: 600; font-size: 13px; }
.auth-tabs button.on { background: var(--a-ink); color: var(--a-card); }
.auth-fld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.auth-fld input { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--a-field); background: var(--a-card); color: var(--a-ink); font-weight: 400; }
.auth-fld input:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
.auth-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-row a { color: var(--blue); font-weight: 500; }
.auth-submit { min-height: 46px; border-radius: 10px; border: 0; background: var(--acc-fill); color: var(--onacc); font-weight: 700; font-size: 15px; }
.auth-submit:hover { background: var(--acc-fill-d); }
.auth-link { background: none; border: 0; color: var(--blue); font-weight: 600; min-height: 36px; }
.auth-err { padding: 10px 12px; border-radius: 10px; background: var(--err-bg); color: var(--err); font-size: 13px; font-weight: 600; }
.auth-ok { padding: 10px 12px; border-radius: 10px; background: rgba(46,125,50,.12); color: var(--pen); font-size: 13px; font-weight: 600; }
.auth-foot { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--a-line); display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--a-mute); }
.auth-foot span:last-child { white-space: nowrap; }
@media (max-width: 1100px) { .auth-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .auth-brand { padding: 28px 24px 0; } .auth-copy { padding: 24px 0 0; } .auth-copy h1 { font-size: 34px; } }

/* sign in, dialogs, toast */
.signin-old { max-width: 400px; margin: 60px auto; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.signin h1 { margin: 0; font-size: 20px; }
.or { text-align: center; color: var(--mute); font-size: 12px; }
.err-msg { color: var(--err); font-size: 13px; font-weight: 600; }
.ok-msg { color: var(--pen); font-size: 13px; font-weight: 600; }
.dlg { border: 0; border-radius: 10px; padding: 0; width: min(560px, 94vw); box-shadow: var(--shadow); background: var(--card); color: var(--ink); }
.dlg::backdrop { background: rgba(10, 14, 20, .55); }
.dlg .dh { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 16px; }
.dlg .db { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 65vh; overflow: auto; }
.dlg .df { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.dlg h3 { margin: 0 0 6px; font-size: 13px; }
.userrow { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line2); }
.userrow span { flex: 1; overflow-wrap: anywhere; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--onink); padding: 10px 18px; border-radius: 8px; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); z-index: 30; }
@media (max-width: 700px) { .page { padding: 10px; } .linegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .linegrid .g-quote { grid-column: 1 / span 1; } .linegrid .g-cust, .linegrid .g-pl, .linegrid .g-sn, .linegrid .g-prod, .linegrid .g-descr { grid-column: 1 / -1; } .linegrid .g-loc { grid-column: 1 / span 1; } .linegrid .g-qty { grid-column: span 1; } .linegrid .g-msrp { grid-column: 1 / -1; } }

/* Split, like ARK-Draft2D */
.splitwrap { position: relative; display: inline-flex; }
.splittoggle { width: 44px; padding: 0; justify-content: center; }
.splittoggle.on { color: var(--pen); border-color: var(--pen); background: var(--line2); }
.splittoggle.warn { border-color: #d97706; color: #b45309; }
.splitmenu { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: 460px; max-width: calc(100vw - 32px); box-sizing: border-box; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.splitmenu[hidden] { display: none; }
.splitmenu .smh { font-size: 13px; color: var(--mute); padding: 2px 4px 6px; }
.splitmenu .sm-check { margin-bottom: 4px; }
.splitmenu .smrow { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 8px; }
.splitmenu .smrow.on { background: var(--line2); }
.splitmenu .smsw { width: 42px; height: 24px; flex: none; border-radius: 12px; border: 0; padding: 0; background: var(--line); position: relative; cursor: pointer; }
.splitmenu .smsw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: left .12s; }
.splitmenu .smsw[aria-checked="true"] { background: var(--pen); }
.splitmenu .smsw[aria-checked="true"]::after { left: 21px; }
.splitmenu .smtx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.splitmenu .smtx b { font-size: 15px; }
.splitmenu .smrow.on .smtx b { color: var(--pen); }
.splitmenu small { color: var(--mute); font-size: 12px; }
.splitmenu .smseg { display: flex; flex: none; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.splitmenu .smseg button { width: 42px; height: 36px; border: 0; border-left: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; }
.splitmenu .smseg button:first-child { border-left: 0; }
.splitmenu .smseg button[aria-pressed="true"] { background: var(--pen); color: #fff; }
.splitmenu .smrow:not(.on) .smseg { opacity: .5; }
.splitmenu .smrow:not(.on) .smseg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.splitmenu .smprev { display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line); margin-top: 6px; padding: 12px 10px 4px; }
.splitmenu .smprev span { display: flex; flex-direction: column; }
.splitmenu .smprev b { font-size: 16px; }
.splitmenu .spbox { fill: var(--card); stroke: var(--pen); stroke-width: 2; }
.splitmenu .spcut { stroke: var(--cut, #d32f2f); stroke-width: 2; stroke-dasharray: 5 4; fill: none; }
.splitmenu .smfoot { padding: 4px 10px 0; }
.splitmenu .smoff { background: none; border: 0; padding: 4px 0; color: var(--mute); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

/* Settings: sections */
dialog.wide { width: min(1280px, calc(100vw - 32px)); max-width: none; }
.setwrap { display: grid; grid-template-columns: 180px minmax(0, 1fr); min-height: 420px; }
.setnav { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-right: 1px solid var(--line); background: var(--bg); }
.setnav button { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.setnav button:hover { background: var(--line2); }
.setnav button.on { background: var(--card); box-shadow: inset 3px 0 0 var(--blue); font-weight: 600; }
.setnav .ti { font-size: 18px; color: var(--mute); }
.setbody { display: flex; flex-direction: column; gap: 22px; height: min(78vh, 900px); max-height: none; overflow: auto; }
.setbody h3 { margin: 0 0 6px; }
.setbtns { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
table.olist.settbl { min-width: 0; }
.settbl td { padding: 4px 6px; } .settbl .inp { width: 100%; min-width: 0; } .settbl input.num { text-align: right; max-width: 110px; }
@media (max-width: 700px) { .setwrap { grid-template-columns: 1fr; } .setnav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); } }
.mattbl { width: 100%; table-layout: fixed; }

/* ---------- phones ---------- */
@media (max-width: 700px) {
  .topbar { flex-wrap: nowrap; gap: 12px; padding: 0 10px; }
  .brand { font-size: 14px; white-space: nowrap; }
  .topnav { min-width: 0; }
  .ver { display: none; }
  .topright { margin-left: auto; gap: 2px; }
  .bar { padding: 8px 10px; gap: 8px; }
  .bar .crumb { flex: 1 1 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bar .pager { margin-left: auto; }
  .seg button { font-size: 11.5px; padding: 0 4px; line-height: 1.15; }
  .canvas { min-height: 300px; height: 58vh; }
  .flat .tools { gap: 6px; }
  .totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .total { padding: 10px 12px; } .total b { font-size: 18px; } .total .cap { font-size: 10px; }
  dialog.wide { width: calc(100vw - 16px); }
  .setwrap { min-height: 0; grid-template-rows: auto minmax(0, 1fr); }
  .setnav { align-items: center; align-self: start; gap: 4px; padding: 6px 8px; }
  .mattbl .empty td { text-align: left; }
  .setnav button { flex: none; min-height: 34px; padding: 0 12px; }
  .setnav button.on { box-shadow: inset 0 -3px 0 var(--blue); }
  .setbody { max-height: 62vh; }
  .setbody .tbl-wrap { overflow-x: auto; }
  table.olist.mattbl { min-width: 640px; }
  .splitmenu { position: fixed; left: 8px; right: 8px; top: 50%; width: auto; max-width: none; transform: translateY(-50%); }
  .splitmenu .smseg button { width: 36px; } .splitmenu .smrow { gap: 8px; padding: 8px 6px; } .splitmenu .smprev svg { width: 110px; height: 62px; }
}

/* colour schemes (avatar menu): accent and top bar. Default = Navy and gold; Classic blue = the original colours */
html[data-scheme] { --topink: #FFFFFF; --topmute: #C9D1DB; --tophover: rgba(255,255,255,.12); --acc-fill: var(--blue); --acc-fill-d: var(--blue-d); --onacc: #FFFFFF; --avbg: var(--blue); --avink: #FFFFFF; }
html[data-scheme][data-theme="dark"] { --topmute: #9AA6B4; --onacc: #0F141A; --avink: #0F141A; }
html[data-scheme] .launch { background: radial-gradient(ellipse at 50% 70%, #34476A 0%, #1F2A3C 52%, #121925 100%); }
html[data-scheme="navygold"] { --blue: #86682F; --blue-d: #6E5525; --blue-l: #F4EEE1; --blue-b: #DCC9A0; --topbg: #1F2A3C; }
html[data-scheme="navygold"][data-theme="dark"] { --blue: #D0B275; --blue-d: #DEC48E; --blue-l: #2B2617; --blue-b: #5A4C2A; --topbg: #111723; }
html[data-scheme="classic"] { --blue: #1F5FBF; --blue-d: #174A96; --blue-l: #E8F0FB; --blue-b: #B9CDEB; --topbg: #1B2430; }
html[data-scheme="classic"][data-theme="dark"] { --blue: #4C8DF0; --blue-d: #6FA3F3; --blue-l: #1C2C44; --blue-b: #2D4A73; --topbg: #0A0E13; }
html[data-scheme="ocean"] { --blue: #0E7490; --blue-d: color-mix(in srgb, #0E7490 80%, #000); --blue-l: color-mix(in srgb, #0E7490 9%, #fff); --blue-b: color-mix(in srgb, #0E7490 35%, #fff); --topbg: #0B3A4A; }
html[data-scheme="ocean"][data-theme="dark"] { --blue: #22B3D6; --blue-d: color-mix(in srgb, #22B3D6 80%, #fff); --blue-l: color-mix(in srgb, #22B3D6 18%, #18202A); --blue-b: color-mix(in srgb, #22B3D6 45%, #18202A); --topbg: #061C24; }
html[data-scheme="forest"] { --blue: #2E7D32; --blue-d: color-mix(in srgb, #2E7D32 80%, #000); --blue-l: color-mix(in srgb, #2E7D32 9%, #fff); --blue-b: color-mix(in srgb, #2E7D32 35%, #fff); --topbg: #1E3A24; }
html[data-scheme="forest"][data-theme="dark"] { --blue: #5CCB6E; --blue-d: color-mix(in srgb, #5CCB6E 80%, #fff); --blue-l: color-mix(in srgb, #5CCB6E 18%, #18202A); --blue-b: color-mix(in srgb, #5CCB6E 45%, #18202A); --topbg: #0C1A10; }
html[data-scheme="crimson"] { --blue: #B42318; --blue-d: color-mix(in srgb, #B42318 80%, #000); --blue-l: color-mix(in srgb, #B42318 9%, #fff); --blue-b: color-mix(in srgb, #B42318 35%, #fff); --topbg: #3D1414; }
html[data-scheme="crimson"][data-theme="dark"] { --blue: #F0645A; --blue-d: color-mix(in srgb, #F0645A 80%, #fff); --blue-l: color-mix(in srgb, #F0645A 18%, #18202A); --blue-b: color-mix(in srgb, #F0645A 45%, #18202A); --topbg: #1C0909; }
html[data-scheme="sunset"] { --blue: #C2410C; --blue-d: color-mix(in srgb, #C2410C 80%, #000); --blue-l: color-mix(in srgb, #C2410C 9%, #fff); --blue-b: color-mix(in srgb, #C2410C 35%, #fff); --topbg: #3A1F12; }
html[data-scheme="sunset"][data-theme="dark"] { --blue: #F58A4B; --blue-d: color-mix(in srgb, #F58A4B 80%, #fff); --blue-l: color-mix(in srgb, #F58A4B 18%, #18202A); --blue-b: color-mix(in srgb, #F58A4B 45%, #18202A); --topbg: #1A0E08; }
html[data-scheme="gold"] { --blue: #A16207; --blue-d: color-mix(in srgb, #A16207 80%, #000); --blue-l: color-mix(in srgb, #A16207 9%, #fff); --blue-b: color-mix(in srgb, #A16207 35%, #fff); --topbg: #3A2E12; }
html[data-scheme="gold"][data-theme="dark"] { --blue: #E0A93A; --blue-d: color-mix(in srgb, #E0A93A 80%, #fff); --blue-l: color-mix(in srgb, #E0A93A 18%, #18202A); --blue-b: color-mix(in srgb, #E0A93A 45%, #18202A); --topbg: #1A1408; }
html[data-scheme="violet"] { --blue: #6D28D9; --blue-d: color-mix(in srgb, #6D28D9 80%, #000); --blue-l: color-mix(in srgb, #6D28D9 9%, #fff); --blue-b: color-mix(in srgb, #6D28D9 35%, #fff); --topbg: #2A1B45; }
html[data-scheme="violet"][data-theme="dark"] { --blue: #A07CF0; --blue-d: color-mix(in srgb, #A07CF0 80%, #fff); --blue-l: color-mix(in srgb, #A07CF0 18%, #18202A); --blue-b: color-mix(in srgb, #A07CF0 45%, #18202A); --topbg: #130C21; }
html[data-scheme="teal"] { --blue: #0F766E; --blue-d: color-mix(in srgb, #0F766E 80%, #000); --blue-l: color-mix(in srgb, #0F766E 9%, #fff); --blue-b: color-mix(in srgb, #0F766E 35%, #fff); --topbg: #123532; }
html[data-scheme="teal"][data-theme="dark"] { --blue: #2EC4B6; --blue-d: color-mix(in srgb, #2EC4B6 80%, #fff); --blue-l: color-mix(in srgb, #2EC4B6 18%, #18202A); --blue-b: color-mix(in srgb, #2EC4B6 45%, #18202A); --topbg: #081917; }
html[data-scheme="rose"] { --blue: #BE185D; --blue-d: color-mix(in srgb, #BE185D 80%, #000); --blue-l: color-mix(in srgb, #BE185D 9%, #fff); --blue-b: color-mix(in srgb, #BE185D 35%, #fff); --topbg: #3B1427; }
html[data-scheme="rose"][data-theme="dark"] { --blue: #F0619E; --blue-d: color-mix(in srgb, #F0619E 80%, #fff); --blue-l: color-mix(in srgb, #F0619E 18%, #18202A); --blue-b: color-mix(in srgb, #F0619E 45%, #18202A); --topbg: #1C0912; }
html[data-scheme="indigo"] { --blue: #4338CA; --blue-d: color-mix(in srgb, #4338CA 80%, #000); --blue-l: color-mix(in srgb, #4338CA 9%, #fff); --blue-b: color-mix(in srgb, #4338CA 35%, #fff); --topbg: #1E1B4B; }
html[data-scheme="indigo"][data-theme="dark"] { --blue: #818CF8; --blue-d: color-mix(in srgb, #818CF8 80%, #fff); --blue-l: color-mix(in srgb, #818CF8 18%, #18202A); --blue-b: color-mix(in srgb, #818CF8 45%, #18202A); --topbg: #0E0C24; }
html[data-scheme="graphite"] { --blue: #374151; --blue-d: color-mix(in srgb, #374151 80%, #000); --blue-l: color-mix(in srgb, #374151 9%, #fff); --blue-b: color-mix(in srgb, #374151 35%, #fff); --topbg: #111827; }
html[data-scheme="graphite"][data-theme="dark"] { --blue: #9CA3AF; --blue-d: color-mix(in srgb, #9CA3AF 80%, #fff); --blue-l: color-mix(in srgb, #9CA3AF 18%, #18202A); --blue-b: color-mix(in srgb, #9CA3AF 45%, #18202A); --topbg: #05070A; }
.mscheme { padding: 8px 12px 10px; border-top: 1px solid var(--line); }
.mscheme .cap { display: block; margin-bottom: 8px; }
.swatches { display: grid; grid-template-columns: repeat(6, 28px); gap: 8px; }
.menu .swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); padding: 0; cursor: pointer; background: linear-gradient(135deg, var(--sw-a) 50%, var(--sw-t) 50%); }
.menu .swatch:hover { background: linear-gradient(135deg, var(--sw-a) 50%, var(--sw-t) 50%); transform: scale(1.08); }
.menu .swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.update-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--ink); color: var(--onink); box-shadow: var(--shadow); font-size: 13px; }
.update-bar .btn { min-height: 30px; }

/* ---------- STCI Apps: home tiles and apps ---------- */
.topbar .homebtn { margin-left: -6px; margin-right: -14px; }
.topbar .homebtn[aria-pressed="true"] { background: var(--tophover); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body[data-app="home"] #app, body[data-app="schedule"] #app { padding: 0; max-width: none; }
.launch { min-height: calc(100vh - 52px); box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 40px; padding: 64px 24px 28px;
  background: radial-gradient(ellipse at 50% 70%, #5A4113 0%, #2A1F0C 52%, #140F07 100%); }
html[data-theme="dark"] .launch { background: radial-gradient(ellipse at 50% 70%, #3A2A0E 0%, #1A140A 55%, #0C0905 100%); }
.tiles { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 36px 48px; max-width: 900px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 140px; padding: 8px 0; border: 0; border-radius: 16px; background: transparent; color: #fff; font: inherit; font-size: 15px; font-weight: 500; text-shadow: 0 1px 2px rgba(0,0,0,.4); cursor: pointer; }
.tile-ic { width: 112px; height: 112px; border-radius: 24px; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .15s, box-shadow .15s; }
.tile-ic svg { width: 70px; height: 70px; }
.tile:hover .tile-ic { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(0,0,0,.35); }
.tile:focus-visible { outline: 3px solid #D0B275; outline-offset: 4px; }
.launch-foot { margin-top: auto; color: rgba(242,236,221,.55); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 14px; }
.appframe { display: block; width: 100%; height: calc(100vh - 52px); border: 0; background: var(--bg); }
@media (max-width: 700px) { .topbar .homebtn { margin-right: -4px; } }
@media (max-width: 640px) { .tile { width: 104px; } .tile-ic { width: 84px; height: 84px; border-radius: 18px; } .tile-ic svg { width: 48px; height: 48px; } .tiles { gap: 24px 20px; } .launch { padding-top: 40px; } }

/* ---------- quote form: Cover and Order Lines side by side, Flat Pattern View floating on top ---------- */
.split2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; min-height: 0; }
.split2 .half { min-width: 0; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.split2 .half-cover .ed-cards { display: block; height: auto !important; }
.split2 .half-cover .leftcol { display: flex; flex-direction: column; gap: 12px; }
.halfh { margin: 0; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); padding: 2px 2px 0; }
.edact { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 -6px 16px rgba(0,0,0,.06); }
.edact .grow { flex: 1 1 auto; text-align: right; }
.flatbtn { display: inline-flex; align-items: center; gap: 8px; }
.flatbtn[aria-pressed="true"] { background: var(--blue-l); border-color: var(--blue-b); color: var(--blue); }
.flat.float { position: fixed; z-index: 40; top: 120px; right: 16px; width: min(560px, 46vw); height: min(640px, calc(100vh - 140px)); overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,.28); border-color: var(--blue-b); }
.flat.float[hidden] { display: none; }
.flat.float .flat-title { cursor: move; user-select: none; touch-action: none; }
.flatclose { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--field); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.flatclose:hover { background: var(--err-bg); border-color: var(--err-b); color: var(--err); }
@media (max-width: 1000px) {
  .split2 { grid-template-columns: minmax(0, 1fr); height: auto !important; }
  .split2 .half { overflow: visible; }
}
@media (max-width: 700px) {
  .flat.float { left: 6px !important; right: 6px !important; top: auto !important; bottom: 6px; width: auto; height: 62vh; resize: none; }
  .flat.float .flat-title { cursor: default; }
}
.stepper { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.stepper .val { min-width: 44px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper .icon-btn { width: 34px; height: 34px; }
.subrow .fld { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }

/* logo */
.toplogo { width: 26px; height: 26px; margin-right: -14px; flex: none; background: var(--topink); -webkit-mask: url(../img/logo.svg) center / contain no-repeat; mask: url(../img/logo.svg) center / contain no-repeat; }
html[data-scheme] .toplogo { background: var(--logo, #D9981A); }
.launch-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.launch-foot img { opacity: .9; }
@media (max-width: 700px) { .toplogo { margin-right: -4px; width: 22px; height: 22px; } }

/* Order Lines: drag handle to reorder (like Odoo's sequence handle) */
.olist .dragc { width: 26px; padding: 0 0 0 8px; }
.draghandle { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 28px; border: 0; border-radius: 4px; background: none; color: var(--mute); cursor: grab; touch-action: none; padding: 0; }
.draghandle:hover, .draghandle:focus-visible { background: var(--line2); color: var(--ink); }
.linetbl tr.dragging { opacity: .6; outline: 2px dashed var(--blue-b); outline-offset: -2px; }
.linetbl tr.dragging .draghandle { cursor: grabbing; }

/* happy colour schemes: bright top bar and buttons (text on them dark or white, whichever reads) */
html[data-scheme="sunshine"] { --topbg: #F5C518; --topink: #1C1A17; --topmute: #5D4D17; --tophover: rgba(0,0,0,.10); --blue: #000000; --blue-d: #000000; --blue-l: #FEF7DF; --blue-b: #FAE597; --acc-fill: #F5C518; --acc-fill-d: #DCB116; --onacc: #1C1A17; --avbg: #1C1A17; --avink: #F5C518; --logo: #1C1A17; }
html[data-scheme="sunshine"][data-theme="dark"] { --topbg: #2A2410; --topink: #F6CE3B; --topmute: #AF922C; --tophover: rgba(255,255,255,.10); --blue: #F6CE3B; --blue-d: #F8D862; --blue-l: #38341A; --blue-b: #766419; --acc-fill: #F6CE3B; --acc-fill-d: #F7D558; --onacc: #1C1A17; --avbg: #F6CE3B; --avink: #1C1A17; }
html[data-scheme="tangerine"] { --topbg: #FF8A3D; --topink: #1C1A17; --topmute: #603C22; --tophover: rgba(0,0,0,.10); --blue: #000000; --blue-d: #000000; --blue-l: #FFEFE4; --blue-b: #FFCAA8; --acc-fill: #FF8A3D; --acc-fill-d: #E67C37; --onacc: #1C1A17; --avbg: #1C1A17; --avink: #FF8A3D; --logo: #1C1A17; }
html[data-scheme="tangerine"][data-theme="dark"] { --topbg: #2E1A0E; --topink: #FF9C5A; --topmute: #B66E3F; --tophover: rgba(255,255,255,.10); --blue: #FF9C5A; --blue-d: #FFB07B; --blue-l: #3A2920; --blue-b: #7B492A; --acc-fill: #FF9C5A; --acc-fill-d: #FFAB73; --onacc: #1C1A17; --avbg: #FF9C5A; --avink: #1C1A17; }
html[data-scheme="lime"] { --topbg: #8CCB2F; --topink: #1C1A17; --topmute: #3E4F1E; --tophover: rgba(0,0,0,.10); --blue: #000000; --blue-d: #000000; --blue-l: #EFF8E2; --blue-b: #CBE8A1; --acc-fill: #8CCB2F; --acc-fill-d: #7EB72A; --onacc: #1C1A17; --avbg: #1C1A17; --avink: #8CCB2F; --logo: #1C1A17; }
html[data-scheme="lime"][data-theme="dark"] { --topbg: #1A2610; --topink: #9DD34E; --topmute: #6F9638; --tophover: rgba(255,255,255,.10); --blue: #9DD34E; --blue-d: #B1DC71; --blue-l: #26351E; --blue-b: #476623; --acc-fill: #9DD34E; --acc-fill-d: #ACDA69; --onacc: #1C1A17; --avbg: #9DD34E; --avink: #1C1A17; }
html[data-scheme="sky"] { --topbg: #3BA7F0; --topink: #1C1A17; --topmute: #254458; --tophover: rgba(0,0,0,.10); --blue: #000000; --blue-d: #000000; --blue-l: #E4F3FD; --blue-b: #A7D7F8; --acc-fill: #3BA7F0; --acc-fill-d: #3596D8; --onacc: #1C1A17; --avbg: #1C1A17; --avink: #3BA7F0; --logo: #1C1A17; }
html[data-scheme="sky"][data-theme="dark"] { --topbg: #0E2233; --topink: #58B4F2; --topmute: #3E81AF; --tophover: rgba(255,255,255,.10); --blue: #58B4F2; --blue-d: #79C3F5; --blue-l: #172E41; --blue-b: #23567A; --acc-fill: #58B4F2; --acc-fill-d: #71BFF4; --onacc: #1C1A17; --avbg: #58B4F2; --avink: #1C1A17; }
html[data-scheme="lagoon"] { --topbg: #1EC8B0; --topink: #1C1A17; --topmute: #1D4E45; --tophover: rgba(0,0,0,.10); --blue: #000000; --blue-d: #000000; --blue-l: #E0F7F4; --blue-b: #9AE6DB; --acc-fill: #1EC8B0; --acc-fill-d: #1BB49E; --onacc: #1C1A17; --avbg: #1C1A17; --avink: #1EC8B0; --logo: #1C1A17; }
html[data-scheme="lagoon"][data-theme="dark"] { --topbg: #0C2824; --topink: #40D0BC; --topmute: #2E9587; --tophover: rgba(255,255,255,.10); --blue: #40D0BC; --blue-d: #66D9C9; --blue-l: #123435; --blue-b: #16655E; --acc-fill: #40D0BC; --acc-fill-d: #5DD7C6; --onacc: #1C1A17; --avbg: #40D0BC; --avink: #1C1A17; }
html[data-scheme="bubblegum"] { --topbg: #FF6FAE; --topink: #1C1A17; --topmute: #603444; --tophover: rgba(0,0,0,.10); --blue: #000000; --blue-d: #000000; --blue-l: #FFEBF4; --blue-b: #FFBEDB; --acc-fill: #FF6FAE; --acc-fill-d: #E6649D; --onacc: #1C1A17; --avbg: #1C1A17; --avink: #FF6FAE; --logo: #1C1A17; }
html[data-scheme="bubblegum"][data-theme="dark"] { --topbg: #2E1220; --topink: #FF85BA; --topmute: #B65D84; --tophover: rgba(255,255,255,.10); --blue: #FF85BA; --blue-d: #FF9DC8; --blue-l: #3A2435; --blue-b: #7B3D5D; --acc-fill: #FF85BA; --acc-fill-d: #FF97C4; --onacc: #1C1A17; --avbg: #FF85BA; --avink: #1C1A17; }
html[data-scheme="grape"] { --topbg: #8B5CF6; --topink: #1C1A17; --topmute: #3D2E5A; --tophover: rgba(0,0,0,.10); --blue: #000000; --blue-d: #000000; --blue-l: #EFE8FE; --blue-b: #CBB6FB; --acc-fill: #8B5CF6; --acc-fill-d: #7D53DD; --onacc: #1C1A17; --avbg: #1C1A17; --avink: #8B5CF6; --logo: #1C1A17; }
html[data-scheme="grape"][data-theme="dark"] { --topbg: #1E1533; --topink: #9C74F7; --topmute: #7053B2; --tophover: rgba(255,255,255,.10); --blue: #9C74F7; --blue-d: #B090F9; --blue-l: #252142; --blue-b: #47347D; --acc-fill: #9C74F7; --acc-fill-d: #AB89F8; --onacc: #1C1A17; --avbg: #9C74F7; --avink: #1C1A17; }
html[data-scheme="coral"] { --topbg: #FF6B6B; --topink: #1C1A17; --topmute: #603230; --tophover: rgba(0,0,0,.10); --blue: #000000; --blue-d: #000000; --blue-l: #FFEAEA; --blue-b: #FFBCBC; --acc-fill: #FF6B6B; --acc-fill-d: #E66060; --onacc: #1C1A17; --avbg: #1C1A17; --avink: #FF6B6B; --logo: #1C1A17; }
html[data-scheme="coral"][data-theme="dark"] { --topbg: #2E1414; --topink: #FF8181; --topmute: #B65B5B; --tophover: rgba(255,255,255,.10); --blue: #FF8181; --blue-d: #FF9A9A; --blue-l: #3A2429; --blue-b: #7B3B3E; --acc-fill: #FF8181; --acc-fill-d: #FF9494; --onacc: #1C1A17; --avbg: #FF8181; --avink: #1C1A17; }
html[data-scheme="mint"] { --topbg: #4FD1A5; --topink: #1C1A17; --topmute: #2B5142; --tophover: rgba(0,0,0,.10); --blue: #000000; --blue-d: #000000; --blue-l: #E6F9F2; --blue-b: #B0EAD6; --acc-fill: #4FD1A5; --acc-fill-d: #47BC94; --onacc: #1C1A17; --avbg: #1C1A17; --avink: #4FD1A5; --logo: #1C1A17; }
html[data-scheme="mint"][data-theme="dark"] { --topbg: #0E2A20; --topink: #69D8B2; --topmute: #499B7F; --tophover: rgba(255,255,255,.10); --blue: #69D8B2; --blue-d: #87E0C1; --blue-l: #1B3633; --blue-b: #2C6959; --acc-fill: #69D8B2; --acc-fill-d: #80DEBE; --onacc: #1C1A17; --avbg: #69D8B2; --avink: #1C1A17; }
html[data-scheme="berry"] { --topbg: #D9346A; --topink: #FFFFFF; --topmute: #F4C2D2; --tophover: rgba(255,255,255,.16); --blue: #000000; --blue-d: #000000; --blue-l: #FAE3EA; --blue-b: #EEA4BC; --acc-fill: #D9346A; --acc-fill-d: #C32F5F; --onacc: #FFFFFF; --avbg: #FFFFFF; --avink: #D9346A; --logo: #FFFFFF; }
html[data-scheme="berry"][data-theme="dark"] { --topbg: #2B0F1A; --topink: #DF5280; --topmute: #A03B5C; --tophover: rgba(255,255,255,.10); --blue: #DF5280; --blue-d: #E57599; --blue-l: #331A28; --blue-b: #6A223E; --acc-fill: #DF5280; --acc-fill-d: #E46C93; --onacc: #1C1A17; --avbg: #DF5280; --avink: #1C1A17; }
.swsep { grid-column: 1 / -1; font-size: 11px; font-weight: 700; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }

/* ---------- Order Lines as a sheet (Excel-like) ---------- */
.sheetbtn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.lbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sheethead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sheethead .btn { margin-left: auto; }
.sheet { display: flex; flex-direction: column; gap: 8px; }
.sh-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sh-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.sh-help { margin-left: auto; }
.sh-wrap { overflow: auto; max-height: calc(100vh - 230px); border: 1px solid var(--field); border-radius: 6px; background: var(--card); outline: none; }
.sh-wrap:focus-visible { box-shadow: 0 0 0 2px var(--blue-b); }
.sh-tbl { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.sh-tbl th, .sh-tbl td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 8px; height: 30px; white-space: nowrap; text-align: left; }
.sh-tbl thead th { position: sticky; top: 0; z-index: 2; background: var(--sub); font-weight: 600; color: var(--mute); }
.sh-tbl thead th.ro, .sh-tbl td.ro { color: var(--mute); }
.sh-tbl td.ro { background: var(--sub); }
.sh-tbl .num { text-align: right; }
.sh-tbl .sh-rh { position: sticky; left: 0; z-index: 1; width: 44px; min-width: 44px; text-align: center; background: var(--sub); color: var(--mute); font-weight: 500; cursor: pointer; user-select: none; }
.sh-tbl thead .sh-rh { z-index: 3; }
.sh-tbl .sh-rh.on { background: var(--blue-l); color: var(--blue); }
.sh-tbl td { cursor: cell; user-select: none; min-width: 90px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.sh-tbl td.in { background: var(--blue-l); }
.sh-tbl td.cur { box-shadow: inset 0 0 0 2px var(--blue); background: var(--card); }
.sh-tbl td.cur.ro { background: var(--sub); }
.sh-tbl .sh-in { width: 100%; min-width: 120px; height: 28px; border: 0; outline: none; padding: 0; background: transparent; font: inherit; color: var(--ink); }
.sh-tbl .sh-in.num { text-align: right; }
.sh-tbl .sh-empty { padding: 20px; color: var(--mute); text-align: center; }
.sh-lock { color: var(--mute); }
.sh-status { min-height: 18px; font-size: 12px; color: var(--mute); }

/* light colour schemes: pale top bar with dark text, coloured buttons */
html[data-scheme="pearl"] { --topbg: #FFFFFF; --topink: #1C1A17; --topmute: #55504A; --tophover: rgba(0,0,0,.06); --logo: #5B6B7F; --blue: #5B6B7F; --blue-d: #4D5B6C; --blue-l: #EBEDF0; --blue-b: #B5BCC5; --acc-fill: #5B6B7F; --acc-fill-d: #505E70; --onacc: #FFFFFF; --avbg: #5B6B7F; --avink: #FFFFFF; }
html[data-scheme="pearl"]:not([data-theme="dark"]) .topbar { box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
html[data-scheme="pearl"][data-theme="dark"] { --topbg: #1A1D22; --topink: #8C97A5; --topmute: #646C77; --tophover: rgba(255,255,255,.10); --logo: #8C97A5; --blue: #8C97A5; --blue-d: #A3ACB7; --blue-l: #1D242C; --blue-b: #313B47; --acc-fill: #8C97A5; --acc-fill-d: #9DA7B2; --onacc: #15120C; --avbg: #8C97A5; --avink: #15120C; }
html[data-scheme="cream"] { --topbg: #FBF3E0; --topink: #1C1A17; --topmute: #55504A; --tophover: rgba(0,0,0,.06); --logo: #9B6B10; --blue: #9B6B10; --blue-d: #845B0E; --blue-l: #F6EFE3; --blue-b: #DBC394; --acc-fill: #B07A12; --acc-fill-d: #9B6B10; --onacc: #1C1A17; --avbg: #B07A12; --avink: #1C1A17; }
html[data-scheme="cream"]:not([data-theme="dark"]) .topbar { box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
html[data-scheme="cream"][data-theme="dark"] { --topbg: #211B10; --topink: #C8A259; --topmute: #8E733F; --tophover: rgba(255,255,255,.10); --logo: #C8A259; --blue: #C8A259; --blue-d: #D3B57A; --blue-l: #2C2619; --blue-b: #574216; --acc-fill: #C8A259; --acc-fill-d: #D0B072; --onacc: #15120C; --avbg: #C8A259; --avink: #15120C; }
html[data-scheme="mist"] { --topbg: #E8EEF4; --topink: #1C1A17; --topmute: #55504A; --tophover: rgba(0,0,0,.06); --logo: #3C77AA; --blue: #3C77AA; --blue-d: #336590; --blue-l: #E8EFF6; --blue-b: #A8C4DC; --acc-fill: #3E7CB1; --acc-fill-d: #376D9C; --onacc: #1C1A17; --avbg: #3E7CB1; --avink: #1C1A17; }
html[data-scheme="mist"]:not([data-theme="dark"]) .topbar { box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
html[data-scheme="mist"][data-theme="dark"] { --topbg: #141A21; --topink: #78A3C8; --topmute: #55738E; --tophover: rgba(255,255,255,.10); --logo: #78A3C8; --blue: #78A3C8; --blue-d: #93B5D3; --blue-l: #172735; --blue-b: #24435E; --acc-fill: #78A3C8; --acc-fill-d: #8CB1D0; --onacc: #15120C; --avbg: #78A3C8; --avink: #15120C; }
html[data-scheme="blush"] { --topbg: #FBE9EC; --topink: #1C1A17; --topmute: #55504A; --tophover: rgba(0,0,0,.06); --logo: #B85168; --blue: #B85168; --blue-d: #9C4558; --blue-l: #F8EBEE; --blue-b: #E4B3BE; --acc-fill: #C4566F; --acc-fill-d: #AC4C62; --onacc: #1C1A17; --avbg: #C4566F; --avink: #1C1A17; }
html[data-scheme="blush"]:not([data-theme="dark"]) .topbar { box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
html[data-scheme="blush"][data-theme="dark"] { --topbg: #24151A; --topink: #D6899A; --topmute: #98606D; --tophover: rgba(255,255,255,.10); --logo: #D6899A; --blue: #D6899A; --blue-d: #DEA1AE; --blue-l: #302029; --blue-b: #603240; --acc-fill: #D6899A; --acc-fill-d: #DC9BA9; --onacc: #15120C; --avbg: #D6899A; --avink: #15120C; }
html[data-scheme="sage"] { --topbg: #E7F0E6; --topink: #1C1A17; --topmute: #55504A; --tophover: rgba(0,0,0,.06); --logo: #487F54; --blue: #487F54; --blue-d: #3D6C47; --blue-l: #EAF1EB; --blue-b: #AFCAB5; --acc-fill: #4E8A5B; --acc-fill-d: #457950; --onacc: #1C1A17; --avbg: #4E8A5B; --avink: #1C1A17; }
html[data-scheme="sage"]:not([data-theme="dark"]) .topbar { box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
html[data-scheme="sage"][data-theme="dark"] { --topbg: #141C15; --topink: #83AD8C; --topmute: #5C7A62; --tophover: rgba(255,255,255,.10); --logo: #83AD8C; --blue: #83AD8C; --blue-d: #9CBDA3; --blue-l: #1A2926; --blue-b: #2B4937; --acc-fill: #83AD8C; --acc-fill-d: #96B99D; --onacc: #15120C; --avbg: #83AD8C; --avink: #15120C; }
html[data-scheme="lavender"] { --topbg: #EEEAFB; --topink: #1C1A17; --topmute: #55504A; --tophover: rgba(0,0,0,.06); --logo: #7259C9; --blue: #7259C9; --blue-d: #614CAB; --blue-l: #EEEBF9; --blue-b: #C0B4E7; --acc-fill: #7259C9; --acc-fill-d: #644EB1; --onacc: #FFFFFF; --avbg: #7259C9; --avink: #FFFFFF; }
html[data-scheme="lavender"]:not([data-theme="dark"]) .topbar { box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
html[data-scheme="lavender"][data-theme="dark"] { --topbg: #1A1726; --topink: #9C8BD9; --topmute: #6E629A; --tophover: rgba(255,255,255,.10); --logo: #9C8BD9; --blue: #9C8BD9; --blue-d: #B0A2E1; --blue-l: #21203A; --blue-b: #3C3369; --acc-fill: #9C8BD9; --acc-fill-d: #AB9CDF; --onacc: #15120C; --avbg: #9C8BD9; --avink: #15120C; }
html[data-scheme="butter"] { --topbg: #FFF6CC; --topink: #1C1A17; --topmute: #55504A; --tophover: rgba(0,0,0,.06); --logo: #907100; --blue: #907100; --blue-d: #7A6000; --blue-l: #F6F1E0; --blue-b: #DBCA8C; --acc-fill: #B08A00; --acc-fill-d: #9B7900; --onacc: #1C1A17; --avbg: #B08A00; --avink: #1C1A17; }
html[data-scheme="butter"]:not([data-theme="dark"]) .topbar { box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
html[data-scheme="butter"][data-theme="dark"] { --topbg: #221E0D; --topink: #C8AD4C; --topmute: #8E7B36; --tophover: rgba(255,255,255,.10); --logo: #C8AD4C; --blue: #C8AD4C; --blue-d: #D3BD70; --blue-l: #2C2915; --blue-b: #57490E; --acc-fill: #C8AD4C; --acc-fill-d: #D0B967; --onacc: #15120C; --avbg: #C8AD4C; --avink: #15120C; }
html[data-scheme="ice"] { --topbg: #E6F6FA; --topink: #1C1A17; --topmute: #55504A; --tophover: rgba(0,0,0,.06); --logo: #197D94; --blue: #197D94; --blue-d: #156A7E; --blue-l: #E4F1F5; --blue-b: #99CCD8; --acc-fill: #1C8EA8; --acc-fill-d: #197D94; --onacc: #1C1A17; --avbg: #1C8EA8; --avink: #1C1A17; }
html[data-scheme="ice"]:not([data-theme="dark"]) .topbar { box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
html[data-scheme="ice"][data-theme="dark"] { --topbg: #101D21; --topink: #60B0C2; --topmute: #447D8A; --tophover: rgba(255,255,255,.10); --logo: #60B0C2; --blue: #60B0C2; --blue-d: #80C0CE; --blue-l: #112A34; --blue-b: #154B5A; --acc-fill: #60B0C2; --acc-fill-d: #78BCCB; --onacc: #15120C; --avbg: #60B0C2; --avink: #15120C; }
html[data-scheme="sand"] { --topbg: #F3ECE2; --topink: #1C1A17; --topmute: #55504A; --tophover: rgba(0,0,0,.06); --logo: #9A6B3F; --blue: #9A6B3F; --blue-d: #835B36; --blue-l: #F3EDE8; --blue-b: #D2BCA9; --acc-fill: #9A6B3F; --acc-fill-d: #885E37; --onacc: #FFFFFF; --avbg: #9A6B3F; --avink: #FFFFFF; }
html[data-scheme="sand"]:not([data-theme="dark"]) .topbar { box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
html[data-scheme="sand"][data-theme="dark"] { --topbg: #1F1A14; --topink: #B89779; --topmute: #826B56; --tophover: rgba(255,255,255,.10); --logo: #B89779; --blue: #B89779; --blue-d: #C6AC94; --blue-l: #282421; --blue-b: #4E3B2B; --acc-fill: #B89779; --acc-fill-d: #C3A78D; --onacc: #15120C; --avbg: #B89779; --avink: #15120C; }
html[data-scheme="peach"] { --topbg: #FFEDE3; --topink: #1C1A17; --topmute: #55504A; --tophover: rgba(0,0,0,.06); --logo: #B55A32; --blue: #B55A32; --blue-d: #9A4C2A; --blue-l: #FAEDE7; --blue-b: #EBBCA6; --acc-fill: #D2693A; --acc-fill-d: #B95C33; --onacc: #1C1A17; --avbg: #D2693A; --avink: #1C1A17; }
html[data-scheme="peach"]:not([data-theme="dark"]) .topbar { box-shadow: inset 0 -1px 0 rgba(0,0,0,.08); }
html[data-scheme="peach"][data-theme="dark"] { --topbg: #23170F; --topink: #E09675; --topmute: #9E6A51; --tophover: rgba(255,255,255,.10); --logo: #E09675; --blue: #E09675; --blue-d: #E6AB91; --blue-l: #322320; --blue-b: #673A28; --acc-fill: #E09675; --acc-fill-d: #E5A68A; --onacc: #15120C; --avbg: #E09675; --avink: #15120C; }
.minflag { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: var(--blue-l); color: var(--blue); font-size: 10px; font-weight: 700; text-transform: uppercase; vertical-align: 1px; }
.filebtn { cursor: pointer; display: inline-flex; align-items: center; }
.total .hint { display: block; margin-top: 4px; font-size: 11px; }

.combo-head .flatbtn { margin-left: auto; width: 38px; height: 38px; }
.flatbtn[aria-pressed="true"] { background: var(--blue-l); border-color: var(--blue-b); color: var(--blue); }
.flat-foot { position: relative; padding-left: 34px; }
.flatgrip { position: absolute; left: 0; bottom: 0; width: 26px; height: 26px; cursor: nesw-resize; touch-action: none;
  background: linear-gradient(45deg, transparent 0 46%, var(--mute) 46% 52%, transparent 52% 64%, var(--mute) 64% 70%, transparent 70%); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px 6px; transform: scaleX(-1); }
@media (max-width: 700px) { .flatgrip { display: none; } .flat-foot { padding-left: 14px; } }
.half-lines .totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-left: 0; }
.edact .grow { text-align: left; }
.sqused { display: flex; align-items: center; min-height: 36px; font-weight: 600; font-size: 13px; }
.sqused.up { color: var(--blue); }
/* Custom: parts */
.custom-body > section.wide { flex: 1 1 100%; border-left: 0; }
.partsl { width: 100%; font-size: 13px; }
.partsl td, .partsl th { padding: 6px 8px; }
.partsl tr.sel td { background: var(--blue-l); }
.partsl tfoot td { border-top: 1px solid var(--line); }
.partbtns { display: flex; gap: 8px; margin-top: 8px; }
.parted { border: 1px solid var(--blue-b); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; background: var(--card); }
.parthead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.partgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.partgrid > section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.canvas svg .lbl.pname { fill: var(--ink); font-weight: 600; }
@media (max-width: 700px) { .partgrid, .parthead { grid-template-columns: minmax(0, 1fr); } }
table.olist.partsl { min-width: 0; table-layout: auto; }
.partsl td:nth-child(3) { white-space: normal; }
.banner-note { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--blue-l); color: var(--ink); font-size: 13px; }

/* Odoo-style many2one search */
.m2o { position: relative; }
.m2o .sicon input { padding-right: 26px; }
.m2o-caret { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--mute); font-size: 12px; cursor: pointer; }
.m2o-list { position: fixed; z-index: 60; margin: 0; padding: 4px 0; list-style: none; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,.16); max-height: 300px; overflow: auto; font-size: 13px; font-weight: 400; }
.m2o-list.tall { max-height: 420px; }
.m2o-list li { padding: 7px 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m2o-list li b { font-weight: 700; }
.m2o-list li:hover, .m2o-list li.on { background: var(--blue-l); }
.m2o-list li.none { color: var(--mute); cursor: default; white-space: normal; }
.m2o-list li.more { color: var(--blue); font-weight: 600; border-top: 1px solid var(--line2); }

/* Settings lists: filters and show / hide columns */
.mattbl .lfilters th { padding: 4px 6px; background: var(--sub); }
.mattbl .lfilters .inp { width: 100%; min-width: 0; height: 30px; font-size: 12px; }
.lcolmenu { position: relative; }
.lcolmenu summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; }
.lcolmenu summary::-webkit-details-marker { display: none; }
.lcolpop { position: absolute; right: 0; top: 30px; z-index: 5; min-width: 180px; padding: 8px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; font-weight: 400; text-align: left; }
.grid2 > .fullrow { grid-column: 1 / -1; }
.mattbl input[readonly] { background: transparent; border-color: transparent; color: var(--mute); }
/* small boxed groups inside the cover cards (Flaps, Price) */
.minicard { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--sub); display: flex; flex-direction: column; gap: 6px; }
.minicard > .cap { margin: 0; }
.calc { width: 100%; border-collapse: collapse; font-size: 13px; }
.calc td { padding: 3px 0; } .calc td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc tr.tot td { font-weight: 700; border-top: 1px solid var(--line); padding-top: 6px; }
.calc tr.tot + tr.tot td { border-top: 0; padding-top: 3px; }
.calc tr.dim td { color: var(--mute); }
.calc tr.struck td.num { text-decoration: line-through; color: var(--mute); }
.pricebig { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.lmulti .inp { height: 34px; max-width: 240px; }
/* Settings › Materials: row actions and archived rows */
.mattbl td.rowacts { white-space: nowrap; } .mattbl td.rowacts .btn + .btn { margin-left: 6px; }
.mattbl tr.archived [data-m] { color: var(--mute); font-style: italic; }
.showarch { display: inline-flex; margin-left: 12px; vertical-align: middle; }
/* Order Lines full screen: the cover editor and flat pattern step aside */
.split2.linesfull { grid-template-columns: minmax(0, 1fr); }
.split2.linesfull .half-cover { display: none; }
.split2.linesfull ~ .flat { display: none; }
/* Order Lines full screen: the cover editor and flat pattern step aside */
.split2.linesfull { grid-template-columns: minmax(0, 1fr); }
.split2.linesfull .half-cover { display: none; }
.split2.linesfull ~ .flat { display: none; }
.lmulti { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lmulti .inp { height: 34px; max-width: 220px; }
.lmulti .inp[aria-invalid="true"] { border-color: var(--red, #c0392b); }
/* Type row: smaller selector, the info in the middle, Flat Pattern button at the end */
.combo-head { flex-wrap: nowrap; }
.combo-head .seg.typeseg { flex: 0 0 auto; max-width: none; }
.combo-head .seg.typeseg button { min-height: 28px; padding: 0 12px; font-size: 12px; }
.combo-head .headinfo { flex: 1 1 auto; min-width: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-head .flatbtn { margin-left: 0; flex: 0 0 auto; }
@media (max-width: 700px) { .combo-head { flex-wrap: wrap; } .combo-head .headinfo { order: 3; flex-basis: 100%; text-align: left; white-space: normal; } }
/* Flap: a grey row like Drawcord */
.flaprow { margin-top: 10px; }
/* Price beside Add in the bottom bar */
.pricebar { display: flex; align-items: center; gap: 10px; }
.pricebar .cap { margin: 0; }
.pricebar .seg.pbseg button { min-height: 28px; padding: 0 12px; }
.pricebar .pricebig { min-width: 90px; }
/* ticked Order Lines: editable cells */
.linetbl .cellinp { height: 30px; min-width: 70px; width: 100%; font-size: 13px; padding: 0 6px; }
.linetbl td.num .cellinp { min-width: 54px; text-align: right; }
.linetbl .cellinp[aria-invalid="true"] { border-color: var(--red, #c0392b); }
.linetbl .cellsub { font-size: 12px; margin-top: 2px; }
.stepper .stepval { width: 58px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); text-align: center; font: inherit; font-weight: 600; padding: 0 4px; }
.totalp { display: inline-flex; align-items: baseline; gap: 8px; margin-right: 6px; } .totalp .cap { margin: 0; }
.dlg.ask { width: min(440px, 94vw); } .dlg.ask .db p { margin: 0; }
.pricebar .priceval { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; min-width: 70px; }
/* Order Lines: the table scrolls inside its box so the column headers stay pinned */
.lines-wrap { overflow: auto; max-height: calc(100vh - 330px); min-height: 160px; }
.lines-wrap.open { overflow: visible; max-height: none; }
.linesfull .lines-wrap { max-height: calc(100vh - 300px); }
.lines-wrap .olist thead th { z-index: 2; box-shadow: 0 1px 0 var(--line); }
.lines-wrap .olist tfoot td { position: sticky; bottom: 0; background: var(--card); z-index: 1; box-shadow: 0 -1px 0 var(--line); }
@media (max-width: 1000px) { .lines-wrap { max-height: 70vh; } }
.copyicon { display: inline-flex; vertical-align: -2px; margin-left: 4px; color: var(--blue-d); cursor: help; }
/* ---- phone layout (≤ 700px) ---- */
@media (max-width: 700px) {
  /* Line card: Quote no. + SN side by side, Location full, Cover Qty + Unit Price side by side */
  .linegrid { grid-auto-flow: row dense; } .linegrid .g-quote { grid-column: 1 / span 1; } .linegrid .g-sn { grid-column: 2 / span 1; }
  .linegrid .g-loc { grid-column: 1 / -1; } .linegrid .g-qty { grid-column: 1 / span 1; } .linegrid .g-msrp { grid-column: 2 / span 1; }
  /* cover types full width; the info and the Flat Pattern button share the next row */
  .combo-head { flex-wrap: wrap; gap: 8px; }
  .combo-head .seg.typeseg { flex: 1 1 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .combo-head .seg.typeseg button { padding: 0 4px; }
  .combo-head .headinfo { order: 0; flex: 1 1 0; text-align: left; white-space: normal; font-size: 12px; }
  .combo-head .flatbtn { flex: 0 0 auto; }
  /* bottom bar stays on screen: Price + switch, then Total + Add */
  .edact { position: sticky; bottom: 0; z-index: 6; flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; box-shadow: 0 -4px 14px rgba(0,0,0,.08); }
  .edact .pricebar { flex: 1 1 100%; justify-content: space-between; }
  .edact > .grow { display: none; }
  .edact .totalp { flex: 1 1 auto; margin: 0; }
  .edact .totalp .pricebig { font-size: 18px; }
  .edact [data-act="add-line"], .edact [data-act="save-line"] { flex: 0 0 auto; }
  /* Order Lines: drop the long hint; totals as one compact strip */
  .lbarhint { display: none; }
  .half-lines .totals { gap: 6px; }
  .half-lines .totals .card.total { padding: 10px; min-height: 0; }
  .half-lines .totals .card.total .cap { font-size: 10px; letter-spacing: .02em; }
  .half-lines .totals .card.total b { font-size: 18px; }
  .half-lines .totals .card.total .hint { display: none; }
  .lines-wrap { max-height: 60vh; }
}
.flat-title .draggrip { color: var(--mute); font-size: 16px; letter-spacing: 2px; }
/* Odoo */
.codebox { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--sub); font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; overflow: auto; max-height: 320px; user-select: all; }
.odoopv { margin-top: 4px; } .odoopv th { text-align: left; font-size: 12px; color: var(--mute); padding: 4px 0; border-bottom: 1px solid var(--line); } .odoopv th.num { text-align: right; }
.odoopv td { vertical-align: top; padding: 6px 0; border-bottom: 1px solid var(--line); } .odoopv td .hint { font-size: 12px; }
.warnp { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--warn-bg, #fff4d6); color: var(--warn-ink, #6b4a00); font-size: 13px; }
.dlg.ask .db { max-height: 60vh; }
.odoopv tr.dupl td { background: var(--warn-bg, #fff4d6); }
.duptag { display: inline-block; padding: 1px 6px; border-radius: 999px; background: #c0392b; color: #fff; font-size: 11px; font-weight: 700; }
.odhave { margin-top: 6px; } .odhave summary { cursor: pointer; font-weight: 600; } .odhave ul { margin: 6px 0 0; padding-left: 18px; }
/* Access settings */
.rolehelp { margin: 0; padding-left: 18px; font-size: 13px; } .rolehelp li { margin: 2px 0; }
.userrow { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.userrow span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .userrow { grid-template-columns: minmax(0, 1fr) auto; } .userrow select { grid-column: 1 / -1; grid-row: 2; } }
/* Settings: tabs inside a page (Price lists | Pipe sizes pricing factor) */
.subtabs { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.subtabs button { border: 0; background: transparent; padding: 8px 12px; font: inherit; font-weight: 600; color: var(--mute); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.subtabs button.on { color: var(--ink); border-bottom-color: var(--acc-fill, var(--blue-b)); }
.fld.autofld input { color: var(--mute); font-style: italic; }
/* Total Difficulty card: Drafting and Sewing */
.diffpair { display: flex; gap: 18px; } .diffpair span { display: flex; flex-direction: column; } .diffpair small { font-size: 11px; opacity: .75; text-transform: uppercase; letter-spacing: .04em; }
/* Settings: unsaved changes bar */
#dlg .df { gap: 8px; }
.setdirty { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; padding: 4px 6px 4px 12px; border-radius: 10px; background: var(--warn-bg, #fff4d6); color: var(--warn-ink, #6b4a00); font-weight: 600; font-size: 13px; }
.setdirty[hidden] { display: none; }
/* Order Lines: SN always editable, copy button at the end */
.linetbl .sninp { min-width: 56px; width: 72px; font-weight: 700; }
.linetbl td.rowcopy { width: 34px; padding: 0 4px; text-align: center; }
