:root{
  --bg:#181818;--card:#242424;--text:#f5f5f5;--blue:#3a86ff;--red:#d62828;
  --green:#16a34a;--orange:#e07b00;--border:#333;
}
body{margin:0;background:var(--bg);color:var(--text);font-family:'Roboto',sans-serif;padding:10px;}
.container{max-width:900px;margin:auto;}
.card{background:var(--card);border:1px solid var(--border);border-radius:10px;padding:15px;margin-bottom:15px;}
h1{text-align:center;font-family:'Oswald',sans-serif;}
.tabs{display:flex;gap:10px;margin-bottom:15px;}
.tab{flex:1;background:#111;border:none;padding:12px;color:white;border-radius:8px;cursor:pointer;font-family:'Oswald',sans-serif;font-size:14px;display:flex;align-items:center;justify-content:center;gap:7px;}
.active{background:var(--blue);}.tab.orange-active{background:var(--orange);}
label{display:block;margin-top:10px;margin-bottom:6px;}
input,textarea,select{width:100%;box-sizing:border-box;padding:12px;margin-bottom:12px;background:#111;border:1px solid #444;color:white;border-radius:8px;}
input[readonly]{background:#0c0c0c;color:#aaa;opacity:.85;cursor:default;}
textarea{min-height:120px;}
.row{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.btn{border:none;padding:12px;border-radius:8px;cursor:pointer;color:white;font-family:'Oswald',sans-serif;display:inline-flex;align-items:center;justify-content:center;gap:7px;}
.blue{background:var(--blue);}.red{background:var(--red);}.green{background:var(--green);}.orange{background:var(--orange);}
.volume-box{background:#111;border:1px solid #333;padding:10px;border-radius:8px;margin-top:10px;}
.volume-box .vol-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;}
.volume-box .vol-label{font-family:'Oswald',sans-serif;font-size:14px;display:flex;align-items:center;gap:8px;}
.vol-num-input{width:70px!important;padding:6px 8px!important;margin-bottom:0!important;font-size:13px;display:inline-block;}
.hidden{display:none!important;}
.success{background:#0f5132;padding:12px;border-radius:8px;margin-top:10px;display:none;align-items:center;gap:8px;}
.preview{max-width:180px;border-radius:10px;margin-top:10px;}
.button-row{display:flex;gap:10px;}
#scheduleList{display:flex;flex-direction:column;gap:12px;}
.sched-item{background:#111;border:1px solid #333;border-radius:10px;padding:14px;display:flex;align-items:center;gap:12px;}
.sched-cover{width:52px;height:72px;object-fit:cover;border-radius:6px;flex-shrink:0;background:#222;}
.sched-cover-placeholder{width:52px;height:72px;border-radius:6px;flex-shrink:0;background:#2a2a2a;display:flex;align-items:center;justify-content:center;}
.sched-info{flex:1;min-width:0;}
.sched-title{font-family:'Oswald',sans-serif;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.sched-subtitle{font-size:11px;color:#888;margin-top:2px;}
.sched-time{font-size:12px;color:#aaa;margin-top:4px;display:flex;align-items:center;gap:5px;}
.sched-countdown{font-size:12px;margin-top:4px;display:flex;align-items:center;gap:5px;}
.countdown-soon{color:#f59e0b;}.countdown-ok{color:#60a5fa;}
.sched-badge{font-size:11px;padding:3px 8px;border-radius:20px;font-family:'Oswald',sans-serif;flex-shrink:0;display:inline-flex;align-items:center;gap:4px;}
.badge-pending{background:#1e3a5f;color:#60a5fa;}.badge-pushed{background:#14532d;color:#4ade80;}.badge-failed{background:#450a0a;color:#f87171;}
.sched-actions{display:flex;flex-direction:column;gap:6px;flex-shrink:0;}
.sched-btn{border:none;padding:6px 12px;border-radius:6px;cursor:pointer;color:white;font-family:'Oswald',sans-serif;font-size:12px;display:inline-flex;align-items:center;justify-content:center;gap:5px;}
.empty-state{text-align:center;padding:40px;color:#555;font-family:'Oswald',sans-serif;font-size:18px;}
#schedDatetimeRow{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
#editSchedDatetimeRow{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.info-box{background:#111;border:1px solid #333;border-radius:8px;padding:10px;font-size:13px;color:#aaa;margin-bottom:12px;display:flex;align-items:flex-start;gap:8px;}
.info-box svg{flex-shrink:0;margin-top:1px;}.info-box span{color:#60a5fa;}
.section-heading{display:flex;align-items:center;gap:8px;font-family:'Oswald',sans-serif;margin:0 0 10px;}
.card-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;}
.type-tag{font-size:10px;padding:2px 7px;border-radius:12px;font-family:'Oswald',sans-serif;vertical-align:middle;margin-left:6px;}
.tag-new{background:#1e3a5f;color:#60a5fa;}.tag-edit{background:#3b2007;color:#fb923c;}
.tag-editing{background:#3b0764;color:#c084fc;}

/* ══ Telegram toggle ══ */
.telegram-toggle-row{display:flex;align-items:center;gap:10px;background:#111;border:1px solid #333;border-radius:8px;padding:12px;margin-top:10px;}
.telegram-toggle-row input[type="checkbox"]{width:auto;margin:0;flex-shrink:0;accent-color:#3a86ff;transform:scale(1.2);}
.telegram-toggle-row label{margin:0;cursor:pointer;font-size:14px;display:flex;align-items:center;gap:8px;flex:1;}
.telegram-toggle-row svg{flex-shrink:0;opacity:.8;color:#60a5fa;}

/* ══ Telegram delay ══ */
.telegram-delay-row{background:#111;border:1px solid #333;border-radius:8px;padding:12px;margin-top:8px;}
.telegram-delay-row .delay-head{display:flex;align-items:center;gap:8px;font-size:14px;margin-bottom:8px;}
.telegram-delay-row .delay-head svg{flex-shrink:0;opacity:.8;color:#60a5fa;}
.telegram-delay-row .delay-input-wrap{display:flex;align-items:center;gap:8px;}
.telegram-delay-row input[type="number"]{margin-bottom:0;max-width:110px;}
.telegram-delay-row .delay-unit{font-size:12px;color:#888;white-space:nowrap;}
.telegram-queue-status{font-size:11px;color:#888;margin-top:8px;display:flex;align-items:center;gap:5px;}
.telegram-queue-status.has-pending{color:#f59e0b;}

/* ══ GitHub Files tab ══ */
#filesSection{
  --gh-bg:#0d1117;--gh-surface:#161b22;--gh-surface2:#0d1117;
  --gh-border:#30363d;--gh-hover:#1c2128;
  --gh-text:#e6edf3;--gh-muted:#8b949e;
  --gh-blue:#58a6ff;--gh-green:#238636;--gh-green-hover:#2ea043;
  --gh-red:#da3633;--gh-orange:#e3b341;
}
#filesSection .card{background:var(--gh-surface);border-color:var(--gh-border);border-radius:10px;}
#filesSection .card-header{padding:14px 14px 0;}
#filesSection .btn.green{background:var(--gh-green);}
#filesSection .btn.green:active{background:var(--gh-green-hover);}
#filesSection .btn.red{background:var(--gh-red);}
#filesSection .btn.blue{background:var(--gh-blue);color:#0d1117;}
#filesSection input{background:var(--gh-bg);border:1px solid var(--gh-border);color:var(--gh-text);border-radius:8px;}
#filesSection input:focus{outline:none;border-color:var(--gh-blue);box-shadow:0 0 0 3px rgba(88,166,255,.15);}
#filesSection .info-box{background:var(--gh-bg);border-color:var(--gh-border);}
#filesSection label{color:var(--gh-muted);font-size:12px;text-transform:uppercase;letter-spacing:.03em;}
#filesSection .section-heading{color:var(--gh-text);}

.gh-searchbar{position:relative;}
.gh-searchbar svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);opacity:.55;pointer-events:none;}
.gh-searchbar input{padding-left:36px!important;background:var(--gh-bg);}

.gh-breadcrumb{display:flex;align-items:center;gap:2px;overflow-x:auto;white-space:nowrap;padding:10px 4px;font-size:13px;-ms-overflow-style:none;scrollbar-width:none;}
.gh-breadcrumb::-webkit-scrollbar{display:none;}
.gh-breadcrumb .gh-crumb{color:var(--gh-blue);cursor:pointer;padding:4px 6px;border-radius:6px;flex-shrink:0;display:flex;align-items:center;gap:4px;}
.gh-breadcrumb .gh-crumb:active{background:var(--gh-hover);}
.gh-breadcrumb .gh-crumb.current{color:var(--gh-text);font-weight:600;cursor:default;}
.gh-breadcrumb .gh-sep{color:var(--gh-muted);flex-shrink:0;}
.gh-back-btn{display:flex;align-items:center;gap:4px;color:var(--gh-blue);font-size:13px;cursor:pointer;padding:4px 6px 4px 2px;flex-shrink:0;}
.gh-back-btn:active{opacity:.7;}
.gh-subline{font-size:12px;color:var(--gh-muted);padding:0 4px 8px;border-bottom:1px solid var(--gh-border);margin-bottom:2px;}

#fileTree{border:1px solid var(--gh-border);border-radius:8px;overflow:hidden;background:var(--gh-surface);}
.gh-row{display:flex;align-items:center;gap:10px;padding:13px 12px;cursor:pointer;border-bottom:1px solid var(--gh-border);user-select:none;background:var(--gh-surface);}
.gh-row:last-child{border-bottom:none;}
.gh-row:active{background:var(--gh-hover);}
.gh-row.active{background:#0c2d4d;}
.gh-row .gh-icon{flex-shrink:0;}
.gh-row .gh-icon.folder{color:var(--gh-blue);}
.gh-row .gh-icon.file{color:var(--gh-muted);}
.gh-row .gh-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--gh-text);font-size:14.5px;}
.gh-row .gh-path-hint{display:block;font-size:11px;color:var(--gh-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.gh-row .gh-meta{color:var(--gh-muted);font-size:12px;flex-shrink:0;margin-left:4px;}
.gh-row .gh-chevron{color:var(--gh-muted);flex-shrink:0;opacity:.7;}
.gh-empty{padding:34px 16px;text-align:center;color:var(--gh-muted);font-size:13px;}

.gh-filepath{display:flex;align-items:center;gap:6px;min-width:0;font-size:14px;color:var(--gh-text);}
.gh-filepath .seg-muted{color:var(--gh-muted);}
.gh-filepath .seg-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;}

.gh-actionbar{display:flex;gap:8px;overflow-x:auto;padding:2px 0 4px;-ms-overflow-style:none;scrollbar-width:none;}
.gh-actionbar::-webkit-scrollbar{display:none;}
.gh-icon-btn{width:36px;height:36px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;border:1px solid var(--gh-border);background:var(--gh-bg);color:var(--gh-text);cursor:pointer;}
.gh-icon-btn:active{background:var(--gh-hover);}
.gh-icon-btn.danger{color:#ffa198;border-color:#5c2222;}
.gh-icon-btn.accent{color:var(--gh-blue);border-color:#1a3a5c;}
/* danger-clear = orangey clear button */
.gh-icon-btn.danger-clear{color:#fb923c;border-color:#5c3007;}

/* ── Native code textarea editor ── */
#codeEditor{
  width:100%;box-sizing:border-box;
  height:420px;resize:vertical;
  background:#0d1117;color:#e6edf3;
  border:1px solid var(--gh-border,#30363d);border-radius:8px;
  font-family:'Courier New',Courier,monospace;font-size:13px;line-height:1.6;
  padding:12px;tab-size:2;
  -webkit-user-select:text;user-select:text;
  /* no margin-bottom override — keep 0 inside editor wrap */
  margin-bottom:0;
  white-space:pre;overflow:auto;
  outline:none;
  caret-color:#58a6ff;
}
#codeEditor:focus{border-color:var(--gh-blue,#58a6ff);box-shadow:0 0 0 3px rgba(88,166,255,.15);}
#codeEditor::selection{background:#264f78;}
#codeEditor::-moz-selection{background:#264f78;}

#editorMeta{word-break:break-all;}
.fe-status-ok{background:#0f5132;color:#d1fae5;}
.fe-status-err{background:#450a0a;color:#fecaca;}
.fe-status-info{background:#1e3a5f;color:#bfdbfe;}

/* repo size pill */
.gh-repo-size{font-size:11px;background:#1c2128;border:1px solid var(--gh-border);color:var(--gh-muted);padding:3px 9px;border-radius:20px;font-family:'Oswald',sans-serif;display:inline-flex;align-items:center;gap:5px;}

/* ── Top header ── */
.rj-header{
  background:linear-gradient(135deg,#1a0000 0%,#2a0000 40%,#1a0505 100%);
  border-bottom:2px solid #d40000;
  padding:14px 18px;
  display:flex;align-items:center;justify-content:space-between;
  margin:-10px -10px 16px -10px;
  position:sticky;top:0;z-index:99;
}
.rj-header-left{display:flex;align-items:center;gap:12px;}
.rj-header-logo{
  width:36px;height:36px;border-radius:8px;
  background:#d40000;display:flex;align-items:center;justify-content:center;
  box-shadow:0 0 12px rgba(212,0,0,.5);flex-shrink:0;
}
.rj-header-title{font-family:'Oswald',sans-serif;font-size:20px;letter-spacing:.04em;color:#fff;line-height:1.1;}
.rj-header-sub{font-size:10px;color:#888;letter-spacing:.06em;text-transform:uppercase;margin-top:1px;}
.rj-header-right{display:flex;align-items:center;gap:10px;}
.rj-header-badge{font-size:10px;background:#d40000;color:#fff;padding:3px 9px;border-radius:20px;font-family:'Oswald',sans-serif;letter-spacing:.04em;}
.rj-header-time{font-size:11px;color:#666;font-family:'Roboto',sans-serif;}
