.portal-shell {
    --rail: 232px;
    --ink: #142b4a;
    --muted: #52647b;
    --line: #dce4ed;
    background: #f6f8fb;
    color: var(--ink);
    padding-left: var(--rail);
    margin: 0;
}
.portal-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--rail);
    background: #fff;
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
}
.portal-brand, .portal-profile, .portal-topbar, .portal-nav-link, .portal-actions {
    display: flex;
    align-items: center;
}
.portal-brand { padding: 0 22px; min-height: 77px; justify-content: space-between; }
.portal-brand img { display: block; width: 165px; height: auto; }
.portal-sidebar nav { padding: 0 12px 20px; overflow-y: auto; flex: 1; }
.portal-group { color: var(--muted); margin: 24px 12px 8px; font-size: .73rem; letter-spacing: .05em; text-transform: uppercase; }
.portal-nav-link { gap: 11px; padding: 11px 12px; color: #43536c; border-radius: 9px; margin-block: 2px; font-size: .92rem; line-height: 1.4; text-decoration: none; }
.portal-nav-link svg { flex: none; }
.portal-nav-link:hover { background: #f2f5fa; }
.portal-nav-link[aria-current] { background: #e8f0ff; color: #154b9e; }
.portal-profile { gap: 10px; border-top: 1px solid var(--line); margin-inline: 12px; padding: 16px 4px; }
.portal-profile strong, .portal-profile small { display: block; overflow-wrap: anywhere; }
.portal-profile strong { font-size: .9rem; }
.portal-profile small { color: var(--muted); font-size: .77rem; }
.portal-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: none; background: #e4edfc; border-radius: 50%; color: #225092; }
.portal-profile form { margin: 0 0 0 auto; }
.portal-profile button, .portal-menu-close, .portal-menu-open { color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; width: 38px; height: 38px; padding: 0; cursor: pointer; }
.portal-profile button { display: grid; place-items: center; }
.portal-topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px clamp(18px,4vw,55px); min-height: 64px; gap: 14px; color: var(--muted); font-size: .91rem; }
.portal-switch { margin-left: auto; color: #2155a2; text-decoration: underline; text-underline-offset: 3px; }
.portal-menu-open, .portal-menu-close, .portal-scrim { display: none; }
.portal-shell .admin-content { max-width: 1320px; margin: 0 auto; padding: 24px clamp(18px,4vw,55px) 50px; min-width: 0; }
.portal-shell .portal-heading { margin: 12px 0 24px; }
.portal-heading h1 { margin: 0 0 7px; }
.portal-heading p { color: var(--muted); }
.portal-shell :focus-visible { outline: 3px solid #3978d6; outline-offset: 3px; }
.portal-actions { gap: 10px; flex-wrap: wrap; }
.version-preview-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; color: var(--muted); font-size: .9rem; }
.version-preview-meta a { color: #2155a2; text-decoration: underline; text-underline-offset: 3px; }
.version-preview-actions { justify-content: space-between; }
.portal-shell .site-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,330px),1fr)); align-items: start; }
.portal-shell .site-overview { overflow: hidden; padding: 0 20px 20px; }
.site-cover { isolation: isolate; position: relative; margin: 0 -20px; padding: 38px 20px 20px; background: #1c3454 center 43% / cover; min-height: 124px; display: flex; flex-direction: column; justify-content: flex-end; }
.site-cover::before { position: absolute; inset: 0; z-index: -1; content: ""; background: linear-gradient(8deg,#0a1c35e8,#11284650); }
.site-cover--salon { background-image: url('../salon.jpg'); }
.site-cover--beauty { background-image: url('../beauty.jpg'); }
.site-cover--ceramic { background-image: url('../ceramic.jpg'); }
.site-cover--auto { background-image: url('../auto.jpg'); }
.site-cover--brand { background: linear-gradient(110deg,#15365c,#386088); }
.site-cover h2, .site-cover .site-product { color: #fff; margin-block: 0; }
.site-cover .site-product { font-size: .68rem; letter-spacing: .09em; }
.site-facts .site-author { display: block; color: var(--muted); font-weight: 550; font-size: .77rem; margin-top: 4px; }
.portal-shell .site-links { margin-top: 10px; }
.portal-shell .site-actions { display: block; }
.portal-shell .site-actions .button { min-height: 41px; padding: 9px 14px; font-size: .86rem; }
.buyer-orders, .portal-list { list-style: none; margin: 16px 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: white; }
.buyer-orders li + li, .portal-row + .portal-row { border-top: 1px solid var(--line); }
.buyer-order { display: grid; grid-template-columns: minmax(130px,1fr) auto auto minmax(90px,auto) auto; align-items: center; gap: 18px; padding: 17px 20px; color: var(--ink); text-decoration: none; }
.buyer-order:hover, a.portal-row:hover { background: #f3f7ff; }
.buyer-order-name strong, .buyer-order-name small { display: block; }
.buyer-order-name small, .buyer-order time, .portal-label { color: var(--muted); font-size: .83rem; }
.buyer-order-name strong { overflow-wrap: anywhere; }
.order-open { color: #2155a2; font-size: .84rem; }
.portal-amount, .portal-metric strong { font-variant-numeric: tabular-nums; }
.portal-status { display: inline-block; justify-self: start; border-radius: 20px; padding: 3px 10px; background: #edf1f6; color: #364961; font-size: .78rem; }
.portal-status[data-state="paid"] { background: #e4f4e9; color: #245b3b; }
.portal-status[data-state="awaiting_payment"] { background: #fff1d8; color: #754d14; }
.portal-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,150px),1fr)); gap: 14px; margin-block: 20px; }
.portal-metric { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 17px; color: var(--ink); }
.portal-metric strong { display: block; }
.portal-row { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 13px 18px; overflow-wrap: anywhere; }
.portal-row > div { flex: 1 1 140px; min-width: 0; }
.portal-row small { display: block; color: var(--muted); }
.portal-row a, .portal-shell .client-card > a:not(.button) { color: #2155a2; text-decoration: underline; text-underline-offset: 3px; }
.portal-metrics .client-card { margin: 0; text-decoration: none; }
.portal-metrics > .portal-metric:first-child { background: #17365d; border-color: #17365d; color: #fff; }
.portal-metrics > .portal-metric:first-child .portal-label { color: #e0ebfa; }
.portal-metric:hover { border-color: #80a3d7; }
.portal-shell .admin-content > h2 { margin: 28px 0 12px; }
.portal-list + nav svg { height: 20px; width: 20px; }
@media (max-width: 800px) {
    .portal-shell { padding: 0; }
    .portal-sidebar { position: static; width: 100%; }
    .portal-shell[data-nav-ready] .portal-sidebar { position: fixed; width: min(292px,86vw); transform: translateX(-102%); visibility: hidden; }
    .portal-shell[data-nav-open] .portal-sidebar { visibility: visible; transform: none; }
    .portal-shell[data-nav-open] { overflow: hidden; }
    .portal-shell[data-nav-ready] :is(.portal-menu-open,.portal-menu-close) { display: grid; place-items: center; font-size: 1.4rem; }
    .portal-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 29; border: 0; background: #12233888; }
    .portal-topbar { padding: 10px 16px; min-height: 55px; }
    .portal-brand { min-height: 65px; }
    .portal-shell .admin-content { padding: 15px 16px 40px; }
    .buyer-order { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 15px; }
    .buyer-order-name { grid-column: 1; grid-row: 1; }
    .buyer-order .portal-amount { grid-column: 2; grid-row: 1; }
    .buyer-order .portal-status { grid-column: 1; grid-row: 3; }
    .order-open { grid-column: 2; grid-row: 3; }
    .portal-row { padding: 13px; }
}

.publication-screen { max-width: 860px; }
.publication-screen h1 { margin: 0 0 16px; }
.publication-screen .client-card { margin: 0 0 14px; padding: clamp(16px, 2.4vw, 26px); }
.publication-screen .client-card h2 { margin: 0 0 8px; }
.publication-screen p { margin: 7px 0; overflow-wrap: anywhere; }
.publication-screen .button { min-height: 44px; padding: 10px 18px; }
.publication-draft { border-top: 3px solid #3068c7; }
.publication-name { font-weight: 650; }
.publication-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; color: var(--muted); font-size: .9rem; }
.publication-meta time { white-space: nowrap; }
.publication-preview { margin-top: 12px; }
.publication-preview summary { display: list-item; width: fit-content; max-width: 100%; padding: 10px 14px; color: #204777; background: #fff; border: 1px solid #aebdd0; border-radius: 9px; font-weight: 600; cursor: pointer; }
.publication-preview summary:hover { background: #f0f5ff; }
.publication-preview a { display: inline-block; margin: 10px 0; }
.publication-preview iframe { display: block; width: 100%; height: clamp(320px, 50vh, 550px); border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.publication-screen .publication-status { margin-top: 14px; }
.publication-confirm { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.publication-confirm label { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; cursor: pointer; }
.publication-confirm input[type=checkbox] { width: 19px; height: 19px; flex: none; margin: 2px 0 0; accent-color: #245cbe; }
.publication-confirm .button { margin-top: 12px; }
.publication-screen .publication-live { background: #f4f8fc; }
.publication-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
@media (max-width: 560px) {
    .publication-confirm .button { width: 100%; }
}
