/* ---------- Font: Inter (self-host, on-prem) ---------- */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/vendor/fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/vendor/fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/vendor/fonts/inter-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+1EA0-1EF9,U+20AB;
}

:root {
  --bg: #0b0f14;
  --bg-2: #0f151d;
  --panel: #131b26;
  --panel-2: #182231;
  --border: #232f3e;
  --border-2: #2c3a4d;
  --text: #e8eef5;
  --muted: #8494a6;
  --accent: #4f8cff;
  --accent-2: #6ea8ff;
  --accent-soft: rgba(79, 140, 255, 0.14);
  --ok: #34d399;
  --warn: #fbbf24;
  --error: #f87171;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  background: radial-gradient(1200px 800px at 80% -10%, #16202e 0%, var(--bg) 55%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { letter-spacing: -0.02em; font-weight: 700; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.9em; }
.error { color: var(--error); font-size: 0.9em; min-height: 1em; margin: 0; }

/* ---------- Controls ---------- */
input, select, button, textarea {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
button {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border: none; color: #fff; cursor: pointer; font-weight: 600;
  box-shadow: 0 2px 8px rgba(79,140,255,.25);
}
button:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button.ghost { background: transparent; border: 1px solid var(--border-2); color: var(--muted); box-shadow: none; }
button.danger { background: transparent; border: 1px solid var(--error); color: var(--error); padding: 5px 12px; box-shadow: none; }
button.danger:hover { background: rgba(248,113,113,.1); }
.chk { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.chk input { width: auto; }

/* ---------- Login ---------- */
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px; width: 360px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow);
}
.card h1 { margin: 0; font-size: 1.35em; }
.brand-lg { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.brand-lg p { margin: 2px 0 0; }
.logo {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(79,140,255,.4);
}

/* ---------- App shell ---------- */
.app-shell { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; font-weight: 700; font-size: 1.05em; }
.brand .logo { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }
nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
nav a {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); text-decoration: none; padding: 10px 12px;
  border-radius: 10px; cursor: pointer; font-weight: 500; font-size: 0.95em;
  transition: background .12s, color .12s;
}
nav a .nav-ico { display: inline-flex; width: 18px; height: 18px; opacity: .9; }
nav a .nav-ico svg { width: 18px; height: 18px; }
nav a:hover { background: var(--panel); color: var(--text); }
nav a.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.sidebar-footer {
  display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px;
  border-top: 1px solid var(--border); margin-top: 8px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  background: var(--panel-2); border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center; font-weight: 700; text-transform: uppercase;
}
.whoami-box { flex: 1; min-width: 0; }
.whoami { display: block; font-size: 0.85em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: transparent; border: none; color: var(--muted); box-shadow: none; font-size: 18px; padding: 6px; }
.icon-btn:hover { color: var(--error); }

/* language switch */
.lang-switch { display: flex; gap: 4px; padding: 8px; }
.center-row { justify-content: center; }
.lang-btn {
  flex: 1; padding: 6px 10px; font-size: 0.82em; font-weight: 700; letter-spacing: .5px;
  background: transparent; border: 1px solid var(--border-2); color: var(--muted); box-shadow: none;
}
.lang-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.card .lang-switch { padding: 0; }
.card .lang-btn { flex: 0 0 auto; min-width: 54px; }

/* ---------- Content ---------- */
.content { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar {
  display: flex; align-items: baseline; gap: 12px;
  padding: 18px 28px; border-bottom: 1px solid var(--border); background: rgba(15,21,29,.5);
  backdrop-filter: blur(8px);
}
.topbar h2 { margin: 0; font-size: 1.2em; }
.page-body { flex: 1; min-height: 0; display: flex; }
.page { flex: 1; min-width: 0; overflow: auto; padding: 24px 28px; }
.page.hidden { display: none !important; }
.section-h { margin: 28px 0 8px; font-size: 1.05em; }

/* ---------- Chat ---------- */
.chat-page { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 28px clamp(16px, 8vw, 120px); display: flex; flex-direction: column; gap: 22px; }
.chat-empty { margin: auto; text-align: center; max-width: 460px; }
.chat-empty-logo { display: inline-flex; color: var(--accent); }
.chat-empty-logo svg { width: 46px; height: 46px; stroke-width: 1.6; }
.chat-empty h3 { margin: 10px 0 6px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.suggestion {
  padding: 8px 14px; border: 1px solid var(--border-2); border-radius: 999px;
  background: var(--panel); color: var(--text); cursor: pointer; font-size: .88em;
}
.suggestion:hover { border-color: var(--accent); color: var(--accent-2); }

.msg { display: flex; gap: 12px; max-width: 820px; width: 100%; margin: 0 auto; animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg .msg-avatar {
  width: 32px; height: 32px; border-radius: 9px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
}
.msg.user .msg-avatar { background: var(--panel-2); border: 1px solid var(--border-2); }
.msg.bot .msg-avatar { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; }
.msg .bubble {
  padding: 13px 16px; border-radius: 14px; line-height: 1.6; white-space: pre-wrap;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot .bubble { background: var(--panel); border: 1px solid var(--border); border-bottom-left-radius: 4px; }

/* typing indicator */
.typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.3s infinite both; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes caret { 50% { opacity: 0; } }

/* markdown trong câu trả lời */
.msg.bot .bubble p { margin: 0 0 8px; }
.msg.bot .bubble p:last-child { margin-bottom: 0; }
.msg.bot .bubble ul, .msg.bot .bubble ol { margin: 6px 0 8px; padding-left: 22px; }
.msg.bot .bubble li { margin: 3px 0; }
.msg.bot .bubble strong { font-weight: 700; color: #fff; }
.msg.bot .bubble code { background: var(--bg-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-family: ui-monospace, Menlo, monospace; font-size: .9em; }
.msg.bot .bubble pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.msg.bot .bubble pre code { border: none; padding: 0; background: none; }
.msg.bot .bubble h4 { margin: 10px 0 6px; font-size: 1em; }
.msg.bot .bubble a { color: var(--accent-2); }
.stream-cursor { display: inline-block; width: 7px; height: 1em; background: var(--accent); margin-left: 2px; vertical-align: text-bottom; border-radius: 1px; animation: caret 1s step-start infinite; }
.msg-actions { margin-top: 10px; display: flex; gap: 6px; opacity: .55; transition: opacity .15s; }
.msg:hover .msg-actions { opacity: 1; }
.ibtn-sm { width: 30px; height: 30px; }
.ibtn-sm svg { width: 16px; height: 16px; }

/* sources */
.sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.src-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 6px; border: 1px solid var(--border-2); border-radius: 10px;
  background: var(--bg-2); cursor: pointer; font-size: .84em; color: var(--text);
  transition: border-color .12s, transform .12s;
}
.src-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.src-chip .ftype {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: #fff; letter-spacing: .3px;
}
.src-chip .src-meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.src-chip .src-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-chip .src-dep { color: var(--muted); font-size: .8em; }
.src-chip .ext-open { color: var(--muted); margin-left: 2px; }
/* file type colors */
.ft-pdf { background: #e2574c; }
.ft-doc { background: #2b7cd3; }
.ft-xls { background: #1f9d55; }
.ft-ppt { background: #d24726; }
.ft-txt { background: #64748b; }
.ft-csv { background: #0e9f6e; }
.ft-img { background: #a855f7; }
.ft-def { background: #475569; }

/* chat input */
.chat-input {
  display: flex; align-items: flex-end; gap: 10px;
  padding: 14px clamp(16px, 8vw, 120px) 22px; border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, var(--bg-2) 40%);
}
.chat-input textarea {
  flex: 1; resize: none; max-height: 180px; line-height: 1.5; border-radius: 14px;
  padding: 12px 14px; background: var(--panel);
}
.chat-input button {
  width: 46px; height: 46px; border-radius: 13px; padding: 0; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.chat-input button:disabled { opacity: .5; cursor: default; }

/* ---------- Panels / tables / forms ---------- */
.card-panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > input:not([type=file]):not([type=number]):not([type=checkbox]), .row > select { min-width: 160px; }
.row > input[type=file] { flex: 1; min-width: 200px; }

.data-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 0.9em; }
.data-table thead th { color: var(--muted); font-weight: 600; background: var(--bg-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--panel-2); }
.data-table code { color: var(--accent-2); }
.tok-val[data-shown="1"] { word-break: break-all; color: var(--ok); }

.note-box { margin: 12px 0 0; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; line-height: 1.5; }
.token-reveal { background: rgba(52,211,153,.08); border: 1px solid var(--ok); border-radius: 10px; padding: 12px; margin-top: 12px; word-break: break-all; }
.token-reveal code { color: var(--ok); }
.badge-ready { color: var(--ok); font-weight: 600; }
.badge-failed { color: var(--error); font-weight: 600; }
.badge-ingesting { color: var(--warn); }
.doc-cell { display: flex; align-items: center; gap: 10px; }

/* ---------- Labeled form grid ---------- */
.form-grid { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: flex-start; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: .78em; color: var(--muted); font-weight: 600; letter-spacing: .01em; }
.field > input, .field > select { min-width: 180px; }
.field-hint { font-size: .76em; color: var(--muted); max-width: 230px; line-height: 1.4; }
.field-btn label { user-select: none; }
.field-btn button { height: 42px; }
.field > input, .field > select { height: 42px; }

/* ---------- Token reveal (eye + copy) ---------- */
.tr-label { margin-bottom: 8px; color: var(--muted); font-size: .9em; }
.tr-row { display: flex; align-items: center; gap: 8px; }
.tr-row code { flex: 1; background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 8px; padding: 9px 12px; color: var(--ok); font-family: ui-monospace, "SF Mono", Menlo, monospace; word-break: break-all; }
.tr-act { border: 1px solid var(--border-2) !important; border-radius: 9px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: transparent; flex: 0 0 auto; }
.tr-act:hover { color: var(--accent-2); border-color: var(--accent) !important; }
.tr-act svg { width: 18px; height: 18px; }

/* ---------- Graph toolbar ---------- */
.graph-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tb-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; }
.tb-btn .tb-ico { display: inline-flex; width: 16px; height: 16px; }
.tb-btn .tb-ico svg { width: 16px; height: 16px; }
.tb-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tb-sep { width: 1px; height: 22px; background: var(--border-2); }
.pg-hint { font-size: .86em; }

/* ---------- Icon action buttons ---------- */
.ibtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--border-2); color: var(--text); box-shadow: none;
}
.ibtn svg { width: 22px; height: 22px; stroke-width: 2.1; }
.ibtn:hover { color: var(--accent-2); border-color: var(--accent); background: var(--accent-soft); }
.ibtn.danger { color: var(--error); }
.ibtn.danger:hover { color: #fff; border-color: var(--error); background: var(--error); }
.row-actions { display: inline-flex; gap: 8px; }

/* leading icon inside primary/text buttons */
button:has(.btn-ico) { display: inline-flex; align-items: center; gap: 8px; }
.btn-ico { display: inline-flex; width: 16px; height: 16px; }
.btn-ico svg { width: 16px; height: 16px; }

/* ---------- Permission graph (SVG tự dựng) ---------- */
#perm-canvas {
  position: relative; width: 100%; height: 500px;
  background:
    radial-gradient(circle, #1a2432 1px, transparent 1px) 0 0 / 26px 26px, var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  margin-bottom: 18px; user-select: none; touch-action: none;
}
.perm-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.pm-edge { stroke: #4f8cff; stroke-width: 2.5; pointer-events: none; transition: stroke .12s, stroke-width .12s; }
.pm-edge.pm-hover { stroke: #6ea8ff; stroke-width: 3.5; }
.pm-edge.pm-selected { stroke: #f87171; stroke-width: 4; }
.pm-hit { stroke: transparent; stroke-width: 22; fill: none; pointer-events: stroke; cursor: pointer; }
.pm-tmp { stroke: #9ca3af; stroke-width: 2; stroke-dasharray: 6 4; pointer-events: none; }
.pnode {
  position: absolute; z-index: 2; min-width: 104px; max-width: 130px; padding: 10px 12px;
  background: var(--panel); border: 1.5px solid var(--accent); border-radius: 11px;
  text-align: center; cursor: grab; box-shadow: 0 3px 12px rgba(0,0,0,.4);
}
.pnode:active { cursor: grabbing; }
.pnode-name { font-weight: 600; font-size: .92em; line-height: 1.2; }
.pnode-code { font-size: .74em; color: var(--muted); margin-top: 2px; }
.pnode.drop-target { border-color: var(--ok); box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
.pnode.pnode-active { border-color: var(--accent-2); }
.pnode-handle {
  position: absolute; right: -12px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: crosshair;
  box-shadow: 0 2px 6px rgba(0,0,0,.4); z-index: 3;
}
.pnode-handle svg { width: 15px; height: 15px; }
.pnode-handle:hover { background: var(--accent-2); transform: translateY(-50%) scale(1.12); }
/* popover xóa kết nối */
.edge-pop {
  position: absolute; z-index: 6; transform: translateX(0);
  background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 10px;
  padding: 10px 12px; box-shadow: var(--shadow); min-width: 180px;
  display: flex; flex-direction: column; gap: 8px;
}
.edge-pop .ep-title { font-size: .9em; }
.edge-pop .ep-title code { color: var(--accent-2); }
.edge-pop .ep-del {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; border: 1px solid var(--error); color: var(--error); box-shadow: none; padding: 8px 12px; font-weight: 600;
}
.edge-pop .ep-del svg { width: 16px; height: 16px; }
.edge-pop .ep-del:hover { background: var(--error); color: #fff; }

/* ---------- Upload dropzone ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 34px 20px; border: 2px dashed var(--border-2); border-radius: 14px;
  background: var(--bg-2); cursor: pointer; text-align: center; transition: border-color .15s, background .15s;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dz-ico { color: var(--accent-2); }
.dz-ico svg { width: 34px; height: 34px; }
.dz-text { font-size: 1em; }
.dz-text strong { color: var(--accent-2); }
.dz-types { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
.dz-types .ftype {
  width: auto; height: auto; padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 800;
  color: #fff; display: inline-flex; align-items: center;
}
.dz-selected {
  display: flex; align-items: center; gap: 12px; margin-top: 14px;
  padding: 10px 12px; background: var(--panel); border: 1px solid var(--border-2); border-radius: 10px;
}
.dz-selected .ftype { width: 34px; height: 34px; border-radius: 8px; font-size: 9px; font-weight: 800; color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.dz-selected .dz-meta { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.dz-selected .dz-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-err { color: var(--error); }

/* ---------- Toast (thu hồi + hoàn tác) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  display: flex; align-items: center; gap: 14px;
  background: var(--panel-2); border: 1px solid var(--border-2); border-radius: 12px;
  padding: 12px 16px; box-shadow: var(--shadow); z-index: 1000;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-undo { background: transparent; border: none; color: var(--accent-2); font-weight: 700; box-shadow: none; padding: 4px 6px; }
.toast-undo:hover { text-decoration: underline; }

/* ---------- Level badge (chiều DỌC) ---------- */
.lvl { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78em; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.lvl-1 { background: rgba(52,211,153,.14); color: #34d399; border-color: rgba(52,211,153,.4); }
.lvl-2 { background: rgba(79,140,255,.14); color: #6ea8ff; border-color: rgba(79,140,255,.4); }
.lvl-3 { background: rgba(251,191,36,.14); color: #fbbf24; border-color: rgba(251,191,36,.4); }
.lvl-4 { background: rgba(248,113,113,.16); color: #f87171; border-color: rgba(248,113,113,.5); }
.inline-lbl { color: var(--muted); font-size: .9em; }

.new-badge { display:inline-block; margin-left:6px; padding:1px 7px; border-radius:999px; font-size:.72em; font-weight:700; background:rgba(52,211,153,.16); color:#34d399; border:1px solid rgba(52,211,153,.45); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #3a4a5f; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 720px) {
  .app-shell { grid-template-columns: 64px 1fr; }
  .brand span, nav a span:not(.nav-ico), .whoami-box { display: none; }
}
