/* drive.mora.vn/cua-toi/ — trang quy trình lưu trữ theo vị trí (cua-toi.js) */
.ct-wrap { max-width: 980px; margin: 0 auto; padding: 28px 24px 56px; }
.ct-wrap > h1 { font-size: 30px; line-height: 1.25; margin: 0 0 6px; }
.ct-wrap > .lead { color: var(--fg-muted); margin: 0 0 22px; font-size: 16px; }
.ct-card { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev); padding: 22px 24px; margin: 0 0 22px; }
.ct-chao h2 { margin: 0 0 8px; font-size: 20px; }
.ct-chao p { margin: 0 0 16px; color: var(--fg-muted); line-height: 1.6; }
.ct-chao .ct-nho { margin: 14px 0 0; }
.ct-trong { text-align: center; }
.ct-trong-chu { margin: 0 0 14px; color: var(--fg-muted); }
.ct-dau { position: relative; padding-right: 140px; }
.ct-xin-chao { margin: 0; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-muted); font-weight: 600; }
.ct-ten { margin: 2px 0 6px; font-size: 26px; line-height: 1.25; }
.ct-phu { margin: 0 0 10px; color: var(--fg-muted); }
.ct-vi-tri { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--on-accent-soft); display: inline-block; }
.ct-thoat { position: absolute; top: 22px; right: 24px; height: 36px; font-size: 14px; padding: 0 14px; cursor: pointer; }
.ct-muc { margin: 30px 0 0; }
.ct-muc > h2 { font-size: 20px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ct-bo-nho { list-style: none; padding: 0; margin: 0 0 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.ct-bn { display: flex; flex-direction: column; gap: 4px; height: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; background: var(--bg-elev); color: var(--fg); text-decoration: none !important; transition: border-color .15s; }
a.ct-bn:hover { border-color: var(--accent); }
.ct-bn-ten { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.ct-bn-phu { font-size: 13px; color: var(--fg-muted); line-height: 1.5; }
.ct-vai { align-self: flex-start; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 10px; }
.vai-ql { background: var(--tag-new-bg); color: var(--tag-new-fg); }
.vai-sua { background: var(--tag-imp-bg); color: var(--tag-imp-fg); }
.vai-xem { background: var(--bg-subtle); color: var(--fg-muted); border: 1px solid var(--line); }
.ct-bang { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ct-bang th, .ct-bang td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); line-height: 1.55; }
.ct-bang th { background: var(--bg-subtle); font-weight: 600; font-size: 13.5px; }
.ct-bang td.ct-noi { color: var(--fg); font-weight: 500; overflow-wrap: anywhere; }
.ct-bang td.ct-ten-tep code { font-family: var(--font); font-size: 13.5px; font-weight: 500; background: var(--code-bg); padding: 2px 6px; border-radius: 6px;
  overflow-wrap: anywhere; word-break: break-word; }
.ct-muc ul { margin: 0 0 10px; padding-left: 22px; line-height: 1.65; }
.ct-muc ul.ct-bo-nho { padding: 0; }
.ct-nho { font-size: 13.5px; color: var(--fg-muted); margin: 8px 0 0; line-height: 1.55; }
.ct-wrap .callout { margin-top: 22px; }
.ct-wrap .callout ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.6; }
.ct-wrap .updated { margin-top: 32px; }
@media (max-width: 640px) {
  .ct-wrap { padding: 20px 16px 40px; }
  .ct-wrap > h1 { font-size: 24px; }
  .ct-card { padding: 18px 16px; }
  .ct-dau { padding-right: 16px; }
  .ct-thoat { position: static; margin-top: 14px; }
  .ct-ten { font-size: 22px; }
  .ct-bang thead { display: none; }
  .ct-bang, .ct-bang tbody, .ct-bang tr, .ct-bang td { display: block; width: 100%; box-sizing: border-box; }
  .ct-bang tr { border: 1px solid var(--line); border-radius: 10px; margin: 0 0 10px; padding: 6px 0; }
  .ct-bang td { border: 0; padding: 4px 12px; }
  .ct-bang td:first-child { font-weight: 600; }
}

/* ---- Thẻ "Phần của tôi" / "Cách đặt tên và lưu trữ" ---- */
.ct-the { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 8px; scroll-margin-top: calc(var(--topbar-h, 56px) + 12px); }
.ct-the-nut { appearance: none; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: var(--fg-muted);
  padding: 10px 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; }
.ct-the-nut[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.ct-the-nut:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ct-o[hidden] { display: none; }

/* ---- Hướng dẫn có hình ---- */
.ct-hd { --p0: var(--accent); --p0b: var(--accent-soft); --p1: var(--tip-line); --p1b: var(--tip-bg);
  --p2: var(--soon-line); --p2b: var(--soon-bg); --p3: var(--warn-line); --p3b: var(--warn-bg); }
.hd-dau-trang { margin: 18px 0 0; }
.hd-mo-dau { font-size: 16px; line-height: 1.65; margin: 0 0 12px; }
.hd-muc-luc { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; counter-reset: ml; padding: 0; margin: 0 0 12px; }
.hd-muc-luc li { counter-increment: ml; }
.hd-muc-luc a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--fg); text-decoration: none; }
.hd-muc-luc a::before { content: counter(ml) ". "; color: var(--accent); font-weight: 700; }
.hd-muc-luc a:hover { border-color: var(--accent); }
.hd-in { height: 34px; font-size: 14px; padding: 0 14px; cursor: pointer; }
.hd-buoc { scroll-margin-top: calc(var(--topbar-h, 56px) + 12px); }
.hd-buoc > h2 { display: flex; align-items: center; gap: 10px; }
.hd-so { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; }
.hd-buoc h3 { font-size: 16px; margin: 22px 0 10px; }
.hd-dan { color: var(--fg-muted); margin: 0 0 12px; line-height: 1.6; }
.hd-hinh { margin: 14px 0 18px; }
.hd-hinh-noi { border: 1px solid var(--line); border-radius: 12px; background: var(--bg-subtle); padding: 20px; }
.hd-hinh figcaption { margin-top: 8px; font-size: 13px; color: var(--fg-muted); }
.hd-bt { display: inline-flex; flex: none; width: 20px; height: 20px; }
.hd-bt svg { width: 100%; height: 100%; }
.hd-bt-tm svg, .hd-bt-bn svg { fill: #E8A93A; }
.hd-bt-tep svg { fill: var(--bg-elev); stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; }

/* Bước 1: sơ đồ chọn nơi lưu */
.hd-luong { display: flex; flex-direction: column; align-items: stretch; --rong-hoi: calc((100% - 74px) * 1.25 / 2.25); }
.hd-hang { display: grid; grid-template-columns: minmax(0, 1.25fr) 74px minmax(0, 1fr); align-items: center; }
.hd-hoi { display: flex; gap: 10px; align-items: flex-start; background: var(--bg-elev); border: 1.5px solid var(--line-strong);
  border-radius: 10px; padding: 12px 14px; line-height: 1.5; font-weight: 500; }
.hd-hoi-so { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--fg); color: var(--bg); font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.hd-mui { position: relative; text-align: center; font-size: 13px; font-weight: 700; color: var(--fg-muted); padding-bottom: 14px; }
.hd-mui::after { content: ""; position: absolute; left: 6px; right: 8px; bottom: 6px; height: 2px; background: var(--fg-muted); }
.hd-mui::before { content: ""; position: absolute; right: 2px; bottom: 2px; border: 5px solid transparent; border-left: 8px solid var(--fg-muted); border-right: 0; }
.hd-kq { display: flex; flex-direction: column; gap: 4px; border-radius: 10px; padding: 12px 14px; border-left: 5px solid; line-height: 1.5; font-size: 14px; }
.hd-kq strong { font-size: 15px; }
.hd-kq-hpa { background: var(--rule-bg); border-color: var(--rule-line); }
.hd-kq-rieng { background: var(--soon-bg); border-color: var(--soon-line); }
.hd-kq-mat { background: var(--warn-bg); border-color: var(--warn-line); }
.hd-kq-chung { background: var(--tip-bg); border-color: var(--tip-line); }
.hd-kq-cuoi { width: var(--rong-hoi); box-sizing: border-box; }
.hd-xuong { position: relative; width: var(--rong-hoi); height: 34px; font-size: 13px; font-weight: 700; color: var(--fg-muted);
  line-height: 34px; padding-left: calc(var(--rong-hoi) / 2 + 10px); box-sizing: border-box; }
.hd-xuong::before { content: ""; position: absolute; left: 50%; top: 2px; bottom: 7px; width: 2px; background: var(--fg-muted); }
.hd-xuong::after { content: ""; position: absolute; left: calc(50% - 5px); bottom: 0; border: 6px solid transparent; border-top: 7px solid var(--fg-muted); border-bottom: 0; }

/* Bước 2: bậc thư mục */
.hd-bac { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hd-bac li { display: grid; grid-template-columns: 150px minmax(0, 1fr); grid-template-areas: "nhan ten" "nhan qt"; column-gap: 14px;
  margin-left: calc(var(--lui) * 26px); background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; position: relative; }
.hd-bac li + li::before { content: ""; position: absolute; left: -14px; top: -9px; width: 12px; height: 26px;
  border-left: 2px solid var(--line-strong); border-bottom: 2px solid var(--line-strong); border-bottom-left-radius: 6px; }
.hd-bac-nhan { grid-area: nhan; font-size: 12px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .03em; padding-top: 3px; }
.hd-bac-ten { grid-area: ten; display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.hd-bac-qt { grid-area: qt; font-size: 13.5px; color: var(--fg-muted); line-height: 1.5; margin-top: 2px; }

/* Đúng / sai */
.hd-ds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 10px; }
.hd-ds-the { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-elev); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.hd-sai, .hd-dung { display: flex; gap: 8px; align-items: baseline; }
.hd-dau { flex: none; font-size: 12px; font-weight: 700; width: 86px; }
.hd-hinh-noi .hd-ds { grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); }
.hd-hinh-noi .hd-dau { width: 54px; }
.hd-sai .hd-dau { color: #B42318; }
.hd-dung .hd-dau { color: var(--tip-line); }
.hd-sai code { text-decoration: line-through; text-decoration-color: #B42318; color: var(--fg-muted); }
.hd-ds code, .hd-mau-toi code { font-family: var(--font); font-size: 13.5px; background: var(--code-bg); padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.hd-dung code { font-weight: 600; }
.hd-ly-do { margin: 0; font-size: 13px; color: var(--fg-muted); line-height: 1.5; }
:root[data-theme="dark"] .hd-sai .hd-dau { color: #F97066; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hd-sai .hd-dau { color: #F97066; } }

/* Cây thư mục bộ nhớ của tôi */
.hd-bn { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-elev); margin: 0 0 8px; }
.hd-bn summary { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; font-weight: 600; }
.hd-bn[open] summary { border-bottom: 1px solid var(--line); }
.ct-muc ul.hd-cay { list-style: none; margin: 0; padding: 8px 14px 12px 14px; line-height: 1.5; }
.ct-muc ul.hd-cay ul.hd-cay { padding: 0 0 0 22px; border-left: 1px dashed var(--line-strong); margin-left: 9px; }
.hd-cay-dong { display: inline-flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 14px; }
.hd-cay-dong .hd-bt { width: 17px; height: 17px; }

/* Bước 3: cấu tạo tên tệp */
.hd-mau { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.hd-p0 { --c: var(--p0); --cb: var(--p0b); } .hd-p1 { --c: var(--p1); --cb: var(--p1b); }
.hd-p2 { --c: var(--p2); --cb: var(--p2b); } .hd-p3 { --c: var(--p3); --cb: var(--p3b); }
.hd-phan { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 8px;
  border: 2px solid var(--c); background: var(--cb); color: var(--c); }
.hd-phan b { width: 20px; height: 20px; border-radius: 50%; color: #fff; background: var(--c); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.hd-vd { display: flex; flex-direction: column; gap: 10px; }
.hd-vd-dong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.hd-vd-ten { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 15px; }
.hd-vd-ten .hd-bt { margin-right: 4px; }
.hd-manh { background: var(--cb); border-bottom: 3px solid var(--c); padding: 1px 5px; border-radius: 4px 4px 0 0; }
.hd-duoi { color: var(--fg-muted); }
.hd-vd-chu { font-size: 13px; color: var(--fg-muted); }
.hd-chu-giai { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 18px 0 0; font-size: 14px; }
.hd-chu-giai dt { font-weight: 700; color: var(--c); }
.hd-chu-giai dd { margin: 0; color: var(--fg-muted); }
.ct-muc ul.hd-mau-toi { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.hd-loai { display: flex; flex-wrap: wrap; gap: 6px; }
.hd-p1-nhe { font-size: 13.5px; padding: 3px 10px; border-radius: 999px; background: var(--tip-bg); color: var(--tip-line); border: 1px solid var(--tip-line); }

/* Bước 4 */
.hd-hoi-nhanh { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 16px 0; background: var(--bg-elev); }
.ct-muc ul.hd-tick { list-style: none; padding: 0; margin: 6px 0 0; }
.hd-tick li { padding: 4px 0; }
.hd-tick input { width: 17px; height: 17px; vertical-align: -3px; accent-color: var(--accent); }
.hd-tick label:has(input:checked) { color: var(--fg-muted); }
.hd-cam { font-size: 15px; letter-spacing: .12em; }

/* Bước 5: vòng đời */
.hd-vong { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.hd-vong li { position: relative; background: var(--bg-elev); border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 10px;
  padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.hd-vong-0 { --c: var(--soon-line); } .hd-vong-1 { --c: var(--tip-line); } .hd-vong-2 { --c: var(--rule-line); } .hd-vong-3 { --c: var(--warn-line); }
.hd-vong li + li::before { content: "→"; position: absolute; left: -19px; top: 40%; color: var(--fg-muted); font-weight: 700; }
.hd-vong-so { width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: #fff; font-size: 13px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
.hd-vong-noi { font-size: 13.5px; font-weight: 600; color: var(--c); }
.hd-vong-viec { font-size: 13.5px; color: var(--fg-muted); line-height: 1.5; }
.hd-anh { margin-top: 6px; }
.hd-chan { margin-top: 28px; }

@media (max-width: 760px) {
  .hd-vong { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .hd-vong li + li::before { content: "↓"; left: 50%; top: -20px; }
}
@media (max-width: 640px) {
  .ct-the-nut { flex: 1; padding: 10px 6px; font-size: 14px; }
  .hd-hinh-noi { padding: 14px 12px; }
  .hd-luong { --rong-hoi: 100%; }
  .hd-hang { grid-template-columns: minmax(0, 1fr); }
  .hd-mui { text-align: left; padding: 6px 0 6px 22px; margin-left: 10px; }
  .hd-mui::after { left: 0; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .hd-mui::before { display: none; }
  .hd-kq { margin-left: 10px; }
  .hd-hang > .hd-kq { margin-left: 10px; }
  .hd-xuong { padding-left: 32px; }
  .hd-xuong::before { left: 21px; }
  .hd-xuong::after { left: 16px; }
  .hd-kq-cuoi { margin-left: 0; }
  .hd-bac li { grid-template-columns: minmax(0, 1fr); grid-template-areas: "nhan" "ten" "qt"; margin-left: calc(var(--lui) * 10px); }
  .hd-bac li + li::before { display: none; }
  .shot-grid.hd-anh { grid-template-columns: minmax(0, 1fr); }
  .hd-chu-giai { grid-template-columns: minmax(0, 1fr); }
  .hd-chu-giai dd { margin-bottom: 6px; }
}
@media print {
  .topbar, header, nav, footer, .ct-the, .ct-thoat, .hd-in, .hd-muc-luc, .ct-o:not(.ct-hd) { display: none !important; }
  .ct-wrap > h1, .ct-wrap > .lead { display: none; }
  .ct-o.ct-hd[hidden] { display: block !important; }
  .hd-hinh, .hd-ds-the, .hd-bac li, .hd-vong li, .shot, .hd-bn { break-inside: avoid; }
  body { background: #fff; }
}
