:root{
  --uiZoom: 1.25;
  --brand:#00A86B;
  --brand2:#19d18b;
  --bg:#071017;
  --card:#0c1722;
  --card2:#0a141e;
  --text:#eaf0ff;
  --muted:#9bb0c9;
  --border:rgba(255,255,255,.10);
  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --radius:18px;
  --danger:#ff6b7a;
  --warn:#ffd37a;
  --ok:#7CFFB2;
  --grad: linear-gradient(135deg, var(--brand) 0%, var(--brand2) 100%);
  --focus: rgba(0,168,107,.35);
  --pageMax: 100%;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: var(--text);
  min-height:100vh;
  font-size: 15px;
  background:
    radial-gradient(900px 520px at 18% 12%, rgba(0,168,107,.22) 0%, transparent 60%),
    radial-gradient(800px 520px at 86% 6%, rgba(25,209,139,.16) 0%, transparent 55%),
    linear-gradient(180deg, #050b10 0%, #071017 40%, #050b12 100%);
}
    .wrap{
      max-width: var(--pageMax);
      margin:0 auto;
      padding: 18px 18px 36px;
      min-height: 100vh;
    }

    /* Topbar */
    .topbar{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:12px;
      padding: 6px 2px 14px;
      flex-wrap:wrap;
    }
    .brand{
      display:flex;
      align-items:center;
      gap:10px;
      font-weight:900;
      font-size:19px; /* büyütüldü */
      letter-spacing:.2px;
    }
    .dot{
      width:12px;height:12px;border-radius:999px;
      background: var(--grad);
      box-shadow: 0 0 0 4px rgba(0,168,107,.14);
    }

    /* Cards */
    .card{
      background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,.03) 100%);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow);
      overflow:hidden;
      min-height: calc(100vh - 80px);
    }
    .card h2{
      margin:0;
      padding:16px 16px 10px;
      font-size:16px; /* büyütüldü */
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      flex-wrap:wrap;
    }
    .card h2 .mini{
      color:var(--muted);
      font-size:12.5px;
      font-weight:800;
    }
    .card .body{ padding: 0 16px 16px; }

    .subcard{
      border:1px solid rgba(255,255,255,.10);
      border-radius:16px;
      background: rgba(255,255,255,.035);
      overflow:hidden;
    }
    .subhead{
      padding:12px 12px 10px;
      border-bottom:1px solid rgba(255,255,255,.08);
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      flex-wrap:wrap;
    }
    .subhead .left{
      display:flex;
      flex-direction:column;
      gap:3px;
    }
    .subhead .left .h{ font-weight:950; font-size:14px; } /* büyütüldü */
    .subhead .left .s{ color:var(--muted); font-size:13px; line-height:1.35; } /* büyütüldü */
    .subbody{ padding: 12px; }

    .row{ display:flex; gap:10px; }
    .row > *{ flex:1; }
    @media (max-width: 720px){
      .row{ flex-direction:column; }
    }

    label{
      display:block;
      font-size:13px; /* büyütüldü */
      color: var(--muted);
      margin: 12px 0 6px;
    }
    input, select, textarea{
      width:100%;
      padding:12px 12px;
      border-radius:14px;
      border:1px solid rgba(255,255,255,.12);
      background: rgba(8,12,22,.55);
      color: var(--text);
      outline:none;
      font-size: 14.5px; /* büyütüldü */
    }
    textarea{ min-height:110px; resize:vertical; }
    input:focus, select:focus, textarea:focus{
      border-color: rgba(0,168,107,.65);
      box-shadow: 0 0 0 4px var(--focus);
    }

    .btns{
      display:flex;
      gap:10px;
      flex-wrap:wrap;
      margin-top:14px;
      align-items:center;
    }
    button, .btnLink{
      padding:11px 14px;
      border:0;
      border-radius:14px;
      cursor:pointer;
      font-weight:900;
      color:#06101f;
      background: var(--grad);
      text-decoration:none;
      display:inline-flex;
      align-items:center;
      justify-content:center;
      gap:8px;
      font-size: 14px; /* biraz büyütüldü */
    }
    button.secondary, .btnLink.secondary{
      color: var(--text);
      background: rgba(255,255,255,.08);
      border: 1px solid rgba(255,255,255,.12);
      font-weight:800;
    }
    button.danger{
      color:#14060a;
      background: linear-gradient(135deg, #ff758c 0%, #ff7eb3 100%);
      font-weight:900;
    }
    button:disabled{ opacity:.55; cursor:not-allowed; }

    .divider{
      border:0;
      border-top:1px solid rgba(255,255,255,.10);
      margin:14px 0 6px;
    }

    /* Nav */
    .nav{
      display:flex;
      gap:10px;
      flex-wrap:wrap;
      padding: 12px 16px 0;
      justify-content:center; /* MENÜ ORTALANDI */
    }
    .nav button{
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.10);
      color: var(--text);
      font-weight:900;
    }
    .nav button.active{
      background: rgba(0,168,107,.18);
      border-color: rgba(0,168,107,.45);
    }

    /* Lists */
    .list{
      display:flex;
      flex-direction:column;
      gap:10px;
      margin-top:12px;
    }
    .item{
      border: 1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.04);
      border-radius: 16px;
      padding: 12px;
      display:flex;
      flex-direction:column;
      gap:10px;
    }
    .itemTop{
      display:flex;
      justify-content:space-between;
      gap:12px;
      align-items:flex-start;
    }
    .title{
      font-weight:950;
      font-size:15px; /* büyütüldü */
      line-height:1.25;
    }
    .meta{
      color:var(--muted);
      font-size:13px; /* büyütüldü */
      line-height:1.5;
      word-break:break-word;
    }
    .actions{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
      align-items:center;
      justify-content:flex-end;
    }

    /* Cover previews */
    .coverRow{
      display:flex;
      gap:12px;
      align-items:flex-start;
      flex-wrap:wrap;
    }
    .coverBox{
      width: 170px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.03);
      overflow:hidden;
      flex: 0 0 auto;
      position: relative;
    }
    .coverBox img{
      width:100%;
      height: 230px;
      object-fit: cover;
      display:block;
      background: rgba(0,0,0,.25);
    }
    .coverEmpty{
      position:absolute;
      inset:0;
      display:flex;
      align-items:center;
      justify-content:center;
      font-weight:950;
      letter-spacing:.2px;
      color: rgba(234,240,255,.85);
      background:
        radial-gradient(220px 160px at 30% 25%, rgba(0,168,107,.20), transparent 55%),
        linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.12));
      text-shadow: 0 10px 24px rgba(0,0,0,.45);
      pointer-events:none;
    }
    .coverMeta{ flex:1; min-width: 240px; }
    .mono{
      font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
      font-size: 12.5px; /* büyütüldü */
      color: var(--muted);
      word-break: break-word;
      line-height: 1.35;
    }

    /* Drag */
    .chapterRow{
      display:flex;
      align-items:flex-start;
      justify-content:space-between;
      gap:10px;
    }
    .dragHandle{
      width:14px;
      height:14px;
      margin-top:2px;
      border-radius:6px;
      background: rgba(0,168,107,.22);
      border: 1px solid rgba(0,168,107,.35);
      box-shadow: 0 0 0 3px rgba(0,168,107,.08);
      flex: 0 0 auto;
      cursor: grab;
    }
    .chapterLeft{
      display:flex;
      gap:10px;
      flex:1;
      min-width:0;
    }
    .chapterTitle{
      font-weight:950;
      font-size:14px; /* büyütüldü */
      line-height:1.25;
      word-break:break-word;
    }
    .chapterMeta{
      margin-top:6px;
      display:flex;
      gap:8px;
      flex-wrap:wrap;
    }
    .chip{
      display:inline-flex;
      align-items:center;
      font-size:13px; /* büyütüldü */
      padding:6px 10px;
      border-radius:999px;
      background: rgba(255,255,255,.06);
      border: 1px solid rgba(255,255,255,.10);
      color: var(--muted);
      gap:6px;
      white-space:nowrap;
    }
    .chip strong{ color: var(--text); font-weight:900; }

    /* Quill theme tweaks */
    .qwrap{
      border-radius:14px;
      overflow:hidden;
      border:1px solid rgba(255,255,255,.12);
      background: rgba(8,12,22,.55);
    }
    .ql-toolbar.ql-snow{
      border:0;
      border-bottom:1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.03);
    }
    .ql-container.ql-snow{ border:0; color: var(--text); font-size:20px; }
    .qwrap .ql-editor{
      min-height: 260px;
      line-height: 1.35;
      padding: 22px 22px 24px;
    }
    .qwrap .ql-editor p,
    .qwrap .ql-editor ol,
    .qwrap .ql-editor ul,
    .qwrap .ql-editor blockquote{
      line-height: 1.35;
      margin: 0 0 8px;
    }
    .qwrap .ql-editor p:last-child,
    .qwrap .ql-editor ol:last-child,
    .qwrap .ql-editor ul:last-child,
    .qwrap .ql-editor blockquote:last-child{
      margin-bottom: 0;
    }
    .qwrap .ql-editor h1{ font-size:30px; line-height:1.35; margin:10px 0 6px; }
    .qwrap .ql-editor h2{ font-size:26px; line-height:1.35; margin:8px 0 6px; }
    .qwrap .ql-editor h3{ font-size:23px; line-height:1.35; margin:6px 0 6px; }
    .qwrap .ql-editor .ql-size-small{ font-size:18px; }
    .qwrap .ql-editor .ql-size-large{ font-size:26px; }
    .qwrap .ql-editor .ql-size-huge{ font-size:32px; }
    .ql-editor.ql-blank::before{
      color: rgba(155,176,201,.75);
      font-style: normal;
    }

    /* Word counter */
    .wordCount{
      margin-top: 10px;
      color: var(--muted);
      font-size: 13px;
      font-weight: 900;
    }

    .hide{ display:none !important; }

    /* Toasts */
    .toasts{
      position: fixed;
      top: 14px;
      right: 14px;
      z-index: 9999;
      display: flex;
      flex-direction: column;
      gap: 10px;
      width: min(420px, calc(100vw - 28px));
      pointer-events: none;
    }
    .toast{
      pointer-events: auto;
      border-radius: 16px;
      border: 1px solid rgba(255,255,255,.14);
      background: linear-gradient(180deg, rgba(12,23,34,.98), rgba(8,16,24,.98));
      box-shadow: 0 16px 50px rgba(0,0,0,.45);
      padding: 12px 12px;
      display:flex;
      gap:10px;
      align-items:flex-start;
    }
    .toast .tIcon{
      width: 28px;
      height: 28px;
      border-radius: 10px;
      display:flex;
      align-items:center;
      justify-content:center;
      flex: 0 0 auto;
      background: rgba(255,255,255,.08);
      border: 1px solid rgba(255,255,255,.10);
      margin-top: 1px;
    }
    .toast.ok .tIcon{ background: rgba(124,255,178,.10); border-color: rgba(124,255,178,.25); }
    .toast.warn .tIcon{ background: rgba(255,211,122,.10); border-color: rgba(255,211,122,.25); }
    .toast.bad .tIcon{ background: rgba(255,107,122,.10); border-color: rgba(255,107,122,.25); }
    .toast .tText{ min-width:0; }
    .toast .tTitle{
      font-weight: 950;
      font-size: 13px;
      margin: 0 0 3px;
      line-height: 1.25;
    }
    .toast .tBody{
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
      white-space: pre-wrap;
      word-break: break-word;
    }
    .toast .tClose{
      margin-left:auto;
      background: rgba(255,255,255,.08);
      border: 1px solid rgba(255,255,255,.12);
      color: var(--text);
      border-radius: 12px;
      padding: 8px 10px;
      font-weight: 900;
      cursor: pointer;
    }

    /* Login improvements */
    .loginHero{
      display:flex;
      gap:14px;
      align-items:stretch;
      flex-wrap:wrap;
      flex-direction: column; /* HIZLI BİLGİ ALTA İNDİ, GİRİŞ DARALMIYOR */
    }
    .loginLeft{
      flex: 1;
      min-width: 280px;
    }
    .loginRight{
      flex: 1;
      min-width: 260px;
    }
    .kicker{
      font-size:13px; /* büyütüldü */
      color: var(--muted);
      font-weight: 900;
      letter-spacing: .2px;
    }
    .bigTitle{
      margin: 6px 0 0;
      font-size: 19px; /* büyütüldü */
      font-weight: 950;
      line-height: 1.25;
    }
    .desc{
      margin: 8px 0 0;
      color: var(--muted);
      font-size: 13.5px; /* büyütüldü */
      line-height: 1.6;
    }

    .passWrap{
      position:relative;
    }
    .passBtn{
      position:absolute;
      top: 50%;
      right: 10px;
      transform: translateY(-50%);
      padding: 8px 10px;
      border-radius: 12px;
      background: rgba(255,255,255,.08);
      border: 1px solid rgba(255,255,255,.12);
      color: var(--text);
      font-weight: 950;
      cursor:pointer;
      line-height: 1;
    }

    .helpCard p{
      margin: 10px 0 0;
      color: var(--muted);
      font-size: 13.5px; /* büyütüldü */
      line-height: 1.65;
    }
    .helpCard .hLine{
      font-weight: 950;
      color: var(--text);
      font-size: 14px; /* büyütüldü */
      margin-top: 10px;
    }
    .helpBox .subhead .left .h{ font-size:15px; }
.helpText{
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.storeRow{
  display:flex;
  gap:10px;
  margin-top:12px;
  flex-wrap:wrap;
}
.storeBtn{
  flex:1;
  min-width: 240px;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
  text-decoration:none;
  color: var(--text);
  font-weight: 900;
}
.storeBtn .i{
  width:36px;height:36px;
  border-radius: 14px;
  display:flex;align-items:center;justify-content:center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  font-size: 18px;
  flex: 0 0 auto;
}
.storeBtn .tx{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.storeBtn .t1{ font-size:13.5px; line-height:1.2; }
.storeBtn .t2{ font-size:12px; color: var(--muted); font-weight:800; }

.storeBtn:hover{
  border-color: rgba(0,168,107,.35);
  background: rgba(0,168,107,.10);
}

.hintLine{
  margin-top:10px;
  color: rgba(155,176,201,.95);
  font-size:12.5px;
  line-height:1.55;
}

.videoFrameWrap{
  position:relative;
  margin-top: 12px;
  border-radius: 16px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.22);
  aspect-ratio: 16 / 9;
}
.videoFrame{
  position:absolute; inset:0;
  width:100%; height:100%;
  border:0;
}
.videoPlaceholder{
  position:absolute; inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(155,176,201,.85);
  font-weight: 900;
  padding: 16px;
  text-align:center;
  background:
    radial-gradient(320px 220px at 30% 25%, rgba(0,168,107,.16), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.14));
  pointer-events:none;
}

    .videoLink{
      display:flex;
      align-items:center;
      justify-content:space-between;
      gap:10px;
      margin-top: 10px;
      padding: 10px 12px;
      border-radius: 14px;
      border: 1px solid rgba(255,255,255,.10);
      background: rgba(255,255,255,.04);
    }
    .videoLink .left{
      min-width:0;
      display:flex;
      flex-direction:column;
      gap:3px;
    }
    .videoLink .left .t{
      font-weight:950;
      font-size: 13.5px; /* büyütüldü */
    }
    .videoLink .left .u{
      color: var(--muted);
      font-size: 13px; /* büyütüldü */
      word-break: break-word;
    }
    .videoLink a{
      flex: 0 0 auto;
    }

    .fileHint{
      margin-top: 8px;
      color: var(--muted);
      font-size: 12px;
      line-height: 1.45;
    }
    
    /* Boot bitene kadar hiçbir view görünmesin (login flash'ı biter) */
body.booting .card .body > section{
  display:none !important;
}

/* Page loader */
.pageLoader{
  position:fixed;
  inset:0;
  z-index:9000;
  display:grid;
  place-items:center;
  padding:24px;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  background:rgba(244,247,251,.76);
  backdrop-filter:blur(8px);
  transition:opacity .16s ease, visibility .16s ease;
}

body[data-theme="dark"] .pageLoader{
  background:rgba(7,11,16,.72);
}

body.booting .pageLoader,
.pageLoader.active{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.pageLoaderCard{
  width:min(340px, calc(100vw - 36px));
  display:grid;
  justify-items:center;
  gap:12px;
  padding:22px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
  color:var(--text);
  box-shadow:var(--shadow);
}

.pageLoaderMark{
  width:54px;
  height:54px;
  display:grid;
  place-items:center;
  border-radius:8px;
  color:white;
  background:var(--grad);
  font-size:26px;
  font-weight:950;
}

.pageLoaderText{
  color:var(--text);
  font-size:15px;
  font-weight:900;
}

.pageLoaderBar{
  width:100%;
  height:4px;
  overflow:hidden;
  border-radius:999px;
  background:var(--surfaceSoft);
}

.pageLoaderBar span{
  display:block;
  width:38%;
  height:100%;
  border-radius:999px;
  background:var(--grad);
  animation:vaveylaLoader 1.05s ease-in-out infinite;
}

@keyframes vaveylaLoader{
  0%{ transform:translateX(-110%); }
  100%{ transform:translateX(280%); }
}

/* =========================
   ZOOM SADECE PC'DE AKTİF
   ========================= */
@media (min-width: 1024px){
  body{ zoom: var(--uiZoom); }
}
@media (max-width: 1023.98px){
  body{ zoom: 1; }
}

/* =========================
   Modern panel refresh
   ========================= */
:root,
body[data-theme="light"]{
  --uiZoom: 1;
  --brand:#2563eb;
  --brand2:#00a86b;
  --accent:#ef5da8;
  --bg:#f4f7fb;
  --panel:#ffffff;
  --card:#ffffff;
  --card2:#f7f9fd;
  --text:#111827;
  --muted:#667085;
  --border:rgba(15,23,42,.12);
  --shadow:0 18px 45px rgba(15,23,42,.08);
  --radius:8px;
  --danger:#e11d48;
  --warn:#b7791f;
  --ok:#047857;
  --grad:linear-gradient(135deg, #2563eb 0%, #00a86b 100%);
  --focus:rgba(37,99,235,.18);
  --input:#ffffff;
  --surfaceSoft:#f7f9fd;
  color-scheme:light;
}

body[data-theme="dark"]{
  --brand:#4ade80;
  --brand2:#60a5fa;
  --accent:#fb7185;
  --bg:#0b0f14;
  --panel:#101720;
  --card:#111923;
  --card2:#17212d;
  --text:#f5f7fb;
  --muted:#a7b0be;
  --border:rgba(255,255,255,.12);
  --shadow:0 18px 45px rgba(0,0,0,.32);
  --danger:#fb7185;
  --warn:#fbbf24;
  --ok:#86efac;
  --grad:linear-gradient(135deg, #4ade80 0%, #60a5fa 100%);
  --focus:rgba(74,222,128,.18);
  --input:#0d141d;
  --surfaceSoft:#151f2b;
  color-scheme:dark;
}

*{
  letter-spacing:0 !important;
}

html,
body{
  background:var(--bg);
}

body{
  color:var(--text);
  font-size:15px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.88) 0%, rgba(244,247,251,.95) 42%, rgba(234,240,248,.98) 100%);
}

@media (min-width: 1101px){
  body{
    overflow:hidden;
  }
}

body[data-theme="dark"]{
  background:linear-gradient(180deg, #0b0f14 0%, #0d1218 48%, #080b10 100%);
}

.wrap{
  width:min(1440px, 100%);
  max-width:1440px;
  height:100vh;
  min-height:0;
  margin:0 auto;
  padding:24px;
  display:grid;
  grid-template-columns:260px minmax(0, 1fr);
  gap:20px;
  align-items:stretch;
}

.topbar{
  position:sticky;
  top:24px;
  grid-column:1;
  width:260px;
  max-width:260px;
  height:calc(100vh - 48px);
  min-height:0;
  min-width:0;
  padding:12px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--panel);
  box-shadow:var(--shadow);
  display:grid;
  grid-template-rows:auto auto minmax(0, 1fr) auto;
  align-items:stretch;
  align-content:start;
  justify-content:stretch;
  gap:10px;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:none;
  z-index:2;
}

.mobileMenuPanel{
  display:contents;
}

.mobileMenuToggle{
  display:none !important;
  width:42px !important;
  height:38px !important;
  min-height:38px !important;
  padding:0 !important;
  border:1px solid var(--border) !important;
  border-radius:8px !important;
  background:var(--surfaceSoft) !important;
  color:var(--text) !important;
  box-shadow:none !important;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:4px;
}

.mobileMenuToggle span{
  display:block;
  width:18px;
  height:2px;
  border-radius:999px;
  background:currentColor;
}

.mobileMenuToggle[aria-expanded="true"] span:nth-child(1){
  transform:translateY(6px) rotate(45deg);
}

.mobileMenuToggle[aria-expanded="true"] span:nth-child(2){
  opacity:0;
}

.mobileMenuToggle[aria-expanded="true"] span:nth-child(3){
  transform:translateY(-6px) rotate(-45deg);
}

.topbar::-webkit-scrollbar{
  width:0;
  height:0;
}

.topbar > *{
  max-width:100%;
  min-width:0;
}

.brand{
  display:grid;
  grid-template-columns:40px minmax(0, 1fr);
  align-items:center;
  gap:10px;
  padding-bottom:10px;
  border-bottom:1px solid var(--border);
  font-size:20px;
  font-weight:900;
  color:var(--text);
}

.brand small{
  grid-column:2;
  color:var(--muted);
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
}

.dot{
  grid-row:1 / span 2;
  width:40px;
  height:40px;
  border-radius:8px;
  background:var(--grad);
  box-shadow:none;
  display:grid;
  place-items:center;
  position:relative;
}

.dot::after{
  content:"V";
  color:white;
  font-weight:950;
  font-size:20px;
}

.topbarActions{
  width:100%;
  min-width:0;
  margin-top:0;
  padding-top:10px;
  border-top:1px solid var(--border);
  align-self:end;
  flex:0 0 auto;
  display:grid;
  gap:6px;
}

.themeToggle{
  width:100%;
  min-height:36px;
  justify-content:center;
}

.card{
  grid-column:2;
  height:calc(100vh - 48px);
  min-height:0;
  display:flex;
  flex-direction:column;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.card h2{
  flex:0 0 auto;
  padding:22px 28px;
  margin:0;
  border-bottom:1px solid var(--border);
  background:var(--card);
  font-size:22px;
  font-weight:900;
}

.card h2 .mini{
  color:var(--muted);
  font-size:13px;
  font-weight:800;
  display:none !important;
}

.card .body{
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  overflow-x:hidden;
}

.card .body > section:not(.hide){
  flex:1;
  min-height:100%;
  display:flex;
  flex-direction:column;
}

.card .body > section:not(.hide) > .subcard:first-child{
  flex:1 0 auto;
}

.nav{
  padding:14px 28px;
  margin:0;
  border-bottom:1px solid var(--border);
  background:var(--surfaceSoft);
  gap:8px;
}

.nav button{
  min-height:40px;
  border-radius:8px;
  background:transparent;
  color:var(--muted);
  border:1px solid transparent;
}

.nav button.active{
  color:var(--brand);
  background:rgba(37,99,235,.10);
  border-color:rgba(37,99,235,.22);
}

body[data-theme="dark"] .nav button.active{
  color:var(--brand);
  background:rgba(74,222,128,.12);
  border-color:rgba(74,222,128,.28);
}

.sidebarProfile{
  display:grid;
  gap:6px;
  padding:8px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surfaceSoft);
}

.sidebarAvatarWrap{
  width:100%;
  min-height:96px;
  position:relative;
  display:grid;
  place-items:center;
  border:1px dashed var(--border);
  background:var(--card);
  color:var(--muted);
  border-radius:8px;
  padding:8px;
}

.sidebarAvatarWrap:hover{
  border-color:rgba(37,99,235,.34);
}

body[data-theme="dark"] .sidebarAvatarWrap:hover{
  border-color:rgba(74,222,128,.34);
}

.sidebarAvatarFrame{
  width:60px;
  height:60px;
  position:relative;
  border-radius:999px;
}

.sidebarAvatarFrame #profileImg,
.sidebarAvatarEmpty{
  position:absolute;
  inset:0;
  width:60px;
  height:60px;
  border-radius:999px !important;
}

.sidebarAvatarFrame #profileImg{
  object-fit:cover;
  border:2px solid var(--card);
  box-shadow:0 8px 20px rgba(15,23,42,.16);
}

.sidebarAvatarEmpty{
  display:grid;
  place-items:center;
  color:#fff;
  background:var(--grad);
  font-size:13px;
  font-weight:950;
}

.sidebarAvatarMenu{
  position:absolute;
  left:50%;
  bottom:8px;
  transform:translateX(-50%);
  z-index:50;
}

.sidebarAvatarMenuToggle{
  width:38px !important;
  min-height:28px !important;
  padding:0 !important;
  color:var(--muted) !important;
  background:var(--surfaceSoft) !important;
  border:1px solid var(--border) !important;
  box-shadow:none !important;
  line-height:1 !important;
  font-weight:950 !important;
  letter-spacing:0 !important;
}

.sidebarAvatarMenu.open .sidebarAvatarMenuToggle,
.sidebarAvatarMenuToggle:hover{
  color:var(--brand) !important;
  background:rgba(37,99,235,.10) !important;
  transform:none !important;
}

.sidebarAvatarMenuPanel{
  position:absolute;
  top:calc(100% + 8px);
  left:50%;
  transform:translateX(-50%);
  min-width:132px;
  display:none;
  gap:4px;
  padding:6px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
  box-shadow:var(--shadow);
}

.sidebarAvatarMenu.open .sidebarAvatarMenuPanel{
  display:grid;
}

.sidebarAvatarMenuPanel button{
  width:100%;
  min-height:34px;
  padding:8px 10px;
  justify-content:flex-start;
  color:var(--text);
  background:transparent;
  border:0;
  box-shadow:none;
  font-size:13px;
}

.sidebarAvatarMenuPanel button:hover{
  transform:none;
  background:var(--surfaceSoft);
}

.sidebarAvatarMenuPanel button.dangerText{
  color:var(--danger);
}

.sidebarProfileInfo{
  display:grid;
  min-width:0;
}

.sidebarProfileName{
  color:var(--text);
  font-size:14px;
  font-weight:950;
  word-break:break-word;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sidebarProfileUsername{
  color:var(--muted);
  font-size:12px;
  line-height:1.35;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sidebarProfileRows{
  display:grid;
  gap:0;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
}

.sidebarProfileRow{
  min-width:0;
  display:grid;
  grid-template-columns:minmax(0, 1fr) 26px;
  grid-template-areas:
    "label edit"
    "value edit";
  align-items:center;
  gap:2px 6px;
  padding:4px 8px;
  border:0;
  border-radius:0;
  background:transparent;
}

.sidebarProfileRow + .sidebarProfileRow{
  border-top:1px solid var(--border);
}

.sidebarProfileRow.readonly{
  grid-template-columns:minmax(0, 1fr);
  grid-template-areas:
    "label"
    "value";
}

.sidebarProfileLabel{
  grid-area:label;
  color:var(--muted);
  font-size:9.5px;
  font-weight:900;
  line-height:1.1;
}

.sidebarProfileValue{
  grid-area:value;
  min-width:0;
  color:var(--text);
  font-size:12px;
  font-weight:850;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sidebarProfileEdit{
  grid-area:edit;
  width:24px !important;
  min-height:24px !important;
  padding:0 !important;
  color:var(--muted) !important;
  background:transparent !important;
  border:1px solid transparent !important;
  box-shadow:none !important;
  font-size:13px !important;
}

.sidebarProfileEdit:hover{
  transform:none !important;
  color:var(--brand) !important;
  background:var(--surfaceSoft) !important;
  border-color:var(--border) !important;
}

.topbar .nav{
  width:100%;
  max-width:100%;
  min-width:0;
  min-height:0;
  flex:0 0 auto;
  align-self:stretch;
  align-content:start;
  justify-content:stretch;
  justify-items:stretch;
  padding:0;
  margin:0;
  border:0;
  background:transparent;
  display:grid;
  grid-template-columns:1fr;
  gap:3px;
  overflow-x:hidden;
  overflow-y:auto;
  scrollbar-width:none;
}

.topbar .nav::-webkit-scrollbar{
  width:0;
  height:0;
}

.topbar .nav button{
  width:100%;
  max-width:100%;
  min-width:0;
  min-height:34px;
  justify-content:flex-start;
  padding:6px 10px;
  color:var(--muted);
  background:transparent;
  border:1px solid transparent;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.topbar .nav button:hover{
  transform:none;
  color:var(--text);
  background:var(--surfaceSoft);
  border-color:var(--border);
}

.topbar .nav button.active{
  color:var(--brand);
  background:rgba(37,99,235,.10);
  border-color:rgba(37,99,235,.22);
}

body[data-theme="dark"] .topbar .nav button.active{
  background:rgba(74,222,128,.12);
  border-color:rgba(74,222,128,.28);
}

.topbar .nav #navLogout{
  margin-top:0;
  color:var(--danger);
}

.topbar .nav #navLogout:hover{
  color:var(--danger);
  background:rgba(225,29,72,.08);
  border-color:rgba(225,29,72,.18);
}

.bookEmptyState{
  min-height:180px;
  display:grid;
  place-content:center;
  gap:10px;
  text-align:center;
}

.bookEmptyTitle,
.infoTitle{
  color:var(--text);
  font-size:20px;
  line-height:1.25;
  font-weight:950;
}

.bookEmptyState .btns,
.infoPanel .btns{
  justify-content:center;
}

.emptyStateAction{
  min-width:160px;
}

.infoPanel{
  min-height:260px;
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  align-content:center;
  justify-content:stretch;
  justify-items:center;
  gap:12px;
  text-align:center;
  padding:34px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surfaceSoft);
}

.infoPanel .meta{
  width:min(760px, 100%);
  max-width:760px;
  margin:0 auto;
}

.panelStoreRow{
  width:620px;
  max-width:100%;
  justify-self:center;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  justify-content:center;
  align-items:stretch;
  gap:12px;
  margin:14px auto 0;
}

.panelStoreRow .storeBtn{
  width:100%;
  min-width:0;
  flex:none;
  display:grid;
  grid-template-columns:38px minmax(0, 1fr);
  align-items:center;
  column-gap:10px;
  justify-content:stretch;
  text-align:left;
}

.panelStoreRow .storeBtn .i{
  width:38px;
  height:38px;
  flex:0 0 38px;
}

.panelStoreRow .storeBtn .tx{
  align-items:flex-start;
  text-align:left;
}

.profileEditOverlay{
  position:fixed;
  inset:0;
  z-index:3000;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(15,23,42,.38);
}

body[data-theme="dark"] .profileEditOverlay{
  background:rgba(0,0,0,.54);
}

.profileEditDialog{
  width:min(420px, 100%);
  display:grid;
  gap:14px;
  padding:18px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
  box-shadow:var(--shadow);
}

.profileEditTitle{
  color:var(--text);
  font-size:18px;
  font-weight:950;
}

.profileEditFields{
  display:grid;
  gap:8px;
}

.profileEditActions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.body{
  padding:24px 28px 32px;
}

.subcard{
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
  box-shadow:none;
  overflow:hidden;
}

.subcard[style*="background:rgba(255,255,255,.02)"],
.subcard[style*="background: rgba(255,255,255,.02)"]{
  background:var(--card) !important;
}

.subhead{
  padding:18px 20px;
  background:var(--surfaceSoft);
  border-bottom:1px solid var(--border);
  align-items:flex-start;
}

.subhead .h{
  color:var(--text);
  font-size:20px;
  font-weight:900;
}

.subhead .s,
.desc,
.meta,
.fileHint{
  color:var(--muted);
  line-height:1.55;
}

.subbody{
  padding:20px;
}

.row{
  gap:14px;
}

label{
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
}

input,
select,
textarea{
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--input);
  color:var(--text);
  padding:13px 14px;
}

input:focus,
select:focus,
textarea:focus{
  border-color:var(--brand);
  box-shadow:0 0 0 4px var(--focus);
}

button,
.btnLink{
  min-height:42px;
  border-radius:8px;
  background:var(--brand);
  color:#fff;
  box-shadow:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

button:hover,
.btnLink:hover{
  transform:translateY(-1px);
}

button.secondary,
.btnLink.secondary{
  color:var(--text);
  background:var(--card);
  border:1px solid var(--border);
}

button.danger{
  color:white;
  background:var(--danger);
}

.btns{
  gap:10px;
}

.passWrap{
  position:relative;
}

.passWrap input{
  padding-right:54px;
}

.passBtn{
  position:absolute;
  top:50%;
  right:6px;
  width:40px;
  min-height:32px;
  padding:0;
  border:0;
  background:transparent;
  color:var(--muted);
  transform:translateY(-50%);
}

.passBtn:hover{
  transform:translateY(-50%);
}

.loginHero{
  display:grid;
  grid-template-columns:minmax(280px, .9fr) minmax(320px, 1.1fr);
  gap:16px;
  align-items:stretch;
}

.loginLeft{
  background:
    linear-gradient(180deg, rgba(37,99,235,.10), rgba(0,168,107,.08)),
    var(--card);
}

body[data-theme="dark"] .loginLeft{
  background:linear-gradient(180deg, rgba(96,165,250,.12), rgba(74,222,128,.08)), var(--card);
}

.loginLeft .subbody,
.loginRight .subbody{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.loginRight .meta{
  padding:14px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surfaceSoft);
}

.list{
  display:grid;
  gap:14px;
  margin-top:0;
}

.listSectionTitle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:8px 0 -2px;
  color:var(--text);
  font-size:13px;
  font-weight:950;
  text-transform:uppercase;
}

.listSectionTitle strong{
  min-width:28px;
  height:28px;
  border-radius:8px;
  display:grid;
  place-items:center;
  color:var(--brand);
  background:rgba(37,99,235,.10);
}

body[data-theme="dark"] .listSectionTitle strong{
  color:var(--brand);
  background:rgba(74,222,128,.12);
}

.item{
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
  padding:16px;
  transition:border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.item:hover{
  border-color:rgba(37,99,235,.38);
  transform:translateY(-1px);
  box-shadow:0 14px 28px rgba(15,23,42,.08);
}

body[data-theme="dark"] .item:hover{
  border-color:rgba(74,222,128,.38);
  box-shadow:0 14px 28px rgba(0,0,0,.24);
}

.emptyState{
  color:var(--muted);
  background:var(--surfaceSoft);
  border-style:dashed;
}

.itemTop{
  gap:18px;
  align-items:center;
}

.bookCardMain{
  min-width:0;
  display:grid;
  gap:8px;
}

.bookCard{
  position:relative;
  cursor:pointer;
  overflow:visible;
  z-index:1;
}

.bookCard.menuOpen{
  z-index:80;
}

#booksList,
#draftBooksList{
  overflow:visible;
  position:relative;
  padding-bottom:var(--book-menu-space, 0px);
  transition:padding-bottom .16s ease;
}

#viewBooks .subcard,
#viewBooks .subbody,
#viewDraftBooks .subcard,
#viewDraftBooks .subbody{
  overflow:visible;
}

.bookCoverThumb{
  width:92px;
  height:130px;
  flex:0 0 92px;
  border-radius:8px;
  overflow:hidden;
  background:var(--surfaceSoft);
  border:1px solid var(--border);
}

.bookCoverThumb img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}

.bookCoverPlaceholder{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  color:#fff;
  background:var(--grad);
  font-size:28px;
  font-weight:950;
}

.bookCardKicker{
  color:var(--brand);
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
}

.title,
.chapterTitle{
  color:var(--text);
  font-size:18px;
  line-height:1.25;
  font-weight:950;
}

.bookDescription{
  color:var(--muted);
  line-height:1.55;
  max-width:82ch;
}

.bookDescription.compact{
  font-size:12px;
  line-height:1.35;
}

.bookStats,
.chapterMeta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

.chip,
.statusPill{
  min-height:30px;
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--surfaceSoft);
  color:var(--muted);
  padding:6px 10px;
  font-size:12px;
  font-weight:900;
}

.chip strong{
  color:var(--text);
}

.statusPill.live{
  color:#047857;
  background:rgba(16,185,129,.12);
  border-color:rgba(16,185,129,.26);
}

.statusPill.draft{
  color:#b45309;
  background:rgba(245,158,11,.13);
  border-color:rgba(245,158,11,.28);
}

body[data-theme="dark"] .statusPill.live{
  color:#86efac;
}

body[data-theme="dark"] .statusPill.draft{
  color:#fbbf24;
}

.actions{
  justify-content:flex-end;
}

.bookMenu{
  position:relative;
  flex:0 0 auto;
  z-index:90;
}

.bookMenuToggle{
  width:38px !important;
  min-height:38px !important;
  padding:0 !important;
  border-radius:8px !important;
  color:var(--muted) !important;
  background:var(--surfaceSoft) !important;
  border:1px solid var(--border) !important;
  font-size:18px !important;
  font-weight:950 !important;
  line-height:1 !important;
  letter-spacing:0 !important;
  box-shadow:none !important;
}

.bookMenu.open .bookMenuToggle,
.bookMenuToggle:hover{
  color:var(--brand) !important;
  border-color:rgba(37,99,235,.34) !important;
  background:rgba(37,99,235,.10) !important;
  transform:none !important;
}

.bookMenuPanel{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  z-index:1000;
  min-width:172px;
  padding:6px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
  box-shadow:var(--shadow);
  display:none;
}

.bookMenu.open .bookMenuPanel{
  display:grid;
  gap:4px;
}

.bookMenuPanel button{
  width:100%;
  min-height:36px;
  justify-content:flex-start;
  padding:8px 10px;
  color:var(--text);
  background:transparent;
  border:0;
  box-shadow:none;
  font-size:14px;
  font-weight:850;
}

.bookMenuPanel button:hover{
  transform:none;
  background:var(--surfaceSoft);
}

.bookMenuPanel button.dangerText{
  color:var(--danger);
}

.bookActionsBar{
  width:auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}

.bookDetailActions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  margin:0 0 0 auto;
}

#viewBookDetail > .subcard > .subhead{
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}

.bookDetailSettings{
  position:relative;
  flex:0 0 auto;
  z-index:120;
}

.bookDetailSettings .iconButton{
  width:42px !important;
  min-height:42px !important;
  padding:0 !important;
  font-size:18px !important;
  line-height:1 !important;
}

.bookDetailSettingsPanel{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  z-index:1000;
  min-width:240px;
  padding:6px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
  box-shadow:var(--shadow);
  display:none;
}

.bookDetailSettings.open .bookDetailSettingsPanel{
  display:grid;
  gap:4px;
}

.bookDetailSettingsPanel button{
  width:100%;
  min-height:36px;
  justify-content:flex-start;
  text-align:left;
  white-space:nowrap;
  padding:8px 10px;
  color:var(--text);
  background:transparent;
  border:0;
  box-shadow:none;
  font-size:14px;
  font-weight:850;
}

.bookDetailSettingsPanel button:hover{
  transform:none;
  background:var(--surfaceSoft);
}

.bookDetailSettingsPanel button.dangerText{
  color:var(--danger);
}

.chapterMediaPicker{
  display:grid;
  gap:12px;
}

.chapterMediaDrop{
  width:100%;
  min-height:260px;
  display:grid;
  place-items:center;
  gap:12px;
  padding:24px;
  border:2px dashed rgba(100,116,139,.58);
  border-radius:8px;
  background:var(--surfaceSoft);
  color:var(--muted);
  box-shadow:none;
  text-align:center;
  overflow:hidden;
}

.chapterMediaDrop:hover,
.chapterMediaDrop:focus-visible{
  transform:none;
  border-color:var(--brand);
  background:rgba(37,99,235,.07);
}

body[data-theme="dark"] .chapterMediaDrop:hover,
body[data-theme="dark"] .chapterMediaDrop:focus-visible{
  background:rgba(74,222,128,.10);
}

.chapterMediaPreview{
  width:min(100%, 520px);
  max-height:180px;
  display:none;
  position:relative;
  overflow:hidden;
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--card);
}

.chapterMediaDrop.has-media .chapterMediaPreview{
  display:block;
}

.chapterMediaPreview img{
  width:100%;
  height:180px;
  display:block;
  object-fit:cover;
}

.chapterMediaDrop.has-media .coverEmpty{
  display:none !important;
}

.chapterMediaIcon{
  width:54px;
  height:54px;
  display:grid;
  place-items:center;
  color:var(--muted);
  font-size:34px;
  line-height:1;
}

.chapterMediaDrop.has-media .chapterMediaIcon{
  display:none;
}

.chapterMediaText{
  color:var(--muted);
  font-size:20px;
  font-weight:800;
  line-height:1.35;
}

.chapterMediaMenu{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
}

.chapterMediaMenu button{
  min-height:40px;
  white-space:nowrap;
}

.chapterMediaMenu button.dangerText{
  color:var(--danger);
}

.chapterYoutubeBox{
  display:grid;
  gap:8px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
}

.chapterYoutubeBox label{
  margin:0;
}

.chapterYoutubeRow{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:10px;
  align-items:center;
}

.chapterYoutubeRow button{
  white-space:nowrap;
}

#viewBookDetail .subcard,
#viewBookDetail .subbody,
#chaptersList{
  overflow:visible;
}

#chaptersList{
  position:relative;
  padding-bottom:var(--chapter-menu-space, 0px);
  transition:padding-bottom .16s ease;
}

.chapterCard{
  cursor:pointer;
  position:relative;
  z-index:1;
}

.chapterCard.menuOpen{
  z-index:80;
}

.chapterRow{
  align-items:center;
  gap:16px;
}

.chapterLeft{
  align-items:center;
}

.chapterMain{
  min-width:0;
  flex:1;
  display:grid;
  gap:8px;
}

.chapterExcerpt{
  color:var(--muted);
  line-height:1.5;
  max-width:86ch;
}

.dragHandle{
  border-radius:8px;
  border-color:var(--border);
  background:var(--surfaceSoft);
}

.chapterMenu{
  position:relative;
  flex:0 0 auto;
  z-index:90;
}

.chapterMenuToggle{
  width:38px !important;
  min-height:38px !important;
  padding:0 !important;
  border-radius:8px !important;
  color:var(--muted) !important;
  background:var(--surfaceSoft) !important;
  border:1px solid var(--border) !important;
  font-size:18px !important;
  font-weight:950 !important;
  line-height:1 !important;
  letter-spacing:0 !important;
}

.chapterMenuToggle:hover,
.chapterMenu.open .chapterMenuToggle{
  color:var(--brand) !important;
  border-color:rgba(37,99,235,.34) !important;
  background:rgba(37,99,235,.10) !important;
}

body[data-theme="dark"] .chapterMenuToggle:hover,
body[data-theme="dark"] .chapterMenu.open .chapterMenuToggle{
  border-color:rgba(74,222,128,.34) !important;
  background:rgba(74,222,128,.12) !important;
}

.chapterMenuPanel{
  position:absolute;
  top:calc(100% + 8px);
  right:0;
  z-index:1000;
  min-width:174px;
  padding:6px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--card);
  box-shadow:var(--shadow);
  display:none;
}

.chapterMenu.open .chapterMenuPanel{
  display:grid;
  gap:4px;
}

.chapterMenuPanel button{
  width:100%;
  min-height:36px;
  justify-content:flex-start;
  padding:8px 10px;
  color:var(--text);
  background:transparent;
  border:0;
  box-shadow:none;
  font-size:14px;
  font-weight:850;
}

.chapterMenuPanel button:hover{
  transform:none;
  background:var(--surfaceSoft);
}

.chapterMenuPanel button.dangerText{
  color:var(--danger);
}

.coverBox,
.mediaDrop,
.profileImg,
.profileEmpty,
.videoFrameWrap,
.videoLink{
  border-radius:8px;
  border-color:var(--border);
  background:var(--surfaceSoft);
}

#profileImg{
  border-radius:8px !important;
}

.videoPlaceholder{
  color:var(--muted);
  background:var(--surfaceSoft);
}

.qwrap{
  border-radius:8px;
  border-color:var(--border);
  background:var(--card);
}

.qwrap .ql-toolbar.ql-snow{
  border-color:var(--border);
  background:var(--surfaceSoft);
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:7px;
  padding:10px 12px;
}

.ql-container.ql-snow{
  color:var(--text);
  font-size:20px;
}

.qwrap .ql-editor{
  min-height:320px;
  line-height:1.35;
  padding:24px;
  background:var(--card);
}

.qwrap .ql-editor p,
.qwrap .ql-editor ol,
.qwrap .ql-editor ul,
.qwrap .ql-editor blockquote{
  line-height:1.35;
  margin:0 0 8px;
}

.qwrap .ql-editor p:last-child,
.qwrap .ql-editor ol:last-child,
.qwrap .ql-editor ul:last-child,
.qwrap .ql-editor blockquote:last-child{
  margin-bottom:0;
}

.qwrap .ql-editor.ql-blank::before{
  color:var(--muted);
}

.qwrap .ql-container.ql-focused .ql-editor.ql-blank::before,
.qwrap .ql-editor.ql-blank:focus::before,
.qwrap:focus-within .ql-editor.ql-blank::before{
  opacity:0;
}

.qwrap .ql-toolbar.ql-snow .ql-formats{
  display:inline-flex;
  align-items:center;
  gap:4px;
  margin:0;
}

.qwrap .ql-toolbar.ql-snow button{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:32px !important;
  width:32px !important;
  height:32px !important;
  padding:6px !important;
  border:0 !important;
  border-radius:8px !important;
  background:transparent !important;
  color:var(--muted) !important;
  box-shadow:none !important;
  transform:none !important;
}

.qwrap .ql-toolbar.ql-snow button:hover,
.qwrap .ql-toolbar.ql-snow button.ql-active{
  color:var(--brand) !important;
  background:rgba(37,99,235,.10) !important;
}

body[data-theme="dark"] .qwrap .ql-toolbar.ql-snow button:hover,
body[data-theme="dark"] .qwrap .ql-toolbar.ql-snow button.ql-active{
  background:rgba(74,222,128,.12) !important;
}

.qwrap .ql-toolbar.ql-snow button svg{
  width:18px !important;
  height:18px !important;
}

.qwrap .ql-toolbar.ql-snow .ql-picker{
  height:32px;
  color:var(--text);
  font-size:14px;
}

.qwrap .ql-toolbar.ql-snow .ql-picker.ql-size{
  width:184px;
}

.qwrap .ql-toolbar.ql-snow .ql-picker.ql-align{
  width:42px;
}

.qwrap .ql-toolbar.ql-snow .ql-picker.ql-align .ql-picker-label{
  justify-content:center;
  padding:0;
}

.qwrap .ql-toolbar.ql-snow .ql-picker.ql-align .ql-picker-label::before{
  content:"☰";
  color:currentColor;
  font-size:16px;
  font-weight:900;
  line-height:1;
}

.qwrap .ql-toolbar.ql-snow .ql-picker.ql-align .ql-picker-label[data-value="center"]::before{
  content:"≡";
}

.qwrap .ql-toolbar.ql-snow .ql-picker.ql-align .ql-picker-label[data-value="right"]::before{
  content:"☷";
}

.qwrap .ql-toolbar.ql-snow .ql-picker.ql-align .ql-picker-label[data-value="justify"]::before{
  content:"▤";
}

.qwrap .ql-toolbar.ql-snow .ql-picker-label{
  min-height:32px;
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--card);
  display:flex;
  align-items:center;
  padding:0 28px 0 10px;
  white-space:nowrap;
  overflow:hidden;
}

.qwrap .ql-toolbar.ql-snow .ql-picker-options{
  border-color:var(--border);
  border-radius:8px;
  background:var(--card);
  box-shadow:var(--shadow);
  padding:6px;
}

.qwrap .ql-toolbar.ql-snow .ql-picker-item{
  border-radius:8px;
  padding:6px 8px;
  white-space:nowrap;
}

.qwrap .ql-toolbar.ql-snow .ql-picker.ql-size .ql-picker-label::before,
.qwrap .ql-toolbar.ql-snow .ql-picker.ql-size .ql-picker-item::before{
  content:"Orta";
}

.qwrap .ql-toolbar.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before,
.qwrap .ql-toolbar.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before{
  content:"Küçük";
  font-size:16px;
}

.qwrap .ql-toolbar.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before,
.qwrap .ql-toolbar.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before{
  content:"Büyük";
  font-size:20px;
}

.qwrap .ql-toolbar.ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before,
.qwrap .ql-toolbar.ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before{
  content:"Daha Büyük";
  font-size:20px;
}

.qwrap .ql-editor .ql-size-small{ font-size:18px; }
.qwrap .ql-editor .ql-size-large{ font-size:26px; }
.qwrap .ql-editor .ql-size-huge{ font-size:32px; }

.chapterActions.isPublished #btnSmartSaveChapter{
  order:1;
}

.chapterActions.isPublished #btnSaveDraft{
  order:2;
}

.chapterActions.isPublished #btnPublish{
  display:none;
}

.toasts{
  right:24px;
  bottom:24px;
}

.toast{
  border-radius:8px;
  border-color:var(--border);
  background:var(--card);
  color:var(--text);
  box-shadow:var(--shadow);
}

@media (max-width: 1100px){
  .wrap{
    grid-template-columns:1fr;
    height:auto;
    min-height:100vh;
    padding:16px;
  }

  .topbar{
    position:static;
    display:flex;
    width:auto;
    max-width:none;
    height:auto;
    min-height:auto;
    grid-column:1;
    flex-direction:row;
    flex-wrap:wrap;
    align-items:center;
    overflow:visible;
  }

  .sidebarProfile{
    flex:1 1 260px;
  }

  .topbar .nav{
    flex:1 1 100%;
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }

  .topbarActions{
    margin-top:0;
    margin-left:auto;
    padding-top:0;
    border-top:0;
  }

  .card{
    grid-column:1;
    height:auto;
    min-height:auto;
  }

  .card .body{
    overflow:visible;
  }

  .loginHero{
    grid-template-columns:1fr;
  }
}

@media (max-width: 720px){
  .wrap{
    padding:10px;
  }

  .topbar,
  .card,
  .subcard{
    border-radius:8px;
  }

  .card h2,
  .body,
  .nav,
  .subhead,
  .subbody{
    padding:16px;
  }

  .topbar{
    align-items:stretch;
    flex-direction:column;
  }

  .topbar .nav{
    grid-template-columns:1fr;
  }

  .topbarActions{
    margin-left:0;
  }

  .panelStoreRow{
    grid-template-columns:1fr;
  }

  .itemTop,
  .chapterRow{
    flex-direction:column;
    align-items:stretch;
  }

  .bookCard .itemTop{
    display:grid;
    grid-template-columns:78px minmax(0, 1fr) auto;
    align-items:center;
  }

  .bookCoverThumb{
    width:78px;
    height:110px;
    flex-basis:78px;
  }

  .actions,
  .actions button{
    width:100%;
  }

  .bookCard .actions{
    width:auto;
  }

  .bookMenuToggle{
    width:38px !important;
  }
}

.card,
.subcard,
.item,
.qwrap,
.coverBox,
.coverEmpty,
.mediaDrop,
.videoFrameWrap,
.videoLink,
.toast,
input,
select,
textarea,
button,
.btnLink,
.chip,
.statusPill,
.storeBtn,
.helpBox,
.passBtn{
  border-radius:8px !important;
}

/* Responsive repair */
html,
body{
  max-width:100%;
  overflow-x:hidden;
}

.wrap,
.topbar,
.card,
.card .body,
.card .body > section,
.subcard,
.subhead,
.subbody,
.qwrap{
  min-width:0;
}

img,
video,
iframe{
  max-width:100%;
}

@media (max-width: 1100px){
  body{
    overflow:auto;
  }

  .wrap{
    width:100%;
    max-width:none;
    height:auto;
    min-height:100vh;
    grid-template-columns:minmax(0, 1fr);
    gap:12px;
    padding:12px;
  }

  .topbar{
    position:relative;
    top:auto;
    width:100%;
    max-width:100%;
    height:auto;
    min-height:0;
    display:grid;
    grid-template-columns:minmax(0, 1fr);
    gap:12px;
    overflow:visible;
  }

  .sidebarProfile{
    width:100%;
    display:grid;
    grid-template-columns:130px minmax(0, 1fr);
    gap:10px;
    align-items:stretch;
  }

  .sidebarAvatarWrap{
    min-height:96px;
  }

  .sidebarProfileInfo{
    align-self:stretch;
    align-content:stretch;
  }

  .topbar .nav{
    width:100%;
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:6px;
  }

  .topbarActions{
    width:100%;
    margin-left:0;
    padding-top:10px;
    border-top:1px solid var(--border);
  }

  .card{
    width:100%;
    height:auto;
    min-height:60vh;
  }

  .card .body{
    overflow:visible;
  }

  .subhead{
    align-items:stretch;
  }

  .subhead .btns{
    justify-content:flex-start;
  }

  .qwrap .ql-toolbar.ql-snow{
    align-items:flex-start;
  }
}

@media (max-width: 720px){
  .wrap{
    padding:8px;
    gap:10px;
  }

  .topbar{
    padding:12px;
  }

  .brand{
    grid-template-columns:40px minmax(0, 1fr);
    padding-bottom:10px;
  }

  .sidebarProfile{
    grid-template-columns:88px minmax(0, 1fr);
    gap:8px;
    padding:8px;
  }

  .sidebarAvatarWrap{
    min-height:88px;
    padding:6px;
  }

  .sidebarAvatarFrame,
  .sidebarAvatarFrame #profileImg,
  .sidebarAvatarEmpty{
    width:58px;
    height:58px;
  }

  .sidebarAvatarMenu{
    bottom:4px;
  }

  .sidebarProfileRow{
    padding:4px 8px;
  }

  .topbar .nav{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .topbar .nav button{
    min-height:36px;
    padding:8px;
    font-size:13px;
  }

  .themeToggle{
    min-height:36px;
  }

  .card h2{
    padding:18px;
    font-size:22px;
  }

  .body{
    padding:0;
  }

  .subhead,
  .subbody{
    padding:14px;
  }

  .btns,
  .chapterActions{
    align-items:stretch;
  }

  .btns button,
  .btns .btnLink{
    flex:1 1 150px;
  }

  .chapterYoutubeRow{
    grid-template-columns:1fr;
  }

  .chapterMediaDrop{
    min-height:210px;
    padding:18px;
  }

  .qwrap .ql-toolbar.ql-snow{
    gap:5px;
    padding:8px;
  }

  .qwrap .ql-toolbar.ql-snow .ql-picker.ql-size{
    width:150px;
  }

  .qwrap .ql-editor{
    min-height:280px;
    padding:18px;
  }
}

@media (max-width: 480px){
  .sidebarProfile{
    grid-template-columns:1fr;
  }

  .topbar .nav{
    grid-template-columns:1fr;
  }

  .bookCard .itemTop{
    grid-template-columns:70px minmax(0, 1fr) 38px;
    gap:10px;
  }

  .bookCoverThumb{
    width:70px;
    height:98px;
    flex-basis:70px;
  }

  .panelStoreRow{
    width:100%;
  }
}

/* Responsive hamburger shell */
@media (max-width: 1100px){
  .wrap{
    width:100%;
    max-width:100%;
    height:auto;
    min-height:100vh;
    padding:84px 12px 12px;
    display:grid;
    grid-template-columns:minmax(0, 1fr);
    gap:14px;
    align-items:start;
    overflow-x:hidden;
  }

  .topbar{
    position:fixed;
    top:0;
    left:0;
    right:0;
    grid-column:1;
    width:auto;
    max-width:100%;
    height:auto;
    min-height:0;
    padding:12px;
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    grid-auto-flow:row;
    align-items:center;
    align-content:start;
    justify-content:stretch;
    gap:10px;
    overflow:visible;
    border-radius:0 0 8px 8px;
    z-index:120;
  }

  .topbar .brand{
    grid-column:1;
    grid-row:1;
    min-width:0;
    padding-bottom:0;
    border-bottom:0;
  }

  .mobileMenuToggle{
    display:inline-flex !important;
    grid-column:2;
    grid-row:1;
    justify-self:end;
  }

  .topbar .sidebarProfile:not(.hide),
  .topbar .nav:not(.hide),
  .topbar .topbarActions{
    display:none;
  }

  .topbar.menuOpen .sidebarProfile:not(.hide){
    display:grid;
    grid-column:1 / -1;
    grid-template-columns:110px minmax(0, 1fr);
    gap:10px;
    padding:10px;
    width:100%;
  }

  .topbar.menuOpen .sidebarAvatarWrap{
    min-height:92px;
  }

  .topbar.menuOpen .sidebarProfileInfo{
    align-self:stretch;
    align-content:center;
  }

  .topbar.menuOpen .nav:not(.hide){
    display:grid;
    grid-column:1 / -1;
    width:100%;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:8px;
    padding-top:8px;
    border-top:1px solid var(--border);
  }

  .topbar.menuOpen .nav button{
    width:100%;
    min-height:38px;
    padding:8px 10px;
    text-align:left;
  }

  .topbar.menuOpen .topbarActions{
    display:grid;
    grid-column:1 / -1;
    width:100%;
    margin-left:0;
    padding-top:8px;
    border-top:1px solid var(--border);
  }

  .topbar.menuOpen .themeToggle{
    width:100%;
    min-height:38px;
  }

  .card{
    grid-column:1;
    width:100%;
    min-width:0;
    height:auto;
    min-height:calc(100vh - 120px);
  }

  .card .body{
    overflow:visible;
  }
}

@media (max-width: 720px){
  .wrap{
    padding:80px 8px 8px;
    gap:10px;
  }

  .topbar{
    top:0;
    left:0;
    right:0;
    padding:10px;
  }

  .topbar.menuOpen .sidebarProfile:not(.hide){
    grid-template-columns:92px minmax(0, 1fr);
    padding:8px;
  }

  .topbar.menuOpen .sidebarAvatarWrap{
    min-height:86px;
  }

  .topbar.menuOpen .nav:not(.hide){
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px){
  .topbar.menuOpen .sidebarProfile:not(.hide){
    grid-template-columns:1fr;
  }

  .topbar.menuOpen .sidebarAvatarWrap{
    min-height:120px;
  }

  .topbar.menuOpen .nav:not(.hide){
    grid-template-columns:1fr;
  }

  .topbar.menuOpen .nav button{
    justify-content:flex-start;
  }
}

/* Mobile menu opens over the page instead of pushing content down */
@media (max-width: 1100px){
  .topbar{
    position:fixed !important;
    top:0 !important;
    overflow:visible !important;
  }

  .topbar .mobileMenuPanel{
    position:absolute;
    left:0;
    right:0;
    top:100%;
    display:none;
    width:100%;
    max-height:calc(100vh - 92px);
    overflow-x:hidden;
    overflow-y:auto;
    padding:10px;
    border:1px solid var(--border);
    border-top:0;
    border-radius:0 0 8px 8px;
    background:var(--panel);
    box-shadow:var(--shadow);
    z-index:80;
  }

  .topbar.menuOpen .mobileMenuPanel{
    display:grid;
    grid-template-columns:minmax(0, 1fr);
    gap:10px;
  }

  .topbar .mobileMenuPanel .sidebarProfile:not(.hide),
  .topbar .mobileMenuPanel .nav:not(.hide),
  .topbar .mobileMenuPanel .topbarActions{
    grid-column:1;
    width:100%;
  }

  .topbar.menuOpen .mobileMenuPanel .sidebarProfile:not(.hide){
    display:grid;
    grid-template-columns:110px minmax(0, 1fr);
    gap:10px;
    padding:10px;
  }

  .topbar.menuOpen .mobileMenuPanel .nav:not(.hide){
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:8px;
    padding:8px 0 0;
    border-top:1px solid var(--border);
  }

  .topbar.menuOpen .mobileMenuPanel .topbarActions{
    display:grid;
    margin:0;
    padding:8px 0 0;
    border-top:1px solid var(--border);
  }
}

@media (max-width: 720px){
  .topbar.menuOpen .mobileMenuPanel .sidebarProfile:not(.hide){
    grid-template-columns:92px minmax(0, 1fr);
  }

  .topbar.menuOpen .mobileMenuPanel .nav:not(.hide){
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px){
  .wrap{
    padding-top:78px;
  }

  .topbar{
    left:0;
    right:0;
  }

  .topbar .mobileMenuPanel{
    max-height:calc(100vh - 78px);
  }

  .topbar.menuOpen .mobileMenuPanel .sidebarProfile:not(.hide),
  .topbar.menuOpen .mobileMenuPanel .nav:not(.hide){
    grid-template-columns:minmax(0, 1fr);
  }
}

/* Fixed mobile shell sizing */
@media (max-width: 1100px){
  .wrap{
    --mobile-topbar-height:88px;
    padding-top:calc(var(--mobile-topbar-height) + 16px);
  }

  .topbar{
    box-sizing:border-box;
    height:var(--mobile-topbar-height);
    min-height:var(--mobile-topbar-height);
  }

  .topbar .mobileMenuPanel{
    top:100%;
    height:calc(100dvh - var(--mobile-topbar-height));
    max-height:none;
  }
}

@supports not (height: 100dvh){
  @media (max-width: 1100px){
    .topbar .mobileMenuPanel{
      height:calc(100vh - var(--mobile-topbar-height));
    }
  }
}

@media (max-width: 720px){
  .wrap{
    --mobile-topbar-height:108px;
  }
}

@media (max-width: 1100px){
  html.mobileMenuLocked,
  body.mobileMenuLocked{
    overflow:hidden;
    overscroll-behavior:none;
  }

  body.mobileMenuLocked{
    touch-action:none;
  }

  body.mobileMenuLocked .mobileMenuPanel{
    touch-action:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
}

/* Login shell: public auth pages do not use the editor sidebar */
body.loginMode{
  background:
    linear-gradient(180deg, #f7fbff 0%, #eef4f8 48%, #e8f1ee 100%);
}

body.loginMode .wrap{
  width:100%;
  max-width:none;
  min-height:100vh;
  height:auto;
  padding:clamp(18px, 4vw, 48px);
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  place-items:center;
}

body.loginMode .topbar{
  display:none !important;
}

body.loginMode .card{
  grid-column:1;
  width:min(1180px, 100%);
  height:auto;
  min-height:0;
  max-height:none;
  overflow:hidden;
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.92);
  box-shadow:0 24px 70px rgba(15,23,42,.12);
}

body.loginMode .card h2{
  display:none;
}

body.loginMode .card .body{
  overflow:visible;
  padding:0;
}

body.loginMode #viewLogin:not(.hide),
body.loginMode #viewHelp:not(.hide){
  min-height:0;
  display:block;
}

body.loginMode .loginHero{
  display:grid;
  grid-template-columns:minmax(300px, .9fr) minmax(360px, 1.1fr);
  gap:18px;
  padding:18px;
  align-items:stretch;
}

.loginBrandPanel{
  grid-column:1 / -1;
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  border:1px solid var(--border);
  border-radius:8px;
  background:
    linear-gradient(135deg, rgba(37,99,235,.10), rgba(0,168,107,.10)),
    var(--surfaceSoft);
}

.loginMark{
  flex:0 0 auto;
  width:46px;
  height:46px;
  border-radius:8px;
  display:grid;
  place-items:center;
  color:white;
  font-size:23px;
  font-weight:950;
  background:var(--grad);
}

.loginBrandCopy{
  min-width:0;
  display:grid;
  gap:4px;
}

.loginEyebrow{
  color:var(--brand);
  font-size:12px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:0;
}

.loginBrandName{
  margin:0;
  color:var(--text);
  font-size:22px;
  line-height:1.05;
  font-weight:950;
}

body.loginMode .loginLeft,
body.loginMode .loginRight{
  border:1px solid var(--border);
  box-shadow:none;
}

body.loginMode .loginLeft{
  background:
    linear-gradient(180deg, rgba(255,255,255,.92), rgba(239,247,244,.92)),
    var(--card);
}

body.loginMode .loginLeft .subbody,
body.loginMode .loginRight .subbody{
  padding:24px;
  gap:18px;
}

.loginFormTitle{
  color:var(--text);
  font-size:20px;
  line-height:1.2;
  font-weight:950;
}

body.loginMode .loginLeft .row{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

body.loginMode .loginLeft input{
  min-height:54px;
  font-size:15px;
  background:white;
}

body.loginMode .loginLeft .btns{
  display:grid;
  grid-template-columns:auto minmax(0, 1fr);
  align-items:center;
  gap:12px;
}

body.loginMode .loginLeft #btnLogin{
  min-height:52px;
  padding:0 26px;
}

body.loginMode .loginLeft #btnHelp{
  min-height:52px;
}

body.loginMode .loginRight .subhead{
  padding:22px 24px;
}

body.loginMode .loginRight .meta{
  padding:18px;
  line-height:1.75;
  background:var(--surfaceSoft);
}

body.loginMode .btnLink{
  min-height:50px;
}

body.loginMode .loginStoreRow{
  width:100%;
  justify-self:stretch;
}

@media (max-width: 900px){
  body.loginMode .loginHero{
    grid-template-columns:1fr;
  }
}

@media (max-width: 620px){
  body.loginMode .wrap{
    padding:10px;
    place-items:start;
  }

  body.loginMode .card{
    width:100%;
    min-height:calc(100vh - 20px);
  }

  body.loginMode .loginHero{
    padding:10px;
    gap:10px;
  }

  .loginBrandPanel{
    align-items:center;
    padding:14px;
  }

  .loginMark{
    width:44px;
    height:44px;
    font-size:22px;
  }

  body.loginMode .loginLeft .subbody,
  body.loginMode .loginRight .subbody,
  body.loginMode .loginRight .subhead{
    padding:18px;
  }

  body.loginMode .loginLeft .btns{
    grid-template-columns:1fr;
  }
}
