/* Bảng màu Pacvina 2026: Mint Dream #34D399→#D9F99D · Lavender Sky #6AA4FF→#C3CFE2 · Coral Sunset #FF9A9E→#FAD0C4 · Midnight Blue #243B55→#141E30
   Font: Reddit Sans (giao diện) + Old Standard TT (tiêu đề lớn) */
:root {
  --accent: #34d399;          /* mint — nền nút chính, trạng thái đang chọn */
  --accent-hover: #2bc48c;
  --accent-dark: #087a55;     /* mint đậm — viền, biểu tượng, liên kết */
  --accent-ink: #047857;      /* chữ màu mint trên nền sáng (đủ tương phản) */
  --accent-soft: #e7faf2;
  --accent-2: #d9f99d;        /* lime nhạt */
  --on-accent: #0f1b2d;       /* chữ trên nền mint */
  --lav: #6aa4ff; --lav-2: #c3cfe2; --lav-soft: #edf3ff; --lav-ink: #2f63c7;
  --coral: #ff9a9e; --coral-2: #fad0c4; --coral-soft: #fff1ef;
  --pink: #ff7f86;            /* nhấn phụ / cảnh báo nhẹ */
  --ink: #141e30;             /* midnight */
  --ink-2: #243b55;
  --linen: #e6ebf2;
  --bg: #f3f5f9;
  --panel: #ffffff;
  --line: #e2e7ef;
  --muted: #627083;
  --canvas-bg: #edf0f5;
  /* Token bổ sung 16/10/2026 — quy tắc: .claude/rules/giao-dien.md (không viết mã hex mới ngoài :root) */
  --accent-strong: #10b981;   /* viền chọn, focus trên canvas */
  --accent-line: #bdf0dc;     /* viền mint nhạt */
  --ink-3: #2a3547;
  --on-dark: #ffffff;         /* chữ / icon trên nền tối hoặc nền màu */
  --panel-2: #f9fafc;         /* nền phụ: đầu bảng, ô nổi nhẹ */
  --field: #f5f7fa;           /* nền ô nhập */
  --hover: #eef2f7;           /* di chuột lên nút / dòng */
  --glass: rgba(255, 255, 255, .94); /* thanh / bảng nổi trên khung vẽ */
  --line-strong: #c6cdd8;
  --muted-2: #94a0b2;         /* chữ phụ nhạt, icon mờ */
  --danger: #c0353d; --danger-soft: #fdecee;
  --warn: #c2410c; --warn-soft: #fff4d6; --warn-ink: #7a5a00;
  --ok: #047857;
  --sel-bg: var(--accent-soft); --sel-ink: var(--accent-ink); /* trạng thái đang chọn — một kiểu duy nhất */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(20, 30, 48, .05), 0 6px 20px rgba(20, 30, 48, .07);
  --shadow-2: 0 12px 40px rgba(20, 30, 48, .18);
  --grad-mint: linear-gradient(150deg, #34d399 0%, #d9f99d 100%);
  --grad-lav: linear-gradient(150deg, #6aa4ff 0%, #c3cfe2 100%);
  --grad-coral: linear-gradient(150deg, #ff9a9e 0%, #fad0c4 100%);
  --grad-night: linear-gradient(160deg, #243b55 0%, #141e30 100%);
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 48, .05), 0 6px 20px rgba(20, 30, 48, .07);
  --font-ui: "Reddit Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Old Standard TT", "Cormorant Garamond", Georgia, serif;
  --font-mono: ui-monospace, Consolas, monospace;
  font-family: var(--font-ui);
  color: var(--ink);
  font-size: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
h2 { font-size: 16px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 13px; margin: 0; font-weight: 700; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Thanh trên ---------- */
.topbar { height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; box-shadow: 0 4px 12px rgba(52, 211, 153, .35); }
.brand b { display: block; font-size: 16px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.crumb { color: var(--muted); font-size: 13px; margin-left: 10px; padding-left: 16px; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.spacer { flex: 1; }
.icon-btn { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; width: 38px; height: 36px; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: var(--field); }
.icon-btn.on { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--accent-line); }

.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap; transition: .15s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: var(--line-strong); background: var(--panel-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.block { width: 100%; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.danger { color: var(--danger); }
.btn svg { flex: none; }
.link { background: none; border: 0; color: var(--accent-ink); cursor: pointer; padding: 0; font-size: 12px; font-weight: 600; }
.caret { font-size: 10px; opacity: .8; }

.seg { display: inline-flex; background: var(--hover); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); transition: .15s; white-space: nowrap; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(20, 30, 48, .12); }
.seg.small button { padding: 4px 9px; font-size: 12px; }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }
#sideSeg button.on[data-side="in"] { background: var(--ink); color: var(--on-dark); } /* mặt trong: cố ý tối, khớp .in-tag */
.mt8 { margin-top: 8px; }

.menu { position: relative; }
.menu-list { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 40px rgba(20, 30, 48, .18); padding: 6px; width: 300px; z-index: 20; }
.menu.open .menu-list { display: block; }
.menu-list button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; border: 0; background: none; padding: 9px 12px; border-radius: 10px; cursor: pointer; text-align: left; }
.menu-list button:hover { background: var(--accent-soft); }
.menu-list small { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

/* ---------- Bố cục: thanh biểu tượng | bảng trái (đóng/mở) | khung giữa | bảng phải (đóng/mở) ---------- */
.layout { --lw: 300px; --rw: 270px; --rr: 68px; display: grid; grid-template-columns: 72px var(--lw) 1fr var(--rw) var(--rr); height: calc(100% - 58px); }
.layout.left-closed { --lw: 0px; }
.layout.right-closed { --rw: 0px; }
/* Xem Mockup 3D: không có gì để thiết kế → ẩn hẳn bảng phải */
.layout.only3d { --rw: 0px; --rr: 0px; }
.layout.only3d .rrail { display: none; }
.layout.left-closed .side.left, .layout.right-closed .side.right, .layout.only3d .side.right { padding: 0; overflow: hidden; }

.rail { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; }
.rail button { width: 60px; border: 0; background: none; border-radius: 12px; padding: 9px 2px 7px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: var(--muted); font-size: 10.5px; font-weight: 600; transition: .15s; }
.rail button svg { width: 22px; height: 22px; }
.rail button:hover { background: var(--hover); color: var(--ink); }
.rail button.on { background: var(--accent-soft); color: var(--accent-dark); }
.rail button.on.closed { background: none; color: var(--accent-dark); }

.side { overflow-y: auto; overflow-x: hidden; min-width: 0; }
.side.left { background: var(--panel); border-right: 1px solid var(--line); padding: 16px; }
.side.right { padding: 14px; background: var(--panel); border-left: 1px solid var(--line); }
.rpage { display: none; } .rpage.on { display: block; }
.rrail { border-right: 0; border-left: 1px solid var(--line); }
.rrail button { width: 58px; }
.page { display: none; } .page.on { display: block; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 8px; }
.sub-head { font-size: 12px; font-weight: 700; color: var(--ink); margin: 16px 0 8px; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.card { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; }
.count { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 8px 0 0; }
.row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.row.two { display: grid; grid-template-columns: 1fr 1fr; margin-top: 0; }
.lbl { font-size: 12px; color: var(--muted); font-weight: 600; }

/* Thu gọn / mở rộng */
details.acc > summary { cursor: pointer; list-style: none; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 8px; user-select: none; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: .15s; margin-right: 2px; }
details.acc[open] > summary::before { transform: rotate(45deg); }
details.acc .sum-right { margin-left: auto; }
.acc-body { padding-top: 10px; }
.side.left details.acc { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 14px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; user-select: none; transition: .15s; }
.chip.on, .chip:has(input:checked) { background: var(--sel-bg); border-color: var(--accent-line); color: var(--sel-ink); }
.chip input { display: none; }

.tpl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tpl { border: 1.5px solid var(--line); border-radius: 12px; padding: 8px; cursor: pointer; background: var(--panel-2); text-align: left; display: flex; flex-direction: column; gap: 3px; transition: .15s; }
.tpl:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.tpl.active { border-color: var(--accent); background: var(--accent-soft); }
.tpl .thumb { height: 66px; display: flex; align-items: center; justify-content: center; color: var(--muted-2); margin-bottom: 2px; }
.tpl .thumb svg { max-width: 100%; max-height: 100%; }
.tpl.active .thumb { color: var(--ink); }
.tpl b { font-size: 12px; line-height: 1.3; font-weight: 700; }
.tpl small { font-size: 10px; color: var(--accent-ink); font-weight: 700; letter-spacing: .02em; }

.dim-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.params { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.inp { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; transition: .15s; }
.inp.short { max-width: 140px; }
.inp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inp input { border: 0; outline: 0; width: 100%; padding: 8px 9px; background: transparent; font-weight: 600; min-width: 0; }
.inp input::placeholder { color: var(--muted-2); font-weight: 500; }
.inp .unit { font-size: 11px; color: var(--muted); padding-right: 9px; }
.dim-grid .inp input { font-size: 16px; font-weight: 700; }
.selects { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.selects .field { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
.selects .field > label { flex: none; }
.selects select { width: 60%; }
#winParams { margin-top: 10px; }

.mat-list { display: flex; flex-direction: column; gap: 6px; }
.mat { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: 12px; padding: 7px; cursor: pointer; background: var(--panel); text-align: left; transition: .15s; }
.mat:hover { border-color: var(--accent-line); }
.mat.active { border-color: var(--accent); background: var(--accent-soft); }
.mat canvas { width: 44px; height: 44px; border-radius: 9px; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.mat b { display: block; font-size: 12.5px; }
.mat small { display: block; font-size: 11px; color: var(--muted); }
.mat .th { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 700; white-space: nowrap; }

.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tools button { border: 1.5px solid var(--line); background: var(--panel); border-radius: 12px; padding: 9px 10px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: .15s; }
.tools button b { font-size: 12.5px; } .tools button small { font-size: 10.5px; color: var(--muted); }
.tools button.on { border-color: var(--accent); background: var(--accent-soft); }
.opt-box { margin-top: 4px; }
.custom-list { display: flex; flex-direction: column; gap: 6px; }
.custom-list:empty::after { content: 'Chưa có chi tiết nào. Chọn một công cụ ở trên để bắt đầu.'; color: var(--muted); font-size: 12px; }
.citem { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--panel); }
.citem.warn { border-color: #f0a3a8; background: var(--danger-soft); }
.citem .ct { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.citem .ct .tag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--hover); color: var(--muted); }
.citem .ct button { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--muted); }
.citem .cf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.citem .cf .inp input { padding: 5px 6px; font-size: 12px; }
.citem .cf select { padding: 5px 6px; font-size: 12px; }
.citem .wm { color: var(--danger); font-size: 11.5px; margin-top: 6px; }

.stats { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; margin: 0; font-size: 12.5px; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font-weight: 700; text-align: right; }

/* ---------- Khung giữa ---------- */
.stage { position: relative; min-width: 0; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.views { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-height: 0; }
.views.v2d { grid-template-columns: 1fr; } .views.v2d #view3d { display: none; }
.views.v3d { grid-template-columns: 1fr; } .views.v3d #view2d { display: none; }
.view { position: relative; min-width: 0; min-height: 0; overflow: hidden; border-radius: 18px; box-shadow: var(--shadow); }
#view2d { background: var(--canvas-bg); }
#view2d canvas, #view3d canvas { display: block; }
.float { position: absolute; z-index: 3; }
.float.tr { right: 12px; top: 12px; }
.float.bc { left: 50%; bottom: 14px; transform: translateX(-50%); }
.float.topbar2 { left: 12px; right: 12px; top: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; pointer-events: none; }
.float.topbar2 > * { pointer-events: auto; }
.toggles { margin: 0; justify-content: flex-end; }
.toggles .chip { background: var(--glass); backdrop-filter: blur(6px); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); background: var(--glass); padding: 6px 12px; border-radius: 10px; backdrop-filter: blur(6px); }
.legend i { display: inline-block; width: 18px; height: 0; vertical-align: middle; margin-right: 6px; border-top: 2px solid #ff0000; }
.legend i.crease { border-top: 2px dashed #00a651; }
.legend i.perf { border-top: 2px dashed #ff00b4; }
.legend i.bleed { border-top: 1.5px solid #00a0e9; }
.legend i.film { border-top: 1.5px dotted #8a8f99; }
.legend .in-tag { background: var(--ink); color: var(--on-dark); border-radius: 6px; padding: 1px 8px; font-weight: 600; }
.side-badge { position: absolute; z-index: 3; left: 50%; top: 56px; transform: translateX(-50%); background: var(--ink); color: var(--on-dark); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; }
.toolbar { display: flex; align-items: center; gap: 6px; background: var(--glass); padding: 6px 10px; border-radius: 14px; box-shadow: 0 8px 26px rgba(20, 30, 48, .16); white-space: nowrap; font-size: 12px; color: var(--muted); }
.toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.toolbar input[type=range] { width: 120px; accent-color: var(--accent); }
.toolbar input[type=color] { width: 26px; height: 24px; border: 0; padding: 0; background: none; cursor: pointer; }
.tb { border: 0; background: none; cursor: pointer; padding: 6px 9px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 5px; }
.tb:hover { background: var(--hover); }
.tb.on { background: var(--sel-bg); color: var(--sel-ink); }
.tb.chk input { accent-color: var(--accent); }
.zoomval { min-width: 46px; text-align: center; font-weight: 700; color: var(--ink); font-size: 12px; }
.play { width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); cursor: pointer; font-size: 11px; }
.toolbar .lbl { font-size: 12px; }

.layerbar { position: absolute; z-index: 4; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 2px; background: var(--panel); border-radius: 12px; padding: 5px; box-shadow: 0 8px 26px rgba(20, 30, 48, .2); }
.layerbar button { border: 0; background: none; width: 34px; height: 32px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.layerbar button svg { width: 19px; height: 19px; }
.layerbar button:hover { background: var(--hover); }
.layerbar button.on { background: var(--accent-soft); color: var(--accent-dark); }
.layerbar button.danger:hover { background: var(--danger-soft); color: var(--danger); }
.layerbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }

.dim-input { position: absolute; z-index: 5; width: 84px; transform: translate(-50%, -50%); border: 2px solid #2f6bff; border-radius: 8px; padding: 4px 6px; font-weight: 700; text-align: center; outline: none; box-shadow: 0 6px 20px rgba(47, 107, 255, .25); }
.popover { position: absolute; z-index: 6; background: var(--panel); border-radius: 16px; box-shadow: 0 18px 40px rgba(20, 30, 48, .22); padding: 14px; }
.size-pop { right: 16px; bottom: 74px; width: 290px; }
.size-pop .dim-grid { margin-top: 0; }
.size-pop .btn.block { margin-top: 12px; }
.flap-pop { width: 330px; max-height: 70%; overflow-y: auto; }
.flap-pop h3 { margin-bottom: 4px; }
.sugg { display: flex; flex-direction: column; gap: 5px; margin: 10px 0; }
.sugg button { border: 1.5px solid var(--line); background: var(--panel); border-radius: 10px; padding: 7px 9px; text-align: left; cursor: pointer; }
.sugg button b { font-size: 12.5px; display: block; } .sugg button small { font-size: 11px; color: var(--muted); }
.sugg button.on { border-color: var(--accent); background: var(--accent-soft); }
.sugg button.best::after { content: 'Gợi ý'; float: right; font-size: 10px; font-weight: 700; color: var(--on-dark); background: var(--pink); border-radius: 6px; padding: 1px 6px; margin-top: -1px; }
.flap-pop .params { margin-top: 6px; }
.flap-pop .actions { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }
.drop-hint { position: absolute; inset: 10px; border: 2px dashed var(--accent); border-radius: 14px; background: rgba(227, 243, 236, .7); display: grid; place-items: center; font-weight: 700; color: var(--accent-dark); z-index: 7; pointer-events: none; }

/* ---------- Bảng phải ---------- */
select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 9px; background: var(--panel); outline: none; }
select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 60px; }
#faceRow { margin-top: 10px; }
.swatches { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.sw.on { box-shadow: 0 0 0 2px var(--accent); }
.sw.none { background: conic-gradient(#fff 0 25%, #e6e6e6 0 50%, #fff 0 75%, #e6e6e6 0) 0 0 / 10px 10px; }
.sw.custom { position: relative; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.sw.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.gallery:empty { display: none; }
.gallery button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--panel); cursor: pointer; }
.gallery img { width: 100%; height: 100%; object-fit: contain; }
.layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.layers:empty::after { content: 'Chưa có lớp nào'; color: var(--muted); font-size: 12px; }
.layers li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 12.5px; background: var(--panel); }
.layers li.on { border-color: var(--accent); background: var(--accent-soft); }
.layers li img { width: 28px; height: 28px; object-fit: cover; border-radius: 6px; background: var(--hover); }
.layers li .ty { width: 28px; height: 28px; border-radius: 6px; background: var(--ink); color: var(--on-dark); display: grid; place-items: center; font-weight: 800; }
.layers li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layers li button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 3px 5px; border-radius: 6px; }
.layers li button:hover { background: #e6e9e3; color: var(--ink); }
.editor { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); display: grid; grid-template-columns: 1fr 1fr; gap: 9px 10px; }
.editor .full { grid-column: 1 / -1; }
.editor input[type=range] { width: 100%; accent-color: var(--accent); }
.editor .inp input { padding: 6px 8px; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--on-dark); padding: 10px 18px; border-radius: 12px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 1350px) { .crumb { display: none; } }

/* ---------- Menu dự án, trạng thái lưu, hộp thoại ---------- */
.menu-list.left { left: 0; right: auto; width: 290px; }
.menu-list hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.proj-name { display: flex; align-items: center; gap: 6px; padding: 6px 8px; color: var(--muted); }
.proj-name input { flex: 1; border: 1px solid transparent; border-radius: 8px; padding: 6px 8px; font-weight: 700; font-size: 14px; outline: none; min-width: 0; }
.proj-name input:hover, .proj-name input:focus { border-color: var(--line); }
.save-state { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.save-state.saving { color: #c58b00; } .save-state.ok { color: var(--accent-dark); } .save-state.err { color: var(--danger); }
.modal { position: fixed; inset: 0; background: rgba(20, 30, 48, .35); z-index: 40; display: grid; place-items: center; }
.modal-card { background: var(--panel); border-radius: 18px; width: min(920px, 92vw); max-height: 84vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, .25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.gcard { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--panel-2); display: flex; flex-direction: column; }
.gcard .gthumb { height: 130px; background: var(--hover) center / contain no-repeat; display: grid; place-items: center; color: var(--muted-2); }
.gcard .gthumb svg { max-width: 90%; max-height: 90%; }
.gcard .gmeta { padding: 8px 10px; font-size: 12px; }
.gcard .gmeta b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard .gmeta small { color: var(--muted); }
.gcard .gact { display: flex; gap: 6px; padding: 0 10px 10px; flex-wrap: wrap; }
.gcard.current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.empty { color: var(--muted); font-size: 13px; padding: 20px 0; text-align: center; }
.tpl .del { position: absolute; top: 4px; right: 4px; border: 0; background: var(--glass); border-radius: 6px; cursor: pointer; color: var(--muted); font-size: 11px; padding: 2px 5px; }
.tpl { position: relative; }

/* ---------- Thư viện tai trong hộp mở rộng cạnh ---------- */
.flap-pop { right: 12px; top: 56px; width: min(390px, calc(100% - 24px)); max-height: calc(100% - 140px); overflow-y: auto; }
.lib-group { font-size: 11px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.lib { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.lib button { border: 1.5px solid var(--line); background: var(--panel); border-radius: 10px; padding: 4px 4px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink); }
.lib button small { font-size: 10.5px; line-height: 1.25; text-align: center; }
.lib button.on { border-color: var(--accent); background: var(--accent-soft); }
.lib button.best { border-color: #ffb3bb; }
.why { font-size: 11.5px; color: var(--accent-dark); background: var(--accent-soft); border-radius: 8px; padding: 6px 8px; margin-top: 8px; }
.angle-row { display: flex; align-items: center; gap: 8px; }
.angle-row input[type=range] { flex: 1; accent-color: var(--accent); }
.quick { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.quick button { border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 3px 8px; cursor: pointer; font-size: 12px; font-weight: 600; }
.quick button.on { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--accent-line); }
.ref-box { margin-top: 0 !important; border-top: 0 !important; padding-top: 0 !important; }
.legend i { border-top-color: var(--c, #000) !important; }

/* ---------- Thanh tác vụ chi tiết, thanh vẽ, danh sách gọn ---------- */
.itembar { position: absolute; z-index: 5; transform: translate(-50%, -100%); display: flex; align-items: center; gap: 3px; background: var(--panel); border-radius: 12px; padding: 5px 7px; box-shadow: 0 8px 26px rgba(20, 30, 48, .22); white-space: nowrap; font-size: 12px; }
.itembar.below, .layerbar.below { transform: translate(-50%, 0); }
.itembar button { border: 0; background: none; border-radius: 7px; padding: 5px 7px; cursor: pointer; font-weight: 600; font-size: 12px; color: var(--ink); }
.itembar button:hover { background: var(--hover); }
.itembar button.on { background: var(--sel-bg); color: var(--sel-ink); }
.itembar button.danger:hover { background: var(--danger-soft); }
.itembar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }
.itembar .lbl { color: var(--muted); font-weight: 600; margin: 0 2px 0 4px; }
.itembar .ttl { margin-right: 6px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.itembar input.mini { width: 56px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 5px; font-weight: 700; font-size: 12px; outline: none; }
.itembar input.mini:focus { border-color: var(--accent); }
.draftbar { position: absolute; z-index: 5; left: 50%; bottom: 70px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; background: var(--ink); color: var(--on-dark); border-radius: 12px; padding: 6px 8px 6px 14px; box-shadow: 0 8px 26px rgba(20, 30, 48, .3); font-size: 12.5px; }
.draftbar .btn { border: 0; }
.draftbar kbd { font: inherit; font-size: 10.5px; opacity: .7; margin-left: 4px; }
.custom-list { max-height: 260px; overflow-y: auto; gap: 3px; }
.custom-list:empty::after { content: '—'; }
.crow { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 8px; cursor: pointer; font-size: 12px; border: 1px solid transparent; }
.crow:hover { background: var(--field); }
.crow.on { background: var(--accent-soft); border-color: var(--accent); }
.crow.warn { background: var(--danger-soft); }
.crow.warn .nm::after { content: ' ⚠'; color: var(--danger); }
.crow .ic { width: 18px; text-align: center; color: var(--muted); }
.crow .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.crow .val { color: var(--muted); white-space: nowrap; font-size: 11.5px; }
.crow button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px 4px; border-radius: 5px; visibility: hidden; }
.crow:hover button, .crow.on button { visibility: visible; }
.lib.compact { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.lib.compact button { padding: 3px 2px 4px; }
.lib.compact button svg { width: 44px; height: 32px; }
.lib.compact button small { font-size: 9.5px; }
.tools { grid-template-columns: 1fr 1fr; }
.tools button { padding: 8px 10px; }
.layers li button.locked { color: var(--ink); }
.menu-list button b { font-weight: 600; }
.itembar select.mini { width: auto; max-width: 150px; padding: 4px 6px; font-size: 12px; font-weight: 600; border-radius: 7px; }
.tools { grid-template-columns: 1fr 1fr; }
.field label small { color: var(--muted); font-weight: 500; }

/* Thứ tự gấp */
.seq-acts { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.sub-head.row-between:has(#seqAuto) { flex-wrap: wrap; row-gap: 4px; }
.sub-head.row-between:has(#seqAuto) .seq-acts { width: 100%; justify-content: flex-start; }
#seqAuto { font-weight: 700; }
.seq-list { display: flex; flex-direction: column; max-height: 340px; overflow-y: auto; margin-top: 6px; }
.seq-step { border: 1px solid var(--line); border-radius: 10px; padding: 4px; background: var(--panel); }
.seq-step.drop, .seq-gap.drop { border-color: var(--accent); background: var(--accent-soft); }
.seq-head { font-size: 11px; font-weight: 700; color: var(--muted); padding: 3px 6px; cursor: pointer; text-transform: uppercase; letter-spacing: .04em; }
.seq-head:hover { color: var(--ink); }
.seq-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 7px; font-size: 12px; cursor: grab; }
.seq-row:hover { background: var(--field); }
.seq-row.on { background: var(--accent-soft); }
.seq-row.dragging { opacity: .4; }
.seq-row .grip { color: var(--muted); }
.seq-row .nm { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seq-row .val { color: var(--muted); font-size: 11px; }
.seq-row button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 1px 4px; border-radius: 5px; font-size: 10px; }
.seq-row button:hover { background: var(--line); color: var(--ink); }
.seq-gap { height: 8px; border: 1px dashed transparent; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 10.5px; color: transparent; transition: height .12s; }
.seq-list.dragging .seq-gap { height: 22px; border-color: var(--line); color: var(--muted); }

/* Nhập dieline */
.imp-btns { margin-left: auto; display: inline-flex; gap: 10px; font-size: 12px; }
.imp { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; min-height: 60vh; }
.imp-view { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#impCv { width: 100%; flex: 1; min-height: 380px; background: var(--field); border-radius: 12px; cursor: crosshair; }
.imp-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--muted); }
.imp-legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--c); vertical-align: middle; margin-right: 5px; }
.imp-legend i.dash { border-top-style: dashed; }
.imp-legend i.fill { height: 9px; border: 0; background: var(--c); opacity: .5; border-radius: 2px; }
.imp-side { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.imp-side select, .imp-side input { width: 100%; }
.imp-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 2px 0; }
.imp-row span { color: var(--muted); }
.imp-groups { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.imp-g { display: grid; grid-template-columns: 18px minmax(0, 1fr) 118px; gap: 6px; align-items: center; font-size: 12px; }
.imp-g i { width: 16px; height: 0; border-top: 3px solid var(--c); }
.imp-g i.dash { border-top-style: dashed; }
.imp-g .nm { min-width: 0; display: flex; flex-direction: column; }
.imp-g .nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-g .nm small, .muted-s { color: var(--muted); font-weight: 500; font-size: 11px; }
.imp-g select { font-size: 12px; padding: 3px 4px; }
.imp-stats { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
.warn-t { color: var(--warn); font-size: 12px; margin: 4px 0; }
@media (max-width: 760px) { .imp { grid-template-columns: 1fr; } }

/* Nhập hàng loạt */
.inbox { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.inbox-s { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.inbox-h { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; margin-bottom: 4px; }
.inbox-h span { color: var(--muted); font-size: 12px; }
.inbox-r { display: grid; grid-template-columns: 22px minmax(140px, 1.2fr) minmax(0, 2fr) auto auto; gap: 8px; align-items: center; font-size: 12px; padding: 4px 0; border-top: 1px dashed var(--line); }
.inbox-r .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.inbox-r .fn small { color: var(--muted); font-weight: 500; margin-left: 6px; }
.inbox-r .inf { display: flex; gap: 8px; align-items: center; min-width: 0; }
.inbox-r .tag { background: var(--accent-soft); color: var(--accent-dark); border-radius: 6px; padding: 1px 6px; font-size: 11px; }
.inbox-foot { position: sticky; bottom: -16px; background: var(--panel); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0 4px; margin-top: 8px; border-top: 1px solid var(--line); }
.inbox-empty pre { background: var(--field); border-radius: 10px; padding: 10px 12px; font-size: 12px; }
/* Tham chiếu gấp 3D */
.float.bl { left: 12px; bottom: 70px; }
.ref-panel { width: min(380px, calc(100% - 24px)); background: var(--glass); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.ref-head { display: flex; gap: 6px; }
.ref-head select { flex: 1; min-width: 0; font-size: 12px; }
.ref-media video, .ref-media img { width: 100%; max-height: 240px; object-fit: contain; background: #111; border-radius: 8px; display: block; }
.ref-media input[type=range] { width: 100%; }
.ref-media a { font-size: 12px; word-break: break-all; }
.ref-ctl { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; }
.ref-ctl[hidden] { display: none; }
.ref-marks { color: var(--muted); font-size: 11px; width: 100%; }
#btnRef.on { background: var(--accent-soft); color: var(--accent-dark); }

/* Kiểm tra nguyên tắc */
.rule-list { display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow-y: auto; margin-top: 4px; }
.rule-list:empty::after { content: '✓ Không phát hiện vi phạm nguyên tắc'; color: var(--accent-dark); font-size: 12px; }
.rule { display: flex; gap: 6px; font-size: 12px; line-height: 1.35; padding: 5px 7px; border-radius: 8px; cursor: pointer; }
.rule:hover { filter: brightness(.97); }
.rule b { flex: none; font-size: 10.5px; padding: 1px 5px; border-radius: 5px; height: fit-content; }
.rule.error { background: var(--danger-soft); } .rule.error b { background: var(--danger); color: var(--on-dark); }
.rule.warn { background: var(--warn-soft); } .rule.warn b { background: #f0a020; color: var(--on-dark); }
.rule.info { background: #f4f6f2; color: var(--muted); } .rule.info b { background: #c9ccc4; color: var(--on-dark); }
.rule.ok { background: var(--accent-soft); } .rule.ok b { background: var(--accent-strong); color: var(--on-dark); }
.count.bad { color: var(--danger); }
.rules-help h3 { font-size: 14px; margin: 14px 0 6px; }
.rules-help li { font-size: 13px; line-height: 1.55; margin-bottom: 4px; }

.model-info { font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 8px; }
.model-info:empty { display: none; }
.model-info span { color: var(--ink); font-weight: 600; }

/* Góc nhìn 3D có sẵn: thanh dọc mép phải */
.float.mr { right: 12px; top: 50%; transform: translateY(-50%); }
.toolbar.vert { flex-direction: column; padding: 5px; gap: 2px; }
.cam-views .tb { padding: 5px 7px; font-size: 11.5px; font-weight: 600; color: var(--muted); width: 100%; justify-content: center; }
.cam-views .tb:hover { color: var(--ink); }

/* Mở rộng cạnh: bảng gợi ý hiện cạnh cạnh đang chọn */
.edge-picker { position: absolute; z-index: 6; width: 360px; max-height: min(460px, calc(100% - 120px)); display: flex; flex-direction: column; background: var(--panel); border-radius: 16px; box-shadow: 0 14px 40px rgba(20, 30, 48, .24); overflow: hidden; }
.edge-picker .ep-head { display: flex; align-items: flex-start; gap: 8px; padding: 12px 12px 8px 14px; border-bottom: 1px solid var(--line); }
.edge-picker .ep-head > div { flex: 1; min-width: 0; }
.edge-picker .ep-head b { display: block; font-size: 13px; }
.edge-picker .ep-head small { color: var(--muted); font-size: 11.5px; }
.edge-picker .ep-body { overflow: auto; padding: 4px 12px 12px; }
.edge-picker .ep-sec { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 10px 0 6px; }
.edge-picker .ep-top { display: grid; gap: 6px; }
.edge-picker .ep-cols { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.edge-picker .ep-cols .chip { font-size: 11.5px; padding: 4px 9px; }
.edge-picker .ep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ep-card { border: 1.5px solid var(--line); background: var(--panel); border-radius: 10px; padding: 5px 4px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink); text-align: center; font: inherit; }
.ep-card b { font-size: 10.5px; font-weight: 600; line-height: 1.25; display: block; }
.ep-card:hover { border-color: var(--accent); background: var(--accent-soft); }
.ep-card.wide { flex-direction: row; text-align: left; gap: 10px; padding: 6px 10px 6px 6px; border-color: var(--accent-line); }
.ep-card.wide b { font-size: 12.5px; }
.ep-card.wide small { display: block; font-size: 11px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.ep-card svg { flex: none; color: var(--ink); }
ol.steps { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); line-height: 1.5; }
ol.steps li { margin-bottom: 6px; }
ol.steps b { color: var(--ink); }

/* Bố cục trải: 8 cách xếp dải thân */

/* Biến thể: tab trên khung giữa */
.variant-bar { display: flex; align-items: center; gap: 6px; min-height: 40px; overflow-x: auto; scrollbar-width: thin; }
.vtab { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); background: var(--panel); border-radius: 12px; padding: 5px 6px 5px 12px; cursor: pointer; white-space: nowrap; color: var(--ink); font: inherit; max-width: 260px; }
.vtab .vt { display: flex; flex-direction: column; line-height: 1.2; text-align: left; min-width: 0; }
.vtab .vt b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.vtab .vt small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.vtab .vx { border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 7px; padding: 2px 6px; font-size: 12px; }
.vtab .vx:hover { background: var(--hover); color: var(--danger); }
.vtab:hover { border-color: var(--accent-line); }
.vtab.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 2px 10px rgba(52, 211, 153, .15); }
.vtab.add { padding: 7px 12px; color: var(--accent-dark); font-weight: 700; font-size: 12.5px; border-style: dashed; }
.variant-bar .vspace { flex: 1; }
.variant-bar .btn.sm { white-space: nowrap; }

/* Gói & mã mở khoá */
.plan-badge { border: 1.5px solid #f2c3c6; background: var(--danger-soft); color: var(--danger); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; margin-right: 8px; white-space: nowrap; }
.plan-badge.pro { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-dark); }
.plans .code-row { display: flex; gap: 8px; margin: 12px 0 4px; }
.plans .code-row input { flex: 1; font: inherit; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 12px; }
.plan { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.plan b { font-size: 13px; } .plan .price { font-size: 16px; font-weight: 800; color: var(--ink); }
.plan small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.plan.pro { border-color: var(--accent-line); } .plan.biz { border-color: #c9b8f0; background: #faf8ff; }

/* Xuất hàng loạt */
.batch textarea { width: 100%; font: 13px/1.6 var(--font-mono); padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; resize: vertical; box-sizing: border-box; }
.batch .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.batch .chip input { display: none; }


/* Kiểu dàn: thẻ có ảnh lưới ghi tên mặt */
.layout-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.net-card { border: 1.5px solid var(--line); background: var(--panel); border-radius: 12px; padding: 6px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: var(--ink); }
.net-card:hover { border-color: var(--accent-line); }
.net-card.on { border-color: var(--accent); background: var(--accent-soft); }
.net-card .net-img { height: 78px; display: flex; align-items: center; justify-content: center; }
.net-card .net-img svg { width: 100%; height: 100%; }
.net-card b { font-size: 11.5px; display: block; }
.net-card i { font-style: normal; font-size: 10px; font-weight: 700; color: var(--on-accent); background: var(--accent); border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.net-card small { display: none; }
.net-pick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 10px; }
.net-pick-grid .net-card { padding: 10px; }
.net-pick-grid .net-card .net-img { height: 150px; }
.net-pick-grid .net-card b { font-size: 13.5px; display: inline; }
.net-pick-grid .net-card small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* Chèn: chữ, hình khối */
.ins-text { display: grid; gap: 6px; }
.ins-t { border: 1.5px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 12px; text-align: left; cursor: pointer; color: var(--ink); font-family: var(--font-ui); }
.ins-t:hover { border-color: var(--accent); background: var(--accent-soft); }
.ins-t.t1 { font-size: 18px; font-weight: 800; } .ins-t.t2 { font-size: 14px; font-weight: 700; } .ins-t.t3 { font-size: 12px; }
.shape-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.shape-grid button { aspect-ratio: 1; border: 1.5px solid var(--line); background: var(--panel); border-radius: 10px; cursor: pointer; color: var(--ink); display: grid; place-items: center; padding: 6px; }
.shape-grid button:hover { border-color: var(--accent); background: var(--accent-soft); }
.shape-grid svg { width: 100%; height: 100%; }
[data-pen].on { background: var(--accent-soft); border-color: var(--accent); }
.layers li .ty.sh { font-size: 14px; }
.editor .colorrow { display: flex; align-items: center; gap: 6px; }
.editor .colorrow input[type=color] { width: 34px; height: 28px; border: 1px solid var(--line); border-radius: 8px; padding: 0; background: none; }
.editor .colorrow .chip { padding: 3px 8px; font-size: 11px; }

/* Thẻ mẫu: dieline + ảnh 3D */
.tpl .thumb.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; align-items: center; height: 74px; }
.tpl .thumb.duo .d2 { height: 100%; display: flex; align-items: center; justify-content: center; min-width: 0; }
.tpl .thumb.duo .d2 svg { max-width: 100%; max-height: 100%; }
.tpl .thumb.duo .d3 { width: 100%; height: 74px; object-fit: contain; }
.tpl .thumb.duo .d3.wait { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--hover), var(--panel-2), var(--hover)); background-size: 200% 100%; animation: shimmer 1.2s infinite; height: 50px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Bát giác: sơ đồ cạnh + bảng số đo gấp */
.octa-info { display: flex; gap: 10px; align-items: center; font-size: 12px; margin-top: 8px; }
.octa-map { width: 110px; flex: none; }
.octa-tb { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 8px; }
.octa-tb th { text-align: left; color: var(--muted); font-weight: 600; padding: 4px; border-bottom: 1px solid var(--line); }
.octa-tb td { padding: 5px 4px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.octa-tb td:first-child { font-weight: 700; white-space: nowrap; }
.octa-tb tr.bd td:first-child { color: #7a6f5c; }
.octa-tb small { color: var(--muted); }
.field input:disabled { background: #f1f4f7; color: #2F6BFF; font-weight: 700; }

/* Lớp gắn theo mặt */
.face-layers { margin-top: 10px; }
.face-layers .fl-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.face-layers .fl-head small { color: var(--muted); font-weight: 500; }
.fl-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 4px; cursor: pointer; font-size: 12px; }
.fl-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.fl-row small { color: var(--muted); }
.fl-row button { border: 0; background: none; color: var(--muted); cursor: pointer; }
.fl-row button:hover { color: var(--danger); }
.fl-row:hover, .fl-row.on { border-color: var(--accent); background: var(--accent-soft); }
.link.danger { color: var(--danger); }

/* ---------- Công cụ dạng icon (Tự dựng khuôn) ---------- */
.tools.icons { grid-template-columns: repeat(5, 1fr); gap: 5px; }
.tools.icons button { position: relative; align-items: center; justify-content: center; padding: 8px 0 6px; border-radius: 11px; }
.tools.icons button svg { width: 22px; height: 22px; color: var(--ink); }
.tools.icons button kbd { position: absolute; right: 3px; bottom: 2px; font: 600 9px/1 inherit; color: var(--muted); background: none; border: 0; padding: 0; }
.tools.icons button.on svg { color: var(--accent-ink, var(--ink)); }
.chips.icon-chips { gap: 5px; margin-bottom: 6px; }
.chip.ico { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; }
.chip.ico svg { flex: none; }
.chip.ico span { font-size: 12px; }
.chip.ico.on svg path, .chip.ico.on svg polygon { stroke: currentColor; }
i.info { display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; border: 1.3px solid var(--muted); color: var(--muted); font: 700 9px/1 var(--font-display); font-style: italic; cursor: help; vertical-align: 1px; }
kbd { font: 600 10.5px/1 var(--font-mono); background: var(--hover); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 4px; }
.itembar { flex-wrap: wrap; justify-content: center; max-width: min(820px, calc(100% - 16px)); }
.itembar select.mini { border: 1px solid var(--line); border-radius: 7px; padding: 3px 4px; font-weight: 600; font-size: 12px; }

/* ---------- Lớp: ẩn/hiện, kéo thả, nhãn hiệu ứng ---------- */
.layers li .vis { padding: 2px 3px; color: var(--ink); }
.layers li.off { opacity: .55; }
.layers li.off img, .layers li.off .ty { filter: grayscale(1); }
.layers li span small.ltag { display: block; font-size: 10px; color: var(--accent-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.layers li.dragging { opacity: .4; }
.layers li.drop-above { box-shadow: 0 -3px 0 var(--accent); }
.layers li.drop-below { box-shadow: 0 3px 0 var(--accent); }
details.sub-acc { margin-top: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; background: var(--panel); }
details.sub-acc > .editor { margin-top: 8px; border: 0; padding: 0; background: none; }
details.sub-acc i.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.editor select { width: 100%; }
.fx-chips { margin: 0; gap: 5px; }
.fx-chips .chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; font-size: 11.5px; }
.foil-sw { width: 13px; height: 13px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.15); }
.foil-gold { background: linear-gradient(135deg, #7d5a14, #fff1a8, #c99a2e); }
.foil-silver { background: linear-gradient(135deg, #6c727a, #fff, #b9bfc6); }
.foil-copper { background: linear-gradient(135deg, #6d3418, #ffd0ad, #b8653a); }
.foil-rose { background: linear-gradient(135deg, #86554f, #fff0e9, #d29a8d); }
.foil-holo { background: conic-gradient(#ff8fd8, #9fd8ff, #c6ffcf, #fff6a8, #ffb4a1, #ff8fd8); }
.sub-head.mat-group { margin-top: 10px; }

/* ---------- Bảng phím tắt ---------- */
.kbd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px 22px; }
.kbd-grid h4 { margin: 0 0 6px; font-size: 13px; }
.kbd-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.kbd-row small { color: var(--muted); text-align: right; }

/* ---------- Kho ảnh ---------- */
.gal-search { width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px; font: inherit; font-size: 12px; outline: none; }
.gal-search:focus { border-color: var(--accent); }
.gallery { max-height: 260px; overflow-y: auto; }
.gal-item { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: #fff repeating-conic-gradient(var(--hover) 0 25%, #fff 0 50%) 0 0 / 10px 10px; cursor: grab; }
.gal-item:hover { border-color: var(--accent); }
.gal-item img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.gal-del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(20, 30, 48,.75); color: var(--on-dark); font-size: 10px; line-height: 18px; padding: 0; cursor: pointer; display: none; }
.gal-item:hover .gal-del { display: block; }

/* ---------- Quy trình khép kín 1 → 2 → 3 (thanh trên) ---------- */
.flow { list-style: none; display: flex; gap: 2px; margin: 0 6px 0 0; padding: 3px; background: var(--hover); border-radius: 11px; }
.flow li { display: flex; align-items: center; gap: 6px; padding: 5px 11px 5px 6px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.flow li i { font-style: normal; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: #dfe2db; color: var(--ink); }
.flow li:hover { color: var(--ink); }
.flow li.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(20, 30, 48, .12); }
.flow li.on i { background: var(--accent); color: var(--on-accent); }
.flow li[data-flow="design"] i { background: var(--pink); color: var(--on-dark); }
.rail button.rail-studio { color: var(--pink); }
.rail button.rail-studio:hover { background: var(--danger-soft); }
.tb.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }


/* ---------- Icon chung (js/icons.js) ---------- */
svg.ic { width: 18px; height: 18px; flex: none; overflow: visible; vertical-align: -4px; }
.btn svg.ic, .tb svg.ic, .itembar button svg.ic, .ins-t svg.ic { width: 16px; height: 16px; }
.tb, .itembar button, .layerbar button, .btn { gap: 6px; }
.tb { display: inline-flex; align-items: center; }
.icon-btn svg, .icon-btn svg.ic { width: 18px; height: 18px; }
.shape-grid svg.ic { width: 26px; height: 26px; }
.layerbar button svg, .layerbar button svg.ic { width: 18px; height: 18px; }
.layers li button svg.ic, .fl-row button svg.ic, .crow button svg.ic, .gal-del svg.ic, .vx svg.ic, .tpl .del svg.ic { width: 13px; height: 13px; vertical-align: -2px; }
.layers li .ty.sh svg.ic { width: 16px; height: 16px; }
.crow .ic svg.ic, .seq-row .grip svg.ic { width: 15px; height: 15px; vertical-align: -3px; }
.play svg.ic { width: 16px; height: 16px; vertical-align: -3px; }
.ep-sec svg.ic { width: 14px; height: 14px; color: var(--accent-ink); vertical-align: -2px; }
.caret svg.ic, .btn .ic + .ic { width: 12px; height: 12px; }

/* ---------- Logo = nút Trang chủ, bước quy trình gộp, tab tài liệu (như Illustrator) ---------- */
.brand-btn { border: 0; background: none; padding: 4px 8px 4px 4px; border-radius: 12px; cursor: pointer; color: inherit; font: inherit; text-align: left; }
.brand-btn:hover { background: var(--hover); }
.menu-list button:has(kbd) { flex-direction: row; justify-content: space-between; align-items: center; }
.menu-list kbd { font: 600 11px/1 var(--font-ui); color: var(--muted); background: var(--hover); border-radius: 6px; padding: 4px 6px; }
.toast { z-index: 300; }
.doctabs { display: flex; align-items: flex-end; gap: 3px; margin: -12px -12px 0; padding: 6px 12px 0; border-bottom: 1px solid var(--line); background: var(--hover); min-height: 40px; overflow-x: auto; scrollbar-width: none; flex: none; }
.dtab { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 6px 0 10px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; cursor: pointer; color: var(--muted); max-width: 230px; min-width: 120px; white-space: nowrap; flex: none; transition: background .15s; }
.dtab:hover { background: var(--field); color: var(--ink); }
.dtab.on { background: var(--bg); border-color: var(--line); color: var(--ink); margin-bottom: -1px; height: 35px; box-shadow: inset 0 2px 0 var(--accent); }
.dtab > .ic { flex: none; opacity: .7; }
.dtab.on > .ic { color: var(--accent-ink); opacity: 1; }
.dt-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; flex: 1; }
.dt-t b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.dt-t small { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.dtab .dx { border: 0; background: none; color: var(--muted); border-radius: 6px; width: 22px; height: 22px; display: grid; place-items: center; cursor: pointer; flex: none; opacity: .6; }
.dtab:hover .dx, .dtab.on .dx { opacity: 1; }
.dtab .dx:hover { background: var(--line); color: var(--danger); }
.dtab-add { border: 0; background: none; width: 30px; height: 30px; margin-bottom: 3px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--muted); flex: none; }
.dtab-add:hover { background: var(--field); color: var(--accent-dark); }

/* ---------- Trang chủ ---------- */
.home { position: fixed; inset: 0; z-index: 80; display: grid; grid-template-columns: 252px 1fr; background: var(--panel); color: var(--ink); }
.h-side { display: flex; flex-direction: column; gap: 8px; padding: 16px 14px; border-right: 1px solid var(--line); background: var(--panel); min-height: 0; }
.h-brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 10px; }
.h-brand .logo { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; box-shadow: 0 4px 12px rgba(52, 211, 153, .35); }
.h-brand b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.h-brand small { display: block; font-size: 11px; color: var(--muted); }
.btn.block { width: 100%; }
.h-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; overflow-y: auto; flex: 1; }
.h-nav hr { border: 0; border-top: 1px solid var(--line); margin: 8px 6px; width: calc(100% - 12px); }
.h-nav button { display: flex; align-items: center; gap: 12px; border: 1.5px solid transparent; background: none; padding: 10px 12px; border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); text-align: left; }
.h-nav button:hover { background: var(--field); }
.h-nav button.on { border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); background: var(--panel); }
.h-me { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--panel); padding: 10px 12px; cursor: pointer; text-align: left; box-shadow: 2px 3px 0 var(--ink); }
.h-me span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.h-me b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-plan { align-self: flex-start; font-size: 11px; font-weight: 700; color: #7a52d6; border: 1px solid #b9a3ef; border-radius: 6px; padding: 0 6px; }
.h-plan.pro { color: var(--accent-dark); border-color: #9fd9c3; background: var(--accent-soft); }
.h-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--panel); }
.h-top { display: flex; align-items: center; gap: 12px; padding: 14px 32px; border-bottom: 1px solid var(--line); }
.h-top .sp, .h-sec .sp { flex: 1; }
.h-search { display: flex; align-items: center; gap: 8px; background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; width: min(460px, 50vw); height: 40px; color: var(--muted); }
.h-search input { border: 0; background: none; outline: none; flex: 1; font-size: 14px; color: var(--ink); }
.h-top kbd { font: 600 11px/1 var(--font-ui); color: var(--muted); background: var(--hover); border-radius: 6px; padding: 3px 5px; }
.h-body { flex: 1; overflow-y: auto; padding: 26px 32px 48px; }
.h-body h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 18px; }
.h-crumb { font-size: inherit; font-weight: 600; color: var(--muted); }
.h-sub { color: var(--muted); margin: -8px 0 16px; max-width: 760px; }
.h-sec { display: flex; align-items: center; gap: 12px; margin: 28px 0 14px; }
.h-sec h2 { font-size: 18px; }
.h-quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; max-width: 980px; }
.h-qa { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; text-align: left; border: 1.5px solid var(--line); background: var(--panel); border-radius: 16px; padding: 16px 18px; cursor: pointer; transition: .15s; font: inherit; color: var(--ink); }
.h-qa .ic { grid-row: span 2; color: var(--accent-ink); }
.h-qa b { font-size: 15px; } .h-qa small { color: var(--muted); }
.h-qa:hover { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.h-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.h-tpl { position: relative; display: flex; flex-direction: column; gap: 3px; border: 1.5px solid var(--line); background: var(--panel); border-radius: 14px; padding: 8px 8px 12px; cursor: pointer; text-align: left; color: var(--ink); font: inherit; transition: .15s; }
.h-tpl:hover { border-color: var(--accent); box-shadow: 0 6px 20px rgba(20, 30, 48, .08); }
.h-tthumb { aspect-ratio: 4 / 3; border-radius: 10px; background: linear-gradient(var(--field), var(--line)); display: grid; place-items: center; overflow: hidden; margin-bottom: 6px; }
.h-tthumb img, .h-tthumb svg { max-width: 88%; max-height: 88%; }
.h-tpl small { font-size: 10.5px; color: var(--accent-ink); font-weight: 700; letter-spacing: .02em; }
.h-tpl b { font-size: 13px; font-weight: 600; }
.h-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px 18px; border-radius: 14px; }
.h-card { display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; }
.h-thumb { position: relative; aspect-ratio: 1.62; border: 1px solid #d9dcd5; border-radius: 12px; background: linear-gradient(#f2f3ef, #d9dbd5) center / cover no-repeat; display: grid; place-items: center; color: #b5bab1; margin-bottom: 6px; transition: .15s; }
.h-card:hover .h-thumb { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.h-card b { font-size: 14.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-card small { font-size: 12.5px; color: var(--muted); }
.h-card small.muted { color: var(--muted-2); }
.h-open { position: absolute; left: 8px; top: 8px; font-style: normal; font-size: 10.5px; font-weight: 700; background: var(--accent); color: var(--on-accent); border-radius: 6px; padding: 2px 7px; }
.h-row .h-open { position: static; margin-left: 8px; }
.h-star, .h-more { border: 0; background: var(--glass); width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; color: var(--muted); box-shadow: 0 1px 4px rgba(20, 30, 48, .12); flex: none; }
.h-thumb .h-star { position: absolute; right: 44px; top: 8px; opacity: 0; transition: .15s; }
.h-thumb .h-more { position: absolute; right: 8px; top: 8px; opacity: 0; transition: .15s; }
.h-card:hover .h-star, .h-card:hover .h-more, .h-star.on { opacity: 1; }
.h-star.on { color: #e9a800; }
.h-star:hover, .h-more:hover { color: var(--ink); }
.h-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.h-row { display: grid; grid-template-columns: 56px minmax(180px, 2fr) 1.2fr 1fr 1.2fr 90px 36px 36px; align-items: center; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.h-row:first-child { border-top: 0; }
.h-row.head { cursor: default; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: var(--panel-2); }
.h-row:not(.head):hover { background: #f7f8f5; }
.h-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-row > span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-row .h-star, .h-row .h-more { box-shadow: none; background: none; }
.h-rthumb { width: 56px; height: 38px; border-radius: 7px; border: 1px solid var(--line); background: var(--hover) center / cover no-repeat; }
.h-vt button { display: grid; place-items: center; padding: 5px 8px; }
.h-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.h-sort select { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--field); font-weight: 600; }
.h-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.h-folder { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 12px 14px 16px; cursor: pointer; background: var(--panel); color: var(--ink); font: inherit; text-align: left; transition: .15s; min-height: 72px; }
.h-folder > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.h-folder b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .h-folder small { color: var(--muted); }
.h-folder .ic { color: var(--accent-ink); flex: none; }
.h-folder .h-more { box-shadow: none; background: none; }
.h-folder.add { border-style: dashed; color: var(--muted); font-weight: 600; }
.h-folder.add .ic { color: var(--muted); }
.h-folder:hover { border-color: var(--ink); }
[data-drop].over { outline: 2px dashed var(--accent); outline-offset: 4px; background: var(--accent-soft); }
.h-chips { margin-bottom: 18px; }
.h-del { position: absolute; right: 6px; top: 6px; z-index: 2; border: 0; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--glass); color: var(--muted); cursor: pointer; opacity: 0; box-shadow: 0 1px 4px rgba(20, 30, 48, .15); }
.h-tpl:hover .h-del, .h-asset:hover .h-del { opacity: 1; }
.h-del:hover { color: var(--danger); }
.h-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.h-asset { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
.h-asset img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 8px; background: repeating-conic-gradient(var(--hover) 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.h-asset small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-empty { border: 1.5px dashed var(--line); border-radius: 14px; padding: 36px; text-align: center; color: var(--muted); }
.h-panel { border: 1.5px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 16px; max-width: 860px; background: var(--panel); }
.h-panel h3 { font-size: 15px; margin-bottom: 10px; }
.h-panel p { margin: 6px 0; color: var(--ink); line-height: 1.5; }
.h-panel .muted, .h-panel p.muted { color: var(--muted); }
.h-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px 16px; margin-top: 10px; }
.h-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.h-form label.wide { grid-column: 1 / -1; }
.h-form label.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); align-self: end; padding-bottom: 8px; }
.h-form label.chk input { accent-color: var(--accent); width: 16px; height: 16px; }
.h-form input:not([type=checkbox]), .h-form select { padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 14px; color: var(--ink); background: var(--panel); outline: none; }
.h-form input:focus, .h-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.h-form input:disabled { background: var(--field); }
.h-form .inp input { border: 0; padding: 9px 0; box-shadow: none; }
.h-actions { display: flex; gap: 8px; margin-top: 12px; }
.h-path { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.h-path code { flex: 1; background: var(--field); border-radius: 10px; padding: 9px 12px; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-panel .code-row { display: flex; gap: 8px; margin: 12px 0 4px; max-width: 520px; }
.h-panel .code-row input { flex: 1; font: inherit; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 10px; }
.plan.cur { border-color: var(--accent); background: var(--accent-soft); }
.h-menu { position: fixed; z-index: 90; min-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(20, 30, 48, .18); padding: 6px; }
.h-menu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; text-align: left; color: var(--ink); }
.h-menu button:hover { background: var(--accent-soft); }
.h-menu button.chk { color: var(--accent-dark); }
.h-menu button.danger { color: var(--danger); }
.h-menu .h-ma { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; } .h-menu .h-ma:hover { background: var(--accent-soft); }
.h-acct { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font: inherit; color: var(--ink); text-align: left; flex: none; }
.h-acct:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.h-acct span { display: flex; flex-direction: column; line-height: 1.15; } .h-acct b { font-size: 13px; } .h-acct small { font-size: 11px; }
.h-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; color: var(--on-dark); background: linear-gradient(135deg, var(--accent, var(--accent-strong)), var(--lav)); }
/* đổi tên tại chỗ + thanh Hoàn tác (dùng chung) */
.inl-edit { border: 1.5px solid var(--accent, var(--accent-strong)); border-radius: 6px; padding: 1px 6px; background: var(--panel); color: var(--ink); outline: none; box-shadow: 0 0 0 3px var(--accent-soft, rgba(16,185,129,.18)); min-width: 0; max-width: 100%; box-sizing: border-box; }
.undo-bar { position: fixed; left: 50%; bottom: 22px; z-index: 300; transform: translate(-50%, 90px); display: flex; align-items: center; gap: 14px; background: var(--ink); color: var(--on-dark); border-radius: 12px; padding: 10px 10px 10px 16px; font-size: 13.5px; font-weight: 600; box-shadow: 0 16px 40px rgba(20, 30, 48, .3); transition: transform .22s ease; }
.undo-bar.on { transform: translate(-50%, 0); }
.undo-bar button { border: 0; background: rgba(255,255,255,.14); color: var(--accent-line); font: inherit; font-weight: 800; border-radius: 8px; padding: 6px 12px; cursor: pointer; } .undo-bar button:hover { background: rgba(255,255,255,.24); }
.h-menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.h-mlabel { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px 4px; }
.h-web { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 6px 8px 10px; font-size: 12.5px; }
.h-web a { color: var(--muted); text-decoration: none; } .h-web a:hover { color: var(--accent-ink); text-decoration: underline; }

/* ---------- Theme 2026: tiêu đề Editorial + gradient bảng màu ---------- */
.h-body h1 { font-family: var(--font-ui); font-weight: 800; letter-spacing: -.025em; font-size: 38px; line-height: 1.1; }
.logo { background: var(--grad-mint) !important; box-shadow: 0 6px 16px rgba(52, 211, 153, .35) !important; }
.logo svg path { stroke: var(--on-accent); }
::selection { background: var(--accent-2); color: var(--ink); }
:focus-visible { outline: 2px solid var(--lav); outline-offset: 2px; }

/* Hộp chọn font */
.font-field { display: inline-flex; min-width: 0; }
.font-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 150px; max-width: 220px; height: 30px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 9px; background: var(--panel); cursor: pointer; color: var(--ink); font-size: 13.5px; }
.font-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-btn:hover { border-color: var(--accent); }
.font-field.cb .font-btn { height: 26px; min-width: 140px; font-size: 12.5px; border-width: 1px; border-radius: 6px; }
.p-col .font-field, .field .font-field { display: flex; } .p-col .font-btn, .field .font-btn { max-width: none; width: 100%; }
.fp-pop { position: fixed; z-index: 400; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px rgba(20, 30, 48, .22); display: flex; flex-direction: column; overflow: hidden; font: 13px/1.35 var(--font-ui); color: var(--ink); }
.fp-pop.busy { opacity: .6; pointer-events: none; }
.fp-head { display: flex; gap: 6px; padding: 10px 10px 6px; }
.fp-q { flex: 1; min-width: 0; height: 32px; border: 1.5px solid var(--line); border-radius: 9px; padding: 0 10px; font: inherit; }
.fp-q:focus { outline: none; border-color: var(--accent); }
.fp-up { display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-weight: 700; cursor: pointer; white-space: nowrap; font-size: 12.5px; }
.fp-cats { display: flex; gap: 4px; padding: 0 10px 8px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.fp-cats button { flex: none; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; color: var(--muted); }
.fp-cats button.on { background: var(--sel-bg); border-color: var(--accent-line); color: var(--sel-ink); }
.fp-list { flex: 1; overflow-y: auto; padding: 4px; min-height: 120px; }
.fp-item { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; cursor: pointer; outline: none; flex-wrap: wrap; }
.fp-item:hover, .fp-item:focus { background: var(--field); } .fp-item.on { background: var(--accent-soft); }
.fp-name { font-size: 18px; line-height: 1.25; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-item small { width: 100%; order: 3; color: var(--muted); font-size: 11px; }
.fp-tags { display: flex; gap: 4px; }
.fp-tag { font-size: 10.5px; font-weight: 700; color: var(--muted); background: var(--hover); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.fp-tag.mine { background: var(--lav-soft); color: var(--lav-ink); } .fp-tag.warn { background: var(--warn-soft); color: var(--warn-ink); }
.fp-del { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 5px; } .fp-del:hover { color: var(--danger); background: var(--danger-soft); }
.fp-empty { padding: 18px 12px; color: var(--muted); text-align: center; }
.fp-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 7px 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.fp-foot label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.fp-head, .fp-cats, .fp-foot { flex: none; }

/* Bước Dieline: mockup 3D là ô xem trước nhỏ ở góc (không chia đôi màn hình) */
.views.pip { grid-template-columns: 1fr; position: relative; }
.views.pip #view3d { position: absolute; right: 16px; bottom: 16px; width: min(300px, 34%); height: min(250px, 42%); z-index: 6; border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(20, 30, 48, .18); border-radius: 16px; }
.views.pip #view3d > .float { display: none !important; }
.pip-bar { display: none; }
.views.pip .pip-bar { display: flex; align-items: center; gap: 4px; position: absolute; z-index: 4; left: 8px; right: 8px; top: 8px; font-size: 11.5px; color: var(--ink); pointer-events: none; }
.views.pip .pip-bar b { background: var(--glass); padding: 3px 8px; border-radius: 7px; } .pip-bar .sp { flex: 1; }
.views.pip .pip-bar .tb { pointer-events: auto; background: var(--glass); width: 26px; height: 26px; padding: 0; display: grid; place-items: center; border-radius: 7px; }
/* Tab quy trình luôn ở chính giữa thanh trên — không nhảy chỗ khi chuyển Dieline ↔ Design ↔ Mockup */
.topbar #flow { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; }

/* Dieline chỉ sửa khuôn: ẩn bảng chèn / lớp / màu nền của thiết kế (các việc này làm ở Design) */
.layout.die-only { --rw: 0px; --rr: 0px; }
.layout.die-only .side.right, .layout.die-only .rrail, body:has(.layout.die-only) #btnRight { display: none !important; }

/* ---------- Bộ công cụ dựng khuôn: thanh dọc trên khuôn (như Illustrator) ---------- */
.die-tools { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; align-items: flex-start; gap: 8px; pointer-events: none; }
.die-tools > * { pointer-events: auto; }
.dt-col { display: flex; flex-direction: column; gap: 3px; background: var(--glass); padding: 5px; border-radius: 14px; box-shadow: 0 10px 28px rgba(20, 30, 48, .16); border: 1px solid var(--line); }
.dt-col button { width: 38px; height: 38px; border: 0; background: none; border-radius: 9px; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.dt-col button .ic { width: 21px; height: 21px; }
.dt-col button:hover:not(:disabled) { background: var(--hover); }
.dt-col button.on, .dt-col button.primary { background: var(--sel-bg); color: var(--sel-ink); }
.dt-col button:disabled { color: var(--muted-2); cursor: default; }
.dt-col #dtDel:not(:disabled) { color: var(--danger); }
.dt-col hr { border: 0; border-top: 1px solid var(--line); margin: 3px 4px; }
.dt-fly { display: flex; flex-direction: column; gap: 6px; }
.dt-opts { background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 5px; box-shadow: 0 10px 28px rgba(20, 30, 48, .14); }
.dt-icons { display: grid; grid-template-columns: repeat(4, 40px); gap: 3px; }
#lockLib.dt-icons { grid-template-columns: repeat(4, 46px); }
.dt-icons button { height: 38px; border: 1.5px solid transparent; background: var(--field); border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--ink); padding: 0; }
.dt-icons button:hover { border-color: var(--line); background: var(--panel); }
.dt-icons button.on { border-color: var(--accent); background: var(--accent-soft); }
.dt-icons svg { max-width: 100%; height: auto; }
.crow.removed { opacity: .75; } .crow.removed .nm { text-decoration: line-through; }

/* Biến thể & chia sẻ */
.variant-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.variant-bar .sp { flex: 1; }
.variant-bar .vshare { display: inline-flex; align-items: center; gap: 6px; }
.vmenu { display: flex !important; flex-direction: column; min-width: 300px; padding: 6px; }
.vmenu button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.vmenu button b { display: flex; align-items: center; gap: 8px; } .vmenu button small { color: var(--muted); font-weight: 400; padding-left: 24px; }
.vsize { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .vsize .field { display: flex; flex-direction: column; gap: 4px; }
.vsize input { padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 9px; font: inherit; }
.vsize-act { margin-top: 14px; display: flex; justify-content: flex-end; }
.share-box { min-width: min(560px, 86vw); display: flex; flex-direction: column; gap: 12px; }
.share-prog { padding: 14px; background: var(--field); border-radius: 10px; }
.share-ok { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--accent-soft); border-radius: 12px; }
.share-ok .code-row { display: flex; gap: 6px; } .share-ok input { flex: 1; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 9px; font: inherit; }
.share-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.share-row .sr-h { display: flex; gap: 10px; align-items: center; } .share-row .sr-h a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-row small { color: var(--muted); } .sr-votes { margin: 4px 0 0; padding-left: 18px; font-size: 13px; } .link.danger { color: var(--danger); }
.sr-cmts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; font-size: 13px; } .sr-cg ul { margin: 2px 0 0; padding-left: 18px; } .sr-cg i { color: var(--accent-ink); font-style: normal; font-weight: 700; }
.crow.removed .link { display: inline-flex !important; margin-left: auto; color: var(--accent-ink); font-weight: 700; }
.sr-lock { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 6px; cursor: pointer; } .sr-lock input { accent-color: var(--accent-dark); }

/* ---------- Màu theo phân loại (Mint = thiết kế · Lavender = khuôn / mẫu hộp · Coral = moodboard / ảnh · Midnight = chung) ---------- */
:root { --c-design: #047857; --c-design-bg: #e7faf2; --c-die: #2f63c7; --c-die-bg: #edf3ff; --c-mood: #e0565e; --c-mood-bg: #fff1ef; --c-img: #c2610f; --c-img-bg: #fff4e6; --c-fav: #d99a00; --c-fav-bg: #fff8db; --c-acct: #7c4dcc; --c-acct-bg: #f3edff; }
.h-nav button svg.ic { width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--hover); color: var(--ink-2); flex: none; transition: transform .15s; }
.h-nav button:hover svg.ic { transform: scale(1.08); }
.h-nav [data-page="home"] svg.ic { background: var(--grad-night); color: var(--on-dark); }
.h-nav [data-page="files"] svg.ic { background: var(--c-design-bg); color: var(--c-design); }
.h-nav [data-page="fav"] svg.ic { background: var(--c-fav-bg); color: var(--c-fav); }
.h-nav [data-page="templates"] svg.ic, .h-nav [data-page="imports"] svg.ic { background: var(--c-die-bg); color: var(--c-die); }
.h-nav [data-page="assets"] svg.ic { background: var(--c-img-bg); color: var(--c-img); }
.h-nav [data-page="account"] svg.ic { background: var(--c-acct-bg); color: var(--c-acct); }
/* thẻ tệp: chữ loại tệp + dải màu trên ảnh theo loại */
.h-card[data-pid] > small:not(.muted) { color: var(--c-design); font-weight: 600; }
.h-card[data-mood] > b::before, .h-card[data-pid] > b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: var(--accent); }
.h-card[data-mood] > b::before { background: var(--coral); }
.h-card[data-mood] .h-thumb { box-shadow: inset 0 3px 0 var(--coral); }
.h-card[data-pid] .h-thumb { box-shadow: inset 0 3px 0 var(--accent); }
.h-card[data-pid] .h-thumb.dl { box-shadow: inset 0 3px 0 var(--lav); }
.h-card[data-pid]:has(.h-thumb.dl) > b::before { background: var(--lav); }
.h-card[data-pid]:has(.h-thumb.dl) > small { color: var(--c-die); }
.h-ftype [data-ftype="design"] svg.ic { color: var(--c-design); } .h-ftype [data-ftype="mood"] svg.ic { color: var(--c-mood); } .h-ftype [data-ftype="dieline"] svg.ic { color: var(--c-die); }
.h-ftype .chip.on[data-ftype="design"] { background: var(--c-design-bg); color: var(--c-design); border-color: var(--accent); }
.h-ftype .chip.on[data-ftype="mood"] { background: var(--c-mood-bg); color: var(--c-mood); border-color: var(--coral); }
.h-ftype .chip.on[data-ftype="dieline"] { background: var(--c-die-bg); color: var(--c-die); border-color: var(--lav); }

.imp-chk { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.35; margin: 6px 0; cursor: pointer; } .imp-chk input { margin-top: 2px; accent-color: var(--accent-dark); }
.imp-mode { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.imp-mode .imp-chk { border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 0; } .imp-mode .imp-chk:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.imp-mode span { display: flex; flex-direction: column; gap: 2px; } .imp-mode small { color: var(--muted); font-size: 11.5px; }
.imp-chk input { width: auto !important; flex: none; }
.imp-assets .imp-groups, .imp-assets #impStats, .imp-assets #impW, .imp-assets #impOrient { opacity: .45; pointer-events: none; }

/* Bảng Mẫu hộp: lọc theo kiểu cấu trúc / mockup sản phẩm */
.tpl-model { width: 100%; margin: 2px 0 10px; }

/* Cảnh mockup 3D */
.scene-pop { position: absolute; top: 56px; right: 14px; z-index: 6; width: 300px; background: var(--panel, #fff); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 18px 40px rgba(20, 30, 48, .16); padding: 12px; }
.scene-pop .sp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.sp-grid button { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; padding: 0; cursor: pointer; font-size: 11px; color: var(--ink); }
.sp-grid button i { width: 56px; height: 44px; border-radius: 10px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(20, 30, 48, .12); background-size: cover; }
.sp-grid button.on i { border-color: var(--accent, var(--accent)); }
.sp-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; }
.sp-row select { flex: 0 0 150px; }

/* Báo phiên bản mới */
.upd-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 9999; display: flex; gap: 10px; align-items: center; background: var(--ink, var(--ink)); color: var(--on-dark); padding: 10px 14px; border-radius: 14px; box-shadow: 0 14px 34px rgba(0, 0, 0, .25); font-size: 14px; }
.upd-bar.upd-news { left: 18px; transform: none; align-items: flex-end; max-width: min(460px, calc(100vw - 36px)); line-height: 1.5; }
.upd-bar b#updN { font-variant-numeric: tabular-nums; }
/* ---------- Trang chủ app: hành trình người mới (checklist, còn x/3 miễn phí, NPS, Góp ý) — giao-dien.md ---------- */
.h-journey { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin: 0 0 22px; }
.h-jcard, .h-quota, .h-nps { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.h-jcard { border-color: var(--accent-line); background: linear-gradient(160deg, var(--accent-soft), var(--panel) 60%); }
.h-jhead { display: flex; align-items: center; gap: 10px; width: 100%; } .h-jhead b { font-size: 15px; } .h-jhead small { color: var(--accent-ink); font-weight: 700; } .h-jhead .icon-btn { margin-left: auto; width: 28px; height: 28px; border: 0; background: transparent; }
.h-jbar { width: 100%; height: 6px; border-radius: var(--r-pill); background: var(--hover); overflow: hidden; } .h-jbar i { display: block; height: 100%; border-radius: inherit; background: var(--grad-mint); transition: width .4s; }
.h-jcard ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: 100%; }
.h-jcard li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.h-jcard li i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--hover); font-size: 11px; font-weight: 800; flex: none; }
.h-jcard li .ic { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--accent); color: var(--on-accent); flex: none; }
.h-jcard li.ok span { text-decoration: line-through; text-decoration-color: var(--muted-2); } .h-jcard li.now { color: var(--ink); font-weight: 700; } .h-jcard li.now i { background: var(--ink); color: var(--on-dark); }
.h-jtip { color: var(--muted); }
.h-quota b { font-size: 15px; } .h-quota small { color: var(--muted); line-height: 1.45; }
.h-quota.out { border-color: var(--warn); background: linear-gradient(160deg, var(--warn-soft), var(--panel) 60%); } .h-quota.out .h-jbar i { background: var(--warn); }
.h-nps b { font-size: 14px; } .h-nps small { display: flex; justify-content: space-between; width: 100%; color: var(--muted); font-size: 11px; }
.h-nps-row { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; width: 100%; }
.h-nps-row button { border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-sm); padding: 6px 0; font-weight: 700; cursor: pointer; } .h-nps-row button:hover { background: var(--sel-bg); color: var(--sel-ink); border-color: var(--accent-line); }
.h-fbbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-ink); font-weight: 700; cursor: pointer; } .h-fbbtn:hover { text-decoration: underline; }
.h-fb textarea { width: 100%; box-sizing: border-box; font: inherit; border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; resize: vertical; margin-bottom: 12px; } .h-fb textarea:focus { outline: none; border-color: var(--accent); }
.h-tthumb img { object-fit: contain; }
/* ---------- Giao diện tối cho vùng làm việc (Dieline, Design, Photo Editor, 3D) — View › Giao diện tối (js/theme.js) ----------
   Chỉ đổi token; Trang chủ app, trang công khai, canvas / artboard / màu tác phẩm giữ nguyên (giao-dien.md) */
:root[data-theme="dark"] .topbar, :root[data-theme="dark"] .layout, :root[data-theme="dark"] .aiw,
:root[data-theme="dark"] .modal-card, :root[data-theme="dark"] .ai-dlg, :root[data-theme="dark"] .nd, :root[data-theme="dark"] .xa {
  --bg: #1d2027; --panel: #282c34; --panel-2: #23272e; --field: #1e2228; --hover: #343943; --linen: #2e333c;
  --line: #3a404a; --line-strong: #4b5260; --ink: #e9ecf1; --ink-2: #d2d8e1; --ink-3: #bcc3ce; --muted: #9ca5b3; --muted-2: #7c8594;
  --canvas-bg: #17191e; --glass: rgba(40, 44, 52, .94);
  --accent-ink: #6ee7b7; --accent-dark: #34d399; --accent-soft: rgba(52, 211, 153, .16); --accent-line: rgba(52, 211, 153, .45);
  --sel-bg: rgba(52, 211, 153, .18); --sel-ink: #6ee7b7;
  --lav-soft: rgba(106, 164, 255, .16); --lav-ink: #9cc2ff; --coral-soft: rgba(255, 154, 158, .16);
  --danger: #ff6b72; --danger-soft: rgba(255, 107, 114, .16); --warn: #f59e4b; --warn-soft: rgba(245, 158, 75, .16); --warn-ink: #f6c27a; --ok: #6ee7b7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .35); --shadow-1: var(--shadow); --shadow-2: 0 12px 40px rgba(0, 0, 0, .5);
  color: var(--ink); color-scheme: dark;
}
:root[data-theme="dark"] .layout { background: var(--bg); }
.h-persona { background: var(--panel); border: 1px solid var(--accent-line); border-radius: var(--r-lg); padding: 18px 20px; margin: 0 0 14px; box-shadow: var(--shadow-1); display: grid; gap: 6px; justify-items: start; }
.h-persona > b { font-size: 17px; } .h-persona > small { color: var(--muted); }
.h-persona-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin: 8px 0 4px; }
.h-persona-row button { display: flex; align-items: center; gap: 12px; text-align: left; border: 1.5px solid var(--line); background: var(--panel); border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; color: var(--ink); }
.h-persona-row button:hover { border-color: var(--accent); background: var(--sel-bg); } .h-persona-row button .ic { color: var(--accent-ink); flex: none; }
.h-persona-row span { display: grid; } .h-persona-row small { color: var(--muted); font-size: 12px; }
@media (max-width: 900px) { .h-persona-row { grid-template-columns: 1fr; } }
