:root {
    --ink: #1b2436;
    --ink-soft: #5b6478;
    --blue: #2470ff;
    --blue-soft: #e9f1ff;
    --blue-line: #cfe0ff;
    --green: #1fae6b;
    --red: #ff5c5c;
    --purple: #8b5cf6;
    --card-bg: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f6f9ff;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 36px 20px 80px;
}

/* ===================== */
/* HEADER */
/* ===================== */
.topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}

.topbar a {
    color: var(--blue);
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}

.topbar a:hover { text-decoration: underline; }

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.eyebrow {
    display: inline-block;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 13px;
    font-weight: bold;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.page-header h1 {
    font-family: "Fredoka", Arial, sans-serif;
    font-size: 36px;
    margin: 0;
}

/* ===================== */
/* CARDS */
/* ===================== */
.card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 26px 26px 28px;
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(20, 30, 60, .06);
}

.card h2 {
    font-family: "Fredoka", Arial, sans-serif;
    font-size: 22px;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h2 .num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--blue);
    color: white;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card p { margin: 0 0 12px; }
.card p:last-child { margin-bottom: 0; }

.rule-list {
    margin: 0 0 4px;
    padding-left: 20px;
}

.rule-list li {
    margin-bottom: 8px;
}

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

.examples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.example-chip {
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: bold;
    padding: 8px 14px;
    border-radius: 12px;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
}

.note {
    background: #fff8e6;
    border-left: 4px solid #ffb020;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    margin-top: 14px;
}

.graph-caption {
    font-size: 13px;
    color: var(--ink-soft);
    text-align: center;
    margin: 10px 0 0;
}

/* ===================== */
/* RADICAL (√ с чертой сверху) */
/* ===================== */
.radical {
    display: inline-flex;
    align-items: stretch;
    vertical-align: middle;
    margin: 0 2px;
}

.radical-symbol {
    display: inline-flex;
    align-items: flex-end;
    font-family: "Fredoka", Arial, sans-serif;
    font-weight: 600;
    font-size: 1.1em;
    padding-bottom: 1px;
    padding-right: 1px;
}

.radical-content {
    border-top: 2.2px solid currentColor;
    padding: 2px 3px 0 2px;
    margin-top: 2px;
}

/* ===================== */
/* ВЛОЖЕННЫЕ МНОЖЕСТВА ЧИСЕЛ */
/* ===================== */
.number-sets-diagram {
    display: flex;
    justify-content: center;
    margin: 20px 0 6px;
}

.ns-box {
    border-radius: 18px;
    padding: 20px 18px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ns-label {
    font-family: "Fredoka", Arial, sans-serif;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
}

.ns-example {
    font-size: 12px;
    color: var(--ink-soft);
    margin-bottom: 14px;
}

.ns-rational {
    background: #f2edff;
    border: 2px solid #ddccff;
}

.ns-rational .ns-label { color: var(--purple); }

.ns-integer {
    background: var(--blue-soft);
    border: 2px solid var(--blue-line);
}

.ns-integer .ns-label { color: var(--blue); }

.ns-natural {
    background: #f2fbf7;
    border: 2px solid #c9ecdc;
    padding-bottom: 16px;
}

.ns-natural .ns-label { color: var(--green); }

.ns-real-outer {
    background: #f6f9ff;
    border: 2px solid #dbe4f5;
    width: 100%;
}

.ns-real-outer > .ns-label {
    color: var(--ink);
    font-size: 17px;
    margin-bottom: 14px;
}

.ns-real-inner {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap;
}

.ns-irrational {
    background: #fff5f8;
    border: 2px solid #ffd0e0;
    justify-content: center;
    min-width: 130px;
}

.ns-irrational .ns-label { color: #e64980; }

.ns-compact { padding: 14px 14px 12px; }
.ns-compact .ns-label { font-size: 13px; margin-bottom: 2px; }
.ns-compact .ns-example { margin-bottom: 10px; font-size: 11px; }

/* ===================== */
/* TRAINER LINK */
/* ===================== */
.trainer-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(135deg, var(--blue), #4c8bff);
    color: white;
    border-radius: 20px;
    padding: 24px 26px;
    text-decoration: none;
    margin-top: 8px;
    transition: transform .15s ease, box-shadow .15s ease;
    box-shadow: 0 10px 26px rgba(36, 112, 255, .3);
}

.trainer-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(36, 112, 255, .4);
}

.trainer-link .tl-text h3 {
    margin: 0 0 4px;
    font-family: "Fredoka", Arial, sans-serif;
    font-size: 20px;
}

.trainer-link .tl-text p {
    margin: 0;
    font-size: 14px;
    opacity: .9;
}

.trainer-link .tl-go {
    font-size: 28px;
    flex-shrink: 0;
}

@media (max-width: 560px) {
    .page-header h1 { font-size: 28px; }
    .ns-real-inner { flex-direction: column; align-items: center; }
}
