:root{--bg:#fbf9f6;--surface:#fff;--ink:#262326;--muted:#8b8689;--line:#ebe6e6;--accent:#8067bd;--accent-bg:#f1ebfb;--shadow:0 8px 28px rgba(58,42,58,.05)}
    *{box-sizing:border-box}html,body{margin:0;min-height:100%;background:var(--bg);font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;color:var(--ink)}
    button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #bda8eb;outline-offset:2px}
    .app{max-width:720px;margin:0 auto;padding:24px 18px 110px}.topline{display:flex;justify-content:space-between;align-items:center;gap:12px}.brand{display:flex;align-items:center;gap:11px}.logo{display:grid;place-items:center;background:#28252c;color:#fff;border-radius:15px;width:45px;height:45px;font-size:24px}.brand-name{font-weight:750;font-size:18px;letter-spacing:-.5px}.brand-sub{font-size:11px;color:var(--muted);margin-top:3px;letter-spacing:1px;text-transform:uppercase}.pill{border-radius:100px;border:1px solid var(--line);background:white;padding:10px 12px;font-size:12px;font-weight:650;white-space:nowrap}
    h1{font-size:32px;font-weight:780;line-height:1.13;letter-spacing:-1px;margin:26px 0 8px}p{margin:0}.sub{color:var(--muted);line-height:1.5;font-size:14px}.highlight{color:var(--accent)}.weather{background:linear-gradient(125deg,#f0e8fd,#f9f1f7 85%);margin:23px 0 26px;padding:19px;border-radius:22px;display:flex;gap:15px;align-items:center;justify-content:space-between}.weather .ico{font-size:35px}.weather .small{font-size:12px;color:#796887;font-weight:650}.weather .main{font-size:18px;font-weight:730;margin:5px 0}.weather .detail{font-size:12px;color:#7c7381}.weather button{background:#fff;border:1px solid #e8dff5;padding:10px 12px;border-radius:12px;font-size:12px;font-weight:700;flex-shrink:0}.section-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:24px 0 15px}.section-head h2{margin:0;font-size:19px;letter-spacing:-.4px}.count{font-size:13px;color:var(--muted)}
    .btn{border:0;border-radius:13px;padding:13px 18px;font-weight:700;background:var(--ink);color:#fff}.btn.light{background:var(--accent-bg);color:#66509e}.btn.ghost{background:#fff;color:var(--ink);border:1px solid var(--line)}.btn.wide{width:100%}.chipbar{display:flex;gap:8px;overflow-x:auto;padding:0 0 10px;scrollbar-width:none}.chipbar::-webkit-scrollbar{display:none}.chip{border:1px solid var(--line);border-radius:30px;background:white;padding:10px 13px;font-size:13px;white-space:nowrap;color:#686168}.chip.selected{background:#302a38;color:white;border-color:#302a38}.items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}@media(min-width:540px){.items{grid-template-columns:repeat(3,minmax(0,1fr))}}.item{background:#fff;border-radius:18px;overflow:hidden;border:1px solid #f0eae8;box-shadow:var(--shadow)}.item-photo{width:100%;aspect-ratio:4/4.5;object-fit:cover;background:#efe9ed;display:block}.item-footer{display:flex;align-items:center;justify-content:space-between;padding:11px;gap:8px}.item-name{font-size:13px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.item-cat{font-size:11px;color:var(--muted);margin-top:3px}.delete{border:0;background:#f8f4f3;border-radius:9px;padding:7px 9px;color:#9b7380}.empty{border:1.5px dashed #dad1db;border-radius:20px;text-align:center;padding:30px 18px;background:#fff}.empty-icon{font-size:44px;margin-bottom:9px}.empty strong{display:block;font-size:17px}.empty p{color:var(--muted);font-size:13px;line-height:1.5;margin:8px 0 16px}
    .footer-nav{position:fixed;bottom:0;left:0;right:0;z-index:10;display:flex;justify-content:center;background:rgba(255,255,255,.97);border-top:1px solid var(--line);padding:12px 12px max(13px,env(safe-area-inset-bottom))}.footer-inside{max-width:720px;width:100%;display:flex;justify-content:space-around}.tab{border:0;background:transparent;color:#999099;min-width:90px;display:grid;justify-items:center;gap:5px;font-size:11px;font-weight:700}.tab span{font-size:21px}.tab.active{color:var(--accent)}.hidden{display:none!important}.form-group{margin-bottom:16px}.form-group label{display:block;font-size:12px;font-weight:700;margin-bottom:7px}.field{width:100%;border:1px solid #e7e1e5;background:#fff;border-radius:12px;padding:13px;color:var(--ink);caret-color:#8067bd;color-scheme:light;-webkit-text-fill-color:#262326}.field:focus{caret-color:#8067bd}.field::placeholder{color:#8b8689;-webkit-text-fill-color:#8b8689}.flex{display:flex;gap:10px}.flex>*{flex:1;min-width:0}.sheet-overlay{position:fixed;inset:0;background:rgba(27,23,29,.42);z-index:20;display:flex;align-items:flex-end;justify-content:center}.sheet{width:100%;max-width:700px;background:#fbf9f6;padding:24px 19px max(25px,env(safe-area-inset-bottom));border-radius:25px 25px 0 0;max-height:92dvh;overflow:auto;box-shadow:0 -15px 45px rgba(0,0,0,.1)}.sheet-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}.sheet-head h2{margin:0;font-size:20px}.close{border:0;background:#ece6ed;border-radius:30px;width:33px;height:33px;font-size:19px}.preview{height:165px;display:grid;place-items:center;margin-bottom:18px;background:#f1ebef;border:1.5px dashed #d5cbd7;border-radius:15px;overflow:hidden;color:#938a94;font-size:13px;text-align:center}.preview img{width:100%;height:100%;object-fit:contain}.look-panel{background:white;border:1px solid var(--line);padding:17px;border-radius:19px}.look-panel h3{margin:0 0 12px}.looks{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.look-tile{border:1px solid var(--line);border-radius:12px;overflow:hidden}.look-tile img{aspect-ratio:1/1;object-fit:cover;width:100%;display:block}.look-tile small{display:block;padding:8px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.note{font-size:12px;line-height:1.6;color:#706a71;margin:10px 0 18px}.notice{padding:13px;background:#f4eef7;border-radius:13px;color:#6d5e77;font-size:12px;line-height:1.5}.stack{display:grid;gap:14px}.settings-card{padding:19px;border-radius:18px;border:1px solid var(--line);background:#fff}.settings-card h3{margin:0 0 8px;font-size:16px}.settings-card p{font-size:13px;color:var(--muted);line-height:1.6}.status{margin-top:11px;font-size:12px;color:#6f6872;min-height:18px}.soft{color:#817784}.space-top{margin-top:14px}.browse-add{border:2px dashed #d7cddc;display:flex;justify-content:center;align-items:center;gap:10px;min-height:115px;border-radius:17px;background:#faf7fc;color:#6f5b7c;font-size:14px;font-weight:750;cursor:pointer}.browse-add span{font-size:22px}

    textarea.field{resize:vertical;min-height:90px;line-height:1.45}
    .look-preferences{background:#fff;border:1px solid var(--line);border-radius:18px;padding:15px}
    .look-weather{font-size:12px;color:#796d83;line-height:1.5;margin:11px 0}
    .look-panel{margin-bottom:14px}
    .look-panel h3{margin:0 0 9px;font-size:18px;line-height:1.3}
    .look-number{font-size:11px;letter-spacing:.07em;color:var(--accent);font-weight:800;margin-bottom:7px}
    .look-buttons{display:flex;gap:9px;align-items:center;margin-top:12px}
    .look-buttons .btn{flex:1}
    .look-panel .note{margin:12px 0 8px}
    .look-panel .looks{margin-top:14px}
    .saved-empty{border:1px dashed #ded5e4;border-radius:16px;padding:18px;text-align:center;color:var(--muted);font-size:13px}
    .look-source{display:inline-flex;align-items:center;background:var(--accent-bg);color:#6c579e;border-radius:20px;padding:5px 9px;font-size:11px;font-weight:700}
    .outline-link{background:transparent;border:1px solid #e3dceb;border-radius:13px;padding:13px;color:#66509e;font-size:13px;font-weight:700}
.item-footer{gap:5px}.edit-item{border:0;background:#f1ebfb;color:#7157a8;border-radius:9px;padding:8px 9px;font-size:17px;cursor:pointer;flex-shrink:0}.item-footer .delete{flex-shrink:0}

    .outfit-board{position:relative;max-width:420px;width:100%;aspect-ratio:4/3;overflow:hidden;margin:14px auto 10px;border-radius:18px;border:1px solid #e8d9f2;background:radial-gradient(ellipse at 50% 23%,#faf1ff 0%,#f5effd 57%,#f3e8f0 100%)}
    .outfit-board::after{content:'MY AI WARDROBE';position:absolute;bottom:10px;left:14px;font-size:9px;font-weight:800;letter-spacing:.18em;color:#947ead}
    .outfit-piece{position:absolute;overflow:hidden;background:#fff;border:2px solid rgba(255,255,255,.9);border-radius:11px;box-shadow:0 4px 15px #583a6e20}
    .outfit-piece img{display:block;width:100%;height:100%;object-fit:contain;background:#fff}
    .outfit-piece.top,.outfit-piece.dress{left:33%;top:4%;width:34%;height:43%}
    .outfit-piece.bottom{left:33%;top:51%;width:34%;height:39%}
    .outfit-piece.shoes{left:69%;top:55%;width:28%;height:34%}
    .outfit-piece.outer{left:3%;top:9%;width:28%;height:72%}
    .outfit-piece.accessory{left:70%;top:8%;width:26%;height:33%}
    .outfit-piece.dress{height:74%}
    .outfit-board .only-main{left:27%;width:46%}
    .outfit-board .only-shoes{top:64%;height:27%}
    .outfit-pieces-label{font-size:12px;color:#6c6371;line-height:1.55;margin-bottom:6px}
    .outfit-disclaimer{font-size:11px;color:#8d8091;margin:5px 0}

    .tryon-start{margin-top:8px;width:100%;background:linear-gradient(110deg,#735bc4,#9b6bc6);color:#fff;border:0}
    .tryon-demo-intro{background:#f5eefc;border:1px solid #e8dbf4;padding:13px;border-radius:14px;font-size:13px;color:#594a6d;line-height:1.5;margin:12px 0}
    .tryon-photo{width:100%;height:165px;object-fit:contain;background:#faf7fd;border-radius:14px;border:1px solid #ede6f6}
    .tryon-steps{font-size:13px;line-height:1.6;color:#4b4052;padding-left:19px;margin:13px 0}
    .tryon-steps li{padding-bottom:4px}
    .tryon-modal-body{overflow-y:auto;max-height:72vh;padding-bottom:10px}
    .tryon-actions{display:flex;gap:10px;flex-wrap:wrap}
    .tryon-actions .btn{flex:1;min-width:150px}
    .tryon-tip{font-size:12px;line-height:1.5;color:#796d83;margin:12px 0}

  .access-gate{position:fixed;inset:0;z-index:90;display:flex;align-items:center;justify-content:center;background:rgba(249,247,251,.98);padding:20px}
  .access-panel{max-width:460px;width:100%;background:white;border:1px solid #eadff2;border-radius:24px;padding:25px;box-shadow:0 16px 50px #37254b20;text-align:center}
  .access-panel h2{font-size:23px;margin:6px 0 13px}
  .access-panel p{font-size:14px;color:#796e80;line-height:1.6;margin:12px 0}
  .access-panel .btn{margin-top:10px}
  .admin-row{border:1px solid #e9e1ec;border-radius:14px;background:white;padding:12px;margin-top:10px}
  .admin-meta{font-size:12px;color:#817788;margin:6px 0;overflow-wrap:anywhere}
  .admin-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:9px}
  .admin-actions button{border:1px solid #e1d5ed;background:#f6f0fc;color:#6a5385;border-radius:9px;padding:8px 10px;font-size:12px;font-weight:700}
  .admin-actions .denied{border-color:#f5d3d8;background:#fff0f1;color:#a43b51}

    /* Embedded official FASHN Gradio Space: the user stays inside Telegram Mini App. */
    #tryon-modal .sheet{height:96dvh;max-height:96dvh;max-width:850px;display:flex;flex-direction:column;padding:17px 14px max(14px,env(safe-area-inset-bottom))}
    #tryon-modal .sheet-head{flex:0 0 auto;margin-bottom:11px;padding:0 3px}
    #tryon-modal .tryon-modal-body{flex:1;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:0 3px 12px}
    .tryon-embed{margin-top:12px;border-radius:15px;border:1px solid #e6dcee;background:#fff;overflow:hidden}
    .tryon-embed iframe{width:100%;height:1120px;min-height:840px;display:block;border:0;background:#fff}
    .tryon-loading{padding:13px;font-size:12px;color:#71617d;line-height:1.5;background:#f6f1fa}
    .tryon-help{font-size:12px;color:#75697c;line-height:1.6;margin:11px 0}
    .tryon-privacy{display:flex;gap:9px;align-items:flex-start;background:#f6f1fa;border-radius:12px;padding:12px;margin:11px 0}
    .tryon-privacy input{margin-top:4px;width:18px;height:18px;accent-color:#8067bd;flex-shrink:0}
    .tryon-privacy label{font-size:12px;color:#62536e;line-height:1.5}
    .tryon-save-row{display:flex;align-items:center;gap:12px;margin:10px 0}
    .tryon-save-row .tryon-photo{width:86px;height:110px;flex-shrink:0}
    .tryon-save-row .tryon-actions{display:grid;gap:8px;flex:1}
    .tryon-save-row .btn{padding:11px 10px;font-size:12px}
    .tryon-embed-actions{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:7px;margin:12px 0}
    .tryon-embed-actions a{font-size:12px;color:#6d55a1;overflow-wrap:anywhere}

    .tryon-person-settings{display:flex;align-items:center;gap:12px;margin:13px 0}
    .tryon-person-settings img{width:100px;height:140px;border-radius:12px;object-fit:contain;border:1px solid #eadff0;background:#f4eff8}
    .tryon-upload-label{display:block;text-align:center;cursor:pointer;font-size:13px;padding:13px 9px;border-radius:12px}
    #person-tryon-remove{font-size:12px;padding:9px 13px}
    .tryon-selected-photos{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:13px 0}
    .tryon-selected-photos>div{min-width:0;border-radius:15px;border:1px solid #ece3f1;padding:8px;text-align:center;background:#fbf8ff}
    .tryon-selected-photos img{width:100%;height:130px;object-fit:contain;display:block;border-radius:10px;background:#f3eef7}
    .tryon-selected-photos small{display:block;font-size:11px;color:#776b80;margin-top:6px}
    .tryon-wait{text-align:center;background:#f7f1fb;border-radius:15px;padding:25px 18px;margin:14px 0;line-height:1.5}
    .tryon-wait strong{font-size:16px}
    .tryon-wait p{font-size:12px;color:#7c698b;margin:9px 0 14px}
    .tryon-spinner{width:39px;height:39px;border-radius:50%;border:4px solid #e6daf4;border-top-color:#8067bd;animation:tryon-spin 1s linear infinite;margin:0 auto 15px}
    @keyframes tryon-spin{to{transform:rotate(360deg)}}
    #tryon-result{padding:10px 0}
    #tryon-result-image{display:block;max-width:100%;width:100%;height:auto;max-height:68vh;object-fit:contain;border-radius:15px;background:#f3eafa;margin:13px auto;border:1px solid #e7ddec}
    #tryon-result .tryon-actions{display:flex;gap:9px}
    #tryon-result .tryon-actions button{flex:1;min-width:0;font-size:12px}
    #tryon-modal .tryon-privacy{cursor:pointer}

    /* Robust narrow Telegram WebView layout; never horizontally pan the dialog. */
    html,body{max-width:100%;overflow-x:hidden}
    #tryon-modal{width:100%;overflow:hidden}
    #tryon-modal .sheet{width:100%;max-width:100%;min-width:0;margin:0;overflow:hidden;box-sizing:border-box;border-radius:22px 22px 0 0}
    #tryon-modal .sheet-head{width:100%;min-width:0;gap:12px}
    #tryon-modal .sheet-head h2{flex:1;min-width:0;font-size:clamp(17px,4.6vw,21px);overflow-wrap:anywhere;line-height:1.25}
    #tryon-modal .close{flex:0 0 36px}
    #tryon-modal .tryon-modal-body{width:100%;min-width:0;max-width:100%;overflow-x:hidden}
    #tryon-modal .tryon-selected-photos{grid-template-columns:repeat(2,minmax(0,1fr));width:100%;max-width:100%}
    #tryon-modal .tryon-selected-photos>div{min-width:0}
    #tryon-modal .tryon-actions{width:100%;max-width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
    #tryon-modal .tryon-actions .btn{min-width:0;width:100%;font-size:12px;padding:12px 7px;overflow-wrap:anywhere;white-space:normal}
    #tryon-result-image{width:100%;max-width:100%;height:auto;display:block;object-fit:contain}
    .crop-sheet{width:100%;max-width:510px;max-height:95dvh;overflow-y:auto;padding:18px;border-radius:24px 24px 0 0}
    .crop-sheet .sheet-head{margin-bottom:10px;gap:8px}
    .crop-sheet .sheet-head h2{font-size:clamp(17px,4.8vw,21px)}
    .crop-canvas-wrap{background:#26202d;border-radius:15px;display:flex;justify-content:center;align-items:center;overflow:hidden;margin:12px auto;width:100%;max-width:400px;min-height:160px;touch-action:none}
    #crop-canvas{display:block;max-width:100%;max-height:52dvh;touch-action:none;cursor:move}
    #person-tryon-crop{font-size:12px}

    /* Pinterest-like editorial lookbook. All product photos are the user's own wardrobe. */
    .inspo-panel{background:#fff;border-radius:25px;padding:18px;border:1px solid #e8dbe8;box-shadow:0 6px 24px rgba(39,18,54,.045)}
    .inspo-heading{display:flex;align-items:center;justify-content:space-between;gap:5px;margin-bottom:12px;color:#8f7097;font-weight:800;font-size:10px;letter-spacing:.16em}
    .inspo-counter{opacity:.65;letter-spacing:.07em}
    .inspo-panel h2{font-family:Georgia,'Times New Roman',serif;letter-spacing:-.045em;font-size:27px;line-height:1.1;font-weight:500;margin:4px 0 10px;color:#372839}
    .inspo-panel>p{color:#7b6c80;font-size:13px;line-height:1.55}
    .inspo-upload{margin:14px 0;display:flex;align-items:center;gap:12px;padding:17px 14px;background:#faf6fc;border:1.5px dashed #c6afd5;border-radius:17px;cursor:pointer}
    .inspo-upload .inspo-icon{display:grid;place-items:center;background:#eaddf0;border-radius:50%;width:42px;height:42px;font-size:27px;color:#795492;flex-shrink:0}
    .inspo-upload strong{display:block;font-size:13px;color:#46314b}
    .inspo-upload small{display:block;font-size:11px;color:#987f9d;margin-top:4px}
    .inspo-preview{display:flex;align-items:center;gap:14px;margin:11px 0;padding:11px;background:#f6f0f5;border-radius:16px}
    .inspo-preview img{width:93px;height:116px;object-fit:cover;border-radius:11px;flex-shrink:0;background:#eee}
    .inspo-preview strong{font-size:14px}
    .inspo-preview p{font-size:12px;line-height:1.4;color:#78677c;margin:6px 0}
    .inspo-clear{border:0;background:transparent;color:#855b99;font-size:12px;font-weight:700;padding:4px 0}
    .inspo-submit{background:linear-gradient(120deg,#35273d,#76558d);min-height:48px}
    .inspo-disclaimer{font-size:11px!important;color:#96899b!important;margin-top:10px!important}
    .inspo-analysis{border-radius:16px;background:#f6f0f6;border:1px solid #e8dbe8;padding:13px;margin-top:13px}
    .inspo-analysis>span{font-size:10px;letter-spacing:.15em;color:#876895;font-weight:800;display:block;margin-bottom:7px}
    .inspo-analysis>strong{display:block;font-family:Georgia,'Times New Roman',serif;font-size:21px;font-weight:500;color:#392b3f}
    .inspo-analysis p{font-size:12px;line-height:1.5;color:#75687a;margin-top:6px}
    .inspo-analysis .inspo-missing{color:#926d48;background:#fff7ea;padding:8px;border-radius:9px}
    .pinterest-moods{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
    .mood-tile{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;min-height:113px;border:1px solid #e8dfe9;background:linear-gradient(155deg,#fff,#f2eaf1);border-radius:17px;padding:11px;overflow:hidden;text-align:left;color:#49364a;transition:transform .12s,border-color .12s}
    .mood-tile:nth-child(2){background:linear-gradient(145deg,#fdfbf5,#f0eada)}
    .mood-tile:nth-child(3){background:linear-gradient(145deg,#f8f6f3,#e7e2e2)}
    .mood-tile:nth-child(4){background:linear-gradient(145deg,#f1edeb,#d8d1d4)}
    .mood-tile:nth-child(5){background:linear-gradient(145deg,#fff7f9,#f2dce4)}
    .mood-tile:nth-child(6){background:linear-gradient(145deg,#f4f2ee,#e6e0da)}
    .mood-tile:active{transform:scale(.97)}
    .mood-tile.selected{border:2px solid #896ab3;box-shadow:0 0 0 2px #e9e0f2 inset}
    .mood-emoji{font-family:Georgia,serif;font-size:29px;line-height:1;color:#836b84;margin-bottom:auto}
    .mood-tile strong{font-size:12px;line-height:1.3}
    .mood-tile small{font-size:10px;margin-top:3px;color:#83727c}
    .lookbook-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:17px;min-width:0}
    .lookbook-card{background:#fff;border:1px solid #eee6e9;border-radius:24px;padding:15px;overflow:hidden;box-shadow:0 6px 24px rgba(40,30,48,.035)}
    .lookbook-eyebrow{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:10px;color:#8e7792;letter-spacing:.16em;font-weight:800}
    .lookbook-eyebrow span:last-child{color:#b097b1}
    .lookbook-card h3{font-family:Georgia,'Times New Roman',serif;font-size:26px;font-weight:500;letter-spacing:-.035em;line-height:1.17;margin:11px 0}
    .lookbook-card .look-source{font-size:10px}
    .lookbook-board{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(6,1fr);gap:7px;aspect-ratio:4/5;border-radius:18px;background:#f5f0f3;padding:9px;margin:13px 0 8px;overflow:hidden}
    .lookbook-tile{position:relative;display:grid;place-items:center;overflow:hidden;background:#fff;border-radius:12px;min-width:0;min-height:0}
    .lookbook-tile img{width:100%;height:100%;display:block;object-fit:contain}
    .lookbook-tile.main{grid-column:1/4;grid-row:1/5}
    .lookbook-tile.second{grid-column:4/7;grid-row:1/5}
    .lookbook-tile.third{grid-column:1/3;grid-row:5/7}
    .lookbook-tile.fourth{grid-column:3/5;grid-row:5/7}
    .lookbook-tile.fifth{grid-column:5/7;grid-row:5/7}
    .lookbook-tile.solo{grid-column:1/7;grid-row:1/7}
    .lookbook-tile.duo:first-child{grid-column:1/4;grid-row:1/7}
    .lookbook-tile.duo:nth-child(2){grid-column:4/7;grid-row:1/7}
    .lookbook-tile.trio:first-child{grid-column:1/7;grid-row:1/5}
    .lookbook-tile.trio:nth-child(2){grid-column:1/4;grid-row:5/7}
    .lookbook-tile.trio:nth-child(3){grid-column:4/7;grid-row:5/7}
    .lookbook-tile small{position:absolute;bottom:6px;left:6px;right:6px;text-align:center;background:rgba(255,255,255,.91);font-size:9px;color:#68586c;border-radius:7px;padding:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
    .lookbook-card .lookbook-list{color:#8b758e;font-size:12px;line-height:1.5;margin-top:5px}
    .lookbook-card .lookbook-description{font-size:12px;line-height:1.6;color:#635d64;margin:10px 0}
    .lookbook-card .lookbook-match{background:#f8f1f8;padding:10px;border-radius:12px;color:#75617b;font-size:12px;line-height:1.5;margin:9px 0}
    .lookbook-card .look-buttons{margin-top:13px}
    .lookbook-card .tryon-start{margin-top:8px}
    @media(min-width:630px){.lookbook-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
    @media(max-width:350px){.pinterest-moods{grid-template-columns:repeat(2,minmax(0,1fr))}}

    /* v1.7: reliable photo-first lookbook on narrow iPhone Telegram WebView. */
    .lookbook-card{min-width:0;max-width:100%}
    .lookbook-board{
      width:100%;max-width:100%;
      height:clamp(270px,85vw,430px);
      aspect-ratio:auto;
      display:grid;
      grid-template-columns:repeat(2,minmax(0,1fr));
      grid-template-rows:repeat(2,minmax(0,1fr));
      grid-auto-flow:row;
      gap:8px;
      padding:8px;
      overflow:hidden;
    }
    .lookbook-board .lookbook-tile{
      position:relative;display:block;min-height:0;min-width:0;
      grid-column:auto;grid-row:auto;
      border:0;border-radius:13px;
      padding:0;margin:0;
      background:#f0eaed;
      appearance:none;overflow:hidden;
      cursor:zoom-in;
    }
    .lookbook-board .lookbook-tile img{
      position:absolute;inset:0;display:block;
      width:100%;height:100%;max-width:none;max-height:none;
      object-fit:cover;object-position:center 40%;
    }
    .lookbook-board .lookbook-tile small{
      position:absolute;bottom:0;left:0;right:0;
      display:block;
      padding:23px 6px 8px;
      background:linear-gradient(to bottom,transparent,rgba(26,18,30,.78));
      border-radius:0;
      color:white;
      font-size:11px;line-height:1.25;text-align:center;font-weight:700;
      white-space:normal;overflow:hidden;max-height:58px;
      text-shadow:0 1px 2px rgba(0,0,0,.35);
      pointer-events:none;
    }
    .lookbook-board.count-1 .lookbook-tile:nth-child(1){grid-column:1/3;grid-row:1/3}
    .lookbook-board.count-2 .lookbook-tile:nth-child(1){grid-column:1;grid-row:1/3}
    .lookbook-board.count-2 .lookbook-tile:nth-child(2){grid-column:2;grid-row:1/3}
    .lookbook-board.count-3{grid-template-columns:minmax(0,1.2fr) minmax(0,.85fr)}
    .lookbook-board.count-3 .lookbook-tile:nth-child(1){grid-column:1;grid-row:1/3}
    .lookbook-board.count-3 .lookbook-tile:nth-child(2){grid-column:2;grid-row:1}
    .lookbook-board.count-3 .lookbook-tile:nth-child(3){grid-column:2;grid-row:2}
    .lookbook-board.count-4 .lookbook-tile:nth-child(1){grid-column:1;grid-row:1}
    .lookbook-board.count-4 .lookbook-tile:nth-child(2){grid-column:2;grid-row:1}
    .lookbook-board.count-4 .lookbook-tile:nth-child(3){grid-column:1;grid-row:2}
    .lookbook-board.count-4 .lookbook-tile:nth-child(4){grid-column:2;grid-row:2}
    .lookbook-board.count-5{grid-template-columns:repeat(3,minmax(0,1fr))}
    .lookbook-board.count-5 .lookbook-tile:nth-child(1){grid-column:1/3;grid-row:1}
    .lookbook-board.count-5 .lookbook-tile:nth-child(2){grid-column:3;grid-row:1}
    .lookbook-board.count-5 .lookbook-tile:nth-child(3){grid-column:1;grid-row:2}
    .lookbook-board.count-5 .lookbook-tile:nth-child(4){grid-column:2;grid-row:2}
    .lookbook-board.count-5 .lookbook-tile:nth-child(5){grid-column:3;grid-row:2}
    .wardrobe-photo-sheet{max-width:560px;padding:18px;max-height:94dvh;overflow-y:auto}
    .wardrobe-photo-sheet .sheet-head{margin-bottom:10px;gap:10px}
    .wardrobe-photo-sheet .sheet-head h2{font-size:18px;min-width:0;overflow-wrap:anywhere}
    #wardrobe-photo-full{display:block;width:100%;max-height:72dvh;object-fit:contain;background:#f8f4f8;border-radius:15px}
    @media(min-width:630px){.lookbook-board{height:clamp(260px,32vw,350px)}}

    /* Shop Lookbook: compact editorial marketplace wardrobe planning. */
    .footer-inside .tab{min-width:0;flex:1;font-size:10px;gap:4px;line-height:1.25;padding:2px 1px;white-space:nowrap}
    .footer-inside .tab span{font-size:19px}
    .shop-eyebrow{letter-spacing:.2em;color:#98799d;font-size:11px;font-weight:800;margin-top:25px}
    .shop-form-panel{border:1px solid #e7dce6;border-radius:22px;background:#fff;padding:16px;box-shadow:0 5px 25px rgba(60,35,65,.04)}
    .shop-form-heading{display:flex;justify-content:space-between;align-items:center;font-family:Georgia,'Times New Roman',serif;font-size:24px;color:#4a3650;margin-bottom:15px}
    .shop-form-heading span{font-family:Inter,Arial,sans-serif;font-weight:800;color:#86659b;font-size:19px}
    .shop-ref-upload{display:flex;align-items:center;gap:12px;padding:13px;border:1.5px dashed #cebdd3;background:#fbf7fc;border-radius:14px;cursor:pointer}
    .shop-ref-plus{font-family:Georgia,serif;font-size:28px;color:#846593;display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#f1e8f5;flex-shrink:0}
    .shop-ref-upload strong{font-size:13px;color:#524058;display:block}
    .shop-ref-upload small{font-size:11px;color:#948198;display:block;margin-top:4px}
    .shop-ref-preview{margin-top:10px;background:#f8f3f8;border-radius:13px;padding:10px;display:flex;align-items:center;gap:12px}
    .shop-ref-preview img{width:65px;height:83px;object-fit:cover;border-radius:10px;background:#eee;flex-shrink:0}
    .shop-ref-preview strong{font-size:12px;color:#4e3c56}
    .shop-ref-preview p{font-size:11px;color:#847288;line-height:1.4;margin-top:3px}
    .shop-ref-remove{border:0;background:transparent;color:#846196;padding:6px 0;font-weight:700;font-size:12px}
    .shop-create{margin-top:15px;background:linear-gradient(115deg,#33213c,#8664aa);padding:16px}
    .shop-explain{padding:12px 13px;background:#f7f1f5;border-radius:15px;margin-top:14px;color:#746576;line-height:1.55}
    .shop-explain strong{font-size:12px;color:#5e4668}
    .shop-explain p{font-size:11px;margin-top:4px}
    .shop-results{display:grid;grid-template-columns:minmax(0,1fr);gap:17px}
    .shop-look{border:1px solid #e8dce8;background:#fff;border-radius:23px;padding:15px;min-width:0;box-shadow:0 4px 24px #3d224d0b}
    .shop-look-head{display:flex;justify-content:space-between;align-items:center;font-size:10px;font-weight:800;letter-spacing:.15em;color:#8f709d}
    .shop-look h3{font-family:Georgia,'Times New Roman',serif;font-size:25px;font-weight:500;margin:9px 0;color:#3c2e44;line-height:1.22}
    .shop-look-reason{font-size:12px;line-height:1.5;color:#7b6c7e;margin-bottom:13px}
    .shop-piece{display:flex;gap:10px;align-items:flex-start;padding:11px 0;border-top:1px solid #f0eaf0;min-width:0}
    .shop-piece-icon{border-radius:13px;width:43px;height:53px;display:grid;place-items:center;font-size:24px;background:#f6edf6;flex-shrink:0}
    .shop-piece:nth-child(3n) .shop-piece-icon{background:#f4eee5}
    .shop-piece:nth-child(4n) .shop-piece-icon{background:#eff2f3}
    .shop-piece-body{min-width:0;flex:1}
    .shop-piece-name{font-size:13px;font-weight:750;color:#4e4053;line-height:1.4}
    .shop-piece-target{font-size:11px;color:#8d7c8e;margin-top:3px}
    .shop-piece-offer{font-size:12px;line-height:1.5;margin:7px 0;color:#63546b}
    .shop-price{font-weight:800;color:#664981;font-size:15px}
    .shop-verified{display:block;font-size:10px;color:#91829a;margin-top:2px}
    .shop-market-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:8px}
    .shop-market-actions a{color:#6a478d;border:1px solid #e4d8e9;background:#fcf8fd;padding:7px 9px;border-radius:9px;font-size:11px;font-weight:750;text-decoration:none}
    .shop-market-actions a.ozon-link{color:#315fa7;background:#f4f7ff;border-color:#dce6fa}
    .shop-budget-summary{font-size:12px;font-weight:700;background:#f8f1fb;border-radius:13px;padding:12px;color:#715882;line-height:1.5;margin:12px 0}
    .shop-check{font-size:12px;padding:12px 9px;width:100%}
    @media(min-width:700px){.shop-results{grid-template-columns:repeat(2,minmax(0,1fr))}}

    .bulk-panel{background:linear-gradient(145deg,#fffdfb,#f7f2ef);border:1px solid #e9ddd5;border-radius:22px;padding:16px;min-width:0}
    .bulk-title{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}
    .bulk-title span{font-size:10px;letter-spacing:.17em;color:#a4836d;font-weight:850}
    .bulk-title strong{font-family:Georgia,'Times New Roman',serif;font-size:22px;font-weight:500;color:#3d3030}
    .bulk-panel>p:not(.status){font-size:12px;line-height:1.55;color:#82736e;margin-bottom:12px}
    .bulk-pick{display:block;text-align:center;cursor:pointer;padding:15px 10px}
    #bulk-progress-box{margin-top:14px;border-top:1px solid #e8dcd5;padding-top:13px}
    .bulk-progress-head{display:flex;justify-content:space-between;gap:10px;font-size:12px;color:#62504c}
    #bulk-progress{display:block;width:100%;height:10px;accent-color:#aa8b72;margin:10px 0 13px}
    .bulk-results{display:grid;gap:7px;max-height:230px;overflow-y:auto}
    .bulk-row{display:flex;align-items:center;gap:9px;background:#fff;border:1px solid #eee7e3;border-radius:11px;padding:8px;min-width:0}
    .bulk-row img{width:42px;height:50px;object-fit:cover;border-radius:8px;background:#f0eeec;flex-shrink:0}
    .bulk-row strong{display:block;font-size:12px;line-height:1.4;color:#51443e}
    .bulk-row small{display:block;font-size:11px;color:#88766d;line-height:1.35;margin-top:3px;overflow-wrap:anywhere}
    .bulk-row .bulk-icon{font-size:15px;margin-left:auto;flex-shrink:0}
    .bulk-actions{display:flex;gap:8px;margin-top:12px}
    .bulk-actions button{flex:1;min-width:0;font-size:12px;padding:12px 7px}
    .shop-complete-price{font-weight:750;color:#514037;font-size:20px;margin:12px 0 9px}
    .shop-complete-price span{font-size:11px;font-weight:500;color:#807570}
    .look-owned-price{margin-top:9px;padding:10px 12px;background:#f5f1ed;border-radius:12px;color:#675147;font-weight:750;font-size:13px}

/* v2.0: three real product cards, editorial tan/cream presentation */
.shop-results{grid-template-columns:minmax(0,1fr)}
.shop-single-look{padding:15px;min-width:0}
.shop-single-look h3{font-family:Georgia,serif;font-size:26px;color:#3d312f;margin:12px 0}
.shop-look-total{display:flex;flex-direction:column;gap:6px;background:#f3ebe4;border-radius:15px;padding:13px;margin:12px 0 16px}
.shop-look-total strong{color:#503b30;font-size:17px;line-height:1.35}
.shop-look-total small{color:#836f65;font-size:11px;line-height:1.5}
.shop-three-products{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.shop-real-product{display:grid;grid-template-columns:minmax(0,42%) minmax(0,58%);border:1px solid #e9ddd6;border-radius:16px;overflow:hidden;min-width:0;background:white}
.shop-real-photo{position:relative;background:#f6f3f0;min-height:180px;display:grid;place-items:center;overflow:hidden}
.shop-real-photo img{width:100%;height:100%;position:absolute;inset:0;object-fit:contain}
.shop-real-index{position:absolute;top:7px;left:7px;z-index:2;padding:5px 7px;border-radius:10px;background:#ffffffee;color:#6d584a;font-size:10px;font-weight:750}
.shop-real-fallback{font-size:40px;opacity:.55}
.shop-real-data{padding:12px 10px;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:7px}
.shop-real-data>strong{font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.shop-real-market{font-size:10px;color:#a08069;font-weight:800}
.shop-real-price{color:#403029;font-weight:850;font-size:23px;letter-spacing:-.04em}
.shop-real-caption{color:#8a776e;font-size:10px;line-height:1.45}
.shop-real-button{background:#967b65;color:white;text-decoration:none;font-size:11px;text-align:center;font-weight:750;border-radius:9px;padding:10px 7px;display:block;width:100%;margin-top:auto}
.shop-real-ozon{display:block;text-decoration:none;font-size:10px;color:#315b99;font-weight:750;padding:6px 1px}
.shop-no-real{background:#faf7f4}
.shop-no-real .shop-real-caption{color:#9d7564;font-size:11px}
.shop-catalog-issue{font-size:11px;line-height:1.5;color:#8b715d;margin-top:13px}
@media(min-width:630px){.shop-three-products{grid-template-columns:repeat(3,minmax(0,1fr))}.shop-real-product{grid-template-columns:minmax(0,1fr);grid-template-rows:190px minmax(190px,1fr)}}
    .shop-catalog-setup{background:#f7f0e9;border:1px solid #e7d8c8;border-radius:18px;padding:22px 16px;margin:15px 0;text-align:center;display:flex;flex-direction:column;align-items:center;gap:11px}
    .shop-catalog-setup-icon{font-size:38px}
    .shop-catalog-setup>strong{font-family:Georgia,serif;font-size:23px;color:#48352c;font-weight:500}
    .shop-catalog-setup p{font-size:13px;line-height:1.5;color:#735f52}
    .shop-catalog-setup small{font-size:11px;line-height:1.45;color:#927a69}
    .shop-setup-links{display:flex;flex-wrap:wrap;justify-content:center;gap:9px}
    .shop-setup-links a{display:inline-block;background:#967b65;color:white;text-decoration:none;font-size:12px;font-weight:700;border-radius:10px;padding:11px 12px}
    .shop-setup-links a:nth-child(2){background:#fff;color:#6d5141;border:1px solid #e2d5c8}

    .shop-manual-group{width:100%;display:flex;flex-direction:column;gap:5px;margin-top:9px;border-top:1px solid #ede7e2;padding-top:10px}
    .shop-manual-group label{font-size:10px;color:#826c5e;font-weight:750;line-height:1.4}
    .shop-sku-input{display:block;box-sizing:border-box;width:100%;border:1px solid #d7c9be;border-radius:9px;padding:10px 8px;background:#fff;color:#47382f;font-size:12px;min-width:0;outline-offset:2px}
    .shop-sku-input:focus{outline:2px solid #a58b71}
    .shop-catalog-issue{border-radius:12px;background:#f7efe9;padding:12px;margin:10px 0;color:#7d604e;font-size:12px;line-height:1.6}
    .shop-no-real .shop-real-photo{min-height:145px}

    /* v2.3 – photo-first Pinterest shopping board. No fake products or emoji placeholders. */
    .shop-editorial{background:#fffaf6;border:1px solid #e9d9cc;border-radius:23px;padding:15px;min-width:0}
    .shop-editorial-top{display:flex;justify-content:space-between;font-size:10px;font-weight:850;letter-spacing:.18em;color:#a78268}
    .shop-editorial h3{font-family:Georgia,'Times New Roman',serif;color:#33251f;font-size:27px;font-weight:500;line-height:1.18;margin:11px 0 8px}
    .shop-editorial-reason{color:#8a7468;font-size:12px;line-height:1.5;margin:0 0 18px}
    .shop-moodboard{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;align-items:stretch}
    .shop-pin{min-width:0;background:#fff;border:1px solid #eaded6;border-radius:16px;overflow:hidden;box-shadow:0 4px 12px #55321e08;display:flex;flex-direction:column}
    .shop-pin:first-child{grid-row:span 2}
    .shop-pin-visual{display:block;position:relative;height:145px;background:#f6f0e9;overflow:hidden}
    .shop-pin:first-child .shop-pin-visual{height:335px}
    .shop-pin-visual img{display:block;width:100%;height:100%;object-fit:contain;position:relative;z-index:1;opacity:0;transition:opacity .22s ease}
    .shop-pin-visual.shop-photo-ready img{opacity:1}
    .shop-pin-photo-state{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:22px;text-align:center;font-size:11px;line-height:1.5;color:#a58c7e;background:linear-gradient(100deg,#f8f3ec 20%,#f2e9e0 45%,#f8f3ec 70%);background-size:220% 100%;animation:shop-photo-wait 1.6s ease-in-out infinite}
    .shop-pin-visual.shop-photo-ready .shop-pin-photo-state{display:none}
    .shop-pin-visual.shop-photo-unavailable .shop-pin-photo-state{animation:none;background:#f7eee7;color:#927765}
    .shop-pin-visual.shop-photo-unavailable img{display:none}
    @keyframes shop-photo-wait{0%{background-position:100% 0}100%{background-position:-100% 0}}
    @media(prefers-reduced-motion:reduce){.shop-pin-photo-state{animation:none}}
    .shop-pin-category{position:absolute;top:8px;left:8px;padding:6px 7px;background:#fffefaed;border:1px solid #e9ded4;border-radius:9px;color:#604b3c;font-size:10px;font-weight:750}
    .shop-pin-content{padding:10px;min-width:0;display:flex;flex-direction:column;gap:6px;flex:1}
    .shop-pin-store{color:#a0826b;letter-spacing:.12em;font-size:9px;font-weight:850}
    .shop-pin-content>strong{font-size:12px;line-height:1.35;color:#3f352f;overflow-wrap:anywhere}
    .shop-pin-number{font-size:10px;color:#948176;overflow-wrap:anywhere}
    .shop-pin-foot{margin-top:auto;display:flex;flex-wrap:wrap;gap:4px;align-items:baseline}
    .shop-pin-foot b{font-size:16px;color:#352a25;white-space:nowrap}
    .shop-pin-foot span{font-size:9px;color:#9d806a}
    .shop-pin-cta{display:block;text-decoration:none;text-align:center;border-radius:9px;padding:9px 5px;margin-top:3px;background:#8c6b56;color:#fff;font-size:10px;font-weight:750}
    .shop-editorial-total{display:flex;justify-content:space-between;align-items:center;gap:10px;border-top:1px solid #e9dcd2;margin-top:16px;padding-top:14px}
    .shop-editorial-total small{font-size:10px;color:#9c806f;display:block;margin-bottom:4px}
    .shop-editorial-total strong{font-size:25px;letter-spacing:-.03em;color:#423126}
    .shop-editorial-total>span{font-size:11px;color:#876b56;text-align:right;max-width:110px}
    .shop-editorial-note{color:#988579;font-size:10px;line-height:1.55;margin-top:12px}
    .shop-refresh{border:0;background:transparent;color:#87664e;font-size:12px;font-weight:750;margin-top:10px;padding:10px 0;cursor:pointer}
    .shop-empty,.shop-searching{border:1px solid #eadcd1;background:#fffaf6;border-radius:23px;padding:28px 20px;text-align:center}
    .shop-empty-rule,.shop-searching-line{display:block;width:40px;height:3px;background:#c9b4a2;margin:0 auto 17px;border-radius:3px}
    .shop-empty strong,.shop-searching strong{display:block;font:normal 23px/1.25 Georgia,serif;color:#4a3529}
    .shop-empty p,.shop-searching p{font-size:12px;color:#887468;line-height:1.6;margin:13px auto 17px;max-width:380px}
    .shop-retry{max-width:250px;width:100%;background:#8c6b56}

    /* Real WB product alternatives, loaded only when an exchange panel opens. */
    .shop-swap-list{border-top:1px solid #eadbd0;margin-top:17px;padding-top:10px}
    .shop-swap-list>strong{display:block;font-size:13px;color:#554134;margin-bottom:9px}
    .shop-swap-panel{border:1px solid #ede2d8;border-radius:13px;margin:9px 0;background:#fff;overflow:hidden}
    .shop-swap-panel>summary{cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:8px;list-style:none;padding:13px 12px;font-size:12px;font-weight:750;color:#654c39}
    .shop-swap-panel>summary::-webkit-details-marker{display:none}
    .shop-swap-panel>summary:after{content:'⌄';font-size:20px;line-height:1}
    .shop-swap-panel[open]>summary:after{transform:rotate(180deg)}
    .shop-alt-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;padding:0 10px 12px}
    .shop-alt-tile{text-align:left;display:flex;flex-direction:column;align-items:stretch;border:1px solid #eadbd0;background:#faf6f0;border-radius:12px;padding:0 0 10px;overflow:hidden;min-width:0;cursor:pointer;color:inherit}
    .shop-alt-tile:focus-visible{outline:2px solid #8c6b56}
    .shop-alt-visual{height:140px!important;flex:none;border-radius:0!important}
    .shop-alt-tile strong{font-size:11px;line-height:1.3;color:#4f3d30;margin:9px 9px 4px;overflow-wrap:anywhere}
    .shop-alt-tile small{font-size:10px;color:#93735f;margin:0 9px}
    .shop-alt-tile b{color:#3e3027;font-size:14px;margin:6px 9px 0}
    .shop-ozon-compare{display:block;text-align:center;text-decoration:underline;text-underline-offset:2px;color:#8f6ca7;font-size:10px;font-weight:650;padding:5px 2px 3px;line-height:1.4}
    .shop-catalog-count{display:block;font-size:11px;color:#8f796c;margin:6px 0 0}
    @media(min-width:630px){.shop-moodboard{grid-template-columns:repeat(3,minmax(0,1fr))}.shop-pin:first-child{grid-row:auto}.shop-pin-visual,.shop-pin:first-child .shop-pin-visual{height:280px}}
    /* Photos stay private in D1 and are fetched only for visible wardrobe cards. */
    .item-photo:not([src]),.lookbook-tile img[data-wardrobe-photo]:not([src]){background:linear-gradient(110deg,#f1eaf0 14%,#faf6fa 48%,#f1eaf0 80%);background-size:220% 100%;animation:wardrobe-photo-skeleton 1.8s ease-in-out infinite}
    .item-photo[data-photo-state="failed"]:not([src]){background:#f0e9ec;animation:none;cursor:pointer}
    @keyframes wardrobe-photo-skeleton{from{background-position:100% 0}to{background-position:-100% 0}}
    @media(prefers-reduced-motion:reduce){.item-photo:not([src]),.lookbook-tile img[data-wardrobe-photo]:not([src]){animation:none}}