:root {
  --font-ui: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-num: "Roboto Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --topbar-h: 56px;
  --sidebar-w: 54px;
  --rightbar-w: 272px;
  --transition: 160ms ease;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.is-hidden { display: none !important; }
.rise { color: var(--rise) !important; }
.fall { color: var(--fall) !important; }
.flat { color: var(--muted) !important; }

body[data-theme="ths"] {
  --bg: #080a0c;
  --bg-soft: #0b0e11;
  --panel: #101316;
  --panel-2: #0c0f12;
  --panel-3: #15191d;
  --panel-hover: #191e22;
  --border: #252a2f;
  --border-strong: #363d43;
  --text: #e8eaec;
  --text-soft: #c7ccd0;
  --muted: #879097;
  --muted-2: #626b72;
  --accent: #f0a020;
  --accent-soft: rgba(240, 160, 32, .12);
  --accent-border: rgba(240, 160, 32, .4);
  --rise: #ff4242;
  --rise-soft: rgba(255, 66, 66, .11);
  --fall: #10bd72;
  --fall-soft: rgba(16, 189, 114, .11);
  --grid: #20252a;
  --grid-strong: #2b3137;
  --shadow: 0 14px 40px rgba(0,0,0,.38);
  --radius: 3px;
  --radius-lg: 5px;
  --control-h: 30px;
  --page-pad: 16px;
  --panel-pad: 14px;
  --density-gap: 10px;
  --topbar: #15181b;
  --canvas-bg: #0b0e11;
  --ma5: #f4d03f;
  --ma10: #a56eff;
  --ma20: #34c5ff;
  --ma60: #f58b3a;
}

body[data-theme="tradingview"] {
  --bg: #0c111b;
  --bg-soft: #101723;
  --panel: #111927;
  --panel-2: #0f1622;
  --panel-3: #172131;
  --panel-hover: #1b2638;
  --border: #243146;
  --border-strong: #34445e;
  --text: #dfe6ef;
  --text-soft: #bdc8d7;
  --muted: #7f8da3;
  --muted-2: #5f6d81;
  --accent: #2962ff;
  --accent-soft: rgba(41, 98, 255, .13);
  --accent-border: rgba(41, 98, 255, .45);
  --rise: #f23645;
  --rise-soft: rgba(242, 54, 69, .11);
  --fall: #089981;
  --fall-soft: rgba(8, 153, 129, .11);
  --grid: #202b3d;
  --grid-strong: #2b3950;
  --shadow: 0 18px 46px rgba(0,0,0,.32);
  --radius: 7px;
  --radius-lg: 10px;
  --control-h: 34px;
  --page-pad: 20px;
  --panel-pad: 18px;
  --density-gap: 14px;
  --topbar: #111827;
  --canvas-bg: #101722;
  --ma5: #f6c343;
  --ma10: #ab7bff;
  --ma20: #4ab8ff;
  --ma60: #ff8a50;
}

#app, .workspace { height: 100%; }
.workspace { min-width: 1180px; background: var(--bg); }

.auth-loading-view {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  color: var(--text); background: var(--bg);
}
.auth-loading-view strong { font-size: 14px; }
.auth-loading-view small { color: var(--muted); font-size: 10px; }
.auth-loading-view .ghost-button { margin-top: 5px; }
.loading-spinner {
  width: 24px; height: 24px; display: inline-block;
  border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%;
  animation: loading-spin .75s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--topbar);
  position: relative;
  z-index: 50;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: .01em;
}
.brand-button { border: 0; background: transparent; padding: 0 4px; height: 100%; }
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
}
.brand-mark svg { width: 21px; height: 21px; stroke-width: 2.1; }
.brand-name { font-size: 15px; white-space: nowrap; }
.brand-tag {
  color: var(--accent);
  font: 600 9px/1 var(--font-num);
  letter-spacing: .12em;
  border: 1px solid var(--accent-border);
  padding: 3px 4px;
  border-radius: 2px;
}
.main-nav { display: flex; align-self: stretch; margin-left: 4px; }
.nav-item {
  position: relative;
  padding: 0 15px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  transition: color var(--transition), background var(--transition);
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.025); }
.nav-item.is-active { color: var(--text); }
.nav-item.is-active::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
}
.global-search {
  position: relative;
  display: flex;
  align-items: center;
  width: clamp(260px, 28vw, 430px);
  height: 34px;
  margin-left: auto;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.global-search:focus-within { border-color: var(--accent-border); box-shadow: 0 0 0 2px var(--accent-soft); }
.search-icon { width: 34px; display: grid; place-items: center; color: var(--muted); }
.search-icon svg { width: 17px; height: 17px; }
.global-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; color: var(--text); background: transparent; font-size: 12px; }
.global-search input::placeholder { color: var(--muted-2); }
.global-search kbd { margin-right: 7px; color: var(--muted); background: var(--panel-3); border: 1px solid var(--border); border-bottom-color: var(--border-strong); border-radius: 3px; padding: 2px 6px; font: 10px var(--font-num); }
.search-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 7px);
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  max-height: 360px;
  overflow: auto;
}
.search-result-item {
  width: 100%; border: 0; background: transparent; color: var(--text);
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: var(--radius); text-align: left;
}
.search-result-item:hover, .search-result-item.is-focused { background: var(--panel-hover); }
.search-result-name { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.search-result-name small { color: var(--muted); font-family: var(--font-num); }
.search-result-type { color: var(--muted); font-size: 11px; border: 1px solid var(--border); padding: 2px 5px; border-radius: 3px; }
.search-result-price { font: 12px var(--font-num); }
.search-empty { min-height: 80px; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.data-state {
  display: flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 9px;
  border: 1px solid var(--border); background: var(--panel-2); border-radius: var(--radius); color: var(--muted); font-size: 11px;
}
.data-state strong { color: var(--text-soft); font: 500 10px var(--font-num); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fall); box-shadow: 0 0 0 3px var(--fall-soft); display: inline-block; }
.data-state.is-demo { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.data-state.is-demo .status-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.data-state.is-error { color: var(--rise); }
.data-state.is-error .status-dot { background: var(--rise); box-shadow: 0 0 0 3px var(--rise-soft); }
.theme-select-wrap {
  height: 32px; min-width: 132px;
  display: flex; align-items: center;
  border: 1px solid var(--border); background: var(--panel-2); border-radius: var(--radius);
}
.theme-icon { width: 31px; display: grid; place-items: center; color: var(--muted); }
.theme-icon svg { width: 16px; height: 16px; }
.theme-select-wrap select { flex: 1; height: 100%; min-width: 0; outline: 0; color: var(--text-soft); border: 0; background: transparent; font-size: 11px; padding-right: 6px; }
.theme-select-wrap option { background: var(--panel); color: var(--text); }
.user-menu-wrap { position: relative; }
.user-button {
  height: 34px; padding: 0 7px 0 4px;
  display: flex; align-items: center; gap: 7px;
  border: 1px solid transparent; background: transparent; border-radius: var(--radius); font-size: 12px;
}
.user-button:hover, .user-button[aria-expanded="true"] { background: var(--panel-2); border-color: var(--border); }
.avatar { width: 26px; height: 26px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-border); border-radius: 50%; font: 700 11px var(--font-num); }
.user-button svg { width: 12px; height: 12px; color: var(--muted); }
.user-menu {
  position: absolute; top: calc(100% + 7px); right: 0; width: 140px; padding: 5px;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow);
}
.user-menu button { width: 100%; border: 0; background: transparent; color: var(--text-soft); text-align: left; padding: 9px 10px; border-radius: var(--radius); font-size: 12px; }
.user-menu button:hover { background: var(--panel-hover); color: var(--text); }

.main-content { height: calc(100% - var(--topbar-h)); overflow: hidden; }
.page { height: 100%; overflow: auto; padding: var(--page-pad); background: var(--bg); }
.chart-page { padding: 0; overflow: hidden; }
.page-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.eyebrow { color: var(--accent); font: 600 10px/1.2 var(--font-num); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 7px; }
.page-title-row h1 { margin: 0; font-size: 24px; line-height: 1.15; letter-spacing: -.02em; }
.page-title-row p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.page-actions { display: flex; gap: 8px; }
.watchlist-group-bar { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--panel-2); }
.watchlist-group-tabs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: thin; }
.watchlist-group-tabs button { flex: 0 0 auto; height: 28px; padding: 0 10px; border: 1px solid var(--border); color: var(--muted); background: var(--panel); border-radius: var(--radius); font-size: 9px; }
.watchlist-group-tabs button:hover { color: var(--text); border-color: var(--border-strong); }
.watchlist-group-tabs button.is-active { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.watchlist-group-tabs button span { margin-left: 5px; color: var(--muted-2); font-family: var(--font-num); }
.group-kline-open-button { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); white-space: nowrap; }
.group-kline-settings-button { white-space: nowrap; }
button svg { width: 16px; height: 16px; }
.primary-button, .ghost-button {
  height: var(--control-h); padding: 0 12px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; transition: all var(--transition);
}
.primary-button { border: 1px solid var(--accent); color: #fff; background: var(--accent); }
body[data-theme="ths"] .primary-button { color: #111; font-weight: 600; }
.primary-button:hover { filter: brightness(1.08); }
.ghost-button { border: 1px solid var(--border); color: var(--text-soft); background: var(--panel); }
.ghost-button:hover { border-color: var(--border-strong); color: var(--text); background: var(--panel-hover); }
.text-button { border: 0; background: transparent; color: var(--accent); font-size: 11px; padding: 5px; }
.icon-button { width: var(--control-h); height: var(--control-h); padding: 0; display: grid; place-items: center; border: 1px solid var(--border); background: var(--panel-2); border-radius: var(--radius); color: var(--muted); }
.icon-button:hover { color: var(--text); border-color: var(--border-strong); background: var(--panel-hover); }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.panel-heading { min-height: 48px; padding: 10px var(--panel-pad); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.panel-heading h2 { margin: 0; font-size: 14px; font-weight: 650; }
.panel-heading span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.fixed-index-note { color: var(--muted-2) !important; font-size: 9px !important; }
.index-section { margin-bottom: var(--density-gap); }
.index-grid { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 1px; background: var(--border); }
.index-card {
  min-width: 0; min-height: 128px; padding: 13px;
  border: 0; border-radius: 0; background: var(--panel); color: var(--text); text-align: left;
  transition: background var(--transition);
  position: relative; overflow: hidden;
}
.index-card:hover { background: var(--panel-hover); }
.index-card::before { content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 100%; background: transparent; }
.index-card:hover::before { background: var(--accent); }
.index-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.index-card-name { font-size: 12px; font-weight: 600; }
.index-card-code { color: var(--muted); font: 9px var(--font-num); }
.index-card-value { display: flex; align-items: baseline; gap: 8px; margin-top: 9px; }
.index-card-value strong { font: 650 20px/1 var(--font-num); }
.index-card-value span { font: 600 11px var(--font-num); }
.index-card-spark { height: 38px; margin-top: 8px; }
.index-card-spark svg { width: 100%; height: 100%; stroke-width: 1.6; }
.index-card-meta { display: flex; justify-content: space-between; color: var(--muted); font: 9px var(--font-num); margin-top: 3px; }

.watchlist-heading { min-height: 52px; }
.table-tools { display: flex; align-items: center; gap: 7px; }
.segmented-control { display: inline-flex; height: var(--control-h); padding: 2px; background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); }
.segmented-control button { border: 0; background: transparent; color: var(--muted); padding: 0 11px; border-radius: calc(var(--radius) - 1px); font-size: 11px; white-space: nowrap; }
.segmented-control button:hover { color: var(--text); }
.segmented-control button.is-active { color: var(--text); background: var(--panel-3); box-shadow: inset 0 0 0 1px var(--border); }
body[data-theme="tradingview"] .segmented-control button.is-active { color: #fff; background: var(--accent); box-shadow: none; }
.segmented-control.compact { height: 28px; }
.segmented-control.compact button { padding: 0 9px; font-size: 10px; }
.table-wrap { overflow: auto; }
.watch-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.watch-table th { height: 34px; padding: 0 10px; text-align: right; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--border); font-size: 10px; font-weight: 500; white-space: nowrap; }
.watch-table td { height: 50px; padding: 0 10px; text-align: right; border-bottom: 1px solid var(--border); color: var(--text-soft); font: 11px var(--font-num); }
.watch-table tbody tr { cursor: pointer; transition: background var(--transition); }
.watch-table tbody tr:hover { background: var(--panel-hover); }
.watch-table tbody tr:last-child td { border-bottom: 0; }
.watch-table .empty-row { cursor: default; }
.watch-table .empty-row:hover { background: transparent; }
.watch-table .empty-row td { height: 92px; text-align: center; color: var(--muted); font-family: var(--font-ui); }
.watch-table .favorite-col { width: 37px; text-align: center; }
.watch-table .symbol-col { width: 200px; text-align: left; }
.watch-table .action-col { width: 42px; }
.watch-table th:nth-child(8) { width: 112px; }
.watch-table td:first-child { text-align: center; }
.symbol-cell { display: flex; align-items: center; gap: 9px; text-align: left; }
.symbol-avatar { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: var(--radius); color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); font: 700 10px var(--font-num); }
.symbol-main { min-width: 0; }
.symbol-main strong { display: block; color: var(--text); font: 600 12px var(--font-ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.symbol-main span { display: block; margin-top: 3px; color: var(--muted); font: 9px var(--font-num); }
.star-button, .row-action-button { border: 0; background: transparent; color: var(--muted-2); padding: 4px; }
.star-button svg { width: 15px; height: 15px; }
.star-button.is-active { color: var(--accent); }
.row-action-button:hover { color: var(--text); }
.price-cell { color: var(--text); font-weight: 600 !important; }
.spark-cell svg { width: 88px; height: 28px; margin-left: auto; stroke-width: 1.6; }
.panel-footer-note { min-height: 34px; padding: 0 var(--panel-pad); display: flex; align-items: center; justify-content: space-between; color: var(--muted); background: var(--panel-2); border-top: 1px solid var(--border); font-size: 9px; }
.panel-footer-note span { display: flex; align-items: center; gap: 7px; }
.watchlist-full-panel { overflow: hidden; }
.watchlist-summary-row { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--border); background: var(--panel-2); }
.watchlist-summary-row > div { min-height: 78px; padding: 15px 18px; border-right: 1px solid var(--border); }
.watchlist-summary-row > div:last-child { border-right: 0; }
.watchlist-summary-row span { display: block; color: var(--muted); font-size: 11px; }
.watchlist-summary-row strong { display: block; margin-top: 8px; font: 650 22px var(--font-num); }
.watch-table-large th, .watch-table-large td { height: 54px; }

.instrument-header {
  height: 74px; display: grid; grid-template-columns: minmax(280px, 1.15fr) minmax(170px, .65fr) minmax(570px, 2.3fr) auto; align-items: center;
  gap: 12px; padding: 0 13px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.instrument-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.back-button, .favorite-button { width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid var(--border); background: var(--panel-2); color: var(--muted); border-radius: var(--radius); display: grid; place-items: center; }
.back-button:hover, .favorite-button:hover { color: var(--text); border-color: var(--border-strong); }
.favorite-button.is-favorite { color: var(--accent); }
.instrument-name-row { display: flex; align-items: center; gap: 7px; min-width: 0; }
.instrument-name-row h1 { margin: 0; font-size: 17px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.type-badge { color: var(--muted); border: 1px solid var(--border); padding: 2px 5px; border-radius: 2px; font-size: 9px; }
.instrument-code-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; color: var(--muted); font: 9px var(--font-num); }
.instrument-code-row span + span::before { content: "·"; margin-right: 6px; color: var(--muted-2); }
.instrument-price-block { display: flex; align-items: baseline; gap: 10px; padding-left: 8px; border-left: 1px solid var(--border); }
.instrument-price-block > strong { font: 700 25px/1 var(--font-num); }
.price-change { display: flex; flex-direction: column; gap: 3px; font: 600 10px var(--font-num); }
.quote-metrics { display: grid; grid-template-columns: repeat(6, minmax(70px, 1fr)); gap: 4px 8px; }
.quote-metric { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; font: 9px var(--font-num); }
.quote-metric span { color: var(--muted); }
.quote-metric b { color: var(--text-soft); font-weight: 500; white-space: nowrap; }
.instrument-actions { display: flex; gap: 7px; }
.compact-button { height: 30px; }

.chart-layout { height: calc(100% - 74px); display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--rightbar-w); gap: 0; background: var(--bg); }
.chart-layout.right-collapsed { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 0; }
.drawing-toolbar { background: var(--panel); border-right: 1px solid var(--border); padding: 6px 5px; display: flex; flex-direction: column; align-items: center; gap: 3px; overflow-y: auto; }
.drawing-tool { width: 43px; min-height: 43px; padding: 4px 2px; border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 8px; }
.drawing-tool svg { width: 17px; height: 17px; }
.drawing-tool:hover { color: var(--text); background: var(--panel-hover); }
.drawing-tool.is-active { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.drawing-divider { width: 28px; height: 1px; margin: 4px 0; background: var(--border); }
.chart-panel { min-width: 0; height: 100%; border-radius: 0; border-top: 0; border-bottom: 0; border-left: 0; display: grid; grid-template-rows: 43px auto 29px minmax(0, 1fr) 26px; overflow: hidden; }
.chart-controls { display: flex; align-items: center; gap: 8px; padding: 0 8px; border-bottom: 1px solid var(--border); background: var(--panel); }
.period-control { height: 29px; }
.soon-dot { width: 5px; height: 5px; margin-left: 4px; display: inline-block; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.control-divider { width: 1px; height: 18px; background: var(--border); }
.indicator-toggles { display: flex; gap: 3px; }
.indicator-button, .icon-text-button { height: 28px; border: 1px solid transparent; background: transparent; color: var(--muted); border-radius: var(--radius); font-size: 10px; padding: 0 8px; }
.indicator-button:hover, .icon-text-button:hover { color: var(--text); background: var(--panel-hover); }
.indicator-button.is-active { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.chart-controls button:disabled, .drawing-toolbar button:disabled { cursor: not-allowed; opacity: .36; pointer-events: none; }
.chart-control-spacer { flex: 1; }
.group-kline-disclosure { min-height: 30px; display: flex; align-items: center; padding: 5px 10px; color: var(--text-soft); background: var(--accent-soft); border-bottom: 1px solid var(--accent-border); font: 9px/1.5 var(--font-num); white-space: normal; }
.icon-text-button { display: inline-flex; align-items: center; gap: 5px; }
.icon-text-button svg { width: 14px; height: 14px; }
.price-scale-control { height: 28px; display: inline-flex; align-items: center; gap: 3px; padding-left: 8px; border-left: 1px solid var(--border); white-space: nowrap; }
.price-scale-status { padding: 0 5px; color: var(--text-soft); font-size: 9px; }
.price-scale-control .icon-text-button { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border); }
.price-scale-control .icon-text-button:hover { color: var(--accent); border-color: var(--accent); }
.chart-legend-row { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px; border-bottom: 1px solid var(--border); background: var(--panel-2); overflow: hidden; }
.ohlc-legend, .ma-legend { display: flex; align-items: center; gap: 11px; min-width: 0; white-space: nowrap; color: var(--muted); font: 9px var(--font-num); }
.ohlc-legend b { color: var(--text-soft); font-weight: 500; }
.ma-legend { margin-left: auto; }
.ma5, .ma-slot-0 { color: var(--ma5); }.ma10, .ma-slot-1 { color: var(--ma10); }.ma20, .ma-slot-2 { color: var(--ma20); }.ma60, .ma-slot-3 { color: var(--ma60); }
.indicator-config-button { min-width: 70px; font-family: var(--font-num); }
.chart-canvas-wrap { position: relative; min-height: 0; background: var(--canvas-bg); overflow: hidden; }
#chartCanvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.chart-loading { position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text-soft); background: color-mix(in srgb, var(--canvas-bg) 88%, transparent); font-size: 11px; }
.chart-loading .loading-spinner { width: 18px; height: 18px; }
.chart-tooltip { position: absolute; z-index: 6; min-width: 156px; padding: 8px 9px; pointer-events: none; background: color-mix(in srgb, var(--panel) 93%, transparent); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 8px 22px rgba(0,0,0,.24); font: 9px/1.55 var(--font-num); }
.chart-tooltip strong { display: block; color: var(--text); margin-bottom: 3px; }
.chart-tooltip-grid { display: grid; grid-template-columns: auto auto; gap: 1px 12px; }
.chart-tooltip-grid span:nth-child(odd) { color: var(--muted); }
.chart-tooltip-grid span:nth-child(even) { text-align: right; color: var(--text-soft); }
.chart-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--canvas-bg); text-align: center; padding: 30px; }
.placeholder-icon { width: 58px; height: 58px; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 50%; }
.placeholder-icon svg { width: 31px; height: 31px; stroke-width: 2; }
.chart-placeholder h3 { margin: 15px 0 6px; font-size: 16px; }
.chart-placeholder p { max-width: 510px; margin: 0 0 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.chart-placeholder code, .reserved-panel code { color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 3px; padding: 1px 4px; font-family: var(--font-num); }
.draw-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 8; color: var(--text); background: var(--panel); border: 1px solid var(--accent-border); box-shadow: var(--shadow); padding: 6px 10px; border-radius: var(--radius); font-size: 10px; pointer-events: none; }
.chart-statusbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 9px; color: var(--muted); background: var(--panel-2); border-top: 1px solid var(--border); font: 8px var(--font-num); }
.chart-statusbar > div { display: flex; align-items: center; gap: 11px; }
.status-action-button { height: 20px; padding: 0 7px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 3px; font: 8px var(--font-num); cursor: pointer; }
.status-action-button:hover { border-color: var(--accent); }
.status-action-button:disabled { cursor: wait; opacity: .58; }

.right-panel { position: relative; min-width: 0; height: 100%; border-radius: 0; border-top: 0; border-bottom: 0; border-right: 0; overflow: visible; transition: transform var(--transition), opacity var(--transition); }
.chart-layout.right-collapsed .right-panel { transform: none; opacity: 1; pointer-events: none; border: 0; background: transparent; }
.chart-layout.right-collapsed .right-panel-tabs,
.chart-layout.right-collapsed .right-tab-content { visibility: hidden; opacity: 0; }
.chart-page.is-group-chart .chart-layout { grid-template-columns: minmax(0, 1fr) var(--rightbar-w); }
.chart-page.is-group-chart .chart-layout.right-collapsed { grid-template-columns: minmax(0, 1fr) 0; }
.chart-page.is-group-chart .drawing-toolbar,
.chart-page.is-group-chart #favoriteButton,
.chart-page.is-group-chart #adjustControl,
.chart-page.is-group-chart .adjust-control-divider,
.chart-page.is-group-chart [data-indicator="VOL"],
.chart-page.is-group-chart #drawingStatus { display: none; }
.right-panel-tabs { height: 43px; display: flex; border-bottom: 1px solid var(--border); background: var(--panel); }
.right-panel-tabs button { flex: 1; position: relative; border: 0; background: transparent; color: var(--muted); font-size: 11px; }
.right-panel-tabs button:hover { color: var(--text); }
.right-panel-tabs button.is-active { color: var(--text); }
.right-panel-tabs button.is-active::after { content: ""; position: absolute; left: 22px; right: 22px; bottom: -1px; height: 2px; background: var(--accent); }
.reserved-label { margin-left: 4px; color: var(--accent); font-size: 8px; }
.right-tab-content { height: calc(100% - 43px); display: flex; flex-direction: column; min-height: 0; }
.right-panel-search { position: relative; margin: 8px; height: 29px; border: 1px solid var(--border); background: var(--panel-2); border-radius: var(--radius); }
.right-group-select { height: 29px; margin: 8px 8px 0; padding: 0 8px; border: 1px solid var(--border); outline: 0; color: var(--text-soft); background: var(--panel-2); border-radius: var(--radius); font-size: 9px; }
.right-panel-search input { width: 100%; height: 100%; padding: 0 30px 0 9px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 10px; }
.right-panel-search svg { position: absolute; right: 8px; top: 7px; width: 14px; height: 14px; color: var(--muted); }
.mini-watchlist { flex: 1; min-height: 0; overflow: auto; }
.mini-watch-item { width: 100%; height: 51px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 0 10px; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; }
.mini-watch-item:hover { background: var(--panel-hover); }
.mini-watch-item.is-active { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.mini-watch-name strong { display: block; color: var(--text); font-size: 11px; font-weight: 600; }
.mini-watch-name span { display: block; margin-top: 3px; color: var(--muted); font: 8px var(--font-num); }
.mini-watch-price { text-align: right; font: 10px var(--font-num); }
.mini-watch-price strong, .mini-watch-price span { display: block; }
.mini-watch-price span { margin-top: 3px; }
.right-panel-add { height: 34px; margin: 8px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1px dashed var(--border-strong); background: transparent; color: var(--muted); border-radius: var(--radius); font-size: 10px; }
.right-panel-add:hover { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.right-panel-add svg { width: 13px; height: 13px; }
.reserved-panel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }
.reserved-icon { width: 52px; height: 52px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--border); background: var(--panel-2); border-radius: var(--radius-lg); }
.reserved-icon svg { width: 27px; height: 27px; }
.reserved-panel h3 { margin: 13px 0 6px; font-size: 13px; }
.reserved-panel p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.7; }
.reserved-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin-top: 13px; }
.reserved-list span { color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); padding: 4px 6px; border-radius: 3px; font-size: 8px; }
.collapse-side-button { position: absolute; left: -18px; top: 50%; transform: translateY(-50%); width: 18px; height: 46px; display: grid; place-items: center; border: 1px solid var(--border); border-right: 0; background: var(--panel); color: var(--muted); border-radius: var(--radius) 0 0 var(--radius); }
.collapse-side-button svg { width: 11px; height: 11px; }
.chart-layout.right-collapsed .collapse-side-button { left: -20px; pointer-events: auto; opacity: 1; transform: translateY(-50%) rotate(180deg); }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--density-gap); }
.settings-card { padding: 18px; }
.settings-card h2 { margin: 0; font-size: 15px; }
.settings-card > p { margin: 6px 0 16px; color: var(--muted); font-size: 11px; }
.theme-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-card { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: var(--radius-lg); padding: 10px; text-align: left; }
.theme-card:hover, .theme-card.is-active { border-color: var(--accent-border); box-shadow: 0 0 0 2px var(--accent-soft); }
.theme-card strong { display: block; margin-top: 9px; font-size: 12px; }
.theme-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.theme-preview { height: 70px; display: grid; grid-template-columns: 14px 1fr 40px; gap: 3px; padding: 4px; border-radius: 4px; overflow: hidden; }
.theme-preview i { display: block; border-radius: 2px; }
.ths-preview { background: #080a0c; border: 1px solid #30363b; }.ths-preview i { background: #171b1f; }.ths-preview i:nth-child(2){background:linear-gradient(145deg,transparent 46%,#f0a020 48%,#f0a020 51%,transparent 53%),#0c0f12}.ths-preview i:nth-child(3){background:#111417}
.tv-preview { background: #0c111b; border: 1px solid #33435d; }.tv-preview i { background: #172131; }.tv-preview i:nth-child(2){background:linear-gradient(145deg,transparent 46%,#2962ff 48%,#2962ff 51%,transparent 53%),#101722}.tv-preview i:nth-child(3){background:#111927}
.setting-row { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--border); }
.setting-row strong { display: block; font-size: 11px; }
.setting-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.setting-row select { min-width: 120px; height: 30px; padding: 0 8px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); border-radius: var(--radius); outline: 0; font-size: 10px; }
.color-pair { display: flex; gap: 6px; }
.color-pair span { margin: 0; padding: 5px 7px; border-radius: 3px; font: 9px var(--font-num); }
.rise-chip { color: var(--rise) !important; background: var(--rise-soft); border: 1px solid color-mix(in srgb, var(--rise) 35%, transparent); }
.fall-chip { color: var(--fall) !important; background: var(--fall-soft); border: 1px solid color-mix(in srgb, var(--fall) 35%, transparent); }
.switch { position: relative; width: 36px; height: 20px; }
.switch input { display: none; }
.switch span { margin: 0; position: absolute; inset: 0; border-radius: 10px; background: var(--border-strong); }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #fff; transition: transform var(--transition); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }

.users-grid { display: grid; grid-template-columns: minmax(260px, 330px) minmax(680px, 1fr); gap: var(--density-gap); align-items: start; }
.user-create-card { padding: 18px; }
.user-create-card h2 { margin: 0; font-size: 15px; }
.user-create-card > p { margin: 6px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.user-create-form input, .user-create-form select { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--border); outline: 0; color: var(--text); background: var(--panel-2); border-radius: var(--radius); font-size: 11px; }
.user-create-form input:focus, .user-create-form select:focus { border-color: var(--accent-border); box-shadow: 0 0 0 2px var(--accent-soft); }
.user-create-form .primary-button { width: 100%; margin-top: 15px; }
.user-create-form .login-error { margin-top: 12px; margin-bottom: 0; }
.users-list-card { min-width: 0; overflow: hidden; }
.users-table { width: 100%; border-collapse: collapse; }
.users-table th { height: 34px; padding: 0 12px; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--border); text-align: left; font-size: 10px; font-weight: 500; white-space: nowrap; }
.users-table td { height: 58px; padding: 0 12px; color: var(--text-soft); border-bottom: 1px solid var(--border); font-size: 10px; }
.users-table tbody tr:last-child td { border-bottom: 0; }
.users-table .action-col, .users-table td:last-child { width: 226px; text-align: right; }
.account-name { display: flex; align-items: center; gap: 9px; }
.account-avatar { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border); border-radius: 50%; font: 700 10px var(--font-num); }
.account-name strong { display: block; color: var(--text); font-size: 11px; }
.account-name small { display: block; margin-top: 3px; color: var(--accent); font-size: 8px; }
.user-role-select { min-width: 96px; height: 29px; padding: 0 7px; border: 1px solid var(--border); outline: 0; color: var(--text-soft); background: var(--panel-2); border-radius: var(--radius); font-size: 9px; }
.user-role-select:disabled { cursor: not-allowed; opacity: .65; }
.account-status { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 999px; font-size: 9px; }
.account-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.account-status.is-enabled { color: var(--fall); background: var(--fall-soft); }
.account-status.is-disabled { color: var(--muted); background: var(--panel-2); }
.account-time { color: var(--muted) !important; font-family: var(--font-num); white-space: nowrap; }
.user-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.user-actions button:disabled { cursor: not-allowed; opacity: .45; }
.danger-button { color: var(--rise); border-color: color-mix(in srgb, var(--rise) 32%, transparent); }
.danger-button:hover { color: var(--rise); background: var(--rise-soft); border-color: var(--rise); }
.users-empty { height: 100px !important; text-align: center; color: var(--muted) !important; }
.invitations-page { max-width: 1320px; margin: 0 auto; }
.invitation-secret-panel { min-height: 70px; margin-bottom: var(--density-gap); padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-color: var(--accent-border); background: var(--accent-soft); }
.invitation-secret-panel span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; }
.invitation-secret-panel code { color: var(--accent); font: 600 13px var(--font-num); letter-spacing: .03em; }
.invitations-table td { min-height: 62px; line-height: 1.55; }
.invitation-code-hint { color: var(--text); font: 10px var(--font-num); }
.invitation-meta strong, .invitation-meta small { display: block; }
.invitation-meta small { margin-top: 3px; color: var(--muted); }
.invitation-status { display: inline-flex; padding: 4px 7px; border-radius: 999px; font-size: 9px; }
.invitation-status.is-active { color: var(--fall); background: var(--fall-soft); }
.invitation-status.is-used { color: var(--accent); background: var(--accent-soft); }
.invitation-status.is-revoked { color: var(--muted); background: var(--panel-2); }
.invitations-table .invitation-revoke-button:disabled { cursor: not-allowed; pointer-events: none; opacity: .55; color: var(--muted); background: transparent; border-color: var(--border); }

.login-view { height: 100%; min-width: 1000px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); background: var(--bg); }
.login-decoration { position: relative; overflow: hidden; padding: 9vh 8vw; display: flex; align-items: flex-end; border-right: 1px solid var(--border); background: radial-gradient(circle at 35% 30%, var(--accent-soft), transparent 38%), var(--panel-2); }
.login-grid { position: absolute; inset: 0; opacity: .5; background-image: linear-gradient(var(--grid) 1px,transparent 1px),linear-gradient(90deg,var(--grid) 1px,transparent 1px); background-size: 52px 52px; mask-image: linear-gradient(to bottom,black,transparent 90%); }
.login-line { position: absolute; height: 2px; transform-origin: left center; background: linear-gradient(90deg,transparent,var(--accent),transparent); box-shadow: 0 0 24px var(--accent); }
.login-line-a { width: 58vw; left: 6vw; top: 39%; transform: rotate(-12deg); }
.login-line-b { width: 50vw; left: 18vw; top: 55%; transform: rotate(17deg); opacity: .45; }
.login-copy { position: relative; z-index: 2; max-width: 650px; }
.brand-large .brand-mark { width: 40px; height: 40px; }.brand-large { font-size: 18px; }
.login-copy h1 { margin: 28px 0 12px; max-width: 620px; font-size: clamp(34px, 4vw, 58px); line-height: 1.08; letter-spacing: -.04em; }
.login-copy > p { max-width: 560px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.login-feature-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.login-feature-row span { color: var(--text-soft); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 9px; font-size: 10px; }
.login-card { width: min(400px, 80%); align-self: center; justify-self: center; padding: 30px; border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.auth-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-bottom: 22px; padding: 3px; border: 1px solid var(--border); background: var(--panel-2); border-radius: var(--radius); }
.auth-mode-switch button { height: 30px; border: 0; color: var(--muted); background: transparent; border-radius: 3px; font-size: 10px; }
.auth-mode-switch button.is-active { color: var(--text); background: var(--panel-hover); box-shadow: inset 0 0 0 1px var(--border-strong); }
.login-card-header h2 { margin: 0; font-size: 25px; }.login-card-header p { margin: 7px 0 23px; color: var(--muted); font-size: 11px; }
.field-label { display: block; margin: 14px 0 6px; color: var(--text-soft); font-size: 10px; }
.login-card input[type="text"], .login-card input[type="password"], .login-card #username { width: 100%; height: 39px; padding: 0 11px; border: 1px solid var(--border); outline: 0; background: var(--panel-2); color: var(--text); border-radius: var(--radius); font-size: 12px; }
.login-card input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 2px var(--accent-soft); }
.checkbox-row { display: flex; align-items: center; gap: 7px; margin: 14px 0; color: var(--muted); font-size: 10px; }
.checkbox-row input { accent-color: var(--accent); }
.login-button { width: 100%; height: 39px; }
.login-button:disabled { cursor: wait; opacity: .65; }
.login-note { margin-top: 12px; color: var(--muted-2); font-size: 9px; text-align: center; }
.login-error { margin: 0 0 12px; padding: 8px 10px; color: var(--rise); background: var(--rise-soft); border: 1px solid color-mix(in srgb, var(--rise) 38%, transparent); border-radius: var(--radius); font-size: 10px; line-height: 1.5; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; transform: translateX(-50%); min-width: 220px; max-width: 460px; padding: 10px 14px; color: var(--text); background: var(--panel); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 11px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); }
.modal-card { width: 520px; max-height: min(680px, 82vh); display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.password-modal-card { width: 430px; display: block; }
.password-form { padding: 4px 18px 18px; }
.password-form > p { margin: 13px 0 3px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.password-form input { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--border); outline: 0; color: var(--text); background: var(--panel-2); border-radius: var(--radius); font-size: 11px; }
.password-form input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 2px var(--accent-soft); }
.password-form .login-error { margin: 13px 0 0; }
.modal-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-header { padding: 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 17px; }
.modal-search { position: relative; height: 36px; margin: 12px; border: 1px solid var(--border); background: var(--panel-2); border-radius: var(--radius); }
.modal-search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; color: var(--muted); }
.modal-search input { width: 100%; height: 100%; padding: 0 10px 0 34px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 11px; }
.modal-symbol-list { min-height: 240px; overflow: auto; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.modal-symbol-item { min-height: 52px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 7px 14px; border-bottom: 1px solid var(--border); }
.modal-symbol-item:last-child { border-bottom: 0; }
.modal-symbol-meta strong { display: block; font-size: 11px; }.modal-symbol-meta span { display: block; margin-top: 4px; color: var(--muted); font: 9px var(--font-num); }
.modal-symbol-price { text-align: right; font: 10px var(--font-num); }
.modal-symbol-item button { height: 28px; min-width: 58px; border: 1px solid var(--accent-border); background: var(--accent-soft); color: var(--accent); border-radius: var(--radius); font-size: 9px; }
.modal-symbol-item button.is-added { color: var(--muted); background: var(--panel-2); border-color: var(--border); }
.modal-footer { min-height: 50px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }
.modal-group-select { min-height: 46px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 9px; }
.modal-group-select select { min-width: 180px; height: 30px; padding: 0 8px; border: 1px solid var(--border); outline: 0; color: var(--text); background: var(--panel-2); border-radius: var(--radius); font-size: 10px; }
#addSymbolModal .modal-card { grid-template-rows: auto auto auto minmax(0,1fr) auto; }
.inline-create-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); }
.inline-create-form input { min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--border); outline: 0; color: var(--text); background: var(--panel-2); border-radius: var(--radius); }
.watchlist-groups-list { max-height: 410px; overflow: auto; }
.watchlist-group-row { min-height: 54px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.watchlist-group-row:last-child { border-bottom: 0; }
.watchlist-group-name { min-width: 0; }
.watchlist-group-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.watchlist-group-name span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.watchlist-group-actions { display: flex; align-items: center; gap: 5px; }
.watchlist-group-actions button { min-width: 30px; }
.watchlist-group-actions .group-kline-view-button { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.group-kline-settings-card .password-form { padding-top: 16px; }
.group-kline-settings-meta { min-height: 34px; padding: 8px 10px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius); font: 9px/1.6 var(--font-num); }

@media (max-width: 1400px) {
  .index-grid { grid-template-columns: repeat(3, 1fr); }
  .index-card { min-height: 112px; }
  .quote-metrics { grid-template-columns: repeat(3, 1fr); }
  .instrument-header { grid-template-columns: minmax(260px, 1fr) 165px minmax(360px, 1.7fr) auto; }
  .data-state span:not(.status-dot) { display: none; }
  .theme-select-wrap { min-width: 118px; }
}

@media (max-height: 760px) {
  .instrument-header { height: 66px; }
  .chart-layout { height: calc(100% - 66px); }
  .quote-metrics { gap: 2px 8px; }
  .drawing-tool { min-height: 39px; }
}
