/* ==========================================================================
   Memoto — design_new2 · CHROME CỦA TRANG TÀI LIỆU
   Không phải app. Mọi thứ trong .phone là app (app.css).
   ========================================================================== */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.doc { max-width: 1280px; margin: 0 auto; padding: 0 26px 130px; }

/* ---------- Đầu trang ---------- */
.mast { padding: 78px 0 34px; display: flex; flex-direction: column; gap: 18px; }
.mast .kicker {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--br);
}
.mast h1 {
  margin: 0; font-family: var(--f-dis); font-weight: 700;
  font-size: clamp(46px, 8.5vw, 96px); line-height: .92; letter-spacing: -.01em;
  text-wrap: balance; max-width: 22ch;
}
.mast .lede { margin: 0; font-size: 19px; color: var(--ink-2); max-width: 62ch; }
.mast .lede b { color: var(--ink); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tag {
  font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; padding: 7px 11px; border-radius: 7px;
  background: var(--sf); border: 1px solid var(--line); color: var(--ink-2);
}
.tag.hi { background: var(--br-s); border-color: transparent; color: var(--br-i); }

/* ---------- Nav dính ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 11px 0; margin-bottom: 54px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav a {
  font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink-2);
  padding: 7px 12px; border-radius: 9px;
}
.nav a:hover { background: var(--sf); color: var(--ink); }
.nav .sp { flex: 1 1 auto; }
.tog { display: inline-flex; gap: 2px; padding: 3px; background: var(--sf); border: 1px solid var(--line); border-radius: 10px; }
.tog button {
  font: inherit; font-size: 12.5px; font-weight: 600; border: 0; cursor: pointer;
  background: transparent; color: var(--ink-2); padding: 6px 13px; border-radius: 7px;
}
.tog button[aria-pressed="true"] { background: var(--br); color: var(--on-br); }
.nav a:focus-visible, .tog button:focus-visible { outline: 2px solid var(--br); outline-offset: 2px; }

/* ---------- Mục ---------- */
section { margin: 0 0 96px; scroll-margin-top: 76px; }
.shead { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.shead .n { font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--br); flex: none; letter-spacing: .1em; }
.shead h2 { margin: 0; font-family: var(--f-dis); font-size: 40px; font-weight: 700; line-height: 1.02; letter-spacing: -.005em; }
.slede { margin: 0 0 34px; color: var(--ink-2); max-width: 74ch; font-size: 17px; }
.slede b { color: var(--ink); font-weight: 600; }
h3.sub { margin: 46px 0 14px; font-family: var(--f-dis); font-size: 24px; font-weight: 700; }

/* ---------- Bảng màu ---------- */
.sws { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; }
.sw-i { background: var(--sf); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.sw-i .box { height: 64px; }
.sw-i .lb { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 2px; }
.sw-i .lb b { font-size: 13px; font-weight: 600; }
.sw-i .lb code { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: .02em; }

/* ---------- Bảng thông số ---------- */
.tw { background: var(--sf); border: 1px solid var(--line); border-radius: var(--r-m); overflow-x: auto; }
table.spec { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.spec th, .spec td { text-align: left; padding: 12px 15px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec th { font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.spec tr:last-child td { border-bottom: 0; }
.spec td.n { font-family: var(--f-mono); font-size: 13px; white-space: nowrap; color: var(--ink-2); }
.spec td b { font-weight: 600; }

/* ---------- Trưng bày mẫu chữ ---------- */
.type { display: grid; gap: 14px; }
.type .r { background: var(--sf); border: 1px solid var(--line); border-radius: var(--r-m); padding: 18px; display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; }
.type .r .meta { flex: none; width: 190px; }
.type .r .meta b { display: block; font-size: 13.5px; font-weight: 600; }
.type .r .meta code { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); }
.type .r .demo-t { flex: 1 1 320px; min-width: 0; }

/* ---------- Khu trưng bày màn hình ---------- */
.screens { display: flex; flex-direction: column; gap: 84px; }
.show { display: grid; grid-template-columns: 390px minmax(300px, 1fr); gap: 52px; align-items: start; }
@media (max-width: 880px) { .show { grid-template-columns: 1fr; } .phone { margin: 0 auto; } }

.notes { display: flex; flex-direction: column; gap: 18px; padding-top: 6px; }
.notes > h3 { margin: 0; font-family: var(--f-dis); font-size: 30px; font-weight: 700; line-height: 1.05; display: flex; align-items: baseline; gap: 12px; }
.notes > h3 .ix { font-family: var(--f-mono); font-size: 12px; font-weight: 500; color: var(--br); flex: none; letter-spacing: .08em; }
.notes > p { margin: 0; color: var(--ink-2); }
.notes ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 13px; }
/* KHÔNG dùng grid cho <li>: chữ nằm sau </b> sẽ thành grid item RIÊNG và rơi
   xuống hàng mới ở cột hẹp — mỗi dòng còn một chữ. Dùng padding + vạch tuyệt
   đối để chữ chảy bình thường theo inline flow. */
.notes ul li { position: relative; padding-left: 20px; font-size: 15px; }
.notes ul li::before { content: ""; position: absolute; left: 0; top: 11px; width: 10px; height: 2px; border-radius: 1px; background: var(--br); }
.notes ul li b { font-weight: 600; }
code.k { font-family: var(--f-mono); font-size: .84em; background: var(--sf2); padding: 2px 6px; border-radius: 5px; color: var(--ink-2); }

.note {
  background: var(--sf); border: 1px solid var(--line); border-left: 2px solid var(--br);
  border-radius: 0 var(--r-m) var(--r-m) 0; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.note .k2 { font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--br); }
.note p { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.note.new { border-left-color: var(--ok); }
.note.new .k2 { color: var(--ok); }
.note.cut { border-left-color: var(--late); }
.note.cut .k2 { color: var(--late); }

/* ---------- Bàn trình diễn component ---------- */
.lab { background: var(--sf2); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 26px; display: flex; flex-wrap: wrap; gap: 26px; align-items: flex-start; }
.lab .cell { display: flex; flex-direction: column; gap: 11px; min-width: 156px; }
.lab .cell.w { flex: 1 1 300px; }
/* Bốn ô thì để lưới 2×2, đừng để flex-wrap kéo ô thứ tư dài hết hàng. */
.lab.g2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.lab .cap { font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
.lab .stage { background: var(--sf); border: 1px solid var(--line); border-radius: var(--r-m); padding: 14px; font-family: var(--f-ui); color: var(--ink); }

footer.foot { border-top: 1px solid var(--line); padding-top: 28px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--ink-3); }

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