/* Trifon trade portal — builds on ../../css/style.css */

body.portal { background: #fcfafb; }
.preview-bar { background: var(--ink); color: #eadfe8; font-size: 12.5px; text-align: center; padding: 7px 16px; }
.preview-bar a { color: #e6c9e1; text-decoration: underline; margin-left: 8px; cursor: pointer; }

/* Header */
.p-head { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--line); }
.p-head .bar1 { height: 64px; display: flex; align-items: center; gap: 28px; padding: 0 32px; }
.p-logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.p-logo img { height: 34px; width: auto; display: block; }
.p-nav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.p-nav a { font-size: 12px; letter-spacing: .1em; font-weight: 500; text-transform: uppercase; padding: 7px 13px; border-radius: 99px; color: var(--ink-2); white-space: nowrap; }
.p-nav a:hover { background: var(--sand); }
.p-nav a.on { background: #f2e7f0; color: var(--ink); font-weight: 600; }
.p-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.p-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 99px; padding: 0 14px; height: 36px; width: 210px; background: #faf7f9; }
.p-search:focus-within { border-color: var(--brand); background: #fff; }
.p-search .i { width: 15px; height: 15px; color: var(--muted); }
.p-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 13.5px; }
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); background: none; border: 0; }
.icon-btn:hover { background: var(--sand); }
.icon-btn .i { width: 19px; height: 19px; }
.icon-btn .badge { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 600; display: grid; place-items: center; padding: 0 4px; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 6px 4px 4px; border-radius: 99px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.user-btn:hover { background: var(--sand); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); border: 1px solid var(--brand); color: var(--brand-dark); display: grid; place-items: center; font-size: 12px; font-weight: 600; letter-spacing: 0; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 240px; padding: 8px; display: none; z-index: 50; }
.menu.open { display: block; animation: rise .2s ease; }
.menu .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu .who b { display: block; font-size: 14px; }
.menu .who span { font-size: 12.5px; color: var(--muted); }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; font-size: 14px; background: none; border: 0; text-align: left; color: var(--ink-2); }
.menu a:hover, .menu button:hover { background: var(--sand); }
.menu .i { width: 16px; height: 16px; color: var(--muted); }
.p-burger { display: none; }
.p-drawer { display: none; }

/* Page shell */
.p-main { padding: 28px 32px 120px; min-height: 70vh; }
.p-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.p-title h1 { font-size: 30px; font-weight: 500; }
.p-title p { color: var(--muted); font-size: 14.5px; margin-top: 6px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--brand-dark); }
.card { background: #fff; border: 1px solid var(--line); min-width: 0; }
.card-pad { padding: 22px; }
.card h3 { font-size: 16px; font-weight: 600; letter-spacing: 0; margin-bottom: 14px; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 13.5px; }
.btn-xs { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-ghost { background: none; border: 0; color: var(--brand-dark); padding: 0; height: auto; font-weight: 500; }
.btn-ghost:hover { text-decoration: underline; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.seg-tabs { display: inline-flex; gap: 4px; background: #f4eff3; padding: 4px; border-radius: 99px; }
.seg-tabs a, .seg-tabs button { border: 0; background: none; padding: 7px 16px; border-radius: 99px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.seg-tabs .on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.empty { text-align: center; padding: 70px 20px; }
.empty .art { width: 150px; height: 150px; margin: 0 auto 20px; border-radius: 50%; overflow: hidden; }
.empty .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.empty h3 { font-size: 22px; font-weight: 500; margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 22px; }
.toast { position: fixed; left: 50%; bottom: 92px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; font-size: 14px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 100; display: flex; gap: 12px; align-items: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: #e6c9e1; font-weight: 500; }
.tag-new { position: absolute; left: 10px; top: 10px; font-size: 10px; letter-spacing: .14em; font-weight: 600; background: #fff; color: var(--brand-dark); padding: 3px 7px; border: 1px solid var(--line); }
.tag-new.best { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Catalogue */
.field label.check { display: inline-flex; }
.cats { position: sticky; top: 65px; z-index: 30; display: flex; gap: 0 2px; flex-wrap: wrap; justify-content: center; background: #fcfafb; border-bottom: 1px solid var(--line); margin: -14px -32px 22px; padding: 8px 32px; }
.cats a { font-size: 12px; letter-spacing: .06em; font-weight: 500; text-transform: uppercase; padding: 6px 7px; color: var(--ink-2); border-bottom: 2px solid transparent; }
.cats a.on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }
.cat-layout { display: grid; grid-template-columns: 236px 1fr; gap: 28px; align-items: start; }
.fpanel { position: sticky; top: 150px; max-height: calc(100vh - 166px); overflow-y: auto; padding-right: 6px; }
.fpanel .fh { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.fgroup { border-bottom: 1px solid var(--line); }
.fgroup > button { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: 0; padding: 13px 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.fgroup > button .i { width: 14px; height: 14px; color: var(--muted); transition: transform .2s; }
.fgroup.open > button .i { transform: rotate(180deg); }
.fgroup .opts { display: none; padding: 0 0 14px; }
.fgroup.open .opts { display: grid; gap: 9px; }
.fopt { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.fopt input { appearance: none; width: 16px; height: 16px; border: 1.5px solid var(--line-2); border-radius: 3px; margin: 0; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.fopt input:checked { background: var(--brand); border-color: var(--brand); }
.fopt input:checked::after { content: ''; width: 7px; height: 4px; border: 1.8px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.fopt input[type=radio] { border-radius: 50%; }
.fopt .ct { margin-left: auto; color: var(--muted); font-size: 12px; }
.fopt .sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .12); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #f6f1f5; padding: 9px 14px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .count { font-weight: 600; font-size: 13.5px; }
.toolbar .r { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar select { border: 1px solid var(--line-2); background: #fff; height: 32px; padding: 0 10px; font-size: 13px; border-radius: 2px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 16px; }
.chips button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 4px 10px 4px 12px; font-size: 12.5px; color: var(--ink-2); }
.chips button .i { width: 12px; height: 12px; }
.view-toggle { display: flex; gap: 4px; }
.view-toggle button { width: 32px; height: 32px; border: 1px solid var(--line-2); background: #fff; display: grid; place-items: center; color: var(--muted); }
.view-toggle button.on { color: var(--ink); border-color: var(--ink); }
.view-toggle .i { width: 15px; height: 15px; }
.filter-btn { display: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.pc { background: #fff; border: 1px solid var(--line); display: flex; flex-direction: column; transition: box-shadow .25s, border-color .25s; }
.pc:hover { box-shadow: var(--shadow-sm); border-color: var(--line-2); }
.pc .im { position: relative; aspect-ratio: 1 / .86; overflow: hidden; background: #f4eef2; }
.pc .im > a { position: absolute; inset: 0; display: block; }
.pc .im img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.pc .im.two > a { display: grid; grid-template-columns: 1fr 1fr; }
.pc .im.two img { min-width: 0; }
.pc .im.two img + img { border-left: 1px solid var(--line); }
.pc:hover .im img { transform: scale(1.05); }
.pc .im .w { position: absolute; left: 10px; bottom: 9px; background: #fff; border: 1px solid var(--line); padding: 2px 7px; font-size: 11.5px; }
.pc .im .hrt { position: absolute; right: 8px; top: 8px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .85); display: grid; place-items: center; color: var(--muted); }
.pc .im .hrt .i { width: 16px; height: 16px; }
.pc .im .hrt.on { color: var(--brand); }
.pc .im .hrt.on .i { fill: currentColor; }
.pc .im .stk { position: absolute; right: 10px; bottom: 9px; font-size: 11px; font-weight: 500; }
.stk-in { color: var(--green); }
.stk-mto { color: var(--brand-deep); }
.pc .bd { padding: 12px 13px 13px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pc .row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pc .row1 a { font-weight: 600; font-size: 14px; }
.pc .row1 .pr { font-weight: 600; font-size: 14px; white-space: nowrap; }
.pc .nm { font-size: 12.5px; color: var(--muted); line-height: 1.4; min-height: 35px; }
.pc .opts { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 8px; align-items: flex-end; font-size: 10px; color: var(--muted); letter-spacing: .08em; }
.pc .opts .ol { display: flex; flex-direction: column; gap: 4px; }
.mini-seg { display: flex; gap: 2px; }
.mini-seg button { border: 1px solid var(--line-2); background: #fff; font-size: 11px; font-weight: 600; padding: 2px 5px; color: var(--muted); }
.mini-seg button.on { border-color: var(--ink); color: var(--ink); }
.swatches { display: flex; gap: 5px; }
.swatches button { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); padding: 0; }
.swatches button.on { box-shadow: 0 0 0 1.5px var(--ink); }
.pc select { border: 1px solid var(--line-2); background: #fff; font-size: 11.5px; padding: 1px 4px; height: 22px; }
.pc .add-row { display: flex; gap: 8px; margin-top: auto; }
.pc .add-row .btn { flex: 1; height: 34px; font-size: 13px; }
.incart { font-size: 11.5px; color: var(--green); font-weight: 500; }
.grid.list { grid-template-columns: 1fr; }
.grid.list .pc { flex-direction: row; }
.grid.list .pc .opts { justify-content: flex-start; gap: 6px 16px; }
.grid.list .pc .add-row { max-width: 320px; }
.grid.list .pc .im { width: 200px; aspect-ratio: 1; flex-shrink: 0; }
.cart-float { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 30; background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; align-items: center; gap: 22px; padding: 10px 10px 10px 22px; border-radius: 4px; font-size: 11.5px; letter-spacing: .08em; color: var(--muted); }
.cart-float b { font-size: 17px; color: var(--ink); margin-right: 5px; letter-spacing: 0; }
.cart-float .sum { font-size: 15px; color: var(--ink); letter-spacing: 0; font-weight: 600; }
.cart-float.hide { display: none; }
.load-more { height: 1px; }

/* Design view: opens over the page when a picture is clicked */
body:has(.modal-bg.open) { overflow: hidden; }
.modal.viewer { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 380px; max-width: 1180px; height: min(88vh, 780px); max-height: none; padding: 0; overflow: hidden; }
.v-img { position: relative; background: #fff; display: grid; place-items: center; min-height: 0; padding: 14px; }
.v-img.two { grid-template-columns: 1fr 1fr; gap: 10px; }
.v-img figure { margin: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.v-zoom { flex: 1; min-height: 0; overflow: hidden; cursor: zoom-in; }
.v-zoom img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .2s ease; }
.v-zoom.on { cursor: zoom-out; touch-action: none; }
.v-zoom.on img { transform: scale(2.5); }
.v-hint { position: absolute; left: 16px; top: 14px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); pointer-events: none; }
.v-hint .i { width: 14px; height: 14px; }
.v-hint.hide { display: none; }
.v-img figcaption { text-align: center; font-size: 12.5px; color: var(--muted); padding-top: 6px; }
.v-info { border-left: 1px solid var(--line); padding: 26px 24px; overflow-y: auto; }
.v-info .sku { font-size: 13px; letter-spacing: .14em; color: var(--muted); font-weight: 500; padding-right: 30px; }
.v-info h2 { font-size: 20px; font-weight: 500; margin: 8px 0 12px; line-height: 1.3; }
.v-info .pd-price { padding: 12px 0; margin-bottom: 8px; }
.v-info .pd-price b { font-size: 26px; }
.v-info .v-facts { margin-bottom: 16px; }
.v-info .opt-row { margin-bottom: 14px; }
.v-info .buy-row { margin: 18px 0 10px; }
.v-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.v-info .pills { gap: 6px; }
.v-info .pills:not(.sw) button { min-width: 44px; height: 38px; padding: 0 8px; }
.v-info .pills.sw button { width: 38px; min-width: 38px; height: 38px; }
.v-info .input { height: 44px; }
.v-remark { display: block; width: 100%; border: 1px solid var(--line-2); background: #fcfafb; padding: 8px 10px; font: inherit; font-size: 13.5px; resize: vertical; outline: 0; }
.v-remark:focus { border-color: var(--brand); background: #fff; }
.v-close, .v-step { position: absolute; z-index: 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink-2); padding: 0; }
.v-close { top: 12px; right: 12px; }
.v-step { top: calc(50% - 19px); right: 394px; }
.v-step.prev { right: auto; left: 14px; }
.v-step.prev .i { transform: rotate(180deg); }
.v-close:hover, .v-step:hover { border-color: var(--ink); }
.v-close .i, .v-step .i { width: 16px; height: 16px; }
.pd-price { display: flex; align-items: baseline; gap: 10px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.pd-price b { font-size: 30px; font-weight: 600; }
.pd-price span { color: var(--muted); font-size: 13.5px; }
.opt-row { margin-bottom: 18px; }
.opt-row .lbl { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; }
.opt-row .lbl b { color: var(--ink); font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 13.5px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pills button { min-width: 48px; height: 40px; padding: 0 14px; border: 1px solid var(--line-2); background: #fff; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.pills button.on { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pills.sw button { width: 40px; min-width: 40px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-2); }
.pills.sw button.on { box-shadow: 0 0 0 2px var(--ink); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); background: #fff; height: 46px; }
.qty button { width: 42px; height: 100%; border: 0; background: none; display: grid; place-items: center; color: var(--ink-2); }
.qty button .i { width: 15px; height: 15px; }
.qty input { width: 52px; text-align: center; border: 0; outline: 0; font-size: 15px; font-weight: 600; height: 100%; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty.sm { height: 34px; }
.qty.sm button { width: 32px; }
.qty.sm input { width: 38px; font-size: 14px; }
.buy-row { display: flex; gap: 10px; margin: 26px 0 14px; }
.buy-row .btn-brand { flex: 1; height: 46px; }
.buy-row .btn-line { width: 46px; padding: 0; }
.buy-row .btn-line.on { color: #c0573f; }
.buy-row .btn-line.on .i { fill: currentColor; }
.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
.kv td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.kv td:first-child { color: var(--muted); width: 46%; }
.kv tr.tot td { font-weight: 600; color: var(--ink); border-bottom: 0; padding-top: 14px; }
.kv td.r { text-align: right; }
.pd-note { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.5; }

/* Cart */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.cl { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 18px; padding: 18px; border-bottom: 1px solid var(--line); }
.cl:last-child { border-bottom: 0; }
.cl .th { aspect-ratio: 1; display: block; overflow: hidden; background: #f4eef2; }
.cl .th img, .tbl .thumb-cell .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cl .t { font-weight: 600; font-size: 14.5px; }
.cl .t span { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.cl .d { font-size: 13px; color: var(--muted); margin: 3px 0 10px; }
.cl .sel { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cl .sel select { height: 34px; border: 1px solid var(--line-2); background: #fff; padding: 0 8px; font-size: 13px; }
.cl .note { margin-top: 10px; width: 100%; max-width: 420px; height: 34px; border: 1px dashed var(--line-2); padding: 0 10px; font-size: 13px; background: #fcfafb; outline: 0; }
.cl .note:focus { border-style: solid; border-color: var(--brand); background: #fff; }
.cl .rt { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cl .rt b { font-size: 16px; }
.cl .rt small { color: var(--muted); font-size: 12px; }
.cl .rm { background: none; border: 0; color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 4px; margin-top: auto; }
.cl .rm:hover { color: #b2472f; }
.cl .rm .i { width: 13px; height: 13px; }
.summary { position: sticky; top: 90px; }
.summary .kv td { padding: 8px 0; font-size: 13.5px; }
.slab-hint { background: var(--brand-soft); padding: 10px 12px; font-size: 13px; color: var(--ink-2); margin: 14px 0; display: flex; gap: 8px; }
.slab-hint .i { color: var(--brand-dark); width: 16px; height: 16px; margin-top: 2px; }
.slab-hint.ok { background: var(--green-soft); }
.slab-hint.ok .i { color: var(--green); }
.summary .field { margin-bottom: 12px; }
.summary .field label { font-size: 13px; }
.summary .input { height: 42px; }
.total-big { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; border-top: 1px solid var(--line-2); margin-top: 6px; }
.total-big span { font-size: 14px; font-weight: 500; }
.total-big b { font-size: 24px; }

/* Orders */
.olist { display: grid; gap: 14px; }
.oc { background: #fff; border: 1px solid var(--line); padding: 18px 20px; }
.oc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.oc-head .l { display: flex; gap: 14px; align-items: center; }
.oc-head .ic { width: 42px; height: 42px; border-radius: 6px; background: var(--sand); display: grid; place-items: center; color: var(--brand-dark); }
.oc-head .ic.green { background: var(--green-soft); color: var(--green); }
.oc-head .ic .i { width: 20px; height: 20px; }
.oc-head b { font-size: 16px; display: block; }
.oc-head span { font-size: 13px; color: var(--muted); }
.oc .stats { margin: 16px 0 14px; }
.oc .stats div { font-size: 10.5px; padding: 9px; }
.oc .stats b { font-size: 14px; margin-top: 2px; }
.prog { display: flex; gap: 3px; margin-bottom: 8px; }
.prog i { flex: 1; height: 4px; background: var(--line); }
.prog i.on { background: var(--brand); }
.prog-lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.prog-lbl b { color: var(--ink); font-weight: 500; }
.oc-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pill.blue { background: #e9eef6; color: #4a6593; }
.pill.grey { background: #f0ecef; color: var(--body); }

.od { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.vtl { position: relative; padding-left: 4px; }
.vtl .s { display: grid; grid-template-columns: 26px 1fr auto; gap: 14px; padding-bottom: 22px; position: relative; }
.vtl .s::before { content: ''; position: absolute; left: 12px; top: 24px; bottom: 0; width: 1.5px; background: var(--line-2); }
.vtl .s:last-child::before { display: none; }
.vtl .s.done::before { background: var(--brand); }
.vtl .dot { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); background: #fff; display: grid; place-items: center; position: relative; z-index: 1; }
.vtl .s.done .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.vtl .s.cur .dot { border-color: var(--brand); box-shadow: 0 0 0 5px rgba(91, 14, 82, .18); }
.vtl .s.cur .dot::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); }
.vtl .dot .i { width: 13px; height: 13px; stroke-width: 2.4; }
.vtl b { font-weight: 500; font-size: 14.5px; }
.vtl .s.todo b { color: var(--muted); font-weight: 400; }
.vtl time { font-size: 12.5px; color: var(--muted); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line-2); background: #faf7f9; white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .thumb-cell { display: flex; gap: 12px; align-items: center; }
.tbl .thumb-cell .th { width: 52px; height: 52px; flex-shrink: 0; display: block; overflow: hidden; background: #f4eef2; }
.tbl .thumb-cell b { display: block; font-weight: 600; }
.tbl .thumb-cell span { color: var(--muted); font-size: 12.5px; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover td { background: #fcf9fb; }
.tbl-wrap { overflow-x: auto; }
.demo-act { font-size: 12px; color: var(--muted); border: 1px dashed var(--line-2); padding: 10px 12px; margin-top: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }

/* Grid children may shrink so wide tables scroll inside their card */
.od > *, .acct > *, .cart-layout > *, .custom-layout > * { min-width: 0; }

/* Ledger */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat-cards .card { padding: 18px 20px; }
.stat-cards span { font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stat-cards b { display: block; font-size: 24px; font-weight: 600; margin-top: 6px; }
.stat-cards small { color: var(--muted); font-size: 12.5px; }
.meter { height: 6px; background: var(--line); margin-top: 10px; border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.dr { color: var(--ink); }
.cr { color: var(--green); }

/* Invoice */

/* Custom orders */
.custom-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.drop { display: block; border: 1.5px dashed var(--line-2); background: #fcf9fb; padding: 26px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop .i { width: 28px; height: 28px; color: var(--brand-dark); margin: 0 auto 8px; display: block; }
.drop b { display: block; font-weight: 500; }
.drop span { font-size: 13px; color: var(--muted); }
.previews { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.previews .pv { width: 76px; height: 76px; position: relative; border: 1px solid var(--line); background: #fff; }
.previews .pv img { width: 100%; height: 100%; object-fit: cover; }
.previews .pv button { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; }
.previews .pv button .i { width: 11px; height: 11px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.input select { -webkit-appearance: none; appearance: none; }
.req { border: 1px solid var(--line); background: #fff; padding: 16px 18px; margin-bottom: 12px; }
.req-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.req-head b { font-size: 15px; }
.req-head span { font-size: 12.5px; color: var(--muted); display: block; }
.req .imgs { display: flex; gap: 6px; margin: 12px 0; }
.req .imgs img { width: 54px; height: 54px; object-fit: cover; border: 1px solid var(--line); }
.req .steps-mini { display: flex; gap: 3px; margin-top: 10px; }
.req .steps-mini i { flex: 1; height: 4px; background: var(--line); }
.req .steps-mini i.on { background: var(--brand); }
.req .now { font-size: 12.5px; margin-top: 8px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Account */
.acct { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.acct-nav { display: grid; gap: 2px; position: sticky; top: 90px; }
.acct-nav a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-size: 14px; color: var(--ink-2); }
.acct-nav a .i { width: 16px; height: 16px; color: var(--muted); }
.acct-nav a.on { background: #fff; border: 1px solid var(--line); font-weight: 500; color: var(--ink); }
.acct-nav a.on .i { color: var(--brand-dark); }
.kyc-ok { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--green-soft); color: #2f5a3b; font-size: 14px; margin-bottom: 20px; }
.kyc-ok .i { width: 20px; height: 20px; }
.addr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.addr { border: 1px solid var(--line); padding: 16px; font-size: 14px; line-height: 1.6; }
.addr b { display: block; margin-bottom: 4px; }
.addr.add { border-style: dashed; display: grid; place-items: center; color: var(--brand-dark); cursor: pointer; min-height: 130px; background: #fcf9fb; }

/* KYC */
.kyc { max-width: 720px; margin: 20px auto; }
.kyc-steps { display: grid; gap: 0; margin: 30px 0; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(30, 8, 27, .45); z-index: 90; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-bg.open { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: #fff; width: 100%; max-width: 460px; padding: 28px; max-height: 90vh; overflow-y: auto; animation: rise .25s ease; }
.modal h3 { font-size: 22px; font-weight: 500; margin-bottom: 18px; }
.modal .btn-row { margin-top: 8px; }

/* Responsive */
@media (max-width: 1200px) {
  .p-search { width: 160px; }
  .p-nav a { padding: 7px 9px; font-size: 11.5px; }
}
@media (max-width: 1024px) {
  .p-head .bar1 { padding: 0 16px; gap: 10px; }
  .p-nav { display: none; }
  .p-burger { display: grid; }
  .p-logo { flex: 1; }
  .p-search { display: none; }
  .p-drawer { position: fixed; inset: 64px 0 0 0; background: #fff; z-index: 39; padding: 12px 20px; overflow-y: auto; }
  .p-drawer.open { display: block; }
  .p-drawer a { display: flex; align-items: center; gap: 12px; padding: 15px 4px; border-bottom: 1px solid var(--line); font-size: 15px; }
  .p-drawer a .i { color: var(--brand-dark); }
  .p-drawer .p-search { display: flex; width: 100%; margin: 6px 0 10px; height: 42px; }
  .user-btn .nm { display: none; }
  .p-main { padding: 20px 16px 120px; }
  .cat-layout { grid-template-columns: 1fr; }
  .fpanel { position: fixed; inset: 0 auto 0 0; width: 300px; max-width: 86vw; max-height: none; background: #fff; z-index: 80; padding: 20px; transform: translateX(-105%); transition: transform .3s ease; box-shadow: var(--shadow); }
  .fpanel.open { transform: none; }
  .filter-btn { display: inline-flex; }
  .cart-layout, .od, .custom-layout, .acct { grid-template-columns: 1fr; }
  .modal.viewer { display: block; height: auto; max-height: 92vh; overflow-y: auto; }
  .v-img { aspect-ratio: 1; }
  .v-info { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .v-step { top: calc(50vw - 39px); right: 12px; }
  .summary { position: static; }
  .acct-nav { position: static; grid-auto-flow: column; overflow-x: auto; }
  .acct-nav a { white-space: nowrap; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .cats { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; margin: -8px -16px 16px; padding: 6px 16px; }
  .cats a { white-space: nowrap; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pc { min-width: 0; }
  .pc .add-row { gap: 6px; }
  .pc .add-row .btn { padding: 0 6px; min-width: 0; }
  .pc .qty.sm button { width: 24px; }
  .pc .qty.sm input { width: 24px; }
  .p-logo img { height: 28px; }
  .toolbar select { max-width: 150px; }
  .pc .im .w { display: none; }
  .pc .nm { display: none; }
  .pc .bd { padding: 10px; }
  .pc .row1 { flex-direction: column; align-items: flex-start; gap: 2px; }
  .pc .opts { justify-content: flex-start; gap: 10px; }
  .grid.list .pc { flex-direction: column; }
  .grid.list .pc .im { width: auto; aspect-ratio: 1 / .86; }
  .cart-float { left: 10px; right: 10px; transform: none; gap: 14px; padding-left: 14px; }
  .cart-float .lbl { display: none; }
  .cl { grid-template-columns: 64px 1fr; }
  .cl .rt { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .stat-cards { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .p-title h1 { font-size: 25px; }
  .tbl-wrap .tbl { min-width: 640px; }
  .oc .stats div { font-size: 9px; }
}
@media print {
  .p-head, .preview-bar, .no-print, .cart-float, .toast { display: none !important; }
  body.portal { background: #fff; }
  .p-main { padding: 0; }
}
