/* ============================================================
   Leo Martins Studio — PORTRAIT layout
   ------------------------------------------------------------
   Everything here hangs off html.leo-portrait, set by leo-portrait.js
   when the screen is taller than it is wide. The desktop Studio is
   untouched: rotate the phone (or flip the layout switch) and the
   normal layout comes back exactly as it was.
   ============================================================ */
html.leo-portrait{--pt-cols:5;--pt-bar:52px;overflow-x:hidden;}
/* no horizontal scrolling anywhere: everything wraps or fits */
html.leo-portrait body,html.leo-portrait .mgr,html.leo-portrait .mgr-body,html.leo-portrait .mgr-main,
html.leo-portrait .mgr-scroll,html.leo-portrait .mgr-top{max-width:100%;overflow-x:hidden;}
/* reserve the scrollbar gutter so line widths never shift with list length */
html.leo-portrait .mgr-scroll,html.leo-portrait .mgr-main,html.leo-portrait .mgr-body{scrollbar-gutter:stable;}
html.leo-portrait .mgr-seg{overflow-x:visible;flex-wrap:wrap;}
/* language chips: always ONE line, never wrapped, never scrolled */
html.leo-portrait .cp-langs,html.leo-portrait .bee-langs{flex-wrap:nowrap;overflow-x:visible;width:100%;gap:2px;}
html.leo-portrait .cp-lang,html.leo-portrait .bee-lang{flex:1 1 0;min-width:0;padding:8px 2px;font-size:10.5px;letter-spacing:.02em;text-align:center;}

/* ---------- top bar: brand + publish only ---------- */
html.leo-portrait .mgr-top{height:var(--pt-bar);padding:0 12px;gap:8px;}
html.leo-portrait .mgr-top-l{gap:10px;min-width:0;flex:1;}
html.leo-portrait .mgr-top-r{gap:8px;flex:none;}
html.leo-portrait .mgr-sections,html.leo-portrait .mgr-back span,html.leo-portrait .mgr-pubhint,
html.leo-portrait .mgr-top-r .mgr-backup,html.leo-portrait .mgr-top-r .mgr-test,
html.leo-portrait .mgr-side-h,html.leo-portrait .mgr-side-hint,html.leo-portrait .mgr-sort-label{display:none;}
html.leo-portrait .mgr-brand{font-size:13px;letter-spacing:.1em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff;cursor:pointer;}
html.leo-portrait .mgr-brand .mgr-brand-dash{display:none;}
html.leo-portrait .mgr-brand .mgr-brand-st{color:#fff;margin-left:.35em;}
html.leo-portrait .mgr-publish{width:44px;height:44px;padding:0;border-radius:50%;font-size:10px;letter-spacing:.06em;display:inline-flex;align-items:center;justify-content:center;flex:none;}
html.leo-portrait .mgr-top-r .mgr-gap-l{margin-left:0;order:1;}
html.leo-portrait .mgr-top-r .mgr-publish{order:2;}
html.leo-portrait .mgr-back{display:none;}

/* back to the section list — arrow, and the section name itself is a button */
.pt-crumb{display:none;}
html.leo-portrait .pt-crumb{display:flex;align-items:center;gap:7px;background:none;border:none;color:#f3efe6;font-family:var(--grot);font-size:13px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;padding:6px 2px;min-width:0;}
html.leo-portrait .pt-crumb svg{color:var(--orange);flex:none;}
html.leo-portrait .pt-crumb span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* ---------- section list (the portrait home screen) ---------- */
.pt-home{display:none;}
html.leo-portrait .pt-home{display:flex;flex-direction:column;flex:1;overflow-y:auto;padding:0 0 24px;}
html.leo-portrait .pt-home .pt-row:first-child{margin-top:auto;}
html.leo-portrait .pt-row{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;flex:none;background:none;border:none;border-bottom:1px solid rgba(255,255,255,.08);color:#f3efe6;padding:24px 18px;text-align:left;font-family:var(--grot);}
html.leo-portrait .pt-row:active{background:rgba(255,153,0,.1);}
html.leo-portrait .pt-row-n{font-size:22px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;}
html.leo-portrait .pt-row-c{font-size:14px;color:rgba(255,255,255,.42);font-weight:600;letter-spacing:.04em;white-space:nowrap;}
html.leo-portrait .pt-row-c b{color:var(--orange);font-weight:700;}
html.leo-portrait .pt-foot{display:flex;justify-content:center;gap:10px;padding:28px 18px 6px;flex-wrap:wrap;margin-top:auto;}
html.leo-portrait .pt-foot .mgr-backup,html.leo-portrait .pt-foot .mgr-test{display:inline-block;}
html.leo-portrait .pt-layout-sw{background:none;border:1px solid rgba(255,255,255,.2);color:rgba(255,255,255,.55);font-family:var(--grot);font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;padding:9px 14px;border-radius:4px;}

/* ---------- library ---------- */
html.leo-portrait .mgr-body{flex-direction:column;min-height:0;}
/* galleries: fixed bar — ALL · add · SPECIAL · GALLERIES dropdown */
html.leo-portrait .mgr-side{display:none;}
.pt-galbar{display:none;}
html.leo-portrait .pt-galbar{display:flex;align-items:center;gap:8px;padding:9px 12px;border-bottom:1px solid rgba(255,255,255,.1);flex:none;}
html.leo-portrait .pt-gb-sp{flex:1;}
html.leo-portrait .pt-gb-all{width:44px;height:44px;flex:none;border-radius:50%;background:var(--orange);border:1px solid var(--orange);color:#000;font-family:var(--grot);font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.5;}
html.leo-portrait .pt-gb-all.on{opacity:1;}
html.leo-portrait .pt-gb-add{width:44px;height:44px;min-height:44px;flex:none;border-radius:0;background:none;border:none;color:#fff;padding:0;display:flex;align-items:center;justify-content:center;}
html.leo-portrait .pt-gb-spec{flex:0 1 auto;max-width:38vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:10px 16px;border-radius:22px;background:none;border:1px solid #d8443a;color:#e8695f;font-family:var(--grot);font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;}
html.leo-portrait .pt-gb-spec.on{background:#d8443a;border-color:#d8443a;color:#fff;}
html.leo-portrait .pt-gb-dd{position:relative;flex:none;}
html.leo-portrait .pt-gb-gal{display:flex;align-items:center;gap:7px;padding:10px 14px;border-radius:22px;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.16);color:#f3efe6;font-family:var(--grot);font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;max-width:42vw;}
html.leo-portrait .pt-gb-gal span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
html.leo-portrait .pt-gb-gal svg{flex:none;color:var(--orange);transition:transform .18s;}
html.leo-portrait .pt-gb-gal.open svg{transform:rotate(180deg);}
html.leo-portrait .pt-gb-back{position:fixed;inset:0;z-index:40;}
html.leo-portrait .pt-gb-menu{position:absolute;top:calc(100% + 8px);right:0;z-index:41;min-width:240px;max-height:62vh;overflow-y:auto;background:#151312;border:1px solid rgba(255,255,255,.14);border-radius:10px;box-shadow:0 24px 60px rgba(0,0,0,.6);padding:5px;}
html.leo-portrait .pt-gb-item{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;padding:13px 12px;background:none;border:none;border-radius:7px;color:#f3efe6;font-family:var(--grot);font-size:13px;font-weight:600;letter-spacing:.06em;text-align:left;}
html.leo-portrait .pt-gb-item.on{background:var(--orange);color:#000;}
html.leo-portrait .pt-gb-item.off{color:rgba(255,255,255,.4);}
html.leo-portrait .pt-gb-n{font-size:12px;opacity:.6;font-variant-numeric:tabular-nums;}
html.leo-portrait .mgr-gal-wrap{flex:0 0 auto;display:flex;}
html.leo-portrait .mgr-cat,html.leo-portrait .mgr-gal-wrap .mgr-cat{flex:0 0 auto;width:auto;padding:9px 14px;border-radius:20px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.12);margin:0;}
html.leo-portrait .mgr-gal-wrap .mgr-cat .mc-grip,html.leo-portrait .mgr-cat .mc-grip,
html.leo-portrait .mgr-gal-wrap .mgr-cat .mc-dot,html.leo-portrait .mgr-cat .mc-dot{display:none;}
html.leo-portrait .mgr-gal-wrap .mgr-cat .mc-name,html.leo-portrait .mgr-cat .mc-name{font-size:12px;white-space:nowrap;}
html.leo-portrait .mgr-cat.on,html.leo-portrait .mgr-gal-wrap .mgr-cat.on{background:var(--orange);border-color:var(--orange);}
html.leo-portrait .mgr-cat.on .mc-name,html.leo-portrait .mgr-gal-wrap .mgr-cat.on .mc-name{color:#000;}
html.leo-portrait .mgr-cat .mc-name{font-size:12px;white-space:nowrap;}
html.leo-portrait .mgr-cat .mc-actions,html.leo-portrait .mgr-cat .mc-slangs,
html.leo-portrait .mgr-gal-wrap .mgr-cat .mc-actions,html.leo-portrait .mgr-gal-wrap .mgr-cat .mc-slangs{display:none;}
html.leo-portrait .mgr-addcat{flex:0 0 auto;width:auto;padding:9px 14px;white-space:nowrap;margin:0;}
html.leo-portrait .mgr-newcat{flex:0 0 auto;width:220px;}
/* uploader collapses to one tap target in the strip */
html.leo-portrait .mgr-drop{flex:0 0 auto;width:auto;padding:9px 14px;margin:0;border-radius:20px;display:flex;align-items:center;gap:8px;}
html.leo-portrait .mgr-drop-icon svg{width:15px;height:15px;}
html.leo-portrait .mgr-drop-text{font-size:12px;white-space:nowrap;}
html.leo-portrait .mgr-drop-hint,html.leo-portrait .mgr-drop-size{display:none;}

html.leo-portrait .mgr-main{padding:12px 10px 90px;}
html.leo-portrait .mgr-filter{gap:10px;margin-bottom:12px;flex-wrap:wrap;overflow-x:visible;}
html.leo-portrait .mgr-filterbar{flex-wrap:wrap;overflow-x:visible;}
html.leo-portrait .mgr-filter>*{flex:1 1 100%;min-width:0;}
html.leo-portrait .mgr-filter-l{font-size:13px;width:100%;justify-content:space-between;}
html.leo-portrait .mgr-seg{flex-wrap:wrap;width:100%;padding-bottom:2px;}
html.leo-portrait .mgr-seg::-webkit-scrollbar{display:none;}
html.leo-portrait .mgr-seg-b{flex:0 0 auto;padding:9px 12px;font-size:11px;}

/* density: 5 → 3 → list */
html.leo-portrait .mgr-grid{grid-template-columns:repeat(var(--pt-cols),minmax(0,1fr));gap:5px;}
html.leo-portrait[data-pt-density="3"]{--pt-cols:3;}
html.leo-portrait[data-pt-density="3"] .mgr-grid{gap:8px;}
html.leo-portrait[data-pt-density="list"] .mgr-grid{display:flex;flex-direction:column;gap:0;}
html.leo-portrait[data-pt-density="list"] .mgr-tile{display:grid;grid-template-columns:58px 1fr;align-items:center;gap:12px;border:none;border-bottom:1px solid rgba(255,255,255,.08);border-radius:0;background:none;padding:8px 4px;}
html.leo-portrait[data-pt-density="list"] .mt-imgwrap{width:58px;height:58px;border-radius:5px;overflow:hidden;}
html.leo-portrait[data-pt-density="list"] .mt-meta{padding:0;}
/* at 5 across a thumb is fingertip-sized: no caption, no action bar — flags read as dots */
html.leo-portrait[data-pt-density="5"] .mt-info,html.leo-portrait[data-pt-density="5"] .mt-bar,
html.leo-portrait[data-pt-density="5"] .pgp-info,html.leo-portrait[data-pt-density="5"] .pgp-bar{display:none;}
html.leo-portrait[data-pt-density="5"] .pgp-tile{border-radius:4px;}
/* a page's online state reads as the same small dot the library uses */
html.leo-portrait .pgp-tile{position:relative;}
html.leo-portrait .pgp-tile::after{content:"";position:absolute;top:5px;right:5px;width:7px;height:7px;border-radius:50%;background:var(--orange);z-index:2;}
html.leo-portrait .pgp-tile.dim::after{background:rgba(255,255,255,.35);}
html.leo-portrait[data-pt-density="5"] .mgr-tile{border-radius:4px;}
html.leo-portrait .mt-flags{gap:3px;}
html.leo-portrait[data-pt-density="5"] .mt-flag{width:7px;height:7px;padding:0;border-radius:50%;font-size:0;overflow:hidden;text-indent:-999px;}
html.leo-portrait .mgr-tile{cursor:pointer;}
html.leo-portrait .mgr-tile:hover{transform:none;}

.pt-density{display:none;}
html.leo-portrait .pt-density{display:inline-flex;flex:0 0 auto;align-items:center;gap:6px;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.14);color:rgba(255,255,255,.72);font-family:var(--grot);font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;padding:9px 13px;border-radius:4px;}

/* ---------- photo editor: full-screen sheet ---------- */
html.leo-portrait .mgr-drawer-wrap{background:#15140f;}
html.leo-portrait .mgr-drawer{width:100%;max-width:100%;padding:16px 14px 100px;box-shadow:none;gap:16px;}
html.leo-portrait .md-head{position:sticky;top:-16px;background:#1c1b13;margin:-16px -14px 0;padding:16px 14px;z-index:2;border-bottom:1px solid rgba(255,255,255,.1);}
html.leo-portrait .md-head button{font-size:24px;padding:0 6px;}
html.leo-portrait .md-toggles{flex-wrap:wrap;}
html.leo-portrait .md-toggle{flex:1 1 46%;padding:14px 8px;}
html.leo-portrait .md-field input,html.leo-portrait .md-field textarea{font-size:16px;padding:13px 12px;}
html.leo-portrait .md-cat{padding:10px 14px;}
html.leo-portrait .md-row{flex-wrap:wrap;gap:10px;}
html.leo-portrait .md-row button{flex:1 1 auto;padding:13px 16px;}

/* ---------- text panels (CONTENT / ABOUT / PAGES / SOCIALS) ---------- */
html.leo-portrait .cp,html.leo-portrait .ab,html.leo-portrait .sp{padding:16px 14px 90px;}
html.leo-portrait .cp.cp-2col .cp-body{columns:1;}
html.leo-portrait .cp-field input,html.leo-portrait .cp-field textarea,
html.leo-portrait .ab-textcol textarea{font-size:16px;}
html.leo-portrait .ab .ab-grid{grid-template-columns:1fr;gap:24px;}
html.leo-portrait .ab-figcol{max-width:100%;}
html.leo-portrait .sp-row{flex-wrap:wrap;gap:8px;}
html.leo-portrait .cp-langs::-webkit-scrollbar,html.leo-portrait .bee-langs::-webkit-scrollbar{display:none;}

/* ---------- pages: same vocabulary as LIBRARY ---------- */
html.leo-portrait .pgp .cp-head{display:none;}
html.leo-portrait .pgp-pt-head{display:flex;align-items:center;gap:9px;padding:2px 0 10px;}
html.leo-portrait .pgp-pt-add{width:44px;height:44px;min-height:44px;max-height:44px;flex:none;border:none;background:none;color:#fff;padding:0;display:flex;align-items:center;justify-content:center;}
html.leo-portrait .pgp-pt-live{margin-left:auto;flex:none;background:none;border:none;padding:0 2px;color:rgba(255,255,255,.45);font-family:var(--grot);font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;}
html.leo-portrait .pgp-pt-live.on{color:var(--orange);}

/* ---------- blog ---------- */
.bp-row-cover{display:block;order:10;flex:none;width:40px;height:40px;border-radius:4px;overflow:hidden;background:#0d0b05;margin-left:12px;}
html.leo-portrait .bp-row-cover{display:block;order:10;flex:none;width:40px;height:40px;border-radius:4px;overflow:hidden;background:#0d0b05;margin-left:12px;}
.bp-row-cover-img,html.leo-portrait .bp-row-cover-img{width:100%;height:100%;object-fit:cover;display:block;}
html.leo-portrait .bp-row-headwrap .bp-row-dot{width:10px;height:10px;min-height:10px;max-height:10px;min-width:10px;border-radius:50%;padding:0;margin-left:12px;flex:none;}
html.leo-portrait .bp-pt-head{display:flex;align-items:center;gap:9px;margin-bottom:12px;}
html.leo-portrait .bp-pt-head .cp-title{font-size:17px;flex:none;}
html.leo-portrait .bp-pt-head .bp-pt-new{width:44px;height:44px;min-height:44px;max-height:44px;flex:none;border-radius:0;background:none;border:none;color:#fff;padding:0;display:flex;align-items:center;justify-content:center;}
html.leo-portrait .bp-pt-head .bp-search-wrap{flex:1 1 auto;min-width:0;}
html.leo-portrait .bp-pt-head .bp-search{width:100%;min-width:0;}
html.leo-portrait .bp-pt-online{flex:none;background:none;border:none;padding:0 2px;color:rgba(255,255,255,.45);font-family:var(--grot);font-size:11px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;}
html.leo-portrait .bp-pt-online.on{color:var(--orange);}
html.leo-portrait .bp-toolbar:empty{display:none;}
html.leo-portrait .bp-row{flex-wrap:wrap;}
html.leo-portrait .bp-post{padding:14px;}
html.leo-portrait .bee-overlay{padding:0;}
html.leo-portrait .bee-shell{width:100%;height:100%;max-width:100%;max-height:100%;border-radius:0;}
html.leo-portrait .bee-head{flex-wrap:wrap;gap:8px;padding:10px 12px;}
html.leo-portrait .bee-head-mid{order:3;flex-basis:100%;}
html.leo-portrait .bee-title{font-size:17px;}
html.leo-portrait .bee-langs{order:4;flex-basis:100%;}
html.leo-portrait .bee-body{flex-direction:column;}
/* one job at a time: TEXT / LAYOUT / COVER */
html.leo-portrait .bee-write,html.leo-portrait .bee-preview{width:100%;flex:1;height:auto;min-height:0;border:none;}
html.leo-portrait .bee-body[data-pt-tab="text"] .bee-preview,
html.leo-portrait .bee-body[data-pt-tab="layout"] .bee-write,
html.leo-portrait .bee-body[data-pt-tab="cover"] .bee-write>*:not(.bee-cover),
html.leo-portrait .bee-body[data-pt-tab="cover"] .bee-preview{display:none;}
html.leo-portrait .bee-body[data-pt-tab="text"] .bee-cover{display:none;}
html.leo-portrait .bee-textarea{font-size:16px;min-height:46vh;}
html.leo-portrait .bee-sizenote{display:none;}
.pt-tabs{display:none;}
html.leo-portrait .pt-tabs{display:flex;flex:none;border-bottom:1px solid rgba(255,255,255,.1);background:#19180f;}
html.leo-portrait .pt-tab{flex:1;background:none;border:none;border-bottom:2px solid transparent;color:rgba(255,255,255,.5);font-family:var(--grot);font-size:11.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;padding:14px 6px;}
html.leo-portrait .pt-tab.on{color:var(--orange);border-bottom-color:var(--orange);}

/* LAYOUT tab: a block list, not a live preview — a phone can't show both */
html.leo-portrait .bee-preview-paper{padding:12px 10px 90px;}
html.leo-portrait .bee-gap{min-height:0;opacity:1;}
html.leo-portrait .bee-gap-acts{display:flex;gap:8px;}
html.leo-portrait .bee-gap-acts button{flex:1;padding:11px 8px;font-size:11px;}
html.leo-portrait .bee-imgbar{position:static;flex-wrap:wrap;gap:8px;padding:10px;}
html.leo-portrait .bee-imgbar-grip{display:none;}
html.leo-portrait .bee-imgbar-seg{flex-wrap:wrap;}
html.leo-portrait .bee-imgbar-b{padding:9px 11px;}
html.leo-portrait .bee-imgbar-w{flex-basis:100%;}

/* blocks mode: paragraphs shrink to two-line stubs so a whole post fits the screen */
html.leo-portrait .bee-body[data-pt-mode="blocks"] .op-post-text p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:13px;line-height:1.5;margin:0 0 6px;color:rgba(255,255,255,.6);}
html.leo-portrait .bee-body[data-pt-mode="blocks"] .op-post-text{border-left:2px solid rgba(255,255,255,.12);padding-left:10px;margin:8px 0;}
html.leo-portrait .bee-body[data-pt-mode="blocks"] .op-post-fig,
html.leo-portrait .bee-body[data-pt-mode="blocks"] .bee-fig{width:100%!important;max-width:100%!important;float:none!important;margin:10px 0!important;}
html.leo-portrait .bee-body[data-pt-mode="blocks"] .op-post-img-el{max-height:34vh;object-fit:cover;}
html.leo-portrait .bee-body[data-pt-mode="blocks"] .op-post-title{font-size:20px;}
.pt-preview-sw{display:none;}
html.leo-portrait .pt-preview-sw{display:block;width:100%;flex:none;background:rgba(255,153,0,.12);border:none;border-bottom:1px solid rgba(255,153,0,.28);color:var(--orange);font-family:var(--grot);font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;padding:12px 10px;}

/* ---------- batch bar, toasts, sheets clear of the home indicator ---------- */
html.leo-portrait .bsel-bar{flex-wrap:wrap;gap:8px;padding:10px 12px calc(10px + env(safe-area-inset-bottom));}
html.leo-portrait .mgr-toast{bottom:calc(76px + env(safe-area-inset-bottom));width:calc(100% - 32px);text-align:center;}
html.leo-portrait .mgr-restore-box{width:calc(100% - 28px);max-width:none;}

/* ---------- Done bar: dismisses the keyboard from a full-screen sheet ---------- */
.pt-donebar{display:none;}
html.leo-portrait .pt-donebar{display:flex;position:fixed;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:200;}
html.leo-portrait .pt-done{background:var(--orange);color:#000;border:none;border-radius:22px;font-family:var(--grot);font-size:12px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;padding:13px 24px;box-shadow:0 8px 24px rgba(0,0,0,.5);}

/* every tap target on a phone clears 44px */
html.leo-portrait .mgr button,html.leo-portrait .mgr-drawer button,html.leo-portrait .bee-shell button{min-height:38px;}
html.leo-portrait .mini-solid,html.leo-portrait .mini-ghost,html.leo-portrait .mini-danger{padding:11px 16px;}
