/* Giao diện xanh Chỉnh Nha Số (logo #0755ed / #00cde2), duyệt mock-up 2026-10-15 */
:root {
  --primary: #0755ed;
  --primary-soft: #e8efff;
  --cyan: #00cde2;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-subtle: #f6f8fb;
  --border: #dfe5ee;
  --text: #0d1b3e;
  --text-muted: #4a5873;
  --text-soft: #8592a8;
  --warn-soft: #fff6e5;
  --warn: #8a5300;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --gift: #e11d48;
  --gift-hover: #be123c;
  --ok: #05603a;
  --ok-soft: #ecfdf3;
  --ok-border: #abefc6;
  --tg: #229ed9;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #5b8cff;
    --primary-soft: #16224a;
    --bg: #0b1020;
    --surface: #121a2e;
    --surface-subtle: #17213a;
    --border: #26324d;
    --text: #e8eefc;
    --text-muted: #a7b3cc;
    --text-soft: #6f7d99;
    --warn-soft: #2d2210;
    --warn: #f0b450;
    --bad: #ff8a80;
    --bad-soft: #3a1a17;
    --gift: #f43f5e;
    --gift-hover: #fb7185;
    --ok: #6ce9a6;
    --ok-soft: #0f2a1d;
    --ok-border: #1d4d35;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --primary: #5b8cff;
  --primary-soft: #16224a;
  --bg: #0b1020;
  --surface: #121a2e;
  --surface-subtle: #17213a;
  --border: #26324d;
  --text: #e8eefc;
  --text-muted: #a7b3cc;
  --text-soft: #6f7d99;
  --warn-soft: #2d2210;
  --warn: #f0b450;
  --bad: #ff8a80;
  --bad-soft: #3a1a17;
  --gift: #f43f5e;
  --gift-hover: #fb7185;
  --ok: #6ce9a6;
  --ok-soft: #0f2a1d;
  --ok-border: #1d4d35;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
a { color: var(--primary); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* line icons (stroke, 24 grid) */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* Đầu trang */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-in { max-width: 1120px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { width: 40px; height: 36px; flex: none; }
.brand-name { font-weight: 750; letter-spacing: -0.3px; color: #0b327a; font-size: 21px; white-space: nowrap; }
.brand-name i { font-style: normal; color: var(--cyan); }
.logo-dot { fill: var(--surface); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-name { color: #e3ebff; } }
:root[data-theme="dark"] .brand-name { color: #e3ebff; }
.app-sep { width: 1px; height: 24px; background: var(--border); }
.app-name { font-weight: 650; color: var(--text-muted); white-space: nowrap; }
.account { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-muted); min-width: 0; }
.avatar { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 750; font-size: 14px; }
.account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Công cụ khác trên thanh đầu trang */
.tools { display: flex; align-items: center; gap: 2px; min-width: 0; }
.tools a { padding: 7px 10px; border-radius: 8px; color: var(--text-muted); font-size: 14.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tools a:hover { background: var(--surface-subtle); color: var(--primary); }
.tools .tool-free {
  display: inline-flex; align-items: center; gap: 6px; color: #fff;
  background: linear-gradient(110deg, #0b327a, #0755ed, #00b8d4, #0755ed, #0b327a) 0 0 / 300% 100%;
  box-shadow: 0 2px 10px rgba(7, 85, 237, 0.35); animation: toolFlow 7s linear infinite;
}
.tools .tool-free:hover { color: #fff; background-color: transparent; filter: brightness(1.08); }
.tools .tool-free svg { width: 12px; height: 12px; fill: #ffd56b; animation: toolTwinkle 1.8s ease-in-out infinite; }
@keyframes toolFlow { to { background-position: 300% 0; } }
@keyframes toolTwinkle { 0%, 100% { transform: scale(0.7) rotate(0deg); opacity: 0.7; } 50% { transform: scale(1.15) rotate(45deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tools .tool-free, .tools .tool-free svg { animation: none; } }
@media (max-width: 1120px) { .account-name { display: none; } }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font-size: 14px; font-weight: 650; white-space: nowrap; }

/* Màn mở trang: logo động gần kín màn hình ~2 giây (app.js hideSplash) */
.splash {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center;
  background: #fff; transition: opacity 0.45s ease;
}
.splash.leaving { opacity: 0; pointer-events: none; }
.splash img { width: min(88vw, calc(80vh * 460 / 400)); height: auto; }
.splash-label { position: absolute; left: 0; right: 0; bottom: 32px; text-align: center; font-size: 14px; color: #8a96ab; }

.container { max-width: 1120px; margin: 0 auto; padding: 12px 24px 56px; }
.home { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 650; }
.home:hover { color: var(--primary); border-color: var(--primary); }
.home .ic { width: 16px; height: 16px; }

/* Bố cục đầu trang: ô gửi file phải thấy ngay khi mở trang (laptop 768px và điện thoại) */
.lay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); grid-template-areas: "title tg" "quota quota" "upload upload"; gap: 14px 24px; margin-top: 10px; }
.a-title { grid-area: title; align-self: center; }
.a-tg { grid-area: tg; }
.a-quota { grid-area: quota; }
.a-upload { grid-area: upload; }
h1 { font-size: 38px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 4px; }
.sub { margin: 0; color: var(--text-muted); font-size: 17px; }
h2 { font-size: 24px; margin: 28px 0 12px; letter-spacing: -0.01em; }

/* Kết nối Telegram (gọn) */
.tg { padding: 12px 14px; display: flex; gap: 12px; align-items: center; }
.tg-qr { width: 84px; height: 84px; flex: none; padding: 4px; background: #fff; border-radius: 8px; border: 1px solid var(--border); }
.tg-qr svg { display: block; width: 100%; height: 100%; }
.tg-main { min-width: 0; flex: 1; }
.tg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tg h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 7px; }
.tg-logo { width: 22px; height: 22px; flex: none; }
.tg-btn { margin-left: auto; display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 7px; background: var(--tg); color: #fff; text-decoration: none; font-weight: 700; font-size: 13px; }
.tg-btn:hover { filter: brightness(1.08); }
.tg ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 13.5px; line-height: 1.4; color: var(--text-muted); }
.tg li { display: flex; gap: 7px; align-items: flex-start; }
.tg li .ic { width: 15px; height: 15px; margin-top: 2px; color: var(--tg); }
.tg li b { color: var(--text); }
.tg.linked { font-size: 14px; color: var(--text-muted); }
.tg.linked b { color: var(--text); }
.tg-who { color: var(--text-soft); }
/* Hộp thoại nhắc kết nối Telegram sau khi gửi file, duyệt mock-up 2026-10-31 */
.tgd-scrim { position: fixed; inset: 0; z-index: 900; display: flex; padding: 16px; overflow-y: auto; background: rgba(13, 27, 62, 0.45); }
.tgd { width: 100%; max-width: 460px; margin: auto; padding: 22px; background: var(--surface); border-radius: 16px; box-shadow: 0 16px 48px rgba(13, 27, 62, 0.28); }
.tgd-body { display: grid; gap: 14px; }
.tgd-head { display: flex; align-items: center; gap: 11px; }
.tgd-head .tg-logo { width: 34px; height: 34px; }
.tgd h2 { margin: 0; font-size: 19px; line-height: 1.3; }
.tgd-lead { margin: 0; font-size: 14.5px; color: var(--text-muted); }
.tgd ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; font-size: 14.5px; line-height: 1.4; }
.tgd li { display: flex; gap: 9px; align-items: flex-start; }
.tgd li .ic { margin-top: 1px; color: var(--tg); }
.tgd-qr { display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--surface-subtle); border-radius: var(--radius); }
.tgd-qr-code { width: 112px; height: 112px; flex: none; padding: 6px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.tgd-qr-code svg { display: block; width: 100%; height: 100%; }
.tgd-qr p { margin: 0; min-width: 0; font-size: 14px; color: var(--text-muted); }
.tgd-qr b { display: block; margin-bottom: 2px; font-size: 15px; color: var(--text); }
.tgd-acts { display: flex; gap: 8px; }
.tgd-btn { flex: 1; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text-muted); font-size: 15px; font-weight: 650; text-decoration: none; cursor: pointer; }
.tgd-open { flex: 2; border-color: var(--tg); background: var(--tg); color: #fff; font-weight: 700; }
.tgd-open:hover { filter: brightness(1.08); }
.tgd-done { justify-items: center; gap: 10px; text-align: center; }
.tgd-done .ic { width: 44px; height: 44px; color: var(--ok); }
.tgd-done .tgd-btn { width: 100%; }
/* Góp ý / Báo lỗi: dòng dưới bảng tệp, hộp nhập dùng chung khung .tgd (như js/gop_y.js của app 2) */
.feedback-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 8px; margin: 12px 0 0; font-size: 14px; color: var(--text-muted); }
.feedback-line .link-btn { display: inline-flex; align-items: center; gap: 6px; }
.feedback-line .ic { width: 16px; height: 16px; }
.gopy-head { display: flex; align-items: center; gap: 10px; }
.gopy-head h2 { flex: 1; }
.gopy-x { width: 32px; height: 32px; flex: none; border: 0; border-radius: 50%; background: var(--surface-subtle); color: var(--text-muted); font-size: 18px; line-height: 1; cursor: pointer; }
.gopy-kind { display: flex; gap: 8px; }
.gopy-kind label { flex: 1; padding: 9px; border: 1.5px solid var(--border); border-radius: 10px; text-align: center; font-size: 14px; font-weight: 700; color: var(--text-muted); cursor: pointer; }
.gopy-kind input { position: absolute; opacity: 0; }
.gopy-kind label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.gopy-kind label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.gopy-field { display: grid; gap: 5px; font-size: 13.5px; font-weight: 650; color: var(--text-muted); }
.gopy-field input, .gopy-field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 15px; font-weight: 400; }
.gopy-field input:focus, .gopy-field textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.gopy-field textarea { min-height: 110px; resize: vertical; }
.gopy-field small { font-size: 12.5px; font-weight: 400; color: var(--text-soft); }
.gopy-err { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 13.5px; }
.gopy-send { flex: 2; border-color: var(--primary); background: var(--primary); color: #fff; font-weight: 700; }
.gopy-send:disabled { opacity: 0.6; cursor: default; }
.ic.ok { color: var(--ok); width: 22px; height: 22px; }

/* Số trang miễn phí + quyên góp */
.quota { padding: 14px 20px; }
.q-row { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.q-main { flex: 1 1 360px; }
.free-line { font-size: 17px; }
.free-line b { font-size: 20px; }
.quota .bar { height: 7px; margin: 6px 0; max-width: 620px; border: 0; background: var(--border); }
.free-split { font-size: 14px; color: var(--text-muted); }
.free-split .gift { color: var(--gift); }
.free-reset { font-size: 13px; color: var(--text-soft); }
.quota.out .free-line { color: var(--warn); font-weight: 650; }
.quota.out .bar { display: none; }
.q-don { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; }
.donate-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 20px; border-radius: 8px; border: 0; cursor: pointer; background: var(--gift); color: #fff; font-weight: 700; }
.donate-btn:hover { background: var(--gift-hover); }
.donate-btn:disabled { opacity: 0.7; cursor: wait; }
.donate-btn .ic { width: 18px; height: 18px; }
.donate-note { margin: 0; font-size: 13.5px; color: var(--text-muted); }
.nw { white-space: nowrap; }  /* chỉ ngắt dòng giữa các cụm, không ngắt giữa chừng */
.donate-note b { color: var(--gift); }
.donate-msg { margin: 10px 0 0; font-size: 14px; color: var(--text-muted); }
.donate-box { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; display: grid; grid-template-columns: 1fr auto; gap: 14px 28px; align-items: start; }
.donate-why { grid-column: 1 / -1; margin: 0; font-size: 14px; color: var(--text-muted); }
.bank { display: grid; gap: 4px; align-content: start; font-size: 15px; color: var(--text-muted); }
.bank b { color: var(--text); }
.content-code { display: inline-block; font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 15px; font-weight: 800; letter-spacing: 1px; padding: 1px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); }
.copy { display: inline-flex; vertical-align: middle; padding: 3px; margin-left: 2px; border: 0; border-radius: 6px; background: none; color: var(--text-soft); cursor: pointer; }
.copy:hover { color: var(--primary); background: var(--surface-subtle); }
.copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.copy.done { color: var(--ok); }
.warn { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 7px 12px; border-radius: 8px; background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 650; }
.warn .ic { width: 17px; height: 17px; }
.pay-qr { width: 172px; text-align: center; font-size: 13px; color: var(--text-muted); }
.pay-qr .q { width: 172px; height: 172px; padding: 6px; background: #fff; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 4px; }
.pay-qr img { display: block; width: 100%; height: 100%; object-fit: contain; }
.save-qr { margin-top: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 650; font-size: 14px; cursor: pointer; }
.save-qr:hover { border-color: var(--primary); color: var(--primary); }
.save-qr:disabled { opacity: 0.6; cursor: wait; }
.save-qr svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.save-hint { margin: 6px 0 0; font-size: 12px; color: var(--text-soft); text-align: left; }
.waiting { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--primary); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.thanks { margin-top: 12px; display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 10px; background: var(--ok-soft); border: 1px solid var(--ok-border); color: var(--ok); font-size: 15px; }
.thanks .ic { width: 20px; height: 20px; margin-top: 1px; }

/* Đăng nhập */
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; max-width: 340px;
  min-height: 48px; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  background: #fff; color: #1f2937; border: 1px solid #d0d5dd; font-weight: 700;
}
.google-btn svg { width: 22px; height: 22px; }
.google-btn:hover { box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.35); }

/* Cổng đăng nhập: chưa đăng nhập chỉ thấy cổng; đang hỏi phiên thì chưa hiện gì dưới màn mở trang */
body.auth-loading main, body.auth-loading .tools { visibility: hidden; }
.gate { display: none; }
body.signed-out .gate { display: block; }
body.signed-out .lay, body.signed-out #jobsPanel, body.signed-out #pdfTools, body.signed-out .foot,
body.signed-out .home { display: none; }
.gate-card { max-width: 520px; margin: 48px auto 24px; padding: 32px 28px; text-align: center; }
.gate-card h1 { margin-bottom: 6px; }
.gate-card .sub { margin-bottom: 22px; }
.gate-card > p:not(.sub):not(.msg) { margin: 0 0 16px; color: var(--text-muted); }
.gate-card .google-btn { margin: 0 auto; }
.gate-card .msg { color: var(--bad); }
.gate-foot { margin: 18px 0 0 !important; font-size: 14px; }

/* Gợi ý Công cụ PDF dưới ô gửi file (pdf-tools.css lo phần còn lại) */
.pdf-hint {
  position: relative; overflow: hidden; margin-top: 12px; padding: 11px 16px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px 16px;
  border: 1px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(120deg, var(--primary), var(--cyan)) border-box;
  box-shadow: none;
}
.pdf-hint::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 140% at 0% 0%, rgba(0, 205, 226, 0.12), transparent 55%),
    radial-gradient(90% 120% at 100% 100%, rgba(7, 85, 237, 0.10), transparent 60%); }
.pdf-hint > * { position: relative; }
.pdf-hint-art { width: 118px; height: auto; display: block; }
.pdf-hint-art .ph-page path:first-child { fill: var(--surface); stroke: var(--text-soft); stroke-width: 2.2; stroke-linejoin: round; }
.pdf-hint-art .ph-fold { fill: none; stroke: var(--text-soft); stroke-width: 2.2; stroke-linejoin: round; }
.pdf-hint-art .ph-line { fill: none; stroke: var(--border); stroke-width: 3.2; stroke-linecap: round; }
.pdf-hint-art .ph-tilt-b path { fill: var(--surface-subtle); }
.pdf-hint-art .ph-weight rect { fill: #ef4444; }
.pdf-hint-art .ph-weight text { fill: #fff; font: 800 12.5px var(--font); }
.pdf-hint-art .ph-lock rect { fill: #f59e0b; }
.pdf-hint-art .ph-lock circle, .pdf-hint-art .ph-lock path:last-child { fill: #fff; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.pdf-hint-art .ph-shackle { fill: none; stroke: #b45309; stroke-width: 4; stroke-linecap: round; }
.pdf-hint-art .ph-rotate path { fill: none; stroke: var(--primary); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.pdf-hint-kicker { margin: 0 0 1px; color: var(--primary); font-size: 11px; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; }
.pdf-hint h3 { margin: 0 0 7px; font-size: 16px; line-height: 1.25; letter-spacing: -0.01em; }
.pdf-hint-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ph-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-subtle); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ph-chip svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ph-chip.heavy svg { color: #ef4444; }
.ph-chip.locked svg { color: #f59e0b; }
.ph-chip.pages svg, .ph-chip.merge svg { color: var(--primary); }
.ph-chip b { font-weight: 800; }
.ph-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.ph-chip:disabled { opacity: 0.7; cursor: wait; }
.pdf-hint-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 9px; border: 0; font-size: 14px;
  background: linear-gradient(120deg, var(--primary), #1f8bff); color: #fff; font-family: inherit; font-weight: 800; cursor: pointer; white-space: nowrap;
  }
.pdf-hint-btn::after { content: "→"; font-size: 16px; line-height: 1; transition: transform 0.15s; }
.pdf-hint-btn[aria-expanded="true"]::after { content: "×"; }
.pdf-hint-btn:hover { filter: brightness(1.08); }
.pdf-hint-btn:hover::after { transform: translateX(3px); }
.pdf-hint-btn:disabled { opacity: 0.7; cursor: wait; }

/* Ô gửi file (nằm ngang, gọn) */
.drop {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 18px 26px; flex-wrap: wrap;
  padding: 28px 26px; border: 2px solid transparent; border-radius: 16px; cursor: pointer;
  /* viền gradient chạy vòng (màu logo) */
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(100deg, var(--primary), var(--cyan), #7c9cff, var(--primary)) border-box;
  background-size: 100% 100%, 300% 100%;
  box-shadow: 0 18px 40px -26px rgba(7, 85, 237, 0.9);
  animation: drop-border 6s linear infinite;
  transition: transform 0.18s, box-shadow 0.18s;
}
.drop::before { content: ""; position: absolute; inset: 0; border-radius: 14px; pointer-events: none;
  background: radial-gradient(60% 120% at 12% 50%, rgba(0, 205, 226, 0.13), transparent 70%),
    radial-gradient(50% 120% at 92% 50%, rgba(7, 85, 237, 0.10), transparent 70%); }
.drop > * { position: relative; }
.drop:hover, .drop.over { transform: translateY(-1px); box-shadow: 0 22px 46px -24px rgba(7, 85, 237, 1); }
.drop.over { transform: scale(1.015); background: linear-gradient(var(--primary-soft), var(--primary-soft)) padding-box,
  linear-gradient(100deg, var(--primary), var(--cyan), #7c9cff, var(--primary)) border-box; background-size: 100% 100%, 300% 100%; }
.drop.busy { pointer-events: none; opacity: 0.6; animation: none; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 3px solid var(--primary); outline-offset: 3px; }
.drop-txt { display: flex; flex-direction: column; gap: 4px; max-width: 420px; }
.drop-txt strong { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; }
.limits { display: block; font-size: 14px; color: var(--text-soft); white-space: nowrap; } /* mỗi câu 1 dòng, không ngắt giữa câu */
.pick-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; padding: 14px 30px; border-radius: 12px;
  background: linear-gradient(120deg, var(--primary), #1f8bff); color: #fff; font-size: 17px; font-weight: 800;
  box-shadow: 0 10px 22px -10px rgba(7, 85, 237, 0.95); }
.pick-btn::before { content: ""; width: 18px; height: 18px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M6 10l6-6 6 6M4 20h16'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M6 10l6-6 6 6M4 20h16'/%3E%3C/svg%3E") center / contain no-repeat; }
.pick-btn::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent); animation: pick-shine 3.2s ease-in-out infinite; }

/* hình EN → VI: trang Việt nổi lên xuống, chữ tự viết ra, mũi tên chạy */
.tr-art { width: 150px; height: auto; flex: none; overflow: visible; }
.tr-sheet { fill: var(--surface); stroke: var(--text-soft); stroke-width: 2.2; stroke-linejoin: round; }
.tr-sheet.vi { stroke: var(--primary); stroke-width: 2.6; }
.tr-fold { fill: none; stroke: var(--text-soft); stroke-width: 2.2; stroke-linejoin: round; }
.tr-fold.vi { stroke: var(--primary); }
.tr-gray { fill: none; stroke: var(--border); stroke-width: 3.4; stroke-linecap: round; }
.tr-tag-en { fill: var(--text-soft); }
.tr-tag-vi { fill: var(--primary); }
.tr-art text { fill: #fff; font: 800 9.5px var(--font); }
.tr-ink { fill: none; stroke: var(--cyan); stroke-width: 3.4; stroke-linecap: round; stroke-dasharray: 46; stroke-dashoffset: 46;
  animation: tr-write 4.2s ease-in-out infinite; }
.tr-ink.l2 { animation-delay: 0.25s; } .tr-ink.l3 { animation-delay: 0.5s; } .tr-ink.l4 { animation-delay: 0.75s; } .tr-ink.l5 { animation-delay: 1s; }
.tr-vi { animation: tr-float 4.2s ease-in-out infinite; transform-box: fill-box; }
.tr-en { opacity: 0.85; }
.tr-arrow { fill: none; stroke: var(--primary); stroke-width: 2.6; stroke-linecap: round; stroke-dasharray: 5 5; animation: tr-dash 1.2s linear infinite; }
.tr-arrow-head { fill: none; stroke: var(--primary); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes drop-border { to { background-position: 0 0, 300% 0; } }
@keyframes pick-shine { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
@keyframes tr-write { 0%, 8% { stroke-dashoffset: 46; } 45%, 82% { stroke-dashoffset: 0; } 96%, 100% { stroke-dashoffset: 46; opacity: 0.2; } }
@keyframes tr-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes tr-dash { to { stroke-dashoffset: -10; } }
@media (prefers-reduced-motion: reduce) {
  .drop, .pick-btn::after, .tr-ink, .tr-vi, .tr-arrow { animation: none; }
  .tr-ink { stroke-dashoffset: 0; }
  .pick-btn::after { display: none; }
}
.closed { margin: 0; padding: 22px 16px; text-align: center; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); }

.upload-progress { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 14px; color: var(--text-muted); }
.bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-subtle); overflow: hidden; border: 1px solid var(--border); }
.bar span { display: block; height: 100%; width: 0; background: var(--primary); transition: width 0.3s; }
.msg { margin: 10px 0 0; font-size: 14px; min-height: 1em; white-space: pre-line; }
.msg.bad { color: var(--bad); }
.msg:empty { display: none; }

/* Tệp của bạn: bảng trên máy tính, thẻ trên điện thoại */
.jobs-card { overflow: hidden; }
/* Cột cuối rộng cố định: mỗi dòng là một lưới riêng, để auto thì cột lệch theo nút của từng dòng */
.jobs-head, .job { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(70px, 0.6fr) minmax(0, 2.1fr) minmax(80px, 0.8fr) 220px; gap: 14px; align-items: center; padding: 13px 22px; }
.jobs-head { font-size: 13px; font-weight: 650; color: var(--text-muted); letter-spacing: 0.03em; text-transform: uppercase; border-bottom: 1px solid var(--border); padding-top: 12px; padding-bottom: 12px; }
.jobs { list-style: none; margin: 0; padding: 0; }
.job { border-bottom: 1px solid var(--border); }
.job:last-child { border-bottom: 0; }
.job-name { font-weight: 600; word-break: break-word; }
.job-meta { font-size: 12.5px; color: var(--text-soft); }
.job-pages, .job-keep { color: var(--text-muted); font-size: 15px; }
.job-status { min-width: 0; }
.badge { display: inline-block; font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 8px; background: var(--surface-subtle); color: var(--text-muted); white-space: nowrap; }
.badge.running, .badge.queued { background: var(--primary-soft); color: var(--primary); }
.badge.done { background: var(--primary-soft); color: var(--primary); }
.badge.partial, .badge.waiting { background: var(--warn-soft); color: var(--warn); }
.badge.failed { background: var(--bad-soft); color: var(--bad); }
.job .bar { margin-top: 6px; max-width: 200px; height: 6px; border: 0; background: var(--border); }
/* Độ rộng do app.js đổi từng khung hình; vệt sáng chạy liên tục để thấy máy vẫn đang làm */
.job .bar span { position: relative; overflow: hidden; transition: none; }
.job .bar span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); transform: translateX(-100%); animation: bar-shine 1.5s linear infinite; }
@keyframes bar-shine { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .job .bar span::after { animation: none; display: none; } }
.job-detail { margin-top: 4px; font-size: 13px; color: var(--text-muted); word-break: break-word; }
.job-detail.bad { color: var(--bad); }
.job-actions { display: flex; gap: 14px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.dl-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 8px; cursor: pointer;
  border: 1.5px solid var(--primary); background: var(--surface); color: var(--primary); font-weight: 700; font-size: 14px; white-space: nowrap;
  text-decoration: none;
}
.dl-btn:hover { background: var(--primary-soft); }
.dl-btn:disabled { opacity: 0.6; cursor: wait; }
.dl-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.job-actions .link-btn { color: var(--text-soft); font-weight: 600; }
.job-actions .link-btn:hover { color: var(--bad); }
.empty { margin: 0; padding: 16px 22px; font-size: 14px; color: var(--text-soft); }

.foot { margin-top: 18px; padding: 12px 18px; display: flex; gap: 12px; align-items: flex-start; color: var(--text-muted); font-size: 14px; }
.foot p { margin: 0; }
.foot b { font-weight: 600; font-size: 15px; }
.foot .ic { color: var(--primary); width: 24px; height: 24px; margin-top: 2px; }

@media (max-width: 760px) {
  .header-in, .container { padding-left: 16px; padding-right: 16px; }
  .app-sep, .app-name, .account-name { display: none; }
  /* điện thoại: công cụ xuống hàng thứ hai, vuốt ngang */
  .header-in { flex-wrap: wrap; row-gap: 8px; }
  .tools { order: 3; flex: 1 0 100%; margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
  .tools::-webkit-scrollbar { display: none; }
  .tools a { padding: 6px 10px; font-size: 13.5px; }
  .lay { grid-template-columns: 1fr; grid-template-areas: "title" "upload" "quota" "tg"; }
  .gate-card { margin-top: 24px; padding: 24px 18px; }
  .pdf-hint { grid-template-columns: 1fr; padding: 12px; gap: 8px; text-align: left; }
  .pdf-hint-art { display: none; }
  .pdf-hint h3 { font-size: 15px; }
  .pdf-hint-btn { width: 100%; justify-content: center; }
  .ph-chip { flex: 0 1 auto; padding: 5px 10px 5px 8px; font-size: 12.5px; }
  .pdf-hint-kicker { display: none; }
  h1 { font-size: 30px; }
  .sub { font-size: 15px; }
  .drop { flex-direction: column; text-align: center; gap: 12px; padding: 22px 16px; }
  .drop-txt strong { font-size: 19px; }
  .limits { font-size: 13px; }
  .tr-art { width: 112px; }
  .pick-btn { width: 100%; justify-content: center; }
  .q-don { align-items: stretch; text-align: left; width: 100%; }
  .donate-btn { justify-content: center; }
  .donate-note { max-width: none; }
  .donate-box { grid-template-columns: 1fr; }
  .pay-qr { justify-self: center; }
  .tg-qr, .tgd-qr { display: none; }  /* đang cầm chính điện thoại: chỉ cần nút Mở Telegram */
  .tgd-acts { flex-direction: column-reverse; }
  .tgd-acts .tgd-btn { flex: none; }
  .jobs-head { display: none; }
  .job { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 14px; }
  .job-name-cell { grid-column: 1 / -1; }
  .job-pages { grid-row: 2; grid-column: 1; }
  .job-keep { grid-row: 2; grid-column: 2; font-size: 14px; }
  .job-keep.none { visibility: hidden; }
  .job-status { grid-column: 1 / -1; }
  .job-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
