:root {
    --bg: #eef4ff;
    --bg-2: #f8fafc;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #dbe4f0;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --green: #16a34a;
    --amber: #d97706;
    --red: #dc2626;
    --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34rem),
        radial-gradient(circle at top right, rgba(22, 163, 74, 0.12), transparent 32rem),
        linear-gradient(180deg, var(--bg), var(--bg-2));
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

.app-shell { max-width: 1180px; }

.app-header { padding: 18px 0 10px; position: sticky; top: 0; z-index: 30; backdrop-filter: blur(16px); }

.nav-shell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(219, 228, 240, 0.9);
    border-radius: 999px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 800;
    text-decoration: none;
    padding-left: 6px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #22c55e);
    color: white;
}

.nav-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: end; }

.content-card,
.metric-card,
.table-card,
.guide-card,
.hero-card,
.insight-card,
.callout,
.install-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.hero-card {
    padding: clamp(24px, 4vw, 46px);
    color: white;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.98), rgba(30, 64, 175, 0.94)),
        radial-gradient(circle at 90% 20%, rgba(34, 197, 94, 0.45), transparent 25rem);
    overflow: hidden;
    position: relative;
}

.settings-hero { background: linear-gradient(135deg, #0f172a, #2563eb); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.86;
    margin-bottom: 12px;
}

.display-title {
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 0.98;
    font-size: clamp(2.2rem, 6vw, 4.9rem);
}

.hero-copy { color: rgba(255, 255, 255, 0.86); font-size: 1.05rem; max-width: 640px; }

.now-panel {
    padding: 24px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

.now-price { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.04em; margin: 8px 0; }
.now-status, .threshold-line { color: rgba(255, 255, 255, 0.88); }

.content-card { padding: clamp(20px, 3vw, 32px); margin: 18px 0; }

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card { padding: 18px; height: 100%; }
.metric-label { color: var(--muted); font-size: 0.86rem; margin-bottom: 8px; }
.metric-value { font-size: clamp(1.12rem, 2vw, 1.45rem); font-weight: 800; letter-spacing: -0.02em; }
.small-muted { color: var(--muted); font-size: 0.9rem; }

.insight-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    height: 100%;
    padding: 16px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.insight-card p { margin: 4px 0 0; color: var(--muted); }
.insight-icon { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 16px; background: #eff6ff; }
.danger-soft .insight-icon { background: #fee2e2; }
.comfort-soft .insight-icon { background: #ecfeff; }
.long-soft .insight-icon { background: #f5f3ff; }

.callout { display: flex; gap: 14px; padding: 18px; height: 100%; }
.callout span { font-size: 1.6rem; }
.callout p { margin: 5px 0 0; color: var(--muted); }
.callout.low { background: #f0fdf4; border-color: #bbf7d0; }
.callout.high { background: #fef2f2; border-color: #fecaca; }

.table-card { overflow: hidden; }
.table thead th { background: #0f172a; color: white; border: 0; font-weight: 700; }
.table td, .table th { vertical-align: middle; padding: 14px 16px; }
.hora-actual td { background: #dbeafe !important; font-weight: 700; }
.price-pill { display: inline-block; min-width: 112px; padding: 7px 11px; border-radius: 999px; font-weight: 800; }
.price-low { background: #dcfce7; color: #166534; }
.price-mid { background: #fef3c7; color: #92400e; }
.price-high { background: #fee2e2; color: #991b1b; }
.price-bar { height: 12px; background: #e2e8f0; border-radius: 999px; overflow: hidden; min-width: 120px; }
.price-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #22c55e, #f59e0b, #ef4444); }

.form-help { color: var(--muted); font-size: 0.86rem; margin-top: 6px; }
.option-card, .channel-card {
    display: block;
    height: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #f8fafc;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.option-card:hover, .channel-card:hover { transform: translateY(-2px); border-color: #93c5fd; box-shadow: 0 10px 28px rgba(37, 99, 235, 0.12); }
.option-card input, .channel-card input { margin-right: 8px; }
.option-card span, .channel-title { display: block; font-weight: 800; margin: 4px 0; }
.option-card small, .channel-card small { display: block; color: var(--muted); }
.channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.telegram-fields { padding: 16px; border-radius: 22px; background: #f8fafc; border: 1px solid var(--border); }
.status-box { padding: 12px 14px; border-radius: 16px; background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.status-box.ok { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.status-box.warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.status-box.error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.install-card { padding: 18px; background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.28); color: white; }
.install-card p { color: rgba(255, 255, 255, 0.82); margin: 8px 0 14px; }
.feature-list { padding-left: 1.1rem; color: var(--muted); }
.feature-list li { margin-bottom: 10px; }
.settings-side { top: 96px; }

#site-footer { color: var(--muted); padding: 20px 0 34px; }

@media (max-width: 768px) {
    .app-header { position: static; }
    .nav-shell { border-radius: 24px; align-items: flex-start; }
    .brand { font-size: 0.98rem; }
    .section-heading { flex-direction: column; }
    .content-card { padding: 18px; }
    .channel-grid { grid-template-columns: 1fr; }
    .table td, .table th { padding: 12px 10px; }
    .price-pill { min-width: auto; }
}

.help-hero { background: linear-gradient(135deg, #1e293b, #2563eb 58%, #16a34a); }

.preset-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.preset-card {
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f8fafc;
    padding: 13px 14px;
    color: var(--text);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.preset-card:hover,
.preset-card.selected {
    transform: translateY(-1px);
    border-color: #60a5fa;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
    background: #eff6ff;
}

.preset-card strong,
.preset-card span {
    display: block;
}

.preset-card span {
    color: var(--muted);
    font-size: 0.82rem;
    margin-top: 3px;
}

.step-list {
    padding-left: 1.2rem;
    color: var(--muted);
}

.step-list li {
    margin-bottom: 10px;
}

.step-list li:last-child { margin-bottom: 0; }

.step-number {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: #eff6ff;
    color: var(--primary-dark);
    font-weight: 800;
    margin-bottom: 14px;
}

.telegram-guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.faq-accordion .accordion-item {
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #fff;
}

.faq-accordion .accordion-button {
    font-weight: 800;
    background: #fff;
}

.faq-accordion .accordion-button:not(.collapsed) {
    color: var(--primary-dark);
    background: #eff6ff;
    box-shadow: none;
}

code {
    color: #1e40af;
    background: #eff6ff;
    border-radius: 8px;
    padding: 0.12rem 0.35rem;
}

#site-footer a {
    color: inherit;
    font-weight: 700;
}

@media (max-width: 992px) {
    .telegram-guide-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav-shell { flex-direction: column; border-radius: 24px; }
    .nav-actions { justify-content: flex-start; }
    .preset-grid { grid-template-columns: 1fr; }
}

.recommendation-card {
    padding: clamp(20px, 3vw, 30px);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    background: linear-gradient(135deg, #ffffff, #eff6ff);
}
.recommendation-card.low { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border-color: #bbf7d0; }
.recommendation-card.mid { background: linear-gradient(135deg, #ffffff, #eff6ff); border-color: #bfdbfe; }
.recommendation-card.high { background: linear-gradient(135deg, #fff7ed, #fee2e2); border-color: #fed7aa; }
.recommendation-card.neutral { background: linear-gradient(135deg, #ffffff, #f1f5f9); }

.quick-mode-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.quick-mode-card {
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
    padding: 14px;
    color: var(--text);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.quick-mode-card:hover,
.quick-mode-card.selected {
    transform: translateY(-1px);
    border-color: #60a5fa;
    background: #eff6ff;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}
.quick-mode-card strong,
.quick-mode-card span { display: block; }
.quick-mode-card span { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.manual-threshold-box {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.status-list { display: grid; gap: 10px; }
.status-list > div {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fafc;
}
.status-list small { color: var(--muted); text-align: right; }

@media (max-width: 992px) {
    .quick-mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 576px) {
    .quick-mode-grid { grid-template-columns: 1fr; }
}
