/* ============================================================
   Trading Signal Annotation Tool — Styles
   ============================================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0d1117;
    --bg2: #161b22;
    --bg3: #21262d;
    --text: #8b949e;
    --text2: #c9d1d9;
    --border: #30363d;
    --accent: #1f6feb;
    --green: #22c55e;
    --red: #ef4444;
    --amber: #f59e0b;
    --radius: 6px;
    --font: 'SF Mono', 'Cascadia Code', 'JetBrains Mono', 'Consolas', monospace;
}

html,
body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 13px;
    user-select: none;
    -webkit-user-select: none;
}

/* ============================================================
   Layout
   ============================================================ */

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
}

/* --- Toolbar: top 15% --- */
#toolbar {
    flex: 0 0 15vh;
    min-height: 48px;
    max-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    gap: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.toolbar-center {
    flex: 1;
    text-align: center;
    overflow: hidden;
    font-size: 12px;
    font-family: var(--font);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    line-height: 1.3;
}

.toolbar-row {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Symbol select */
#symbol-select {
    background: var(--bg3);
    color: var(--text2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 8px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
}
#symbol-select:focus {
    border-color: var(--accent);
}

/* Timeframe buttons */
#timeframe-group {
    display: flex;
    gap: 2px;
}

.tf-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 4px 8px;
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    transition: 0.15s;
}
.tf-btn:hover {
    color: var(--text2);
    background: var(--bg3);
}
.tf-btn.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(31, 111, 235, 0.1);
}

/* Toolbar buttons */
.tool-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 8px;
    height: 26px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.15s;
    white-space: nowrap;
}
.tool-btn:hover {
    color: var(--text2);
    background: var(--bg3);
}

.live-btn.active {
    color: var(--green);
    border-color: var(--green);
    animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* OHLC bar */
#ohlc-bar {
    font-family: var(--font);
    font-size: 12px;
}
.toolbar-info {
    font-family: var(--font);
    font-size: 11px;
    opacity: 0.8;
    margin-left: 8px;
    white-space: nowrap;
}
.ohlc-val {
    font-weight: 500;
    margin-right: 6px;
}
.ohlc-val.up {
    color: var(--green);
}
.ohlc-val.down {
    color: var(--red);
}
.ohlc-time {
    color: var(--text);
    margin-left: 4px;
    opacity: 0.7;
}
#data-source {
    font-family: var(--font);
    font-size: 10px;
    color: var(--text);
    opacity: 0.45;
    margin-left: 10px;
    white-space: nowrap;
}

/* --- Chart: middle 55% --- */
#chart-container {
    flex: 0 0 55vh;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

#chart {
    width: 100%;
    height: 100%;
}

/* Loading overlay */
#chart-container.loading::after {
    content: '数据加载中...';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 17, 23, 0.85);
    color: var(--text2);
    font-size: 14px;
    z-index: 10;
    letter-spacing: 2px;
}

/* --- Signal Area: bottom 30% --- */
#signal-area {
    flex: 0 0 37vh;
    min-height: 140px;
    max-height: 360px;
    display: flex;
    flex-direction: column;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    overflow: hidden;
}

/* Signal history */
#signal-history {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: var(--bg2);
}

.signal-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px 4px;
    font-size: 12px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sig-count {
    background: var(--bg3);
    border-radius: 10px;
    padding: 0 8px;
    font-size: 11px;
    font-family: var(--font);
}

#signal-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
    min-height: 0;
}
#signal-list.hidden {
    display: none;
}

/* Signal area controls (category/search rows) */
#signal-controls {
    flex-shrink: 0;
    padding: 2px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}
#signal-controls.hidden {
    display: none;
}
.sig-ctrl-select {
    background: var(--bg);
    color: var(--text2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2px 4px;
    font-size: 11px;
    font-family: var(--font);
    cursor: pointer;
    outline: none;
    max-width: 140px;
}
.sig-ctrl-select:focus {
    border-color: var(--accent);
}
.sig-ctrl-count {
    font-family: var(--font);
    font-size: 10px;
    color: var(--text);
    opacity: 0.5;
}
.sig-ctrl-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    padding: 0 4px;
    line-height: 1;
    opacity: 0.5;
    transition: 0.1s;
}
.sig-ctrl-btn:hover {
    opacity: 1;
    color: var(--text2);
}
.sig-ctrl-input {
    background: var(--bg);
    color: var(--text2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2px 6px;
    font-size: 11px;
    font-family: var(--font);
    outline: none;
    width: 120px;
}
.sig-ctrl-input:focus {
    border-color: var(--accent);
}#signal-list::-webkit-scrollbar {
    width: 4px;
}
#signal-list::-webkit-scrollbar-track {
    background: transparent;
}
#signal-list::-webkit-scrollbar-thumb {
    background: var(--bg3);
    border-radius: 2px;
}

.signal-empty {
    text-align: center;
    color: var(--text);
    padding: 20px 0;
    font-size: 13px;
    opacity: 0.5;
}

.sig-entry {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: 0.1s;
    flex-wrap: wrap;
}
.sig-entry:hover {
    background: var(--bg3);
}

.sig-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.sig-info {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}

.sig-type {
    font-weight: 600;
    font-size: 12px;
}

.sig-meta {
    font-family: var(--font);
    font-size: 11px;
    color: var(--text);
    opacity: 0.8;
}

.sig-note {
    width: 100%;
    padding: 4px 0 2px 16px;
    font-size: 12px;
    color: var(--text2);
    opacity: 0.85;
    line-height: 1.4;
    word-break: break-word;
}

.sig-del {
    background: none;
    border: none;
    color: var(--red);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    margin-left: auto;
    opacity: 0;
    transition: 0.1s;
    line-height: 1;
    flex-shrink: 0;
}
.sig-entry:hover .sig-del {
    opacity: 0.6;
}
.sig-del:hover {
    opacity: 1 !important;
}

.sig-filters {
    display: flex;
    gap: 2px;
}
.sig-filter {
    background: transparent;
    color: var(--text);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 2px 6px;
    font-size: 11px;
    font-family: var(--font);
    cursor: pointer;
    transition: 0.1s;
}
.sig-filter:hover {
    color: var(--text2);
    background: var(--bg3);
}
.sig-filter.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(31, 111, 235, 0.1);
}

/* --- Notes area --- */
#note-area {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 12px;
    background: var(--bg3);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    min-height: 32px;
    transition: 0.15s;
}
#note-area.hidden {
    display: none;
}
.note-top {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
#note-signal-info {
    font-size: 11px;
    color: var(--text);
    font-family: var(--font);
    white-space: nowrap;
    flex-shrink: 0;
    opacity: 0.7;
}
.note-ref-btns {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.note-ref-btn {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 10px;
    font-family: var(--font);
    cursor: pointer;
    transition: 0.1s;
    line-height: 1.6;
}
.note-ref-btn:hover {
    color: var(--text2);
    background: var(--bg);
    border-color: var(--accent);
}
.note-ref-btn:disabled {
    opacity: 0.3;
    cursor: default;
}
.note-ref-btn:disabled:hover {
    color: var(--text);
    background: transparent;
    border-color: var(--border);
}
#note-category {
    background: var(--bg);
    color: var(--text2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2px 6px;
    font-size: 11px;
    font-family: var(--font);
    cursor: pointer;
    outline: none;
    margin-left: auto;
    flex-shrink: 0;
}
#note-category:focus {
    border-color: var(--accent);
}
#note-category:disabled {
    opacity: 0.4;
    cursor: default;
}
#note-input {
    flex: 1;
    background: var(--bg);
    color: var(--text2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 8px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    min-width: 0;
    resize: none;
    line-height: 1.4;
    min-height: 28px;
    max-height: 80px;
}
#note-input:focus {
    border-color: var(--accent);
}
#note-input:disabled {
    opacity: 0.4;
}

/* Note rendered references */
.note-ref {
    display: inline-block;
    font-size: 11px;
    font-family: var(--font);
    border-radius: 3px;
    padding: 0 5px;
    line-height: 1.6;
    margin: 0 1px;
}
.note-ref-flash {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    text-decoration: none;
    cursor: pointer;
}
.note-ref-flash:hover {
    text-decoration: underline;
}
.note-ref-article {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    text-decoration: none;
    cursor: pointer;
}
.note-ref-article:hover {
    text-decoration: underline;
}
.note-ref-note {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    cursor: help;
}

/* Flash / Article / Note pickers (shared overlay class) */
.picker-overlay {
    position: fixed;
    bottom: calc(30vh + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 500px;
    max-height: 220px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}
.picker-overlay.hidden {
    display: none;
}
.flash-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    font-size: 11px;
    color: var(--text);
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.picker-close {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    line-height: 1;
}
.picker-close:hover {
    color: var(--text2);
}
.picker-list {
    overflow-y: auto;
    flex: 1;
}
.picker-list::-webkit-scrollbar {
    width: 3px;
}
.picker-list::-webkit-scrollbar-thumb {
    background: var(--bg3);
    border-radius: 2px;
}
.flash-picker-item {
    padding: 5px 8px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text2);
    border-bottom: 1px solid var(--border);
    line-height: 1.3;
    transition: 0.05s;
}
.flash-picker-item:last-child {
    border-bottom: none;
}
.flash-picker-item:hover {
    background: var(--bg3);
}
.flash-picker-item .fpi-time {
    font-family: var(--font);
    font-size: 10px;
    color: var(--text);
    opacity: 0.5;
    margin-right: 6px;
}

/* Category badges */
.sig-cat {
    display: inline-block;
    font-size: 10px;
    padding: 0 5px;
    border-radius: 3px;
    font-family: var(--font);
    line-height: 1.6;
    margin-right: 4px;
}

/* Tabs */
.sig-tabs {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.sig-tab {
    background: transparent;
    color: var(--text);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 2px 8px;
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    transition: 0.1s;
}
.sig-tab:hover {
    color: var(--text2);
    background: var(--bg3);
}
.sig-tab.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(31, 111, 235, 0.1);
}

/* Note list */
#note-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
    min-height: 0;
}
#note-list::-webkit-scrollbar {
    width: 4px;
}
#note-list::-webkit-scrollbar-track {
    background: transparent;
}
#note-list::-webkit-scrollbar-thumb {
    background: var(--bg3);
    border-radius: 2px;
}
#note-list.hidden {
    display: none;
}

.note-entry {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: 0.1s;
}
.note-entry:hover {
    background: var(--bg3);
}
.note-entry .note-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}
.note-entry .note-body {
    flex: 1;
    min-width: 0;
}
.note-entry .note-meta {
    font-size: 11px;
    color: var(--text);
    opacity: 0.8;
    font-family: var(--font);
}
.note-entry .note-text {
    font-size: 12px;
    color: var(--text2);
    line-height: 1.4;
    margin-top: 2px;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.note-entry .note-time {
    font-size: 10px;
    color: var(--text);
    opacity: 0.5;
    font-family: var(--font);
    margin-top: 2px;
}

/* --- Newsflash --- */
#newsflash-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
    min-height: 0;
}
#newsflash-list::-webkit-scrollbar {
    width: 4px;
}
#newsflash-list::-webkit-scrollbar-track {
    background: transparent;
}
#newsflash-list::-webkit-scrollbar-thumb {
    background: var(--bg3);
    border-radius: 2px;
}
#newsflash-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    background: var(--bg2);
}
#newsflash-list.hidden {
    display: none;
}

.news-entry {
    padding: 8px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: 0.1s;
    border-bottom: 1px solid var(--border);
}
.news-entry:last-child {
    border-bottom: none;
}
.news-entry:hover {
    background: var(--bg3);
}
.news-entry.news-imp {
    border-left: 2px solid var(--amber);
}

.news-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.news-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.news-imp .news-dot {
    background: var(--amber);
}
.news-time {
    font-family: var(--font);
    font-size: 11px;
    color: var(--text);
    opacity: 0.6;
}
.news-bm {
    user-select: none;
    transition: transform 0.1s;
}
.news-bm:hover {
    transform: scale(1.2);
}
.news-badge {
    font-size: 10px;
    color: var(--amber);
    border: 1px solid var(--amber);
    border-radius: 3px;
    padding: 0 4px;
    font-family: var(--font);
    line-height: 1.4;
}
.news-title {
    font-size: 13px;
    color: var(--text2);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 3px;
}
.news-content {
    font-size: 12px;
    color: var(--text);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.news-source {
    font-size: 10px;
    color: var(--accent);
    opacity: 0.6;
    margin-top: 4px;
    font-family: var(--font);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.news-imp .news-source {
    opacity: 0.8;
}

/* --- Signal Buttons --- */
#signal-buttons {
    display: flex;
    gap: 8px;
    padding: 6px 12px 8px;
    flex-shrink: 0;
}

.signal-btn {
    flex: 1;
    padding: 8px 0;
    border: none;
    border-radius: var(--radius);
    font-size: 18px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: 0.15s;
    letter-spacing: 4px;
    position: relative;
    overflow: hidden;
}
.signal-btn:active {
    transform: scale(0.97);
}
.signal-btn::after {
    content: attr(data-shortcut);
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 10px;
    font-weight: 400;
    opacity: 0.4;
    font-family: var(--font);
    letter-spacing: 0;
}

.buy-btn {
    background: var(--green);
    color: #000;
}
.buy-btn:hover {
    background: #16a34a;
}

.hold-btn {
    background: var(--amber);
    color: #000;
}
.hold-btn:hover {
    background: #d97706;
}

.sell-btn {
    background: var(--red);
    color: #fff;
}
.sell-btn:hover {
    background: #dc2626;
}

/* ============================================================
   Fullscreen chart mode
   ============================================================ */

#app.fullscreen #toolbar {
    display: none;
}
#app.fullscreen #signal-area {
    display: none;
}
#app.fullscreen #chart-container {
    flex: 1;
    height: 100vh;
}

#btn-fs-exit {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 50;
    display: none;
    background: var(--bg3);
    color: var(--text2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 10px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    opacity: 0.5;
    transition: 0.15s;
}
#btn-fs-exit:hover {
    opacity: 1;
    background: var(--bg);
}
#app.fullscreen #btn-fs-exit {
    display: block;
}

/* ============================================================
   Signal stats
   ============================================================ */

.sig-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sig-stats {
    font-family: var(--font);
    font-size: 11px;
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sig-stat-up { color: var(--green); font-weight: 600; }
.sig-stat-mid { color: var(--amber); font-weight: 600; }
.sig-stat-down { color: var(--red); font-weight: 600; }

/* ============================================================
   Toast
   ============================================================ */

.toast {
    position: fixed;
    bottom: calc(30vh + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg3);
    color: var(--text2);
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-family: var(--font);
    border: 1px solid var(--border);
    opacity: 0;
    transition: 0.25s ease;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast-success {
    border-color: var(--green);
}
.toast-error {
    border-color: var(--red);
}
.toast-info {
    border-color: var(--accent);
}

/* Confirm dialog */
.confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
}
.confirm-backdrop.show {
    display: block;
}
.confirm-overlay {
    position: fixed;
    bottom: calc(37vh + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg3);
    color: var(--text2);
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    font-family: var(--font);
    border: 1px solid var(--border);
    opacity: 0;
    transition: 0.25s ease;
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 16px;
    pointer-events: none;
    white-space: nowrap;
}
.confirm-overlay.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.confirm-msg {
    color: var(--text2);
}
.confirm-btn {
    background: var(--bg2);
    color: var(--text2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 14px;
    font-size: 12px;
    cursor: pointer;
    font-family: var(--font);
}
.confirm-btn:hover {
    background: var(--bg1);
}
.confirm-btn.ok {
    border-color: var(--red);
    color: var(--red);
}
.confirm-btn.ok:hover {
    background: rgba(239,68,68,0.15);
}

/* ============================================================
   Symbol select (grouped dropdown)
   ============================================================ */

.sym-select {
    background: var(--bg3);
    color: var(--text2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 6px;
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    outline: none;
    max-width: 256px;
}
.sym-select:focus {
    border-color: var(--accent);
}
.sym-select optgroup {
    font-family: inherit;
    font-size: 11px;
    color: var(--text);
    background: var(--bg2);
}
.sym-select option {
    font-family: inherit;
    font-size: 12px;
    background: var(--bg2);
    color: var(--text2);
    padding: 2px 4px;
}

/* ============================================================
   Tool select (dropdown)
   ============================================================ */

.tool-select {
    background: var(--bg3);
    color: var(--text2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 4px;
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
    outline: none;
    height: 26px;
}
.tool-select:focus {
    border-color: var(--accent);
}

/* ============================================================
   Draw mode
   ============================================================ */

#chart-container.draw-mode {
    cursor: crosshair;
}

#btn-struct.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(31, 111, 235, 0.1);
}

/* ============================================================
   Responsive tweaks
   ============================================================ */

@media (max-width: 640px) {
    #toolbar {
        flex-wrap: wrap;
        min-height: 56px;
        padding: 4px 8px;
    }
    .toolbar-left {
        flex-wrap: wrap;
    }
    .tf-btn {
        padding: 2px 5px;
        font-size: 11px;
    }
    .signal-btn {
        font-size: 15px;
        padding: 6px 0;
        letter-spacing: 2px;
    }
    .signal-btn::after {
        display: none;
    }
    #note-area {
        flex-wrap: wrap;
    }
}
