:root {
    --bg-color: #000000;
    --card-bg: #1c1c1e;
    --text-primary: #ffffff;
    --text-secondary: #86868b;
    --accent: #007aff; /* Apple Blue */
    --accent-hover: #0051a8;
    --danger: #ff3b30;
    --success: #34c759;
    --glass: rgba(28, 28, 30, 0.95);
    --border-radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 100px;
}

/* --- HEADER --- */
.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 30px;
    position: relative;
    z-index: 100;
}

.logo { 
    font-weight: 700; 
    font-size: 20px; 
    letter-spacing: -0.5px; 
    white-space: nowrap; 
    display: flex; 
    align-items: center; 
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* DIAMOND BUTTON */
.diamond-btn {
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid var(--accent);
    color: white;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
    animation: pulse 2s infinite;
}
.diamond-btn:hover {
    background: var(--accent);
    transform: scale(1.1);
}
.diamond-btn.hidden { display: none; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 122, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 122, 255, 0); }
}

.auth-display { font-size: 13px; color: white; font-weight: 500; }

.battery-wrapper {
    display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary);
    background: #1a1a1a; padding: 4px 8px; border-radius: 8px; border: 1px solid #333;
}
.battery { width: 24px; height: 12px; border: 1px solid var(--text-secondary); border-radius: 3px; padding: 1px; position: relative; }
.battery::after { content: ''; position: absolute; right: -3px; top: 3px; width: 2px; height: 4px; background: var(--text-secondary); border-radius: 0 1px 1px 0; }
.battery .level { height: 100%; background: var(--success); width: 100%; border-radius: 1px; transition: width 0.3s, background 0.3s; }

.lang-switch {
    display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
    color: var(--text-secondary); background: #2c2c2e; padding: 6px 10px; border-radius: 8px;
    cursor: pointer; border: 1px solid #333;
}
.lang-opt { cursor: pointer; transition: color 0.2s, text-shadow 0.2s; color: #555; }
.lang-opt:hover { opacity: 1; color: white; }
.lang-opt.active { color: #ffffff !important; font-weight: bold; text-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
.lang-sep { opacity: 0.3; }

.limit-counter { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }

/* --- HERO & SEO --- */
.hero { text-align: center; margin-bottom: 20px; }
.hero h1 { font-size: 36px; font-weight: 700; letter-spacing: -1px; margin-bottom: 10px; background: linear-gradient(90deg, #fff, #a1a1a6); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--text-secondary); font-size: 15px; max-width: 400px; margin: 0 auto; line-height: 1.4; }

/* SEO Section */
.seo-section {
    text-align: center;
    margin-top: 80px;
    margin-bottom: 30px;
    padding: 0 20px;
    opacity: 1;
    transition: opacity 0.5s, max-height 0.5s;
    max-height: 1200px;
    overflow: hidden;
    width: 100%;
    max-width: 800px; 
    margin-left: auto; 
    margin-right: auto;
    box-sizing: border-box;
}
.seo-section.hidden { opacity: 0; max-height: 0; margin: 0; }
.seo-section h2 { font-size: 24px; color: white; margin-bottom: 20px; }
.seo-section > p { 
    font-size: 14px; color: var(--text-secondary); line-height: 1.6; 
    max-width: 700px; margin: 0 auto 40px auto; 
    width: 100%; overflow-wrap: break-word; word-wrap: break-word;
}

.seo-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
    text-align: left; max-width: 900px; margin: 0 auto;
}
.seo-grid h3 { color: white; font-size: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.seo-grid p { color: var(--text-secondary); font-size: 13px; line-height: 1.5; margin: 0; }

/* --- MARKET TABS (UPDATED) --- */
.market-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.tab-btn {
    background: transparent; border: 1px solid #333; color: var(--text-secondary);
    padding: 10px 24px; border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600;
    transition: all 0.2s; position: relative;
}
.tab-btn:hover { border-color: #555; background: #2c2c2e; }

/* ACTIVE STATE (Теперь красивый синий) */
.tab-btn.active {
    border-color: var(--accent);
    color: white;
    background: rgba(0, 122, 255, 0.15); /* Легкий синий фон */
}

.daily-setups-strip {
    display: flex;
    justify-content: center;
    margin: -8px 0 18px;
}
.daily-setups-btn {
    border: 1px solid rgba(52, 199, 89, 0.45);
    background: rgba(52, 199, 89, 0.12);
    color: #fff;
    border-radius: 12px;
    min-height: 40px;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s, transform 0.1s;
}
.daily-setups-btn:hover {
    background: rgba(52, 199, 89, 0.2);
    border-color: rgba(52, 199, 89, 0.75);
}
.daily-setups-btn:active {
    transform: scale(0.97);
}
.daily-setups-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}
.daily-setups-banner {
    grid-column: 1 / -1;
    border: 1px solid #303036;
    background: #151516;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    font-size: 13px;
}
.daily-setups-banner strong {
    display: block;
    color: #fff;
    font-size: 15px;
    margin-bottom: 3px;
}
.shared-setup-cta {
    display: flex;
    justify-content: center;
    margin: 18px 0 0;
}
.setup-feedback {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.setup-feedback button {
    flex: 1;
    border: 1px solid #333;
    background: #141416;
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.18s;
}
.setup-feedback button:hover,
.setup-feedback button.active {
    color: #fff;
    border-color: var(--accent);
    background: rgba(0, 122, 255, 0.15);
}

/* --- DRAWING AREA --- */
.drawing-section {
    background: var(--card-bg); border-radius: var(--border-radius); padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); border: 1px solid #333; position: relative; z-index: 10;
}
.canvas-wrapper {
    position: relative; width: 100%; height: 300px; background: #121212;
    border-radius: 12px; overflow: hidden; cursor: crosshair; border: 1px solid #333; touch-action: none;
}
canvas { display: block; width: 100%; height: 100%; touch-action: none; position: relative; z-index: 2; }
.canvas-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center; pointer-events: none;
    opacity: 1; transition: opacity 0.3s; z-index: 1;
}
.canvas-overlay p { color: var(--text-secondary); font-size: 14px; user-select: none; }
.icon-btn {
    position: absolute; top: 10px; right: 10px; background: rgba(50,50,50,0.8); border: none; color: white;
    width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: 14px;
    backdrop-filter: blur(10px); transition: 0.2s; z-index: 10;
}
.icon-btn:hover { background: rgba(80,80,80,1); }

/* --- PROGRESS BAR --- */
.progress-container {
    width: 100%; height: 4px; background: #222; margin-top: 15px; border-radius: 2px; overflow: hidden;
}
.progress-bar {
    height: 100%; width: 0%; background: var(--accent);
    transition: width 0.2s; box-shadow: 0 0 10px var(--accent);
}

/* --- CONTROLS --- */
.controls { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 15px; justify-content: space-between; align-items: center; }
.toggles { display: flex; gap: 10px; background: #2c2c2e; padding: 4px; border-radius: 10px; }
.toggle-item { position: relative; cursor: pointer; }
.toggle-item input { display: none; }
.toggle-item span { display: block; padding: 6px 12px; font-size: 13px; color: var(--text-secondary); border-radius: 7px; transition: 0.2s; user-select: none; }
.toggle-item input:checked + span { background: #636366; color: #fff; }
.toggle-item input.locked + span { opacity: 0.6; color: #888; border: 1px solid transparent; }
.toggle-item input.locked:hover + span { opacity: 0.6; color: #666; cursor: pointer; }

.settings-btn {
    background: transparent; border: none; color: var(--text-secondary);
    width: 40px; height: 40px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.settings-btn:hover { color: white; transform: rotate(30deg); }

.buttons-row { display: flex; gap: 10px; align-items: center; }

.action-btn {
    background: var(--accent); border: none; color: white; padding: 10px 24px; border-radius: 20px;
    font-size: 15px; font-weight: 600; cursor: pointer; transition: transform 0.1s; display: flex; align-items: center; gap: 8px;
}
.action-btn:active { transform: scale(0.96); }
.action-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.stop-btn {
    background: rgba(255, 59, 48, 0.2); border: 1px solid var(--danger); color: var(--danger);
    padding: 10px 20px; border-radius: 20px; font-size: 14px; font-weight: 600; cursor: pointer; transition: 0.2s;
}
.stop-btn:hover { background: var(--danger); color: white; }

.spinner {
    width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); 
    border-radius: 50%; border-top-color: #fff; animation: spin 1s linear infinite; display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- RESULTS GRID --- */
.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 20px; 
    margin-top: 40px; 
    opacity: 0; 
    transform: translateY(20px); 
    transition: 0.5s;
    width: 100%;
}
.results-grid.visible { opacity: 1; transform: translateY(0); }
.hidden { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }

.result-card {
    background: var(--card-bg); border-radius: 14px; padding: 15px;
    border: 1px solid transparent; transition: transform 0.2s;
    overflow: hidden;
    height: auto;
    cursor: pointer;
}
.result-card:hover { border-color: var(--accent); }

.card-header { display: flex; justify-content: space-between; margin-bottom: 10px; }
.card-symbol { font-weight: 700; font-size: 15px; cursor: pointer; }
.card-meta { font-size: 12px; color: var(--text-secondary); }
.match-score { color: var(--success); font-weight: 600; font-size: 12px; }

.setup-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.setup-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}
.setup-badge {
    border: 1px solid #333;
    background: #141416;
    color: #d8d8dc;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.setup-badge.bullish { color: #34c759; border-color: rgba(52,199,89,0.35); background: rgba(52,199,89,0.08); }
.setup-badge.bearish { color: #ff453a; border-color: rgba(255,69,58,0.35); background: rgba(255,69,58,0.08); }
.setup-badge.neutral { color: #64d2ff; border-color: rgba(100,210,255,0.35); background: rgba(100,210,255,0.08); }
.action-score-pill {
    color: white;
    background: rgba(255,255,255,0.07);
    border: 1px solid #333;
    border-radius: 10px;
    padding: 5px 7px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.setup-mini-levels {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 11px;
}
.setup-mini-levels span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chart-preview { 
    width: 100%; 
    height: 180px; 
    position: relative; 
    margin-top: 5px;
}

/* --- PRO LOCKED CARDS (NEW) --- */
.pro-locked {
    cursor: pointer;
    position: relative;
    border-color: #333;
}
.pro-locked:hover {
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(0, 122, 255, 0.2);
}
.pro-locked .chart-preview canvas {
    filter: blur(5px);
    opacity: 0.4;
    transition: 0.3s;
}
.pro-locked:hover .chart-preview canvas {
    opacity: 0.6;
}
.blur-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- TOAST --- */
.toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(52, 199, 89, 0.9); color: white; padding: 8px 20px; border-radius: 20px;
    font-size: 14px; font-weight: 600; z-index: 2000; box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown { from { top: -50px; } to { top: 20px; } }

/* --- MODALS --- */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(5px);
    z-index: 1000; display: flex; align-items: center; justify-content: center;
}
.glass-panel {
    background: #252525; width: 90%; max-width: 400px; padding: 30px; border-radius: 24px;
    text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.7); border: 1px solid #333;
}
.premium-btn {
    background: linear-gradient(135deg, #007aff, #00c6ff); border: none; width: 100%;
    padding: 14px; border-radius: 12px; color: white; font-weight: 700; font-size: 16px;
    margin: 20px 0 10px; cursor: pointer;
}
.text-btn { background: none; border: none; color: var(--text-secondary); cursor: pointer; margin-top: 15px; font-size: 14px; }
.coming-soon { font-size: 12px; color: var(--text-secondary); display: none; margin-top: 10px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; margin: 15px 0; }
select { background: #333; color: white; border: 1px solid #444; padding: 5px 10px; border-radius: 8px; outline: none; }

/* Feedback */
.feedback-buttons { display: flex; justify-content: center; gap: 20px; margin-top: 20px; }
.fb-btn {
    background: #333; border: 1px solid #444; color: white; padding: 15px 30px; border-radius: 12px;
    font-size: 18px; cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; align-items: center; gap: 5px;
}
.fb-btn:hover { background: #444; transform: translateY(-2px); }
.fb-btn.like:hover { border-color: var(--success); }
.fb-btn.dislike:hover { border-color: var(--danger); }
textarea {
    width: 100%; background: #1a1a1a; border: 1px solid #333; color: white;
    padding: 10px; border-radius: 8px; margin-top: 10px; resize: none; outline: none;
}
textarea:focus { border-color: var(--accent); }

/* --- LEGAL FOOTER --- */
.legal-footer {
    margin-top: 80px; border-top: 1px solid #333; padding: 30px 0;
    text-align: center; color: var(--text-secondary); font-size: 12px;
}
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-bottom: 15px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; transition: 0.2s; cursor: pointer; }
.footer-links a:hover { color: white; }
.legal-content { text-align: left; }
.scrollable-text {
    max-height: 400px; overflow-y: auto; text-align: left; background: #1a1a1a;
    padding: 15px; border-radius: 8px; font-size: 13px; line-height: 1.5; margin-bottom: 15px; border: 1px solid #333;
}
.scrollable-text h3 { color: white; margin-top: 0; font-size: 16px; margin-bottom: 10px; }
.scrollable-text h4 { color: white; margin-top: 15px; font-size: 14px; margin-bottom: 5px; }
.scrollable-text p { margin-bottom: 10px; }
.cookie-link { color: var(--accent); text-decoration: none; font-weight: 600; cursor: pointer; }
.cookie-link:hover { text-decoration: underline; }

/* COOKIE BANNER */
.cookie-banner {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: 90%; max-width: 900px; background: rgba(30, 30, 30, 0.95);
    padding: 15px 20px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; gap: 15px;
    border: 1px solid #444; box-shadow: 0 10px 30px rgba(0,0,0,0.5); z-index: 999;
}
.cookie-banner p { font-size: 12px; margin: 0; color: #ccc; text-align: left; flex-grow: 1; }
.cookie-buttons { display: flex; gap: 10px; }
.cookie-banner button {
    background: var(--accent); border: none; color: white; padding: 8px 16px; border-radius: 8px;
    font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.secondary-btn { background: transparent !important; border: 1px solid #666 !important; color: #ccc !important; }
.secondary-btn:hover { border-color: #fff !important; color: #fff !important; }
.share-link-box {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.share-link-box input {
    min-width: 0;
    flex: 1;
    border: 1px solid #333;
    background: #111;
    color: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 13px;
}
.share-link-box .secondary-btn {
    white-space: nowrap;
}
.copy-share-link-btn {
    border: 1px solid rgba(0, 122, 255, 0.45);
    background: rgba(0, 122, 255, 0.14);
    color: #f5f5f7;
    border-radius: 10px;
    padding: 0 14px;
    min-height: 41px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s, border-color 0.18s, transform 0.1s;
}
.copy-share-link-btn:hover {
    background: rgba(0, 122, 255, 0.24);
    border-color: rgba(0, 122, 255, 0.75);
}
.copy-share-link-btn:active {
    transform: scale(0.97);
}
.copy-share-link-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

@media (max-width: 600px) {
    .hero h1 { font-size: 32px; }
    .glass-header { flex-direction: column; gap: 15px; align-items: flex-start; }
    .header-right { width: 100%; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
    #auth-display span:first-child { display: none; }
    .results-grid { grid-template-columns: 1fr; }
    .canvas-wrapper { height: 250px; }
    .controls { justify-content: center; }
    .buttons-row { width: 100%; justify-content: center; margin-top: 10px; }
    .action-btn, .stop-btn { width: 100%; justify-content: center; }
    .cookie-banner { flex-direction: column; align-items: flex-start; }
    .cookie-buttons { width: 100%; display: flex; gap: 10px; margin-top: 10px; }
    .cookie-banner button { width: 50%; }
    .feedback-buttons { flex-direction: column; }
    .fb-btn { width: 100%; }
    .seo-grid { grid-template-columns: 1fr; gap: 20px; }
    .share-link-box { flex-direction: column; }
    .daily-setups-banner { align-items: flex-start; flex-direction: column; }
    .shared-setup-cta .action-btn { width: 100%; }
}

#telegram-support a { color: #4dabf7; text-decoration: none; font-weight: 600; }
#telegram-support a:hover { text-decoration: underline; color: #74c0fc; }

/* SHARE BUTTON */
.card-actions { display: flex; align-items: center; gap: 10px; }
.share-icon-btn {
    background: transparent; border: 1px solid #333; color: var(--text-secondary);
    width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.share-icon-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(0, 122, 255, 0.1); }
.setup-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.setup-share-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
}
#share-preview-container canvas {
    width: 100%;
    height: auto;
    max-height: 68vh;
    object-fit: contain;
}

/* SETUP DETAIL */
.setup-modal-content {
    max-width: 640px;
    text-align: left;
    padding: 22px;
}
.setup-symbol {
    font-weight: 800;
    font-size: 20px;
    color: #fff;
}
.setup-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 4px;
}
.setup-chart-wrap {
    height: 260px;
    background: #111;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}
.setup-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.setup-metrics div,
.setup-score-row div {
    background: #151518;
    border: 1px solid #303035;
    border-radius: 10px;
    padding: 10px;
}
.setup-metrics span,
.setup-score-row span {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.setup-metrics b,
.setup-score-row strong {
    color: white;
    font-size: 15px;
}
.copyable-price {
    cursor: pointer;
    transition: color 0.15s ease;
}
.copyable-price:hover {
    color: #34c759;
}
.setup-score-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
}
.setup-factors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.setup-factors span {
    border: 1px solid #333;
    background: #101012;
    border-radius: 999px;
    padding: 7px 10px;
    color: #d8d8dc;
    font-size: 12px;
}
.setup-factors .warn {
    color: #ffcc00;
    border-color: rgba(255,204,0,0.35);
    background: rgba(255,204,0,0.08);
}
.setup-disclaimer {
    color: #8e8e93;
    font-size: 11px;
    line-height: 1.45;
    margin-top: 14px;
    text-align: center;
}

@media (max-width: 600px) {
    .setup-modal-content {
        width: 92%;
        max-height: 88vh;
        height: auto;
        max-width: 420px;
        border-radius: 22px;
        align-self: center;
        overflow-y: auto;
        padding: 18px;
    }
    #setup-modal { align-items: center; }
    .setup-chart-wrap { height: 205px; }
    .setup-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .setup-score-row { gap: 8px; }
    .setup-metrics div,
    .setup-score-row div { padding: 9px; }
    .setup-metrics b,
    .setup-score-row strong { font-size: 14px; }
    .setup-factors span { font-size: 11px; padding: 6px 8px; }
}

/* MODE TABS */
.search-mode-tabs { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.mode-btn {
    background: #1c1c1e; border: 1px solid #333; color: #888; padding: 10px 20px;
    border-radius: 12px; cursor: pointer; font-weight: 600; transition: all 0.2s; font-size: 14px;
}
.mode-btn:hover { background: #2c2c2e; color: #bbb; }
.mode-btn.active { border-color: var(--accent); color: white; background: rgba(0, 122, 255, 0.15); }

/* PATTERNS GRID */
.patterns-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; padding: 10px; }
.pattern-card {
    background: #1c1c1e; border: 1px solid #333; border-radius: 20px; padding: 0;
    aspect-ratio: 1 / 1; display: flex; justify-content: center; align-items: center;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden; position: relative;
}
.pattern-card img {
    width: 100%; height: 100%; object-fit: cover; opacity: 0.4; filter: grayscale(0.5); transition: all 0.3s ease;
}
.pattern-card span {
    position: absolute; bottom: 8px; width: 100%; text-align: center;
    font-size: 10px; font-weight: 600; color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase; letter-spacing: 0.5px; pointer-events: none;
}
.pattern-card:hover { border-color: #555; }
.pattern-card:hover img { opacity: 0.6; }
.pattern-card.selected {
    border-color: var(--accent); background: #000; box-shadow: 0 0 20px rgba(0, 122, 255, 0.4); transform: scale(1.05);
}
.pattern-card.selected img { opacity: 1; filter: grayscale(0); }
.pattern-card.selected span { color: #fff; text-shadow: 0 0 5px rgba(0, 0, 0, 1); }
@media (max-width: 600px) {
    .patterns-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
}

/* BELL BUTTON */
.icon-action-btn {
    width: 44px; height: 44px; background: #1c1c1e; border: 1px solid #333;
    border-radius: 12px; font-size: 20px; cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: 0.2s; margin-right: 10px;
}
.icon-action-btn:hover { background: #333; border-color: #555; transform: scale(1.05); }

/* ALERTS LIST */
.alerts-list { max-height: 300px; overflow-y: auto; text-align: left; margin-bottom: 10px; }
.alert-item {
    background: #111; border: 1px solid #333; border-radius: 10px; padding: 12px;
    margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center;
}
.alert-info { font-size: 13px; color: #fff; }
.alert-meta { font-size: 11px; color: #666; margin-top: 4px; }
.delete-alert-btn {
    background: rgba(255, 59, 48, 0.1); color: #ff3b30; border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 6px; padding: 6px 10px; font-size: 12px; cursor: pointer;
}
.delete-alert-btn:hover { background: #ff3b30; color: white; }

/* ALERTS MODAL HEADER */
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #333;
}
.modal-header h3 { margin: 0; font-size: 18px; font-weight: 600; color: white; }
.close-icon {
    background: transparent; border: none; color: #888; font-size: 28px; line-height: 1;
    cursor: pointer; padding: 0; transition: color 0.2s;
}
.close-icon:hover { color: white; }

/* CONNECT TG BUTTON */
.connect-tg-large {
    background: #0088cc; color: white; width: 100%; padding: 14px; border-radius: 12px;
    border: none; font-weight: 600; font-size: 16px; cursor: pointer; display: flex;
    align-items: center; justify-content: center; gap: 10px; transition: transform 0.1s;
    text-decoration: none; margin-bottom: 15px;
}
.connect-tg-large:active { transform: scale(0.98); }
.status-block a { text-decoration: none; }
