/* Text determines the space it needs; translations must not overlap adjacent UI. */
.site-header .site-nav{width:auto;flex:0 0 auto}
.site-header .site-search{min-width:0;flex:1 1 280px}
.site-search input{min-width:0;flex:1 1 0}
.site-nav button{overflow-wrap:anywhere;hyphens:auto}
.primary-button,.secondary-button,.outline-button{height:auto;white-space:normal;overflow-wrap:anywhere;line-height:1.4;padding-block:9px;text-align:center}
.site-page :is(h1,h2,h3,p,dt,dd,label,small),.footer-brand,.footer-copy{overflow-wrap:anywhere}
.profile-card-actions,.credit-balance,.analysis-feedback,.feedback-actions,.starter-grid{flex-wrap:wrap}
.starter{white-space:normal;max-width:100%;height:auto}
.credit-pack-list button,.payment-choice-list button{gap:12px;flex-wrap:wrap}
.credit-pack-list button>*,.payment-choice-list button>*{min-width:0;overflow-wrap:anywhere}
.edit-grid>section,.plan-grid article,.credit-summary{height:auto}
.plan-grid article{min-height:417px}
.plan-grid .featured>b{position:static;align-self:flex-end;max-width:100%;text-align:end;margin-bottom:-8px}
.edit-grid>section>*{flex-shrink:0;min-width:0}
.edit-actions{flex-wrap:wrap}
.category-grid label,.category-grid span{max-width:100%}
.category-grid span{height:auto;min-height:32px;padding-block:7px;overflow-wrap:anywhere}
.add-form>section:first-child,.add-form>section:nth-child(2){height:auto;min-height:0;padding-bottom:24px}
.category-note{height:auto}
.upload-zone{height:auto;min-height:90px;gap:4px 14px}
.upload-zone strong,.upload-zone small{min-width:0;overflow-wrap:anywhere}
.upload-zone b{height:auto;min-height:34px;white-space:normal;text-align:center}
.file-ready,.review-gallery-heading{height:auto;min-height:18px}
.file-ready>div{flex-wrap:wrap}
.review-fields label,.edit-grid label,.auth-wrap label,.name-fields,.compound-money-field{min-width:0}
.review-fields input,.review-fields select,.edit-grid input,.auth-wrap input{min-width:0;max-width:100%}
.review-fields label{align-content:start}
.museum-meta{flex-wrap:wrap;gap:8px}
.museum-meta small{flex-basis:180px;overflow-wrap:anywhere}
.museum-meta .museum-link{height:auto;min-height:24px;max-width:100%;white-space:normal}
.museum-link span{min-width:0;overflow-wrap:anywhere}
.hero-explore{width:auto;min-width:133px;max-width:100%;height:auto;min-height:32px;padding:7px 16px;line-height:1.4;overflow-wrap:anywhere}
.auth-page.active,[data-page="sign-up"].auth-page.active{height:auto;min-height:652px}
.auth-wrap{height:auto;min-height:652px}
.signup-wrap{min-height:0}
.remember-row span,.switch-row span,.advisor-memory-toggle span{min-width:0;overflow-wrap:anywhere}
.remember-row input,.switch-row input{flex-shrink:0}
.detail-actions{flex-wrap:wrap}
.detail-panel dl div{grid-template-columns:minmax(0,110px) minmax(0,1fr)}
.detail-panel>div{min-width:0}
.collection-summary-content>div{min-width:0}
.collection-summary-content>div>strong{line-height:1.2;overflow-wrap:anywhere}
.collection-summary p{flex-wrap:wrap}
.collection-toolbar>div{min-width:0}
.chip{height:auto;min-height:28px;padding-block:5px}
.new-conversation{width:100%;height:auto;min-height:48px;padding:10px;overflow-wrap:anywhere}
.add-form>.form-actions button:first-child,.add-form>.form-actions button:last-child{width:auto;min-width:84px;max-width:100%}
#mobileShareOverlay .mobile-share-qr span{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.advisor-page.active{height:calc(100dvh - var(--fixed-header-height,88px))}
.advisor-thread-label:after{top:calc(var(--fixed-header-height,88px) + 16px)}
.clarification-form{grid-template-columns:repeat(2,minmax(0,1fr))}
.clarification-field{min-width:0}
.clarification-field input,.clarification-field textarea{min-width:0;max-width:100%}
.toast{max-width:calc(100vw - 32px);width:max-content;overflow-wrap:anywhere}

@media(min-width:768px){
 body{min-width:0}
 .site-header,body[data-route="add-collection"] .site-header{gap:30px;padding-inline:clamp(24px,4.45vw,64px)}
 .site-header .site-nav,body[data-route="add-collection"] .site-header .site-nav{width:auto;flex:0 0 auto;gap:32px}
 .site-header .site-nav button{flex-shrink:0}
 .home-section,.collection-heading,.collection-toolbar,.collection-grid,.view-all,.detail-wrap,.profile-wrap,.edit-wrap,.recharge-wrap,.payment-wrap{max-width:calc(100% - 48px)}
 .membership-wrap{width:min(1120px,calc(100% - 48px))}
 .hero-copy{max-width:calc(100% - 48px);transform:none}
 .hero-question{left:50%;transform:translateX(-50%);max-width:calc(100% - 48px)}
 .profile-grid,.edit-grid,.recharge-grid,.payment-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .detail-layout{grid-template-columns:repeat(2,minmax(0,1fr));gap:32px}
 .detail-main{width:100%;height:auto;aspect-ratio:420/520;object-fit:contain}
 .detail-gallery,.detail-copy,.profile-grid>section,.recharge-grid>section,.payment-grid>*{min-width:0}
 .add-wrap{max-width:calc(100% - 48px);transform:none}
 .object-review{grid-template-columns:repeat(2,minmax(0,1fr))}
 .review-main-media{width:100%}
 .news-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:32px}
 .news-row.reverse{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .news-row>img{width:100%}
 .site-footer{grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);gap:clamp(40px,8vw,120px)}
 .collection-summary{padding:24px 24px 40px;display:flex;align-items:center;justify-content:center}
 .collection-summary-content{width:max-content;max-width:100%;height:405px;display:grid;grid-template-columns:minmax(362px,max-content) 568px;gap:64px;align-items:center}
 .collection-summary-content>div{padding:40px 0;display:flex;flex-direction:column;align-items:flex-start;gap:24px}
 .collection-summary h1{margin:0;line-height:1.45}
 .collection-summary-content>div>strong{font-size:56px;line-height:1.1}
 .collection-summary p{margin:0;line-height:1.78}
 .collection-summary-content>canvas{width:568px;max-width:568px;height:258px;justify-self:start}
 .plan-grid{align-items:stretch}
 .edit-grid{align-items:stretch}
 .edit-grid>section{height:auto;min-height:552px}
}
@media(min-width:768px) and (max-width:1279px){
 .collection-summary{padding-inline:clamp(24px,7vw,120px)}
 .collection-summary-content{width:100%;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:32px}
 .collection-summary-content>canvas{width:100%;max-width:568px}
 .collection-summary-content>div>strong{font-size:clamp(32px,3.9vw,56px)}
 .site-header .site-logo{flex-basis:130px;width:130px}
 .site-header .site-nav button{font-size:16px}
 .site-footer{width:calc(100% - 48px);margin-inline:24px}
 .opportunity-card{height:auto;min-height:600px;padding-inline:24px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px}
 .opportunity-art{width:100%}.opportunity-art>img{max-width:100%}
 .opportunity-values{gap:12px}.opportunity-values>div{height:auto;min-height:92px;padding:16px 10px}
 .opportunity-values strong{font-size:18px;overflow-wrap:anywhere}
 .market-grid{gap:24px}
 .plan-grid{gap:12px}.plan-grid article{padding:20px 16px}
 .plan-grid h2{font-size:28px}
}
@media(max-width:767px){
 .site-header{height:auto;min-height:84px;padding-block:16px}
 .site-header .site-nav{flex:1 1 0;min-width:0;gap:8px}
 .site-header .site-nav button{flex:1 1 0;min-width:0;height:auto;min-height:44px;white-space:normal;line-height:16px;padding-block:4px}
 .site-header .site-search{flex:none;top:var(--fixed-header-height,84px)}
 body[data-route="collection"] .site-search{top:var(--fixed-header-height,84px)}
 .mobile-breadcrumb{height:auto;min-height:18px;flex-wrap:wrap;white-space:normal}
 .mobile-breadcrumb button,.mobile-breadcrumb strong{max-width:100%;overflow-wrap:anywhere}
 .hero-explore{max-width:48%;min-width:0;min-height:26px;bottom:21px}
 .hero-dots{width:297px}
 .edit-actions button{min-width:0;flex:1 1 120px}
 .profile-card-actions>*{min-width:0;flex:1 1 100px}
 .collection-toolbar .chip{white-space:nowrap}
 .collection-summary-content>div>strong{font-size:clamp(27px,9vw,40px)}
 body[data-route="advisor"] .mobile-menu{top:calc(var(--fixed-header-height,84px) + 7px)}
 .advisor-page.active{height:calc(var(--mobile-viewport-height,100dvh) - var(--fixed-header-height,84px))}
 .starter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .starter{min-width:0;padding-inline:10px}
 .detail-actions>.wide{flex:1 1 100px;min-width:0}
 .plan-grid article{min-height:0}
 .auth-wrap{min-height:0}
 .museum-meta .museum-link{min-height:44px}
 .clarification-form{grid-template-columns:minmax(0,1fr)}
}

.collection-delete-dialog { position:fixed; inset:0; margin:auto; box-sizing:border-box; width:min(480px, calc(100vw - 32px)); max-width:calc(100vw - 32px); max-height:calc(100dvh - 32px); overflow:auto; padding:24px; border:1px solid #555; border-radius:20px; color:#fff; background:#171717; }
html:has(.collection-delete-dialog[open]) { overflow:hidden; scrollbar-gutter:auto; }
.collection-delete-dialog::backdrop { position:fixed; inset:0; background:rgb(0 0 0 / .65); }
.collection-delete-dialog p { margin:0 0 20px; font-size:13px; line-height:18px; letter-spacing:-0.2px; color:#fff; text-align:start; text-wrap:pretty; word-break:normal; overflow-wrap:break-word; }
.collection-delete-dialog input[type="text"] { display:block; width:100%; box-sizing:border-box; min-height:40px; margin:0 0 20px; padding:0 13px; border:1px solid var(--line); border-radius:9px; background:#171717; color:#fff; font:400 13px/18px var(--sans); letter-spacing:-0.2px; }
.collection-delete-dialog input[type="text"]:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.collection-delete-dialog > div { display:flex; justify-content:flex-end; align-items:stretch; gap:10px; }
.collection-delete-dialog button { box-sizing:border-box; min-width:0; min-height:36px; padding:8px 16px; border:1px solid #ffffff4d; border-radius:100px; background:#ffffff14; color:#fff; font:400 13px/18px var(--sans); letter-spacing:-0.2px; cursor:pointer; white-space:normal; overflow-wrap:break-word; max-width:calc((100% - 10px)/2); }
@media(max-width:767px){.collection-delete-dialog{padding:20px}.collection-delete-dialog button{min-height:44px;padding:8px 14px}}

/* 真实联调时发现的缺口：多件文档识别现在可能要等1-2分钟，之前界面上只有一句
   不会变化的静态文字，用户容易以为卡死了。加一个转圈动画+阶段性文案，跟
   invoiceFileStatus 配合使用，见 site.js 的 startInvoiceProgress()。 */
.invoice-spinner { width:16px; height:16px; border:2px solid rgba(255,255,255,.25); border-top-color:#fff; border-radius:50%; animation:invoice-spin 0.8s linear infinite; flex:none; }
@keyframes invoice-spin { to { transform:rotate(360deg); } }

.catalogue-review-dialog { position:fixed; inset:0; margin:auto; box-sizing:border-box; width:min(720px, calc(100vw - 32px)); max-width:calc(100vw - 32px); max-height:calc(100dvh - 64px); overflow:auto; padding:24px; border:1px solid #555; border-radius:20px; color:#fff; background:#171717; }
html:has(.catalogue-review-dialog[open]) { overflow:hidden; scrollbar-gutter:auto; }
.catalogue-review-dialog::backdrop { position:fixed; inset:0; background:rgb(0 0 0 / .65); }
.catalogue-review-dialog h2 { margin:0 0 8px; font-size:18px; }
.catalogue-review-warning { margin:0 0 16px; font-size:13px; color:#f5c86a; }
.catalogue-review-list { display:flex; flex-direction:column; gap:16px; margin-bottom:20px; }
.catalogue-review-card { border:1px solid #3a3a3a; border-radius:14px; padding:16px; }
.catalogue-review-card-head { display:flex; align-items:center; gap:10px; margin-bottom:12px; cursor:pointer; }
.catalogue-review-card-head strong { font-size:15px; font-weight:600; }
.catalogue-review-fields { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; }
.catalogue-review-fields label { display:flex; flex-direction:column; gap:4px; font-size:12px; color:rgba(255,255,255,.7); }
.catalogue-review-fields input { box-sizing:border-box; min-height:36px; padding:6px 10px; border:1px solid #555; border-radius:10px; background:rgba(255,255,255,.04); color:#fff; font-size:13px; }
.catalogue-review-images { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
.catalogue-review-thumb { padding:0; border:2px solid transparent; border-radius:10px; overflow:hidden; width:64px; height:64px; background:#000; }
.catalogue-review-thumb[aria-pressed="true"] { border-color:#fff; }
.catalogue-review-thumb img { width:100%; height:100%; object-fit:cover; }
.catalogue-review-actions { display:flex; justify-content:flex-end; gap:10px; }
@media(max-width:767px){
  .catalogue-review-dialog{padding:18px}
  .catalogue-review-fields{grid-template-columns:minmax(0,1fr)}
}
.collection-delete-dialog button:focus-visible { outline:2px solid #fff; outline-offset:3px; }

/* One shared vertical centre for every header control, across all routes. */
.site-header{align-items:center}
.site-header .site-logo{display:flex;align-items:center;transform:none}
.site-header .site-logo img{display:block;width:100%;height:auto;aspect-ratio:229/65;object-fit:cover;object-position:left bottom}
.site-header .site-nav{align-items:center}
.site-header .site-nav button{display:flex;align-items:center;justify-content:center;padding-block:0;line-height:1.2}
.site-header .profile-link{display:grid;place-items:center;margin:0;padding:0}
.site-header :is(.profile-link,.mobile-search-trigger,.collection-search-submit) img{display:block}
.site-header .site-search input{padding-block:0;line-height:normal}
@media(min-width:768px){
 .site-header .site-logo,body[data-route="add-collection"] .site-header .site-logo{height:40px}
 .site-header .site-logo img,body[data-route="add-collection"] .site-header .site-logo img{height:auto;width:100%}
 .site-header .site-nav,.site-header .site-nav button{height:40px}
}
@media(max-width:767px){
 .site-header .site-logo{height:44px}
 .site-header .site-nav button{height:auto;min-height:44px;line-height:16px}
}

/* Shared footer rows keep both columns aligned when translations wrap. */
.site-footer .footer-brand>img{display:block;width:116px;height:auto;aspect-ratio:229/65;object-fit:cover;object-position:left bottom}
.site-footer .footer-copyright{display:none}
@media(min-width:768px){
 .site-header{--header-nav-size:20px;--header-logo-width:107px}
 .site-header .site-logo img{transform:translateY(calc((var(--header-nav-size) - var(--header-logo-width) * 65 / 229) / 2))}
 body[data-route="add-collection"] .site-header{--header-nav-size:16px;--header-logo-width:130px}
 .site-footer{grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:64px;row-gap:0;align-items:start}
 .site-footer .footer-brand,.site-footer .footer-copy{display:contents}
 .site-footer .footer-brand>img{grid-column:1;grid-row:1;margin-bottom:8px}
 .site-footer .footer-brand>p{grid-column:1;grid-row:2;max-width:440px;margin:0;font-size:16px;line-height:1.4}
 .site-footer .footer-copy p:not(.footer-copyright){margin:0;line-height:1.45}
 .site-footer .footer-copy p:nth-child(2){grid-column:2;grid-row:2}
 .site-footer .social-links{grid-column:1;grid-row:3;margin-top:28px;align-self:center}
 .site-footer .footer-copy p:last-child{grid-column:2;grid-row:3;margin-top:28px}
}
@media(min-width:768px) and (max-width:1100px){
 .site-header{--header-nav-size:16px;--header-logo-width:130px}
 .site-footer{column-gap:40px}
}
@media(max-width:767px){
 .site-footer .footer-brand>p{line-height:1.4}
 .site-footer .footer-copy{padding-top:0}
}

/* Keep the designed frame dimensions while showing the entire source image. */
#reviewMainImage{display:block;width:100%;height:100%;object-fit:contain}
#reviewMainImage[hidden]{display:none}
.review-media-thumb>img{object-fit:contain}

/* Detail actions keep the advisor and delete controls aligned without an edit bubble. */
.detail-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:center;gap:12px;width:100%}
.detail-actions>button,.detail-actions>.wide{justify-self:start;max-width:100%;width:auto;min-width:0;min-height:45px;height:auto;padding:14px 16px;border:0;border-radius:28px;background:rgba(255,255,255,.3);color:#fff;font:600 14px/1.2 var(--sans);text-align:center;white-space:normal;overflow-wrap:anywhere;cursor:pointer}
.detail-actions>#detailDeleteButton{justify-self:end}
.detail-actions>button:disabled{opacity:.55;cursor:wait}
@media(max-width:767px){.detail-actions{gap:8px}.detail-actions>button,.detail-actions>.wide{min-height:48px;padding:12px 8px}}

/* Collection detail: vertically stacked facts and valuation, matching the reference. */
.detail-copy{padding-top:0}
.detail-share{top:0}
.detail-panel{padding:20px;margin-bottom:16px}
.detail-panel:first-of-type{grid-template-columns:minmax(0,1fr);gap:0}
.detail-panel>div{min-width:0;margin-top:16px;gap:6px}
.detail-panel small,.detail-panel dt{font-size:12px;line-height:1.5}
.detail-panel strong{font-size:24px;line-height:1.25;overflow-wrap:anywhere}
.detail-panel .detail-estimate-range{color:#fff}
.detail-panel .detail-converted-price{font-size:12px;line-height:1.5;color:var(--muted)}
.detail-panel dl{display:grid;gap:16px}
.detail-panel dl div{grid-template-columns:minmax(0,1fr);gap:3px;margin:0}
.detail-panel dd{font-size:16px;font-weight:600;line-height:1.4;overflow-wrap:anywhere}
@media(max-width:767px){.detail-copy{padding-top:24px}.detail-share{top:24px}}

.view-all>button{border:0;background:transparent;color:inherit;font:inherit;cursor:pointer;padding:0 10px;min-height:32px}
.view-all>button:focus-visible{outline:2px solid var(--gold);outline-offset:3px;border-radius:4px}

.detail-panel #detailEstimateChange.down{color:var(--red)}

#sendButton.has-text:not(:disabled){background:#000}
#sendButton.has-text:not(:disabled) img{filter:invert(1)}

/* Fit text within the existing module geometry. */
.detail-actions>button,.detail-actions>.wide{height:45px;min-height:45px;white-space:nowrap;overflow-wrap:normal;letter-spacing:-.2px}
#detailPurchasePrice,#detailEstimateRange,[data-collection-purchase-value]{white-space:nowrap;overflow-wrap:normal;letter-spacing:-.4px}
#shareCardEstimate{white-space:nowrap;overflow-wrap:normal;letter-spacing:-.4px}
@media(max-width:767px){.detail-actions>button,.detail-actions>.wide{height:48px;min-height:48px}}

@media (min-width: 768px) {
  .membership-card .profile-card-actions { display:flex; flex-wrap:nowrap; gap:8px; width:100%; }
  .membership-card .profile-card-actions > button { flex:1 1 0; min-width:0; width:0; height:40px; min-height:40px; white-space:nowrap; }
}
