:root{--bg:#faf8f5;--paper:#fffefa;--cream:#f2eae0;--cream2:#f8f2eb;--line:#e4d9cf;--ink:#4c3020;--text:#453c35;--muted:#86796e;--accent:#8c6345;--terracotta:#b88e6d;--shadow:0 20px 70px rgba(50,30,15,.13)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-family: 'Apple SD Gothic Neo','Malgun Gothic',system-ui,sans-serif;line-height:1.62;font-size:14px}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}h1,h2,h3,p{margin:0}.serif,h1,h2,.wordmark{font-family:Georgia,'Times New Roman',serif}.hidden{display:none!important}.container{width:min(1180px,calc(100% - 40px));margin:auto}.muted{color:var(--muted)}.tiny{font-size:11px}.eyebrow{font-size:11px;color:var(--accent);letter-spacing:.24em;text-transform:uppercase;font-weight:650}.topbar{background:var(--ink);color:#fff9f3;text-align:center;padding:9px 12px;font-size:11px;letter-spacing:.07em}.header{position:sticky;top:0;z-index:15;background:#fffefaee;backdrop-filter:blur(10px);border-bottom:1px solid var(--line)}.header-inner{min-height:83px;display:flex;align-items:center;justify-content:space-between;gap:20px}.header-logo{width:250px;max-width:56vw;display:block}.header button{background:transparent;border:1px solid var(--line);padding:10px 14px;color:var(--ink);border-radius:5px}.header .right-actions{display:flex;gap:9px}.hero{text-align:center;padding:63px 12px 33px}.hero h1{font-size:clamp(39px,6vw,70px);font-weight:400;color:var(--ink);margin:12px 0 12px;letter-spacing:-.025em}.hero p{color:var(--muted)}.ornament{display:flex;align-items:center;justify-content:center;gap:13px;color:var(--accent);margin:19px auto}.ornament:before,.ornament:after{content:"";width:60px;height:1px;background:#c3a990}.search{border:1px solid var(--line);background:white;border-radius:7px;padding:0 18px;display:flex;align-items:center;gap:12px;margin:23px 0 19px}.search input{width:100%;height:55px;border:0;outline:none;background:transparent}.search svg{width:20px;height:20px;stroke:var(--accent);flex-shrink:0}.tabs{display:flex;flex-wrap:wrap;gap:9px;margin:20px 0 22px}.tab{border:1px solid var(--line);background:white;border-radius:30px;padding:10px 19px;color:var(--muted);transition:.2s}.tab.active{background:var(--ink);border-color:var(--ink);color:white}.section-title{display:flex;justify-content:space-between;align-items:end;gap:14px;margin:35px 0 18px}.section-title h2{font-size:29px;font-weight:400;color:var(--ink)}.brand-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:13px}.brand-card{border:1px solid var(--line);background:white;aspect-ratio:1.13;position:relative;padding:16px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:10px;color:var(--ink);transition:.2s;overflow:hidden}.brand-card:hover{border-color:#c3a58b;transform:translateY(-2px);box-shadow:0 9px 25px #47301d13}.brand-card:before{content:"";position:absolute;inset:10px;border:1px solid #f0e9df;pointer-events:none}.brand-card:nth-child(6n+2),.brand-card:nth-child(6n+6){background:var(--cream2)}.brand-card:nth-child(6n+4){background:#f6f2ec}.brand-name{font-size:clamp(15px,1.65vw,23px);font-weight:500;word-break:keep-all;letter-spacing:-.07em;line-height:1.3;z-index:1}.brand-card small{z-index:1;color:#9d8d80;letter-spacing:.12em;font-size:10px}.brand-card .brand-cover{width:100%;height:100%;object-fit:cover;position:absolute;inset:0;opacity:.2}.product-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px}.product-card{border:1px solid var(--line);background:white;overflow:hidden;text-align:left;padding:0;color:var(--text);border-radius:5px;transition:.2s}.product-card:hover{box-shadow:0 12px 24px #47301d15;transform:translateY(-2px)}.product-media{aspect-ratio:4 / 4.7;display:grid;place-items:center;background:#f2eae1;overflow:hidden}.product-media img{width:100%;height:100%;object-fit:cover}.placeholder{font:italic 18px Georgia,serif;color:#9e8876}.product-info{display:block;padding:15px 15px 18px}.product-info small{display:block;color:var(--muted);font-size:11px}.product-info strong{display:block;color:var(--ink);margin-top:4px}.product-info .price{font-weight:700;color:#7b5037;margin-top:6px}.back{border:0;background:transparent;color:var(--accent);padding:0;margin-top:28px}.brand-hero{text-align:center;padding:24px 0 29px;border-bottom:1px solid var(--line);margin-bottom:26px}.brand-hero h1{font-weight:400;font-size:clamp(40px,5vw,65px);margin:7px 0}.empty{text-align:center;color:var(--muted);border:1px dashed #d5c6b7;background:#fdfaf6;padding:50px 20px;grid-column:1/-1}.footer{margin-top:80px;border-top:1px solid var(--line);padding:45px 0 65px;text-align:center;color:var(--muted);font-size:12px}.footer h3{color:var(--ink);font:normal 22px Georgia,serif;letter-spacing:.22em}.gate{position:fixed;inset:0;z-index:50;background:#fbf9f6;display:grid;place-items:center;padding:24px}.gate-card{width:min(440px,100%);background:var(--paper);border:1px solid var(--line);box-shadow:var(--shadow);text-align:center;padding:40px 34px 36px}.gate-card img{display:block;width:min(275px,100%);margin:0 auto 17px}.gate-card h1{font:normal 32px Georgia,serif;color:var(--ink);margin:10px 0 12px}.gate-card p{color:var(--muted);font-size:13px}.field{display:flex;flex-direction:column;gap:6px;margin:15px 0}.field label{font-weight:650;color:#634b3a;font-size:12px}.field input,.field select,.field textarea{background:#fff;border:1px solid var(--line);border-radius:5px;padding:11px 12px;color:var(--text);width:100%}.field textarea{min-height:105px;resize:vertical}.field small{color:var(--muted)}.primary{background:var(--ink);color:white;border:1px solid var(--ink);padding:13px 18px;border-radius:5px;font-weight:600}.secondary{background:white;color:var(--ink);border:1px solid #cebaa6;padding:10px 16px;border-radius:5px}.danger{background:#a83f32;color:white;border:0;padding:10px 16px;border-radius:5px}.gate .field{text-align:left;margin:24px 0 12px}.gate .primary{width:100%}.err{color:#b83f30;font-size:12px;min-height:18px;margin-top:10px}.demo-note{background:#f7e9d4;border:1px solid #e8cfb1;color:#805a3a;text-align:center;padding:10px 15px;font-size:12px}.modal-shade{position:fixed;inset:0;background:#1c130cbf;z-index:30;display:flex;justify-content:center;align-items:center;padding:24px}.modal{position:relative;width:min(910px,100%);max-height:min(90vh,920px);overflow-y:auto;background:var(--paper);box-shadow:var(--shadow);border-radius:8px}.close{position:sticky;z-index:4;top:12px;float:right;margin:12px 12px -50px 0;width:38px;height:38px;border:0;border-radius:50%;background:#f2ebe4;color:var(--ink);font-size:23px}.modal-content{padding:32px}.chart{background:#f9f4ed;border:1px solid #eaddcf;padding:19px;border-radius:6px;margin:0 0 23px}.chart h3{color:var(--ink);font:normal 21px Georgia,serif;margin:5px 0 12px}.chart table{width:100%;border-collapse:collapse;text-align:center;font-size:12px;background:white}.chart th,.chart td{padding:9px 6px;border-bottom:1px solid #ede5dd}.chart th{background:#f4eade;color:var(--ink)}.chart small{display:block;margin-top:10px;color:var(--muted)}.chart-wrap{overflow-x:auto}.detail-title{margin:0 0 14px}.detail-title h2{font-weight:400;color:var(--ink);font-size:33px;margin:6px 0}.detail-title .detail-price{font-size:22px;color:#81553b;font-weight:700}.detail-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:19px 0 22px}.detail-gallery img{width:100%;object-fit:cover;display:block;border-radius:4px}.detail-gallery img:first-child:nth-last-child(odd){grid-column:1/-1;max-height:640px;object-fit:contain;background:#f1eeea}.detail-desc{line-height:1.8;white-space:pre-line;margin:8px 0 24px}.option-group{margin:17px 0}.option-group strong{display:block;color:var(--ink);margin-bottom:8px}.chips{display:flex;gap:8px;flex-wrap:wrap}.chip{border:1px solid #d6c8bb;background:#fff;padding:9px 14px;border-radius:5px;color:#765945}.chip.active{background:var(--ink);border-color:var(--ink);color:white}.chip small{display:block;font-size:10px}.qty{display:inline-flex;border:1px solid var(--line);align-items:center}.qty button{border:0;background:white;padding:9px 14px}.qty b{min-width:32px;text-align:center}.sum{margin-top:20px;background:#f7f1e8;padding:18px 20px}.sum .row{display:flex;justify-content:space-between;margin:4px 0}.sum .total{border-top:1px solid #ddcebe;padding-top:12px;margin-top:12px;color:var(--ink);font-weight:700}.order-preview{border:1px solid #d7c7b6;padding:13px;margin:14px 0;word-break:break-all;font-size:13px;background:white}.copy{width:100%;font-size:15px}.toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);background:var(--ink);color:white;border-radius:7px;padding:13px 20px;z-index:100;box-shadow:var(--shadow);text-align:center}.notice{padding:22px;background:#f2ebe2;border:1px solid #e5d8cb;color:var(--ink);text-align:center;margin:38px 0 0}.admin-shell{width:min(1260px,calc(100% - 38px));margin:30px auto 90px}.admin-top{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:1px solid var(--line);padding-bottom:22px}.admin-top h1{font-size:34px;font-weight:400;color:var(--ink)}.admin-tabs{margin:27px 0}.admin-card{background:white;border:1px solid var(--line);padding:25px;border-radius:7px;margin-bottom:22px}.admin-card h2{font-size:26px;font-weight:400;color:var(--ink);margin-bottom:16px}.admin-columns{display:grid;grid-template-columns:minmax(220px,.8fr) minmax(0,1.5fr);gap:22px}.admin-list{border:1px solid var(--line);border-radius:5px;max-height:610px;overflow:auto}.admin-list button{background:#fff;border:0;border-bottom:1px solid #f0e9e3;width:100%;padding:13px 15px;text-align:left;color:var(--ink)}.admin-list button:hover,.admin-list button.active{background:#f5ede3}.admin-list small{display:block;color:var(--muted)}.admin-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 15px}.admin-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.admin-upload{display:flex;flex-wrap:wrap;gap:8px;margin-top:11px}.admin-upload .thumb{width:88px;position:relative}.admin-upload img{width:88px;height:91px;object-fit:cover;border:1px solid var(--line)}.admin-upload button{background:#fff;border:1px solid var(--line);color:#a43f32;width:100%;font-size:11px}.admin-info{background:#f7f1e7;padding:15px;border-left:3px solid var(--accent);margin:15px 0;color:#71513b;font-size:13px}.admin-err{color:#b84032;font-size:13px;margin:12px 0}.admin-ok{color:#23674d;font-size:13px;margin:12px 0}.admin-title{font-weight:650;color:var(--ink);margin:6px 0 12px}.login-admin{width:min(455px,calc(100% - 36px));margin:65px auto 0}.login-admin img{display:block;width:235px;margin:12px auto 25px}.config-warning{border:1px solid #e4ca9f;background:#fff7e9;padding:24px;border-radius:6px;color:#705334}
@media(max-width:850px){.brand-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.admin-columns{grid-template-columns:1fr}.admin-list{max-height:220px}}@media(max-width:550px){.container{width:calc(100% - 30px)}.header-inner{min-height:70px}.header-logo{max-width:55vw}.header button{padding:8px 10px;font-size:11px}.hero{padding:48px 6px 19px}.brand-grid,.product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.brand-card{padding:10px}.brand-name{font-size:16px}.section-title h2{font-size:23px}.modal-shade{padding:0;align-items:end}.modal{height:94vh;max-height:94vh;border-radius:15px 15px 0 0}.modal-content{padding:24px 17px 30px}.detail-gallery{gap:5px}.detail-title h2{font-size:27px}.chart{padding:13px}.chart th,.chart td{padding:8px 3px;font-size:11px}.admin-form-grid{grid-template-columns:1fr}.admin-card{padding:17px}.admin-shell{width:calc(100% - 26px)}.admin-top h1{font-size:25px}}

/* V4: season selectors, selectable sizes, cover/detail image inputs */
.season-selects{display:grid;grid-template-columns:1fr 1fr;gap:9px}.size-field-wide{grid-column:1/-1}.size-field-header{display:flex;align-items:center;justify-content:space-between;gap:10px}.minor-button{border:1px solid #d9c6b3;background:#fff8f0;color:#67462f;border-radius:5px;padding:6px 10px;font-size:11px}.size-check-groups{display:grid;grid-template-columns:1fr;gap:12px;padding:15px;background:#fcf9f5;border:1px solid #e7dcd1;border-radius:6px}.size-check-group{display:flex;flex-direction:column;gap:7px}.size-group-title{color:#71533d;font-size:12px;font-weight:700}.size-pill-grid{display:flex;gap:6px;flex-wrap:wrap}.size-pill{position:relative;display:inline-flex!important;cursor:pointer}.size-pill input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}.size-pill span{display:inline-flex;justify-content:center;align-items:center;border:1px solid #d9c7b5;border-radius:5px;min-width:38px;padding:8px 10px;background:white;font-size:12px;color:#6e5038;transition:.15s}.size-pill input:checked+span{color:#fff;background:#5a3b2b;border-color:#5a3b2b}.size-pill input:focus-visible+span{outline:2px solid #907358;outline-offset:2px}.size-extra-label{margin-top:10px}.size-selected-preview{margin:6px 0 0;display:flex;gap:6px;flex-direction:column;font-size:12px;color:#7d6655;line-height:1.6}.size-selected-preview strong{color:#543a2d}.image-area{padding:18px;border:1px solid #e7ddd2;border-radius:7px;margin:18px 0;background:#fcfaf7}.image-area-heading{display:flex;gap:12px;align-items:center;margin-bottom:8px}.image-area-number{background:#5a3b2b;border-radius:50%;color:white;min-width:29px;height:29px;display:flex;align-items:center;justify-content:center;font:12px Georgia,serif}.image-area h3{font:normal 19px Georgia,serif;color:#503729;margin:0}.image-area p{margin:3px 0 0;font-size:12px;color:#8a796c}.image-area .field{margin:12px 0}.image-empty{font-size:12px;padding:8px 0}.cover-upload .thumb{width:120px}.cover-upload img{width:120px;height:125px}.detail-upload .thumb{width:92px}.detail-upload img{width:92px;height:100px}
@media(max-width:550px){.season-selects{grid-template-columns:1fr 1fr}.image-area{padding:12px}.size-pill span{padding:8px 9px}}

/* V5: single-column full-width product images, selectable order lines, photo management */
.detail-gallery{display:flex!important;flex-direction:column!important;gap:12px;align-items:stretch;margin:19px 0 25px}
.detail-gallery img,.detail-gallery img:first-child:nth-last-child(odd){display:block;position:static;width:100%;max-width:100%;height:auto!important;max-height:none!important;object-fit:contain!important;grid-column:auto;border-radius:4px;background:#f7f4f0}
.detail-price{display:flex;gap:8px 16px;align-items:baseline;flex-wrap:wrap}
.delivery-fee{font-size:13px;font-weight:500;color:#796c60;border-left:1px solid #d8c8b7;padding-left:13px}
.add-option{display:block;width:100%;margin-top:14px;font-size:14px}
.option-hint{font-size:12px;margin-top:8px}
.selected-items{border:1px solid #e0d2c4;border-radius:6px;margin:22px 0 10px;background:#fffdfa;padding:16px}
.selected-title{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--ink);margin-bottom:9px}
.selected-title span{color:var(--muted);font-size:12px}
.selected-option-row{padding:12px 0;border-top:1px solid #eee5da;display:flex;align-items:center;justify-content:space-between;gap:10px}
.selected-option-info{display:flex;flex-direction:column;gap:3px;min-width:0}
.selected-option-info strong{color:#4c3020;font-size:13px}
.selected-option-info span{color:#86796e;font-size:12px}
.selected-option-end{display:flex;gap:9px;align-items:center;flex-shrink:0}
.selected-option-end b{font-size:13px;color:#543a2c}
.remove-item{background:#fff;border:1px solid #d8c8b8;border-radius:5px;color:#a14439;padding:5px 9px;font-size:12px}
.empty-selection{font-size:12px;padding:11px 0}
.image-count{font-size:12px;color:#71543f;margin:8px 0 10px}
.detail-upload .detail-thumb{width:115px;display:flex;flex-direction:column;gap:4px;background:#fff;border:1px solid #e3d6c7;border-radius:5px;padding:6px;cursor:grab}
.detail-upload .detail-thumb:active{cursor:grabbing}
.detail-upload .detail-thumb img{width:100%;height:112px;object-fit:cover;border-radius:2px}
.detail-upload .detail-thumb .photo-order{font-weight:700;color:#6d4f37;font-size:12px}
.admin-upload .photo-state{font-size:10px;color:#8b7869;min-height:17px;line-height:1.3}
.admin-upload .photo-actions{display:flex;gap:4px}
.admin-upload .photo-actions button{flex:1;font-weight:700;color:#5c3b2a;font-size:15px;padding:3px 2px;border-radius:4px}
.admin-upload .thumb .remove-detail{background:#fff3f0;border-color:#e3cbc6;border-radius:4px;padding:4px 0}
@media(max-width:550px){.selected-option-row{align-items:flex-start}.selected-option-end{flex-direction:column;align-items:flex-end}.detail-gallery{gap:9px}.detail-upload .detail-thumb{width:105px}}
.order-preview{white-space:pre-line;line-height:1.85}

/* V6: Brand-wide size guide image, full width and original aspect ratio. */
.brand-chart-photo{background:#fbf8f4}
.size-guide-photo{display:block;width:100%;max-width:100%;height:auto;object-fit:contain;background:#fff;border:1px solid #eee4d9;border-radius:3px}
.brand-guide-preview{display:flex;align-items:flex-start;gap:12px;flex-wrap:wrap;width:100%}
.brand-guide-preview img{width:min(230px,100%);height:auto;max-height:320px;object-fit:contain;border:1px solid #e1d4c6;background:#fff;border-radius:4px}
.brand-guide-preview .minor-button{align-self:center}
.brand-guide-preview .muted{align-self:center;font-size:12px}
@media(max-width:550px){.size-guide-photo{width:100%;height:auto}.brand-guide-preview img{max-width:180px}}


/* BEBE GROUND V7 — Product detail modal: nearly fullscreen, easier to read.
   Presentation only: no product, Supabase, photo, or ordering logic changed. */
.modal-shade{
  padding:10px;
  align-items:center;
  justify-content:center;
}
.modal{
  width:min(1600px,calc(100vw - 20px));
  height:calc(100vh - 20px);
  height:calc(100dvh - 20px);
  max-height:none;
  border-radius:9px;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.modal-content{
  padding:clamp(24px,3vw,48px);
}
.close{
  top:14px;
  margin:14px 17px -60px 0;
  width:48px;
  height:48px;
  font-size:29px;
  box-shadow:0 2px 12px #2b150b14;
}
#detailSeason{
  font-size:clamp(16px,1.6vw,21px);
  line-height:1.5;
  letter-spacing:.1em;
  margin:12px 0 8px;
  font-weight:650;
}
#detailBrand{
  font-size:clamp(17px,1.8vw,23px);
  font-weight:600;
  margin-bottom:6px;
}
.detail-title{
  margin:0 0 25px;
}
.detail-title h2{
  font-size:clamp(36px,3.5vw,56px);
  line-height:1.24;
  letter-spacing:-.035em;
  margin:5px 0 14px;
  overflow-wrap:anywhere;
}
.detail-title .detail-price{
  font-size:clamp(30px,2.6vw,42px);
  line-height:1.45;
  gap:8px 20px;
  align-items:center;
}
.detail-price .delivery-fee{
  font-size:clamp(19px,1.7vw,26px);
  font-weight:600;
  line-height:1.5;
  padding-left:18px;
}
.detail-gallery{
  display:flex!important;
  flex-direction:column!important;
  align-items:center;
  gap:18px;
  margin:24px 0 32px;
}
.detail-gallery img,
.detail-gallery img:first-child:nth-last-child(odd){
  display:block;
  width:100%;
  max-width:1200px;
  height:auto!important;
  max-height:none!important;
  object-fit:contain!important;
  border-radius:3px;
}
/* Keep tall brand charts from dominating the enlarged modal. */
#sizeChartBox .chart{
  padding:clamp(15px,2vw,26px);
  margin-bottom:27px;
}
#sizeChartBox .size-guide-photo{
  display:block;
  width:auto;
  max-width:100%;
  height:auto;
  max-height:min(42dvh,480px);
  margin:15px auto 9px;
  object-fit:contain;
}
#sizeChartBox .chart-wrap{max-width:1050px;margin:0 auto}
#sizeChartBox .chart table{font-size:clamp(13px,1.1vw,17px)}
#sizeChartBox .chart th,#sizeChartBox .chart td{padding:12px 8px}
@media(max-width:700px){
  .modal-shade{padding:0;align-items:stretch}
  .modal{
    width:100vw;
    height:100vh;
    height:100dvh;
    max-height:none;
    border-radius:0;
    scrollbar-gutter:auto;
  }
  .modal-content{padding:21px 17px 40px}
  .close{top:8px;margin:8px 9px -49px 0;width:42px;height:42px;font-size:26px}
  #detailSeason{font-size:16px;letter-spacing:.08em;margin-top:17px}
  #detailBrand{font-size:18px;margin-bottom:2px}
  .detail-title h2{font-size:clamp(33px,8vw,42px);line-height:1.28;margin:8px 0 12px}
  .detail-title .detail-price{font-size:clamp(28px,7vw,36px);gap:3px 10px}
  .detail-price .delivery-fee{font-size:18px;padding-left:11px}
  .detail-gallery{gap:10px;margin:18px 0 25px}
  .detail-gallery img,.detail-gallery img:first-child:nth-last-child(odd){max-width:100%}
  #sizeChartBox .chart{padding:12px;margin-bottom:24px}
  #sizeChartBox .size-guide-photo{max-height:min(35dvh,360px);margin:10px auto}
  #sizeChartBox .chart h3{font-size:18px}
  #sizeChartBox .chart table{font-size:12px}
  #sizeChartBox .chart th,#sizeChartBox .chart td{padding:9px 3px}
}


/* V8 — Readable size charts (structured brand data first, image as fallback). */
#sizeChartBox .chart{
  padding:clamp(14px,2.7vw,28px);
  background:#faf7f2;
  border:1px solid #e9ddd0;
  margin-bottom:clamp(18px,2.5vw,30px);
}
#sizeChartBox .chart h3{font-size:clamp(18px,2vw,27px);font-family:Georgia,'Malgun Gothic',serif;letter-spacing:-.015em;margin-bottom:18px}
#sizeChartBox .chart-wrap{width:100%;max-width:1200px;margin:0 auto;overflow-x:auto;-webkit-overflow-scrolling:touch}
#sizeChartBox .chart .size-table{border-collapse:collapse;width:100%;background:#fffefa;table-layout:auto;font-size:clamp(13px,1.3vw,19px);color:#402e22}
#sizeChartBox .chart .size-table thead th{background:#eee4d8;color:#4f3424;font-weight:750}
#sizeChartBox .chart .size-table :is(td,th){padding:clamp(10px,1.5vw,19px) clamp(5px,1vw,15px);white-space:nowrap;border-bottom:1px solid #ebe2d7;text-align:center}
#sizeChartBox .chart .size-table tbody th{font-weight:750;background:#f8f2ec}
#sizeChartBox .chart .size-table tbody tr:nth-child(even) td{background:#fdf9f5}
#sizeChartBox .chart .size-table tbody tr:last-child :is(td,th){border-bottom:0}
#sizeChartBox .size-guide-photo-link{display:block;text-align:center;background:white;padding:8px}
#sizeChartBox .size-guide-photo{
 width:100%;max-width:100%;max-height:none!important;height:auto!important;margin:0 auto;object-fit:contain;
}
#sizeChartBox .guide-tap-tip{text-align:center;font-size:12px;color:#8f705b;margin:8px 0 0}
/* Admin: brand size table editor */
.guide-editor-panel{border:1px solid #e1d4c5;border-radius:8px;background:#fbf8f3;padding:18px;margin:20px 0}
.guide-editor-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:13px;margin-bottom:18px;flex-wrap:wrap}
.guide-editor-heading h3{font:normal 22px Georgia,'Malgun Gothic',serif;color:#503528;margin:0 0 4px}
.guide-editor-heading p,.guide-editor-foot{font-size:12px;color:#837064}
.guide-editor-labels,.guide-edit-row{display:grid;grid-template-columns:minmax(75px,.75fr) repeat(3,minmax(85px,1fr)) 52px;gap:7px;align-items:center}
.guide-editor-labels{font-size:12px;font-weight:750;color:#59422f;padding:0 4px 8px}
.guide-edit-row{padding:6px 0;border-bottom:1px solid #eee3d8}
.guide-edit-cell{margin:0;display:block;min-width:0}
.guide-edit-cell input{display:block;width:100%;border:1px solid #dbcab9;background:white;border-radius:5px;padding:10px 7px;color:#4d3628;font-size:13px;text-align:center}
.guide-remove-row{border:1px solid #decac5;background:white;color:#a1453a;border-radius:5px;padding:10px 0;font-size:12px}
.guide-edit-row:focus-within{background:#fffdf8}
.guide-mobile-label{display:none}
.guide-editor-foot{display:flex;justify-content:space-between;gap:12px;align-items:center;padding-top:14px;flex-wrap:wrap}
@media(max-width:700px){
 #sizeChartBox .chart{padding:12px 7px}
 #sizeChartBox .chart h3{font-size:18px;margin-bottom:12px}
 #sizeChartBox .chart .size-table{font-size:clamp(12px,3vw,15px)}
 #sizeChartBox .chart .size-table :is(th,td){padding:12px 3px;white-space:normal;line-height:1.35}
 .guide-editor-panel{padding:12px}
 .guide-editor-labels{display:none}
 .guide-edit-row{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:12px 0}
 .guide-edit-cell{display:flex;flex-direction:column;gap:4px}
 .guide-edit-cell input{text-align:left;padding:10px}
 .guide-mobile-label{display:block;font-size:11px;color:#856a55;font-weight:700}
 .guide-remove-row{grid-column:1/-1;padding:8px}
}


/* V9: Balanced desktop product popup; full-viewport mobile popup. */
@media(min-width:701px){
  .modal-shade{padding:6px 20px;align-items:center;justify-content:center}
  .modal{
    width:min(1020px,calc(100vw - 72px));
    height:calc(100vh - 12px);
    height:calc(100dvh - 12px);
    max-height:calc(100dvh - 12px);
    border-radius:10px;
    scrollbar-gutter:auto;
  }
  .modal-content{padding:30px clamp(22px,3vw,38px) 45px}
  .detail-gallery{width:100%;max-width:850px;margin:22px auto 32px;gap:14px}
  .detail-gallery img,.detail-gallery img:first-child:nth-last-child(odd){
    width:auto!important;
    max-width:100%!important;
    height:auto!important;
    max-height:none!important;
    object-fit:contain!important;
    margin:0 auto;
  }
  #sizeChartBox .chart{max-width:880px;margin:0 auto 25px;padding:20px 24px}
  #sizeChartBox .chart-wrap{max-width:800px}
  #sizeChartBox .chart .size-table{font-size:clamp(14px,1.15vw,17px)}
  #sizeChartBox .chart .size-table :is(th,td){padding:12px 8px}
  #sizeChartBox .brand-chart-photo .size-guide-photo-link{max-width:490px;margin:auto}
  #sizeChartBox .brand-chart-photo .size-guide-photo{
    width:auto!important;max-width:100%!important;max-height:390px!important;
    height:auto!important;object-fit:contain!important;
  }
  .detail-title h2{font-size:clamp(35px,3.1vw,47px)}
  .detail-title .detail-price{font-size:clamp(29px,2.4vw,38px)}
  .detail-price .delivery-fee{font-size:clamp(18px,1.6vw,23px)}
}
@media(max-width:700px){
  .modal-shade{padding:0;align-items:stretch}
  .modal{width:100vw;height:100dvh;max-height:100dvh;border-radius:0;scrollbar-gutter:auto}
  .modal-content{padding:20px 14px 36px}
  .detail-gallery{width:100%;max-width:100%;margin:19px 0 28px;gap:9px}
  .detail-gallery img,.detail-gallery img:first-child:nth-last-child(odd){
    display:block;width:100%!important;max-width:100%!important;height:auto!important;max-height:none!important;object-fit:contain!important
  }
  #sizeChartBox .brand-chart-photo .size-guide-photo{
    width:auto!important;max-width:100%!important;max-height:55dvh!important;height:auto!important;
  }
}

/* V11 — preserve variable brand tables, readable on mobile */
#sizeChartBox .size-guide-section{margin-top:17px}
#sizeChartBox .size-section-title{font-size:16px;font-weight:750;color:#62452f;margin:0 0 8px}
#sizeChartBox .chart .size-table{table-layout:auto;min-width:max-content;font-variant-numeric:tabular-nums}
#sizeChartBox .chart .size-table th,#sizeChartBox .chart .size-table td{white-space:nowrap;line-height:1.5}
#sizeChartBox .guide-source-note{font-size:13px;color:#735e4d;background:#f2e9de;padding:10px 13px;border-radius:4px;margin:8px 0}
.rich-section{border:1px solid #e1d2c0;background:#fffdf9;padding:14px;border-radius:6px;margin:15px 0}
.rich-section-top{display:flex;gap:10px;align-items:center;justify-content:space-between;margin-bottom:12px}
.rich-title{flex:1;min-width:100px}.rich-caption{display:block;color:#6c5140;font-weight:700;font-size:12px;margin:8px 0 5px}
.rich-columns{width:100%;box-sizing:border-box;padding:11px;border:1px solid #dfcfc0;border-radius:5px}
.rich-section .minor-button{margin:8px 5px 8px 0}.rich-rows{display:flex;flex-direction:column;gap:9px;margin-top:9px}
.rich-row{display:flex;flex-wrap:wrap;gap:7px;align-items:end;background:#f8f3ed;padding:9px;border-radius:4px}
.rich-cell{flex:1 1 120px;min-width:105px;display:flex;flex-direction:column;gap:4px;font-size:11px;color:#7a6653}
.rich-cell input{padding:10px 8px;border:1px solid #d9c8b7;border-radius:4px;width:100%;box-sizing:border-box;background:white;color:#543b2b}
@media(max-width:600px){#sizeChartBox .chart .size-table{font-size:13px;min-width:100%}#sizeChartBox .chart .size-table th,#sizeChartBox .chart .size-table td{padding:10px 8px;white-space:nowrap}#sizeChartBox .guide-source-note{font-size:12px}.rich-section-top{align-items:stretch;flex-direction:column}}
