/* © 2026 IG Tools — All rights reserved. */
/* Grid Pop-Out mobile-first shell — pairs with shell.js and shared/ui.js (same base as motionblur/shell.css).
   The landing (drop zone) keeps its own layout; everything under "editor" only applies once a photo is open (body.ready). */

/* ---- the ONE top bar (UI_RULES §1) ---- */
.mcs-top{display:flex;align-items:center;gap:6px;min-height:calc(56px + var(--ad-handle,0px));padding:var(--ad-handle,0px) 8px 0;box-sizing:border-box;position:relative;z-index:30;margin:calc(var(--ad-gap,0px) - 26px) -18px 18px;
  background:var(--chrome-solid,var(--panel));border-bottom:1px solid var(--line)}
.mcs-home{order:1;display:flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;padding:0 10px;border:0;border-radius:12px;background:none;color:var(--accent);cursor:pointer}
.mcs-tool{order:3;display:flex;align-items:center;gap:8px;font:700 17px/1 var(--sans);color:var(--text);padding-left:2px}
.mcs-tool svg{flex:none;color:var(--logo)}
.mcs-new{order:2;display:none}
.mcs-mode{order:3;display:none;gap:2px;padding:3px;border-radius:13px;background:var(--fill)}
.mcs-mode button{min-height:40px;padding:0 9px;border:0;border-radius:10px;background:transparent;color:var(--muted);display:flex;align-items:center;justify-content:center;gap:6px;font:600 13px/1 var(--sans);cursor:pointer}
.mcs-mode button.on{background:var(--panel);color:var(--text);box-shadow:var(--sh)}
#mcsDl{order:5;margin-left:auto;display:none}
.mcs-lang{order:6;display:flex;align-items:center;gap:2px;margin-left:auto;background:var(--fill);border-radius:10px;padding:2px 2px 2px 8px}
.mcs-theme{order:6;margin-left:auto;display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:0;border-radius:12px;background:none;color:var(--text);cursor:pointer;padding:0}
.mcs-lang{margin-left:0}
.mcs-globe{display:flex;color:var(--muted)}
.mcs-lang button{border:0;background:none;color:var(--muted);font:600 13px/1 var(--sans);padding:8px 10px;border-radius:8px;cursor:pointer}
.mcs-lang button.on{background:var(--panel);color:var(--text);box-shadow:var(--sh)}
.mcs-inst{width:fit-content;margin:14px auto 0;min-height:44px;padding:0 16px;border-radius:22px;display:flex;align-items:center;gap:8px;font:600 14px/1 var(--sans)}
.mcs-inst[hidden],body.ready .mcs-inst{display:none}
.mcs-newbtn{display:flex!important;align-items:center;justify-content:center;gap:8px;min-width:44px;min-height:44px;padding:0;border:0;border-radius:12px!important;background:none;box-shadow:none;color:var(--text);cursor:pointer;font:600 14px/1 var(--sans)}
.mcs-newt{display:none}
/* the old landing header (logo, wordmark, TR/EN, tagline) stays in the DOM, off-screen: h1, SEO copy, language handlers */
.igsb{display:none!important}
.wrap>header{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.mcs-ask{text-align:center;padding:4px 0 6px}
.mcs-ask-ic{display:inline-flex;align-items:center;justify-content:center;width:56px;height:56px;border-radius:18px;background:rgba(255,59,48,.12);color:#FF3B30;margin-bottom:10px}
.mcs-ask b{display:block;font:700 19px/1.2 var(--sans);color:var(--text)}
.mcs-ask p{margin:8px 0 0;font:400 14px/1.45 var(--sans);color:var(--muted)}
.mcs-ask-btns{display:flex;gap:8px;margin-top:18px}
.mcs-ask-btns .ig-btn{flex:1;min-height:52px}
.ig-btn.mcs-danger{background:#FF3B30;color:#fff}

/* ================= editor (body.ready) ================= */
body.ready{padding:var(--ad-top,0px) 0 calc(84px + var(--ad-bot,0px))!important}
body.ready .mcs-top{margin:0;position:sticky;top:var(--ad-top,0px)}
body.ready .wrap{padding:0 12px}
body.ready .mcs-tool,body.ready .mcs-lang,body.ready .mcs-theme{display:none}
body.ready .mcs-new,body.ready #mcsDl,body.ready .mcs-mode{display:flex}
/* what the shell replaced: the whole control panel, the tool bar, the pieces/zip buttons, the hint lines, the footer.
   Their buttons are still clicked by the sheets (display:none does not stop .click()). */
body.ready .panel,body.ready .tools-bar,body.ready .dl-all,body.ready .dl-zip,body.ready .pieces-opt,body.ready .pieces,body.ready .note,
body.ready #imgStripWrap,body.ready .tip,body.ready #cropRow,body.ready .igbar,body.ready .igrow,body.ready .igdots{display:none!important}
body.ready .stage{margin-top:10px}
body.ready .frame img{max-height:calc((100dvh - 56px - 84px - var(--ad-top,0px) - var(--ad-bot,0px) - 28px) * var(--vz,1))}
@media(max-width:380px){.mcs-mode button span,.mcs-top .ig-btn.pri span{display:none}.mcs-top .ig-btn.pri{padding:0;width:44px}}
@media(max-width:380px){body.mcs-prev .mcs-mode button[data-m=edit] span{display:inline}}

/* Düzenle shows the editor column, Önizle the Instagram card (also on desktop: one thing at a time, like the other tools) */
body.mcs-prev .editcol{display:none}
body.ready:not(.mcs-prev) .prevcol{display:none}
body.mcs-prev .prevcol{flex:1 1 auto;max-width:430px;margin:0 auto;width:100%}
.prevcol .igwrap{margin-top:6px}

/* dock: Düzenle = Pop-out · Çizgi · Renk · Grafik; Önizle = Çerçeve · Grafik */
.mcs-dock{display:none}
body.ready .mcs-dock{display:flex;position:fixed;left:0;right:0;bottom:var(--ad-bot,0px);z-index:30;padding:6px 8px calc(6px + env(safe-area-inset-bottom,0px));
  background:var(--chrome-solid,var(--panel));border-top:1px solid var(--line)}
.mcs-tab{flex:1;min-height:56px;border:0;border-radius:12px;background:transparent;color:var(--muted);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font:600 12px/1 var(--sans);cursor:pointer;position:relative}
.mcs-tab.on{color:var(--accent);background:var(--fill)}
.mcs-tab[data-t=frame]{display:none}
body.mcs-prev .mcs-tab{display:none}
body.mcs-prev .mcs-tab[data-t=gfx],body.mcs-prev .mcs-tab[data-t=frame]{display:flex}
/* on/off dot (UI_RULES §13): black = off, green = on */
.mcs-dot{display:block;flex:none;width:12px;height:12px;border-radius:50%;background:#1D1D1F;box-shadow:0 0 0 3px rgba(29,29,31,.14)}
.mcs-tab .mcs-dot{position:absolute;top:8px;right:calc(50% - 26px)}
.mcs-tab.on .mcs-dot,.mcs-swrow.on .mcs-dot{background:#34C759;box-shadow:0 0 0 3px rgba(52,199,89,.35)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) .mcs-dot{background:#fff;box-shadow:0 0 0 3px rgba(255,255,255,.2)}}
:root[data-theme=dark] .mcs-dot{background:#fff;box-shadow:0 0 0 3px rgba(255,255,255,.2)}
@media(min-width:900px){body.ready .mcs-dock{max-width:560px;margin:0 auto;border:1px solid var(--line);border-radius:18px;bottom:calc(14px + var(--ad-bot,0px));box-shadow:var(--sh-hi)}}

/* sheets that host the panes sit low and leave the photo visible; the photo stays workable while one is open */
.ig-sheet.mcs-s .ig-sh-box{max-height:48vh}
@media(min-width:900px){.ig-sheet.mcs-s .ig-sh-box{top:auto;bottom:var(--sh-b,96px);left:auto;right:var(--sh-r,24px);transform:none;max-height:var(--sh-mh,calc(100vh - 200px))}}
.ig-sheet.mcs-s{pointer-events:none}
.ig-sheet.mcs-s .ig-sh-box{pointer-events:auto}
.ig-sheet .ig-row[hidden]{display:none}
.ig-sheet .ig-row.on{outline:2px solid var(--accent)}
.ig-sheet .ig-row.mcs-swrow.on{outline:0}
.ig-sheet .ig-row+.ig-row,.ig-sheet .mcs-wrow,.ig-sheet .mcs-dirwrap{margin-top:8px}
.mcs-lbl{font:600 12px/1 var(--sans);letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin:6px 2px 8px}
.mcs-dirs{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.mcs-dirs .btn-ghost{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:56px;padding:6px 0;font-size:18px;line-height:1;border-radius:14px;box-shadow:none;background:var(--fill);border-color:transparent}
.mcs-dirs .btn-ghost::after{content:attr(data-capt);font:600 11px/1 var(--sans);color:var(--muted)}
.mcs-dirs .btn-ghost.on{background:color-mix(in srgb,var(--accent) 15%,transparent);color:var(--accent)}
.mcs-dirs .btn-ghost.on::after{color:var(--accent)}
.mcs-hidden-in{position:absolute!important;width:1px!important;height:1px!important;opacity:0;pointer-events:none}
.mcs-nrow{position:relative}
.mcs-step{display:flex;align-items:center;gap:2px;background:var(--panel);border-radius:12px;padding:3px;box-shadow:var(--sh)}
.mcs-step button{width:44px;height:40px;border:0;border-radius:9px;background:none;color:var(--accent);font:600 22px/1 var(--sans);cursor:pointer}
.mcs-nv{min-width:34px;text-align:center;font:700 16px/1 var(--sans);color:var(--text)}
.mcs-wrow .seg{width:100%}
.mcs-wrow .seg button{flex:1;min-height:44px}

/* size chip (bottom-left of the photo) */
.shellwrap{position:relative}
.mcs-size{position:absolute;left:12px;bottom:12px;z-index:6;display:none;align-items:center;gap:6px;min-height:40px;padding:0 12px;border:1px solid rgba(255,255,255,.14);border-radius:14px;
  background:rgba(28,28,30,.72);color:#fff;font:600 13px/1 var(--sans);backdrop-filter:blur(14px) saturate(180%);-webkit-backdrop-filter:blur(14px) saturate(180%);cursor:pointer}
body.ready .mcs-size{display:flex}

/* floats on the photo: AI pill (top right), Ortala + Düz çizgiler pill (top left, UI_RULES §33), Pop-out pill (bottom centre) */
.mcs-fab{position:absolute;inset:12px;z-index:6;display:none;pointer-events:none}
body.ready .mcs-fab{display:block}
.mcs-pill{position:absolute;top:0;right:0;display:flex;flex-direction:column;pointer-events:auto;border:1px solid rgba(255,255,255,.14);border-radius:16px;overflow:hidden;
  background:rgba(28,28,30,.72);box-shadow:0 4px 14px rgba(0,0,0,.35);backdrop-filter:blur(14px) saturate(180%);-webkit-backdrop-filter:blur(14px) saturate(180%)}
.mcs-pill .btn-ghost{width:44px;height:44px;padding:0;margin:0;font-size:0!important;line-height:0;display:flex;align-items:center;justify-content:center;gap:0;border:0;border-radius:0;
  background:transparent!important;color:#fff!important;box-shadow:none}
.mcs-pill .btn-ghost::before{content:"";width:22px;height:22px;background:currentColor;-webkit-mask:var(--ic) center/contain no-repeat;mask:var(--ic) center/contain no-repeat}
.mcs-pill .btn-ghost.on{box-shadow:inset 0 0 0 2px var(--accent)!important}
.mcs-pill .btn-ghost+.btn-ghost{border-top:1px solid rgba(255,255,255,.14)}
.mcs-pill.mcs-pillL{right:auto;left:0}
.mcs-pill:empty{display:none}
.mcs-poppill{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);z-index:6;display:none;align-items:center;gap:8px;min-height:44px;padding:0 18px;border:1px solid rgba(255,255,255,.14);border-radius:22px;
  background:rgba(28,28,30,.72);color:#fff;font:600 14px/1 var(--sans);backdrop-filter:blur(14px) saturate(180%);-webkit-backdrop-filter:blur(14px) saturate(180%);cursor:pointer;white-space:nowrap}
.mcs-poppill.on{background:var(--accent);border-color:transparent}
body.ready .mcs-poppill{display:flex}

/* zoom capsule (UI_RULES §14): icon-only － 1× ＋, bottom-left above the size chip */
/* UI_RULES §33 (Osman, 2026-10-21): tuval düzeni her araçta aynı — zoom kapsülü PC'de de dikey, sol altta */
.shellwrap .pvzoomf{left:12px;right:auto;top:auto;bottom:62px;flex-direction:column;align-items:center}
.shellwrap .pvzoomf .pvfval{border:0;min-width:0;width:40px;padding:1px 0;font-size:12px;color:#fff}
.shellwrap .pvfbtn .igi{margin:auto}
/* phones: every on-photo control is a VERTICAL stack hugging the stage edge */
@media(max-width:899px){
  .shellwrap .pvfloat{border-radius:13px}
  .shellwrap .pvfbtn{width:40px;height:40px}
  .shellwrap .pvzoomf{left:6px;bottom:70px;flex-direction:column;align-items:center}
  .shellwrap .pvzoomf .pvfval{border:0;min-width:0;width:40px;padding:1px 0;font-size:12px}
  .mcs-size{left:6px;bottom:6px;flex-direction:column;gap:3px;min-height:0;width:40px;padding:7px 0;font-size:11px;border-radius:13px;justify-content:center}
  .mcs-size span{max-width:40px;text-align:center;white-space:nowrap;overflow:hidden;font-size:10.5px;line-height:1.1}
  .mcs-fab{inset:6px}
  .mcs-poppill{bottom:6px}
}

/* the download-options popup becomes a bottom sheet */
body.ready #dlOptsModal{align-items:flex-end!important;padding:0!important}
body.ready #dlOptsModal .modal-box{max-width:560px!important;width:100%!important;margin:0 auto;border-radius:22px 22px 0 0!important;max-height:88vh;overflow:auto;padding-bottom:calc(22px + env(safe-area-inset-bottom,0px))!important}

/* ---- landing: one clear action, Ana sayfa on top ---- */
body:not(.ready) .wrap{max-width:560px}
body:not(.ready) .wrap>header .badge,body:not(.ready) .wrap>header .sub{display:none}
body:not(.ready) .wrap>header{margin-bottom:0}
body:not(.ready) .drop{display:flex;flex-direction:column;justify-content:center;min-height:56vh;border:0;background:none;box-shadow:none;padding:0 8px;margin-top:0}
body:not(.ready) .drop:hover{transform:none;box-shadow:none}
body:not(.ready) .drop .content{display:flex;flex-direction:column;align-items:center;gap:0}
body:not(.ready) .drop .icon{font-size:0;width:84px;height:84px;border-radius:24px;background:#1D1D1F;position:relative;margin:0 0 16px}
body:not(.ready) .drop .icon::after{content:"";position:absolute;inset:19px;background:#fff;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h6v6H4zM14 14h6v6h-6zM4 14h6v6H4z'/%3E%3Crect x='12.5' y='2.5' width='9' height='9' rx='2'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 4h6v6H4zM14 14h6v6h-6zM4 14h6v6H4z'/%3E%3Crect x='12.5' y='2.5' width='9' height='9' rx='2'/%3E%3C/svg%3E") center/contain no-repeat}
body:not(.ready) .drop .big{font-size:22px;font-weight:700;letter-spacing:-.02em}
body:not(.ready) .drop .small{font-size:13.5px;max-width:340px;line-height:1.45;margin:8px 0 18px}
body:not(.ready) .drop .pill{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:60px;margin:0;padding:0 20px;border-radius:18px;font-size:17px;font-weight:600;box-sizing:border-box}
body:not(.ready) .drop .pill::before{content:"";width:24px;height:24px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='14' height='14' rx='2.5'/%3E%3Cpath d='M4 16l4-4 3 3 2-2 4 4'/%3E%3Cpath d='M19 3v6M16 6h6'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='14' height='14' rx='2.5'/%3E%3Cpath d='M4 16l4-4 3 3 2-2 4 4'/%3E%3Cpath d='M19 3v6M16 6h6'/%3E%3C/svg%3E") center/contain no-repeat}

/* desktop landing (>=900px): wide page like the editor, a real drop target */
@media(min-width:900px){
  body:not(.ready) .wrap{max-width:1120px}
  body:not(.ready) .drop{max-width:760px;width:100%;margin:28px auto 0;min-height:420px;padding:48px 40px;border:2px dashed var(--line);border-radius:28px;background:var(--panel);box-sizing:border-box}
  body:not(.ready) .drop:hover,body:not(.ready) .drop.over{border-color:var(--accent);background:rgba(0,122,255,.05)}
  body:not(.ready) .drop .icon{width:96px;height:96px;border-radius:28px;margin-bottom:20px}
  body:not(.ready) .drop .icon::after{inset:22px}
  body:not(.ready) .drop .big{font-size:28px}
  body:not(.ready) .drop .small{font-size:15px;max-width:480px;margin:10px 0 26px}
  body:not(.ready) .drop .pill{width:auto;min-width:340px}
  body .promo,body .wrap>.seo{max-width:760px;margin-left:auto;margin-right:auto}
}
@media(min-width:900px){
  .mcs-top{padding:0 max(20px,calc((100% - 1100px)/2));gap:10px}
  body.ready .mcs-tool,body.ready .mcs-lang{display:flex}
  body.ready .mcs-theme{display:flex;margin-left:6px}
  body.ready #mcsDl{margin-left:auto}
  .mcs-new{order:4;margin-left:6px}
  .mcs-newbtn{padding:0 16px;border:1px solid var(--line)!important;border-radius:22px!important;background:var(--panel)!important;box-shadow:var(--sh)!important;min-height:40px}
  .mcs-newt{display:inline}
  body.ready .mcs-lang{margin-left:0}
}


/* The bottom bar is a FIXED object: it must not move while the page scrolls (Osman, 2026-10-15).
   Every tool stylesheet has html,body{overflow-x:hidden}; with html non-visible that makes <body> a scroll container of
   its own, and Safari then lets fixed children drift with it. `clip` cuts the overflow without making a scroller, so the
   viewport is the only scroll container. The dock also gets its own compositor layer so it never repaints late. */
html body{overflow-x:clip!important}
.mcs-dock{-webkit-transform:translateZ(0);transform:translateZ(0);backface-visibility:hidden;-webkit-backface-visibility:hidden}

/* PILOT inner scroll (shell.js INNER_SCROLL): desktop >=1100px with a photo open. The window does not scroll, <body> does, so the
   side-rail ads do not react to scrolling. shell.js only adds the classes at that width; nothing here touches a phone. */
html.mcs-inner{height:100%;overflow:hidden}
html body.mcs-inner{height:100dvh;box-sizing:border-box;overflow:hidden auto!important;overscroll-behavior:contain}
html body.mcs-inner.ig-locked{overflow:hidden!important}
