/* ============================================================
   Bộ màu theo template TTT (báo cáo QC TTTA):
   nền xám ấm, đầu trang đen, thẻ trắng, nhấn cam.
   Muốn đổi màu thương hiệu: chỉ sửa các biến trong :root.
   ============================================================ */
:root {
  --bg: #f4f4f2;          /* nền trang */
  --bg-2: #ecece9;        /* nền phụ, tiêu đề bảng */
  --panel: #ffffff;       /* thẻ */
  --panel-2: #fafaf8;
  --line: #d9d9d6;        /* viền */
  --line-strong: #bdbdb8;
  --text: #1b1b1b;        /* chữ chính, đầu trang, nút chính */
  --muted: #666666;
  --ink: #1b1b1b;
  --on-ink: #ffffff;
  --accent: #f77f00;      /* cam nhấn TTT */
  --accent-dark: #c96400; /* cam đậm cho chữ trên nền sáng */
  --accent-soft: #fff7e6; /* nền cam nhạt */
  --blue: #1d70b8;
  --green: #2a9d55;
  --danger: #d62828;
  --radius: 10px;
  --shadow: 0 8px 28px rgba(27, 27, 27, .10);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.ms { font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1;
  display: inline-block; vertical-align: middle; font-variation-settings: "FILL" 0, "wght" 400; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.container.wide { width: auto; margin: 0 20px; }
.grad-text { color: var(--accent-dark); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Đầu trang (đen như template TTT) ---------- */
.nav { position: sticky; top: 0; z-index: 20; background: var(--ink); color: var(--on-ink); }
.nav .container { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .5px; font-size: 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: var(--ink); }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; letter-spacing: .8px; }
.brand-text small { font-size: 9.5px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent); margin-top: 3px; }
.foot-brand { display: inline-flex; align-items: center; gap: 12px; }
.foot-brand img { height: 56px; width: auto; }
.nav-links { display: flex; gap: 22px; color: #c9c9c6; font-size: 14px; margin-left: 12px; }
.nav-links a:hover { color: #fff; }
.nav .spacer { flex: 1; }
.nav .btn { background: transparent; color: #fff; border-color: #4a4a48; }
.nav .btn:hover { background: #2b2b2a; border-color: #6a6a66; }
.nav .btn-primary, .nav .btn-primary:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.nav .btn-account.is-connected { border-color: var(--green); }
.nav .btn-account.is-connected .ms { color: #6fd39a; }

/* ---------- Nút ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:hover { border-color: var(--line-strong); background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn-primary:hover { background: #333331; border-color: #333331; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: var(--bg-2); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Trang giới thiệu ---------- */
.hero { position: relative; padding: 80px 0 56px; text-align: center; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -30% -10% auto; height: 560px; z-index: -1;
  background: radial-gradient(closest-side, rgba(247, 127, 0, .10), transparent 70%); }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 5px 13px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); font-size: 13px; background: var(--panel); }
.eyebrow .ms { color: var(--accent); }
.hero h1 { font-size: clamp(32px, 5.4vw, 58px); line-height: 1.12; margin: 20px auto 16px; max-width: 900px; font-weight: 800; letter-spacing: -.5px; }
.hero p.lead { color: var(--muted); font-size: clamp(16px, 2vw, 19px); max-width: 680px; margin: 0 auto 30px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.ba-demo { margin: 48px auto 0; max-width: 980px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 40px auto 0; max-width: 820px; }
.stat { text-align: center; padding: 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--accent); }
.stat b { display: block; font-size: 26px; }
.stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

section.block { padding: 68px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: clamp(26px, 3.6vw, 36px); margin: 0 0 10px; }
.section-head p { color: var(--muted); margin: 0; }

.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tool-card { position: relative; padding: 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s; }
a.tool-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.tool-card .ms { font-size: 28px; color: var(--accent); }
.tool-card h3 { margin: 12px 0 6px; font-size: 17px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14px; }
.tag { position: absolute; top: 16px; right: 16px; font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--panel-2); }
.tag.live { color: var(--on-ink); background: var(--ink); border-color: var(--ink); font-weight: 600; }

.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; padding: 36px 0; }
.feature.reverse .feature-media { order: 2; }
.feature h3 { font-size: clamp(22px, 3vw, 30px); margin: 12px 0; }
.feature p { color: var(--muted); }
.checks { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: center; }
.checks .ms { color: var(--green); font-size: 20px; }
.feature-media { border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); aspect-ratio: 4 / 3; }
.feature-media svg { width: 100%; height: 100%; display: block; }

.audience { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 20px; }
.faq details[open] { border-left: 3px solid var(--accent); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { color: var(--muted); margin: 10px 0 0; }

.cta { text-align: center; padding: 52px 24px; border-radius: 14px; background: var(--ink); color: var(--on-ink); }
.cta h2 { font-size: clamp(26px, 3.6vw, 34px); margin: 0 0 10px; }
.cta p { color: #c9c9c6; margin: 0 0 24px; }
.cta .btn-primary { background: var(--accent); color: var(--ink); border-color: var(--accent); }
footer { padding: 32px 0 44px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); margin-top: 68px; }
footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Thanh kéo Trước/Sau ---------- */
.compare { position: relative; overflow: hidden; user-select: none; touch-action: none; background: #e6e6e2; }
.compare img, .compare svg { width: 100%; height: 100%; object-fit: contain; display: block;
  /* Không cho trình duyệt "kéo ảnh" (drag & drop) chiếm thao tác kéo thanh so sánh */
  pointer-events: none; user-select: none; -webkit-user-drag: none; }
.compare { cursor: ew-resize; }
.compare .after { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: #fff; transform: translateX(-1px); pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.compare .handle::after { content: "⇆"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: var(--ink); display: grid; place-items: center; font-size: 18px; font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.compare .lbl { position: absolute; top: 12px; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: rgba(27,27,27,.78); color: #fff; }
.compare .lbl.l { left: 12px; } .compare .lbl.r { right: 12px; }

/* ---------- Studio: hàng tab ---------- */
.subnav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 10px 20px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 60px; z-index: 15; }
.round-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
.round-btn:hover { border-color: var(--line-strong); }
.tabs { justify-self: center; display: flex; align-items: center; gap: 2px; padding: 5px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2);
  max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; white-space: nowrap;
  font-size: 15px; font-weight: 600; color: #3a3a38; }
.tab + .tab::before { content: ""; position: absolute; left: -2px; top: 11px; bottom: 11px; width: 1px; background: var(--line); }
.tab.active::before, .tab.active + .tab::before { display: none; }
.tab .ms { font-size: 20px; color: var(--muted); }
.tab:hover { background: var(--bg); }
.tab.active { background: var(--accent); color: var(--ink); box-shadow: 0 2px 10px rgba(247, 127, 0, .35); }
.tab.active .ms { color: var(--ink); }
.tab .soon { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 999px; background: var(--bg-2); color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); font-weight: 600; font-size: 15px; white-space: nowrap; }
.pill-btn:hover { border-color: var(--line-strong); }
.pill-btn.active { border-color: var(--accent); background: var(--accent-soft); }
.pill-btn .ms { font-size: 20px; }

.notice-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 20px; background: var(--accent-soft);
  border-bottom: 1px solid #f3c58f; font-size: 14px; }
.notice-bar > .ms { color: var(--accent-dark); }
.notice-bar > span:nth-child(2) { flex: 1; min-width: 220px; }

/* ---------- Studio: màn chọn không gian ---------- */
.chooser { padding: 56px 24px 72px; text-align: center; }
.chooser h1 { font-size: clamp(28px, 3.6vw, 40px); margin: 0 0 12px; letter-spacing: -.3px; }
.chooser > p { margin: 0 0 44px; font-size: 17px; }
.space-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; max-width: 1380px; margin: 0 auto; text-align: left; }
.space-card { display: block; padding: 14px; border-radius: 24px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 2px 0 rgba(0,0,0,.03);
  transition: border-color .2s, box-shadow .2s, transform .2s; }
.space-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-3px); }
.space-media { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 5; background: #222; }
.space-art, .space-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transition: transform .5s; }
.space-card:hover .space-art { transform: scale(1.05); }
.space-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .5s; }
.space-card:hover .space-img { transform: scale(1.05); }
.space-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(18,18,18,.55) 58%, rgba(18,18,18,.92) 100%); }
.space-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 22px 24px 24px; color: #fff; }
.space-title { display: flex; align-items: center; gap: 14px; font-size: clamp(22px, 2vw, 28px); font-weight: 800; margin-bottom: 14px; }
.space-icon { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; background: rgba(27,27,27,.72);
  border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(6px); }
.space-icon .ms { font-size: 26px; color: #fff; }
.space-body p { margin: 0 0 16px; font-size: 14.5px; color: rgba(255,255,255,.86); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.space-cta { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: #ffb35c; }
.space-cta .ms { font-size: 20px; transition: transform .2s; }
.space-card:hover .space-cta .ms { transform: translateX(4px); }

.ext-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; max-width: 1100px; margin: 0 auto; text-align: left; }
.soon-box { max-width: 520px; margin: 40px auto; padding: 40px 28px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.soon-box > .ms { font-size: 48px; color: var(--accent); }
.soon-box h1 { font-size: 28px; margin: 12px 0 8px; }
.soon-box p { margin: 0 0 24px; }

.history-page { padding: 32px 24px 64px; max-width: 1380px; margin: 0 auto; }
.history-page h1 { margin: 0 0 4px; font-size: 28px; }
.history-grid.big { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 20px; }

/* ---------- Studio: màn làm việc ---------- */
.work { display: grid; grid-template-columns: 400px 1fr; min-height: calc(100vh - 124px); }
.controls { border-right: 1px solid var(--line); padding: 20px; overflow-y: auto; background: var(--panel); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.back-link:hover { color: var(--text); }
.back-link .ms { font-size: 18px; }
.tool-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.tool-icon { width: 46px; height: 46px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid #f3c58f; }
.tool-icon .ms { color: var(--accent-dark); font-size: 26px; }
.controls h2 { margin: 0 0 4px; font-size: 20px; }
.controls .desc { color: var(--muted); font-size: 14px; margin: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; }
select, textarea, input[type="password"], input[type="text"] { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; font-size: 14px; }
textarea { min-height: 84px; resize: vertical; }
select:focus, textarea:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--line-strong); }
.chip.on { color: var(--on-ink); background: var(--ink); border-color: var(--ink); }

.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); cursor: pointer; background: var(--panel); transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .ms { font-size: 32px; color: var(--accent); }
.drop img { max-height: 180px; margin: 0 auto; border-radius: 6px; }
.drop p { margin: 6px 0 0; font-size: 13px; }

.stage { padding: 20px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.notice { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid #f3c58f; border-left: 4px solid var(--accent); background: var(--accent-soft); font-size: 14px; }
.result { flex: 1; min-height: 360px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; overflow: hidden; position: relative; }
.result .empty { text-align: center; color: var(--muted); padding: 24px; }
.result .empty .ms { font-size: 48px; color: var(--line-strong); }
.result .compare { width: 100%; height: 100%; max-height: 72vh; }
.result-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.result-bar .meta { color: var(--muted); font-size: 13px; margin-right: auto; }
.error { color: var(--danger); font-size: 14px; margin: 8px 0 0; }
.error:empty { display: none; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

.history-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.history h3 { margin: 4px 0 2px; font-size: 15px; }
.history > p { margin: 0 0 10px; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.history-grid button { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); cursor: pointer; position: relative; aspect-ratio: 1; }
.history-grid button:hover { border-color: var(--accent); }
.history-grid img { width: 100%; height: 100%; object-fit: cover; }
.history-grid span { position: absolute; left: 6px; bottom: 6px; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(27,27,27,.78); color: #fff; }

/* ---------- Hộp thoại tài khoản ---------- */
.dialog { width: min(560px, calc(100% - 32px)); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 12px; padding: 24px; color: var(--text); background: var(--panel); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog::backdrop { background: rgba(27, 27, 27, .55); }
.dialog h2 { margin: 0 0 8px; font-size: 20px; padding-right: 32px; }
.dialog > p { margin: 0 0 16px; font-size: 14px; }
.dialog-close { position: absolute; top: 12px; right: 12px; margin: 0; }
.steps { margin: 0 0 18px; padding-left: 22px; display: grid; gap: 14px; font-size: 14px; }
.steps li::marker { font-weight: 700; color: var(--accent-dark); }
.steps .btn { margin-top: 8px; }
.key-row { display: flex; gap: 8px; margin-top: 8px; }
.key-row input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; }
.connected { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); border: 1px solid #a9dcbd; background: #eef8f1; margin-bottom: 18px; }
.connected > .ms { color: var(--green); font-size: 28px; }
.connected > div { flex: 1; }
.privacy { display: flex; gap: 8px; align-items: flex-start; margin: 4px 0 0; }
.privacy .ms { font-size: 18px; color: var(--muted); }

/* ---------- Inpaint ---------- */
.inpaint { display: grid; grid-template-columns: 264px minmax(0, 1fr) 300px; height: calc(100vh - 124px); min-height: 560px; }
.ip-tools, .ip-side { background: var(--panel); overflow-y: auto; padding: 16px; }
.ip-tools { border-right: 1px solid var(--line); }
.ip-side { border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.ip-section { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.ip-section:last-child { border-bottom: 0; margin-bottom: 0; }
.ip-label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.ip-label .ms { font-size: 18px; color: var(--accent-dark); }
.ip-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 8px; }
#ipToolBtns { grid-template-columns: repeat(6, 1fr); }
.ip-btn { aspect-ratio: 1; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; padding: 0; }
.ip-btn .ms { font-size: 20px; }
.ip-btn:hover { border-color: var(--line-strong); }
.ip-btn.on { background: var(--accent); border-color: var(--accent); color: var(--ink); }
#ipToggleMask.on { background: var(--accent-soft); border-color: #f3c58f; color: var(--accent-dark); }
.ip-slider { display: block; margin-bottom: 12px; }
.ip-slider > span { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: #3a3a38; margin-bottom: 4px; }
.ip-slider b { font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ip-slider input { width: 100%; accent-color: var(--accent); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); }
.seg-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border: 0; border-radius: 7px; background: none;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg-btn .ms { font-size: 18px; }
.seg-btn.on { background: var(--accent); color: var(--ink); }
.ip-hint { margin: 10px 0 0; line-height: 1.45; }

.ip-main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.ip-promptbar { display: flex; gap: 10px; padding: 14px 16px 8px; }
.ip-promptbar textarea { flex: 1; min-height: 48px; resize: vertical; }
.ip-promptbar .btn { height: auto; min-height: 48px; padding: 0 22px; }
.ip-optbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 16px 10px; }
.ip-optbar .spacer { flex: 1; }
.ip-ref { position: relative; display: inline-flex; }
.ip-ref img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.ip-ref .icon-btn { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; padding: 0; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; }
.ip-ref .icon-btn .ms { font-size: 14px; }
.ip-select { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); }
.ip-select .ms { font-size: 18px; color: var(--muted); }
.ip-select select { border: 0; padding: 6px 6px; width: auto; background: transparent; }
.ip-err { padding: 0 16px; margin: 0 0 8px; }
.ip-stage { position: relative; flex: 1; min-height: 360px; margin: 0 16px 16px; border-radius: 12px; border: 2px dashed var(--line-strong);
  background: repeating-conic-gradient(#ecece9 0% 25%, #f6f6f4 0% 50%) 0 0 / 22px 22px; overflow: hidden; }
.ip-stage.over { border-color: var(--accent); }
.ip-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.ip-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 24px; background: var(--panel-2); }
.ip-empty-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid #f3c58f; margin-bottom: 8px; }
.ip-empty-icon .ms { font-size: 28px; color: var(--accent-dark); }
.ip-busy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(244, 244, 242, .72); backdrop-filter: blur(2px); font-size: 14px; }

.ip-drop { padding: 22px 14px; }
.ip-drop p { margin: 4px 0 0; }
.ip-hist { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ip-patch-head { margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.ip-patches { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 120px; overflow-y: auto; }
.ip-patch-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; text-align: center; }
.ip-patch-empty .ms { font-size: 36px; color: var(--line-strong); }
.ip-patch { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); }
.ip-patch img { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; flex: none; }
.ip-patch.off img { opacity: .4; }
.ip-patch-info { flex: 1; min-width: 0; font-size: 12.5px; }
.ip-patch-info b { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--accent); color: var(--ink); font-size: 11px; margin-bottom: 2px; }
.ip-patch.off .ip-patch-info b { background: var(--bg-2); color: var(--muted); }
.ip-patch-info span { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ip-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }

@media (max-width: 1200px) { .inpaint { grid-template-columns: 230px minmax(0, 1fr) 260px; } }
@media (max-width: 980px) {
  .inpaint { grid-template-columns: 1fr; height: auto; }
  .ip-tools, .ip-side { border: 0; border-bottom: 1px solid var(--line); }
  .ip-main { order: -1; }
  .ip-stage { height: 62vh; flex: none; }
}

/* ---------- Mở trong Flow ---------- */
.btn-flow { border-color: #f3c58f; background: var(--accent-soft); color: var(--accent-dark); }
.btn-flow:hover { border-color: var(--accent); background: #ffefd6; }
.ip-flow { grid-column: 1 / -1; }
.copy-row { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.copy-row textarea { flex: 1; min-height: 0; font-size: 13px; resize: none; background: var(--panel-2); }
.notice-inline { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 8px; background: var(--accent-soft); border: 1px solid #f3c58f; font-size: 14px; }
.notice-inline a { color: var(--blue); text-decoration: underline; }
.dialog code { font-size: 12.5px; background: var(--bg); padding: 1px 6px; border-radius: 4px; word-break: break-all; }

/* ---------- Tạo miễn phí qua ứng dụng Gemini ---------- */
.btn-free { border-color: #a9dcbd; background: #eef8f1; color: #1f7a43; }
.btn-free:hover { border-color: var(--green); background: #e2f3e8; }
.btn-sub { font-size: 11px; font-weight: 500; opacity: .75; margin-left: 2px; }
.btn-block + .btn-block { margin-top: 8px; }
.ip-promptbar .ip-gen-col { display: flex; flex-direction: column; gap: 6px; }
.ip-promptbar .ip-gen-col .btn { min-height: 0; }
.ip-promptbar .ip-gen-col .btn-primary { height: 42px; }
.ho-drop { margin-top: 8px; padding: 16px; }
.ho-drop p { margin: 4px 0 0; }

/* ---------- Hộp thoại tài khoản: chế độ miễn phí / nâng cao ---------- */
.mode-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 6px 0 14px; background: var(--panel-2); }
.mode-card.on { border-color: #a9dcbd; background: #f6fbf8; }
.mode-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; font-size: 15px; }
.mode-icon { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; background: #e2f3e8; color: #1f7a43; }
.tag-free { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--green); color: #fff; vertical-align: 1px; }
.mode-card .steps { margin-bottom: 12px; }
.mode-card .connected { margin-bottom: 12px; }
.mode-adv { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.mode-adv summary { cursor: pointer; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; list-style: none; }
.mode-adv summary::-webkit-details-marker { display: none; }
.mode-adv summary::after { content: "expand_more"; font-family: "Material Symbols Rounded"; margin-left: auto; color: var(--muted); font-size: 20px; }
.mode-adv[open] summary::after { content: "expand_less"; }
.mode-adv summary .ms { color: var(--muted); font-size: 20px; }
.mode-adv[open] summary { margin-bottom: 10px; }

/* ---------- Làm Video ---------- */
.video-page { padding: 16px 20px 24px; }
.vd-modebar { display: flex; justify-content: center; margin-bottom: 16px; }
.vd-mode { background: var(--panel); min-width: 340px; }
.vd-mode .seg-btn { height: 40px; font-size: 15px; }
.vd-grid { display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 20px; align-items: start; }
.vd-left { position: sticky; top: 140px; display: flex; flex-direction: column; max-height: calc(100vh - 160px); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.vd-scroll { overflow-y: auto; padding: 18px; }
.vd-sec { padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.vd-sec:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 4px; }
.vd-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 13.5px; text-transform: uppercase; letter-spacing: .6px; }
.vd-sec-head > .ms { color: var(--accent-dark); font-size: 22px; }
.vd-sec-head .muted { font-size: 12px; }
.req { margin-left: auto; font-size: 10.5px; font-weight: 800; letter-spacing: .8px; padding: 3px 10px; border-radius: 999px; color: var(--danger); background: #fdecec; border: 1px solid #f6c5c5; }
.vd-drop { padding: 22px 16px; }
.vd-drop p { margin: 4px 0 0; }
.vd-drop-icon { width: 48px; height: 48px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--accent-soft); border: 1px solid #f3c58f; }
.vd-drop-icon .ms { color: var(--accent-dark); }
.vd-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.vd-thumbs:empty { display: none; }
.vd-thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.vd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.vd-thumb-lbl { position: absolute; left: 6px; bottom: 6px; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(27,27,27,.78); color: #fff; }
.vd-thumb .icon-btn { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0; display: grid; place-items: center; border-radius: 50%; background: rgba(27,27,27,.78); color: #fff; }
.vd-thumb .icon-btn .ms { font-size: 16px; }
.vd-row { margin-top: 10px; }
.vd-row .link-btn { display: inline-flex; align-items: center; gap: 4px; }
.vd-row .link-btn .ms { font-size: 18px; }
.vd-hist { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.vd-tip { display: flex; gap: 8px; margin: 12px 0 0; font-size: 12.5px; font-style: italic; color: var(--muted); }
.vd-tip .ms { color: var(--accent); font-size: 20px; font-style: normal; }
#vdScript { min-height: 120px; }
#vdScript.flash { outline: 2px solid var(--accent); }
.vd-selects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.vd-selects label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.vd-selects select { padding: 8px 10px; font-size: 13px; }
.vd-foot { padding: 14px 18px 16px; border-top: 1px solid var(--line); background: var(--panel-2); }
.vd-cost { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 12px; }
.vd-cost small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.vd-cost b { display: inline-flex; align-items: center; gap: 6px; font-size: 16px; }
.vd-cost b .ms { color: var(--accent); font-size: 22px; }
.vd-cost-r { text-align: right; }
.vd-cost-r b { color: var(--green); }
.vd-go { height: 50px; font-size: 16px; }

.vd-right { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.vd-right-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.vd-right-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 22px; }
.vd-right-head h2 .ms { color: var(--accent); }
.vd-right-head .seg { min-width: 320px; }
.vd-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.vd-card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel-2); }
.vd-card:hover { border-color: var(--accent); }
.vd-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vd-card-top .small { display: inline-flex; align-items: center; gap: 4px; }
.vd-card-top .ms { font-size: 16px; }
.vd-tag { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; padding: 4px 10px; border-radius: 8px; background: var(--ink); color: #fff; }
.vd-card-media { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #222; }
.vd-card-art, .vd-card-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.vd-card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.7)); }
.vd-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.92); color: var(--accent-dark); z-index: 1; }
.vd-play .ms { font-size: 30px; }
.vd-card-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vd-card-media.has-video { cursor: pointer; }
.vd-card-media.has-video:hover .vd-play { opacity: 0; }
.vd-sample { position: absolute; top: 10px; right: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 8px; background: rgba(27,27,27,.75); color: #fff; }
.vd-sample::before { content: "play_circle"; font-family: "Material Symbols Rounded"; font-size: 16px; color: var(--accent); }
.vd-play { transition: opacity .2s; }
.dialog-video { width: min(960px, calc(100% - 32px)); }
.dialog-video video { width: 100%; max-height: 70vh; border-radius: 10px; background: #000; display: block; }
.vd-card-title { position: absolute; left: 14px; bottom: 12px; z-index: 1; color: #fff; font-size: 15px; }
.vd-quote { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 13.5px; font-style: italic; color: #3a3a38; }
.vd-card .btn-primary { margin-top: auto; }
.vd-library { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.vd-vid { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel-2); display: flex; flex-direction: column; }
.vd-vid.hl { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(247,127,0,.2); }
.vd-vid video { width: 100%; aspect-ratio: 16 / 9; background: #111; display: block; }
.vd-vid-meta { padding: 10px 12px 0; font-size: 13.5px; }
.vd-vid-meta b { display: block; margin-bottom: 2px; }
.vd-vid-actions { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; }
.vd-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 48px 16px; }
.vd-empty .ms { font-size: 48px; color: var(--line-strong); }
.dialog-wide { width: min(640px, calc(100% - 32px)); }
.history-grid video { width: 100%; height: 100%; object-fit: cover; }
.hist-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-family: "Material Symbols Rounded"; font-style: normal; font-size: 36px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
@media (max-width: 1100px) { .vd-grid { grid-template-columns: 1fr; } .vd-left { position: static; max-height: none; } }
@media (max-width: 640px) { .vd-mode, .vd-right-head .seg { min-width: 0; width: 100%; } .vd-selects { grid-template-columns: 1fr; } .vd-templates, .vd-library { grid-template-columns: 1fr; } .video-page { padding: 12px; } }

/* ---------- Inpaint: Focus, zoom, gợi ý ---------- */
.ip-modeseg { padding: 3px; }
.ip-modeseg .seg-btn { height: 30px; padding: 0 12px; flex: none; }
.ip-modeseg .seg-btn[data-mode="focus"].on { background: #f5c518; }
.focus-mode #ipToolBtns, .focus-mode .ip-section:first-child .ip-grid:not(#ipToolBtns) .ip-btn:not(#ipClear):not(#ipToggleMask), .focus-mode .ip-slider:has(#ipSize), .focus-mode .ip-slider:has(#ipFeather), .focus-mode .ip-slider:has(#ipExpansion), .focus-mode #ipRegion, .focus-mode .ip-check { opacity: .4; }
.ip-info { padding: 0 16px; margin: -4px 0 8px; }
.ip-info:empty { display: none; }
.ip-hintbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2; pointer-events: none; white-space: nowrap;
  font: 500 11.5px/1 ui-monospace, Consolas, monospace; color: #e8e8e4; background: rgba(27,27,27,.78); padding: 6px 10px; border-radius: 6px; }
.ip-hintbar b { color: #fff; }
.ip-zoom { position: absolute; left: 12px; bottom: 12px; z-index: 2; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(27,27,27,.85); }
.ip-zoom .icon-btn { color: #ddd; padding: 4px; }
.ip-zoom .icon-btn:hover { background: #333; color: #fff; }
.ip-zoom .icon-btn .ms { font-size: 18px; }
.ip-zoom span { min-width: 46px; text-align: center; color: #fff; font: 600 12px/1 ui-monospace, Consolas, monospace; }
.ip-check { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 12.5px; line-height: 1.45; cursor: pointer; }
.ip-check input { margin-top: 2px; accent-color: var(--accent); }
@media (max-width: 1300px) { .ip-hintbar { display: none; } }

/* ---------- Hàng chờ & phương án ---------- */
.btn-queue { border-style: dashed; }
.btn-queue .ms { color: var(--accent-dark); }
.variants { display: flex; gap: 6px; flex-wrap: wrap; }
.queue-card { position: fixed; left: 20px; bottom: 20px; z-index: 49; width: min(360px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--line);
  border-top: 3px solid var(--accent); border-radius: 14px; padding: 12px 14px; box-shadow: 0 16px 40px rgba(0,0,0,.18); }
.qc-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.qc-head > .ms { color: var(--accent-dark); }
.qc-head .icon-btn { margin-left: auto; }
.queue-card.collapsed .qc-list, .queue-card.collapsed .qc-actions, .queue-card.collapsed .qc-note { display: none; }
.queue-card.collapsed .qc-head .icon-btn .ms { transform: rotate(180deg); }
.qc-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; max-height: 240px; overflow-y: auto; }
.qc-list li { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.qc-list li.running { border-color: var(--accent); background: var(--accent-soft); }
.qc-list img { width: 44px; height: 33px; object-fit: cover; border-radius: 5px; flex: none; }
.qc-list li > div { flex: 1; min-width: 0; font-size: 13px; }
.qc-list li b { display: block; }
.qc-list li span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-actions { display: flex; gap: 8px; }
.qc-note { margin: 8px 0 0; color: var(--muted); }
.qc-note a { color: var(--blue); }

/* ---------- Flow Bridge ---------- */
.bridge-status { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-size: 14px; }
.bridge-status.on { border-color: #a9dcbd; background: #eef8f1; }
.bridge-status.on > .ms { color: var(--green); }
details.bridge-status { display: block; }
details.bridge-status summary { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; list-style: none; }
details.bridge-status summary::-webkit-details-marker { display: none; }
details.bridge-status summary .ms { color: var(--muted); }
details.bridge-status .steps { margin: 10px 0 0; }
.bridge-panel { position: fixed; right: 20px; bottom: 20px; z-index: 50; width: min(380px, calc(100% - 32px)); background: var(--ink); color: #fff;
  border-radius: 14px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.35); border: 1px solid #333; }
.bridge-panel.attn { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(247,127,0,.35), 0 16px 40px rgba(0,0,0,.35); }
.bp-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.bp-head .icon-btn { margin-left: auto; color: #aaa; }
.bp-head .icon-btn:hover { background: #2b2b2a; color: #fff; }
.bp-dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); }
.bp-live { font-size: 10.5px; font-weight: 800; letter-spacing: 1px; color: #4ade80; }
.bp-steps { list-style: none; display: flex; gap: 4px; flex-wrap: wrap; padding: 0; margin: 12px 0 8px; }
.bp-steps li { font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: #2b2b2a; color: #9a9a96; }
.bp-steps li.done { background: #1f3b2a; color: #8fe0ad; }
.bp-steps li.now { background: var(--accent); color: var(--ink); font-weight: 700; }
.bp-steps li.err { background: #5a1f1f; color: #ffb4b4; font-weight: 700; }
.bp-text { margin: 0 0 12px; font-size: 13.5px; color: #e8e8e4; }
.bp-text.error { color: #ffb4b4; }
.bp-actions { display: flex; gap: 8px; }
.bp-actions .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.bp-actions .btn:not(.btn-primary) { background: transparent; color: #fff; border-color: #4a4a48; }

/* ---------- Màn hình nhỏ ---------- */
@media (max-width: 1200px) { .space-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 820px; } .space-media { aspect-ratio: 5 / 4; } }
@media (max-width: 1100px) { .work { grid-template-columns: 340px 1fr; } .tab { padding: 0 12px; font-size: 14px; } }
@media (max-width: 900px) {
  .nav-links { display: none; }
  .feature, .feature.reverse { grid-template-columns: 1fr; gap: 24px; }
  .feature.reverse .feature-media { order: 0; }
  .audience { grid-template-columns: 1fr; }
  .subnav { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 8px 16px; }
  .tabs { justify-self: stretch; }
  .work { grid-template-columns: 1fr; }
  .controls { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .space-cards { grid-template-columns: 1fr; max-width: 420px; }
  .pill-btn { padding: 0 12px; }
  .pill-btn { font-size: 0; gap: 0; }
  .pill-btn .ms { font-size: 20px; }
  .chooser { padding: 36px 16px 56px; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .nav .btn:not(.btn-primary):not(.btn-account) { display: none; }
  .nav .btn-account #accountLabel { display: none; }
  .container.wide { margin: 0 16px; }
}
