*{box-sizing:border-box}body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;background:#f5f6f8;color:#15171a}.topbar{height:64px;background:#fff;border-bottom:1px solid #e6e8eb;display:flex;align-items:center;justify-content:space-between;padding:0 24px;position:sticky;top:0;z-index:20}.topbar strong{font-size:calc(20px * var(--text-scale,1))}.muted{color:#7b818a;font-size:calc(13px * var(--text-scale,1));margin-left:8px}.shell{max-width:1120px;margin:28px auto;padding:0 18px}.card{background:#fff;border:1px solid #e5e7ea;border-radius:16px;padding:22px;box-shadow:0 8px 30px rgba(0,0,0,.035)}.auth-grid{display:grid;grid-template-columns:1fr 1fr;gap:28px;max-width:820px;margin:60px auto}.auth-grid form+form{border-left:1px solid #eceef1;padding-left:28px}h2{margin:0 0 18px;font-size:calc(20px * var(--text-scale,1))}label{display:flex;flex-direction:column;gap:7px;font-size:calc(13px * var(--text-scale,1));color:#555c65;margin-bottom:14px}input,textarea{width:100%;border:1px solid #d9dde3;border-radius:10px;padding:11px 12px;font:inherit;color:#15171a;background:#fff}input:focus,textarea:focus{outline:2px solid #c8d7ff;border-color:#7b9cff}button{border:0;border-radius:10px;background:#15171a;color:#fff;padding:11px 16px;font-weight:650;cursor:pointer}button:hover{opacity:.9}button.secondary{background:#edf0f3;color:#1d2228}.tabs{display:flex;gap:10px;margin-bottom:18px}.tabs button{background:#e9ecef;color:#333}.tabs button.active{background:#15171a;color:#fff}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.full{grid-column:1/-1}.filter-row{display:grid;grid-template-columns:repeat(4,1fr) auto;gap:10px}.product-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:16px}.product-card{background:#fff;border:1px solid #e5e7ea;border-radius:14px;overflow:hidden}.product-card .cover{height:170px;background:#eef0f2;display:flex;align-items:center;justify-content:center;color:#9298a1}.product-card .body{padding:16px}.product-card h3{margin:0 0 8px}.chips{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}.chip{font-size:calc(12px * var(--text-scale,1));background:#f0f2f4;border-radius:999px;padding:4px 8px}.notice{margin-top:14px;padding:12px;border-radius:10px;background:#f0f7ff;color:#164f8a}.hidden{display:none!important}dialog{width:min(760px,92vw);border:0;border-radius:18px;padding:24px;box-shadow:0 24px 80px rgba(0,0,0,.2)}dialog::backdrop{background:rgba(0,0,0,.45)}.dialog-close{position:absolute;right:14px;top:12px;background:transparent;color:#333;font-size:calc(26px * var(--text-scale,1));padding:4px 10px}.media-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:16px 0}.media-grid img,.media-grid video{width:100%;max-height:360px;object-fit:contain;background:#f3f4f6;border-radius:12px}.share-box{border-top:1px solid #eceef1;margin-top:18px;padding-top:18px}.share-result{display:grid;grid-template-columns:1fr 180px;gap:18px;align-items:center}.share-result img{width:180px;height:180px}.public-card{max-width:760px;margin:40px auto}.password-row{display:flex;gap:10px}.password-row input{font-size:calc(22px * var(--text-scale,1));letter-spacing:8px;text-align:center}.charm{font-size:calc(26px * var(--text-scale,1));font-weight:750}.toast{position:fixed;right:18px;bottom:18px;background:#15171a;color:#fff;padding:12px 16px;border-radius:10px;z-index:50}@media(max-width:760px){.auth-grid{grid-template-columns:1fr;margin:20px auto}.auth-grid form+form{border-left:0;border-top:1px solid #eceef1;padding-left:0;padding-top:22px}.form-grid{grid-template-columns:1fr}.filter-row{grid-template-columns:1fr 1fr}.product-grid{grid-template-columns:1fr}.share-result{grid-template-columns:1fr}.media-grid{grid-template-columns:1fr}.topbar{padding:0 14px}}.code-row{display:grid;grid-template-columns:1fr auto;gap:10px;align-items:end}.code-row label{margin-bottom:0}.code-row button{margin-bottom:14px;white-space:nowrap}.code-row button:disabled{opacity:.55;cursor:not-allowed}@media(max-width:760px){.code-row{grid-template-columns:1fr}.code-row button{margin-bottom:14px}}

.three-images{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.three-images>div{aspect-ratio:1;background:#eef0f2;display:grid;place-items:center;overflow:hidden}.three-images img{width:100%;height:100%;object-fit:cover}.public-detail>img,.public-detail>video{display:block;max-width:100%;max-height:75vh;margin:16px auto}.public-detail>img{cursor:zoom-in}
.product-card h3,.public-card,.share-result{overflow-wrap:anywhere}select{max-width:100%}button:disabled{cursor:not-allowed;opacity:.55}pre{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;overflow:auto}@media(max-width:480px){.tabs{flex-wrap:wrap}.password-row{flex-wrap:wrap}.card{padding:14px}.topbar{height:auto;min-height:64px;flex-wrap:wrap;gap:8px}.filter-row{grid-template-columns:minmax(0,1fr)}}

.media-editor-item{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:10px 0;overflow-wrap:anywhere;min-width:0}.media-editor-item img,.media-editor-item video{width:150px;max-width:100%;max-height:180px;object-fit:contain}.media-editor-item button,.media-editor-item select{min-height:44px}.media-editor-item label{margin:0}#recoveryPanel{max-height:70vh;overflow:auto}#draftMedia,#recoveryPanel{min-width:0}
#productResult{overflow-wrap:anywhere}.media-editor-item img{cursor:zoom-in}

/* Retain these two columns at phone widths; other fields keep their responsive grid. */
.merchant-basics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;min-width:0}
.merchant-basics>label,#productForm>label{min-width:0;overflow-wrap:anywhere}
#productForm input,#productForm select,#productForm textarea{min-width:0;max-width:100%}
#productForm{min-width:0}#merchantTab{min-width:0}
.field-error{color:#a31c25;font-size:calc(12px * var(--text-scale,1));overflow-wrap:anywhere}
[aria-invalid="true"]{border-color:#a31c25}

/* Keep long Chinese nicknames editable on narrow mobile viewports. */
#registerForm,#registerForm label,#registerForm input{min-width:0;max-width:100%;box-sizing:border-box}
#registerForm input[name="display_name"]{width:100%;white-space:nowrap;overflow:hidden;text-overflow:clip}
.product-card-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px}
.product-card-actions>button{min-height:40px}
.product-card-contact{flex:1 1 100%;min-width:0;margin-top:4px}
.high-tier-share-note{padding:10px 12px;border-radius:10px;background:#f0f7ff;color:#164f8a}

/* Three-end private beta navigation */
.tabs{flex-wrap:wrap}.tabs button[aria-current=page]{font-weight:700}.area-map{font-size:calc(.9rem * var(--text-scale,1))}.area-map p{color:#667085}.notice-unread{font-weight:700}#passwordRecoveryForm{display:grid;gap:12px}#registerForm.hidden,[data-workspace-panel].hidden{display:none!important}@media(max-width:600px){.shell{padding:12px}.tabs button{flex:1}.topbar{gap:8px}button{min-height:42px}}

#cHome[data-detail-active=true] #collectionProducts>div{display:none}#cHome[data-detail-active=true] #collectionProducts>.c-selected-detail{display:block}#cHome[data-detail-active=true] #collectionFilters,#cHome[data-detail-active=true] #collectionPrevious,#cHome[data-detail-active=true] #collectionNext,#cHome[data-detail-active=true] #collectionMe{display:none}

/* All role detail media use one column at every viewport width. */
.product-media-detail{display:flex;flex-direction:column;gap:12px;min-width:0}.product-media-detail>img,.product-media-detail>video{display:block;width:100%;max-width:100%;max-height:75vh;object-fit:contain;background:#f3f4f6;border-radius:12px;margin:0 auto}.product-media-detail>img{cursor:zoom-in}.product-media-detail>p{margin:4px 0;overflow-wrap:anywhere}#merchantList>.card{margin-bottom:16px}#merchantList .three-images{margin-bottom:12px}#merchantList button{margin:4px}#productResult details{margin-top:10px}#productResult button{margin-top:10px}#productResult[data-state="failure"]{background:#fff0f1;color:#8e1a26}#productResult[data-state="pending"]{background:#fff8e2;color:#69510e}

/* One merchant detail surface keeps preview and editing together. */
#merchantProductDetail{max-height:92dvh;overflow:auto;padding:20px}
.merchant-detail-toolbar{position:sticky;top:-20px;z-index:3;background:#fff;padding:12px 0;border-bottom:1px solid #e5e7ea;align-items:center}
.merchant-detail-toolbar button{min-height:44px}.merchant-detail-toolbar button:last-child{margin-left:auto}
.merchant-detail-note{overflow-wrap:anywhere;color:#555c65;margin:12px 0 18px}
.merchant-dialog-editor>.card{padding:0;border:0;box-shadow:none}
#merchantSearch{display:grid;grid-template-columns:minmax(160px,2fr) minmax(160px,2fr) minmax(110px,1fr) minmax(130px,1fr);gap:12px;align-items:start}
#merchantSearch>button{grid-column:1/-1;justify-self:start;min-width:120px}
#merchantSearch label{min-width:0;margin:0}#merchantSearch .area-map{grid-column:1/-1}
#merchantSearch select,#productForm select{width:100%;padding:11px 12px;min-height:44px;border:1px solid #d9dde3;border-radius:10px;background:#fff;font:inherit;color:#15171a}
#merchantSearch select:focus,#productForm select:focus{outline:2px solid #c8d7ff;border-color:#7b9cff}
[data-city-note]{font-size:calc(12px * var(--text-scale,1));line-height:1.5;color:#667085}
.merchant-media-preview{display:flex;flex-direction:column;gap:8px;max-width:100%}.merchant-media-preview video{background:#f3f4f6;min-height:100px}
.merchant-media-preview .video-load-button{max-width:180px;white-space:normal}
.product-media-detail>.video-load-button{align-self:center;min-height:44px}
.contact-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}
.contact-field{min-width:0}.contact-field>span{display:flex;align-items:center;gap:8px}
.contact-icon{display:inline-flex;width:28px;height:28px;min-width:28px;align-items:center;justify-content:center;color:#315f85}.contact-icon svg{display:block;width:28px;height:28px}
.contact-preview{display:grid;gap:10px;margin:18px 0}.contact-row,.contact-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;min-width:0}
.contact-value{display:inline-flex;align-items:center;gap:9px;flex:1 1 200px;min-width:0;padding:10px 12px;border-radius:10px;background:#f3f6f9;color:#183d59;text-decoration:none;font-weight:500;text-align:left;overflow-wrap:anywhere}
.contact-value span:last-child{min-width:0;overflow-wrap:anywhere}.contact-row button,.merchant-contact-form>button{min-height:44px}.merchant-contact-form>button{grid-column:1/-1;justify-self:start}
.contact-legacy{padding:12px;margin-top:18px;background:#f6f7f9;border-radius:10px;overflow-wrap:anywhere}.contact-legacy summary{cursor:pointer}
@media(max-width:760px){#merchantSearch{grid-template-columns:repeat(2,minmax(0,1fr))}#merchantProductDetail{width:96vw;padding:14px}.merchant-detail-toolbar{top:-14px}}
@media(max-width:480px){#merchantSearch,.contact-grid{grid-template-columns:minmax(0,1fr)}.merchant-detail-toolbar button{padding:10px;flex:1 1 auto}.merchant-detail-toolbar button:last-child{margin-left:0}}

/* Round8 merchant editor: one compact city control and one media editing surface. */
.merchant-city-combo{display:grid;grid-template-columns:minmax(0,1fr) 1px minmax(92px,34%);align-items:stretch;border:1px solid #d9dde3;border-radius:10px;background:#fff;overflow:hidden}
.merchant-city-combo input,.merchant-city-combo select{border:0!important;border-radius:0!important;outline:0!important;background:transparent!important}
.merchant-city-combo input:focus,.merchant-city-combo select:focus{box-shadow:inset 0 0 0 2px #c8d7ff}
.merchant-city-divider{background:#d9dde3;margin:8px 0}
.merchant-city-note{display:none}
.merchant-file-inputs{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;white-space:nowrap!important}

.merchant-public-location{margin-bottom:12px}
.merchant-public-location>label{margin-bottom:6px}
.merchant-location-control{display:flex;align-items:center;gap:10px;margin-top:6px}
.merchant-location-control>button{flex:0 0 auto}
.merchant-location-control>.geo-status{margin:0;color:#667085;font-size:calc(12px * var(--text-scale,1))}
.geo-private-point:empty{display:none}
.merchant-location-dialog .geo-status{margin:8px 0}
.merchant-location-dialog [data-location-action="discard"]{display:none}
.geo-actions{margin-top:10px}

.merchant-media-board{display:flex;flex-direction:column;gap:10px;margin:6px 0 12px;width:100%;max-width:420px}
.merchant-media-section{min-width:0;padding:8px;border:1px solid var(--border,#d5dde5);border-radius:12px}
.merchant-media-section>h3{font-size:calc(14px * var(--text-scale,1));margin:0 0 6px}
.merchant-media-grid{display:grid;gap:6px;min-width:0}
.merchant-media-grid-cover{grid-template-columns:minmax(0,1fr)}
.merchant-media-grid-cover>.merchant-media-add{max-width:88px}
.merchant-media-cover:has([data-role=cover]){padding:0;overflow:hidden}
.merchant-media-grid-cover>[data-role=cover]{aspect-ratio:16/9;border:0}
.merchant-media-grid-detail{grid-template-columns:repeat(4,minmax(0,1fr))}
.merchant-media-grid-video{grid-template-columns:repeat(3,minmax(0,1fr))}
.merchant-media-cell,.merchant-media-add{position:relative;width:100%;aspect-ratio:1;border:1.5px dashed #bfd0df;border-radius:10px;background:#f6f9fc;overflow:hidden;min-width:0}
.merchant-media-add{display:grid;place-items:center;color:#2f6da3;background:#f3f8fd;font-size:calc(32px * var(--text-scale,1));padding:0}
.merchant-media-add:hover{background:#eaf4fc}
.merchant-media-cell.is-empty{opacity:.45}
.merchant-media-cell.is-filled{border-style:solid;border-color:#d5dde5;background:#eef2f5}
.merchant-media-cell .merchant-media-preview,.merchant-media-cell>.pam-media-protected,.merchant-media-cell>img,.merchant-media-cell>video{width:100%;height:100%;margin:0}
.merchant-media-cell .merchant-media-preview{position:absolute;inset:0;display:block}
.merchant-media-cell .merchant-media-preview img,.merchant-media-cell .merchant-media-preview video,.merchant-media-cell>img,.merchant-media-cell>video{width:100%;height:100%;max-width:none;max-height:none;object-fit:cover;border-radius:0}
.merchant-media-grid-video .merchant-media-cell video{object-fit:contain;background:#142338;min-height:0}
.merchant-media-remove{position:absolute;z-index:6;right:6px;top:6px;width:30px;height:30px;min-height:0;padding:0;border-radius:50%;background:rgba(15,23,42,.78);font-size:calc(22px * var(--text-scale,1));line-height:1;color:#fff}
/* Long transfer messages and retry controls get their own line below the thumbnail. */
.merchant-media-grid{align-items:start}
.merchant-media-cell:has(.merchant-upload-state:not(.is-busy)){display:grid;grid-template-columns:minmax(0,1fr);aspect-ratio:auto}
.merchant-media-cell:has(.merchant-upload-state:not(.is-busy))::before{content:"";grid-area:1/1;aspect-ratio:1}
/* Position corner controls within the first row, including its bottom grid line. */
.merchant-media-cell:has(.merchant-upload-state:not(.is-busy))>:is(img,video,.merchant-media-placeholder,.merchant-media-remove){grid-area:1/1/2/2}
.merchant-media-cell:has(.merchant-upload-state:not(.is-busy))>:is(img,video){position:absolute;inset:0}
.merchant-upload-state{grid-area:2/1;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:3px;padding:4px;min-width:0;text-align:center;overflow-wrap:anywhere;background:var(--soft,#eef2f5);color:var(--ink,#142338);font-size:calc(12px * var(--text-scale,1));line-height:1.4}
.merchant-upload-state.is-busy{position:absolute;inset:0;z-index:5;display:grid;place-items:center;background:none;pointer-events:none}
.merchant-upload-spinner{width:27px;height:27px;border:3px solid #ffffffa8;border-top-color:#214f41;box-shadow:0 0 0 1px #0004;border-radius:50%;animation:merchant-spin .8s linear infinite}
.merchant-upload-state button{max-width:100%;min-height:24px;padding:3px 6px;font-size:inherit}
.merchant-upload-retry{background:var(--surface,#fff);color:var(--primary,#1f4f7c)}
@keyframes merchant-spin{to{transform:rotate(360deg)}}


/* Keep the merchant saved-preview video control, but remove the technical wording. */
#merchantProductDetail .video-load-button,.merchant-media-cell .video-load-button{font-size:0;position:absolute;z-index:4;left:50%;top:50%;transform:translate(-50%,-50%);width:48px;height:48px;min-height:0;border-radius:50%;padding:0;background:rgba(15,23,42,.72)}
#merchantProductDetail .video-load-button::before,.merchant-media-cell .video-load-button::before{content:"▶";font-size:calc(20px * var(--text-scale,1));color:#fff;margin-left:3px}

/* The upload page and the editor opened from Home use the exact same editor component. */
.merchant-dialog-editor #merchantEditor{margin:0}
.merchant-dialog-editor #merchantEditorHeading{display:none}

@media(max-width:760px){
  .merchant-media-remove{right:4px;top:4px;width:26px;height:26px;font-size:calc(19px * var(--text-scale,1))}
  .merchant-city-combo{grid-template-columns:minmax(0,1fr) 1px minmax(84px,36%)}
}

/* Stable failed-media presentation occupies the existing unified editor slot. */
.merchant-media-placeholder{position:absolute;inset:0;display:grid;place-items:center;padding:12px;text-align:center;background:var(--surface,#eef2f5);color:var(--text,#52635b);font-size:calc(13px * var(--text-scale,1));overflow-wrap:anywhere}
.merchant-media-cell [hidden]{display:none!important}
.merchant-contact-editor .contact-preview{gap:6px;margin:10px 0}
.merchant-contact-editor .contact-row{display:flex;flex-wrap:nowrap;gap:6px}
.merchant-contact-editor .contact-value{flex:1;min-width:0;padding:6px;text-align:left}
.merchant-contact-editor .contact-row>button:last-child{flex:none;padding:6px 10px}
.merchant-contact-editor .contact-icon{width:22px;height:22px;flex:0 0 22px}
.merchant-contact-editor p:empty{display:none}

/* Shared upload/home editor actions also work without drag-and-drop. */

.charm-preview{min-width:0;max-width:100%;overflow-x:auto}.charm-preview table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}.charm-preview th,.charm-preview td{text-align:end;padding:.5em;border-bottom:1px solid var(--border,#aaa)}.charm-preview :is(th,td):first-child{text-align:start}

/* Public description and private notes keep four lines, with internal scrolling. */
#productForm textarea:is([name="description"],[name="internal_note"]){box-sizing:border-box;display:block;width:100%!important;max-width:100%;min-width:0;line-height:1.5;padding:11px 12px;height:calc(6em + 24px)!important;min-height:calc(6em + 24px)!important;max-height:calc(6em + 24px)!important;resize:none;overflow-x:hidden;overflow-y:auto;field-sizing:fixed}
