/* NTCOM ntcom.40 / ntcom.42: Wiki home (desktop only, >= 861px).

   ntcom.42: the Đồ thị page is ONLY the graph, like Obsidian's graph view. `.hud-body` is
   `display: contents`, so its children sit in the .hud grid:

       top    top    top
       left   graph  panel        (Vault | graph | graph controls, ntcom-graph.js)

   The chat column, its history and the composer are hidden HERE (they are still in the DOM:
   the Trò chuyện page borrows #chatArea / #hudVoice etc. and shows them there). Widths are CSS
   variables the drag handles set (ntcom-home.js). Phones keep the old stacked layout. */

.nt-gpanel, .nt-rz { display: none; }

@media (min-width: 861px) {
  /* Rail width is draggable too; the collapsed rail keeps its own fixed width. */
  body.ntcom-layout:not(.rail-collapsed) { --rail-w: var(--nt-rail-w, 190px); }
  body.ntcom-layout .rail .nt-rz-rail {
    display: block; position: absolute; top: 0; bottom: 0; right: -4px; width: 8px;
    cursor: col-resize; z-index: 61;
  }
  body.ntcom-layout.rail-collapsed .rail .nt-rz-rail { display: none; }
  body.ntcom-layout .rail .nt-rz-rail::after { top: 0; bottom: 0; left: 3px; width: 2px; }

  body.ntcom-layout .hud {
    --nt-vault-eff: var(--nt-vault-w, 260px);
    --nt-hist-eff: var(--nt-hist-w, 270px);
    grid-template-columns: var(--nt-vault-eff) minmax(0, 1fr) var(--nt-hist-eff);
    grid-template-rows: 52px minmax(0, 1fr);
    grid-template-areas:
      "top top top"
      "left graph panel";
  }
  body.ntcom-layout.vault-thu .hud { --nt-vault-eff: 44px; }
  body.ntcom-layout.ngp-thu .hud { --nt-hist-eff: 0px; }
  body.ntcom-layout .hud-body { display: contents; }
  body.ntcom-layout .hud-top { grid-area: top; }
  body.ntcom-layout .hud-body > .hud-left { grid-area: left; }
  body.ntcom-layout .hud-center { grid-area: graph; }
  body.ntcom-layout .nt-gpanel { grid-area: panel; }
  /* Chat, history and composer are not part of the graph page. */
  body.ntcom-layout .hud-body > .hud-right,
  body.ntcom-layout .hud > .bg-strip,
  body.ntcom-layout .hud > .attach-bar,
  body.ntcom-layout .hud > .model-bar,
  body.ntcom-layout .hud > .hud-voice { display: none !important; }

  /* ---- Composer, claude.ai style: a rounded shadowed card, the text on top and one slim
     tool row under it (attach, mic ... model chip, send). The model chip lives in its own
     grid row elsewhere; here it is laid over the card's tool row (same grid area). ---- */
  body.ntcom-layout .bg-strip,
  body.ntcom-layout .attach-bar,
  body.ntcom-layout .hud-voice {
    width: calc(100% - 48px); max-width: 860px; margin-left: auto; margin-right: auto;
    box-sizing: border-box;
  }
  body.ntcom-layout .hud-voice {
    flex-wrap: wrap; align-items: center; row-gap: 2px; column-gap: 2px;
    margin-top: 6px; margin-bottom: 14px; padding: 10px 10px 8px 10px;
    border: 1px solid var(--border); border-radius: 20px; background: var(--bg2);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 20px rgba(20, 40, 80, 0.08);
    transition: box-shadow .15s, border-color .15s;
  }
  body.ntcom-layout .hud-voice:focus-within {
    border-color: var(--accent-line);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 26px rgba(20, 40, 80, 0.13);
  }
  body.ntcom-layout .hud-voice .voice-input {
    order: 0; flex: 1 0 100%; width: 100%;
    border: 0; background: transparent; border-radius: 0; padding: 4px 6px 6px;
    min-height: var(--nt-input-h, 44px); max-height: 70vh; overflow-y: auto;
  }
  body.ntcom-layout .hud-voice .voice-input:focus { border: 0; }
  body.ntcom-layout .hud-voice .attach-btn { order: 1; }
  body.ntcom-layout .hud-voice .mic-big { order: 2; margin-right: auto; }
  body.ntcom-layout .hud-voice .stop-btn,
  body.ntcom-layout .hud-voice .send-btn { order: 3; width: 34px; height: 34px; border-radius: 10px; }
  body.ntcom-layout .hud-voice .mic-big,
  body.ntcom-layout .hud-voice .attach-btn {
    width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--text3);
  }
  body.ntcom-layout .hud-voice .mic-big svg, body.ntcom-layout .hud-voice .attach-btn svg { width: 18px; height: 18px; }
  body.ntcom-layout .hud-voice .mic-big:hover,
  body.ntcom-layout .hud-voice .attach-btn:hover { background: var(--surface-2, rgba(127,127,127,.12)); color: var(--text); }
  body.ntcom-layout .model-bar {
    grid-area: voice; align-self: end; justify-self: end; z-index: 3;
    width: auto; max-width: 60%; padding: 0;
    margin: 0 calc(max(24px, (100% - 860px) / 2) + 54px) 26px 0;
  }
  body.ntcom-layout .model-bar .mb-chip { background: transparent; border-color: transparent; color: var(--text3); }
  body.ntcom-layout .model-bar .mb-chip:hover { color: var(--text); border-color: var(--border); }
  body.ntcom-layout .model-bar .mb-pop { left: auto; right: 0; }

  /* ---- Drag handles (grid items placed on the column/row edges) ---- */
  body.ntcom-layout .nt-rz { display: block; position: relative; z-index: 20; touch-action: none; }
  body.ntcom-layout .nt-rz::after {
    content: ""; position: absolute; background: var(--accent-solid); opacity: 0; transition: opacity .12s;
  }
  body.ntcom-layout .nt-rz:hover::after, body.ntcom-layout .nt-rz.on::after { opacity: .55; }
  body.ntcom-layout .nt-rz-vault { grid-column: 1; grid-row: 2; justify-self: end; width: 8px; margin-right: -4px; cursor: col-resize; }
  body.ntcom-layout .nt-rz-hist { grid-column: 3; grid-row: 2; justify-self: start; width: 8px; margin-left: -4px; cursor: col-resize; }
  body.ntcom-layout .nt-rz-vault::after, body.ntcom-layout .nt-rz-hist::after { top: 0; bottom: 0; left: 3px; width: 2px; }
  body.nt-dragging, body.nt-dragging * { user-select: none !important; }
  body.nt-dragging.nt-drag-col, body.nt-dragging.nt-drag-col * { cursor: col-resize !important; }
  body.ntcom-layout.vault-thu .nt-rz-vault, body.ntcom-layout.ngp-thu .nt-rz-hist { display: none; }

  /* ---- Top bar: brain picker without the delete button and the note/link counter ---- */
  .hud-top .navbar-brain #delBrainBtn, .hud-top .navbar-brain #graphStats { display: none; }

}

/* ===== NTCOM ntcom.40: "Cấu hình" row at the rail foot + settings dialog (ntcom-cfg.js) ===== */
/* The "Hệ thống" group, the language select and the version line are replaced by one row. */
body.ntcom-layout .rail-group.foot,
body.ntcom-layout #railLangWrap,
body.ntcom-layout .rail-foot .rf-meta { display: none !important; }
body.ntcom-layout .rail-foot { padding-top: 8px; gap: 4px; }
.ntc-btn {
  order: 1; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 7px;
  padding: 7px 5px; border: 0; border-radius: 9px; background: transparent; color: var(--text2);
  font: inherit; font-family: var(--font-ui); font-size: 13px; font-weight: 600; cursor: pointer; text-align: left;
}
.ntc-btn:hover, .ntc-btn[aria-expanded="true"] { background: var(--surface-2, rgba(127,127,127,.12)); color: var(--text); }
.ntc-btn svg { width: 17px; height: 17px; flex: none; }
.ntc-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 861px) {
  .rail.collapsed .ntc-btn { flex: 0 0 auto; justify-content: center; }
  .rail.collapsed .ntc-btn .ntc-lbl { display: none; }
  .rail.collapsed .rail-foot { flex-direction: column; }
}
.ntc-menu {
  position: fixed; z-index: 300; padding: 6px; border-radius: 12px; max-width: calc(100vw - 16px);
  background: var(--bg2); border: 1px solid var(--border); color: var(--text);
  box-shadow: 0 10px 34px rgba(20, 40, 80, 0.18), 0 1px 3px rgba(0, 0, 0, 0.06);
}
.ntc-mi {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; color: inherit; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.ntc-mi:hover { background: var(--surface-2, rgba(127,127,127,.12)); }
.ntc-mi svg { width: 16px; height: 16px; flex: none; color: var(--text2); }
.ntc-mi-r { margin-left: auto; color: var(--text3); font-size: 12px; }
.ntc-li { padding-left: 36px; }
.ntc-li.on { color: var(--accent); font-weight: 600; }
.ntc-sep { height: 1px; margin: 5px 4px; background: var(--border); }
.ntc-ver { padding: 4px 10px 3px; font-size: 11.5px; color: var(--text3); }
.ntc-nav, .ntc-close, .ntc-backdrop { display: none; }

/* Settings / Account / Share as a centred dialog, claude.ai style (desktop). */
@media (min-width: 861px) {
  body.ntc-open .ntc-backdrop {
    display: block; position: fixed; inset: 0; z-index: 199; background: rgba(10, 20, 40, 0.38);
    backdrop-filter: blur(2px);
  }
  body.ntc-open .cview {
    top: 5vh; bottom: 5vh; left: 50%; right: auto; width: min(1180px, 92vw); transform: translateX(-50%);
    z-index: 200; display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    border-radius: 16px; overflow: hidden; background: var(--bg2);
    border: 1px solid var(--border); box-shadow: 0 24px 70px rgba(10, 25, 55, 0.28);
  }
  body.ntc-open .cview > .ntc-nav {
    display: block; grid-row: 1 / 3; overflow-y: auto; padding: 16px 12px;
    border-right: 1px solid var(--border); background: var(--bg);
  }
  body.ntc-open .cview > .cview-head { grid-column: 2; padding: 22px 64px 14px 28px; border-bottom: 0; }
  body.ntc-open .cview > .cview-body { grid-column: 2; padding: 4px 28px 28px; }
  body.ntc-open .cview-body .settings-tabs { display: none; }
  body.ntc-open .cview > .ntc-close {
    display: flex; position: absolute; top: 14px; right: 14px; z-index: 2; width: 34px; height: 34px;
    align-items: center; justify-content: center; border: 0; border-radius: 9px; background: none;
    color: var(--text2); cursor: pointer;
  }
  body.ntc-open .cview > .ntc-close:hover { background: var(--surface-2, rgba(127,127,127,.12)); color: var(--text); }
  body.ntc-open .cview > .ntc-close svg { width: 18px; height: 18px; }
}
.ntc-search {
  display: flex; align-items: center; gap: 7px; padding: 7px 10px; margin-bottom: 12px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--bg2); color: var(--text3);
}
.ntc-search svg { width: 15px; height: 15px; flex: none; }
.ntc-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; }
.ntc-grp { padding: 10px 10px 6px; font-size: 11.5px; color: var(--text3); font-weight: 600; }
.ntc-ni {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; margin-bottom: 1px;
  border: 0; border-radius: 8px; background: none; color: var(--text2); font: inherit; font-size: 13.5px;
  text-align: left; cursor: pointer;
}
.ntc-ni:hover { background: var(--surface-2, rgba(127,127,127,.12)); color: var(--text); }
.ntc-ni.active { background: var(--surface-3, rgba(127,127,127,.18)); color: var(--text); font-weight: 600; }
.ntc-ni svg { width: 16px; height: 16px; flex: none; }
.ntc-ni[hidden] { display: none; }

/* ===== NTCOM ntcom.41: conversation list of the Trò chuyện page, claude.ai style =====
   One line per conversation: a small circle, the title, nothing else. Time, channel, engine and
   message-count badges are gone; pin / move / rename / delete appear on hover at the right end
   (a pinned row keeps its pin visible). The Cộng sự page list (.cside-gon) is left as is. */
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-new {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text); font-size: 14px; font-weight: 500;
}
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-new:hover { background: var(--surface-2, rgba(127,127,127,.12)); }
body.ntcom-layout :not(.cside-gon) > .cside-pane { gap: 6px; }
body.ntcom-layout .cside-tab.active { background: var(--surface-2, rgba(127,127,127,.12)); border-color: transparent; color: var(--text); }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-search { background: transparent; font-size: 13.5px; padding: 7px 10px; }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cs-proj-cur { border-color: transparent; background: transparent; }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cs-proj-cur:hover { background: var(--surface-2, rgba(127,127,127,.12)); }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cs-proj-add { border-color: transparent; }

body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-group {
  text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; padding: 12px 8px 4px;
}
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item {
  position: relative; display: flex; align-items: center; min-height: 32px; margin: 0;
  padding: 6px 8px 6px 26px; border: 0; border-radius: 8px;
}
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item::before {
  content: ""; position: absolute; left: 10px; top: 50%; width: 7px; height: 7px; margin-top: -4px;
  border: 1.5px solid var(--text3); border-radius: 50%; opacity: .7;
}
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item.running::before { display: none; }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item.running { padding-left: 8px; }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item.ghim { border-left: 0; }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item.ghim::before { border-color: var(--accent); background: var(--accent); opacity: 1; }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item:hover { background: var(--surface-2, rgba(127,127,127,.12)); }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item.active { background: var(--surface-3, rgba(127,127,127,.18)); }
body.ntcom-layout :not(.cside-gon) > .cside-pane .ci-title {
  flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 400; color: var(--text);
}
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item.active .ci-title { font-weight: 600; }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item:hover .ci-title { padding-right: 84px; }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item.ghim:not(:hover) .ci-title { padding-right: 20px; }
body.ntcom-layout :not(.cside-gon) > .cside-pane .ci-meta {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); margin: 0;
}
body.ntcom-layout :not(.cside-gon) > .cside-pane .ci-meta > :not(.act) { display: none; }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item.ghim:not(:hover) .act > :not(.pin) { display: none; }
/* Search results keep their snippet under the title. */
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item:has(.ci-snip) { display: block; padding-left: 8px; }
body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item:has(.ci-snip)::before { display: none; }
@media (hover: none) {
  body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item .ci-title,
  body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item.ghim:not(:hover) .ci-title { padding-right: 84px; }
  body.ntcom-layout :not(.cside-gon) > .cside-pane .cside-item.ghim:not(:hover) .act > :not(.pin) { display: inline; }
}

/* ===== NTCOM ntcom.41: one text size on the Wiki screen (desktop) + a composer that stands out =====
   The owner picked the size of the "Cấu hình" label (13px, --font-ui) for everything: rail,
   Vault tree, chat bubbles, both history lists, the composer. Headings in answers scale from it. */
@media (min-width: 861px) {
  body.ntcom-layout { --nt-fs: 13px; }
  body.ntcom-layout .rail-item .rail-lbl,
  body.ntcom-layout .rail-grp-lbl,
  body.ntcom-layout .vault-tree, body.ntcom-layout .vault-results, body.ntcom-layout .vt-info, body.ntcom-layout .vt-node,
  body.ntcom-layout #vaultSearch, body.ntcom-layout .vs-chip,
  body.ntcom-layout .ci-title, body.ntcom-layout .cside-new, body.ntcom-layout .cside-search,
  body.ntcom-layout .cs-proj-cur, body.ntcom-layout .cside-tab, body.ntcom-layout .cside-group,
  body.ntcom-layout .nt-gpanel,
  body.ntcom-layout .mb-chip, body.ntcom-layout .ntc-mi, body.ntcom-layout .ntc-ni,
  body.ntcom-layout .msg-user .bubble, body.ntcom-layout .msg-javis .bubble,
  body.ntcom-layout .md-table,
  body.ntcom-layout .hud-voice .voice-input {
    font-size: var(--nt-fs);
  }
  body.ntcom-layout .ci-snip { font-size: 12px; }
  body.ntcom-layout .msg-user .bubble, body.ntcom-layout .msg-javis .bubble { line-height: 1.65; }
  body.ntcom-layout .msg-javis .bubble h1 { font-size: 16px; }
  body.ntcom-layout .msg-javis .bubble h2 { font-size: 15px; }
  body.ntcom-layout .msg-javis .bubble h3 { font-size: 14px; }
  body.ntcom-layout .msg-javis .bubble h4, body.ntcom-layout .msg-javis .bubble h5,
  body.ntcom-layout .msg-javis .bubble h6 { font-size: 13px; }
  body.ntcom-layout .msg-javis .bubble code { font-size: 12px; }
  body.ntcom-layout .msg-javis .bubble pre, body.ntcom-layout .msg-javis .bubble pre code { font-size: 12px; }

  /* Composer contrast, claude.ai-like: white card with a clearly visible edge on a tinted page. */
  body.ntcom-layout .hud-voice {
    background: var(--bg2);
    border: 1px solid color-mix(in srgb, var(--text) 20%, transparent);
    box-shadow: 0 1px 3px rgba(15, 30, 60, 0.08), 0 6px 22px rgba(15, 30, 60, 0.10);
  }
  body.ntcom-layout .hud-voice:focus-within {
    border-color: color-mix(in srgb, var(--text) 32%, transparent);
    box-shadow: 0 1px 3px rgba(15, 30, 60, 0.10), 0 8px 28px rgba(15, 30, 60, 0.14);
  }
  body.ntcom-layout .hud-voice .voice-input { color: var(--text); }
  body.ntcom-layout .hud-voice .voice-input::placeholder { color: #9ca3af; opacity: 1; }
  body.ntcom-layout .hud-voice .mic-big, body.ntcom-layout .hud-voice .attach-btn { color: var(--text2); }
  body.ntcom-layout .model-bar .mb-chip { color: var(--text2); }
  :root:not([data-theme="light"]) body.ntcom-layout .hud-voice {
    background: color-mix(in srgb, var(--bg2) 88%, white);
    border-color: color-mix(in srgb, var(--text) 24%, transparent);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  }
}

/* ===== NTCOM ntcom.41: chat bubbles, claude.ai style (all screens) =====
   Answers sit on the page: no frame, no background, no inner padding. The owner's own messages
   keep their tinted background but lose the border. */
body.ntcom-layout .msg-javis .bubble {
  background: transparent; border: 0; border-radius: 0; padding: 2px 0; box-shadow: none; max-width: 100%;
}
body.ntcom-layout .msg-user .bubble { border: 0; }

/* ===== NTCOM ntcom.42: Obsidian-style graph panel (ntcom-graph.js) ===== */
@media (min-width: 861px) {
  body.ntcom-layout .nt-gpanel {
    display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden;
    background: var(--bg2); border-left: 1px solid var(--border); padding: 10px 12px 16px; position: relative;
  }
  body.ntcom-layout.ngp-thu .nt-gpanel { padding: 0; border: 0; overflow: visible; }
  body.ntcom-layout.ngp-thu .nt-gpanel > :not(.ngp-expand) { display: none; }
  .ngp-expand { display: none; }
  body.ntcom-layout.ngp-thu .nt-gpanel > .ngp-expand {
    display: flex; position: absolute; top: 12px; right: 12px; z-index: 8; width: 34px; height: 34px;
    align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--border);
    background: var(--bg2); color: var(--text2); cursor: pointer; box-shadow: var(--shadow-1);
  }
  body.ntcom-layout.ngp-thu .nt-gpanel > .ngp-expand svg { width: 17px; height: 17px; }
  /* The graph's own eye / timelapse buttons sit where the open-panel button goes. */
  body.ntcom-layout.ngp-thu .hud-center .brain-overlay-toggle { right: 56px; }
}
.ngp-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ngp-count { flex: 1 1 auto; color: var(--text3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ngp-top .mini-btn { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-color: transparent; }
.ngp-top .mini-btn svg { width: 15px; height: 15px; }
.ngp-sec { border-top: 1px solid var(--border); padding: 4px 0 6px; }
.ngp-head { display: flex; align-items: center; }
.ngp-toggle {
  flex: 1; display: flex; align-items: center; gap: 6px; padding: 8px 2px; border: 0; background: none;
  color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: left;
}
.ngp-car { display: inline-block; width: 10px; font-size: 10px; color: var(--text3); transition: transform .15s; }
.ngp-sec.open .ngp-car { transform: rotate(90deg); }
.ngp-body { display: none; padding: 2px 0 4px; }
.ngp-sec.open .ngp-body { display: block; }
.ngp-search {
  display: flex; align-items: center; gap: 6px; padding: 6px 9px; margin-bottom: 6px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text3);
}
.ngp-search svg { width: 14px; height: 14px; flex: none; }
.ngp-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.ngp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; color: var(--text2); cursor: pointer; }
.ngp-sw {
  appearance: none; -webkit-appearance: none; flex: none; width: 32px; height: 18px; margin: 0; border-radius: 9px;
  background: color-mix(in srgb, var(--text) 22%, transparent); position: relative; cursor: pointer; transition: background .15s;
}
.ngp-sw::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s;
}
.ngp-sw:checked { background: var(--accent-solid); }
.ngp-sw:checked::after { transform: translateX(14px); }
.ngp-sl { display: flex; flex-direction: column; gap: 2px; padding: 5px 0; color: var(--text2); }
.ngp-sl input[type="range"] { width: 100%; accent-color: var(--accent-solid); }
.ngp-btn {
  width: 100%; margin: 8px 0 2px; padding: 7px 10px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--accent-solid); color: var(--on-accent, #fff); font: inherit; font-weight: 600;
}
.ngp-btn:hover { opacity: .9; }
.ngp-grp { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.ngp-gq {
  flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg); color: var(--text); font: inherit; outline: 0;
}
.ngp-gq:focus { border-color: var(--accent-line); }
.ngp-gc { flex: none; width: 26px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: none; cursor: pointer; }
.ngp-gc::-webkit-color-swatch-wrapper { padding: 2px; }
.ngp-gc::-webkit-color-swatch { border: 0; border-radius: 50%; }
.ngp-gx { flex: none; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--text3); cursor: pointer; border-radius: 6px; }
.ngp-gx:hover { color: var(--text); background: var(--surface-2, rgba(127,127,127,.12)); }
.ngp-gx svg { width: 14px; height: 14px; }

/* ===== NTCOM ntcom.42: model chip INSIDE the composer's tool row on the Trò chuyện page =====
   On the old home grid the chip shared the composer's grid cell. The chat page slot is a flex
   column (gap 10px), so the chip goes AFTER the composer and is pulled up into its bottom row. */
@media (min-width: 861px) {
  body.ntcom-layout .chatpage-main:not(.edit-on) > .chatpage-slot > .hud-voice { order: 1; }
  body.ntcom-layout .chatpage-main:not(.edit-on) > .chatpage-slot > .model-bar {
    order: 2; align-self: center; justify-self: auto; display: flex; justify-content: flex-end;
    width: min(860px, calc(100% - 48px)); max-width: none; box-sizing: border-box;
    margin: -61px 0 37px; padding: 0 54px 0 0; position: relative; z-index: 3; pointer-events: none;
  }
  body.ntcom-layout .chatpage-main:not(.edit-on) > .chatpage-slot > .model-bar > * { pointer-events: auto; }
}

/* ===== NTCOM ntcom.43: phone drawer "Hệ thống" keeps only the brain picker and "+" =====
   The delete-brain button, the external-folder button and the "N note · M kết nối" line are
   hidden like on the desktop top bar. Deleting a brain moved to the "Cấu hình" menu. */
.rail-sys .navbar-brain #delBrainBtn,
.rail-sys .navbar-brain #pickFolderBtn,
.rail-sys .navbar-brain #graphStats { display: none !important; }
.ntc-mi.ntc-danger, .ntc-mi.ntc-danger svg { color: var(--red, #e5484d); }

/* ===== NTCOM ntcom.44: flat sections inside the Cấu hình dialog (claude.ai settings look) =====
   Cards of the Account / Share / Settings pages lose their frame, shadow, glass and hover lift;
   fields and buttons inside keep their own look. Separation comes from the section titles. */
body.ntc-open .cview-body .gcard,
body.ntc-open .cview-body .gcard:hover,
body.ntc-open .cview-body .gcard.current,
body.ntc-open .cview-body .settings-group,
body.ntc-open .cview-body .settings-card,
body.ntc-open .cview-body .qs-block,
body.ntc-open .cview-body .upd-card,
body.ntc-open .cview-body .tk-hero,
body.ntc-open .cview-body .tk-a {
  border: 0; box-shadow: none; background: transparent; transform: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  padding-left: 0; padding-right: 0; border-radius: 0;
}

/* ===== NTCOM ntcom.48: coloured rail icons (each item its own colour on a tinted tile) ===== */
.rail-item[data-id="chat"]          { --ri: #2563eb; }
.rail-item[data-id="workspace"]     { --ri: #7c3aed; }
.rail-item[data-id="conversations"] { --ri: #0891b2; }
.rail-item[data-id="home"]          { --ri: #db2777; }
.rail-item[data-id="notes"]         { --ri: #d97706; }
.rail-item[data-id="files"]         { --ri: #16a34a; }
.rail-item[data-id="qr"]            { --ri: #475569; }
.rail-item[data-id="kanban"]        { --ri: #0d9488; }
.rail-item[data-id="selfimprove"]   { --ri: #ea580c; }
.rail-item[data-id="terminal"]      { --ri: #334155; }
.rail-item[data-id="coding"]        { --ri: #4f46e5; }
.rail-item[data-id="plugins"]       { --ri: #c026d3; }
.rail-item[data-id="skills"]        { --ri: #ca8a04; }
.rail-item[data-id="learn"]         { --ri: #e11d48; }
.rail-item[data-id="models"]        { --ri: #0284c7; }
.rail-item[data-id="mcp"]           { --ri: #65a30d; }
.rail-item[data-id="channels"]      { --ri: #9333ea; }
.rail-group[data-grp="hoi_thoai"]   { --rg: #2563eb; }
.rail-group[data-grp="nang_suat"]   { --rg: #d97706; }
.rail-group[data-grp="lap_trinh"]   { --rg: #4f46e5; }
.rail-group[data-grp="cau_hinh_ai"] { --rg: #64748b; }
:root:not([data-theme="light"]) .rail-item[data-id="terminal"],
:root:not([data-theme="light"]) .rail-item[data-id="qr"] { --ri: #94a3b8; }
body.ntcom-layout .rail-item[data-id] .rail-ico {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  color: var(--ri, var(--text2));
  background: color-mix(in srgb, var(--ri, var(--text2)) 13%, transparent);
}
body.ntcom-layout .rail-item[data-id] .rail-ico svg { width: 16px; height: 16px; }
body.ntcom-layout .rail-item[data-id].active .rail-ico {
  color: #fff; background: var(--ri, var(--accent-solid));
}
body.ntcom-layout .rail-group[data-grp] .rail-grp-ico { color: var(--rg, var(--text2)); }
/* Always-open groups: no caret (they cannot be folded). */
body.ntcom-layout .rail-group[data-grp="hoi_thoai"] > .rail-grp-lbl::before,
body.ntcom-layout .rail-group[data-grp="nang_suat"] > .rail-grp-lbl::before { visibility: hidden; }
body.ntcom-layout .rail-group[data-grp="hoi_thoai"] > .rail-grp-lbl,
body.ntcom-layout .rail-group[data-grp="nang_suat"] > .rail-grp-lbl { cursor: default; }

/* ntcom.49: chữ gợi ý ô chat màu xám, mọi khổ màn hình và mọi theme */
.voice-input::placeholder, #chatInput::placeholder { color: #9ca3af; opacity: 1; }

/* ntcom.50: thẻ Kỹ năng - tên 14px, chú thích 12px xám, dàn đều hai bên và kín bề ngang thẻ.
   Hàng nút (Chọn/Sửa/Xuất/Xoá) nổi ở góc phải khi rê chuột thay vì giữ chỗ một cột,
   nên chú thích không còn bị bóp hẹp ở skill có nhiều nút. */
body.ntcom-layout .sk2-card { position: relative; }
body.ntcom-layout .sk2-info .nm { font-size: 14px; }
body.ntcom-layout .sk2-info .ds { font-size: 12px; line-height: 1.55; color: #8b9099; text-align: justify; hyphens: auto; }
body.ntcom-layout .sk2-info .gp { font-size: 12px; color: #8b9099; }
@media (min-width: 861px) {
  body.ntcom-layout .sk2-act { position: absolute; top: 8px; right: 10px; padding: 3px; border-radius: 8px; background: var(--bg); }
  body.ntcom-layout .sk2-card:not(:hover) .sk2-act { pointer-events: none; }
}

/* ntcom.51: nút đang BẬT / đang chọn (dấu ● và chữ) màu xanh lá, cả nền sáng và tối */
html body .si-chip.sel { color: #16a34a; border-color: #22c55e; background: rgba(34, 197, 94, 0.12); }
:root:not([data-theme="light"]) body .si-chip.sel { color: #4ade80; }
:root[data-theme="dark"] body .si-chip.sel { color: #4ade80; }

/* ntcom.52: trang Bộ nhớ dài hạn dùng đúng cỡ chữ thanh menu (13px), chú thích nhỏ hơn 1px (12px).
   Trang gốc viết cỡ chữ inline (14, 13.5, 15px...) nên phải dùng !important. */
#cview[data-page="learn"] .cview-body,
#cview[data-page="learn"] .cview-body * { font-size: var(--nt-fs, 13px) !important; }
#cview[data-page="learn"] .cview-body .dim,
#cview[data-page="learn"] .cview-body .dim *,
#cview[data-page="learn"] .cview-body .si-log p,
#cview[data-page="learn"] .cview-body .si-log ol,
#cview[data-page="learn"] .cview-body .si-log ol * { font-size: 12px !important; }
#cview[data-page="learn"] .cview-body .si-chip { padding: 5px 12px; }
#cview[data-page="learn"] .cview-body .si-field > label { color: var(--text2); font-weight: 600; }

/* ntcom.58: bảng chọn EMOJI cho linh vật (Cài đặt > Emoji, avatar trợ lý) */
.pet-picker[data-pet-part="shapes"] { display: block; }
.emo-dau { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.emo-dang { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text3); min-width: 0; }
.emo-dang b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.emo-dang-anh img { width: 28px; height: 28px; display: block; }
.emo-tim { width: 100%; box-sizing: border-box; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg, transparent); color: var(--text); font: inherit; font-size: 14px; margin-bottom: 8px; }
.emo-nhom { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.emo-nhom::-webkit-scrollbar { display: none; }
.emo-nhom button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--text2); font: inherit; font-size: 12.5px; cursor: pointer; }
.emo-nhom button img { width: 18px; height: 18px; }
.emo-nhom button[aria-selected="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-wash, rgba(31,95,191,.12)); }
.emo-luoi { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; max-height: 340px; overflow-y: auto;
  padding: 4px; border-radius: 12px; border: 1px solid var(--border); margin-top: 4px; overscroll-behavior: contain; }
.emo-o { border: 0; background: transparent; border-radius: 10px; padding: 5px; cursor: pointer; aspect-ratio: 1; }
.emo-o img { width: 100%; height: 100%; display: block; }
.emo-o:hover { background: var(--surface-2, rgba(127,127,127,.1)); }
.emo-o[aria-pressed="true"] { background: var(--accent-wash, rgba(31,95,191,.16)); box-shadow: inset 0 0 0 2px var(--accent); }
.emo-cho { grid-column: 1 / -1; padding: 16px; text-align: center; color: var(--text3); font-size: 13px; }
@media (max-width: 860px) { .emo-luoi { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); max-height: 300px; } .emo-tim { font-size: 16px; } }
