/* LiveBridge Admin · plain CSS (no build) · dark console per UI v7 */
:root {
  --bg: #070B10;
  --panel: #0D131B;
  --card: #111923;
  --card2: #0F1620;
  --line: #1E293B;
  --line-soft: rgba(30, 41, 59, .65);
  --text: #F8FAFC;
  --muted: #CBD5E1;
  --dim: #A7B7CA;
  --green: #22C55E;
  --green-soft: #4ADE80;
  --blue: #3B82F6;
  --blue-soft: #60A5FA;
  --amber: #F59E0B;
  --amber-soft: #FCD34D;
  --red: #EF4444;
  --red-soft: #FCA5A5;
  --radius: 10px;
  --radius-lg: 12px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: rgba(34, 197, 94, .28); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #243247; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #33445e; background-clip: padding-box; }
:focus-visible { outline: 2px solid var(--blue-soft); outline-offset: 2px; }

/* ---------- generic ---------- */
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; flex: none; }
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }
.dot-blue { background: var(--blue); }
.dot-gray { background: var(--dim); }
.tiny { font-size: 11px; color: var(--dim); line-height: 1.6; }
.muted { color: var(--muted); }
.green { color: var(--green-soft); }
.amber { color: var(--amber-soft); }
.red { color: var(--red-soft); }
.blue { color: var(--blue-soft); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }

.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, .22);
  border-top-color: var(--green);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(10px); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 9px;
  border: 1px solid transparent; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, transform .05s;
  background: transparent;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #2EE06A, #16A34A); color: #04170A; box-shadow: 0 6px 16px rgba(34, 197, 94, .15); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #4BEB7D, #1BB253); }
.btn-blue { background: linear-gradient(180deg, #60A5FA, #3B82F6); color: #fff; box-shadow: 0 6px 16px rgba(59, 130, 246, .16); }
.btn-blue:hover:not(:disabled) { filter: brightness(1.06); }
.btn-ghost { background: var(--card); border-color: var(--line); color: #CBD5E1; }
.btn-ghost:hover:not(:disabled) { background: #17212E; border-color: #2B3A50; color: var(--text); }
.btn-danger { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .34); color: var(--red-soft); }
.btn-danger:hover:not(:disabled) { background: rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .5); }
.btn-slim { height: 28px; padding: 0 10px; font-size: 11px; border-radius: 7px; font-weight: 600; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 10px; border-radius: 6px; font-weight: 600; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 11px; border-radius: 7px; font-weight: 700; }
.btn-block { width: 100%; height: 40px; }
.btn-icon {
  width: 32px; height: 32px; padding: 0; border-radius: 9px;
  background: var(--card); border-color: var(--line); color: var(--muted); font-size: 14px;
}
.btn-icon:hover:not(:disabled) { color: var(--text); border-color: #334155; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .42; cursor: not-allowed; filter: saturate(.35); box-shadow: none;
}
.btn-wrap { display: inline-flex; align-items: center; gap: 4px; }
.btn-loading { pointer-events: none; opacity: .7; }

.link { color: var(--blue-soft); background: none; border: 0; padding: 0; font-size: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }
a.link { display: inline-flex; align-items: center; gap: 3px; }

/* ---------- chips / tags / flags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  font-size: 10px; line-height: 1; padding: 4px 7px; border-radius: 5px;
  background: rgba(255, 255, 255, .05); color: var(--muted);
  border: 1px solid rgba(255, 255, 255, .055); white-space: nowrap;
}
.tag.green { background: rgba(34, 197, 94, .12); color: #86EFAC; border-color: rgba(34, 197, 94, .17); }
.tag.amber { background: rgba(245, 158, 11, .12); color: #FCD34D; border-color: rgba(245, 158, 11, .17); }
.tag.red { background: rgba(239, 68, 68, .12); color: #FCA5A5; border-color: rgba(239, 68, 68, .17); }
.tag.blue { background: rgba(59, 130, 246, .12); color: #93C5FD; border-color: rgba(59, 130, 246, .17); }
.tag.gray { color: var(--muted); }
.tag .dot { width: 5px; height: 5px; }
.tag.sm { font-size: 9px; padding: 3px 5px; }

.flag {
  width: 20px; height: 14px; border-radius: 3px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 7.5px; font-weight: 800; letter-spacing: .02em; color: #fff;
  background: #475569;
}
.flag.f-id { background: linear-gradient(180deg, #E11D48, #BE123C); }
.flag.f-th { background: linear-gradient(180deg, #2563EB, #1E40AF); }
.flag.f-vn { background: linear-gradient(180deg, #DC2626, #991B1B); }
.flag.f-my { background: linear-gradient(180deg, #0EA5E9, #0369A1); }
.flag.f-ph { background: linear-gradient(180deg, #F59E0B, #B45309); }
.flag.f-sg { background: linear-gradient(180deg, #A855F7, #6B21A8); }
.flag.f-tw { background: linear-gradient(180deg, #14B8A6, #0F766E); }
.flag.f-id2 { background: linear-gradient(180deg, #F43F5E, #9F1239); }
.flag.f-other { background: linear-gradient(180deg, #64748B, #334155); }

.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  appearance: none; border: 1px solid var(--line); background: rgba(255, 255, 255, .035);
  color: var(--muted); border-radius: 999px; padding: 4px 9px; font-size: 10px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: all .15s;
}
.chip:hover { color: var(--text); border-color: #334155; }
.chip.on { background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .32); color: #BBF7D0; }
.chip .flag { width: 16px; height: 11px; font-size: 6px; border-radius: 2px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.field > span:first-child { font-weight: 600; color: #CBD5E1; }
.input, .select, .textarea {
  width: 100%; height: 36px; background: var(--card2); border: 1px solid var(--line);
  border-radius: 8px; color: var(--text); font-size: 12px; padding: 0 10px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 9px 10px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: rgba(59, 130, 246, .7); box-shadow: 0 0 0 3px rgba(59, 130, 246, .12);
}
.input:disabled, .select:disabled, .textarea:disabled { opacity: .55; cursor: not-allowed; }
.select {
  appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394A3B8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
select option { background: #0D131B; color: var(--text); }
.input-group { position: relative; display: block; }
.input-group .input { padding-right: 56px; }
.input-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--dim); font-size: 10.5px;
  cursor: pointer; padding: 4px 5px; border-radius: 5px;
}
.input-eye:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.check input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--green); cursor: pointer; }
.form-error {
  border: 1px solid rgba(239, 68, 68, .32); background: rgba(239, 68, 68, .09);
  color: var(--red-soft); border-radius: 8px; padding: 8px 10px; font-size: 11.5px; line-height: 1.5;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.form-note { font-size: 10.5px; color: var(--dim); line-height: 1.6; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 34px; height: 19px; border-radius: 99px; background: #243247;
  position: relative; transition: background .15s; flex: none;
}
.switch .track::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #94A3B8; transition: transform .15s, background .15s;
}
.switch input:checked + .track { background: rgba(34, 197, 94, .38); }
.switch input:checked + .track::after { transform: translateX(15px); background: #4ADE80; }
.switch input:focus-visible + .track { outline: 2px solid var(--blue-soft); outline-offset: 2px; }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-card {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 9px; padding: 10px 11px; cursor: pointer; background: var(--card2);
}
.radio-card:hover { border-color: #334155; }
.radio-card input { accent-color: var(--green); }
.radio-card .rc-main { flex: 1; min-width: 0; }
.radio-card .rc-name { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.radio-card .rc-sub { font-size: 10px; color: var(--dim); margin-top: 2px; }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(60% 50% at 50% 30%, #0D1A15 0%, #070B10 65%); z-index: 900;
}
.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 24px; }
.boot-mark {
  width: 54px; height: 54px; border-radius: 15px;
  background: linear-gradient(180deg, #2EE06A, #16A34A); color: #04170A;
  font-size: 20px; font-weight: 900; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 40px rgba(34, 197, 94, .22);
}
.boot-brand { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.boot-text { font-size: 11.5px; color: var(--dim); }
.boot-error { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 420px; }
.boot-error p { font-size: 11.5px; color: var(--red-soft); line-height: 1.6; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); }
.login-aside {
  position: relative; overflow: hidden; display: flex; align-items: stretch;
  background:
    radial-gradient(70% 60% at 15% 10%, rgba(34, 197, 94, .16), transparent 60%),
    radial-gradient(50% 50% at 80% 90%, rgba(59, 130, 246, .12), transparent 60%),
    linear-gradient(160deg, #0B1410 0%, #070B10 55%, #080D13 100%);
  border-right: 1px solid var(--line);
}
.login-aside::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(148, 163, 184, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, .035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(60% 60% at 40% 40%, #000 20%, transparent 75%);
}
.login-aside-inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 34px; padding: 42px 48px; width: 100%; }
.login-logo { padding: 0; }
.login-hero h2 { font-size: 34px; line-height: 1.22; letter-spacing: -.025em; font-weight: 800; margin-top: auto; }
.login-hero p { margin-top: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.8; max-width: 460px; }
.login-points { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.login-points li { display: flex; gap: 9px; align-items: flex-start; font-size: 11.5px; color: #CBD5E1; line-height: 1.6; }
.login-points .tick { color: var(--green); font-weight: 800; }
.login-badge {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 10.5px; color: var(--muted); border: 1px solid var(--line);
  background: rgba(15, 22, 32, .7); border-radius: 999px; padding: 6px 10px;
}
.login-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 28px; }
.login-card { width: min(384px, 100%); display: flex; flex-direction: column; gap: 14px; }
.login-card-head { margin-bottom: 8px; }
.login-card-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.login-card-head p { margin-top: 6px; font-size: 11.5px; color: var(--dim); }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.login-help { font-size: 10.5px; color: var(--dim); }
.login-note {
  font-size: 10.5px; color: var(--dim); line-height: 1.65; border-top: 1px solid var(--line);
  padding-top: 12px; margin-top: 2px;
}
.login-foot { position: absolute; bottom: 20px; font-size: 11px; color: var(--dim); }
.login .input-group .input { height: 40px; }
.login .field .input { height: 40px; }
.login .btn-block { font-size: 13px; }

/* ---------- app shell ---------- */
.app { height: 100vh; height: 100dvh; display: flex; overflow: hidden; }
.side {
  width: 224px; flex: none; display: flex; flex-direction: column; min-height: 0;
  background: linear-gradient(180deg, #0C121A, #080D13);
  border-right: 1px solid var(--line); padding: 18px 14px 16px;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(180deg, #2EE06A, #16A34A); color: #04170A;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px;
  box-shadow: 0 8px 20px rgba(34, 197, 94, .18);
}
.brand { font-size: 14px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.brand small { display: block; font-size: 9.5px; color: var(--dim); font-weight: 400; margin-top: 3px; letter-spacing: 0; }
.menu { display: flex; flex-direction: column; gap: 3px; }
.mi {
  height: 40px; border-radius: 9px; display: flex; align-items: center; gap: 10px;
  padding: 0 11px; font-size: 12.5px; color: var(--muted); border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.mi:hover { background: rgba(255, 255, 255, .035); color: var(--text); }
.mi.on { background: rgba(34, 197, 94, .1); color: #BBF7D0; font-weight: 700; border-color: rgba(34, 197, 94, .15); }
.mi .ic { width: 18px; text-align: center; font-size: 14px; color: #94A3B8; flex: none; }
.mi.on .ic { color: #4ADE80; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 8px 0; display: flex; flex-direction: column; gap: 6px; font-size: 10px; color: var(--dim); }
.side-mode { display: flex; align-items: center; gap: 6px; color: var(--muted); margin-bottom: 2px; }
.side-line { display: flex; align-items: center; gap: 6px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 16, .62); backdrop-filter: blur(8px);
}
.bc { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--dim); min-width: 0; }
.bc a { color: var(--muted); transition: color .15s; }
.bc a:hover { color: var(--text); }
.bc .sep { color: #334155; }
.bc b { color: #E2E8F0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 8px; flex: none; }
.pill {
  height: 30px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px; padding: 0 11px; font-size: 10.5px; color: var(--muted); white-space: nowrap;
}
.pill .dot { width: 5px; height: 5px; }
.user { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 6px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #334155, #1E293B);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #E2E8F0; border: 1px solid var(--line); text-transform: uppercase;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 11px; font-weight: 700; color: #E2E8F0; max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 9px; color: var(--dim); margin-top: 2px; }
.view { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 24px 26px; }
.view.is-live { overflow: hidden; padding: 12px 16px 14px; display: flex; flex-direction: column; }

/* ---------- page layout ---------- */
.page { display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; }
.pagehead h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagehead .sub { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.65; max-width: 900px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.page-actions .btn { white-space: nowrap; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; min-width: 0; }
.kpi .l { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.kpi .v { font-size: 23px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; line-height: 1.15; }
.kpi .v small { font-size: 11px; color: var(--dim); font-weight: 400; margin-left: 2px; letter-spacing: 0; }
.kpi .s { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.55; overflow-wrap: anywhere; }
.kpi.kpi-green .v { color: var(--green-soft); }
.kpi.kpi-amber .v { color: var(--amber-soft); }
.kpi.kpi-blue .v { color: var(--blue-soft); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.grid-2.wide-left { grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); }
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.grow { flex: 1; }
.chead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.chead .t { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.chead .t small { font-size: 10px; color: var(--dim); font-weight: 400; }
.chead .a { font-size: 10.5px; color: var(--blue-soft); display: inline-flex; align-items: center; gap: 3px; }
.chead .a:hover { text-decoration: underline; }
.section-gap { height: 2px; }
.hr { height: 1px; background: var(--line); margin: 12px 0; border: 0; }
.note-line { font-size: 10.5px; color: var(--dim); line-height: 1.6; display: flex; align-items: flex-start; gap: 6px; flex-wrap: wrap; }
.scope-note { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--dim); line-height: 1.5; }
.scope-note .i { width: 15px; height: 15px; border-radius: 5px; background: rgba(255,255,255,.05); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 9px; flex: none; }

/* ---------- notice / alert / empty ---------- */
.notice {
  display: flex; gap: 8px; padding: 9px 11px; border-radius: 9px;
  background: rgba(59, 130, 246, .06); border: 1px solid rgba(59, 130, 246, .16);
  color: #BFDBFE; font-size: 10.8px; line-height: 1.6;
}
.notice.warn { background: rgba(245, 158, 11, .06); border-color: rgba(245, 158, 11, .18); color: #FDE68A; }
.notice.success { background: rgba(34, 197, 94, .06); border-color: rgba(34, 197, 94, .18); color: #BBF7D0; }
.notice .ni { width: 18px; height: 18px; border-radius: 5px; background: rgba(255,255,255,.06); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; flex: none; }
.alert { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 11.5px; line-height: 1.5; }
.alert:last-child { border-bottom: none; }
.alert .i { width: 20px; height: 20px; border-radius: 6px; background: rgba(245, 158, 11, .12); color: var(--amber-soft); display: flex; align-items: center; justify-content: center; font-size: 10px; flex: none; font-weight: 700; }
.alert.level-info .i { background: rgba(59, 130, 246, .12); color: var(--blue-soft); }
.alert.level-error .i { background: rgba(239, 68, 68, .12); color: var(--red-soft); }
.alert.level-success .i { background: rgba(34, 197, 94, .12); color: var(--green-soft); }
.alert b { color: #E2E8F0; font-weight: 700; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 34px 18px; text-align: center; color: var(--dim); font-size: 11.5px; line-height: 1.6; }
.empty .em-ic { width: 38px; height: 38px; border-radius: 11px; border: 1px dashed #2B3A50; display: flex; align-items: center; justify-content: center; color: #475569; font-size: 16px; margin-bottom: 2px; }
.empty b { color: var(--muted); font-weight: 600; }
.state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 58px 20px; text-align: center; color: var(--dim); font-size: 11.5px; line-height: 1.6; }
.state .spinner { margin-bottom: 2px; }
.state-error { color: var(--red-soft); }
.state-error .st-title { font-size: 13px; font-weight: 700; color: #FCA5A5; }
.state-error .st-msg { max-width: 520px; }
.state .st-actions { display: flex; gap: 8px; margin-top: 4px; }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; margin: 0 -2px; padding: 0 2px; }
table.data { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.data th {
  text-align: left; color: var(--dim); font-weight: 500; padding: 8px 6px;
  border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 10.5px;
}
.data td { padding: 9px 6px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover { background: rgba(255, 255, 255, .018); }
.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.data .actions { text-align: right; white-space: nowrap; }
.data .actions .btn + .btn { margin-left: 4px; }
.cell-main { font-weight: 700; font-size: 12px; color: #E2E8F0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cell-sub { font-size: 10px; color: var(--dim); margin-top: 2px; line-height: 1.45; }
.shop-cell { display: flex; align-items: center; gap: 7px; }
.flag-stack { display: inline-flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; font-size: 10px; color: var(--dim); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar .search { position: relative; width: 220px; max-width: 100%; }
.toolbar .search .input { height: 32px; font-size: 11px; padding-left: 28px; }
.toolbar .search::before { content: '⌕'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--dim); font-size: 13px; pointer-events: none; }
.toolbar .select { height: 32px; font-size: 11px; width: auto; min-width: 110px; }
.toolbar .spacer { flex: 1; }
.toolbar .stat-inline { font-size: 10.5px; color: var(--dim); }
.toolbar .stat-inline b { color: var(--muted); }

/* ---------- dashboard ---------- */
.live-summary { display: flex; flex-direction: column; gap: 10px; }
.live-summary-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.live-summary-title { font-size: 15px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-summary-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 6px; font-size: 10.5px; color: var(--muted); }
.live-summary-meta b { color: #E2E8F0; }
.mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 70px; margin-top: 8px; }
.mini-bars i { flex: 1; min-width: 3px; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #34D399, #166534); opacity: .9; }
.progress { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; margin: 5px 0 9px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #22C55E, #4ADE80); border-radius: 99px; }
.progress.blue i { background: linear-gradient(90deg, #3B82F6, #60A5FA); }
.progress.amber i { background: linear-gradient(90deg, #F59E0B, #FCD34D); }
.smallrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 10.5px; color: var(--muted); }
.smallrow b { color: #E2E8F0; font-weight: 600; }
.comment-mini { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 11px; line-height: 1.5; }
.comment-mini:last-child { border-bottom: none; }
.comment-mini .flag { margin-top: 1px; }
.comment-mini b { color: #E2E8F0; }
.comment-mini .trans { color: #86EFAC; font-size: 10px; margin-top: 1px; }
.comment-mini .orig { color: #CBD5E1; font-size: 10.5px; margin-top: 1px; }
.comment-mini .time { margin-left: auto; color: var(--dim); font-size: 9.5px; white-space: nowrap; }

/* ---------- shops ---------- */
.shop-ident { display: flex; align-items: center; gap: 8px; }
.shop-ident .flag { width: 24px; height: 16px; font-size: 8px; }
.shop-name { font-weight: 700; color: #E2E8F0; font-size: 12px; }
.shop-code { font-size: 9.5px; color: var(--dim); margin-top: 1px; }
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.config-grid .span-2 { grid-column: 1 / -1; }
.config-shop-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card2); margin-bottom: 14px; }
.config-shop-head .flag { width: 28px; height: 19px; font-size: 9px; }
.config-shop-head .nm { font-weight: 800; font-size: 13px; }
.config-shop-head .cd { font-size: 10px; color: var(--dim); margin-top: 2px; }

/* ---------- products ---------- */
.listing-cell { min-width: 92px; }
.listing-price { font-size: 11.5px; font-weight: 600; color: #E2E8F0; font-variant-numeric: tabular-nums; }
.listing-stock { font-size: 9.5px; color: var(--dim); margin-top: 1px; }
.listing-cell.out .listing-price { color: var(--amber-soft); }
.listing-cell.missing { color: var(--dim); font-size: 10.5px; }
.listing-cell .tag { margin-top: 2px; }
.product-name { font-weight: 600; color: #E2E8F0; max-width: 260px; }
.detail-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 11.5px; }
.detail-kv dt { color: var(--dim); font-size: 10.5px; }
.detail-kv dd { margin: 2px 0 0; color: #E2E8F0; }
.detail-listing-table { margin-top: 6px; }

/* ---------- cart plans ---------- */
.cart-layout { display: grid; grid-template-columns: 292px minmax(0, 1fr); gap: 12px; align-items: start; }
.plan-list { display: flex; flex-direction: column; gap: 8px; }
.plan-item {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px;
  background: var(--card2); cursor: pointer; transition: border-color .15s, background .15s;
}
.plan-item:hover { border-color: #334155; }
.plan-item.on { border-color: rgba(34, 197, 94, .38); background: rgba(34, 197, 94, .055); }
.plan-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-item-name { font-size: 12.5px; font-weight: 700; color: #E2E8F0; }
.plan-item-sub { font-size: 10px; color: var(--dim); margin-top: 3px; }
.plan-item-flags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.slot-badge {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  background: rgba(34, 197, 94, .14); color: #86EFAC;
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800;
}
.slot-badge.muted { background: rgba(255, 255, 255, .06); color: var(--muted); }
.matrix-status { display: flex; flex-direction: column; gap: 3px; }
.matrix-status .tag { align-self: flex-start; }

/* ---------- hosts ---------- */
.host-ident { display: flex; align-items: center; gap: 8px; }
.host-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #334155, #1E293B); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 9.5px; color: #E2E8F0; font-weight: 700;
}
.policy-list { display: flex; flex-direction: column; gap: 10px; }
.policy-item { display: flex; gap: 9px; font-size: 11px; line-height: 1.55; }
.policy-num {
  width: 18px; height: 18px; border-radius: 6px; background: rgba(59, 130, 246, .12);
  color: var(--blue-soft); display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 800; flex: none;
}
.policy-item b { color: #E2E8F0; display: block; margin-bottom: 1px; }
.policy-item span { color: var(--dim); }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.settings-grid .span-full { grid-column: 1 / -1; }
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.settings-section-title { font-size: 11px; font-weight: 700; color: #CBD5E1; display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.settings-form .form-grid { gap: 12px 14px; }
.account-row { display: flex; align-items: center; gap: 11px; }
.account-row .avatar { width: 40px; height: 40px; font-size: 12px; }
.account-name { font-size: 13px; font-weight: 700; }
.account-sub { font-size: 10px; color: var(--dim); margin-top: 2px; }
.worker-node { display: flex; align-items: center; gap: 8px; }
.worker-node .nm { font-weight: 700; font-size: 11.5px; color: #E2E8F0; }
.node-ic { width: 20px; height: 20px; border-radius: 6px; background: rgba(59, 130, 246, .12); color: #93C5FD; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; flex: none; }
.budget-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 2px; font-size: 10.5px; color: var(--muted); }
.budget-line b { color: #E2E8F0; }

/* ---------- live big screen ---------- */
.live-page { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.live-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex: none; }
.live-head-left { min-width: 0; }
.live-back { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--dim); margin-bottom: 5px; transition: color .15s; }
.live-back:hover { color: var(--text); }
.live-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-title { font-size: 19px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.live-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 5px; font-size: 10.5px; color: var(--muted); }
.live-meta .sep { width: 1px; height: 10px; background: var(--line); }
.live-meta b { color: #E2E8F0; font-weight: 600; }
.live-timer { font-variant-numeric: tabular-nums; color: #E2E8F0; font-weight: 600; font-size: 10.5px; padding: 4px 7px; border-radius: 5px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.05); }
.live-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 58%; }
.live-hint { font-size: 10px; color: var(--dim); line-height: 1.5; margin-top: 4px; }
.live-hint.warn { color: var(--amber-soft); }
.live-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 10px; }
.live-left { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.shop-grid {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.shop-tile {
  position: relative; display: block; overflow: hidden; text-align: left;
  padding: 0; border: 1px solid var(--line); border-radius: 10px;
  background: #0B1220; color: var(--text); font: inherit; cursor: pointer;
  transition: border-color .15s, box-shadow .15s; min-height: 0;
}
.shop-tile:hover { border-color: #334155; }
.shop-tile.selected { border-color: rgba(34, 197, 94, .7); box-shadow: 0 0 0 1px rgba(34, 197, 94, .35), 0 0 30px rgba(34, 197, 94, .07); }
.shop-tile.empty { cursor: default; border-style: dashed; border-color: #243247; background: rgba(17, 25, 35, .35); }
.shop-tile.empty:hover { border-color: #243247; }
.tile-bg { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(160deg, #111B28, #080D14 70%); }
.tile-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, .18), rgba(2, 6, 23, .1) 38%, rgba(2, 6, 23, .92));
}
.tile-bg.f-id { background: radial-gradient(120% 90% at 15% 0%, rgba(225, 29, 72, .34), transparent 62%), linear-gradient(160deg, #1A0E16, #080D14 72%); }
.tile-bg.f-th { background: radial-gradient(120% 90% at 15% 0%, rgba(37, 99, 235, .34), transparent 62%), linear-gradient(160deg, #0C1424, #080D14 72%); }
.tile-bg.f-vn { background: radial-gradient(120% 90% at 15% 0%, rgba(220, 38, 38, .32), transparent 62%), linear-gradient(160deg, #1B0E0E, #080D14 72%); }
.tile-bg.f-my { background: radial-gradient(120% 90% at 15% 0%, rgba(14, 165, 233, .3), transparent 62%), linear-gradient(160deg, #08151F, #080D14 72%); }
.tile-bg.f-ph { background: radial-gradient(120% 90% at 15% 0%, rgba(245, 158, 11, .3), transparent 62%), linear-gradient(160deg, #1B1509, #080D14 72%); }
.tile-bg.f-sg { background: radial-gradient(120% 90% at 15% 0%, rgba(168, 85, 247, .3), transparent 62%), linear-gradient(160deg, #150D1E, #080D14 72%); }
.tile-bg.f-tw { background: radial-gradient(120% 90% at 15% 0%, rgba(20, 184, 166, .3), transparent 62%), linear-gradient(160deg, #081918, #080D14 72%); }
.tile-bg.f-id2 { background: radial-gradient(120% 90% at 15% 0%, rgba(244, 63, 94, .3), transparent 62%), linear-gradient(160deg, #1B0C12, #080D14 72%); }
.tile-bg .wm {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  color: rgba(255, 255, 255, .055); font-size: 54px; font-weight: 900; letter-spacing: .04em;
  pointer-events: none;
}
.tile-bg .wm small { font-size: 9.5px; letter-spacing: .16em; color: rgba(255, 255, 255, .32); font-weight: 600; background: rgba(2, 6, 23, .45); padding: 3px 6px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .08); }
.tile-feed-state { display: inline-flex; align-items: center; font-size: 9px; color: var(--muted); border: 1px solid rgba(148, 163, 184, .22); background: rgba(15, 22, 32, .55); border-radius: 4px; padding: 1px 4px; white-space: nowrap; }
.tile-body { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; padding: 8px 9px; gap: 3px; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.tile-name { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); min-width: 0; }
.tile-name .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-name .flag { width: 18px; height: 13px; font-size: 7px; }
.tile-status .tag { font-size: 8.5px; padding: 3px 5px; }
.tile-title { font-size: 10px; color: #CBD5E1; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 27px; }
.tile-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 8.5px; color: var(--muted); line-height: 1.4; }
.tile-bottom { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.tile-viewers { font-size: 21px; font-weight: 900; line-height: 1; letter-spacing: -.02em; }
.tile-viewers small { font-size: 8px; color: #CBD5E1; font-weight: 400; margin-left: 2px; letter-spacing: 0; }
.tile-stats { display: flex; gap: 8px; text-align: right; font-size: 8px; color: var(--muted); line-height: 1.35; }
.tile-stats b { display: block; font-size: 9.5px; color: #F8FAFC; font-weight: 700; }
.tile-empty-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--dim); font-size: 10px; text-align: center; padding: 8px; }
.tile-empty-label .flag { width: 22px; height: 15px; font-size: 8px; background: #243247; color: var(--dim); }
.tile-empty-label small { font-size: 8.5px; color: var(--dim); }
.live-strip {
  flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #0B1220; border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 11px; font-size: 10px; color: var(--muted); min-height: 33px;
}
.live-strip .si { display: flex; align-items: center; gap: 4px; }
.live-strip .si b { color: #E2E8F0; font-weight: 600; }
.live-strip .sep { width: 1px; height: 11px; background: var(--line); }
.live-strip .grow { flex: 1; }
.live-strip .warn { color: var(--amber-soft); display: flex; align-items: center; gap: 4px; }
.live-strip .live-refresh { font-size: 9.5px; color: var(--dim); }

.live-panel { background: var(--card); border: 1px solid var(--line); border-radius: 11px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.live-tabs { flex: none; display: flex; gap: 2px; padding: 7px 8px 0; border-bottom: 1px solid var(--line); }
.live-tab {
  appearance: none; background: transparent; border: 0; color: var(--muted);
  font-size: 11px; font-weight: 600; padding: 7px 8px 9px; cursor: pointer;
  border-bottom: 2px solid transparent; display: inline-flex; align-items: center; gap: 5px;
}
.live-tab:hover { color: var(--text); }
.live-tab.on { color: #BBF7D0; border-bottom-color: var(--green); }
.live-tab .cnt { font-size: 8.5px; padding: 1px 5px; border-radius: 99px; background: rgba(255,255,255,.07); color: var(--muted); line-height: 1.4; }
.live-tab .cnt.hot { background: rgba(245, 158, 11, .16); color: #FCD34D; }
.live-panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.panel-note { flex: none; font-size: 9.5px; color: var(--dim); line-height: 1.55; padding: 7px 10px 0; }
.panel-topbar { flex: none; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px 10px 0; }
.panel-topbar .spacer { flex: 1; }
.panel-topbar .tiny { font-size: 9.5px; }
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.panel-foot { flex: none; border-top: 1px solid var(--line); background: rgba(15, 22, 32, .82); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.panel-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 24px 14px; text-align: center; color: var(--dim); font-size: 10.5px; line-height: 1.6; }
.panel-empty .em-ic { width: 34px; height: 34px; border-radius: 10px; border: 1px dashed #2B3A50; display: flex; align-items: center; justify-content: center; color: #475569; font-size: 15px; }
.panel-empty a { color: var(--blue-soft); font-size: 10.5px; }

.comment {
  border: 1px solid var(--line); border-radius: 8px; background: var(--card2);
  padding: 7px 8px; cursor: pointer; transition: border-color .15s, background .15s;
}
.comment:hover { border-color: #334155; }
.comment.on { border-color: rgba(59, 130, 246, .55); background: rgba(59, 130, 246, .055); }
.comment-top { display: flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--muted); flex-wrap: wrap; }
.comment-user { font-weight: 700; color: #E2E8F0; font-size: 10px; }
.comment-top .tag { margin-left: 0; }
.comment-time { margin-left: auto; color: var(--dim); font-size: 8.5px; white-space: nowrap; }
.comment-original { font-size: 10.8px; color: #F1F5F9; margin-top: 4px; line-height: 1.45; word-break: break-word; }
.comment-translated { font-size: 9.8px; color: #86EFAC; margin-top: 2px; line-height: 1.45; word-break: break-word; }
.comment-replied { font-size: 9.5px; color: var(--blue-soft); margin-top: 3px; }
.reply-result { border: 1px solid rgba(34, 197, 94, .24); background: rgba(34, 197, 94, .07); border-radius: 7px; padding: 6px 8px; font-size: 9.8px; color: #BBF7D0; line-height: 1.5; }
.reply-result b { color: #DCFCE7; }
.composer-label { font-size: 9.5px; color: var(--dim); display: flex; align-items: center; gap: 5px; }
.composer-label b { color: #E2E8F0; font-size: 10px; }
.panel-foot .textarea { min-height: 44px; font-size: 10.5px; padding: 6px 8px; }
.panel-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.panel-actions .grow { flex: 1; }
.panel-actions .tiny { font-size: 9px; }

.cart-slot { border: 1px solid var(--line); border-radius: 8px; background: var(--card2); padding: 7px 8px; }
.cart-slot.showing { border-color: rgba(34, 197, 94, .32); background: rgba(34, 197, 94, .045); }
.cart-slot-head { display: flex; align-items: center; gap: 7px; }
.cart-slot-head .slot-badge { width: 19px; height: 19px; font-size: 9px; border-radius: 5px; }
.cart-slot-main { flex: 1; min-width: 0; }
.cart-name { font-size: 10.5px; font-weight: 700; color: #E2E8F0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-sub { font-size: 9px; color: var(--dim); margin-top: 1px; }
.cart-mappings { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
.mapping { display: inline-flex; align-items: center; gap: 3px; font-size: 8px; color: var(--muted); background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.05); border-radius: 4px; padding: 2px 4px; }
.mapping .flag { width: 12px; height: 9px; font-size: 5px; border-radius: 1px; }
.mapping.ok { color: #86EFAC; border-color: rgba(34, 197, 94, .18); background: rgba(34, 197, 94, .07); }
.mapping.warn { color: #FCD34D; border-color: rgba(245, 158, 11, .18); background: rgba(245, 158, 11, .07); }
.mapping.bad { color: #FCA5A5; border-color: rgba(239, 68, 68, .18); background: rgba(239, 68, 68, .07); }
.mapping.missing { color: var(--dim); }
.cart-actions { display: flex; align-items: center; gap: 5px; margin-top: 5px; }
.cart-result { margin-top: 5px; padding-top: 5px; border-top: 1px dashed var(--line); font-size: 8.8px; color: var(--muted); line-height: 1.6; display: flex; flex-wrap: wrap; gap: 3px 8px; }
.cart-result .ok { color: #86EFAC; }
.cart-result .skip { color: #FCD34D; }
.cart-result .bad { color: #FCA5A5; }
.cart-footer-note { flex: none; padding: 6px 10px 8px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; font-size: 9px; color: var(--dim); }
.cart-footer-note a { color: var(--blue-soft); }

.prompt-compose { flex: none; padding: 8px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; background: rgba(15, 22, 32, .55); }
.prompt-compose .textarea { min-height: 72px; font-size: 10.5px; }
.prompt-count { font-size: 8.5px; color: var(--dim); margin-left: auto; }
.prompt-history-label { flex: none; font-size: 9px; color: var(--dim); padding: 7px 10px 0; display: flex; align-items: center; justify-content: space-between; }
.prompt-item { border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; background: var(--card2); font-size: 10.5px; line-height: 1.5; }
.prompt-item-head { display: flex; align-items: center; gap: 5px; font-size: 8.5px; color: var(--dim); margin-bottom: 3px; }
.prompt-item-head .time { margin-left: auto; }
.prompt-content { color: #E2E8F0; word-break: break-word; }
.prompt-read { color: #86EFAC; font-size: 8.5px; margin-top: 2px; }
.prompt-read.pending { color: var(--dim); }

/* ---------- real local stream tile (HTTP-FLV) ---------- */
.shop-cells { display: contents; }
.local-tile { position: relative; overflow: hidden; background: #05080C; padding: 0; text-align: left; cursor: pointer; }
.local-tile.selected { border-color: rgba(34, 197, 94, .7); box-shadow: 0 0 0 1px rgba(34, 197, 94, .35), 0 0 30px rgba(34, 197, 94, .07); }
.local-media { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(90% 80% at 50% 40%, #0E1A26, #05080C 75%); }
.local-media::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(2, 6, 23, .86), rgba(2, 6, 23, .32) 38%, rgba(2, 6, 23, .94)); z-index: 1; }
.real-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; pointer-events: none; }
.local-body { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; padding: 8px 9px; gap: 3px; pointer-events: none; text-shadow: 0 1px 6px rgba(0, 0, 0, .82); }
.local-tile .tile-title { color: #F8FAFC; }
.local-tile .tile-meta, .local-tile .tile-stats { color: #D7E0EC; }
.local-placeholder { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 42px 12px 52px; text-align: center; color: var(--muted); pointer-events: none; }
.local-placeholder .lp-icon { width: 36px; height: 36px; border-radius: 11px; border: 1px dashed rgba(148, 163, 184, .35); display: flex; align-items: center; justify-content: center; color: #64748B; font-size: 16px; background: rgba(15, 22, 32, .55); }
.local-placeholder .lp-title { font-size: 12.5px; font-weight: 700; color: #E2E8F0; letter-spacing: -.01em; }
.local-placeholder .lp-sub { font-size: 9.5px; line-height: 1.55; color: var(--dim); max-width: 190px; }
.local-placeholder.err .lp-title { color: var(--red-soft); }
.local-placeholder .lp-retry { pointer-events: auto; margin-top: 2px; }
.local-connect { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 10.5px; color: #E2E8F0; background: rgba(2, 6, 23, .48); }
.local-connect .spinner { width: 14px; height: 14px; border-width: 1.5px; }
.local-stream-badge { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-top: 1px; }
.local-stream-badge .tag { font-size: 8.5px; padding: 3px 6px; }
.local-tile .tile-title { min-height: 0; }
.local-tile .tile-name .nm { max-width: 120px; }
.local-tile .tile-bottom { margin-top: auto; }
.local-tile .tile-viewers { font-size: 19px; }
.local-tile .tile-stats { gap: 8px; }
.local-tile .local-silent { font-size: 8px; color: var(--dim); }
@media (max-width: 1380px) {
  .local-tile .tile-viewers { font-size: 17px; }
  .local-tile .local-silent { display: none; }
}

/* ---------- modal / toast / hints ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000; padding: 24px;
  background: rgba(2, 6, 23, .72); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; animation: fadeIn .14s ease-out;
}
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column; background: #0D131B;
  border: 1px solid #263244; border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  animation: popIn .18s ease-out;
}
.modal-lg { width: min(820px, 100%); }
.modal-sm { width: min(430px, 100%); }
.m-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 18px 12px; border-bottom: 1px solid var(--line); }
.m-head h3 { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.m-sub { font-size: 10.5px; color: var(--dim); margin-top: 3px; line-height: 1.5; }
.m-close { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; font-size: 12px; }
.m-close:hover { color: var(--text); border-color: #334155; }
.m-body { flex: 1; min-height: 0; overflow-y: auto; padding: 15px 18px; }
.m-foot { flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 18px 15px; border-top: 1px solid var(--line); }
.m-foot .btn { min-width: 82px; }
.confirm-msg { font-size: 12px; color: #E2E8F0; line-height: 1.7; }
.confirm-sub { font-size: 10.5px; color: var(--dim); margin-top: 6px; line-height: 1.6; }
.modal .form-grid + .form-grid { margin-top: 12px; }
.handover-current { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; margin-bottom: 12px; background: rgba(34, 197, 94, .04); }
.handover-current .nm { font-size: 12px; font-weight: 700; }
.handover-current .sub { font-size: 9.5px; color: var(--dim); margin-top: 1px; }

/* ---------- narrow modal: prevent horizontal scrolling ---------- */
.modal { max-width: 100%; }
.modal .m-head > *, .modal .m-foot > *, .modal .form-grid > * { min-width: 0; }
.modal .m-body { overflow-x: hidden; }
.modal .config-shop-head { flex-wrap: wrap; min-width: 0; }
.modal .config-shop-head > div { min-width: 0; }
.modal .config-shop-head .nm,
.modal .config-shop-head .cd { overflow-wrap: anywhere; }
.modal .m-head h3, .modal .m-sub { overflow-wrap: anywhere; }
.modal .input, .modal .select, .modal .textarea { max-width: 100%; }
.modal .m-foot { flex-wrap: wrap; }
.modal .m-foot .btn { flex: 1 1 auto; min-width: 0; }

@media (max-width: 820px) {
  .modal-overlay { padding: 12px; }
  .modal, .modal-lg, .modal-sm { width: 100%; max-width: 100%; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
  .m-head, .m-body, .m-foot { padding-left: 14px; padding-right: 14px; }
  .modal .form-grid { grid-template-columns: minmax(0, 1fr); }
  .modal .form-grid .span-2 { grid-column: auto; }
}

@media (max-width: 480px) {
  .modal-overlay { padding: 8px; }
  .modal, .modal-lg, .modal-sm { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .m-head, .m-body, .m-foot { padding-left: 12px; padding-right: 12px; }
}