/* Branding THE RESET TRADER: 3 màu chính + đỏ chỉ dùng cho kết quả âm */
:root {
  /* Tối (mặc định): nền Near Black, chữ Warm White */
  --bg: #09090B;
  --text: #F4F2ED;
  --ink: 244, 242, 237;          /* màu chữ dạng số, để pha độ trong suốt */
  --paper: 9, 9, 11;             /* màu nền dạng số */
  --accent: #14B8A6;             /* teal dùng để tô nền, nút, đường biểu đồ */
  --accent-text: #14B8A6;        /* teal dùng cho chữ */
  --on-accent: #09090B;          /* chữ trên nút teal */
  --loss: #E5484D;
  --loss-text: #E5484D;
  --loss-pill: #FF8589;
  --field: #111114;              /* nền ô nhập liệu */
  --muted: rgba(var(--ink), 0.6);
  --line: rgba(var(--ink), 0.145);  /* đường kẻ: đậm hơn ~20% (09/11) */
  --surface: rgba(var(--ink), 0.04);
  /* 14/11: web chỉ 2 font: Archivo (tiêu đề, logo) + Geist (chữ giao diện, số) */
  --font-head: 'Archivo', system-ui, sans-serif;
  --font-body: 'Geist', system-ui, sans-serif;
  --font-num: 'Geist', system-ui, sans-serif;
  --radius: 10px;
  color-scheme: dark;
}
/* Sáng: nền Warm White, chữ Near Black. Teal và đỏ đậm hơn cho chữ để đủ độ tương phản */
:root[data-theme="light"] {
  --bg: #F4F2ED;
  --text: #09090B;
  --ink: 9, 9, 11;
  --paper: 244, 242, 237;
  --accent-text: #0F766E;
  --loss-text: #C42E35;
  --loss-pill: #B4232A;
  --field: #FFFFFF;
  --muted: #4B4B52;              /* màu đặc, không trong suốt: chữ phụ rõ nét trên nền sáng */
  --line: rgba(var(--ink), 0.19);  /* đường kẻ: đậm hơn ~20% (09/11) */
  --surface: rgba(var(--ink), 0.035);
  color-scheme: light;
}
:root[data-theme="light"] body { -webkit-font-smoothing: auto; -moz-osx-font-smoothing: auto; }
/* Chế độ sáng: bỏ hiệu ứng kính mờ phía sau thanh trên/menu đáy để chữ không bị nhoè */
:root[data-theme="light"] .topbar, :root[data-theme="light"] .bottom-nav { backdrop-filter: none; background: var(--bg); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-variant-numeric: tabular-nums;
  /* ánh teal rất nhẹ ở góc trên bên trái, duy nhất một chỗ trên cả trang */
  background: radial-gradient(55% 45% at 0% 0%, rgba(20, 184, 166, 0.09), transparent 70%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 14px; color: var(--muted); }

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Bố cục: sidebar trái + cột nội dung ---------- */
.layout { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 24px;
  padding: 24px 20px;
  border-right: 1px solid var(--line);
  /* ánh teal rất nhẹ ở góc trên, chỉ 1 chỗ duy nhất */
  background: rgba(var(--ink), 0.015);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); letter-spacing: 0.04em; }
.brand b { font-weight: 700; font-size: 15px; font-stretch: 125%; font-variation-settings: "wdth" 125; }
.brand b span { color: var(--accent-text); }
.brand small { display: block; font: 400 12px var(--font-body); letter-spacing: 0; color: var(--muted); }
/* 15/11 logo mới: RT dính nhau (Archivo Expanded 800) đen trên ô teal; màu cố định, không đổi theo sáng/tối */
.brand-mark { width: 24px; height: 24px; flex: none; border-radius: 7px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Crect width='512' height='512' rx='112' fill='%2314B8A6'/%3E%3Cg fill='%2309090B'%3E%3Cpath transform='translate(-162.8 0)' d='M250.3 328.7V183.3H371.4Q387.3 183.3 397.7 189.8Q408.1 196.3 413.3 207Q418.5 217.7 418.5 230.3Q418.5 244.1 412 255.4Q405.4 266.7 392.3 273.3L422 328.7H373.4L349.3 280.3H293.4V328.7ZM293.4 248.5H357.3Q365.1 248.5 369.7 243.9Q374.4 239.2 374.4 231.5Q374.4 226.3 372.3 222.6Q370.2 219 366.4 217.1Q362.6 215.2 357.3 215.2H293.4Z'/%3E%3Cpath transform='translate(165.7 0)' d='M153 328.7V218H90V183.3H259.1V218H196.1V328.7Z'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.welcome { padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.welcome h2 { font-size: 22px; letter-spacing: -0.01em; text-transform: none; color: var(--text); line-height: 1.2; }
.welcome p { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.side-nav { display: grid; gap: 4px; }
.side-nav a, .side-nav .soon {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  color: var(--muted); border: 1px solid transparent; font-size: 14px;
}
.side-nav a:hover { color: var(--text); background: var(--surface); }
.side-nav a.active {
  position: relative; color: var(--text); border-color: var(--line);
  background: linear-gradient(90deg, rgba(var(--ink), 0.09), rgba(var(--ink), 0.02));
}
.side-nav a.active::after { content: ''; position: absolute; right: 12px; width: 3px; height: 14px; border-radius: 2px; background: var(--accent); }
.soon { opacity: 0.5; cursor: default; }
.soon em { margin-left: auto; font: 500 12px var(--font-body); font-style: normal; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line); }
.btn-block { width: 100%; padding: 12px; }
.tagline { margin-top: auto; font: 700 12px var(--font-head); letter-spacing: 0.12em; color: var(--muted); line-height: 1.7; }

.main-col { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 32px; min-height: 64px;
  background: rgba(var(--paper), 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand-mobile { display: none; }
.crumbs svg { width: 20px; height: 20px; margin-right: 6px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); min-width: 0; }
.crumbs b { color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs a:hover { color: var(--text); }
.theme-btn { width: 38px; height: 38px; padding: 0; flex: none; }
.theme-btn svg { width: 18px; height: 18px; }
:root[data-theme="light"] .theme-btn .moon, :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
.scope { width: auto; margin-left: auto; padding: 8px 10px; font-size: 14px; }
.scope.on { border-color: var(--accent-text); color: var(--accent-text); }
.scope + .search { margin-left: 0; }
.search { margin-left: auto; position: relative; width: min(320px, 40%); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.search input { padding-left: 34px; }
.topbar .btn-plus { display: none; }
.streak { display: flex; align-items: center; gap: 8px; padding: 12px 32px 0; font-size: 14px; color: var(--muted); }
.streak::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.streak.warn::before { background: var(--loss); }
.streak b { color: var(--text); font-weight: 600; }
.streak.warn b { color: var(--loss-text); }
.stop-banner {
  margin: 12px 32px 0; padding: 12px 16px; border-radius: 8px; background: var(--loss); color: #fff;
  font-weight: 500; text-align: center;
}
main { max-width: 1280px; padding: 24px clamp(16px, 2.5vw, 32px) 80px; }
.bottom-nav { display: none; }

/* ---------- Dashboard ---------- */
.eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.eyebrow b { color: var(--text); font-weight: 500; }
.eyebrow svg { width: 16px; height: 16px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); display: inline-grid; place-items: center; }
.dot::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text); }
.display { font-size: clamp(28px, 1.8vw + 14px, 40px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.dash-head select { width: auto; }
.kpis-big { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; margin-bottom: 20px; }
.kpis-small { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 20px; margin-bottom: 40px; }
.kpi {
  position: relative; overflow: hidden; min-width: 0;
  border: 1px solid var(--line); border-radius: 20px; padding: 22px;
  background: linear-gradient(180deg, rgba(var(--ink), 0.045), rgba(var(--ink), 0.015));
}
/* Ánh màu rất nhẹ ở đáy thẻ lớn, theo màu kết quả */
.kpi-big::after { content: ''; position: absolute; inset: auto 0 0 0; height: 60%; pointer-events: none; }
.glow-win::after { background: radial-gradient(80% 100% at 50% 100%, rgba(20, 184, 166, 0.10), transparent 70%); }
.glow-loss::after { background: radial-gradient(80% 100% at 50% 100%, rgba(229, 72, 77, 0.10), transparent 70%); }
.kpi-top { display: flex; align-items: center; gap: 14px; }
.kpi h3 { font: 500 14px var(--font-body); color: var(--muted); }
.kpi-name { font: 600 16px var(--font-head); margin-top: 2px; }
.icon-tile {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); background: rgba(20, 184, 166, 0.10); color: var(--accent-text);
}
.kpis-small .icon-tile { width: 36px; height: 36px; border-radius: 10px; }
.kpis-small .icon-tile svg { width: 18px; height: 18px; }
.value-label { position: relative; margin-top: 26px; padding-left: 14px; font-size: 14px; color: var(--muted); }
.value-label::before { content: ''; position: absolute; left: -22px; top: -2px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--muted); }
.value-label.win::before { background: var(--accent); }
.value-label.loss::before { background: var(--loss); }
.kpi .value { font: 600 28px var(--font-num); margin-top: 12px; font-variant-numeric: tabular-nums; }
.kpi-big .value { font-size: clamp(28px, 1.6vw + 14px, 40px); margin-top: 4px; padding-left: 14px; }
.kpi .value.win { color: var(--accent-text); }
.kpi .value.loss { color: var(--loss-text); }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-left: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  font: 500 14px var(--font-body); white-space: nowrap; font-variant-numeric: tabular-nums;
  background: rgba(var(--ink), 0.06); color: var(--text);
}
.pill svg { width: 14px; height: 14px; }
.pill.win { background: rgba(20, 184, 166, 0.14); color: var(--accent-text); }
.pill.loss { background: rgba(229, 72, 77, 0.14); color: var(--loss-pill); }
.pill-icon { width: 30px; height: 30px; padding: 0; justify-content: center; }
.spark { position: relative; z-index: 1; display: block; width: 100%; height: 72px; margin-top: 18px; overflow: visible; }
.spark path { stroke-width: 2; }
.kpi-big { padding-bottom: 22px; }
.spark-dot { position: absolute; z-index: 2; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid; }
.spark-wrap { position: relative; margin-top: 18px; }
.spark-wrap .spark { margin-top: 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: 22px; letter-spacing: -0.02em; text-transform: none; color: var(--text); }
.section-head .eyebrow { margin-bottom: 6px; }
.btn-soft { background: rgba(var(--ink), 0.06); border-color: var(--line); }
.link { font-size: 14px; color: var(--accent-text); }
.table-wrap { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: rgba(var(--ink), 0.015); }
.table { width: 100%; border-collapse: collapse; }
.table td, .table th { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.table th { font: 500 12px var(--font-body); color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background .15s; }
.table tbody tr:hover td { background: rgba(var(--ink), 0.03); }
.setup-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.setup-cell b { display: block; font-weight: 500; }
.setup-cell small { display: block; font-size: 12px; color: var(--muted); }
.mini { width: 44px; height: 30px; border-radius: 6px; background: var(--field); border: 1px solid var(--line); overflow: hidden; flex: none; }
.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.muted { color: var(--muted); }
.danger-block { border-color: rgba(229, 72, 77, 0.45); }
.btn-danger-solid { background: var(--loss); border-color: var(--loss); color: #fff; font-weight: 600; }
.btn-danger-solid:disabled { opacity: 0.4; cursor: not-allowed; }
/* Review mới */
.review-step { display: grid; gap: 12px; margin-bottom: 20px; }
.step-title { display: flex; align-items: center; gap: 10px; margin: 0; font: 700 22px var(--font-head); color: var(--text); }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--on-accent); font: 700 14px var(--font-head); }
.problems { margin: 0; padding-left: 22px; display: grid; gap: 14px; }
.problems li::marker { color: var(--loss-text); font-weight: 700; }
.problems b { display: block; font-weight: 600; font-size: 16px; }
.problems span { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; max-width: 72ch; }
.ok-line { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--accent-text); }
.rule-options { display: grid; gap: 8px; }
.rule-option { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--text); font-size: 16px; }
.rule-option:has(input:checked) { border-color: var(--accent); background: rgba(20, 184, 166, 0.08); }
.rule-option input[type=radio] { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.rule-option span { display: grid; gap: 8px; flex: 1; }
.kept-check { border-color: var(--accent); }
.rule-text { margin: 0; font-size: 16px; font-weight: 500; }
.kept-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-box { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.ai-box summary { cursor: pointer; font-weight: 600; }
.ai-box[open] { gap: 10px; }
.rule-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 20px; border: 1px solid var(--accent); border-radius: 12px; background: rgba(20, 184, 166, 0.08); color: var(--text); }
.rule-banner svg { color: var(--accent-text); }
/* Dashboard 2 cột */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 16px; margin-bottom: 20px; }
.stat .value { font-size: 28px; margin-top: 8px; }
.stat .sub.win { color: var(--accent-text); }
.stat .sub.loss { color: var(--loss-text); }
.dash-grid { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); grid-template-areas: "left right"; gap: 20px; align-items: start; }
.dash-left { grid-area: left; display: grid; gap: 16px; }
.dash-right { grid-area: right; display: grid; gap: 20px; min-width: 0; }
.donut-card .donut { width: 104px; height: 104px; }
.donut-card .donut-wrap { gap: 16px; flex-wrap: nowrap; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 8px 12px; font: 600 14px var(--font-head); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.toggle.small button { padding: 5px 12px; font-size: 14px; }
.toggle button[disabled] { opacity: 0.4; cursor: not-allowed; }
.chart-card { position: relative; overflow: hidden; }
/* Ánh teal nhẹ ở góc dưới phải, giống ảnh tham khảo */
.chart-card::after { content: ''; position: absolute; right: -10%; bottom: -30%; width: 70%; height: 80%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(20, 184, 166, 0.16), transparent); }
.chart-card > * { position: relative; z-index: 1; }
.chart-title { margin: 0; font: 600 16px var(--font-body); color: var(--text); }
.chart-tools { display: flex; align-items: center; gap: 12px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font: 14px var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--text); }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 4px 0 18px;
  border: 1px solid var(--line); border-radius: 12px; }
.segmented button { border: 0; border-radius: 9px; padding: 8px 0; background: transparent; color: var(--muted); font: 500 14px var(--font-body); cursor: pointer; }
.segmented button.on { background: rgba(var(--ink), 0.09); color: var(--text); }
.segmented button:focus-visible, .link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chart-area { position: relative; height: 230px; }
.chart-area svg { width: 100%; height: 100%; display: block; overflow: visible; stroke: none; }
.chart-area svg path { stroke: none; }
.chart-area .vgrid { stroke: var(--line); stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.chart-area .zero { stroke: var(--muted); stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart-area .cum-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-area .bar-win { fill: var(--accent); }
.chart-area .bar-loss { fill: var(--loss); }
.end-dot { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2.5px solid; background: var(--bg); }
.x-labels { position: relative; height: 26px; margin-top: 8px; border-top: 1px solid var(--line); }
.x-labels span { position: absolute; top: 8px; transform: translateX(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; }
.chart-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.foot-label { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.foot-value { font: 600 40px/1 var(--font-num); color: var(--text); }
.foot-value sup { font-size: 16px; font-weight: 500; margin-left: 6px; vertical-align: top; position: relative; top: 2px; }
.foot-value.win, .foot-delta.win, .foot-value sup.win { color: var(--accent-text); }
.foot-value.loss, .foot-delta.loss, .foot-value sup.loss { color: var(--loss-text); }
.foot-value.win, .foot-value.loss { color: var(--text); }
.foot-delta { display: flex; align-items: center; gap: 6px; font: 600 22px var(--font-num); }
.foot-delta svg { width: 20px; height: 20px; }
.cal-card .cal { border-radius: 14px; }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li + li { border-top: 1px solid var(--line); }
.recent-list a { display: grid; grid-template-columns: 1fr auto 24px; align-items: center; gap: 10px; padding: 10px 0; }
.recent-list b { display: block; font-weight: 500; font-size: 14px; }
.recent-list small { color: var(--muted); font-size: 12px; }
.status-dot { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.status-dot svg { width: 14px; height: 14px; }
.status-dot.ok { color: var(--accent-text); background: rgba(20, 184, 166, 0.14); }
.status-dot.bad { color: var(--loss-text); background: rgba(229, 72, 77, 0.14); }
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; grid-template-areas: "right" "left"; }
  .dash-left { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
}
/* Settings + Review */
.set-block { display: grid; gap: 14px; margin-bottom: 20px; justify-items: start; }
.set-block .toggle button { padding: 9px 18px; }
label.inline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--text); }
label.inline select { width: auto; }
.list-edit { width: 100%; padding-top: 14px; border-top: 1px solid var(--line); }
.edit-chip { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.edit-chip button { border: 0; background: none; color: inherit; font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.list-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.saved { font-size: 14px; }
.saved.ok { color: var(--accent-text); }
.saved.error { color: var(--loss-text); }
code { font-size: 12px; padding: 2px 6px; border-radius: 4px; background: var(--surface); }
.review-tags { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; margin: 4px 0 8px; }
.review-form { display: grid; gap: 16px; }
.review-form .form-actions { align-items: center; }
.rule-reminder { color: var(--text); }
.rule-reminder svg { color: var(--accent-text); }
.topbar .settings-mobile { display: none; }
/* Accounts */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.acc-card .kpi-top { align-items: flex-start; }
.acc-edit { margin-left: auto; padding: 6px 12px; font-size: 14px; }
.acc-card .pills { padding-left: 0; }
.acc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.acc-stats dt { font-size: 12px; color: var(--muted); }
.acc-stats dd { margin: 2px 0 0; font: 600 16px var(--font-num); font-variant-numeric: tabular-nums; }
.acc-stats dd.win { color: var(--accent-text); }
.acc-stats dd.loss { color: var(--loss-text); }
.acc-form { display: grid; gap: 16px; margin-bottom: 20px; border-color: var(--accent-text); }
.money .value { font-size: 22px; }
.hint { margin: 0; font-size: 14px; color: var(--muted); }
/* Calendar */
.cal-nav { display: flex; align-items: center; gap: 12px; }
.cal-nav b { font: 600 16px var(--font-head); min-width: 150px; text-align: center; }
.cal-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.cal-summary b { font: 600 22px var(--font-num); color: var(--text); }
.cal-summary b.win { color: var(--accent-text); }
.cal-summary b.loss { color: var(--loss-text); }
.cal { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 0.9fr); }
.cal-row + .cal-row { border-top: 1px solid var(--line); }
.cal-head div { padding: 10px 14px; font-size: 12px; color: var(--muted); background: var(--surface); }
.cal-day, .cal-week {
  min-height: 104px; padding: 10px 12px; text-align: left; display: flex; flex-direction: column; gap: 2px;
  background: transparent; border: 0; border-right: 1px solid var(--line); color: var(--text); font: 14px var(--font-body);
}
.cal-week { border-right: 0; background: var(--surface); }
.cal-day:not([disabled]) { cursor: pointer; }
.cal-day:not([disabled]):hover { outline: 1px solid var(--muted); outline-offset: -1px; }
.cal-day.out .cal-num { opacity: 0.35; }
.cal-day.today .cal-num { color: var(--on-accent); background: var(--accent); border-radius: 6px; padding: 0 6px; width: fit-content; }
.cal-day.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-num { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cal-day b, .cal-week b { font: 600 16px var(--font-num); font-variant-numeric: tabular-nums; }
.cal-day small, .cal-week small { font-size: 12px; color: var(--muted); }
.cal-day span:not(.cal-num), .cal-week span:not(.cal-num) { font-size: 12px; font-variant-numeric: tabular-nums; }
.cal-day.win, .cal-week.win { background: rgba(20, 184, 166, 0.10); }
.cal-day.loss, .cal-week.loss { background: rgba(229, 72, 77, 0.10); }
.cal-day.win b, .cal-week.win b { color: var(--accent-text); }
.cal-day.loss b, .cal-week.loss b { color: var(--loss-pill); }
/* 14/11: cột Weekly nổi bật bằng MÀU, cỡ chữ giữ y như ô ngày.
   Vạch dọc tách cột + nền cột khác ô ngày + số tiền tuần nằm trong nhãn màu (xanh lời / đỏ lỗ). */
.cal-week, .cal-head .cal-week-col { border-left: 2px solid color-mix(in srgb, var(--muted) 45%, transparent); }
.cal-week { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.cal-head .cal-week-col { color: var(--text); font-weight: 600; }
.cal-week .cal-num { color: var(--text); font-weight: 600; }
.cal-week b { width: fit-content; padding: 1px 8px; border-radius: 6px; }
.cal-week.win, .cal-week.loss { background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.cal-week.win b { background: var(--accent); color: var(--on-accent); }
.cal-week.loss b { background: var(--loss-pill); color: #fff; }
/* Donut */
.donut-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 18px; }
.donut { width: 120px; height: 120px; flex: none; }
.kpi-big .donut { width: 150px; height: 150px; }
.donut circle { fill: none; stroke-width: 12; }
.donut-box { position: relative; flex: none; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; font: 600 22px var(--font-num); color: var(--text); }
.donut-card .donut-center { font-size: 22px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--muted); min-width: 0; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend b { margin-left: auto; padding-left: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.lead { margin: 10px 0 0; color: var(--muted); }
.notice { display: flex; align-items: center; gap: 10px; margin: 0 0 20px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; color: var(--muted); }
.notice svg { width: 18px; height: 18px; color: var(--text); }
.vs { display: grid; gap: 12px; margin-top: 26px; }
.vs-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.vs-row .r { font: 600 28px var(--font-num); font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.table.static tbody tr { cursor: default; }
.table td.win { color: var(--accent-text); }
.table td.loss { color: var(--loss-text); }
.note { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.empty.small { padding: 28px 20px; margin-bottom: 8px; }
.reasons { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.reasons li + li { border-top: 1px solid var(--line); }
.reasons a { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 14px 20px; }
.reasons a:hover { background: rgba(var(--ink), 0.03); }
.section-head { margin-top: 40px; }
.kpis-small + .section-head, .dash-head + .kpis-big { margin-top: 0; }
.show-sm { display: none; }

/* ---------- Nút ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--text);
  font: 500 14px var(--font-body); cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent-text); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent-text); }
.btn-danger:hover { border-color: var(--loss-text); color: var(--loss-text); }

/* ---------- Gallery ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.filters select { width: auto; min-width: 170px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  display: block; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); transition: border-color .15s;
}
.card:hover { border-color: var(--accent-text); }
.card .thumb { aspect-ratio: 16 / 10; background: var(--field); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 12px 14px 14px; }
.card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card .meta { font-size: 12px; color: var(--muted); }
.card .tags { font-size: 12px; margin-top: 6px; color: var(--muted); }
.card .tags:has(.pill) { display: flex; flex-wrap: wrap; gap: 6px; }
.card .warn { color: var(--loss-text); }
.r { font-family: var(--font-num); font-weight: 600; font-size: 16px; }
.r.win { color: var(--accent-text); }
.r.loss { color: var(--loss-text); }
.r.flat, .r.open { color: var(--muted); }
.empty { text-align: center; padding: 80px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty .btn { margin-top: 16px; }

/* ---------- Form ---------- */
form.trade { display: grid; gap: 28px; max-width: 860px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 0; display: grid; gap: 16px; }
legend { padding: 0 8px; font-family: var(--font-head); font-weight: 700; font-size: 14px; color: var(--accent-text); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 9px 11px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--field); color: var(--text);
  font: 14px var(--font-body);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-text); }
/* iPhone: ô ngày/giờ có độ rộng riêng nên tràn ra ngoài ô; ép về đúng độ rộng cột và canh trái như các ô khác */
input[type="date"], input[type="time"] { min-width: 0; max-width: 100%; min-height: 38px; -webkit-appearance: none; appearance: none; text-align: left; }
.cols > label { min-width: 0; }
textarea { resize: vertical; min-height: 64px; }
select option { background: var(--field); color: var(--text); }
.field-label { font-size: 14px; color: var(--muted); margin-bottom: 6px; }

.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.toggle button { padding: 8px 16px; border: 0; background: transparent; color: var(--muted); font: 500 14px var(--font-body); cursor: pointer; }
.toggle button + button { border-left: 1px solid var(--line); }
.toggle button.on { background: var(--accent); color: var(--on-accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: 14px var(--font-body); cursor: pointer; }
.chip.on { border-color: var(--accent-text); background: rgba(20, 184, 166, 0.15); color: var(--accent-text); }
.chip.on.bad { border-color: var(--loss-text); background: rgba(229, 72, 77, 0.15); color: var(--loss-text); }
.chip-add { width: 140px; padding: 6px 12px; border-radius: 999px; font-size: 14px; }

.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.shot {
  position: relative; aspect-ratio: 16 / 10; border: 1px dashed var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); font-size: 14px; text-align: center; cursor: pointer; overflow: hidden; background: var(--field);
}
.shot:focus, .shot.active { outline: none; border-color: var(--accent-text); border-style: solid; color: var(--text); }
.shot.dragover { border-color: var(--accent-text); background: rgba(20, 184, 166, 0.08); }
.shot b { color: var(--text); font-weight: 600; }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot .remove {
  position: absolute; top: 8px; right: 8px; z-index: 2; padding: 4px 10px; border-radius: 6px;
  border: 0; background: rgba(var(--paper), 0.8); color: var(--text); font: 12px var(--font-body); cursor: pointer;
}
.news-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: end; }
@media (max-width: 600px) { .news-row { grid-template-columns: 1fr; } }
.r-preview { padding: 9px 0; font-size: 14px; color: var(--muted); }
.r-preview.r { font-size: 16px; padding: 5px 0; }
.plan.ok { color: var(--accent-text); }
.plan.bad { color: var(--loss-text); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.error { color: var(--loss-text); font-size: 14px; }

/* ---------- Chi tiết ---------- */
.detail { display: grid; gap: 24px; }
.detail .shots-view { display: grid; gap: 16px; }
.detail figure { margin: 0; }
.detail figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.detail figcaption { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.info { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.info > div { background: var(--bg); padding: 14px 16px; }
.info dt { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.info dd { margin: 0; white-space: pre-wrap; }
.back { color: var(--muted); font-size: 14px; }
.back:hover { color: var(--text); }


/* ---------- Cửa sổ vừa (901–1200px, ví dụ kéo nhỏ cửa sổ hoặc zoom to): sidebar thu thành cột icon ---------- */
@media (min-width: 901px) and (max-width: 1200px) {
  .layout { grid-template-columns: 76px 1fr; }
  .sidebar { padding: 20px 12px; align-items: center; }
  .sidebar .brand > span:last-child, .welcome, .tagline { display: none; }
  .side-nav { width: 100%; }
  .side-nav a, .side-nav .soon { font-size: 0; justify-content: center; padding: 12px 0; }
  .side-nav .soon em { display: none; }
  .side-nav a.active::after { right: 4px; }
  .sidebar .btn-block { font-size: 0; width: 44px; height: 44px; padding: 0; }
  .sidebar .btn-block::after { content: '+'; font-size: 22px; }
  .topbar, .streak { padding-left: 24px; padding-right: 24px; }
  .stop-banner { margin-left: 24px; margin-right: 24px; }
}
/* ---------- Máy tính bảng / điện thoại: bỏ sidebar, dùng menu đáy ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { padding: 12px 16px; }
  .brand-mobile { display: flex; flex: none; }
  .brand-mobile b { white-space: nowrap; font-size: 14px; letter-spacing: 0.02em; font-stretch: 100%; font-variation-settings: "wdth" 100; }
  .scope { margin-left: auto; max-width: 150px; min-width: 0; }
  .topbar .btn-plus { margin-left: 8px !important; }
  .topbar .settings-mobile { display: inline-flex; flex: none; }
  .crumbs, .search { display: none; }
  .topbar .btn-plus { display: inline-flex; flex: none; margin-left: auto; width: 38px; height: 38px; padding: 0; font-size: 0; position: relative; }
  /* dấu + vẽ bằng 2 vạch (chữ "+" bị lệch theo font): đúng tâm ô, cùng cao 38px với nút lọc và ô tài khoản */
  .topbar .btn-plus::before, .topbar .btn-plus::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; border-radius: 1px; background: currentColor; transform: translate(-50%, -50%); }
  .topbar .btn-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
  .topbar .scope { height: 38px; }
  .streak { padding: 12px 16px 0; }
  .stop-banner { margin: 12px 16px 0; }
  main { padding: 20px 16px 96px; }
  fieldset { padding: 16px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(var(--paper), 0.96); backdrop-filter: blur(8px); border-top: 1px solid var(--line);
  }
  .bottom-nav a, .bottom-nav .soon {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    min-height: 48px; justify-content: center; font-size: 12px; color: var(--muted);
  }
  .bottom-nav a.active { color: var(--accent-text); }
}
@media (max-width: 600px) {
  .kpis-big { grid-template-columns: 1fr; }
  .kpis-small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi.kpi-big .value { font-size: 28px; }
  .kpi .value { font-size: 22px; }
  .table .hide-sm { display: none; }
  #theme-toggle { display: none; }
  .scope { max-width: 120px; }
  .cal-row { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-week-col, .cal-week { display: none; }
  .cal-day { min-height: 64px; padding: 6px; }
  .cal-day span:not(.cal-num), .cal-day small { display: none; }
  .cal-day b { font-size: 12px; }
  .cal-nav b { min-width: 0; font-size: 14px; }
  .dash-head { flex-wrap: wrap; }
  .donut { width: 96px; height: 96px; }
  .kpi-big .donut { width: 120px; height: 120px; }
  .table .show-sm { display: inline; }
  .table td, .table th { padding: 12px 14px; }
  .display { font-size: 28px; }
  .kpi { padding: 18px; }
  .value-label::before { left: -18px; }
}

/* =====================================================================
   Dashboard mới (08/11/2026): bố cục ,
   màu và font giữ branding Reset Journal.
   ===================================================================== */
main { max-width: 1480px; }

/* Sidebar: luôn nền đen (cả chế độ sáng), giống bố cục ảnh tham khảo */
:root[data-theme="light"] .sidebar {
  --ink: 244, 242, 237; --text: #F4F2ED; --bg: #09090B;
  --muted: rgba(244, 242, 237, 0.62); --line: rgba(244, 242, 237, 0.145); --surface: rgba(244, 242, 237, 0.04);
  --accent-text: #14B8A6;
  background: #09090B; color: var(--text); border-right-color: #09090B;
}
.sidebar .btn-block { margin-top: -4px; }

.dash-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
/* 14/11: tiêu đề mọi trang cùng một kiểu (giống trang Trades: h1 22px) */
.dash-top .hint { margin-top: 4px; }
.dash-top .hint b { color: var(--text); font-weight: 500; }
.dash-controls { display: flex; align-items: center; gap: 10px; }
.dash-top:has(> .dash-controls) { align-items: center; } /* Dashboard không còn dòng phụ: tiêu đề và nút Week/Month/All cùng đường giữa, tiêu đề ngang các trang khác */
.dash-controls .segmented { display: inline-grid; grid-template-columns: repeat(3, auto); margin: 0; border-radius: 10px; }
.dash-controls .segmented button { padding: 6px 16px; border-radius: 7px; }
.rule-strip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border: 1px solid var(--accent); border-radius: 10px; background: rgba(20, 184, 166, 0.08); font-size: 14px; }
.rule-strip svg { width: 18px; height: 18px; color: var(--accent-text); }

/* Thẻ (tile) */
.tile {
  min-width: 0; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  background: rgba(var(--ink), 0.035);
}
:root[data-theme="light"] .tile { background: #FFFFFF; border-color: rgba(9, 9, 11, 0.10); box-shadow: 0 1px 2px rgba(9, 9, 11, 0.06); }
.tile-head { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; min-height: 22px; }
.tile-head h3 { display: flex; align-items: center; gap: 8px; font: 600 14px var(--font-body); color: var(--text); }
.info-tip { display: inline-grid; color: var(--muted); cursor: help; border-radius: 50%; }
.info-tip svg { width: 15px; height: 15px; }
.info-tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile-link { margin-left: auto; }
.count { font: 500 12px var(--font-num); padding: 1px 7px; border-radius: 6px; background: rgba(var(--ink), 0.08); color: var(--muted); }
.tile-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 12px; min-height: 160px; text-align: center; color: var(--muted); }
.tile-empty p { margin: 0; max-width: 32ch; }
.small-hint { font-size: 12px; margin-top: 8px; }
.small-hint b { color: var(--text); font-weight: 600; }

/* Hàng 5 thẻ số */
.kpi-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi-row .tile { padding: 14px 16px; }
.kpi-row .tile-head { margin-bottom: 4px; }
.kpi-body { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 60px; }
.big { font: 600 26px/1.1 var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.big.win { color: var(--accent-text); }
.big.loss { color: var(--loss-text); }
.kpi-sub { font-size: 12px; color: var(--muted); }
.gauge-box { display: grid; justify-items: center; gap: 2px; flex: none; }
.gauge { width: 76px; height: 40px; }
.gauge circle { fill: none; stroke-width: 11; }
.gauge-counts { display: flex; gap: 4px; }
.gauge-counts span { font: 500 12px var(--font-num); padding: 0 6px; border-radius: 999px; background: rgba(var(--ink), 0.08); color: var(--muted); }
.gauge-counts span.win { background: rgba(20, 184, 166, 0.14); color: var(--accent-text); }
.gauge-counts span.loss { background: rgba(229, 72, 77, 0.14); color: var(--loss-pill); }
.mini-ring { width: 46px; height: 46px; }
.mini-ring circle { fill: none; stroke-width: 13; }
.wl { gap: 14px; }
.wl-bar { flex: 1; min-width: 70px; max-width: 140px; display: grid; gap: 4px; }
.bar2 { display: flex; height: 6px; border-radius: 999px; overflow: hidden; background: var(--line); }
.bar2 .w { background: var(--accent); }
.bar2 .l { background: var(--loss); }
.wl-nums { display: flex; justify-content: space-between; gap: 6px; font: 500 12px var(--font-num); }
.wl-nums .win { color: var(--accent-text); }
.wl-nums .loss { color: var(--loss-text); }

/* Lưới 3 cột */
.tile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }

/* Biểu đồ có trục số */
.axis-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.y-labels { position: relative; height: 200px; }
.y-labels span { position: absolute; right: 0; transform: translateY(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.axis-chart .chart-area { height: 200px; }
.chart-area .hgrid { stroke: var(--line); vector-effect: non-scaling-stroke; }

/* Reset Score (mạng nhện) */
.radar { position: relative; width: min(100%, 280px); aspect-ratio: 1; margin: 0 auto; }
.radar svg { position: absolute; inset: 12%; width: 76%; height: 76%; overflow: visible; }
.radar .ring { fill: none; stroke: var(--line); stroke-width: 0.5; }
.radar .shape { fill: rgba(20, 184, 166, 0.22); stroke: var(--accent); stroke-width: 1; }
.radar .dot { fill: var(--bg); stroke: var(--accent); stroke-width: 0.8; }
.radar span { position: absolute; transform: translate(-50%, -50%); font-size: 12px; color: var(--muted); white-space: nowrap; cursor: help; }
.radar span.disc { color: var(--text); font-weight: 500; }
.score-foot { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.score-foot small { display: block; font-size: 12px; color: var(--muted); }
.score-foot b { font: 600 26px var(--font-num); }
.bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.scale-nums { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Plan tracker */
.pt { display: grid; grid-template-columns: 34px repeat(var(--weeks), minmax(0, 18px)); gap: 4px; align-items: center; }
.pt > span:not(.pt-day):not(.pt-cell) { height: 16px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pt-day { font-size: 12px; color: var(--muted); }
.pt-cell { display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 4px; background: rgba(var(--ink), 0.07); }
button.pt-cell { cursor: pointer; }
button.pt-cell:hover, button.pt-cell:focus-visible { outline: 2px solid var(--muted); outline-offset: 1px; }
.pt-cell.ok { background: var(--accent); }
.pt-cell.bad { background: var(--loss); }
.pt-cell.unk { background: rgba(var(--ink), 0.3); }
.pt-cell.future { background: transparent; border: 1px dashed var(--line); }
.pt-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0 14px; padding: 0; font-size: 12px; color: var(--muted); }
.pt-legend li { display: flex; align-items: center; gap: 6px; }
.pt-legend .pt-cell { width: 12px; }
.pt-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pt-foot small { display: block; font-size: 12px; color: var(--muted); }
.pt-foot b { font: 600 22px var(--font-num); }
.pt-foot .bar { width: 160px; margin-top: 6px; }

/* Recent trades */
.table-wrap.flat { border: 0; border-radius: 8px; background: none; }
.table.compact th { padding: 10px 12px; background: rgba(var(--ink), 0.05); }
.table.compact td { padding: 10px 12px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.num.win { color: var(--accent-text); }
.table td.num.loss { color: var(--loss-text); }
.table.compact .status-dot { display: inline-grid; width: 18px; height: 18px; vertical-align: middle; }
.table.compact .status-dot svg { width: 12px; height: 12px; }

/* Account balance */
.bal-total { font: 600 26px var(--font-num); margin-bottom: 10px; }
.bal-list { list-style: none; margin: 0; padding: 0; }
.bal-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.bal-list small { display: block; font-size: 12px; color: var(--muted); }
.bal-list .num { text-align: right; font-variant-numeric: tabular-nums; }
.bal-list small.win { color: var(--accent-text); }
.bal-list small.loss { color: var(--loss-text); }

/* Lịch + khung ngày */
.cal-tile-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-tile-head h3 { font: 700 22px var(--font-head); }
.cal-tile-head .hint b.win { color: var(--accent-text); }
.cal-tile-head .hint b.loss { color: var(--loss-text); }
/* 14/11: đầu lịch một hàng: trái ‹ Tháng › ‹ Năm ›, phải Today + Month / Year (mọi nút cao 34px) */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-bar-left, .cal-bar-right { display: flex; align-items: center; gap: 8px; }
.cal-bar-left { gap: 20px; }
.cal-step { display: inline-flex; align-items: center; gap: 2px; }
.cal-arrow { width: 30px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.cal-arrow:hover { background: var(--line); color: var(--text); }
.cal-step-label { font: 600 18px var(--font-head); min-width: 104px; text-align: center; }
.cal-step-label.year { min-width: 52px; }
.cal-today { height: 34px; }
.cal-view { padding: 2px; height: 34px; margin: 0; grid-template-columns: repeat(2, auto); gap: 2px; }
.cal-view button { min-width: 60px; height: 28px; padding: 0 12px; font-size: 13px; border-radius: 7px; }
@media (max-width: 600px) {
  .cal-bar-left { gap: 6px; }
  .cal-step-label { font-size: 15px; min-width: 86px; }
  .cal-step-label.year { min-width: 44px; }
}
/* Chế độ Year: 12 ô tháng */
.cal-year { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.cal-year .cal-mcell { min-height: 104px; border-bottom: 1px solid var(--line); }
.cal-year .cal-mcell:nth-child(4n) { border-right: 0; }
.cal-year .cal-mcell:nth-last-child(-n + 4) { border-bottom: 0; }
.cal-year .cal-mcell .cal-num { color: var(--text); font-weight: 600; }
.cal-year .cal-mcell.today .cal-num { color: var(--on-accent); }
@media (max-width: 760px) {
  .cal-year { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cal-year .cal-mcell:nth-child(4n) { border-right: 1px solid var(--line); }
  .cal-year .cal-mcell:nth-child(3n) { border-right: 0; }
  .cal-year .cal-mcell:nth-last-child(-n + 4) { border-bottom: 1px solid var(--line); }
  .cal-year .cal-mcell:nth-last-child(-n + 3) { border-bottom: 0; }
  .cal-year .cal-mcell { min-height: 84px; }
  .cal-year .cal-mcell span:not(.cal-num), .cal-year .cal-mcell small { display: inline; }
}
.cal-tile .cal { border-radius: 10px; }
.cal-num { display: flex; align-items: center; gap: 6px; }
.cal-note { display: inline-grid; color: var(--accent-text); }
.cal-note svg { width: 14px; height: 14px; }
.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.day-panel { margin-top: 16px; padding: 16px; border: 1px solid var(--accent); border-radius: 12px; background: rgba(20, 184, 166, 0.04); }
.day-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.day-panel-head h3 { font: 600 16px var(--font-head); }
.day-actions { display: flex; gap: 8px; }
.day-cols { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; }
.day-trades { list-style: none; margin: 0; padding: 0; }
.day-trades li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.day-trades li:first-child { border-top: 0; padding-top: 0; }
.dt-main b { display: block; font-weight: 500; }
.dt-main small { display: block; font-size: 12px; color: var(--muted); }
.dt-main:hover b { color: var(--accent-text); }
.btn-sm { padding: 6px 12px; }
.day-note { display: grid; gap: 8px; align-content: start; }
.day-note label { color: var(--text); font-weight: 500; }

@media (max-width: 1150px) {
  .kpi-row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .kpi-row .tile:nth-child(-n+2) { grid-column: span 3; }
  .kpi-row .tile:nth-child(n+3) { grid-column: span 2; }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .day-cols { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .tile-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-row .tile:nth-child(n) { grid-column: span 1; }
  .kpi-row .tile:first-child { grid-column: span 2; }
  .wl { flex-direction: column; align-items: flex-start; gap: 8px; }
  .wl-bar { width: 100%; max-width: none; }
  .big { font-size: 22px; }

}

/* ---------- Lịch 7 ngày: Thứ Bảy, Chủ Nhật nền hơi tối hơn ---------- */
.cal-day.weekend { background: rgba(var(--ink), 0.025); }
.cal-day.weekend.win { background: rgba(20, 184, 166, 0.10); }
.cal-day.weekend.loss { background: rgba(229, 72, 77, 0.10); }
.cal-day, .cal-week { padding: 8px 10px; }

/* ---------- Nút « thu gọn sidebar (08/11/2026) ---------- */
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-toggle {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
}
.side-toggle:hover { color: var(--text); background: var(--surface); border-color: var(--line); }
.side-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.side-toggle svg { width: 18px; height: 18px; transition: transform .2s; }
/* Màn hình 901–1200px: menu tự thu gọn, không cần nút */
@media (min-width: 901px) and (max-width: 1200px) { .side-toggle { display: none; } }
/* Bấm nút: thu gọn thành cột icon (chỉ trên máy tính, từ 1201px) */
@media (min-width: 1201px) {
  .side-collapsed .layout { grid-template-columns: 76px 1fr; }
  .side-collapsed .sidebar { padding: 20px 12px; align-items: center; }
  .side-collapsed .side-top { flex-direction: column; gap: 12px; }
  .side-collapsed .sidebar .brand > span:last-child, .side-collapsed .tagline { display: none; }
  .side-collapsed .side-toggle svg { transform: rotate(180deg); }
  .side-collapsed .side-nav { width: 100%; }
  .side-collapsed .side-nav a { font-size: 0; justify-content: center; padding: 12px 0; }
  .side-collapsed .side-nav a.active::after { right: 4px; }
  .side-collapsed .sidebar .btn-block { font-size: 0; width: 44px; height: 44px; padding: 0; }
  .side-collapsed .sidebar .btn-block::after { content: '+'; font-size: 22px; }
}
.side-top .brand { min-width: 0; letter-spacing: 0.02em; }
.side-top .brand b { font-size: 15px; white-space: nowrap; }
@media (max-width: 600px) { .cal-day b { white-space: nowrap; letter-spacing: -0.02em; } .cal-day, .cal-week { padding: 6px 4px; } }

/* ---------- Menu mới (đợt 3) ---------- */
.side-bottom { padding-top: 12px; border-top: 1px solid var(--line); }
.tagline { margin-bottom: 0; }
@media (min-width: 1201px) {
  .side-collapsed .side-nav .soon { font-size: 0; justify-content: center; padding: 12px 0; }
  .side-collapsed .side-nav .soon em { display: none; }
}
.bottom-nav .soon { opacity: 0.45; }
.btn.is-disabled { opacity: 0.45; cursor: not-allowed; }
/* Tab của Progress Tracker */
.subtabs { display: flex; gap: 4px; padding: 16px clamp(16px, 2.5vw, 32px) 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.subtabs[hidden] { display: none; }
.subtab { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; white-space: nowrap; }
.subtab:hover { color: var(--text); }
.subtab.on { color: var(--text); border-bottom-color: var(--accent); }
.subtab.soon { cursor: default; opacity: 0.55; }
.subtab em { font-style: normal; font-size: 12px; padding: 1px 6px; margin-left: 4px; border: 1px solid var(--line); border-radius: 4px; }

/* ---------- Daily Journal ---------- */
.daily-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.daily-list { display: grid; gap: 12px; min-width: 0; }
.mini-cal { position: sticky; top: 84px; }
.day-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.day-head h3 { font: 600 16px var(--font-head); }
.day-net { font: 600 16px var(--font-num); }
.day-net.win { color: var(--accent-text); }
.day-net.loss { color: var(--loss-text); }
.note-flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--accent-text); cursor: help; }
.note-flag svg { width: 14px; height: 14px; }
.day-note-btn { margin-left: auto; }
.day-note-btn svg { width: 16px; height: 16px; }
.chev { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; }
.chev svg { width: 16px; height: 16px; transition: transform .2s; }
.chev[aria-expanded="true"] svg { transform: rotate(90deg); }
.chev:hover { border-color: var(--muted); }
.chev:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.day-card > .hint { margin-top: 12px; }
.day-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; align-items: center; margin-top: 14px; }
.day-chart .y-labels, .day-chart .chart-area { height: 130px; }
.day-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 0; margin: 0; }
.day-stats > div { padding: 0 14px; border-left: 1px solid var(--line); }
.day-stats dt { font-size: 12px; color: var(--muted); }
.day-stats dd { margin: 2px 0 0; font: 600 16px var(--font-num); font-variant-numeric: tabular-nums; }
.day-stats dd.win { color: var(--accent-text); }
.day-stats dd.loss { color: var(--loss-text); }
.day-more { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.day-more h4 { margin: 0 0 8px; font: 600 14px var(--font-body); }
.day-more .day-trades { margin-bottom: 12px; }
.day-card.open { border-color: var(--accent); }
/* Lịch nhỏ */
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.mc-head b { font: 600 16px var(--font-head); }
.mc-nav { width: 32px; height: 32px; padding: 0; }
.mc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mc-dow { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 2px; }
.mc-day { position: relative; aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--text); font: 12px var(--font-num); cursor: pointer; }
.mc-day:hover { border-color: var(--muted); }
.mc-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mc-day.win { background: rgba(20, 184, 166, 0.18); border-color: rgba(20, 184, 166, 0.5); }
.mc-day.loss { background: rgba(229, 72, 77, 0.16); border-color: rgba(229, 72, 77, 0.5); }
/* Hôm nay: viền đậm theo MÀU CỦA NGÀY (xanh nếu lời, đỏ nếu lỗ), không đè viền xanh lên ô đỏ (trước đây ô hôm nay lỗ bị nửa xanh nửa đỏ) */
.mc-day.today { font-weight: 700; box-shadow: inset 0 0 0 1px var(--accent); }
.mc-day.today.win { border-color: #14B8A6; box-shadow: inset 0 0 0 1px #14B8A6; }
.mc-day.today.loss { border-color: #E5484D; box-shadow: inset 0 0 0 1px #E5484D; }
.mc-day.has-note::after { content: ''; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-text); }
@media (max-width: 1150px) {
  .daily-layout { grid-template-columns: 1fr; }
  .mini-cal { position: static; order: -1; max-width: 360px; }
  .day-body { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .day-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .day-more { grid-template-columns: 1fr; }
  .day-note-btn { margin-left: 0; }
  .dash-controls { flex-wrap: wrap; }
  .mini-cal { max-width: none; }
}

/* ---------- Progress Tracker · Daily checklist (đợt 4) ---------- */
.tile-grid.two { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
.check-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.check-head h3 { font: 700 22px var(--font-head); }
.check-head .btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li + li { border-top: 1px solid var(--line); }
.check-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; color: var(--text); font-size: 16px; cursor: pointer; min-height: 48px; }
.check-item input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }
.check-item:has(input:checked) span { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(var(--ink), 0.35); }
.check-item.auto { cursor: help; }
.check-item small { display: block; font-size: 12px; color: var(--muted); }
.check-item em { margin-left: auto; font-style: normal; font-size: 12px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.auto-box { display: grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 5px; background: var(--accent); color: var(--on-accent); }
.auto-box svg { width: 14px; height: 14px; }
.check-item.missed .auto-box { background: var(--loss); color: #fff; }
.check-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.check-foot small { display: block; font-size: 12px; color: var(--muted); }
.check-foot b { font: 600 22px var(--font-num); }
.check-foot .bar { width: 180px; margin-top: 6px; }
.check-links { display: flex; align-items: center; gap: 12px; }
.pt-cell.l1 { background: rgba(20, 184, 166, 0.25); }
.pt-cell.l2 { background: rgba(20, 184, 166, 0.5); }
.pt-cell.l3 { background: rgba(20, 184, 166, 0.75); }
.pt-cell.l4 { background: var(--accent); }
.pt-cell.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.heat-legend .pt-cell { width: 12px; }
.heat-legend span:first-child { margin-right: 4px; }
.heat-legend span:last-child { margin-left: 4px; }
.check-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.check-stats dt { font-size: 12px; color: var(--muted); }
.check-stats dd { margin: 2px 0 0; font: 600 16px var(--font-num); }
@media (max-width: 1150px) { .tile-grid.two { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .check-stats { grid-template-columns: 1fr 1fr; } .check-foot { flex-wrap: wrap; } }
@media (max-width: 900px) {
  /* 6 mục như menu bên máy tính: Dashboard, Daily, Trades, Models, Accounts, Notebook */
  .bottom-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); padding-left: 4px; padding-right: 4px; }
  .bottom-nav a { font-size: 10px; gap: 3px; min-width: 0; text-align: center; justify-content: flex-start; padding-top: 4px; line-height: 1.15; }
}

/* ---------- Hộp xác nhận + menu chuột phải (08/11) ---------- */
dialog.ask { width: min(440px, calc(100vw - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--field); color: var(--text); }
:root:not([data-theme="light"]) dialog.ask { background: #141417; }
dialog.ask::backdrop { background: rgba(9, 9, 11, 0.55); }
dialog.ask h3 { font: 700 16px var(--font-head); margin-bottom: 8px; }
.ask-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.ctx-menu { position: fixed; z-index: 50; min-width: 160px; padding: 6px; display: grid; border: 1px solid var(--line); border-radius: 10px; background: var(--field); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
:root:not([data-theme="light"]) .ctx-menu { background: #141417; }
.ctx-menu button { padding: 8px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: 14px var(--font-body); text-align: left; cursor: pointer; }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: rgba(var(--ink), 0.07); outline: none; }
.ctx-menu button.danger { color: var(--loss-text); }
.btn.btn-danger-solid { background: var(--loss); border-color: var(--loss); color: #fff; font-weight: 600; }
.btn.btn-danger-solid:hover { filter: brightness(1.08); }
.btn.btn-danger-solid:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Reset Score: nhãn nằm ngoài biểu đồ, canh theo phía (08/11) ---------- */
.radar { --rs: 180px; width: 100%; max-width: none; aspect-ratio: auto; height: 272px; margin: 0; }
.radar svg { inset: auto; left: 50%; top: 50%; width: var(--rs); height: var(--rs); transform: translate(-50%, -50%); }
.radar span { display: grid; gap: 1px; max-width: 96px; white-space: normal; line-height: 1.25; transform: none; color: var(--muted); }
.radar span b { font: 600 14px var(--font-num); color: var(--text); }
.radar span.side-r { transform: translate(0, -50%); text-align: left; }
.radar span.side-l { transform: translate(-100%, -50%); text-align: right; justify-items: end; }
.radar span.side-t { transform: translate(-50%, -100%); text-align: center; justify-items: center; white-space: nowrap; max-width: none; }
.radar span.side-b { transform: translate(-50%, 0); text-align: center; justify-items: center; white-space: nowrap; max-width: none; }
.radar span.side-t b, .radar span.side-b b { display: inline; }

/* ---------- Thanh trên: All accounts nằm sát nút sáng/tối ---------- */
@media (min-width: 901px) { .topbar .search { margin-left: auto; } .topbar .scope { margin-left: 0; } }

/* ---------- Thông báo nhỏ + Undo (Cmd/Ctrl+Z) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 10px 12px 10px 16px;
  border-radius: 10px; background: #F4F2ED; color: #09090B; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); font-size: 14px;
  transition: opacity .2s, transform .2s;
}
:root[data-theme="light"] .toast { background: #09090B; color: #F4F2ED; }
.toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { flex: none; padding: 6px 10px; border: 0; border-radius: 6px; background: rgba(20, 184, 166, 0.18); color: inherit; font: 600 14px var(--font-body); cursor: pointer; }
.toast kbd, .hint kbd { font: 500 12px var(--font-body); padding: 1px 5px; margin-left: 4px; border: 1px solid currentColor; border-radius: 4px; opacity: 0.7; }
@media (max-width: 900px) { .toast { bottom: 88px; } }

/* ---------- Settings · Trash ---------- */
.trash-list { list-style: none; margin: 0; padding: 0; width: 100%; }
.trash-list li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.trash-list li > span { flex: 1; min-width: 0; }
.trash-list b { display: block; font-weight: 500; }
.trash-list small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .trash-list li { flex-wrap: wrap; } .trash-list li > span { flex-basis: 100%; } }

/* ---------- Notebook ---------- */
.nb-searchbar { position: relative; max-width: 420px; margin-bottom: 12px; }
.nb-searchbar svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.nb-searchbar input { padding-left: 34px; }
.nb { display: grid; grid-template-columns: 220px 280px minmax(0, 1fr); gap: 12px; align-items: start; }
.nb-folders { gap: 2px; padding: 12px; }
.nb-add-folder { width: 100%; justify-content: flex-start; margin-bottom: 8px; }
.nb-sec { margin: 6px 8px 6px; font-size: 12px; color: var(--muted); }
.nb-f { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: 14px var(--font-body); text-align: left; cursor: pointer; }
.nb-f span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-f small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.nb-f:hover { background: rgba(var(--ink), 0.05); }
.nb-f.on { background: rgba(20, 184, 166, 0.14); color: var(--accent-text); font-weight: 500; }
.nb-f-row { display: flex; align-items: center; gap: 2px; }
.nb-f-row .nb-f { flex: 1; min-width: 0; }
.nb-more { flex: none; width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; letter-spacing: 1px; }
.nb-more:hover { background: rgba(var(--ink), 0.06); color: var(--text); }
.nb-list { padding: 12px; }
.nb-list-head { margin-bottom: 8px; }
.nb-list-head .btn { width: 100%; }
.nb-logday { width: 100%; justify-content: space-between; }
.nb-logday input { width: auto; }
.nb-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 70vh; overflow-y: auto; }
.nb-item { display: grid; gap: 2px; width: 100%; padding: 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; cursor: pointer; font: 14px var(--font-body); }
.nb-item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-item small { font-size: 12px; color: var(--muted); }
.nb-item span { font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nb-item:hover { background: rgba(var(--ink), 0.05); }
.nb-item.on { background: rgba(var(--ink), 0.09); }
.nb-item:focus-visible, .nb-f:focus-visible, .nb-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nb-empty { padding: 12px 8px; }
.nb-editor { min-height: 480px; padding: 18px 22px; }
.nb-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.nb-title { border: 0; background: transparent; padding: 4px 0; font: 700 22px var(--font-head); color: var(--text); }
.nb-title:focus { outline: none; border: 0; }
.nb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.nb-row select { width: auto; }
.nb-toolbar { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.nb-tool { min-width: 34px; height: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font: 14px var(--font-body); cursor: pointer; }
.nb-tool:hover { background: rgba(var(--ink), 0.07); }
.nb-sep { width: 1px; height: 20px; margin: 0 4px; background: var(--line); }
.nb-body { min-height: 320px; padding: 14px 2px; font-size: 16px; line-height: 1.6; outline: none; }
.nb-body:empty::before { content: attr(data-placeholder); color: var(--muted); }
.nb-body h3 { font: 700 18px var(--font-head); margin: 12px 0 4px; }
.nb-body ul, .nb-body ol { padding-left: 22px; }
.nb-day-title { font: 700 22px var(--font-head); color: var(--text); margin: 0 0 4px; }
.nb-editor .day-body { margin: 6px 0 14px; }
.nb-label { margin-top: 6px; color: var(--text); font-weight: 500; }
.nb-day-text { min-height: 200px; font-size: 16px; line-height: 1.6; }
.nb-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 1150px) {
  .nb { grid-template-columns: 200px minmax(0, 1fr); }
  .nb-editor { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .nb { grid-template-columns: 1fr; }
  .nb-items { max-height: 40vh; }
  .nb-editor { padding: 16px; }
}
.tile.set-block { align-items: flex-start; }
.tile.set-block .trash-list { align-self: stretch; }

/* Server cũ: dải cảnh báo trên cùng */
.server-banner { margin: 12px clamp(16px, 2.5vw, 32px) 0; padding: 12px 16px; border-radius: 10px; background: var(--loss); color: #fff; font-size: 14px; }

/* ---------- Trades: chọn nhiều lệnh bằng kéo chuột ---------- */
.gallery-area { min-height: 60vh; padding-bottom: 40px; user-select: none; -webkit-user-select: none; }
.marquee { position: fixed; z-index: 40; border: 1px solid var(--accent); background: rgba(20, 184, 166, 0.12); border-radius: 4px; pointer-events: none; }
.card { position: relative; }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.sel-check { position: absolute; top: 8px; left: 8px; z-index: 2; display: none; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: var(--accent); color: var(--on-accent); }
.sel-check svg { width: 16px; height: 16px; }
.card.sel .sel-check { display: grid; }
.sel-bar { position: sticky; top: 72px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 10px; background: var(--field); }
.sel-bar[hidden] { display: none; }
.sel-bar .hint { margin-left: auto; font-size: 12px; }
.sel-tip { font-size: 12px; margin: -12px 0 12px; }
/* Thanh "N selected" nổi ở đáy, không đẩy các thẻ xuống khi đang kéo chọn */
.sel-bar { position: fixed; top: auto; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 45; margin: 0; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); }
.sel-bar .hint { margin-left: 8px; }
@media (max-width: 900px) { .sel-bar { bottom: 88px; } }

/* ---------- Nhập nhanh kết quả ngày trên lịch ---------- */
.quick-add { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.qa-label { font-weight: 600; font-size: 14px; }
.qa-field { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; color: var(--muted); }
.qa-field input { width: 120px; }
.quick-add .saved { flex-basis: 100%; }
.quick-add .saved:empty { display: none; }
.day-quick { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.day-quick .quick-add { margin: 0; }
.day-quick + .day-more { margin-top: 12px; padding-top: 0; border-top: 0; }

/* ---------- Gõ số ngay trong ô lịch ---------- */
.cal-day.editing { outline: 2px solid var(--accent); outline-offset: -2px; gap: 4px; }
.cal-input { width: 100%; padding: 6px 8px; font: 600 16px var(--font-num); border-color: var(--accent); }
.cal-day.editing small { font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .cal-input { padding: 4px; font-size: 14px; } .cal-day.editing small { display: none; } }
/* Ô lịch đang gõ: 2 ô nhỏ $ và R */
.cal-field { display: grid; grid-template-columns: 14px minmax(0, 1fr); align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.cal-day.editing .cal-input { padding: 4px 6px; font-size: 14px; }
@media (max-width: 600px) { .cal-field { grid-template-columns: minmax(0, 1fr); } .cal-field span { display: none; } }
.test-banner { margin: 12px clamp(16px, 2.5vw, 32px) 0; padding: 12px 16px; border-radius: 10px; background: #F5C542; color: #09090B; font-size: 14px; }
.test-banner a { text-decoration: underline; font-weight: 600; }

/* ---------- Khung ngày giữa màn hình ---------- */
dialog.day-modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow-y: auto;
  padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--field); color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
:root:not([data-theme="light"]) dialog.day-modal { background: #141417; }
dialog.day-modal::backdrop { background: rgba(9, 9, 11, 0.6); }
.dm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 22px 12px; }
.dm-head h2 { font: 700 22px var(--font-head); color: var(--text); margin: 0 0 2px; }
.dm-x { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; }
.dm-x svg { width: 16px; height: 16px; }
.dm-x:hover { border-color: var(--muted); }
.dm-quick { margin: 0 22px; padding: 14px; border: 1px solid var(--accent); border-radius: 12px; background: rgba(20, 184, 166, 0.06); }
.dm-label { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dm-label .hint { font-size: 12px; }
.dm-fields { display: grid; grid-template-columns: 80px 1fr 1fr auto; gap: 10px; align-items: end; }
.dm-fields label { font-size: 12px; }
.dm-fields input { font: 600 16px var(--font-num); }
.dm-tip { font-size: 12px; margin-top: 8px; }
.dm-quick .saved:empty { display: none; }
.dm-sec { margin: 16px 22px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.dm-sec h3 { font: 600 14px var(--font-body); margin-bottom: 6px; }
.dm-note-label { color: var(--text); font-weight: 600; margin-bottom: 6px; }
.dm-sec .list-actions { margin-top: 8px; }
.dm-foot { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 18px; padding: 14px 22px 20px; border-top: 1px solid var(--line); }
.dm-foot .btn-danger { margin-right: auto; }
.dm-foot a.btn:first-child { margin-right: auto; }
@media (max-width: 600px) {
  .dm-fields { grid-template-columns: 1fr 1fr 1fr; }
  .dm-fields .btn { grid-column: 1 / -1; }
}
.dm-foot .btn-danger { margin-right: 0; }

/* ---------- Khung giải thích (i) ---------- */
.info-tip { padding: 2px; border: 0; background: transparent; cursor: pointer; }
.info-tip:hover { color: var(--accent-text); }
.radar span[data-tip] { cursor: pointer; }
.radar span[data-tip]:hover, .radar span[data-tip]:focus-visible { color: var(--accent-text); outline: none; }
.tip-pop {
  position: fixed; z-index: 70; max-width: min(320px, calc(100vw - 16px)); padding: 12px 14px;
  border-radius: 10px; background: #F4F2ED; color: #09090B; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  font: 14px/1.5 var(--font-body); white-space: pre-line; pointer-events: none;
}
:root[data-theme="light"] .tip-pop { background: #09090B; color: #F4F2ED; }

/* ---------- Accounts: kiểu thẻ mới ---------- */
.kpi-row.acc-sum { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
@media (max-width: 1150px) { .kpi-row.acc-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } .kpi-row.acc-sum .tile { grid-column: auto !important; } }
@media (max-width: 700px) { .kpi-row.acc-sum { grid-template-columns: 1fr; } }
.acc-grid { gap: 12px; }
.acc-card { gap: 0; }
.acc-form { display: grid; gap: 16px; margin-bottom: 16px; border-color: var(--accent); }

/* ---------- Form tài khoản: chọn loại bằng thẻ ---------- */
.acc-types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.acc-type { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--text); }
.acc-type input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.acc-type b { display: block; font-weight: 600; font-size: 14px; }
.acc-type small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.acc-type:hover { border-color: var(--muted); }
.acc-type.on { border-color: var(--accent); background: rgba(20, 184, 166, 0.08); }
.acc-type-hint { margin-top: -8px; }
@media (max-width: 1000px) { .acc-types { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .acc-types { grid-template-columns: 1fr; } }
/* Ô chỉ dành cho prop: ẩn thật khi chọn Live/Demo (thuộc tính hidden bị display:grid của .cols ghi đè) */
.prop-only[hidden] { display: none !important; }
/* Sửa tài khoản: form chiếm cả hàng (không bị nhét vào 1 cột thẻ hẹp), thẻ loại tự xuống hàng theo chiều rộng */
.acc-grid .acc-form { grid-column: 1 / -1; }
.acc-types { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important; }
.acc-type b, .acc-type small { overflow-wrap: anywhere; }

/* Nút "+" khi sidebar thu gọn: vẽ dấu + bằng 2 vạch, canh giữa tuyệt đối
   (trước đây dấu + là chữ, bị lệch phải 3px do khoảng cách gap và lệch xuống do chiều cao dòng) */
@media (min-width: 901px) and (max-width: 1200px) {
  .sidebar .btn-block { gap: 0; justify-content: center; align-items: center; }
  .sidebar .btn-block::after {
    content: ''; width: 16px; height: 16px; font-size: 0;
    background: linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat,
                linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  }
}
@media (min-width: 1201px) {
  .side-collapsed .sidebar .btn-block { gap: 0; justify-content: center; align-items: center; }
  .side-collapsed .sidebar .btn-block::after {
    content: ''; width: 16px; height: 16px; font-size: 0;
    background: linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat,
                linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  }
}

/* Khung ngày: ngày đã có lệnh → 3 ô chỉ hiện tổng, khoá lại */
.dm-quick.locked .dm-fields { grid-template-columns: 80px 1fr 1fr; }
.dm-quick.locked input { background: transparent; border-style: dashed; color: var(--text); cursor: default; }
@media (max-width: 640px) { .dm-quick.locked .dm-fields { grid-template-columns: 1fr 1fr 1fr; } }

/* ---------- Models (09/11) ---------- */
.model-pick { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.model-pick-head { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; }
.model-pick-head label { flex: 1 1 220px; }
/* Link canh giữa đúng chiều cao ô chọn "No model", có gạch chân */
.model-pick-head .link { align-self: flex-end; display: inline-flex; align-items: center; height: 40px; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.mc-row { display: grid; grid-template-columns: 56px auto auto; justify-content: start; gap: 14px; align-items: center; }
.mc-row.editor { grid-template-columns: 130px 1fr; align-items: start; }
.mc-row.editor .mc-tier { padding-top: 7px; }
.mc-tier { font: 600 12px var(--font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.mc-score { margin: 2px 0 0; font-size: 15px; }
.mc-score b { font: 700 18px var(--font-num); }
.mc-score b.win { color: var(--accent-text); } .mc-score b.loss { color: var(--loss-text); }
.mc-yes, .mc-no { display: inline-flex; align-items: center; gap: 3px; margin-right: 8px; white-space: nowrap; }
.mc-yes svg, .mc-no svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.mc-yes { color: var(--accent-text); } .mc-no { color: var(--loss-text); text-decoration: line-through; text-decoration-thickness: 1px; }
.score-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font: 600 12px var(--font-num); border: 1px solid var(--line); color: var(--text); vertical-align: middle; }
.score-badge.win { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.score-badge.loss { color: var(--loss-text); border-color: color-mix(in srgb, var(--loss) 45%, transparent); }
.few { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); vertical-align: middle; }
.few svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; }
.models-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 12px; }
.model-form { grid-column: 1 / -1; display: grid; gap: 14px; }
.model-card .model-items { display: grid; gap: 6px; font-size: 14px; }
.model-actions { margin-left: auto; display: flex; gap: 6px; }
.model-stats .tile-head { flex-wrap: wrap; }
.model-stats .segmented { margin-left: auto; }
.mp-tile { grid-column: 1 / -1; }
.mp-list { display: grid; gap: 4px; }
.mp-row { display: grid; grid-template-columns: minmax(90px, 180px) 1fr 52px 120px; gap: 12px; align-items: center; padding: 8px 6px; border-radius: 8px; color: inherit; text-decoration: none; }
.mp-row:hover { background: var(--surface); }
.mp-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.mp-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.mp-win { font: 700 15px var(--font-num); text-align: right; }
.mp-n { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) {
  .mc-row, .mc-row.editor { grid-template-columns: 1fr; gap: 6px; }
  .mp-row { grid-template-columns: 1fr 52px; }
  .mp-bar { grid-column: 1 / -1; grid-row: 2; }
  .mp-n { grid-column: 1 / -1; }
}
.model-stats td:first-child { white-space: nowrap; }

/* ---------- Form lệnh gọn: 4 khối, 2 cột (09/11) ---------- */
form.trade.trade-v2 { max-width: 1180px; gap: 16px; }
.tf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tf-charts .shot { aspect-ratio: 4 / 3; }
.trade-v2 fieldset { gap: 14px; padding: 16px 18px; }
.trade-v2 .cols.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trade-v2 .cols.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trade-v2 .tf-charts .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trade-v2 .tf-charts .hint { margin: 0; font-size: 13px; }
.trade-v2 textarea { min-height: 0; }
.opt { color: var(--muted); font-weight: 400; font-size: 12px; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
@media (max-width: 1000px) { .tf-grid { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .trade-v2 .cols.c3 { grid-template-columns: 1fr 1fr; }
  .trade-v2 .cols.c3 label:last-child { grid-column: 1 / -1; }
  .trade-v2 .tf-charts .shots { grid-template-columns: 1fr; }
  .sticky-actions { bottom: 64px; } /* chừa chỗ cho menu đáy điện thoại */
}
.tf-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.trade-v2 fieldset { min-width: 0; } /* fieldset mặc định không co lại, làm ảnh tràn ra ngoài */
.tf-charts .shot { padding: 8px; font-size: 12px; }
.tf-charts .shot span:last-of-type { display: none; } /* câu hướng dẫn dài đã có ở trên khối */
.tf-charts .shot { min-width: 0; }
/* What I saw + By condition + Test a combo (09/11) */
.chip.need { position: relative; }
.chip.need::after { content: ''; position: absolute; top: 3px; right: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.need-key { color: var(--accent-text); font-weight: 700; }
.mc-seen { display: inline-block; margin-right: 8px; color: var(--text); }
.cond-table td.mc-tier { width: 56px; }
.combo { display: grid; gap: 10px; }
.combo-result { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); justify-items: start; }
.combo-result p { margin: 0; }
.combo-result .btn { margin-top: 6px; }
.mc-row { align-items: start; } .mc-row .mc-tier { padding-top: 7px; }
/* My steps (09/11) */
.steps-tile { margin-bottom: 12px; display: grid; gap: 10px; }
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; counter-reset: step; }
.steps-list li { counter-increment: step; display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.steps-list li::before { content: counter(step); flex: 0 0 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 600 12px var(--font-num); background: var(--surface); border: 1px solid var(--line); align-self: start; }
.steps-list li.editing { display: block; } .steps-list li.editing::before { display: none; }
.step-main { flex: 1; min-width: 0; } .step-main .hint { font-size: 13px; margin-top: 2px; }
.step-tfs { font: 600 12px var(--font-num); color: var(--accent-text); margin-left: 6px; }
.step-form { display: grid; gap: 12px; }
.chip.on + .chip-add, .chips .chip-add { }
[data-step-items] .chip:not(.on) { text-decoration: line-through; opacity: .55; }
.mc-tf.chips { flex-wrap: nowrap; }
.models-grid > .empty { grid-column: 1 / -1; padding: 24px; }
.mc-row .mc-tf { justify-self: start; width: auto; }
/* Khối Setup thoáng hơn, chỉ còn Model (09/11) */
.trade-v2 .tf-setup { gap: 22px; }
.trade-v2 .tf-setup .field-label { margin-bottom: 8px; }
.trade-v2 .model-pick { padding: 16px 18px; gap: 14px; }
#model-check[hidden] { display: none; }
#model-check { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.mc-title { margin: 0; font-size: 13px; color: var(--muted); }
.mc-chips { gap: 10px; }
.mc-chips .chip { padding: 8px 14px; }
.mc-step { color: var(--muted); font-size: 12px; }
.chip.on .mc-step { color: inherit; opacity: .75; }
.trade-v2 .mc-score { margin: 0; }
/* Xem ảnh lớn trong form lệnh (09/11) */
dialog.img-view { width: min(96vw, 1400px); max-height: 94vh; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text); overflow: hidden; }
dialog.img-view::backdrop { background: rgba(0, 0, 0, 0.75); }
.img-view header { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.img-view .iv-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.img-view .iv-body { display: grid; place-items: center; padding: 10px; max-height: calc(94vh - 100px); overflow: auto; cursor: zoom-out; }
.img-view .iv-body img { max-width: 100%; max-height: calc(94vh - 120px); object-fit: contain; cursor: default; }
.img-view .iv-tip { margin: 0; padding: 0 14px 10px; font-size: 12px; }
.shot img { cursor: zoom-in; }
.mc-no-plain { display: inline-flex; align-items: center; gap: 3px; color: var(--loss-text); } .mc-no-plain svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; }
/* Setup theo + trang Review (10/11) */
.setup-flow { margin: -4px 0 0; font-size: 12px; letter-spacing: .02em; }
.pda-tf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.pda-tf .hint { font-size: 12px; }
.aligned-line { margin: 8px 0 0; font-size: 13px; display: flex; align-items: center; gap: 4px; min-height: 18px; color: var(--muted); }
.aligned-line.win { color: var(--accent-text); } .aligned-line.loss { color: var(--loss-text); }
.aligned-line svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.review-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.rv-nav { display: flex; align-items: center; gap: 8px; }
.rv-label { font: 600 15px var(--font-head); min-width: 120px; text-align: center; }
.rv-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.rv-summary > div { display: grid; gap: 2px; }
.rv-summary small { color: var(--muted); font-size: 12px; }
.rv-summary b { font: 700 22px var(--font-num); }
.rv-summary b.win { color: var(--accent-text); } .rv-summary b.loss { color: var(--loss-text); }
.rv-summary .hint { font-size: 12px; }
.delta { font: 600 12px var(--font-num); color: var(--muted); }
.delta.win { color: var(--accent-text); } .delta.loss { color: var(--loss-text); }
.rv-table td:first-child { white-space: nowrap; }
.rv-foot { font-size: 12px; margin: 4px 0 16px; }
.models-manage { display: grid; gap: 10px; margin-top: 12px; }
.model-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.model-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.model-list li .hint { font-size: 12px; }
.model-list .model-actions { margin-left: auto; }
.model-inline { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.model-inline input { flex: 1 1 200px; width: auto; }
@media (max-width: 640px) { .rv-summary { grid-template-columns: 1fr 1fr; } }
.rv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.rv-grid .model-stats { margin: 0; }
@media (max-width: 1100px) { .rv-grid { grid-template-columns: 1fr; } }

/* ---------- Setup chỉnh chu (10/11): nhãn cột trái, mọi nút/chip cao đều 34px ---------- */
.trade-v2 .tf-setup { gap: 0; }
.trade-v2 .setup-flow { margin: 0 0 6px; font: 600 11px var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.trade-v2 .setup-flow span { color: var(--accent-text); margin: 0 4px; }
.su-step { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.su-step:first-of-type { border-top: 0; }
.su-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 600 11px var(--font-num); color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); margin-top: 6px; }
.su-extra .su-num { border-color: transparent; }
.su-body { display: grid; gap: 12px; min-width: 0; }
.su-row { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; }
.su-label { font-size: 13px; color: var(--muted); padding-top: 8px; }
.su-ctl { display: grid; gap: 10px; min-width: 0; }
.su-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.su-sub { font-size: 12px; color: var(--muted); }
.trade-v2 .pda-tf { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.trade-v2 .aligned-line { margin: 0; min-height: 0; }
.su-select { width: auto; min-width: 200px; height: 34px; padding: 0 10px; }
.trade-v2 .su-row textarea { min-height: 60px; }
/* chiều cao đều cho nút chọn, chip và ô + Add trong form lệnh */
.trade-v2 .toggle button { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; }
.trade-v2 .chips { gap: 8px; }
.trade-v2 .chip { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; }
.trade-v2 .chip-add { height: 34px; width: 110px; padding: 0 12px; }
@media (max-width: 640px) {
  .su-row { grid-template-columns: 1fr; gap: 6px; }
  .su-label { padding-top: 0; }
  .su-step { grid-template-columns: 22px 1fr; gap: 10px; }
}
.su-inline .link { font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Models & Review chỉnh chu (10/11) ---------- */
.rv-head { align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.rv-head .review-bar { margin: 0; gap: 12px; }
.rv-nav { display: flex; align-items: center; gap: 6px; }
.rv-arrow { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.rv-arrow:hover:not([disabled]) { background: var(--surface); }
.rv-arrow[disabled] { opacity: .35; cursor: default; }
.rv-head .segmented button { height: 34px; }
.rv-label { min-width: 150px; font: 600 14px var(--font-head); }
/* Chế độ All không có nút ‹ ›: nhãn nằm sát lề trái, không canh giữa */
.rv-nav .rv-label:first-child { min-width: 0; text-align: left; }
.rv-summary { padding: 18px 20px; gap: 0; }
.rv-summary > div { padding: 0 20px; border-left: 1px solid var(--line); gap: 4px; }
.rv-summary > div:first-child { padding-left: 0; border-left: 0; }
.rv-summary b { font-size: 26px; line-height: 1.1; }
.rv-h2 { font: 700 13px var(--font-head); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 10px; }
.m-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.m-card { display: grid; gap: 10px; align-content: start; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); min-height: 168px; text-align: left; color: var(--text); font: inherit; }
.m-card header { display: flex; align-items: center; gap: 8px; min-width: 0; }
.m-card header b { font: 600 15px var(--font-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-card.none header b { color: var(--muted); }
.m-card[data-card] { cursor: pointer; transition: border-color .15s, background-color .15s; }
.m-card[data-card]:hover { border-color: var(--accent-text); }
.m-card[data-card]:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.m-card.gone header b { color: var(--muted); }
.m-more { margin-left: auto; width: 28px; height: 28px; border-radius: 6px; border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; }
.m-more:hover { background: var(--line); color: var(--text); }
.m-win { display: flex; align-items: baseline; gap: 6px; }
.m-win span { font: 700 30px var(--font-num); line-height: 1; }
.m-win small { color: var(--muted); font-size: 12px; }
.m-line { margin: 0; font-size: 13px; color: var(--muted); min-height: 18px; }
.m-line .win { color: var(--accent-text); } .m-line .loss { color: var(--loss-text); }
.rv-bar { display: block; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.rv-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.m-new { place-items: center; place-content: center; gap: 6px; border-style: dashed; background: transparent; color: var(--muted); cursor: pointer; text-align: center; }
.m-new span { font-size: 26px; line-height: 1; color: var(--accent-text); }
.m-new:hover { color: var(--text); border-color: var(--accent-text); }
.m-card.editing { align-content: center; }
.m-card.editing input { height: 36px; }
.m-card-actions { display: flex; gap: 8px; justify-content: flex-end; }
.rv-error { margin: 8px 0 0; }
.rv-breakdown { margin-top: 22px; display: grid; gap: 14px; }
/* Review 4 khối (14/11) */
.rv-block { margin-top: 16px; display: grid; gap: 12px; }
.rv-block .tile-head { margin-bottom: 0; }
.rv-block .tile-empty { min-height: 0; padding: 4px 0; display: block; text-align: left; }
.rv-block .tile-empty p { margin: 0; max-width: none; }
.rv-lead { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.5; }
.rv-lead b { color: var(--text); }
.rv-lead b.loss, .rv-lead .loss { color: var(--loss-text); }
.rv-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rv-compare > div { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.rv-compare small, .rv-hour small { display: block; font-size: 12px; color: var(--muted); }
.rv-compare b { font: 600 18px var(--font-num); }
.rv-compare .win { color: var(--accent-text); } .rv-compare .loss, .rv-hour .loss { color: var(--loss-text); } .rv-hour .win { color: var(--accent-text); }
.rv-hours { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rv-hour { margin: 0; display: block; line-height: 1.6; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; color: var(--muted); }
.rv-hour b { color: var(--text); font: 600 15px var(--font-num); }
@media (max-width: 640px) { .rv-compare, .rv-hours { grid-template-columns: 1fr; } }
.rv-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.rv-tabs button { height: 36px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font: 500 14px var(--font-body); cursor: pointer; margin-bottom: -1px; }
.rv-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.rv-tabs button:hover { color: var(--text); }
.rv-rows { display: grid; }
.rv-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(160px, 2fr) 70px 80px 90px 90px; gap: 14px; align-items: center; padding: 11px 4px; border-top: 1px solid var(--line); font-size: 14px; }
.rv-row.head { border-top: 0; padding-top: 0; font-size: 12px; color: var(--muted); }
.rv-row .num { text-align: right; font-family: var(--font-num); }
.rv-row .num.win { color: var(--accent-text); } .rv-row .num.loss { color: var(--loss-text); }
.rv-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-winc { display: grid; grid-template-columns: 1fr 44px; gap: 10px; align-items: center; }
.rv-winc b { font: 600 14px var(--font-num); text-align: right; }
@media (max-width: 640px) {
  /* 4 tab Breakdown: lưới 2 cột đều nhau, thẳng hàng */
  .rv-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; }
  .rv-tabs button { padding: 0 4px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 760px) {
  .rv-summary { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .rv-summary > div:nth-child(3) { padding-left: 0; border-left: 0; }
  /* 14/11: tên + Win % một hàng, các số một hàng 4 cột (có tiêu đề cột) cho gọn */
  .rv-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 10px; }
  .rv-row > :nth-child(1) { grid-column: 1 / 3; }
  .rv-row > :nth-child(2) { grid-column: 3 / 5; }
  .rv-row.head > :nth-child(1), .rv-row.head > :nth-child(2) { display: none; }
  .rv-row.head { padding-bottom: 2px; }
  .rv-row.head > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rv-row .num { text-align: left; font-size: 13px; }
}
.su-row > .toggle, .su-ctl > .toggle { justify-self: start; }

/* ---------- Nét vẽ trên ảnh chart (10/11) ---------- */
.anno-wrap { position: relative; display: block; line-height: 0; }
.anno-wrap img { display: block; width: 100%; height: auto; }
.anno-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.anno-stage { position: relative; display: inline-block; line-height: 0; max-width: 100%; }
.anno-stage img { display: block; }
.anno-stage .anno-svg { pointer-events: none; }
dialog.img-view.drawing .anno-stage .anno-svg { pointer-events: all; cursor: crosshair; touch-action: none; }
dialog.img-view.drawing .anno-stage[data-mode="erase"] .anno-svg { cursor: pointer; }
dialog.img-view.drawing .anno-stage[data-mode="erase"] .mk:hover { opacity: .45; }
dialog.img-view.drawing .anno-stage[data-mode="text"] .anno-svg { cursor: text; }
dialog.img-view.drawing .iv-body { cursor: default; }
.shot svg.anno-svgimg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mark-badge { position: absolute; left: 8px; bottom: 8px; z-index: 2; padding: 2px 8px; border-radius: 6px; background: rgba(var(--paper), 0.85); color: var(--text); font: 600 11px var(--font-body); }
.iv-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.iv-tools[hidden] { display: none; }
.iv-group { display: flex; align-items: center; gap: 6px; }
.iv-group + .iv-group { padding-left: 14px; border-left: 1px solid var(--line); }
.iv-tool { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 500 13px var(--font-body); cursor: pointer; }
.iv-tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.iv-tool:hover { color: var(--text); }
.iv-tool.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.iv-color { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--c); cursor: pointer; }
.iv-color.on { outline: 2px solid var(--text); outline-offset: 2px; }
.anno-text { position: absolute; transform: translateY(-50%); z-index: 3; line-height: normal; }
.anno-text input { width: 220px; height: 32px; padding: 0 8px; font-size: 14px; }
@media (max-width: 640px) { .iv-tool span { display: none; } }
.iv-actions [hidden] { display: none; }
/* Trang lệnh: bấm ảnh để xem lớn / vẽ (10/11) */
.shot-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: var(--radius); overflow: hidden; }
.shot-open:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.rv-qbox { display: grid; gap: 4px; }
.rv-q { margin: 0; font: 600 15px var(--font-head); }
.rv-best { margin: 0; font-size: 13px; color: var(--muted); }
.rv-best b { color: var(--accent-text); }
/* Thanh kỳ review: mọi thứ cao 38px, thẳng một hàng, thoáng (10/11) */
.rv-head { align-items: center; }
.rv-head .review-bar { display: flex; align-items: center; gap: 20px; margin: 0; }
.rv-head .segmented { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 3px; margin: 0; }
.rv-head .segmented button { height: 30px; min-width: 64px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; }
.rv-head .rv-nav { gap: 10px; }
.rv-head .rv-arrow { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; }
.rv-head .rv-label { min-width: 170px; text-align: center; font-size: 15px; }
/* Công cụ vẽ v2 (10/11): màu + opacity, độ dày, viền box, chữ B/I/cỡ */
.iv-for[hidden], .iv-pop[hidden] { display: none !important; }
.iv-style { gap: 12px; }
.iv-colorwrap { position: relative; }
.iv-swatch { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); padding: 5px; cursor: pointer;
  background: repeating-conic-gradient(rgba(var(--ink), .15) 0 25%, transparent 0 50%) 50% / 10px 10px; }
.iv-swatch span { display: block; width: 100%; height: 100%; border-radius: 4px; }
.iv-pop { position: absolute; top: 42px; left: 0; z-index: 20; width: 220px; display: grid; gap: 10px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.iv-presets { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.iv-presets button { aspect-ratio: 1; border-radius: 50%; border: 1px solid var(--line); background: var(--c); cursor: pointer; padding: 0; }
.iv-presets button.on { outline: 2px solid var(--text); outline-offset: 2px; }
.iv-hex { display: grid; grid-template-columns: 34px 1fr; gap: 8px; }
.iv-hex input[type="color"] { width: 34px; height: 34px; padding: 2px; border-radius: 8px; cursor: pointer; }
.iv-hex input[type="text"] { height: 34px; font: 500 13px var(--font-num); text-transform: uppercase; }
.iv-range { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.iv-range input { width: 90px; accent-color: var(--accent); padding: 0; border: 0; background: none; }
.iv-range span { min-width: 30px; font: 500 12px var(--font-num); color: var(--text); }
.iv-pop .iv-range input { flex: 1; width: auto; }
.iv-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.iv-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.iv-textctl { display: inline-flex; align-items: center; gap: 6px; }
.iv-textctl select { width: 64px; height: 34px; padding: 0 6px; }
.iv-fmt { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.iv-fmt.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.anno-text input { font-family: 'Geist', system-ui, sans-serif; font-weight: 400; }
.iv-pop { width: 264px; } .iv-presets { gap: 8px; }
/* Chọn / sửa từng nét (10/11) */
.anno-svg .mk.sel { filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 4px #14B8A6); }
dialog.img-view.drawing .anno-stage[data-mode="select"] .anno-svg { cursor: default; }
dialog.img-view.drawing .anno-stage[data-mode="select"] .mk { cursor: move; }
dialog.img-view.drawing .anno-stage[data-mode="select"] text.mk, dialog.img-view.drawing .anno-stage[data-mode="text"] text.mk { cursor: text; }
.iv-editing { font: 600 11px var(--font-body); letter-spacing: .04em; text-transform: uppercase; color: var(--accent-text); }
.iv-editing[hidden] { display: none; }
/* Ô gõ chữ: nền trong suốt, chỉ một viền mảnh mờ */
.anno-text input { width: auto; height: auto; min-width: 60px; padding: 2px 6px; background: transparent !important; border: 1px dashed color-mix(in srgb, var(--tc, #14B8A6) 55%, transparent); border-radius: 4px; box-shadow: none; line-height: 1.2; font-family: 'Geist', system-ui, sans-serif; }
.anno-text input:focus { outline: none; border-color: color-mix(in srgb, var(--tc, #14B8A6) 80%, transparent); }
.anno-text input::placeholder { color: inherit; opacity: .45; }
.anno-text { transform: translate(-7px, -50%); }
.anno-svg, svg.anno-svgimg { stroke: none; fill: none; } /* không ăn theo quy tắc stroke chung của icon */
/* Bảng màu dạng lưới (10/11) */
.iv-pop { width: 286px; gap: 14px; padding: 14px; }
.iv-presets { grid-template-columns: repeat(10, 22px); gap: 4px; }
.iv-presets button { width: 22px; height: 22px; aspect-ratio: auto; border-radius: 5px; border: 1px solid rgba(var(--ink), .12); }
.iv-presets button.gap-top { grid-column-start: 1; }
.iv-presets button:nth-child(n+21) { margin-top: 0; }
.iv-presets button:nth-child(21) { margin-top: 8px; }
.iv-presets button:nth-child(n+22):nth-child(-n+30) { margin-top: 8px; }
.iv-presets button.on { outline: 2px solid var(--text); outline-offset: 1px; }
.iv-presets button:hover { transform: scale(1.12); }
.iv-custom { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.iv-cur { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(var(--ink), .2); }
.iv-plus { position: relative; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; border: 1px dashed var(--line); color: var(--muted); font-size: 18px; cursor: pointer; overflow: hidden; }
.iv-plus input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0; border: 0; }
.iv-custom input[type="text"] { flex: 1; height: 30px; font: 500 13px var(--font-num); text-transform: uppercase; }
.iv-op { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.iv-opline { display: flex; align-items: center; gap: 10px; }
.iv-op input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 12px; border-radius: 99px; padding: 0; border: 0;
  background: linear-gradient(to right, transparent, var(--oc, #14B8A6)), repeating-conic-gradient(rgba(var(--ink), .18) 0 25%, transparent 0 50%) 0 0 / 8px 8px; }
.iv-op input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #09090B; box-shadow: 0 0 0 1px #fff; cursor: pointer; }
.iv-op input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #09090B; cursor: pointer; }
.iv-opv { min-width: 46px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; font: 500 12px var(--font-num); color: var(--text); }
.mk-hit { pointer-events: stroke; }
dialog.img-view.drawing .anno-svg .mk, dialog.img-view.drawing .anno-svg .mk-hit { cursor: move; }
dialog.img-view.drawing .anno-svg text.mk { cursor: text; }
dialog.img-view.drawing .anno-stage[data-mode="erase"] .mk, dialog.img-view.drawing .anno-stage[data-mode="erase"] .mk-hit { cursor: pointer; }
.iv-editing { text-transform: none; letter-spacing: 0; font-size: 12px; }
/* Điểm nắm nét đang chọn (10/11) */
dialog.img-view.drawing .anno-svg .mk-h { cursor: grab; pointer-events: all; }
dialog.img-view.drawing .anno-svg .mk-h[data-h="n"], dialog.img-view.drawing .anno-svg .mk-h[data-h="s"] { cursor: ns-resize; }
dialog.img-view.drawing .anno-svg .mk-h[data-h="e"], dialog.img-view.drawing .anno-svg .mk-h[data-h="w"] { cursor: ew-resize; }
dialog.img-view.drawing .anno-svg .mk-h[data-h="nw"], dialog.img-view.drawing .anno-svg .mk-h[data-h="se"] { cursor: nwse-resize; }
dialog.img-view.drawing .anno-svg .mk-h[data-h="ne"], dialog.img-view.drawing .anno-svg .mk-h[data-h="sw"] { cursor: nesw-resize; }
.anno-svg .mk.sel { filter: none; }
/* Ô màu: màu đặc, không ô cờ, không viền nét đứt (10/11) */
.iv-swatch { padding: 0; background: none; border: 1px solid rgba(var(--ink), .25); overflow: hidden; }
.iv-swatch span { border-radius: 0; opacity: 1 !important; }
/* Ảnh chart linh động (10/11): lưới tự xuống hàng + ô Add image */
.trade-v2 .tf-charts .shots.shots-flex { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tf-charts .shot.filled .mark-badge { display: inline-block; }
.tf-charts .shot-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px dashed var(--line); background: transparent; color: var(--muted); cursor: pointer; font: inherit; aspect-ratio: 4 / 3; border-radius: var(--radius); padding: 8px; }
.tf-charts .shot-add span:last-of-type { display: block; font-size: 11px; text-align: center; }
.tf-charts .shot-add .shot-plus { display: block; font-size: 24px; line-height: 1; color: var(--accent-text); }
.tf-charts .shot-add b { font-size: 13px; color: var(--text); }
.tf-charts .shot-add:hover, .tf-charts.dragover .shot-add { border-color: var(--accent-text); color: var(--text); }
.tf-charts.dragover { border-color: var(--accent-text); }
.shot.filled .remove { opacity: 0; transition: opacity .15s; }
.shot.filled:hover .remove, .shot.filled:focus-within .remove { opacity: 1; }
@media (hover: none) { .shot.filled .remove { opacity: 1; } }
.shots-view { display: grid; gap: 16px; }
/* Nút xoá ảnh luôn hiện, dạng icon tròn góc trên phải (10/11) */
.shot.filled .remove { opacity: 1 !important; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(9, 9, 11, .72); color: #fff; }
.shot.filled .remove svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.2; }
.shot.filled .remove:hover { background: var(--loss); }
/* Thẻ model: tiêu đề cùng một hàng dù có hay không có nút ⋯ */
.m-card header { min-height: 28px; }
/* Language (10/11) */
.lang-list { display: grid; gap: 4px; margin-top: 4px; }
.lang-opt { display: flex; align-items: center; gap: 12px; padding: 8px 4px; font-size: 15px; color: var(--text); cursor: pointer; border-radius: 8px; }
.lang-opt:hover { background: var(--surface); }
.lang-opt input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

/* ---------- Settings gọn lại (11/11): các thẻ không kéo hết màn hình, câu hướng dẫn không chạy quá dài ---------- */
.set-wrap { max-width: 720px; }

/* ---------- Kéo ô ngày thả sang ô khác để chuyển lệnh (11/11) ---------- */
.cal-day[draggable="true"] { cursor: grab; }
.cal-day.dragging { opacity: 0.45; }
.cal-day.drop-target { outline: 2px dashed var(--accent); outline-offset: -2px; background: rgba(20, 184, 166, 0.12); }
.day-trades li .btn { flex: none; }
.day-trades .dt-actions { display: flex; gap: 6px; }

/* ---------- Ô chọn (select): mũi tên có khoảng thở (11/11) ----------
   Mũi tên mặc định của trình duyệt dính sát mép phải. Vẽ mũi tên riêng, cách mép 16px, chừa 40px bên phải để chữ không đè lên. */
select:not([multiple]) {
  -webkit-appearance: none; appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23A1A1AA' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 12px;
  text-overflow: ellipsis;
}
:root[data-theme="light"] select:not([multiple]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%234B4B52' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* Ô chọn nhỏ trong thanh công cụ vẽ (cỡ chữ): mũi tên nhỏ hơn, vẫn có chỗ thở */
.iv-textctl select:not([multiple]) { padding-right: 24px; background-position: right 8px center; background-size: 10px 10px; }

/* ---------- Settings: tiêu đề khối cùng kiểu với tiêu đề thẻ ở Dashboard/Accounts (11/11) ----------
   Trước đây dùng Montserrat 16px (font rộng) nên chữ trông "bè" và lệch so với các trang khác. */
.set-block h3 { font: 600 14px var(--font-body); letter-spacing: normal; color: var(--text); }

/* ---------- Editor model (11/11): công thức theo trình tự Daily → HTF → Structure → Entry ---------- */
.model-editor { display: grid; gap: 14px; margin: 0 0 16px; max-width: 760px; }
.model-editor > label { max-width: 360px; }
.model-editor .chips { gap: 8px; }
.model-editor .chip { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; }
.model-editor .chip-add { height: 34px; width: 110px; padding: 0 12px; }
.model-editor .form-actions { justify-content: flex-end; }
.m-recipe { margin: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-card.is-editing { border-color: var(--accent-text); }

/* ---------- Dấu × xoá lựa chọn khỏi danh sách trong editor model (11/11) ---------- */
.chip-wrap { position: relative; display: inline-flex; }
.chip-x { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--field); color: var(--muted); font: 600 14px/1 var(--font-body); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .12s; z-index: 1; }
.chip-wrap:hover .chip-x, .chip-x:focus-visible { opacity: 1; }
.chip-x:hover { color: var(--loss-text); border-color: var(--loss-text); }
@media (hover: none) { .chip-x { opacity: 1; } }

/* ---------- Xếp hạng PDA (11/11) + số liệu nhỏ trên chip PDA trong editor model ---------- */
.chip-stat { margin-left: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.on .chip-stat { color: inherit; opacity: .75; }

/* ---------- Thẳng hàng trang Models (11/11) ---------- */
/* Chữ tab Breakdown sát lề trái, thẳng với tiêu đề và bảng bên dưới (trước đây thụt 14px) */
.rv-tabs { gap: 20px; }
.rv-tabs button { padding: 0; }
@media (max-width: 640px) { .rv-tabs { gap: 0 16px; } }
/* Thẻ model: dòng công thức luôn chiếm chỗ để Win % của các thẻ nằm song song */
.m-recipe { min-height: 16px; line-height: 16px; }
/* Dòng trong bảng xếp hạng/Breakdown sát lề, thẳng với tiêu đề (trước đây đệm 4px hai bên) */
.rv-row { padding-left: 0; padding-right: 0; }

/* Settings → Time zone: danh sách chọn 5 múi giờ, cao bằng các nút khác (34px), thẳng lề với chữ phía trên */
.tz-select { display: block; width: 100%; max-width: 320px; height: 38px; margin: 12px 0; }

/* Trang lệnh: 4 tab (Stats · Strategy · Charts · Notes), dùng lại kiểu tab của Breakdown */
.dt-tabs { margin: 18px 0 16px; }
.dt-panel[hidden] { display: none; }
.dt-empty { margin: 0; }
@media (max-width: 640px) { .dt-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Ô trống cuối lưới thông tin không bị tô xám (ngăn cách bằng đường kẻ của từng ô thay vì nền) */
.dt-panel.info { background: transparent; gap: 0; border-width: 1px 0 0 1px; border-radius: 0; overflow: visible; }
.dt-panel.info > div { box-shadow: inset -1px -1px 0 var(--line); }

/* Trang Strategies: băng nhắc "lệnh đang nhập dở" (quay lại form) */
.draft-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border: 1px solid rgba(20, 184, 166, 0.5); background: rgba(20, 184, 166, 0.1); border-radius: var(--radius); }
.draft-banner .draft-actions { display: flex; gap: 8px; }


/* ---------- Ô Account balance (14/11, bản 2): mỗi tài khoản 1 thẻ, viền đều 1px, cách nhau 8px; thẻ đang xem viền teal ---------- */
.bal-cards { display: grid; gap: 8px; }
.bal-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s; }
.bal-row:hover { border-color: var(--muted); }
.bal-row.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.bal-name, .bal-num { display: grid; gap: 2px; min-width: 0; }
.bal-name b { font: 600 15px var(--font-head); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bal-num { text-align: right; }
.bal-num b { font: 600 16px var(--font-num); font-variant-numeric: tabular-nums; }
.bal-row small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bal-row small.win { color: var(--accent-text); } .bal-row small.loss { color: var(--loss-text); }
.bal-hint { margin-top: 10px; font-size: 12px; }
.bal-nag { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 13px; color: var(--muted); }
.bal-nag svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--text); }
.bal-nag .link { margin-left: auto; font-weight: 600; white-space: nowrap; }
