/* On Studio — bộ giao diện Vercel bản Opus (#023756) áp vào app — #031736 nhóm A (PHẦN DÙNG CHUNG).
   Nguồn: phong-ban/thiet-ke/nhan-su/023756-bo-giao-dien-studio-vercel-opus/mockup/osv.css — giữ NGUYÊN tên biến/lớp
   để các màn B/C/D dùng lại; chỉ đổi: phông Geist tự host (/vendor/fonts/geist) thay Google Fonts, bỏ cờ "bản mẫu",
   thêm phần khung app ở cuối tệp (mục 6). CSS riêng của từng màn đặt ở tệp riêng của màn, KHÔNG sửa tệp này. */
@import url('/vendor/fonts/geist/geist.css');


/* ============ 1) TOKEN NỀN — theme Sáng (mặc định) ============ */
:root, [data-theme="sang"] {
  --g100: #f2f2f2; --g200: #ebebeb; --g300: #e6e6e6; --g400: #eaeaea; --g500: #c9c9c9;
  --g600: #a8a8a8; --g700: #8f8f8f; --g800: #7d7d7d; --g900: #666666; --g1000: #171717;
  --bg100: #ffffff; --bg200: #fafafa;
  --blue: #0070f3;  --blue-bg: #ebf5ff;  --blue-fg: #0060d1;
  --green: #28a948; --green-bg: #ecfdf0; --green-fg: #1a7f37;
  --amber: #f5a623; --amber-bg: #fff6e0; --amber-fg: #a35200;
  --red: #e5484d;   --red-bg: #fff0f0;   --red-fg: #cb2a2f;
  --purple: #8e4ec6;--purple-bg: #f7f0fe;--purple-fg: #7d3bb5;
  --accent: #171717; --accent-fg: #ffffff; --ring: rgba(0,112,243,.35);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px -2px rgba(0,0,0,.06);
  --shadow-lg: 0 1px 1px rgba(0,0,0,.02), 0 8px 16px -4px rgba(0,0,0,.08), 0 24px 32px -8px rgba(0,0,0,.08);
  --overlay: rgba(0,0,0,.35);
  --thumb-a: #e9e4ff; --thumb-b: #ffe7d6; --thumb-c: #d9f2ff;
  color-scheme: light;
}
[data-theme="toi"] {
  --g100: #1a1a1a; --g200: #1f1f1f; --g300: #292929; --g400: #2e2e2e; --g500: #454545;
  --g600: #5e5e5e; --g700: #8f8f8f; --g800: #7c7c7c; --g900: #a1a1a1; --g1000: #ededed;
  --bg100: #0a0a0a; --bg200: #000000;
  --blue: #3291ff;  --blue-bg: #0a1a33;  --blue-fg: #52a8ff;
  --green: #3ecf6e; --green-bg: #0b2414; --green-fg: #5fd88a;
  --amber: #ffb224; --amber-bg: #2a1c05; --amber-fg: #ffc453;
  --red: #ff6166;   --red-bg: #2e0e10;   --red-fg: #ff7a7e;
  --purple: #bf7af0;--purple-bg: #221331;--purple-fg: #cf97f5;
  --accent: #ededed; --accent-fg: #0a0a0a; --ring: rgba(82,168,255,.45);
  --shadow-sm: 0 0 0 1px rgba(255,255,255,.04);
  --shadow-md: 0 0 0 1px rgba(255,255,255,.06), 0 4px 12px rgba(0,0,0,.5);
  --shadow-lg: 0 0 0 1px rgba(255,255,255,.08), 0 16px 40px rgba(0,0,0,.7);
  --overlay: rgba(0,0,0,.6);
  --thumb-a: #2a2145; --thumb-b: #3a2616; --thumb-c: #12303f;
  color-scheme: dark;
}
/* Đêm xanh: nền xanh than, nhấn xanh On Studio — hợp phòng dựng phim ban đêm */
[data-theme="dem-xanh"] {
  --g100: #131a26; --g200: #172030; --g300: #1d2839; --g400: #223047; --g500: #33445f;
  --g600: #4b5f7f; --g700: #7488a8; --g800: #6f82a0; --g900: #9fb0c9; --g1000: #e8eef8;
  --bg100: #0c111b; --bg200: #080c14;
  --blue: #4c9dff;  --blue-bg: #0e2240;  --blue-fg: #7ab6ff;
  --green: #3fd08a; --green-bg: #0c2a20; --green-fg: #6ee0a8;
  --amber: #ffbe3d; --amber-bg: #2c2210; --amber-fg: #ffd177;
  --red: #ff6b7a;   --red-bg: #33121a;   --red-fg: #ff8d99;
  --purple: #a78bfa;--purple-bg: #1f1a3d;--purple-fg: #c4b1ff;
  --accent: #4c9dff; --accent-fg: #06101f; --ring: rgba(76,157,255,.5);
  --shadow-sm: 0 0 0 1px rgba(122,182,255,.06);
  --shadow-md: 0 0 0 1px rgba(122,182,255,.08), 0 4px 14px rgba(0,0,0,.5);
  --shadow-lg: 0 0 0 1px rgba(122,182,255,.1), 0 18px 44px rgba(0,0,0,.65);
  --overlay: rgba(3,6,12,.65);
  --thumb-a: #1c2a4a; --thumb-b: #2c2440; --thumb-c: #0f3340;
  color-scheme: dark;
}
/* Giấy: sáng ấm, nhấn cam đất — dịu mắt cho khâu viết kịch bản/biên tập dài */
[data-theme="giay"] {
  --g100: #f3efe7; --g200: #ede8de; --g300: #e5dfd3; --g400: #e3dccf; --g500: #cfc6b5;
  --g600: #ada392; --g700: #8f8676; --g800: #7d7466; --g900: #62594c; --g1000: #231d15;
  --bg100: #fffdf8; --bg200: #f9f6ef;
  --blue: #2f6fd6;  --blue-bg: #eef3fc;  --blue-fg: #2458ad;
  --green: #3c8c4f; --green-bg: #edf6ee; --green-fg: #2d6b3c;
  --amber: #d08a1c; --amber-bg: #fcf1dc; --amber-fg: #8f5a0b;
  --red: #c9483c;   --red-bg: #fcece9;   --red-fg: #a3372d;
  --purple: #8a5bb8;--purple-bg: #f5eefb;--purple-fg: #6f449a;
  --accent: #c2571a; --accent-fg: #fffdf8; --ring: rgba(194,87,26,.35);
  --shadow-sm: 0 1px 2px rgba(60,40,10,.05);
  --shadow-md: 0 1px 2px rgba(60,40,10,.05), 0 4px 12px -2px rgba(60,40,10,.08);
  --shadow-lg: 0 1px 1px rgba(60,40,10,.03), 0 10px 20px -4px rgba(60,40,10,.1), 0 24px 36px -10px rgba(60,40,10,.1);
  --overlay: rgba(35,29,21,.35);
  --thumb-a: #f1e3cf; --thumb-b: #f6d8c4; --thumb-c: #dbe8dc;
  color-scheme: light;
}
/* Tương phản cao: đạt WCAG AAA cho chữ thân, viền đậm — cho màn ngoài trời/máy chiếu */
[data-theme="tuong-phan"] {
  --g100: #ffffff; --g200: #f4f4f4; --g300: #000000; --g400: #000000; --g500: #000000;
  --g600: #3d3d3d; --g700: #333333; --g800: #262626; --g900: #1a1a1a; --g1000: #000000;
  --bg100: #ffffff; --bg200: #ffffff;
  --blue: #0047b3;  --blue-bg: #e1ecff;  --blue-fg: #00307a;
  --green: #0a6b2a; --green-bg: #dcf5e3; --green-fg: #04471b;
  --amber: #8a4b00; --amber-bg: #ffeccc; --amber-fg: #5c3200;
  --red: #b3000c;   --red-bg: #ffe0e2;   --red-fg: #7a0008;
  --purple: #5b1a99;--purple-bg: #efe2fc;--purple-fg: #3f0f6e;
  --accent: #000000; --accent-fg: #ffffff; --ring: rgba(0,71,179,.6);
  --shadow-sm: none; --shadow-md: 0 0 0 1px #000; --shadow-lg: 0 0 0 2px #000;
  --overlay: rgba(0,0,0,.55);
  --thumb-a: #e6e6e6; --thumb-b: #d4d4d4; --thumb-c: #c2c2c2;
  color-scheme: light;
}

/* ---- 4 theme của BỘ TRƯỚC (#225952: Sáng, Tối, Xanh, Tím) — lệnh sếp 731601090 "gom lại làm cả 2 để chọn bất kỳ".
   Giá trị lấy NGUYÊN bảng quy đổi của Phân tích #030613 (mockup the-bo-truoc.css): chỉ đặt lại biến màu/bóng theo đúng
   tên biến bộ Opus; mã "truoc-" để không trùng "sang"/"toi" của bộ Opus. */
[data-theme="truoc-sang"], [data-theme="truoc-xanh"] {
  --g100: #f5f5f5; --g200: #ebebeb; --g300: #e0e0e0; --g400: #eaeaea; --g500: #d4d4d4;
  --g600: #a8a8a8; --g700: #8f8f8f; --g800: #6f6f6f; --g900: #4d4d4d; --g1000: #0a0a0a;
  --bg100: #ffffff; --bg200: #fafafa;
  --blue: #0070f3;  --blue-bg: #ebf5ff;  --blue-fg: #0070f3;
  --green: #0cce6b; --green-bg: #e9f8ee; --green-fg: #0c8a3e;
  --amber: #f5a623; --amber-bg: #fff4e0; --amber-fg: #a35200;
  --red: #ee0000;   --red-bg: #ffeef0;   --red-fg: #d8102c;
  --purple: #7d27d8;--purple-bg: #f5ecff;--purple-fg: #7d27d8;
  --accent: #0a0a0a; --accent-fg: #ffffff; --ring: rgba(0,0,0,.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.02);
  --shadow-md: 0 1px 2px rgba(0,0,0,.04), 0 1px 1px rgba(0,0,0,.02);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
  --overlay: rgba(0,0,0,.35);
  --thumb-a: #e9e4ff; --thumb-b: #ffe7d6; --thumb-c: #d9f2ff;
  color-scheme: light;
}
/* Xanh = Sáng của bộ trước, nút chính nhấn xanh dương */
[data-theme="truoc-xanh"] {
  --blue-bg: #eaf4ff; --accent: #0070f3; --accent-fg: #ffffff; --ring: rgba(0,112,243,.3);
}
[data-theme="truoc-toi"] {
  --g100: #141414; --g200: #1f1f1f; --g300: #292929; --g400: #1f1f1f; --g500: #333333;
  --g600: #4d4d4d; --g700: #6f6f6f; --g800: #8a8a8a; --g900: #a1a1a1; --g1000: #ededed;
  --bg100: #0a0a0a; --bg200: #000000;
  --blue: #3291ff;  --blue-bg: #0b2540;  --blue-fg: #3291ff;
  --green: #0cce6b; --green-bg: #0d2118; --green-fg: #4ad18b;
  --amber: #f5a623; --amber-bg: #241a08; --amber-fg: #f5a623;
  --red: #ee0000;   --red-bg: #2a0d12;   --red-fg: #ff6b6b;
  --purple: #b78cff;--purple-bg: #1e1330;--purple-fg: #b78cff;
  --accent: #ffffff; --accent-fg: #0a0a0a; --ring: rgba(255,255,255,.14);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.6); --shadow-md: 0 1px 2px rgba(0,0,0,.6);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.7);
  --overlay: rgba(0,0,0,.6);
  --thumb-a: #2a2145; --thumb-b: #3a2616; --thumb-c: #12303f;
  color-scheme: dark;
}
[data-theme="truoc-tim"] {
  --g100: #171125; --g200: #221a35; --g300: #2c2244; --g400: #221a35; --g500: #3a2d57;
  --g600: #574a75; --g700: #786d94; --g800: #948aae; --g900: #b0a6c9; --g1000: #f0ecfa;
  --bg100: #0f0b1a; --bg200: #08060f;
  --blue: #60a5fa;  --blue-bg: #0b1f3a;  --blue-fg: #60a5fa;
  --green: #4ad18b; --green-bg: #0d2118; --green-fg: #4ad18b;
  --amber: #f5a623; --amber-bg: #241a08; --amber-fg: #f5a623;
  --red: #ff6b6b;   --red-bg: #2a0d12;   --red-fg: #ff6b6b;
  --purple: #a78bfa;--purple-bg: #1e1636;--purple-fg: #a78bfa;
  --accent: #a78bfa; --accent-fg: #120c22; --ring: rgba(167,139,250,.25);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.5); --shadow-md: 0 1px 2px rgba(0,0,0,.5);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.6);
  --overlay: rgba(8,6,15,.65);
  --thumb-a: #2a2145; --thumb-b: #3a2616; --thumb-c: #1e1636;
  color-scheme: dark;
}

/* ============ 2) TOKEN NGỮ NGHĨA + THANG ĐO ============ */
:root, [data-theme] {
  --bg: var(--bg200); --surface: var(--bg100); --surface-2: var(--g100);
  --hover: var(--g200); --active: var(--g300);
  --border: var(--g400); --border-strong: var(--g500);
  --text: var(--g1000); --text-2: var(--g900); --text-3: var(--g700);
  /* Khoảng cách: bước 4px */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;
  /* Bo góc */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px; --r-full: 999px;
  /* Chữ */
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --t-12: 12px/16px; --t-13: 13px/20px; --t-14: 14px/20px; --t-16: 16px/24px;
  --h-20: 600 20px/28px var(--font); --h-24: 600 24px/32px var(--font);
  --h-32: 600 32px/40px var(--font); --h-48: 600 40px/48px var(--font);
  --ease: cubic-bezier(.2,.8,.2,1); --dur: 160ms;
  --header-h: 56px; --tabs-h: 46px; --bnav-h: 64px;
}
[data-theme="tuong-phan"] { --text-2: #1a1a1a; --text-3: #333; --border: #000; --border-strong: #000; }

/* ============ 3) NỀN TRANG ============ */
/* Biểu tượng nội dòng: cỡ mặc định 16px (thành phần nào cần khác thì tự đè phía dưới) */
svg[aria-hidden="true"] { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--t-14) var(--font); letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased; transition: background var(--dur), color var(--dur);
  padding-bottom: calc(var(--bnav-h) + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { body { padding-bottom: 0; } }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid transparent; box-shadow: 0 0 0 2px var(--bg100), 0 0 0 4px var(--ring); border-radius: var(--r-md); }

/* ============ 4) KHUNG: header + tab kiểu Vercel ============ */
.hdr { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--border); }
.hdr-top { height: var(--header-h); display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s4); }
.logo { width: 24px; height: 24px; flex: none; display: grid; place-items: center; }
.logo svg { width: 22px; height: 22px; fill: var(--text); }
.slash { color: var(--g500); font-size: 22px; font-weight: 300; flex: none; }
.crumb { display: flex; align-items: center; gap: var(--s2); min-width: 0; padding: 4px 6px; border-radius: var(--r-md); font-weight: 500; }
.crumb:hover { background: var(--hover); }
.crumb { white-space: nowrap; }
.crumb > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb > .av, .crumb > .badge, .crumb > .chev { flex: none; overflow: visible; }
.crumb .chev { flex: none; color: var(--text-3); }
.hdr-sp { flex: 1; }
.hdr-actions { display: flex; align-items: center; gap: var(--s2); flex: none; }
@media (max-width: 899.98px) { .hide-sm { display: none !important; } }
@media (min-width: 900px) { .hide-lg { display: none !important; } }

.tabs { display: flex; gap: 2px; padding: 0 var(--s2); height: var(--tabs-h); align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: flex; align-items: center; padding: 0 10px; color: var(--text-2); white-space: nowrap; font-size: 14px; }
.tab::before { content: ""; position: absolute; inset: 7px 0; border-radius: var(--r-sm); z-index: -1; transition: background var(--dur); }
.tab:hover { color: var(--text); } .tab:hover::before { background: var(--hover); }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; background: var(--text); border-radius: 2px; }
.tab { isolation: isolate; }

.page { max-width: 1200px; margin: 0 auto; padding: var(--s6) var(--s4) var(--s12); }
@media (min-width: 900px) { .page { padding: var(--s10) var(--s6) var(--s16); } }
.page-head { display: flex; flex-direction: column; gap: var(--s4); margin-bottom: var(--s6); }
@media (min-width: 900px) { .page-head { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.h1 { font: var(--h-24); letter-spacing: -0.03em; margin: 0; }
@media (min-width: 900px) { .h1 { font: var(--h-32); letter-spacing: -0.04em; } }
.h2 { font: var(--h-20); letter-spacing: -0.02em; margin: 0; }
.h3 { font-weight: 600; font-size: 16px; line-height: 24px; margin: 0; letter-spacing: -0.01em; }
.eyebrow { font: 500 12px/16px var(--mono); color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }

/* Thanh điều hướng dưới — chỉ điện thoại */
.bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px); border-top: 1px solid var(--border); }
.bnav a, .bnav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 0; background: none; color: var(--text-3); font-size: 11px; font-weight: 500; cursor: pointer; min-width: 0; }
.bnav svg { width: 22px; height: 22px; }
.bnav [aria-current="page"] { color: var(--text); }
.bnav .fab { width: 44px; height: 44px; border-radius: var(--r-full); background: var(--accent); color: var(--accent-fg);
  display: grid; place-items: center; margin: 0 auto; box-shadow: var(--shadow-md); }
.bnav .fab svg { width: 20px; height: 20px; }
@media (min-width: 900px) { .bnav { display: none; } }

/* ============ 5) THÀNH PHẦN ============ */
/* Nút */
.btn { --h: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--h); padding: 0 14px;
  border-radius: var(--r-md); border: 1px solid transparent; font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur), color var(--dur), transform 80ms; user-select: none; }
.btn:active { transform: scale(.98); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-sm { --h: 32px; padding: 0 10px; font-size: 13px; }
.btn-lg { --h: 48px; padding: 0 20px; font-size: 16px; border-radius: var(--r-lg); }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--bg100)); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { background: var(--hover); }
.btn-tertiary { background: transparent; color: var(--text); }
.btn-tertiary:hover { background: var(--hover); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 85%, #000); }
.btn[disabled], .btn.is-disabled { background: var(--g100); color: var(--g600); border-color: var(--border); cursor: not-allowed; box-shadow: none; }
.btn.is-loading { pointer-events: none; color: transparent !important; position: relative; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-fg);
  border-right-color: transparent; animation: spin .7s linear infinite; }
.btn-secondary.is-loading::after { border-color: var(--text); border-right-color: transparent; }
.btn-icon { width: var(--h); padding: 0; }
.btn-pill { border-radius: var(--r-full); }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-group { display: inline-flex; }
.btn-group .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-group .btn + .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; padding: 0 10px; border-left: 1px solid color-mix(in srgb, var(--accent-fg) 25%, transparent); }

/* Phím tắt */
.kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 4px; font: 500 12px/1 var(--mono);
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border); box-shadow: inset 0 -1px 0 var(--border); }

/* Ô nhập — cỡ chữ 16px chống iPhone tự phóng to */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.help { font-size: 13px; color: var(--text-3); }
.help.err { color: var(--red-fg); }
.input { display: flex; align-items: center; gap: var(--s2); height: 40px; padding: 0 12px; border-radius: var(--r-md); min-width: 0;
  background: var(--surface); border: 1px solid var(--border); transition: border-color var(--dur), box-shadow var(--dur); }
.input:hover { border-color: var(--border-strong); }
.input:focus-within { border-color: var(--g700); box-shadow: 0 0 0 3px var(--ring); }
.input.is-error { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 20%, transparent); }
.input input, .input select, textarea.input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; padding: 0; }
.input svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
textarea.input { display: block; height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 24px; width: 100%; }
textarea.input:focus { border-color: var(--g700); box-shadow: 0 0 0 3px var(--ring); outline: 0; }
select.input { appearance: none; font-size: 16px; padding-right: 32px; width: 100%;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238f8f8f' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center; }

/* Công tắc + ô chọn */
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--g500); transition: background var(--dur); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--dur) var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); background: var(--accent-fg); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 32px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

/* Điều khiển phân đoạn */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--g100); border: 1px solid var(--border); border-radius: var(--r-md); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); }

/* Nhãn, chấm trạng thái */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-full); font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--g100); color: var(--text-2); border: 1px solid transparent; }
.badge.blue { background: var(--blue-bg); color: var(--blue-fg); }
.badge.green { background: var(--green-bg); color: var(--green-fg); }
.badge.amber { background: var(--amber-bg); color: var(--amber-fg); }
.badge.red { background: var(--red-bg); color: var(--red-fg); }
.badge.purple { background: var(--purple-bg); color: var(--purple-fg); }
.badge.outline { background: transparent; border-color: var(--border); }
[data-theme="tuong-phan"] .badge { border-color: currentColor; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--g600); display: inline-block; }
.dot.ready { background: var(--green); } .dot.building { background: var(--amber); } .dot.error { background: var(--red); }
.dot.queued { background: var(--g600); } .dot.review { background: var(--purple); } .dot.info { background: var(--blue); }
.dot.building { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 25%, transparent); } }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }

/* Thẻ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-pad { padding: var(--s4); }
@media (min-width: 900px) { .card-pad { padding: var(--s6); } }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); min-height: 52px; }
.card-ft { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--border); background: var(--bg200); border-radius: 0 0 var(--r-lg) var(--r-lg); font-size: 13px; color: var(--text-2); }
a.card, .card.is-link { transition: border-color var(--dur), box-shadow var(--dur); }
a.card:hover, .card.is-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

/* Danh sách dạng hàng (kiểu Deployments) */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--border); align-items: center; }
.rows > .row:first-child { border-top: 0; }
.row:hover { background: var(--bg200); }
.row-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.row-end { display: flex; align-items: center; gap: var(--s3); color: var(--text-2); font-size: 13px; }

/* Bảng — trên điện thoại cuộn ngang trong khung, không làm tràn trang */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; font-size: 14px; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-2); background: var(--bg200); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--bg200); }

/* Ảnh đại diện */
.av { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff; flex: none;
  background: linear-gradient(135deg, #7928ca, #ff0080); }
.av.b { background: linear-gradient(135deg, #0070f3, #50e3c2); } .av.c { background: linear-gradient(135deg, #f5a623, #e5484d); }
.av-lg { width: 32px; height: 32px; font-size: 13px; }
.av-stack { display: inline-flex; } .av-stack .av { box-shadow: 0 0 0 2px var(--surface); } .av-stack .av + .av { margin-left: -6px; }

/* Thanh tiến độ */
.bar { height: 6px; border-radius: 99px; background: var(--g200); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--text); }
.bar.blue > i { background: var(--blue); } .bar.green > i { background: var(--green); } .bar.amber > i { background: var(--amber); }

/* Khung ảnh/ khung hình phim (giả lập bằng gradient, không cần ảnh thật) */
.frame { position: relative; aspect-ratio: 16/9; border-radius: var(--r-md); overflow: hidden; background:
  radial-gradient(120% 90% at 20% 110%, var(--thumb-b), transparent 60%),
  radial-gradient(90% 80% at 90% 0%, var(--thumb-c), transparent 60%), var(--thumb-a); border: 1px solid var(--border); }
.frame::after { content: ""; position: absolute; inset: auto 12% 18% auto; width: 22%; aspect-ratio: 1; border-radius: 50%;
  background: color-mix(in srgb, var(--text) 10%, transparent); }
.frame.v2 { background: radial-gradient(100% 90% at 80% 100%, var(--thumb-a), transparent 60%), linear-gradient(160deg, var(--thumb-c), var(--thumb-b)); }
.frame.v3 { background: linear-gradient(180deg, var(--thumb-c) 0 55%, var(--thumb-b) 55%); }
.frame.v3::after { inset: 30% auto auto 18%; width: 14%; }
.frame.blank { background: repeating-linear-gradient(45deg, var(--g100) 0 8px, var(--bg100) 8px 16px); }
.frame.blank::after { display: none; }
.frame .fr-tag { position: absolute; left: 8px; top: 8px; z-index: 1; font: 500 11px/1 var(--mono); padding: 4px 6px; border-radius: 4px;
  background: rgba(0,0,0,.6); color: #fff; }
.frame .fr-dur { position: absolute; right: 8px; bottom: 8px; z-index: 1; font: 500 11px/1 var(--mono); padding: 4px 6px; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; }

/* Ghi chú, thông báo trong trang */
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); font-size: 14px; }
.note svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.note.blue { background: var(--blue-bg); border-color: color-mix(in srgb, var(--blue) 30%, transparent); color: var(--blue-fg); }
.note.amber { background: var(--amber-bg); border-color: color-mix(in srgb, var(--amber) 35%, transparent); color: var(--amber-fg); }
.note.red { background: var(--red-bg); border-color: color-mix(in srgb, var(--red) 30%, transparent); color: var(--red-fg); }
.note.green { background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 30%, transparent); color: var(--green-fg); }

/* Khung xương khi tải */
.sk { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--g100), var(--g200), var(--g100)); background-size: 200% 100%; animation: sk 1.4s linear infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* Trạng thái trống */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s3); padding: var(--s10) var(--s4);
  border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface); }
.empty .ico { width: 40px; height: 40px; border-radius: var(--r-md); display: grid; place-items: center; border: 1px solid var(--border); background: var(--bg200); }
.empty .ico svg { width: 20px; height: 20px; }

/* Chú thích nổi */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--g1000); color: var(--bg100); font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 60; pointer-events: none; }

/* Hộp thoại — điện thoại: tấm trượt từ dưới lên; máy tính: giữa màn */
.overlay { position: fixed; inset: 0; z-index: 80; background: var(--overlay); display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity var(--dur); }
.overlay.open { opacity: 1; pointer-events: auto; }
.dialog { width: 100%; max-height: 88vh; overflow: auto; background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(24px); transition: transform 220ms var(--ease); padding-bottom: env(safe-area-inset-bottom); }
.overlay.open .dialog { transform: none; }
.dialog-grab { width: 36px; height: 4px; border-radius: 4px; background: var(--g500); margin: 8px auto 0; }
.dialog-hd { padding: var(--s4) var(--s4) 0; }
.dialog-bd { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
.dialog-ft { display: flex; gap: var(--s2); justify-content: flex-end; padding: var(--s3) var(--s4); border-top: 1px solid var(--border); background: var(--bg200); position: sticky; bottom: 0; }
.dialog-ft .btn { flex: 1; }
@media (min-width: 900px) {
  .overlay { align-items: center; }
  .dialog { width: 540px; border-radius: var(--r-xl); transform: translateY(8px) scale(.98); }
  .dialog-grab { display: none; }
  .dialog-hd { padding: var(--s6) var(--s6) 0; } .dialog-bd { padding: var(--s6); } .dialog-ft { padding: var(--s4) var(--s6); border-radius: 0 0 var(--r-xl) var(--r-xl); }
  .dialog-ft .btn { flex: none; }
}
.dtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s4); }
@media (min-width: 900px) { .dtabs { margin: 0 calc(-1 * var(--s6)); padding: 0 var(--s6); } }
.dtabs button { position: relative; height: 40px; padding: 0 10px; border: 0; background: none; color: var(--text-2); font-weight: 500; cursor: pointer; white-space: nowrap; }
.dtabs button[aria-selected="true"] { color: var(--text); }
.dtabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--text); }
.dpanel[hidden] { display: none; }

/* Bảng lệnh (⌘K) */
.cmdk { position: fixed; inset: 0; z-index: 90; background: var(--overlay); display: none; align-items: flex-start; justify-content: center; padding: 12vh var(--s3) 0; }
.cmdk.open { display: flex; }
.cmdk-box { width: 100%; max-width: 620px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.cmdk-in input { flex: 1; height: 52px; border: 0; outline: 0; background: none; font-size: 16px; min-width: 0; }
.cmdk-list { max-height: 50vh; overflow: auto; padding: 8px; }
.cmdk-grp { font-size: 12px; color: var(--text-3); padding: 8px 8px 4px; }
.cmdk-it { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 10px; border-radius: var(--r-md); border: 0; background: none; text-align: left; cursor: pointer; }
.cmdk-it svg { width: 16px; height: 16px; color: var(--text-2); flex: none; }
.cmdk-it span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-it:hover, .cmdk-it.on { background: var(--hover); }

/* Thông báo nổi */
.toasts { position: fixed; z-index: 100; left: var(--s3); right: var(--s3); bottom: calc(var(--bnav-h) + 12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (min-width: 900px) { .toasts { left: auto; right: var(--s6); bottom: var(--s6); width: 380px; } }
/* #062617: quy tắc .toast của khung là cho thông báo nổi do osv-shell.js sinh — chúng luôn là con
   TRỰC TIẾP của .toasts. Để trần `.toast` là luật toàn site, đè lên .toast riêng của từng màn nạp
   sau (vd workflow-project.css pointer-events:none) ⇒ hộp toast rỗng nuốt cú chạm. Giới hạn theo
   .toasts > .toast để không rò sang toast riêng của màn khác (bẫy #054040, đúng lớp lỗi #140531). */
.toasts > .toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); font-size: 14px; animation: tin 240ms var(--ease); }
.toasts > .toast .dot { margin-top: 6px; }
.toasts > .toast b { font-weight: 600; display: block; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* Menu thả */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 50; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.menu.open { display: block; }
.menu-it { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; text-align: left; font-size: 14px; }
.menu-it:hover { background: var(--hover); }
.menu-it .sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border-strong); flex: none; }
.menu-it[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--text-2); }
.menu-sep { height: 1px; background: var(--border); margin: 6px -6px; }
.menu-lbl { font-size: 12px; color: var(--text-3); padding: 6px 10px 4px; }

/* Lưới tiện ích */
.grid { display: grid; gap: var(--s4); grid-template-columns: minmax(0,1fr); }
@media (min-width: 640px) { .g-2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-3, .g-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1000px) { .g-3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .g-4 { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.stack { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.cluster { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-width: 0; }
.sep { height: 1px; background: var(--border); border: 0; margin: var(--s6) 0; }

/* Chỉ số */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .v { font: 600 28px/36px var(--font); letter-spacing: -0.03em; }
.stat .k { font-size: 13px; color: var(--text-2); }
.delta { font: 500 12px/1 var(--mono); padding: 3px 6px; border-radius: 4px; }
.delta.up { color: var(--green-fg); background: var(--green-bg); } .delta.down { color: var(--red-fg); background: var(--red-bg); }


@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ============ 6) KHUNG APP On Studio (#031736 nhóm A) — dùng chung mọi màn trừ Đăng nhập ============ */
/* Ẩn bằng thuộc tính hidden phải thắng mọi luật display của lớp (bẫy #013402). */
[hidden] { display: none !important; }
.tab .cnt, .bnav .cnt { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 99px; background: var(--amber-bg); color: var(--amber-fg); font: 600 11px/1 var(--mono); }
.bnav .cnt { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }
.bnav a, .bnav button { position: relative; }
.hdr-decide { position: relative; }
.hdr-decide .cnt { position: absolute; top: -2px; right: -6px; margin: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; }
.hdr-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.acct-hd { display: flex; align-items: center; gap: 10px; padding: 8px 10px; min-width: 0; }
.acct-hd b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-hd small { display: block; color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Tấm "Tạo mới" / "Thêm": danh sách lựa chọn to, dễ chạm trên điện thoại */
.pick { display: flex; flex-direction: column; gap: 8px; }
.pick-it { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border-radius: var(--r-lg);
  border: 1px solid var(--border); background: var(--surface); text-align: left; cursor: pointer; color: var(--text); }
.pick-it:hover { border-color: var(--border-strong); background: var(--bg200); }
.pick-it > svg { width: 20px; height: 20px; flex: none; color: var(--text-2); }
.pick-it span { min-width: 0; flex: 1; }
.pick-it b { display: block; font-weight: 500; }
.pick-it small { display: block; color: var(--text-2); font-size: 13px; }
.pick-it[aria-current="page"] { border-color: var(--text); }
.theme-pick { display: flex; flex-direction: column; gap: 10px; }
.theme-grp { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.theme-grp .seg { flex-wrap: wrap; }
.menu { max-height: calc(100vh - 80px); overflow-y: auto; }
/* Nút Trợ năng (Spot Fix) nổi phía trên thanh dưới điện thoại; ẩn tạm khi tấm/hộp thoại mở */
@media (max-width: 899.98px) {
  body.has-osv-shell #spot-fix-launcher { bottom: calc(var(--bnav-h) + 16px + env(safe-area-inset-bottom, 0px)) !important; }
}
body.osv-sheet-open #spot-fix-launcher { visibility: hidden; }
/* Widget Trợ năng (Spot Fix) nền trắng cố định: giữ chữ tối ở MỌI theme (không ăn màu chữ sáng của theme tối). */
[id^="spot-fix-"]:not(#spot-fix-launcher):not(#spot-fix-badge):not(#spot-fix-toast) { color: #171717; color-scheme: light; }
/* Sàn 16px cho ô nhập ở khổ hẹp/máy cảm ứng — Safari iPhone không tự phóng to (cùng luật styles.css/studio-mobile-nav.css, #001441). */
@media (max-width: 820px), (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]), select, textarea { font-size: 16px !important; }
}
