/* ============================================================
   Журнал 148 — CRM-стиль
   ============================================================ */

:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #e8fcf2;
    --text: #303438;
    --muted: #7d8590;
    --border: #e8e1d1;
    --border-strong: #f2f4f7;
    --input-border: #cbcdd6;
    --btn-dark: #2b2f33;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow-lg: 0 4px 12px -2px rgba(16, 24, 40, .10);
    --font: 'Geologica', 'Inter', Arial, 'Helvetica Neue', Helvetica, FreeSans, sans-serif;

    /* единый акцент */
    --accent: #50e598;
    --accent-strong: #2da45d;
    --accent-soft: #e8fcf2;
    --accent-soft-border: #c8eeda;
    --on-accent: #ffffff;
    --accent-glow: rgba(80, 229, 152, .30);

    /* кремовая гамма (фон сайдбара + интерфейс) */
    --pastel: #fffdf7;
    --pastel-soft: #f7f1e2;
    --pastel-border: #ddd2b8;

    --danger: #d98702;
    --danger-soft: #fdf4e4;
    --success: #059669;
    --success-soft: #ecfdf5;
    --warn: #b45309;
    --warn-soft: #fffbeb;

    --sidebar-w: 236px;
    --sidebar-bg: #fff;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Прелоадер (пишущая ручка)
   ============================================================ */

.preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--text);
    transition: opacity .35s ease, visibility .35s ease;
}
.preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.preloader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
}
.preloader-pen {
    animation: preloader-bob 1.2s ease-in-out infinite;
}
.preloader-line-path {
    stroke: #e91616;
    stroke-dasharray: 240;
    stroke-dashoffset: 240;
    animation: preloader-write 1.6s ease-in-out infinite;
}
@keyframes preloader-bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}
@keyframes preloader-write {
    0% { stroke-dashoffset: 240; opacity: 0; }
    12% { opacity: 1; }
    70% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}

h1 { font-size: 1.45rem; margin: 0 0 .35rem; font-weight: 300; letter-spacing: -.01em; }
h2 { font-size: 1rem; margin: 0 0 .65rem; font-weight: 300; letter-spacing: -.01em; }
h3 { font-size: .92rem; margin: 1rem 0 .5rem; font-weight: 300; }
p { margin: 0 0 .75rem; }

hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

.muted { color: var(--muted); }
.small { font-size: .82rem; }
.danger { color: var(--danger); }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 .35em; font-size: .85em; }

/* ============================================================
   Каркас: сайдбар + основная область
   ============================================================ */

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1rem .75rem;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .35rem .5rem;
    margin-bottom: 1.25rem;
    color: var(--text);
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: -.01em;
}
.sidebar-brand:hover { text-decoration: none; }

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 7px;
    background: var(--accent);
    color: #fff;
    font-weight: 300;
    font-size: .85rem;
    flex-shrink: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .7rem;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 300;
    font-size: .9rem;
    transition: background .12s, color .12s;
    border-left: 2px solid transparent;
}
.nav-icon {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    color: var(--text);
    transition: color .12s;
}
.nav-link:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }
.nav-link:hover .nav-icon { color: var(--accent); }
.nav-link.active { background: var(--accent-soft); color: var(--text); border-left-color: var(--accent); font-weight: 300; }
.nav-link.active .nav-icon { color: var(--accent); }

.nav-section {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    margin: .1rem 0 .5rem;
}

.nav-select {
    margin: .35rem 0 .55rem;
}
.nav-select-label {
    display: block;
    font-size: .7rem;
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--muted);
    margin: 0 .15rem .3rem;
}
.nav-select .class-switcher {
    margin-top: 0;
    padding: .4rem .55rem;
    font-size: .88rem;
    font-weight: 300;
    background: var(--surface);
}

.nav-sub {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    margin: .1rem 0 .35rem;
    padding-left: .35rem;
}

.nav-sub-toggle {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .32rem .55rem;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-weight: 300;
    font-size: .85rem;
    transition: background .12s, color .12s;
}
.nav-sub-toggle:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }

.nav-caret {
    width: 0;
    height: 0;
    flex-shrink: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid currentColor;
    transition: transform .15s ease;
}
.nav-sub-item.open > .nav-sub-toggle .nav-caret { transform: rotate(90deg); }

.nav-sub-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-sub-links {
    display: none;
    flex-direction: column;
    gap: .05rem;
    padding-left: 1.05rem;
    margin: .1rem 0 .15rem;
    border-left: 1px solid var(--border);
}
.nav-sub-item.open > .nav-sub-links { display: flex; }

.nav-sublink {
    display: block;
    padding: .28rem .6rem;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: .8rem;
    transition: background .12s, color .12s;
}
.nav-sublink:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }
.nav-sublink.active { color: var(--text); font-weight: 300; background: var(--accent-soft); }

.sidebar-foot {
    border-top: 1px solid var(--border);
    padding-top: .85rem;
    margin-top: 1rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 .35rem .75rem;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-sm);
}
.sidebar-user:hover { background: var(--accent-soft); }
.sidebar-user.active { background: var(--accent-soft); }

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}
.sidebar-user-info strong {
    font-size: .85rem;
    font-weight: 300;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-info .muted { font-size: .75rem; }

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f2f4f7;
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 2.5rem;
    flex: 1;
}

.footer {
    text-align: center;
    color: var(--muted);
    font-size: .8rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* ============================================================
   Карточки и сетка
   ============================================================ */

.card {
    /* background: var(--surface); */
    /* border: 1px solid var(--border); */
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.card.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.card.center { text-align: center; }
.card.half { max-width: 50%; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .65rem;
}
.card-head h2 { margin-bottom: 0; }

.card-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .75rem;
}

.grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 760px) {
    .grid { grid-template-columns: 1fr 1fr; }
    .grid > .card:only-child { grid-column: 1 / -1; }
}

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
}

.row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    gap: .75rem;
}

.row-actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.row-form {
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}
.row-form input { flex: 1; min-width: 180px; }

.holiday-row {
    position: relative;
    display: flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: nowrap;
    margin-bottom: .5rem;
    padding: .4rem 2rem .4rem .5rem;
    border-radius: var(--radius-sm);
    transition: background .12s;
}
.holiday-row:hover { background: var(--accent-soft); }
.holiday-row input[type="date"] { flex: 0 0 auto; width: 9.5rem; min-width: 0; }
.holiday-row input[type="text"] { flex: 1 1 auto; min-width: 140px; }
.holiday-row .holiday-remove {
    position: absolute;
    top: .2rem;
    right: .35rem;
    margin-left: 0;
    line-height: 1;
}

.field { display: block; margin-bottom: .9rem; }
.field-label { display: block; font-size: .82rem; font-weight: 300; color: var(--muted); margin-bottom: .3rem; }
.field select, .field input[type="file"], .field textarea { margin-top: 0; }
.field input[type="file"] { padding: .4rem 0; border: none; background: transparent; }

.upload-help { width: 100%; border-collapse: collapse; margin: .6rem 0 1rem; font-size: .85rem; }
.upload-help th, .upload-help td { text-align: left; padding: .4rem .6rem; border: 1px solid var(--border); }
.upload-help th { background: var(--surface-2); font-weight: 300; }

.student-add-form { flex-wrap: nowrap; }
.student-add-form input[type="text"] { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.student-add-form input[type="date"] { flex: 0 0 auto; width: 8.5rem; min-width: 0; margin-top: 0; }
.student-add-form .btn { flex: 0 0 auto; margin-top: 0; }
@media (max-width: 500px) {
    .student-add-form { flex-wrap: wrap; }
    .student-add-form input[type="text"] { flex: 1 1 100%; }
    .student-add-form input[type="date"] { flex: 1 1 auto; width: auto; }
    .student-add-form .btn { flex: 1 1 auto; }
}

.inline { display: inline; }

.page-head { margin-bottom: 1.25rem; }
.page-head .back {
    display: inline-block;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 300;
    margin-bottom: .4rem;
}
.page-head .back:hover { text-decoration: underline; }
.page-head h1 { margin-top: 0; }

/* ============================================================
   Карточки классов
   ============================================================ */

.class-card { position: relative; }

.class-card-head {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.class-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 300;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.class-badge:hover { text-decoration: none; background: var(--accent-strong); }

.class-card-title { flex: 1; min-width: 0; }
.class-card-title h2 { margin: 0; }
.class-card-title h2 a { color: var(--text); }
.class-card-title h2 a:hover { color: var(--text); text-decoration: underline; }

.card-delete { position: absolute; top: .85rem; right: .85rem; }
.card-delete .link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 6px;
    color: var(--muted);
    font-size: 1.1rem;
    background: transparent;
}
.card-delete .link-btn:hover { background: var(--danger-soft); color: var(--danger); }

.chip {
    display: inline-block;
    padding: .15rem .6rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 300;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
}

a.chip { color: var(--text); }
a.chip:hover {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--text);
    text-decoration: none;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: .8rem;
}

.chip-del {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}
.chip-del .chip-x {
    background: none;
    border: none;
    padding: 0 .15rem;
    margin: 0;
    cursor: pointer;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
}
.chip-del .chip-x:hover { color: var(--danger); }

.card-new {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-style: dashed;
    border-color: var(--border-strong);
    background: var(--surface-2);
    min-height: 190px;
}
.card-new h2 { margin-bottom: .9rem; }

.card-new-plus {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: .5rem;
}

/* ============================================================
   Баннер модерации
   ============================================================ */

.moderation-banner {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .8rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-weight: 300;
    font-size: .9rem;
    color: var(--warn);
    background: var(--warn-soft);
    border: 1px solid #fde68a;
    box-shadow: var(--shadow);
}
.moderation-banner:hover { text-decoration: none; border-color: #fbbf24; }
.moderation-banner .chevron { margin-left: auto; font-size: 1.1rem; }

.banner-dot {
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: #f59e0b;
    flex-shrink: 0;
    animation: pulse 1.8s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, .07); }
}

/* ============================================================
   Формы
   ============================================================ */

label {
    display: block;
    font-size: .84rem;
    font-weight: 300;
    margin-bottom: .7rem;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
input[type="time"],
select,
textarea {
    display: block;
    width: 100%;
    margin-top: .28rem;
    padding: .45rem .65rem;
    font: inherit;
    font-size: .9rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    transition: border-color .12s, box-shadow .12s;
}

textarea { resize: vertical; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .5rem .75rem .75rem;
    margin: 0 0 .8rem;
}
legend { font-size: .8rem; color: var(--muted); padding: 0 .35rem; }

.radio, .checkbox {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 300;
    margin-bottom: .45rem;
}
.radio input, .checkbox input { margin: 0; width: auto; accent-color: var(--accent); }

.role-field {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.role-field legend { flex-basis: 100%; }
.role-field .radio {
    flex: 1 1 0;
    min-width: 0;
    padding: .5rem .7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    justify-content: center;
    margin-bottom: 0;
}
.role-field .radio:hover { border-color: var(--accent); background: var(--accent-soft); }
.role-field .radio:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.filter-form { display: flex; gap: .5rem; align-items: center; }
.filter-form input { width: auto; flex: 1; min-width: 140px; margin-top: 0; }

/* ============================================================
   Кнопки
   ============================================================ */

.btn {
    display: inline-block;
    padding: .45rem .85rem;
    font: inherit;
    font-size: .88rem;
    font-weight: 300;
    border-radius: var(--radius-sm);
    border: 1px solid var(--pastel-border);
    background: var(--pastel-soft);
    color: var(--accent-strong);
    cursor: pointer;
    text-align: center;
    transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--pastel); border-color: var(--accent-soft-border); color: var(--accent-strong); text-decoration: none; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: 0 1px 2px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--text); }

.btn-dark { background: var(--btn-dark); border-color: var(--btn-dark); color: #fff; }
.btn-dark:hover { background: #3a3f45; border-color: #3a3f45; color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--pastel-soft); color: var(--accent-strong); }

.btn-sm { padding: .28rem .6rem; font-size: .8rem; border-radius: 6px; }
.btn-block { width: 100%; }

.link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: .85rem;
    color: var(--accent);
    cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

/* ============================================================
   Уведомления
   ============================================================ */

.alert {
    padding: .7rem .9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin-bottom: 1rem;
    font-size: .88rem;
    line-height: 1.45;
}
.alert-error { background: var(--danger-soft); border-color: #f2d3a8; color: #d98702; }
.alert-success { background: var(--success-soft); border-color: #a7f3d0; color: #047857; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.alert-warn { background: var(--warn-soft); border-color: #fde68a; color: #92400e; }

/* ============================================================
   Таблицы
   ============================================================ */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}
.table th, .table td {
    text-align: left;
    padding: .55rem .6rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table thead th {
    color: var(--muted);
    font-weight: 300;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table td.td-actions { width: 50px; text-align: right; }

/* Расписание: фиксированные колонки, чтобы строки не «прыгали» */
.schedule-table { table-layout: fixed; }
.schedule-table .col-time { width: 112px; }
.schedule-table .col-room { width: 110px; }
.schedule-table .col-actions { width: 76px; text-align: right; }
.schedule-table .col-actions .link-btn { white-space: nowrap; }

@media (max-width: 600px) {
    .table { font-size: .8rem; }
    .table th, .table td { padding: .45rem .4rem; }
}

/* ============================================================
   Оценки
   ============================================================ */

.grade {
    font-weight: 300;
    font-size: 1rem;
    color: var(--text);
    line-height: 1.3;
}
.grade-5 { color: #047857; }
.grade-4 { color: #1d4ed8; }
.grade-3 { color: #92400e; }
.grade-2 { color: #d98702; }
.grade-н { color: var(--muted); }
.grade-б { color: #c2410c; }
.grade-о { color: #a16207; }
.grade-у { color: #6d28d9; }
.grade-double { color: var(--text); }

/* Зелёное подчёркивание оценки при наличии комментария */
.grade.has-comment {
    text-decoration: underline;
    text-decoration-color: #16a34a;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.grade-edit-row { background: var(--accent-soft); }
.grade-edit-row td { padding: .55rem .6rem; }
.grade-edit-form {
    display: flex;
    gap: .45rem;
    align-items: center;
    flex-wrap: wrap;
}
.grade-edit-form select,
.grade-edit-form input[type="date"],
.grade-edit-form input[type="text"] {
    width: auto;
    margin-top: 0;
}
.grade-edit-form input[type="text"] { flex: 1; min-width: 120px; }
.grade-edit-form select { min-width: 130px; }

/* ============================================================
   Списки учеников
   ============================================================ */

.student-list { list-style: none; margin: 0; padding: 0; }

.student-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}
.student-item:last-child { border-bottom: none; }

.student-main {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.student-name {
    color: var(--text);
    text-decoration: none;
    font-weight: 300;
}
.student-name:hover { color: var(--text); text-decoration: underline; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: .3rem;
    border-radius: 6px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
}
.icon-btn:hover { background: var(--pastel-soft); color: var(--accent); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.student-side {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}

.student-toolbar {
    display: flex;
    gap: .6rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: .6rem;
}
.student-toolbar input[type="text"] { flex: 1; min-width: 200px; margin-top: 0; }

.student-edit-form {
    display: none;
    flex-basis: 100%;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
    padding: .55rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}
.student-edit-form input[type="text"] { flex: 1; min-width: 180px; margin-top: 0; }
.student-edit-form input[type="date"] { width: auto; margin-top: 0; }

.student-card-edit-form {
    margin-top: .75rem;
    padding: .75rem;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
}

.ta-r { text-align: right; }

.profile-list { margin: 0; }
.profile-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .5rem 0;
    border-bottom: 1px solid var(--border);
}
.profile-row:last-child { border-bottom: none; }
.profile-row dt { color: var(--muted); font-weight: 300; }
.profile-row dd { margin: 0; font-weight: 300; }

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: hsl(var(--avh, 220) 65% 88%);
    color: hsl(var(--avh, 220) 45% 30%);
    font-weight: 300;
    font-size: .85rem;
    flex-shrink: 0;
}
.avatar-lg { width: 2.9rem; height: 2.9rem; font-size: 1.15rem; }

.invite-status {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.link-chip {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    padding: .2rem .6rem;
    border-radius: 999px;
    border: 1px solid var(--border);
}
.link-active { background: var(--success-soft); border-color: #a7f3d0; }
.link-pending { background: var(--warn-soft); border-color: #fde68a; }
.link-rejected { background: var(--danger-soft); border-color: #f2d3a8; }
.link-revoked { background: var(--surface-2); }

/* ============================================================
   Бейджи и списки ДЗ
   ============================================================ */

.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 300;
    background: var(--accent-soft);
    color: var(--accent);
}
.badge-warn { background: var(--warn-soft); color: var(--warn); }

.hw-list { list-style: none; margin: 0; padding: 0; }
.hw-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}
.hw-item:last-child { border-bottom: none; }
.hw-main { display: flex; flex-direction: column; gap: .2rem; }
.hw-main .badge { color: var(--text); }

/* Дневник домашних заданий (разворот на 6 дней: 2 колонки по 3 дня) */
.diary-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1rem;
}
.diary-week-label {
    font-weight: 300;
    color: var(--text);
    min-width: 220px;
    text-align: center;
}

.diary-spread {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
.diary-page {
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: .9rem 1rem 1.1rem;
}
.diary-page:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}
.diary-page:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}
.diary-day { margin-bottom: 1.15rem; }
.diary-day:last-child { margin-bottom: 0; }
.diary-day-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-strong);
    padding-bottom: .3rem;
    margin-bottom: .55rem;
}
.diary-dow { font-weight: 500; font-size: .85rem; color: var(--text); }
.diary-date { font-size: .78rem; color: var(--muted); }
.diary-day-body { display: flex; flex-direction: column; gap: .5rem; }
.diary-task {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .45rem .55rem;
}
.diary-task--plain {
    background: transparent;
    border: none;
    padding: 0;
}
.diary-task-main { flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.diary-task-title { font-weight: 300; color: var(--text); font-size: .9rem; }
.diary-task-desc { font-size: .82rem; color: var(--muted); }
.diary-task .badge {
    flex: 0 0 6rem;
    max-width: 6rem;
    margin-top: .1rem;
    padding: 0;
    background: none;
    color: var(--text);
    border-radius: 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.diary-empty { color: var(--muted); font-size: .85rem; opacity: .45; padding: .25rem .25rem; }
.diary-del { font-size: 1rem; line-height: 1; opacity: .35; }
.diary-task:hover .diary-del { opacity: 1; }
.diary-edit,
.diary-task .diary-del { color: var(--text); }
.diary-task { cursor: pointer; }
.diary-task .diary-del { cursor: pointer; }
.hw-item:has(.diary-edit) { cursor: pointer; }

@media (max-width: 760px) {
    .diary-spread { grid-template-columns: 1fr; gap: 1rem; }
    .diary-page:first-child { border-radius: var(--radius); }
    .diary-page:last-child { border-radius: var(--radius); }
    .card.half { max-width: 100%; }
}

.day-title {
    margin: 1rem 0 .4rem;
    color: var(--muted);
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .05em;
    font-weight: 300;
}

/* ============================================================
   Модальное окно (редактирование ДЗ)
   ============================================================ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal.open { display: flex; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 24, 40, .45);
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1.25rem .35rem;
}
.modal-head h2 { margin: 0; }

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--muted);
    padding: 0 .15rem;
}
.modal-close:hover { color: var(--danger); }

.modal-body {
    padding: .5rem 1.25rem 1.25rem;
}

.schedule-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.schedule-list li {
    display: flex;
    gap: .6rem;
    align-items: baseline;
    padding: .4rem 0;
    border-bottom: 1px solid var(--border);
}
.schedule-list li:last-child { border-bottom: none; }

/* ============================================================
   Кабинет родителя
   ============================================================ */

.child-card {
    display: flex;
    align-items: center;
    gap: .9rem;
    color: var(--text);
}
.child-card:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.child-card .chevron { margin-left: auto; color: var(--muted); font-size: 1.2rem; }

/* ============================================================
   Авторизация
   ============================================================ */

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.auth-logo { text-align: center; margin-bottom: 1.4rem; }
.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 300;
    font-size: 1.25rem;
    margin-bottom: .7rem;
}
.auth-logo h1 { margin: 0 0 .2rem; }
.auth-logo p { margin: 0; }

.tabs {
    display: flex;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .2rem;
    margin-bottom: 1.2rem;
}

.tab {
    flex: 1;
    padding: .5rem;
    background: none;
    border: none;
    border-radius: 5px;
    font: inherit;
    font-size: .9rem;
    font-weight: 300;
    color: var(--muted);
    cursor: pointer;
    transition: background .12s, color .12s;
}
.tab.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tabs-inline {
    display: inline-flex;
    gap: .15rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .15rem;
    margin-bottom: 0;
    flex: none;
}
.tabs-inline .tab {
    flex: none;
    padding: .3rem .65rem;
    font-size: .82rem;
    border-radius: 5px;
}
.tabs-inline .tab:hover { color: var(--text); text-decoration: none; }

.smart-captcha { margin: .75rem 0; }

/* ============================================================
   Карточка приглашения (печать)
   ============================================================ */

.invite-card {
    text-align: center;
    padding: 1rem;
}
.invite-card a { color: var(--text); text-decoration: underline; }
.invite-card .qr { margin: 1rem auto; display: block; }
.invite-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.35rem;
    letter-spacing: .28em;
    margin: .7rem 0;
    font-weight: 300;
}
.invite-student { margin-bottom: .5rem; }
.invite-student strong { display: block; }

.auth-code-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.auth-code-row .qr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: block;
}
.auth-code-info { flex: 1; min-width: 200px; }
.auth-code-info .invite-code {
    text-align: left;
    margin: 0 0 .3rem;
    font-size: 1.15rem;
    letter-spacing: .2em;
}
.auth-code-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: .5rem;
}

.print-toolbar { text-align: right; margin-bottom: 1rem; }

/* Печать всех кодов доступа: по 4 карточки на страницу (2×2) */
.cards-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    page-break-after: always;
    break-inside: avoid;
    margin-bottom: .75rem;
}
.cards-page:last-child { page-break-after: auto; margin-bottom: 0; }
.cards-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem;
    text-align: center;
    break-inside: avoid;
}
.cards-card .qr { margin: .6rem auto; display: block; }
.cards-card a { color: var(--text); text-decoration: underline; }

@media print {
    .no-print { display: none !important; }
    .sidebar, .footer, .alert { display: none !important; }
    body { background: #fff; }
    .container { padding: 0; max-width: none; }
    .print-area { border: none; box-shadow: none; }
    .cards-page { gap: 0; margin-bottom: 0; }
    .cards-card { border: 1px dashed #bbb; border-radius: 0; }
}

/* ============================================================
   Подтверждение привязки
   ============================================================ */

.confirm-child {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: .7rem 0;
}

/* ============================================================
   Сообщения
   ============================================================ */

.msg-list { list-style: none; margin: 0; padding: 0; }

.msg-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .8rem 0;
    border-bottom: 1px solid var(--border);
}
.msg-item:last-child { border-bottom: none; }

.msg-link-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex: 1;
    min-width: 0;
    color: var(--text);
}
.msg-link-inner:hover { text-decoration: underline; }

.msg-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.msg-head { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.msg-head strong { font-weight: 300; }

.msg-meta { display: flex; flex-wrap: wrap; gap: .15rem; }

.msg-body {
    font-size: .85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.msg-body-full { white-space: pre-wrap; line-height: 1.6; }

.msg-read { flex-shrink: 0; }

.read {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .75rem;
    font-weight: 300;
    padding: .15rem .55rem;
    border-radius: 999px;
}

/* Переписка в стиле мессенджера */
.msg-thread {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
.msg-thread .card-head {
    padding: 1rem 1.25rem .75rem;
    margin-bottom: 0;
}
.msg-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    max-height: 58vh;
    padding: .75rem 1.25rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.msg-pager {
    text-align: center;
    margin: .25rem 0 .75rem;
}
.msg-thread .msg-body {
    white-space: pre-wrap;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
}
.msg-compose {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .9rem 1.25rem 1.25rem;
    background: var(--surface-2);
}
.msg-compose-row {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
}
.msg-compose-row select {
    flex: 0 0 250px;
    max-width: 250px;
    margin-top: 0;
}
.msg-compose-row input[type="text"] {
    flex: 1;
    min-width: 0;
    margin-top: 0;
}
.msg-compose-row textarea {
    flex: 1;
    margin-top: 0;
    resize: none;
}
.msg-compose-row .btn {
    flex-shrink: 0;
    margin-top: 0;
}
@media (max-width: 720px) {
    .msg-compose-row { flex-wrap: wrap; }
    .msg-compose-row select { flex: 1 1 100%; max-width: none; }
}
.read-yes { background: var(--success-soft); color: #047857; }
.read-no { background: var(--warn-soft); color: var(--warn); }

.chevron { color: var(--muted); font-size: 1.1rem; }

/* ============================================================
   Адаптивность
   ============================================================ */

/* Мобильный бургер-бар (скрыт на десктопе) */
.mobile-bar { display: none; }
.mobile-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--text);
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: -.01em;
}
.mobile-brand:hover { text-decoration: none; }
.burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border: none;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.burger:hover { background: var(--accent-soft); }
.sidebar-backdrop { display: none; }

@media (max-width: 720px) {
    .app { flex-direction: column; }
    .mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 60;
        height: 3.4rem;
        padding: 0 .9rem;
        background: var(--sidebar-bg);
        border-bottom: 1px solid var(--border);
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        z-index: 100;
        padding: 1rem .75rem;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .sidebar .sidebar-brand { display: none; }
    .sidebar-nav {
        flex: 1;
        overflow-y: auto;
        flex-direction: column;
    }
    .nav-link {
        width: 100%;
        border-left: none;
        padding: .6rem .7rem;
    }
    .sidebar-foot { margin-top: auto; }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(16, 24, 40, .4);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease, visibility .25s ease;
    }
    .sidebar-backdrop.open { opacity: 1; visibility: visible; }
    .container { padding: 1rem 1rem 2rem; }
    .row-2, .row-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   Классный журнал (сетка оценок)
   ============================================================ */

.journal-head h1 { margin-bottom: 0; }

.journal-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.journal-field {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    font-size: .78rem;
    font-weight: 300;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .03em;
}
.journal-field select {
    margin-top: 0;
    min-width: 150px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 300;
}

.journal-year {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}
.journal-year-label {
    font-weight: 300;
    font-size: .95rem;
    letter-spacing: -.01em;
    min-width: 5.5rem;
    text-align: center;
}

.journal-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.journal-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: .82rem;
}
.journal-table th,
.journal-table td {
    border: 0;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: .25rem .35rem;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
}

.journal-table .jr-corner,
.journal-table .jr-student {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 2;
    text-align: left;
    width: 240px;
    min-width: 240px;
    max-width: 240px;
    font-weight: 300;
    overflow: hidden;
    text-overflow: ellipsis;
}
.jr-corner { z-index: 4; }

.jr-avg {
    position: sticky;
    right: 0;
    background: var(--surface-2);
    z-index: 3;
    font-weight: 300;
    color: var(--text);
    width: 68px;
    min-width: 68px;
    max-width: 68px;
    padding: .25rem .5rem;
    text-align: center;
}
.journal-table th.jr-avg,
.journal-table td.jr-avg {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}
.jr-avg-label {
    display: inline-block;
    max-width: 100%;
    font-weight: 300;
    font-size: .78rem;
    line-height: 1.2;
    white-space: normal;
}

.jr-month {
    background: var(--surface-2);
    font-weight: 300;
    font-size: .78rem;
    color: var(--text);
    padding: .45rem .5rem;
}

.jr-day {
    background: var(--surface-2);
    padding: .2rem .3rem;
    min-width: 30px;
}
.jr-day .jr-dow {
    display: block;
    font-size: .64rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--muted);
    font-weight: 300;
}
.jr-day .jr-num { font-weight: 300; color: var(--text); }

.jr-cell {
    min-width: 34px;
    height: 34px;
    cursor: pointer;
    transition: background .12s;
}
.jr-cell:hover { background: var(--accent-soft); }
.journal-table tbody tr:hover .jr-student { background: var(--accent-soft); }

.jr-mark { margin: 2px 3px; }

/* Панель ввода отметок */
.jr-popover {
    position: fixed;
    z-index: 1000;
    width: 264px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .8rem;
}

.jr-pop-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .6rem;
}
.jr-pop-title { min-width: 0; }
.jr-pop-title strong { display: block; font-size: .9rem; }
.jr-pop-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--muted);
    padding: 0 .15rem;
}
.jr-pop-close:hover { color: var(--danger); }

.jr-pop-marks {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    align-items: center;
    min-height: 1.8rem;
    margin-bottom: .6rem;
}
.jr-pop-marks .empty { color: var(--muted); font-size: .8rem; }

.jr-pop-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .15rem .3rem;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface);
}
.jr-pop-chip .grade { min-width: 1.1rem; text-align: center; }
.jr-chip-x {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}
.jr-chip-x:hover { color: var(--danger); }

.jr-chip-edit {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1;
    padding: 0;
}
.jr-chip-edit:hover { color: var(--accent); }

.jr-pop-chip.editing { background: var(--accent-soft); border-color: var(--accent); }

.jr-pop-edit {
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: .55rem;
    margin-bottom: .6rem;
    background: var(--surface-2);
}
.jr-pop-edit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .45rem;
}
.jr-pop-edit-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--accent);
    font-weight: 300;
}
.jr-pop-edit-current { font-size: 1.15rem; }
.jr-pop-edit-values {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    align-items: center;
    margin-bottom: .45rem;
}
.jr-pop-edit-values button {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    cursor: pointer;
    font-weight: 300;
    font-size: .8rem;
    color: var(--text);
}
.jr-pop-edit-values button:hover { border-color: var(--accent); color: var(--accent); }
.jr-pop-edit-values button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.jr-pop-edit-values input.jr-edit-value { width: 3.2rem; margin-top: 0; }
.jr-pop-edit input.jr-edit-comment { margin-top: 0; width: 100%; }
.jr-pop-edit-actions {
    display: flex;
    gap: .4rem;
    justify-content: flex-end;
    margin-top: .5rem;
}
.jr-edit-save,
.jr-edit-cancel {
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    cursor: pointer;
    padding: .2rem .6rem;
    font-size: .8rem;
    line-height: 1.3;
}
.jr-edit-save { background: var(--accent); border-color: var(--accent); color: #fff; }
.jr-edit-save:hover { filter: brightness(1.05); }
.jr-edit-cancel { background: none; color: var(--text); }
.jr-edit-cancel:hover { border-color: var(--danger); color: var(--danger); }

.jr-pop-add {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .6rem;
}
.jr-pop-add button {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    cursor: pointer;
    font-weight: 300;
    font-size: .82rem;
    color: var(--text);
    transition: background .12s, color .12s, border-color .12s;
}
.jr-pop-add button:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.jr-pop-comment { width: 100%; }

.jr-pop-double {
    display: flex;
    gap: .35rem;
    margin-bottom: .6rem;
}
.jr-pop-double input { flex: 1; min-width: 0; margin-top: 0; }
.jr-pop-double button { flex-shrink: 0; }
