/* ═══════════════ ALL-DEVICE SCREEN FIT (additive only — nothing above is changed) ═══════════════ */
.m-root.m-mgr{-webkit-text-size-adjust:100%;text-size-adjust:100%}
.m-root.m-mgr{overflow-x:hidden}
.m-mgr .main{min-width:0;max-width:100%}
.m-mgr .content{min-width:0}
.m-mgr .sidebar{height:100dvh}
.m-mgr .panel{max-width:100%}
.m-mgr .panel-head{flex-wrap:wrap}
.m-mgr .tab-row{flex-wrap:wrap}
.m-mgr .topbar > div:first-child{min-width:0}
.m-mgr .topbar-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.m-mgr .an-search{max-width:100%}
.m-mgr .modal{max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);display:flex;flex-direction:column}
.m-mgr .modal-body{overflow-y:auto;-webkit-overflow-scrolling:touch}
.m-mgr .mobile-nav-inner{overflow-x:auto;scrollbar-width:none}
.m-mgr .mobile-nav-inner::-webkit-scrollbar{display:none}
.m-mgr .mnav-btn{flex-shrink:0}
.m-mgr .content.pv-locked{height:calc(100dvh - 54px)}

/* Very large / ultra-wide screens */
@media(min-width:1700px){
  .m-mgr .content{max-width:1500px;width:100%;margin-left:auto;margin-right:auto}
  .m-mgr .content.pv-locked{max-width:none}
}

/* Tablets & small laptops */
@media(min-width:769px) and (max-width:1100px){
  .m-mgr .sidebar{width:196px}
  .m-mgr .main{margin-left:196px}
  .m-mgr .content{padding:20px 20px}
  .m-mgr .topbar{padding:0 20px}
  .m-mgr [style*="grid-template-columns:1fr 1fr 1fr"]{grid-template-columns:1fr 1fr !important}
}
@media(min-width:769px) and (max-width:900px){
  .m-mgr .save-indicator{display:none}
  .m-mgr .stats-row{grid-template-columns:repeat(2,1fr)}
  .m-mgr .screen-size-grid{grid-template-columns:repeat(2,1fr)}
}

/* Phones & small tablets (portrait) */
@media(max-width:768px){
  .m-mgr .sidebar{height:100dvh}
  .m-mgr .sidebar.mobile-open{width:min(260px,85vw)}
  .m-mgr .content{padding-bottom:calc(90px + env(safe-area-inset-bottom,0px))}
  .m-mgr .content.pv-locked{padding:0;height:calc(100dvh - 54px - 64px)}
  .m-mgr .save-indicator{display:none}
  .m-mgr .topbar-actions{gap:6px}
  .m-mgr [style*="grid-template-columns:1fr 1fr"]{grid-template-columns:1fr !important}
  .m-mgr .xp-grid,.m-mgr #earn-placements{grid-template-columns:1fr}
  .m-mgr .form-group input,.m-mgr .form-group textarea,.m-mgr .form-group select,.m-mgr #tmdb-query,.m-mgr #yt-query,.m-mgr #yt-direct-input,.m-mgr .an-search,.m-mgr .ss-custom-row input,.m-mgr .cm-ad-form input{font-size:16px}
  .m-mgr #admin-toast{left:12px;right:12px;bottom:calc(78px + env(safe-area-inset-bottom,0px));text-align:center}
  .m-mgr .an-chart-wrap{height:220px}
  .m-mgr #cz-frame{height:clamp(420px,70vh,640px)}
  .m-mgr .modal-backdrop{padding:12px}
  .m-mgr .modal-head,.m-mgr .modal-body,.m-mgr .modal-footer{padding-left:16px;padding-right:16px}
  .m-mgr .modal-footer{flex-wrap:wrap}
  .m-mgr .panel-head{padding:14px 16px}
  .m-mgr .panel-body{padding:16px}
  .m-mgr .cm-row{padding:11px 12px}
}

/* Small phones */
@media(max-width:480px){
  .m-mgr .topbar-actions .btn{padding:6px 10px}
  .m-mgr #topbar-sync-badge{padding:5px 9px !important}
  .m-mgr .stat-card{padding:13px 14px}
  .m-mgr .tab{padding:6px 14px}
  .m-mgr .form-group[style*="min-width:200px"],.m-mgr .form-group[style*="min-width:150px"]{min-width:0 !important;flex-basis:100%}
  .m-mgr .cm-ad-form input{min-width:0}
  .m-mgr .panel-head .btn{padding:6px 10px}
}
@media(max-width:380px){
  .m-mgr #topbar-sync-text{display:none}
  .m-mgr .content{padding-left:10px;padding-right:10px}
  .m-mgr .topbar{padding:0 10px}
  .m-mgr .mnav-btn{padding:6px 8px}
  .m-mgr #tmdb-results{grid-template-columns:repeat(auto-fill,minmax(100px,1fr)) !important}
  .m-mgr .lock-box{padding:26px 20px}
}

/* Landscape phones / short screens */
@media(max-height:560px){
  .m-mgr #lock-screen{justify-content:flex-start;overflow-y:auto;padding:16px 0}
  .m-mgr .lock-logo{margin:0 0 16px}
  .m-mgr .lock-box{margin:auto 0}
  .m-mgr .modal{max-height:calc(100vh - 16px);max-height:calc(100dvh - 16px)}
}

/* Touch screens: bigger tap targets */
@media(pointer:coarse){
  .m-mgr .row-btn{width:36px;height:36px}
  .m-mgr .modal-close{width:34px;height:34px}
  .m-mgr .nav-btn{padding:11px 12px}
  .m-mgr .conn-toggle input{width:20px;height:20px}
}

/* ── SITE STATUS ── */
.m-mgr .st-badge{display:inline-flex;align-items:center;gap:6px;font-size:0.62rem;font-weight:700;letter-spacing:0.12em;text-transform:uppercase;padding:4px 12px;border-radius:20px;border:1px solid var(--border2);color:var(--muted)}
.m-mgr .st-badge.live{color:var(--green);border-color:rgba(80,220,130,0.35);background:rgba(80,220,130,0.06)}
.m-mgr .st-badge.maint{color:var(--yellow);border-color:rgba(255,200,60,0.35);background:rgba(255,200,60,0.06)}
.m-mgr .st-badge.err{color:rgba(255,120,120,0.95);border-color:rgba(255,80,80,0.35);background:rgba(255,80,80,0.06)}
.m-mgr #st-mode{appearance:none;-webkit-appearance:none;cursor:pointer;padding-right:38px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center}
.m-mgr .st-spin{display:none;width:13px;height:13px;border:2px solid rgba(255,255,255,0.25);border-top-color:#fff;border-radius:50%;animation:m-mgr-stSpin .7s linear infinite}
.m-mgr .btn.loading .st-spin{display:inline-block}
@keyframes m-mgr-stSpin{to{transform:rotate(360deg)}}
.m-mgr .st-result{display:none;font-size:0.76rem;line-height:1.6;padding:12px 14px;border-radius:12px;border:1px solid var(--border2)}
.m-mgr .st-result.ok{display:block;color:var(--green);border-color:rgba(80,220,130,0.35);background:rgba(80,220,130,0.06)}
.m-mgr .st-result.bad{display:block;color:rgba(255,120,120,0.95);border-color:rgba(255,80,80,0.35);background:rgba(255,80,80,0.06)}
/* ── REPOSITORY TABS (Add Mode · Edit Files · Live Preview) — new, uses the same theme variables ── */
.m-mgr .rp-notice{display:none;margin:0 0 14px;padding:12px 14px;border-radius:12px;border:1px solid rgba(255,200,60,0.35);background:rgba(255,200,60,0.06);color:var(--yellow);font-size:0.74rem;line-height:1.6}
.m-mgr #lp-notice{margin:14px}
.m-mgr .rp-drop{border:1px dashed var(--border2);border-radius:14px;padding:30px 16px;text-align:center;font-size:0.8rem;color:rgba(255,255,255,0.55);cursor:pointer;background:rgba(255,255,255,0.02);transition:all .15s}
.m-mgr .rp-drop:hover,.m-mgr .rp-drop.over{border-color:rgba(255,255,255,0.4);background:rgba(255,255,255,0.06);color:#fff}
.m-mgr .rp-drop small{display:block;margin-top:6px;font-size:0.66rem;color:rgba(255,255,255,0.3)}
.m-mgr #add-list{display:flex;flex-direction:column;gap:6px}
.m-mgr .rp-sel-item{display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--border);border-radius:10px;background:rgba(255,255,255,0.02);font-size:0.76rem}
.m-mgr .rp-sel-item .n{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:rgba(255,255,255,0.8)}
.m-mgr .rp-sel-item .s{color:rgba(255,255,255,0.3);font-size:0.66rem;flex-shrink:0}
.m-mgr .rp-split{display:grid;grid-template-columns:300px minmax(0,1fr);gap:18px;align-items:start}
.m-mgr .rp-split .panel{margin-bottom:0}
.m-mgr .rp-files{display:flex;flex-direction:column;gap:2px;max-height:62vh;overflow-y:auto}
.m-mgr .rp-file{display:block;width:100%;text-align:left;padding:7px 10px;border-radius:8px;border:1px solid transparent;background:transparent;color:rgba(255,255,255,0.65);font-size:0.74rem;word-break:break-all;line-height:1.4;transition:all .15s}
.m-mgr .rp-file:hover{background:rgba(255,255,255,0.06);color:#fff}
.m-mgr .rp-file.active{background:rgba(255,255,255,0.1);border-color:var(--border2);color:#fff}
.m-mgr .rp-file.bin{opacity:.35;cursor:not-allowed}
.m-mgr .rp-file .d{color:rgba(255,255,255,0.3)}
.m-mgr .rp-empty{padding:14px 8px;font-size:0.72rem;color:rgba(255,255,255,0.35);line-height:1.7}
.m-mgr .rp-editor{width:100%;min-height:420px;height:58vh;resize:vertical;background:rgba(0,0,0,0.35);border:1px solid var(--border2);border-radius:12px;padding:12px 14px;color:#fff;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:0.76rem;line-height:1.6;tab-size:2;white-space:pre;overflow:auto;outline:none}
.m-mgr .rp-editor:focus{border-color:rgba(255,255,255,0.35)}
.m-mgr .rp-editor:disabled{opacity:.5}
.m-mgr .rp-frame-wrap{position:relative;height:calc(100vh - 54px - 170px);height:calc(100dvh - 54px - 170px);min-height:420px;background:#000;overflow:hidden}
.m-mgr #lp-frame{border:0;width:100%;height:100%;background:#fff}
.m-mgr #lp-select{width:auto;min-width:200px;max-width:100%}
.m-mgr #lp-select option{background:#111;color:#fff}
.m-mgr #add-result,.m-mgr #ef-result{white-space:pre-wrap}
@media(max-width:900px){.m-mgr .rp-split{grid-template-columns:1fr}.m-mgr .rp-files{max-height:34vh}.m-mgr .rp-editor{font-size:16px;height:50vh}}
/* ── GITHUB MULTI-REPOSITORY (new — same theme variables) ── */
.m-mgr .nb-t{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.m-mgr .gh-repos{display:flex;flex-direction:column;gap:6px;max-height:60vh;overflow-y:auto}
.m-mgr .gh-repo{display:flex;align-items:center;gap:12px;padding:10px 14px;border:1px solid var(--border);border-radius:12px;background:rgba(255,255,255,0.02);cursor:pointer;transition:border-color .15s}
.m-mgr .gh-repo:hover{border-color:rgba(255,255,255,0.22)}
.m-mgr .gh-repo.open{border-color:rgba(80,220,130,0.35);background:rgba(80,220,130,0.04)}
.m-mgr .gh-repo input{width:16px;height:16px;accent-color:#fff;cursor:pointer;flex-shrink:0}
.m-mgr .gh-repo .n{flex:1;min-width:0;font-size:0.8rem;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.m-mgr .gh-repo .s{font-size:0.62rem;color:var(--muted);flex-shrink:0}
.m-mgr .st-result{white-space:pre-wrap}
.m-mgr a.btn{text-decoration:none}
.m-mgr .lp-frame{border:0;width:100%;height:100%;background:#fff}
.m-mgr .lp-select{width:auto;min-width:200px;max-width:100%}
.m-mgr .lp-select option{background:#111;color:#fff}
.m-mgr .lp-notice{margin:14px}
.m-mgr .sc-row{display:flex;align-items:center;gap:10px;padding:9px 12px;border:1px solid var(--border);border-radius:10px;background:rgba(255,255,255,0.02);font-size:0.76rem}
.m-mgr .sc-row.done{opacity:.45}
.m-mgr .sc-row .n{flex:1;min-width:0;color:rgba(255,255,255,0.8);line-height:1.5}
.m-mgr .sc-row .s{color:rgba(255,255,255,0.35);font-size:0.66rem;flex-shrink:0;text-align:right}
.m-mgr a.cm-row{display:block;padding:9px 12px;border:1px solid var(--border);border-radius:10px;background:rgba(255,255,255,0.02);margin-bottom:6px;font-size:0.76rem;line-height:1.5;color:rgba(255,255,255,0.8)}
.m-mgr a.cm-row:hover{border-color:rgba(255,255,255,0.25)}
.m-mgr a.cm-row small{display:block;color:rgba(255,255,255,0.32);font-size:0.64rem}
@media(max-width:768px){.m-mgr .sc-row{flex-wrap:wrap}}
.m-mgr .st-sel{appearance:none;-webkit-appearance:none;cursor:pointer;padding-right:38px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 14px center}

/* ── MOBILE / TOUCH SCREEN IMPROVEMENTS (phones & tablets) ── */
.m-root.m-mgr{-webkit-tap-highlight-color:transparent}
.m-mgr button,.m-mgr .btn,.m-mgr .tab,.m-mgr .nav-btn,.m-mgr .mnav-btn,.m-mgr .gh-repo,.m-mgr .rp-drop,.m-mgr .rp-file{touch-action:manipulation}
.m-mgr .st-result,.m-mgr .sc-row .n,.m-mgr a.cm-row,.m-mgr .gh-repo .n,.m-mgr .panel-title,.m-mgr .rp-sel-item .n{overflow-wrap:anywhere}
.m-mgr .panel,.m-mgr .panel-body{min-width:0;max-width:100%}
@media(max-width:768px){
  /* bottom bar: scrolls sideways and the first button stays reachable */
  .m-mgr .mobile-nav-inner{justify-content:flex-start;gap:4px;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity}
  .m-mgr .mnav-btn{min-width:62px;max-width:92px;white-space:nowrap;scroll-snap-align:center}
  /* repository sub tabs: one scrollable row instead of wrapping */
  .m-mgr .tab-row{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding-bottom:4px}
  .m-mgr .tab-row::-webkit-scrollbar{display:none}
  .m-mgr .tab-row .tab{flex-shrink:0;white-space:nowrap;padding:9px 16px}
  /* headers, search boxes, selects use the full width */
  .m-mgr .panel-head{align-items:flex-start;gap:8px}
  .m-mgr .panel-head > div{max-width:100%}
  .m-mgr .panel-head .an-search,.m-mgr .lp-select{width:100%;min-width:0}
  .m-mgr .panel-head > div[style*="align-items:center"]{width:100%}
  /* big, easy to tap buttons */
  .m-mgr #sec-github .panel-body > div[style*="display:flex"] > .btn,
  .m-mgr #sec-allmode .panel-body > div[style*="display:flex"] > .btn,
  .m-mgr #sec-allstatus .panel-body > div[style*="display:flex"] > .btn,
  .m-mgr #repo-sections .panel-body > div[style*="display:flex"] > .btn{flex:1 1 calc(50% - 8px);justify-content:center;text-align:center;min-height:44px;padding:10px}
  .m-mgr .gh-repo{padding:13px 14px}
  .m-mgr .gh-repo input{width:20px;height:20px}
  .m-mgr .gh-repos{max-height:55vh}
  /* editor, files, preview fit the phone screen */
  .m-mgr .rp-editor{min-height:300px}
  .m-mgr .rp-files{max-height:30vh}
  .m-mgr .rp-frame-wrap{height:calc(100dvh - 54px - 64px - 150px);min-height:360px}
  .m-mgr .rp-drop{padding:26px 12px}
  .m-mgr .sc-row .s{text-align:left}
  .m-mgr .topbar-title{max-width:62vw}
}
@media(max-width:480px){
  .m-mgr .gh-repo{flex-wrap:wrap}
  .m-mgr .gh-repo .s{width:100%;padding-left:32px}
  .m-mgr .rp-notice{font-size:0.7rem}
}

/* ── DASHBOARD ── */
.m-mgr .db-row{padding:14px 16px;border:1px solid var(--border);border-radius:14px;background:rgba(255,255,255,0.02);display:flex;flex-direction:column;gap:9px}
.m-mgr .db-top{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.m-mgr .db-name{background:none;border:none;color:#fff;font-size:0.86rem;font-weight:600;text-align:left;cursor:pointer;padding:0;overflow-wrap:anywhere}
.m-mgr .db-name:hover{text-decoration:underline}
.m-mgr .db-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:4px 18px;font-size:0.7rem;color:rgba(255,255,255,0.45);line-height:1.6;overflow-wrap:anywhere}
.m-mgr .db-meta b{color:rgba(255,255,255,0.75);font-weight:600}
.m-mgr .db-meta .warn,.m-mgr .db-meta .warn b{color:rgba(255,120,120,0.95)}
