[hidden] { display: none !important; }
:root {
  --bg: #f4f6fa; --card: #fff; --line: #e3e7ee; --txt: #111827; --mut: #6b7280;
  --blue: #1a6ae5; --green: #1d7a3a; --red: #d0302f; --slate: #4b5563; --indigo: #4f46e5; --amber: #b45309;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--txt); font: 15px/1.5 system-ui, "Segoe UI", "Nirmala UI", sans-serif; }
.wrap { max-width: 1260px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin-bottom: 20px; }
h1 { font-size: 30px; margin: 0; } h2 { font-size: 22px; margin: 0; }
.titlebar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.muted { color: var(--mut); } .small { font-size: 12.5px; } .strong { font-weight: 600; }
.green { color: var(--green); } .red { color: var(--red); } .blue { color: var(--blue); } .gray { color: var(--mut); } .amber { color: var(--amber); }

.drop { border: 2px dashed #b7c0cf; border-radius: 12px; background: #fafbfd; padding: 40px 16px; text-align: center; cursor: pointer; margin: 16px 0; }
.drop.over { border-color: var(--blue); background: #eef4ff; }
.drop-title { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.drop .btn { margin-top: 14px; }

.btn { display: inline-block; border: 0; border-radius: 7px; padding: 8px 14px; font: 600 13.5px system-ui, sans-serif; color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; }
.btn-blue { background: var(--blue); } .btn-green { background: var(--green); } .btn-red { background: var(--red); }
.btn-slate { background: var(--slate); } .btn-indigo { background: var(--indigo); } .btn-amber { background: var(--amber); }
.btn-ghost { background: transparent; color: var(--txt); border: 1px solid var(--line); }
.btn-ghost.on { background: #eef2f7; }

select, input[type=text], input[type=number] { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }

.picked { list-style: none; padding: 0; margin: 0 0 12px; }
.picked li { display: grid; grid-template-columns: 1fr auto 140px 150px 24px; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.picked .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picked .x { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--mut); }

.settings { margin: 6px 0 14px; } .settings summary { cursor: pointer; color: var(--mut); }
.settings-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
.settings-row label { display: flex; flex-direction: column; font-size: 13px; color: var(--mut); gap: 4px; }

.table-scroll { overflow-x: auto; }
table.jobs { width: 100%; border-collapse: collapse; }
.jobs th { text-align: left; font-size: 13px; color: #374151; padding: 10px; border-bottom: 1px solid var(--line); }
.jobs td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.jobs td.file { max-width: 380px; word-break: break-word; }
.jobs .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.jobs td { vertical-align: middle; }
.bar { height: 8px; background: #e6e9ef; border-radius: 6px; overflow: hidden; min-width: 160px; }
.bar i { display: block; height: 100%; background: var(--green); transition: width .4s; }
.bar i.blue-bg { background: var(--blue); } .bar i.gray-bg { background: #9ca3af; } .bar i.red-bg { background: var(--red); }
.small-bar { min-width: 0; height: 6px; }
.pager { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 12px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 50; }
.toast.bad { background: var(--red); }

@media (max-width: 700px) {
  .picked li { grid-template-columns: 1fr auto 24px; } .picked .bar, .picked li > .small:not(.muted) { display: none; }
}

.banner { border-radius: 10px; padding: 12px 14px; margin: 10px 0 4px; line-height: 1.6; }
.banner.info { background: #eef4ff; border: 1px solid #c7d8fb; }
.banner.bad { background: #fff1f0; border: 1px solid #f5c2bf; }
.banner.warn { background: #fff8e6; border: 1px solid #f3dca2; }
.banner code { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; word-break: break-all; }
.banner ol { margin: 6px 0 0; padding-left: 20px; }

.btn-violet, .btn-ai { background: #7c3aed; }
.ai-sum { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; }
.ai-big { font-size: 26px; font-weight: 700; }
.ai-note { font-size: 12.5px; color: var(--mut); margin-top: 6px; }
.ai-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: #e6e9ef; margin: 8px 0; }
.ai-bar i { display: block; height: 100%; }
.ai-seg { border-left: 4px solid #cbd5e1; padding: 6px 10px; margin: 8px 0; background: #f8fafc; border-radius: 0 6px 6px 0; cursor: pointer; }
.ai-seg.ai { border-color: #dc2626; background: #fef2f2; }
.ai-seg.unclear { border-color: #d97706; background: #fffbeb; }
.ai-seg.human { border-color: #16a34a; background: #f0fdf4; }
.ai-seg .meta { font-size: 12px; color: var(--mut); margin-bottom: 2px; }
.ai-seg .txt { font-size: 14px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ai-seg.open .txt { -webkit-line-clamp: unset; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* download progress popup */
.xp-wrap { position: fixed; inset: 0; background: rgba(17, 24, 39, .35); display: grid; place-items: center; z-index: 1000; padding: 16px; }
.xp { width: 100%; max-width: 420px; background: #fff; border-radius: 14px; padding: 20px 22px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.35); }
.xp-head { display: flex; justify-content: space-between; align-items: center; font-size: 17px; }
.xp-x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--mut); padding: 0 4px; }
.xp-name { color: var(--mut); font-size: 13.5px; margin: 2px 0 14px; }
.xp-bar { height: 10px; background: #e5e7eb; border-radius: 6px; overflow: hidden; }
.xp-bar i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 6px; transition: width .4s ease; }
.xp.bad .xp-bar i { background: var(--red); }
.xp-row { display: flex; justify-content: space-between; margin-top: 8px; font-size: 14px; }
.xp.bad .xp-row span { color: var(--red); }
.xp-note { font-size: 12.5px; color: var(--mut); margin-top: 12px; }
.xp-btns { margin-top: 14px; text-align: right; }

.go-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }

.ai-verdict { font-size: 16px; font-weight: 700; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; border: 1px solid; }
.ai-verdict.ai { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.ai-verdict.mixed { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ai-verdict.human { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.ai-verdict.na { background: #f8fafc; border-color: var(--line); color: var(--mut); }

/* folders */
.jobs-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.jobs-tools input[type=search] { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; min-width: 220px; }
.folders { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 12px; }
.fchip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: 600 13px system-ui, sans-serif; cursor: pointer; color: var(--txt); }
.fchip:hover { background: #f3f6fb; }
.fchip.on { background: #e8f0fe; border-color: #a8c4f5; color: #1a4fb0; }
.fchip .n { color: var(--mut); font-weight: 500; margin-left: 2px; }
.fchip.add { border-style: dashed; color: var(--blue); }
.fopts { font-size: 13px; margin-left: 4px; }
.bulk { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #eef4ff; border: 1px solid #c7d8fb; border-radius: 9px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
.bulk select { margin-left: 4px; }
.jobs th.chk, .jobs td.chk { width: 28px; padding-right: 0; }
.jobs tr.sel td { background: #f5f8ff; }
.fbadge { display: inline-block; margin-left: 6px; font-size: 11.5px; color: #1a4fb0; background: #e8f0fe; border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }

/* Word menu */
.wmenu { position: relative; display: inline-block; }
.wmenu > summary { list-style: none; }
.wmenu > summary::-webkit-details-marker { display: none; }
.wmenu-list { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; min-width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.25); padding: 6px; }
.wmenu-list a { display: block; padding: 8px 10px; border-radius: 7px; color: var(--txt); text-decoration: none; font-size: 13.5px; white-space: normal; }
.wmenu-list a:hover { background: #eef2ff; }
.wmenu-list a span { display: block; color: var(--mut); font-size: 12px; margin-top: 2px; }
.fbadge.dupb { background: #fff4e0; color: #9a5b00; text-decoration: none; cursor: pointer; }
.fbadge.dupb:hover { background: #ffe8bf; }
#pickSum { margin: 6px 0 2px; color: #334155; }
/* folders: 4 chip + "more" list */
.folders details.fmore { position: relative; }
.folders details.fmore > summary { list-style: none; }
.folders details.fmore > summary::-webkit-details-marker { display: none; }
.folders details.fmore[open] > summary { background: #e8f0fe; border-color: #a8c4f5; }
.fmore-list { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 280px; max-width: 85vw; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px -12px rgba(30, 41, 80, .3); padding: 8px; }
.fmore-q { width: 100%; font: inherit; padding: 7px 10px; border: 1px solid #d5dbe5; border-radius: 8px; margin-bottom: 6px; }
.fmore-items { max-height: 280px; overflow: auto; display: grid; }
.fitem { display: flex; gap: 6px; align-items: center; text-align: left; border: 0; background: none; padding: 7px 8px; border-radius: 8px;
  font: 600 13px system-ui, sans-serif; color: var(--txt); cursor: pointer; }
.fitem:hover { background: #f3f6fb; }
.fitem .n { margin-left: auto; color: var(--mut); font-weight: 500; }
.fmore-none { padding: 6px 8px; }
.fitem.on { background: #e8f0fe; color: #1a4fb0; }
/* AI check: kaunsi files chal rahi hain */
.aiq { border: 1px solid #e3d9fb; background: #faf7ff; border-radius: 10px; padding: 10px 12px; margin: 4px 0 12px; font-size: 13.5px; }
.aiq-h { margin-bottom: 6px; }
.aiq-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; flex-wrap: wrap; }
.aiq-row a { color: #4c1d95; text-decoration: none; } .aiq-row a:hover { text-decoration: underline; }
.aiq-dot { width: 8px; height: 8px; border-radius: 50%; background: #7c3aed; animation: aiqp 1.2s ease-in-out infinite; flex: none; }
@keyframes aiqp { 50% { opacity: .25; } }
.aiq-bar { width: 140px; height: 6px; background: #ece6fb; border-radius: 4px; overflow: hidden; }
.aiq-bar i { display: block; height: 100%; background: #7c3aed; }
.aiq-wait { margin-top: 4px; }
@media (prefers-reduced-motion: reduce) { .aiq-dot { animation: none; } }
.prio { color: #d97706; font-weight: 700; }
.prio-btn { padding: 1px 7px !important; font-size: 11.5px !important; margin-left: 4px; }
.aiq-paused { opacity: .9; }
.aiq-row.aiq-prio a { color: #b45309; }
.aiq-row.aiq-prio .aiq-dot { background: #d97706; }
.prio-box { display: inline-flex; gap: 6px; flex-wrap: wrap; } .prio-box .btn { padding: 5px 10px; font-size: 12.5px; }
.aiq-toggle { margin-left: 10px; padding: 4px 10px !important; font-size: 12.5px !important; vertical-align: 3px; color: #5b21b6; border-color: #e3d9fb; }
.aiq-toggle .n { color: var(--mut); font-weight: 500; }
.aiq-toggle.on { background: #faf7ff; }
/* har file ki settings */
.fset-btn { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 2px 8px; font: 12px system-ui, sans-serif; color: var(--mut); cursor: pointer; white-space: nowrap; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.fset-btn:hover { background: #f3f6fb; }
.fset-btn.on { border-color: #a8c4f5; background: #e8f0fe; color: #1a4fb0; }
.fset { white-space: nowrap; }
.jset { margin-top: 2px; }
.set-dlg { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; width: min(720px, calc(100vw - 32px)); box-shadow: 0 24px 60px -24px rgba(30, 41, 80, .35); }
.set-dlg::backdrop { background: rgba(15, 23, 42, .35); }
.set-dlg h3 { margin: 0 0 4px; font-size: 17px; }
.set-dlg .settings-row { margin: 14px 0; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; }
.picked li { grid-template-columns: 1fr auto minmax(120px, 230px) 140px 150px 24px; }
.picked .fset-btn, .picked .fset { justify-self: start; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 700px) { .picked li { grid-template-columns: 1fr auto 24px; } .picked .fset-btn { grid-column: 1 / -1; } }
/* ⚙ Running menu */
.runmenu { position: relative; display: inline-block; }
.runmenu > summary { list-style: none; cursor: pointer; }
.runmenu > summary::-webkit-details-marker { display: none; }
.run-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #e5e7eb; color: #374151; font-size: 11.5px; text-align: center; margin-left: 2px; }
.run-n.on { background: #7c3aed; color: #fff; }
.runmenu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 400px; max-width: calc(100vw - 32px); max-height: 70vh; overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px -12px rgba(30, 41, 80, .3); padding: 10px 12px; text-align: left; }
.run-h { font-weight: 700; font-size: 13px; margin: 6px 0 4px; }
.run-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.run-row:last-child { border-bottom: 0; }
.run-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-name a { color: var(--txt); text-decoration: none; font-weight: 600; } .run-name a:hover { text-decoration: underline; }
.run-prog { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.run-prog .aiq-bar { width: 120px; height: 6px; background: #ece6fb; border-radius: 4px; overflow: hidden; flex: none; }
.run-prog .aiq-bar i { display: block; height: 100%; background: #7c3aed; }
.run-none { padding: 2px 0 6px; }

/* AI result: user ka sudhar */
.ai-seg .fb { display: none; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.ai-seg.open .fb { display: flex; }
.ai-seg .fb .btn { padding: 3px 10px; font-size: 12.5px; }
.ai-seg .fb .btn:disabled { opacity: .45; cursor: default; }
.fb-tag { color: #6d28d9; font-weight: 600; }

/* 👥 share */
.fbadge.shb { background: #ecfeff; color: #155e75; }
.fbadge.shn { background: #f5f3ff; color: #5b21b6; text-decoration: none; }
.share-dlg { width: min(520px, calc(100vw - 32px)); }
.share-dlg #shQ { width: 100%; box-sizing: border-box; font: inherit; padding: 7px 10px; border: 1px solid #d5dbe5; border-radius: 8px; margin: 6px 0; }
.share-dlg .sh-users { display: block; width: 100%; box-sizing: border-box; }
.share-dlg .sh-users label.sh-u { display: flex !important; flex-direction: row; grid-template-columns: none; width: 100%; box-sizing: border-box; margin: 0; }
.share-dlg .sh-users label.sh-u[hidden] { display: none !important; }
.share-dlg .sh-users label.sh-u input { margin: 0; width: auto; }
.sh-users { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.sh-u { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.sh-u:hover { background: #f1f5f9; }
.sh-now { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sh-pill { display: inline-flex; align-items: center; gap: 4px; background: #f5f3ff; color: #4c1d95; border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 13px; }
.sh-pill button { border: 0; background: none; cursor: pointer; color: #6d28d9; font-size: 12px; padding: 0 6px; }

/* ⚡ Folder first */
.fprio { color: #b45309; font-weight: 700; }
.fchip .fprio { background: #fef3c7; border-radius: 6px; padding: 0 4px; font-size: 12px; }

/* Jobs list: AI haal ek nazar me + ⋯ menu */
.btn.aires { color: #fff; white-space: nowrap; }
.btn.aires small { font-weight: 500; opacity: .9; font-size: 12px; }
.btn.aires.ai { background: #dc2626; } .btn.aires.mixed { background: #d97706; } .btn.aires.human { background: #16a34a; }
.btn.aires.na { background: #94a3b8; } .btn.aires.run { background: #ede9fe; color: #5b21b6; cursor: default; }
.wmenu.more > summary { padding-left: 12px; padding-right: 12px; font-weight: 700; letter-spacing: 1px; }
.wmenu.more .wmenu-list { min-width: 240px; }
.wmenu-list a.red b { color: #b91c1c; }
.jobs .actions { flex-wrap: nowrap; }
.jobs td.file { max-width: 340px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .jobs .actions { flex-wrap: wrap; } }

/* bhasha badge */
.lbadge { color: #475569; margin-top: 1px; }
.lbadge b { font-weight: 600; }
.lbadge.hi b { color: #9a3412; } .lbadge.en b { color: #1d4ed8; } .lbadge.bn b { color: #047857; } .lbadge.mixed { color: #6d28d9; }

/* AI tab: badi kitaab ke hisse chhaanto */
.ai-filter { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0 4px; font-size: 13px; color: var(--mut); }
.ai-filter .btn { padding: 4px 10px; font-size: 12.5px; }
.ai-filter .btn.on { background: #1e293b; color: #fff; }

/* 📅 chhapne ka saal */
.fbadge.yr { background: #f1f5f9; color: #334155; text-decoration: none; }
.fbadge.yr.old { background: #dcfce7; color: #166534; }

/* Hindi page: folder se kitaabein tick */
.fpick { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.fpick select { flex: 1; min-width: 180px; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid #d5dbe5; border-radius: 7px; }
.fpick .btn { padding: 4px 10px; font-size: 12.5px; }

/* v97: saal pe shak (admin) */
.fbadge.yr.ydoubt { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.isbn-t { width: 100%; border-collapse: collapse; font-size: 13px; }
.isbn-t th, .isbn-t td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.isbn-t th { font-size: 12px; color: var(--mut); font-weight: 600; position: sticky; top: 0; background: var(--card, #fff); }
.isbn-t tr.dbt td { background: #fffbeb; }
.isbn-t .mono { font-family: ui-monospace, monospace; white-space: nowrap; }
