/* Portal interaction pass: readable operations, visual image management. */
[hidden]{display:none!important}
:where(button,a,input,select,textarea):focus-visible{outline:2px solid #2563eb;outline-offset:3px}
:where(input,select,textarea){font-size:14px}
.field{font-size:13px;line-height:1.6;font-weight:600}
:where(.ops-table,.operational-table){font-size:13px;line-height:1.6}
:where(.ops-table,.operational-table) th{font-size:12px;font-weight:600}
:where(.ops-table,.operational-table) td{padding-block:16px}
:where(.review-detail,.record-detail){font-size:14px;line-height:1.65}
.review-detail .panel-head{padding-block-end:14px;border-block-end:1px solid var(--line)}
.review-detail .panel-head h2{margin:0;font-size:18px}
.review-detail .ops-comment{padding:14px;background:#f4f7fb;border-radius:8px;color:#34465e;overflow-wrap:anywhere}
.gallery-head{display:flex;justify-content:space-between;align-items:start;gap:20px;flex-wrap:wrap}
.gallery-head h2{font-size:20px;margin:0 0 6px}
.gallery-head p{margin:0;font-size:14px}
.gallery-filterbar{display:flex;flex-wrap:wrap;align-items:center;gap:16px;border-block-end:1px solid var(--line);padding-block-end:16px}
.gallery-filterbar input{flex:1;min-width:190px;max-width:340px}
.gallery-filterbar p{margin:0;white-space:nowrap}
.gallery-tabs{flex:1;min-width:260px;flex-wrap:wrap}
.gallery-tabs button{min-height:44px;font-size:13px;white-space:nowrap}
.library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(172px,1fr));gap:18px}
.library-card{position:relative;display:flex;flex-direction:column;gap:0;padding:0;overflow:hidden;border:1px solid var(--line);border-radius:12px;background:#fff;min-width:0}
.library-card:focus-within{border-color:#2563eb}
.library-card .photo-thumb{width:100%;height:auto;aspect-ratio:1;background:#f2f4f7;border-radius:0;display:grid;place-items:center;overflow:hidden}
.library-card .photo-thumb img{width:100%;height:100%;object-fit:cover}
.photo-open{display:block;width:100%;border:0;padding:0;background:#f2f4f7;cursor:zoom-in}
.photo-menu,.photo-remove{position:absolute;inset-block-start:8px;inset-inline-end:8px;display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;background:#fff;border:1px solid #d9e1eb;border-radius:10px;color:#17263c;font-size:26px;line-height:1;cursor:pointer;box-shadow:0 2px 5px #10213b12}
.photo-remove{color:#b03040}
.photo-card-caption{display:grid;gap:5px;padding:14px;min-width:0}
.photo-card-caption strong{font-size:14px;font-weight:600;overflow-wrap:anywhere;line-height:1.5}
.photo-card-caption small{font-size:12px;color:#52647a}
.library-card .library-usages{padding:0 14px 12px;gap:6px}
.library-usages:empty{display:none}
.library-usage{font-size:12px;line-height:1.5}
.gallery-empty{grid-column:1/-1;padding:40px 16px;display:grid;place-items:center;gap:8px;text-align:center;border:1px dashed #ccd6e3;border-radius:10px}
.gallery-empty p{margin:0;font-size:14px}
.library-dialog{width:min(960px,calc(100% - 40px));max-height:90dvh;padding:24px;border-radius:16px;background:#fff;overscroll-behavior:contain;overflow:auto}
.library-dialog-head{position:sticky;inset-block-start:-24px;background:#fff;z-index:3;margin:-24px -24px 22px;padding:18px 24px;border-block-end:1px solid var(--line);align-items:center}
.library-dialog-head h2{font-size:20px}
.library-dialog-head .button{width:44px;height:44px;padding:0;font-size:24px}
.library-dialog::backdrop{background:#10213b80}
.photo-inspector{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(240px,1fr);gap:28px;align-items:start}
.photo-inspector-preview{width:100%;aspect-ratio:1;background:#f4f6f8;display:grid;place-items:center;border-radius:10px;overflow:hidden}
.photo-inspector-preview img{width:100%;height:100%;object-fit:contain}
.photo-inspector h2,.photo-inspector h3{margin:0}
.photo-inspector p{margin:0;font-size:14px}
.photo-usage-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-block-end:1px solid var(--line);padding-block:10px}
.photo-usage-row strong{font-size:14px}
.image-source-actions{display:flex;align-items:start;gap:12px;flex-wrap:wrap}
.image-upload{display:grid;gap:10px;min-width:0}
.image-upload .row-actions{align-items:center;flex-wrap:wrap}
.upload-status{font-size:13px;color:#52647a}
.upload-queue{display:grid;gap:8px;max-height:180px;overflow:auto}
.upload-queue:empty{display:none}
.upload-file{display:grid;grid-template-columns:44px minmax(70px,1fr) auto;align-items:center;gap:10px;font-size:12px;max-width:420px}
.upload-file img{width:44px;height:44px;object-fit:cover;border-radius:6px}
.upload-file > span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.upload-file.is-failed{color:#b03040}
.upload-file.is-complete > span:last-child{color:#19734d}
.image-editor-footer{position:sticky;inset-block-end:-24px;display:flex;justify-content:flex-end;gap:12px;background:#fff;border-block-start:1px solid var(--line);margin:8px -24px -24px;padding:16px 24px;z-index:2}
.library-pick{cursor:pointer;position:relative;padding:0;border-radius:10px;overflow:hidden}
.library-pick:focus-visible,.library-pick:hover{border-color:#2563eb}
.library-pick .photo-thumb{aspect-ratio:1}
.library-pick span{padding:8px;font-size:13px}
.marketing-image-preview{position:relative}
.marketing-history{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:18px}
.marketing-history-card{display:grid;gap:16px;overflow:hidden;border:1px solid var(--line);border-radius:12px;padding:16px}
.marketing-history-card h3,.marketing-history-card p{margin:0}
.marketing-history-card small{color:#52647a}
.marketing-history-card .marketing-photo{aspect-ratio:2;max-height:240px}
.marketing-placement{font-size:13px;color:#34465e}
.activity-images{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.activity-images figure{margin:0;min-width:0}
.activity-photo{width:100%;aspect-ratio:1;overflow:hidden;border-radius:8px;background:#f4f6f8;display:grid;place-items:center}
.activity-photo img{width:100%;height:100%;object-fit:contain}
.activity-images figcaption{font-size:13px;margin-block-start:8px;color:#52647a}
.brand-image{position:relative}
.brand-image-actions{display:flex;gap:8px;justify-content:flex-end;margin-block-start:12px}
.brand-logo-photo{max-height:180px}
.brand-cover-photo{max-height:280px}
@media(min-width:1200px){.review-workspace.has-detail{grid-template-columns:minmax(0,1fr) minmax(380px,440px)}}
@media(max-width:640px){
 .gallery-head{gap:14px}.gallery-head>div{width:100%}.gallery-filterbar{gap:12px}.gallery-filterbar input{max-width:none;width:100%}.gallery-tabs{width:100%;min-width:0;overflow-x:auto;flex-wrap:nowrap}.gallery-tabs button{flex:none}
 .library-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.photo-card-caption{padding:12px}.photo-card-caption small{font-size:11px}.library-card .library-usages{padding:0 12px 12px}
 .library-dialog{width:calc(100% - 16px);max-height:94dvh;padding:18px;border-radius:14px}.library-dialog-head{inset-block-start:-18px;margin:-18px -18px 18px;padding:12px 18px}.library-dialog-head h2{font-size:18px}
 .photo-inspector{grid-template-columns:1fr;gap:20px}.photo-inspector-preview{max-height:42dvh;aspect-ratio:1.3}.image-editor-footer{inset-block-end:-18px;margin:8px -18px -18px;padding:14px 18px}.image-editor-footer .button{flex:1}
 :where(.button,.text-button,.library-usage){min-height:44px}.image-source-actions{gap:10px}.image-source-actions>.button,.image-source-actions>.image-upload{flex:1}.image-upload .button{width:100%}
 .marketing-history{grid-template-columns:1fr}.shop-brand-grid{grid-template-columns:1fr}.brand-logo-photo{max-height:150px}.brand-cover-photo{max-height:220px}
 .review-detail{max-height:none;position:static}.ops-facts{gap:12px}.ops-table td{font-size:14px}
 .portal-shell--delivery .button{min-height:48px;font-size:15px}.portal-shell--delivery .delivery-phone-card{border-radius:14px;box-shadow:0 3px 12px #10213b06}.portal-shell--delivery .delivery-phone-card h2{line-height:1.5}.portal-shell--delivery .delivery-search input{height:48px;font-size:15px}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

.gallery-filterbar{display:grid;grid-template-columns:minmax(0,1fr) auto}.gallery-tabs{grid-column:1/-1;flex-wrap:nowrap;overflow-x:auto;min-width:0}.gallery-tabs button{flex:none}.gallery-filterbar input{max-width:none}.image-crop-canvas{display:block;max-height:48dvh;max-width:100%;width:auto;margin:auto;background:#f4f6f8;touch-action:none;cursor:move;border:1px solid var(--line);border-radius:8px}::selection{background:#d7e6ff;color:#10213b}input,textarea{caret-color:#2563eb}

/* Readable type and predictable action sizes across every operational page. */
:root{--muted:#52647a}
.page-head p,.purpose-note{font-size:14px;line-height:1.65}
.panel h2{font-size:18px}.panel h3{font-size:16px}
.nav button,.portal-nav .nav-copy strong{font-size:14px}.nav button{min-height:44px}.nav button span{font-size:14px}
.field>span{font-size:13px;line-height:1.6}.field small{font-size:12px}
.ops-stat span:not(.ops-stat-icon):not(.ops-stat-arrow){font-size:13px}.ops-stat{min-height:94px}
.ops-fact,.ops-pair strong{font-size:14px}.ops-pair small{font-size:12px;color:#52647a}
.ops-table td,.operational-table td{font-size:14px;padding-block:15px}.ops-table th,.operational-table th{font-size:12px}
.ops-tabs button{font-size:13px;min-height:44px}.button--small{font-size:13px;min-height:38px}
.review-detail .panel-head .button{font-size:13px;min-height:40px}
@media(min-width:1200px){.review-workspace.has-detail{grid-template-columns:minmax(0,1fr) 400px}.review-detail{padding:22px}}
@media(max-width:1100px){.review-workspace.has-detail{grid-template-columns:1fr}}
@media(max-width:640px){.button,.button--small,.nav button{min-height:44px}.ops-fact{font-size:14px}.ops-table td{font-size:14px}.ops-stat{padding:14px;min-height:90px}.page-head h1{font-size:26px}}

/* Refund and balance workspaces share the existing portal type and color tokens. */
.partner-balance{min-width:0}.partner-balances>summary{margin-block-end:18px}.partner-balances>.table-wrap{margin-block:18px}
.ops-refund-line{display:flex;align-items:center;gap:14px;padding-block:14px;min-width:0;border-block-end:1px solid #dce5f1}
.ops-refund-line>div:not(.photo-thumb){flex:1;min-width:0}.ops-refund-line input[type=number]{width:72px;flex:none}
.ops-refund-line .photo-thumb{width:58px;height:66px;flex:none;overflow:hidden;border-radius:8px}
.ops-refund-line .photo-thumb img{width:100%;height:100%;object-fit:cover}.ops-refund-line strong,.refund-receipt-section p{overflow-wrap:anywhere}
.refund-receipt-section{padding-block:18px;border-block-end:1px solid #dce5f1}.refund-payment-form{margin-block-start:16px}
.refund-queue>.form-grid{padding-block-end:20px}.refund-queue input,.refund-queue select{width:100%;min-width:0}
.refund-queue .form-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.balance-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:20px;margin-block:24px}
.balance-metrics>div{min-width:0}.balance-metrics dt{color:#52647a;font-size:14px}.balance-metrics dd{font-size:26px;font-weight:650;margin:8px 0 0;font-variant-numeric:tabular-nums}
.balance-order-list{display:grid;gap:0}.balance-order{display:flex;flex-direction:column;gap:6px;padding-block:18px;border-block-end:1px solid #dce5f1}.balance-order>small{color:#52647a}
.partner-balance .record-facts{grid-template-columns:repeat(2,minmax(0,1fr))}.partner-balance .table-note{margin-block:14px}
@media(max-width:800px){.balance-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.refund-queue .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.refund-queue .form-grid{grid-template-columns:1fr}.balance-metrics{gap:18px}.balance-metrics dd{font-size:23px}.partner-balance .record-facts{grid-template-columns:1fr}.ops-refund-line{gap:10px}.refund-receipt-section .button{width:100%;min-height:44px}.ops-refund-intake>.row-actions{align-items:end;flex-wrap:wrap}.ops-refund-intake>.row-actions>label{flex:1;min-width:200px}}

/* Compact, actionable messages fit phone queues without hiding the next job. */
.empty-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:18px;}
.empty-actions .button{min-height:44px;}
.empty-state{min-height:180px;gap:8px;}.empty-state h2{margin:0;font-size:1.15rem}.empty-state p{margin:0;}
.delivery-group .empty-state{min-height:140px;padding:20px 16px}.partner-balance>.empty-state{min-height:0;padding:20px 16px;}
@media(max-width:600px){.empty-state{padding:24px 16px}.empty-actions{width:100%}.empty-actions .button{flex:1 1 150px}}

/* Destination-aware photo assignment: photos carry the hierarchy. */
.inline-photo-editor { gap:20px; min-width:0; }
.assignment-intro { display:grid; gap:12px; }
.assignment-intro p,.photo-retention-note,.photo-draft-status { margin:0; font-size:13px; }
.assignment-intro .image-source-actions { align-items:center; }
.assignment-gallery { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.assignment-photo { min-width:0; background:white; }
.assignment-photo .assignment-preview { height:auto; aspect-ratio:4/5; border-radius:12px; background:#f5f6f8; }
.assignment-preview img { object-fit:contain; width:100%; height:100%; }
.assignment-caption { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 12px; padding-block-start:8px; }
.assignment-caption strong { font-size:14px; }
.assignment-photo-actions { display:flex; flex-wrap:wrap; gap:4px 10px; }
.assignment-photo-actions .text-button,.assignment-caption .text-button { min-height:44px; padding:8px 0; font-size:13px; }
.assignment-empty { grid-column:1/-1; padding:32px 16px; text-align:center; background:#f7f8fa; border-radius:12px; }
.assignment-empty p { margin:8px 0 0; }
.assignment-library { padding:16px; background:#f6f7f9; border-radius:12px; }
.assignment-library h3 { margin:0; font-size:16px; }
.assignment-library .assignment-choices { grid-template-columns:repeat(auto-fill,minmax(112px,1fr)); max-height:330px; overflow:auto; padding:4px; }
.assignment-choices .library-pick { border:2px solid transparent; background:white; box-shadow:none; }
.assignment-choices .library-pick.is-selected { border-color:var(--ink); }
.assignment-choices .library-pick:disabled { opacity:.55; }
.assignment-library-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.assignment-library-actions p { flex:1; margin:0; }
.assignment-gallery[data-usage=SHOP_COVER] { grid-template-columns:1fr; }
.assignment-gallery[data-usage=SHOP_COVER] .assignment-preview { aspect-ratio:16/9; }
.assignment-gallery[data-usage=SHOP_LOGO],.assignment-gallery[data-usage=CATEGORY_IMAGE] { grid-template-columns:minmax(0,260px); }
.assignment-gallery[data-usage=SHOP_LOGO] .assignment-preview,.assignment-gallery[data-usage=CATEGORY_IMAGE] .assignment-preview { aspect-ratio:1; }
.inline-photo-editor .editor-footer { position:sticky; bottom:-24px; z-index:2; background:white; padding-block:16px; }
.inline-photo-editor .photo-draft-status:empty { display:none; }
@media(max-width:600px) {
 .assignment-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
 .assignment-photo:first-child { grid-column:1/-1; }
 .assignment-photo:first-child .assignment-preview { aspect-ratio:4/3; }
 .assignment-gallery[data-usage=SHOP_COVER] .assignment-preview { aspect-ratio:16/9; }
 .assignment-gallery[data-usage=SHOP_LOGO] .assignment-preview,.assignment-gallery[data-usage=CATEGORY_IMAGE] .assignment-preview { aspect-ratio:1; }
 .inline-photo-editor .editor-footer { bottom:-18px; }
 .assignment-intro .image-source-actions { align-items:stretch; }
}

/* Calm Library navigation and usage review, shared by scoped Shop/Admin views. */
.library-workspace { border:0; box-shadow:none; background:white; padding:20px; gap:20px; }
.library-workspace .gallery-head { align-items:center; gap:16px; }
.library-workspace .gallery-head h2 { font-size:18px; margin:0 0 4px; }
.library-workspace .gallery-head p { font-size:13px; }
.library-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.library-filter-tabs { display:flex; flex-wrap:wrap; gap:4px; min-width:0; }
.library-filter-tabs button { min-height:44px; padding:8px 12px; border:0; border-radius:8px; background:transparent; color:var(--muted); }
.library-filter-tabs button[aria-pressed=true] { background:#edf0f4; color:var(--ink); font-weight:600; }
.library-filter-tabs button:hover { background:#f4f5f7; }
.library-search-tools { display:flex; align-items:center; gap:12px; }
.library-count { margin:0; font-size:13px; white-space:nowrap; }
.library-search { max-width:440px; width:100%; }
.library-collection { grid-template-columns:repeat(auto-fill,minmax(168px,1fr)); gap:20px; }
.library-tile { padding:0; border:0; border-radius:12px; background:white; color:var(--ink); text-align:start; box-shadow:0 3px 14px rgba(25,35,45,.055); overflow:hidden; min-width:0; }
.library-tile .photo-thumb { width:100%; height:auto; aspect-ratio:4/5; border-radius:0; background:#f6f7f9; }
.library-tile .photo-thumb img { object-fit:contain; }
.library-tile-caption { display:grid; gap:4px; padding:12px; }
.library-tile-caption strong { font-size:14px; font-weight:600; line-height:1.55; overflow-wrap:anywhere; }
.library-tile-caption small { font-size:12px; color:var(--muted); }
.library-load-more { justify-self:center; }
.library-inspector-controls { gap:22px; min-width:0; }
.library-inspector-controls .library-shop-context { font-size:13px; }
.library-used-in,.library-placement { gap:10px; }
.library-used-in h3,.library-placement h3 { font-size:16px; }
.library-used-in .photo-usage-row { gap:12px; padding-block:6px; border:0; }
.library-used-in .photo-usage-row div { display:grid; gap:2px; min-width:0; }
.library-used-in .photo-usage-row small { color:var(--muted); font-size:12px; }
.library-used-in .photo-usage-row strong { overflow-wrap:anywhere; }
.library-used-in .text-button { min-height:44px; flex-shrink:0; }
.library-placement-note { font-size:13px!important; }
.library-image-options,.library-image-details { min-width:0; }
.library-image-options summary,.library-image-details summary { min-height:44px; padding-block:12px; cursor:pointer; font-size:13px; }
.library-image-options > .button { margin-block:6px 10px; margin-inline-end:8px; }
.library-image-options p,.library-image-details p { font-size:13px; margin-block:6px; }
.library-inspector-feedback:empty { display:none; }
.inline-photo-editor .editor-footer { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; }
.assignment-destination { margin:0; font-weight:600; color:var(--ink); }
@media(max-width:640px) {
 .library-workspace { padding:12px; gap:16px; }
 .library-toolbar { align-items:start; }
 .library-filter-tabs { flex:1 1 100%; }
 .library-search-tools { width:100%; justify-content:space-between; }
 .library-collection { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
 .library-tile-caption { padding:10px; }
 .library-inspector .photo-inspector-preview { aspect-ratio:4/3; max-height:32dvh; }
 .library-inspector-controls { gap:16px; }
}

/* Final visual corrections from actual Shop/Admin phone and desktop review. */
.library-placement select { height:44px; width:100%; padding:4px 12px; font:inherit; color:var(--ink); background:white; border:1px solid var(--line); border-radius:8px; }
.library-used-in .text-button,.inline-photo-editor .text-button { border:0; background:transparent; color:var(--accent); font:inherit; cursor:pointer; }
.library-used-in .text-button { padding:8px 0; }

/* Customer photo crop samples. The separate assignment image retains contain. */
.customer-photo-crops { min-width:0; }
.customer-photo-crops summary { min-height:44px; display:list-item; align-content:center; cursor:pointer; font-weight:600; }
.customer-photo-crops > p { margin:4px 0 14px; font-size:13px; color:var(--muted); }
.customer-crop-grid { display:flex; flex-wrap:wrap; align-items:flex-start; gap:20px; }
.customer-crop-sample { margin:0; flex:1 1 220px; max-width:390px; min-width:0; }
.customer-crop-sample figcaption { margin-block-start:8px; font-size:13px; }
.customer-crop { width:100%; overflow:hidden; border-radius:14px; background:#f5f6f8; }
.customer-crop img { display:block; width:100%; height:100%; object-fit:cover; object-position:center; }
.customer-crop--product { aspect-ratio:1.35; }
.customer-crop--shop-phone { aspect-ratio:390/222.3; }
.customer-crop--shop-wide { aspect-ratio:760/290; }
.customer-crop--shop-tile { aspect-ratio:1; max-width:180px; }

/* Email-code actions keep consistent accessible targets within the existing auth layout. */
.auth-email-flow .button{min-height:44px}

/* Pricing is one form section; stock-only removal must not remove its inputs. */
.product-editor-form .product-pricing-editor { grid-column: 1 / -1; min-width: 0; }
