/* Partner portal, order screen. Builds on the tokens of site.css (The Barcode Wall):
   aluminium ground, charcoal ink, 2 px rules, square corners, the wood textures as the only colour. */

.portal { --head: 76px; padding-bottom: 40px; }
.head { padding-block: clamp(20px, 2.6vw, 32px) 0; margin-bottom: 0; }
.head h1 { font-size: clamp(1.85rem, 3.4vw, 2.85rem); max-width: none; }
.head .lede { margin: 8px 0 0; max-width: 62ch; }
.portal h2 { font-size: clamp(1.2rem, 1.6vw, 1.45rem); max-width: none; letter-spacing: -.02em; }

/* ---------- container choice ---------- */
.choose { padding-block: 20px 22px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.cc { text-align: left; font: inherit; color: var(--ink); background: transparent; border: 2px solid var(--ink); padding: 16px 22px; cursor: pointer; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "size cap" "size ex"; gap: 2px 22px; align-items: center; transition: background-color .2s var(--ease), color .2s var(--ease); }
.cc:hover { background: var(--ground-2); }
.cc .cc-size { grid-area: size; font-size: clamp(1.85rem, 3.4vw, 2.85rem); font-weight: 700; font-variation-settings: "wdth" 118; letter-spacing: -.03em; line-height: 1; }
.cc .cc-cap { grid-area: cap; font-size: .95rem; font-weight: 600; }
.cc .cc-ex { grid-area: ex; font-size: .875rem; color: var(--ink-2); }
.choose.is-chosen .cc { padding: 10px 18px; }
.choose.is-chosen .cc .cc-size { font-size: clamp(1.2rem, 1.6vw, 1.45rem); }
.choose.is-chosen .cc .cc-ex { display: none; }
.cc[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.cc[aria-pressed="true"] .cc-ex { color: #C9CAC5; }
.cc[aria-pressed="true"]:hover { background: #35332E; }

/* ---------- work area ---------- */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: clamp(28px, 4vw, 64px); align-items: start; padding-block: 28px 96px; }
.catalogue > h2 { margin-bottom: 4px; }
.locked { display: none; margin: 10px 0 0; padding: 14px 16px; border: 2px solid var(--ink); font-weight: 500; max-width: none; }
.catalogue.is-locked .locked { display: block; }
.catalogue.is-locked .qcell { opacity: .4; pointer-events: none; }
.jump { display: flex; flex-wrap: nowrap; gap: 8px; margin: 14px 0 0; overflow-x: auto; scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump a { flex: none; white-space: nowrap; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 2px solid var(--ground-3); text-decoration: none; font-weight: 600; font-size: .95rem; transition: border-color .2s var(--ease); }
.jump a:hover { border-color: var(--ink); }

/* ---------- catalogue: product families ---------- */
.fam { border-top: 2px solid var(--ink); margin-top: 36px; padding-top: 18px; scroll-margin-top: calc(var(--head) + 12px); }
.fam:first-of-type { margin-top: 24px; }
.fam-head h3 { font-size: clamp(1.2rem, 1.6vw, 1.45rem); font-variation-settings: "wdth" 112; font-weight: 700; letter-spacing: -.02em; }
.fam-head p { margin: 6px 0 0; color: var(--ink-3); font-size: .95rem; max-width: 60ch; }
.fam-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; margin-top: 18px; align-items: start; }
.fam-photo { position: sticky; top: calc(var(--head) + 16px); margin: 0; }
.fam-photo .ph { aspect-ratio: 1 / 1; background: #fff center / cover no-repeat; overflow: hidden; }
.fam-photo img { width: 100%; height: 100%; object-fit: cover; }
.fam-photo figcaption { margin-top: 10px; font-size: .875rem; color: var(--ink-2); line-height: 1.35; }
.fam-photo figcaption b { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }

.grp { margin: 0; padding: 18px 8px 8px; font-size: 1.0625rem; font-weight: 650; font-variation-settings: "wdth" 106; letter-spacing: -.01em; }
.grp:first-child { padding-top: 0; }
.row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 112px 164px; gap: 6px 14px; align-items: center; padding: 12px 8px; border-top: 1px solid var(--ground-3); transition: background-color .2s var(--ease); }
.row.in-load { background: #F4F4F1; }
.th { width: 64px; height: 64px; background: var(--ground-2) center / cover no-repeat; overflow: hidden; }
.th.has-photo { background-color: #fff; }
.th img { width: 100%; height: 100%; object-fit: cover; }
.dot { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; background-size: cover; background-position: center; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); }
.id { min-width: 0; }
.id .sku { font-weight: 650; font-variant-numeric: tabular-nums; margin-right: 8px; }
.id .col { color: var(--ink-2); font-size: .95rem; }
.id .title { display: block; font-size: .875rem; color: var(--ink-3); line-height: 1.3; margin-top: 1px; }
.id .pack { display: block; font-size: .875rem; color: var(--ink-2); margin-top: 3px; font-variant-numeric: tabular-nums; }
.price { text-align: right; font-size: .95rem; font-variant-numeric: tabular-nums; line-height: 1.3; }
.price b { font-weight: 650; }
.price small { display: block; color: var(--ink-3); font-size: .875rem; }
.qcell { display: grid; justify-items: end; gap: 4px; }
.qty { display: flex; align-items: center; justify-content: flex-end; }
.qinfo { margin: 0; font-size: .875rem; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; max-width: none; }
.row.in-load .qinfo { color: var(--ink); font-weight: 600; }
.qwhy { margin: 0; font-size: .875rem; color: var(--error); font-weight: 600; text-align: right; max-width: none; }
.step { width: 44px; height: 44px; font: inherit; font-size: 1.0625rem; font-weight: 700; line-height: 1; color: var(--ink); background: transparent; border: 2px solid var(--ink); cursor: pointer; transition: background-color .15s var(--ease), transform .1s var(--ease); }
.step:hover:not(:disabled):not([aria-disabled="true"]) { background: var(--ground-2); }
.step:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); }
.step:disabled, .step[aria-disabled="true"] { opacity: .32; cursor: not-allowed; }
.qty input { width: 52px; height: 44px; font: inherit; font-weight: 650; font-variant-numeric: tabular-nums; text-align: center; color: var(--ink); background: #F4F4F1; border: 2px solid var(--ink); border-left: 0; border-right: 0; border-radius: 0; padding: 0; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }

/* ---------- load panel ---------- */
.load { position: sticky; top: calc(var(--head) + 16px); max-height: calc(100vh - var(--head) - 32px); display: flex; flex-direction: column; overflow: auto; border-top: 2px solid var(--ink); padding-top: 14px; }
.dock { display: none; }
.load-body { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.load-body > * { flex: none; }
.load-body > .lines { flex: 1 1 auto; min-height: 96px; overflow: auto; }
.load-body > h2 { font-size: clamp(1.2rem, 1.6vw, 1.45rem); }
#load-h:focus { outline: none; }
.cn { margin: 2px 0 10px; color: var(--ink-2); font-weight: 600; max-width: none; }
.gauges { display: grid; gap: 10px; margin: 14px 0 12px; }
.g-row { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; font-weight: 600; }
.g-val { font-weight: 400; font-variant-numeric: tabular-nums; text-align: right; }
.track { position: relative; height: 10px; background: var(--ground-3); margin-top: 6px; }
.track i { position: absolute; inset: 0; background: var(--ink); transform: scaleX(var(--p, 0)); transform-origin: left center; transition: transform .25s var(--ease); }
.track .tick { position: absolute; left: 90%; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.gauge.over .track i { background: var(--error); }
.gauge.over .g-val { color: var(--error); font-weight: 600; }

.lines-h { font-size: 1.0625rem; font-weight: 650; letter-spacing: -.01em; margin-top: 4px; }
.lines { list-style: none; padding: 0; margin: 6px 0 0; max-width: none; }
.lines li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 2px 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--ground-3); margin: 0; font-size: .9rem; }
.lines .th { width: 48px; height: 48px; }
.lines strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.lines .sub { display: block; color: var(--ink-3); font-size: .875rem; font-variant-numeric: tabular-nums; }
.lines .r { text-align: right; display: grid; justify-items: end; }
.lines .lp { font-variant-numeric: tabular-nums; font-weight: 600; }
.lines .rm { font: inherit; font-size: .875rem; color: var(--ink-2); background: none; border: 0; min-height: 44px; min-width: 44px; padding: 0 0 0 12px; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.lines .rm:hover { color: var(--ink); }
.lines .none { display: block; color: var(--ink-3); border-top: 1px solid var(--ground-3); padding: 12px 0; }

.summary { border-top: 2px solid var(--ink); padding-top: 10px; margin: 4px 0 4px; }
.status { margin: 0 0 10px; padding: 10px 12px; border: 2px solid var(--ink); font-weight: 500; font-size: .95rem; max-width: none; }
.status.is-ok { border-color: var(--ok); color: var(--ok); }
.status.is-warn { border-color: var(--error); color: var(--error); }
.total { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.t-label { font-size: .9rem; font-weight: 600; }
.t-fig { white-space: nowrap; font-size: 1.9rem; font-weight: 700; font-variation-settings: "wdth" 112; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.place { width: 100%; margin-top: 10px; }
.place[disabled] { cursor: not-allowed; opacity: .45; }
.load .form-note { margin: 8px 0 0; max-width: none; }
.scrim { display: none; }

/* ---------- narrower screens ---------- */
@media (max-width: 1000px) {
	.work { grid-template-columns: minmax(0, 1fr); padding-bottom: 190px; }
	.load { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30; max-height: 90vh; display: block; overflow: auto; background: var(--ground); border-top: 2px solid var(--ink); padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom, 0px)); }
	.dock { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; }
	.dock-meter { position: relative; grid-column: 1 / -1; height: 6px; background: var(--ground-3); }
	.dock-meter i { display: block; height: 100%; width: 100%; background: var(--ink); transform: scaleX(var(--p, 0)); transform-origin: left center; transition: transform .25s var(--ease); }
	.dock-tick { position: absolute; left: 90%; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
	.dock-text { margin: 0; font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; max-width: none; display: grid; gap: 2px; }
	.dock-text .dk-b { font-size: 1.15rem; font-weight: 700; letter-spacing: -.01em; }
	.dock-text .dk-c { font-weight: 400; color: var(--ink-2); }
	.dock-text .dk-c.is-warn { color: var(--error); font-weight: 600; }
	.load-body { display: none; padding-top: 18px; }
	.load.is-open .load-body { display: flex; }
	.load-body > .lines { overflow: visible; }
		.scrim { position: fixed; inset: 0; z-index: 25; background: color-mix(in srgb, var(--ink) 45%, transparent); }
	body.sheet-open .scrim { display: block; }
	body.sheet-open { overflow: hidden; }
	.fam-body { grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 720px) {
	.choices { grid-template-columns: 1fr 1fr; gap: 10px; }
	.cc { grid-template-columns: 1fr; grid-template-areas: "size" "cap"; padding: 14px 14px; gap: 6px; }
	.cc .cc-ex { display: none; }
	.fam-body { grid-template-columns: 1fr; }
	.fam-photo { display: none; }
	.row { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "th id" "price price" "qcell qcell"; padding: 14px 4px; }
	.row .th { grid-area: th; }
	.row .id { grid-area: id; }
	.row .price { grid-area: price; text-align: left; display: flex; gap: 12px; align-items: baseline; }
	.row .price small { display: inline; }
	.row .qcell { grid-area: qcell; justify-items: start; }
	.row .qty { justify-content: flex-start; }
	.row .qinfo, .row .qwhy { text-align: left; }
	}
@media (prefers-reduced-motion: reduce) {
	.track i, .dock-meter i, .row, .cc, .step, .jump a { transition: none; }
}

/* ---------- portal pages around the order screen ---------- */
.portal-tabs { display: flex; flex-wrap: wrap; gap: 6px 26px; padding-top: 22px; border-bottom: 1px solid var(--ground-3); }
.portal-tabs a { text-decoration: none; font-weight: 500; padding: 12px 0 10px; border-bottom: 2px solid transparent; }
.portal-tabs a:hover { border-bottom-color: var(--alu); }
.portal-tabs a[aria-current="page"] { border-bottom-color: var(--ink); font-weight: 650; }
.portal-tabs .portal-out { margin-left: auto; color: var(--ink-2); }
.fx-note { margin: 8px 0 0; font-size: .875rem; color: var(--ink-3); max-width: none; }
.ncp-table { overflow-x: auto; margin-top: 18px; }
.ncp-table table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.ncp-table th, .ncp-table td { text-align: left; padding: 12px 14px 12px 0; border-top: 1px solid var(--ground-3); vertical-align: top; }
.ncp-table th { font-size: .875rem; color: var(--ink-3); font-weight: 600; border-top: 2px solid var(--ink); }
.ncp-login, .ncp-register { max-width: 560px; margin-top: 24px; }
.ncp-login form p { margin: 0 0 14px; }
.ncp-login input[type="text"], .ncp-login input[type="password"] { font: inherit; padding: 13px 14px; border: 2px solid var(--ground-3); background: #F4F4F1; color: var(--ink); width: 100%; border-radius: 0; }
.ncp-login input[type="submit"] { font: inherit; font-weight: 600; padding: 15px 22px; border: 2px solid var(--ink); background: var(--ink); color: var(--ground); cursor: pointer; border-radius: 0; }

/* invoices and drawings */
.ncp-inv{display:flex;gap:12px;align-items:baseline;justify-content:space-between;padding:4px 0;font-size:15px}
.ncp-inv+.ncp-inv{border-top:1px solid var(--ground-3)}
.ncp-dl{font-weight:600;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}

/* two-step login */
.ncp-steps{max-width:560px;padding-left:1.2em;margin:18px 0}
.ncp-steps li{margin:0 0 14px}
.ncp-qr{display:block;width:200px;max-width:60vw;margin:10px 0;background:#fff}
.ncp-qr svg{display:block;width:100%;height:auto}
.ncp-keyline{display:block;margin:6px 0}
.ncp-key{font-size:17px;letter-spacing:.06em;word-break:break-all}
.ncp-2fa{display:flex;flex-direction:column;gap:10px;max-width:320px;margin:18px 0}
.ncp-2fa input{font-size:22px;letter-spacing:.12em;padding:10px 12px;min-height:48px}
.ncp-linkbtn{background:none;border:0;padding:0;font:inherit;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.ncp-codes{list-style:none;padding:0;margin:18px 0;display:grid;grid-template-columns:repeat(2,minmax(0,200px));gap:10px}
.ncp-codes code{font-size:18px;letter-spacing:.05em}
