/* Qnote – phong cách sáng giống EasyPlan */
:root {
  --pri: #2563eb;
  --pri2: #1d4ed8;
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #d9dfe5;
  --text: #16202c;
  --muted: #64707d;
  --danger: #c0392b;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-text-size-adjust: 100%;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }
.sp { flex: 1; }
body.is-touch .desk { display: none !important; }

/* ---------- nút chung (như EasyPlan) ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  border-radius: 9px; padding: 8px 12px; min-height: 40px; font-weight: 500; cursor: pointer; }
.btn:hover { border-color: #aab5c0; }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.primary:hover { background: var(--pri2); }
.btn.danger { color: var(--danger); border-color: #efc4bf; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: 13.5px; }
.btn.big { min-height: 52px; font-size: 17px; font-weight: 600; width: 100%; border-radius: 12px; }

/* ---------- màn hình chào ---------- */
#home { overflow-y: auto; align-items: center; }
.home-box { width: 100%; max-width: 460px; padding: calc(var(--st) + 18px) 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 52px; height: 52px; border-radius: 14px; }
h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.3px; }
h1 span { color: var(--pri); }
.sub { margin: 0; color: var(--muted); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 14.5px; line-height: 1.5; }
.card ol { margin: 8px 0 0; padding-left: 20px; }
.card li { margin: 4px 0; }
.note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
body.drag #home { outline: 3px dashed var(--pri); outline-offset: -10px; }

/* ---------- thanh công cụ trên ---------- */
.topbar { flex: none; display: flex; align-items: stretch; justify-content: center; gap: 2px; background: #fff;
  border-bottom: 1px solid var(--line); padding: calc(var(--st) + 4px) 6px 4px; }
.topbar .sep { width: 1px; background: var(--line); margin: 6px 4px; flex: none; }
.tbtn { position: relative; flex: 1; max-width: 56px; min-width: 0; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 11px; color: #3b4652; }
.tbtn svg { width: 25px; height: 25px; }
.tbtn.send { color: var(--pri); }
.tbtn.send svg { width: 23px; height: 23px; }
.tbtn.save { color: var(--pri); }
.tbtn span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tbtn.on { background: #dde8f6; color: var(--pri); font-weight: 600; }
.tbtn .cnt { position: absolute; top: 0; right: 6px; background: var(--pri); color: #fff; font-size: 11px; min-width: 18px; height: 18px;
  border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.tbtn .cnt:empty { display: none; }
.tbtn.busy { opacity: .5; }
@media (hover: hover) { .tbtn:hover { background: #eef2f6; } .tbtn.on:hover { background: #dde8f6; } }

/* ---------- vùng ảnh ---------- */
#stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: none;
  background: var(--bg) radial-gradient(#d9dfe5 1px, transparent 1px) 0 0 / 22px 22px; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ta { position: absolute; margin: 0; border: 0; outline: 2px dashed rgba(37,99,235,.9); resize: none; overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-weight: 600;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word; -webkit-user-select: text; user-select: text;
  caret-color: var(--pri); transform-origin: 0 0; }
.menu { position: absolute; top: 8px; right: 8px; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(22,32,44,.18); padding: 6px; display: flex; flex-direction: column; min-width: 250px; }
.menu button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; text-align: left; font-size: 14.5px; }
.menu button:hover { background: #eef2f6; }
.menu svg { width: 20px; height: 20px; color: var(--pri); }

/* ---------- thanh tùy chọn ---------- */
#opts { flex: none; background: #fff; border-top: 1px solid var(--line); padding: 6px 10px 2px; display: flex; flex-direction: column; gap: 6px; }
#opts:empty { display: none; }
.row { display: flex; align-items: center; gap: 8px; min-height: 36px; overflow-x: auto; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.sw { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); }
.sw.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--pri); }
.sw.none { background: linear-gradient(135deg, transparent 45%, #ff3b30 45%, #ff3b30 55%, transparent 55%), #fff; }
.seg { flex: none; display: inline-flex; background: #eef2f6; border-radius: 9px; padding: 2px; }
.seg button { padding: 6px 10px; border-radius: 7px; font-size: 13px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--pri); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.wbtn { flex: none; width: 40px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; }
.wbtn i { display: block; width: 22px; background: var(--text); border-radius: 4px; }
.wbtn.on { background: #dde8f6; border-color: #bcd0ee; }
.wbtn.on i { background: var(--pri); }
.tg { flex: none; padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--muted); }
.tg.on { background: #dde8f6; border-color: #bcd0ee; color: var(--pri); font-weight: 600; }
.sl { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); flex: 1; min-width: 130px; }
.sl input { flex: 1; min-width: 70px; accent-color: var(--pri); }
.sl output { width: 34px; text-align: right; color: var(--text); }
.del { margin-left: auto; color: var(--danger); }
.msg { color: var(--muted); font-size: 13px; flex: 1; }

/* ---------- thanh dưới ---------- */
.finish { flex: none; display: flex; align-items: center; gap: 2px; background: #fff; border-top: 1px solid var(--line);
  padding: 4px 8px calc(var(--sb) + 4px); }
.ic { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: #3b4652; }
.ic:disabled { opacity: .3; cursor: default; }
.ic svg { width: 22px; height: 22px; }
@media (hover: hover) { .ic:not(:disabled):hover { background: #eef2f6; } }
.pager { display: inline-flex; align-items: center; color: var(--muted); font-size: 14px; margin-left: 6px; }
.chip { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.chip.on { border-color: var(--pri); color: var(--pri); background: #eef4ff; }
#opts .ic.sm, .ic.sm { width: 34px; height: 34px; }

/* ---------- thông báo ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--sb) + 130px); transform: translateX(-50%); background: #15803d;
  color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw; text-align: center; z-index: 10;
  box-shadow: 0 6px 24px rgba(0,0,0,.2); pointer-events: none; }

@media (min-width: 900px) {
  .topbar { gap: 6px; }
  #opts { align-items: center; }
  .row { max-width: 860px; width: 100%; }
}

/* ---------- màn hình chào: thư mục ---------- */
.acts { display: flex; gap: 10px; }
.acts .big { flex: 1.4; }
.btn.big2 { flex: 1; min-height: 52px; border-radius: 12px; font-weight: 600; }
.btn.big2 svg { color: var(--pri); }
.hint { margin: -4px 0 0; color: var(--muted); font-size: 13.5px; }
h2 { font-size: 18px; margin: 8px 0 -6px; }
.warnbox { margin: 0; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.empty { color: var(--muted); margin: 0; line-height: 1.5; }
#folders { display: flex; flex-direction: column; gap: 10px; }
.fcard { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: left; }
.fcard:hover { border-color: #aab5c0; }
.fcard > svg { color: #aab5c0; }
.fmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fmeta b { font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmeta small { color: var(--muted); font-size: 13px; }
.mosaic { flex: none; width: 64px; height: 64px; border-radius: 9px; overflow: hidden; background: #eef2f6; display: grid; gap: 2px;
  grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic i { background: #dde3ea center / cover no-repeat; }
.mosaic.n1 i { grid-area: 1 / 1 / 3 / 3; }
.mosaic.n2 i { grid-row: 1 / 3; }
.mosaic.n3 i:first-child { grid-row: 1 / 3; }

/* ---------- màn hình thư mục ---------- */
#folder { background: var(--bg); }
.fhead { flex: none; display: flex; align-items: center; gap: 4px; background: #fff; border-bottom: 1px solid var(--line); padding: calc(var(--st) + 6px) 8px 6px; }
.ftext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ftitle { font-size: 18px; font-weight: 700; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ftitle::after { content: " ✎"; color: var(--muted); font-size: 14px; font-weight: 400; }
.fsub { color: var(--muted); font-size: 12.5px; }
#grid { flex: 1; overflow-y: auto; padding: 10px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); align-content: start; }
.tile { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line); padding: 0; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile em { position: absolute; left: 6px; bottom: 6px; background: var(--pri); color: #fff; font-style: normal; font-size: 11px; font-weight: 700;
  border-radius: 9px; min-width: 18px; height: 18px; padding: 0 5px; display: flex; align-items: center; justify-content: center; }
.tile u { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.25); }
.tile.on { outline: 3px solid var(--pri); outline-offset: -3px; }
.tile.on u { background: var(--pri) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 14px no-repeat; }
.tile.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--pri); font-weight: 600; font-size: 13px;
  border: 1.5px dashed #9db8ea; background: #f5f8ff; cursor: pointer; }
.fbar { flex: none; display: flex; align-items: center; gap: 6px; background: #fff; border-top: 1px solid var(--line); padding: 8px 10px calc(var(--sb) + 8px); }
.fbar .msg { font-size: 13px; }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- hộp thoại ---------- */
#dlg { position: fixed; inset: 0; z-index: 20; background: rgba(22,32,44,.35); display: flex; align-items: center; justify-content: center; padding: 20px; }
.dbox { background: #fff; border-radius: 14px; padding: 18px; width: 100%; max-width: 360px; box-shadow: 0 20px 50px rgba(0,0,0,.25); display: flex; flex-direction: column; gap: 10px; }
.dbox b { font-size: 17px; }
.dbox p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.dbox input { font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; -webkit-user-select: text; user-select: text; }
.dbox input:focus { outline: 2px solid var(--pri); border-color: var(--pri); }
.dact { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
@media (max-width: 520px) { .acts { flex-direction: column; } .btn.big2 { min-height: 44px; } }

/* ---------- thanh tuỳ chọn gọn (1 hàng) ---------- */
#opts { padding: 4px 8px; gap: 4px; }
#opts .row { min-height: 34px; gap: 6px; }
#opts .sw { width: 24px; height: 24px; }
#opts .seg button { padding: 4px 8px; font-size: 12.5px; }
#opts .wbtn { width: 32px; height: 28px; }
#opts .wbtn i { width: 18px; }
#opts .tg { padding: 4px 9px; font-size: 12.5px; }
#opts .sl { min-width: 110px; font-size: 12px; }
#opts .sl output { width: 30px; font-size: 12px; }
.vsep { flex: none; width: 1px; height: 20px; background: var(--line); }
.more { flex: none; height: 28px; min-width: 34px; padding: 0 6px; border-radius: 8px; background: #eef2f6; color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.more.on { background: #dde8f6; color: var(--pri); }
.chip.warn { color: var(--danger); border-color: #efc4bf; font-weight: 600; }
#opts .r2 .sl { flex: none; width: 150px; min-width: 0; }
#opts .r2 .sl input { min-width: 0; }
.pager, .chip { white-space: nowrap; }
.pg { min-width: 38px; text-align: center; }
.pastebig { display: flex; align-items: center; gap: 12px; width: 100%; padding: 16px; border-radius: 14px; background: #eef4ff;
  border: 2px solid var(--pri); color: var(--pri); text-align: left; animation: pulse 1.6s ease-in-out infinite; }
.pastebig svg { width: 34px; height: 34px; }
.pastebig span { display: flex; flex-direction: column; gap: 2px; }
.pastebig b { font-size: 17px; }
.pastebig small { color: var(--muted); font-size: 13px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(37,99,235,.15); } }
@media (prefers-reduced-motion: reduce) { .pastebig { animation: none; } }
.help summary { font-weight: 600; cursor: pointer; }
.help p { margin: 8px 0 0; }
.help code { font-size: 12.5px; background: #eef2f6; padding: 2px 5px; border-radius: 5px; word-break: break-all; -webkit-user-select: text; user-select: text; }
.acts { flex-wrap: wrap; }
.acts, .acts:is(*) { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex-direction: unset; }
.acts .big { grid-column: 1 / -1; }
.acts .btn.big2 { min-height: 46px; }

/* ---------- lượt ảnh đang làm / nút quay lại ---------- */
.acts .big { grid-column: auto; }
.resume { display: flex; align-items: center; gap: 12px; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: left; }
.resume:hover { border-color: #aab5c0; }
.resume > svg { color: #aab5c0; }
.rth { display: flex; flex: none; }
.rth i { width: 40px; height: 52px; border-radius: 7px; background: #dde3ea center / cover no-repeat; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.15); margin-left: -14px; }
.rth i:first-child { margin-left: 0; }
.rtx { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.rtx b { font-size: 15.5px; }
.rtx small { color: var(--muted); font-size: 13px; }
.tbtn.back { color: var(--text); }
.tbtn.back svg { width: 28px; height: 28px; stroke-width: 2.4; }
.acts, .acts:is(*) { grid-template-columns: 1.5fr 1fr; }
.tbtn.copy { color: var(--pri); }
.help .step { font-weight: 700; color: var(--pri); margin-top: 12px; }
.help ol { margin: 6px 0 0; padding-left: 20px; }
.help li { margin: 4px 0; line-height: 1.45; }
.guidelink { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; color: inherit; text-decoration: none; }
.guidelink:hover { border-color: #aab5c0; }
.guidelink .gi { flex: none; width: 40px; height: 40px; border-radius: 10px; background: #eef4ff; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.guidelink > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.guidelink b { font-size: 15px; }
.guidelink small { color: var(--muted); font-size: 13px; }
.guidelink > svg { color: #aab5c0; }

/* ---------- v1.6: không thanh đáy, bảng màu dọc bên phải, chuyển ảnh nổi ---------- */
#opts { position: absolute; z-index: 4; right: 8px; top: 50%; transform: translateY(-50%); padding: 6px; gap: 6px;
  background: rgba(255,255,255,.96); border: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 6px 20px rgba(22,32,44,.16); max-height: calc(100% - 16px); }
#opts .row { flex-direction: column; min-height: 0; gap: 7px; overflow: visible; max-width: none; width: auto; }
#opts .seg { flex-direction: column; }
#opts .seg button { padding: 5px 6px; font-size: 11.5px; }
#opts .sw { width: 26px; height: 26px; }
#opts .vsep { width: 20px; height: 1px; }
#opts .wbtn { width: 30px; height: 26px; }
#opts .del { margin: 0; }
#opts .msg { display: none; }
#opts .btn.small { min-height: 30px; padding: 4px 8px; font-size: 12.5px; width: 100%; }
#opts .r2 { position: absolute; right: calc(100% + 8px); top: 0; width: 200px; background: #fff; border: 1px solid var(--line);
  border-radius: 14px; padding: 10px; box-shadow: 0 6px 20px rgba(22,32,44,.16); gap: 10px; align-items: stretch; }
#opts .r2 .sl { width: 100%; min-width: 0; }
#opts .r2 .tg { width: 100%; }
.pager { position: absolute; z-index: 4; left: 50%; bottom: calc(var(--sb) + 10px); transform: translateX(-50%); display: flex; align-items: center;
  gap: 2px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px; box-shadow: 0 4px 14px rgba(22,32,44,.14); margin: 0; }
.pager button { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: #3b4652; }
.pager svg { width: 20px; height: 20px; }
#stage { padding-bottom: 0; }
/* bảng màu dọc nằm bên TRÁI (Nam chốt) */
#opts { right: auto; left: 8px; }
#opts .r2 { right: auto; left: calc(100% + 8px); }
#ta { touch-action: none; }

/* ---------- v1.8: ⓘ Giới thiệu · Hướng dẫn (cùng kiểu EasyPlan) ---------- */
.brand .info-btn { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; color: var(--text); display: flex; align-items: center; justify-content: center; }
.brand .info-btn:hover { border-color: var(--pri); color: var(--pri); }
.note .lock svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
.guidelink .gi svg { width: 22px; height: 22px; color: var(--pri); }
.about { position: fixed; inset: 0; z-index: 30; background: #fff; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); -webkit-user-select: text; user-select: text; }
.about-head { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.about-tabs { display: flex; gap: 6px; }
.atab { min-height: 40px; padding: 6px 16px; font-size: 15px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--text); }
.atab.on { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 600; }
.about-x { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; font-size: 18px; display: flex; align-items: center; justify-content: center; flex: none; }
.about-x:hover { border-color: var(--pri); color: var(--pri); }
.about-body { overflow-y: auto; padding: 16px 16px calc(var(--sb) + 40px); max-width: 720px; margin: 0 auto; width: 100%; font-size: 15.5px; line-height: 1.55; }
.about .small { font-size: 13.5px; }
.about .muted { color: var(--muted); }
.about a { color: var(--pri); }
.about a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.about a.btn.primary { color: #fff; }
.about-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.about-hero .avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; flex: none; padding: 3px; background: #e3ecf8; }
.about-hero h2 { margin: 0 0 2px; font-size: 21px; color: var(--pri); }
.about-hero .role { margin: 0; font-size: 14px; color: #3b4652; }
.about-book { display: flex; gap: 14px; align-items: flex-start; background: #f6f8fa; border-radius: 12px; padding: 12px; margin: 0; }
.about-book img { width: 120px; height: auto; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,.18); flex: none; display: block; }
.about-book h3 { margin: 2px 0; font-size: 16.5px; }
.about-book .book-sub { margin: 4px 0 8px; color: #3b4652; line-height: 1.4; }
.book-pre { display: block; font-size: 13px; font-weight: 600; color: #3b4652; }
.about-h { font-size: 17px; color: var(--pri); margin: 14px 0 8px; }
.about-courses { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.about-courses a { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; height: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); }
.about-courses a b { font-size: 13.5px; line-height: 1.3; }
.about-courses .price { color: var(--pri); font-weight: 600; white-space: nowrap; font-size: 13px; }
.funnel-row { display: flex; gap: 8px; margin: 10px 0 0; }
.funnel-row > .btn { flex: 1 1 0; margin: 0; min-width: 0; white-space: nowrap; padding-left: 6px; padding-right: 6px; }
.zalo-group { justify-content: center; background: #0068ff !important; color: #fff !important; border-color: #0068ff !important; font-weight: 600; }
.coffee-btn { justify-content: center; gap: 8px; color: var(--pri); font-weight: 600; }
.coffee-btn svg { width: 20px; height: 20px; }
.coffee-btn.on { background: #f6f8fa; }
.coffee { text-align: center; background: #f6f8fa; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 8px 0 0; }
.coffee h3 { margin: 0 0 10px; font-size: 16.5px; color: var(--pri); }
.coffee img { max-width: 220px; width: 70%; height: auto; border-radius: 8px; }
.coffee .thanks { margin: 12px 0 0; font-size: 14.5px; color: #3b4652; }
.changelog { margin: 10px 0 0; font-size: 13px; }
.changelog summary { cursor: pointer; font-weight: 500; color: var(--muted); }
.changelog ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.5; }
.priv-ic svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
.about .social { display: flex; justify-content: center; gap: 12px; margin: 16px 0 6px; flex-wrap: wrap; }
.soc { width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.soc svg { width: 22px; height: 22px; }
.soc-fb { background: #1877f2; } .soc-yt { background: #ff0000; } .soc-mail { background: #fff; border: 2px solid #5f6368; }
.soc-zalo { background: #0068ff; } .soc-zalo svg { width: 29px; height: 29px; } .soc-web { background: #6d28d9; }
.about .guide { border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; margin-bottom: 5px; }
.about .guide summary { font-weight: 600; cursor: pointer; color: var(--pri); display: flex; align-items: center; gap: 8px; list-style: none; min-height: 30px; font-size: 14.5px; }
.about .guide summary::-webkit-details-marker { display: none; }
.about .guide summary::after { content: '▸'; margin-left: auto; color: #94a3b8; }
.about .guide[open] summary::after { content: '▾'; }
.guide-ic { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--pri); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.guide-ic svg { width: 15px; height: 15px; }
.about .guide ul { margin: 8px 0 2px; padding: 0; list-style: none; }
.about .guide li { margin: 0; padding: 7px 0; border-top: 1px solid #eef2f6; display: grid; grid-template-columns: minmax(96px, 30%) 1fr; gap: 10px; font-size: 14px; line-height: 1.45; }
.about .guide li b { color: #1f2937; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.about .guide li span { color: #475569; }
.gi-ic { width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: #eff4ff; color: var(--pri) !important; }
.gi-ic svg { width: 15px; height: 15px; }
@media (max-width: 560px) { .about .guide li { grid-template-columns: 1fr; gap: 2px; } }
/* bảng so sánh trong ⓘ */
.cbars { display: grid; gap: 6px; margin: 0 0 10px; }
.cb { display: grid; grid-template-columns: 74px minmax(0, 1fr) 30px; align-items: center; gap: 8px; font-size: 13.5px; color: #3b4652; }
.cb i { display: block; height: 10px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.cb u { display: block; height: 100%; background: #94a3b8; border-radius: 999px; }
.cb.qn, .cb.qn b { color: var(--pri); } .cb.qn u { background: var(--pri); }
.cb b { text-align: right; }
.ctab { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.35; }
.ctab th, .ctab td { padding: 6px 5px; border-top: 1px solid #eef2f6; text-align: center; vertical-align: top; }
.ctab th:first-child, .ctab td:first-child { text-align: left; color: #1f2937; font-weight: 600; width: 34%; }
.ctab thead th { border-top: 0; color: var(--muted); font-weight: 600; }
.ctab .qn { background: #eff4ff; color: #1e3a8a; font-weight: 600; }
.ctab thead .qn { background: var(--pri); color: #fff; border-radius: 6px 6px 0 0; }
.ctab small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
.ctab tr.sum td { font-weight: 700; font-size: 14.5px; }
.about .cmpbox ul { display: none; }
.vdpics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 2px 0 6px; }
.vdpics figure { margin: 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.vdpics img { width: 100%; border-radius: 14px; border: 4px solid #1f2937; display: block; }
.vdpics .qn img { border-color: var(--pri); }
.vdpics .qn figcaption { color: var(--pri); font-weight: 600; }
.flow { border-top: 1px solid #eef2f6; padding: 8px 0; }
.flow > b { display: block; font-size: 13.5px; margin-bottom: 4px; color: #1f2937; }
.flow.qn > b { color: var(--pri); }
.flow .st { display: inline-flex; align-items: center; gap: 4px; margin: 2px 8px 2px 0; font-size: 13px; color: #3b4652; }
.flow .n { display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; border-radius: 50%; background: #94a3b8; color: #fff; font-size: 11px; font-weight: 700; }
.flow.qn .n { background: var(--pri); }
.about .hdbox .hd { margin-top: 6px; }

/* ---------- iPad / máy tính: thanh công cụ DỌC bên phải (Nam 30/11/2026) – vùng ảnh cao hết màn hình ---------- */
@media (min-width: 700px) {
  #editor { flex-direction: row; }
  #editor .topbar { order: 2; flex-direction: column; justify-content: flex-start; align-items: center; width: 68px; flex: none;
    padding: calc(var(--st) + 8px) calc(env(safe-area-inset-right, 0px) + 6px) calc(var(--sb) + 8px) 6px;
    border-bottom: 0; border-left: 1px solid var(--line); gap: 4px; overflow-y: auto; scrollbar-width: none; }
  #editor .topbar::-webkit-scrollbar { display: none; }
  #editor .topbar .tbtn { flex: none; max-width: none; width: 50px; height: 50px; }
  #editor .topbar .sep { width: 34px; height: 1px; margin: 6px 0; }
  #editor #stage { order: 1; }
  #editor .menu { top: 8px; right: 8px; }
}

/* cột màu: sát mép trên vùng ảnh (không bị bàn phím che), dài quá thì cuộn (Nam 30/11/2026) */
#opts { top: 8px; transform: none; max-height: none; overflow: visible; }
#opts .row:first-child { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
#opts .row:first-child::-webkit-scrollbar { display: none; }
#opts .r2 { top: 0; }

/* ---------- máy tính: chụp màn hình ---------- */
.pcbox { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.pchead { display: flex; gap: 12px; align-items: center; }
.pchead > svg { width: 40px; height: 40px; padding: 8px; border-radius: 10px; background: #eef4ff; color: var(--pri); flex: none; }
.pchead div { display: flex; flex-direction: column; gap: 2px; }
.pchead b { font-size: 15px; } .pchead small { color: var(--muted); font-size: 13px; }
.pcacts { display: flex; gap: 8px; flex-wrap: wrap; }
.pcacts .btn { flex: 1; min-width: 180px; }
.pcacts .btn svg { width: 18px; height: 18px; }
#autoBtn.on { border-color: #bcd0ee; background: #eef4ff; color: var(--pri); font-weight: 600; }
.pchelp summary { cursor: pointer; color: var(--pri); font-weight: 600; font-size: 14px; }
.pchelp ol { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.pchelp li { margin: 5px 0; }
.pchelp p { font-size: 13.5px; color: var(--muted); margin: 8px 0 0; }

/* nút micro dưới ô chữ (iPad / máy tính) */
.mic-btn { position: absolute; z-index: 5; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 10px;
  border-radius: 999px; background: #fff; color: var(--pri); border: 1.5px solid #bcd0ee; box-shadow: 0 4px 14px rgba(22,32,44,.16); font-size: 14px; font-weight: 600; }
.mic-btn svg { width: 20px; height: 20px; }
.mic-btn.on { background: #ef4444; border-color: #ef4444; color: #fff; animation: micpulse 1.2s ease-in-out infinite; }
@keyframes micpulse { 50% { box-shadow: 0 0 0 8px rgba(239,68,68,.18); } }
@media (prefers-reduced-motion: reduce) { .mic-btn.on { animation: none; } }

/* nút X góc dưới bên trái ảnh: bỏ ảnh đang làm dở */
.del-img { position: absolute; z-index: 4; width: 36px; height: 36px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.96); color: #ef4444;
  border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(22,32,44,.18); cursor: pointer; }
.del-img svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.del-img:hover { background: #ef4444; color: #fff; border-color: #ef4444; }
.del-img[hidden] { display: none; }

/* Gửi sang Claude Code */
.tbtn.ccb { color: #c2410c; }
.cc { position: fixed; inset: 0; z-index: 19; background: rgba(22,32,44,.35); display: flex; justify-content: center; align-items: flex-start;
  padding: calc(env(safe-area-inset-top) + 56px) 12px 12px; }
.cc[hidden] { display: none; }
.ccbox { background: #fff; border-radius: 16px; padding: 14px; width: 100%; max-width: 520px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
  display: flex; flex-direction: column; gap: 10px; max-height: calc(100dvh - 80px); overflow: auto; }
.cchead { display: flex; align-items: center; justify-content: space-between; }
.cchead b { font-size: 17px; }
.ccx { width: 34px; height: 34px; border-radius: 50%; color: var(--muted); font-size: 16px; }
#ccText { font: inherit; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; min-height: 72px;
  -webkit-user-select: text; user-select: text; }
#ccText:focus { outline: 2px solid var(--pri); border-color: var(--pri); }
.ccrow { display: flex; align-items: center; justify-content: space-between; }
.cclabel { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cclink { color: var(--pri); font-size: 14px; font-weight: 600; padding: 4px 2px; }
.ccprojects { display: flex; flex-wrap: wrap; gap: 8px; }
.pj { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-size: 14.5px; font-weight: 600; color: var(--text); }
.pj .em { font-size: 17px; line-height: 1; }
.pj.on { border-color: var(--pri); background: #eaf1ff; color: var(--pri); }
.pj.on::after { content: "✓"; font-weight: 800; margin-left: 2px; }
.pj .rm { margin-left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fee2e2; color: #dc2626; display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; }
.pj.add { border-style: dashed; color: var(--pri); }
.ccgo { min-height: 46px; font-size: 16px; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.cchint { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
