@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
  --ink: #17201d;
  --muted: #69736f;
  --paper: #f7f5ef;
  --card: #fffefa;
  --line: #deddd5;
  --green: #1d5948;
  --green-soft: #dcebe4;
  --coral: #e96f51;
  --coral-soft: #fbe3db;
  --shadow: 0 18px 50px rgba(23, 32, 29, .08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 Manrope, sans-serif; }
a { color: var(--green); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
.topbar { height: 76px; padding: 0 max(24px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(247,245,239,.92); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.brand { color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; background: var(--green); color: white; border-radius: 50%; font-family: 'Playfair Display', serif; }
.profile { display: flex; align-items: center; gap: 12px; }
.account-tools { display: flex; align-items: center; gap: 22px; }.portal-nav { display: flex; gap: 6px; }.portal-nav a { padding: 8px 11px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; }.portal-nav a:hover { color: var(--green); background: var(--green-soft); }
.profile-name { font-weight: 600; }.role, .moscow-clock { color: var(--muted); font-size: 13px; }.moscow-clock { font-variant-numeric: tabular-nums; white-space: nowrap; }
.page { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 52px 0 72px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px; border-top: 1px solid var(--line); }
h1, h2 { font-family: 'Playfair Display', serif; margin: 0; line-height: 1.05; letter-spacing: -.025em; }
h1 { font-size: clamp(42px, 6vw, 70px); } h2 { font-size: 34px; } h3 { margin: 16px 0 4px; font-size: 20px; }
.eyebrow { color: var(--coral); font-size: 12px; text-transform: uppercase; letter-spacing: .16em; font-weight: 700; margin-bottom: 12px; }
.lead { color: var(--muted); font-size: 17px; max-width: 580px; }
.hero { padding: 44px; min-height: 270px; border-radius: 28px; color: white; background: var(--green); display: flex; align-items: flex-end; justify-content: space-between; overflow: hidden; position: relative; }
.hero::after { content: ''; position: absolute; width: 280px; height: 280px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; right: -80px; top: -100px; box-shadow: 0 0 0 45px rgba(255,255,255,.03), 0 0 0 90px rgba(255,255,255,.025); }
.hero .eyebrow { color: #a9d1c1; }.hero .lead { color: #d2e3dc; }.hero > * { position: relative; z-index: 1; }
.hero-stat { min-width: 155px; border-left: 1px solid rgba(255,255,255,.3); padding-left: 24px; display: flex; flex-direction: column; }
.hero-stat strong { font: 600 54px/1 'Playfair Display', serif; }.hero-stat span { color: #d2e3dc; font-size: 13px; }
.stats-row { display: flex; gap: 28px; }.section { margin-top: 58px; }.section-head { display: flex; justify-content: space-between; margin-bottom: 22px; }
.schedule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lesson-card { padding: 24px; min-height: 205px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.lesson-card time { display: inline-block; color: var(--coral); font-weight: 700; font-size: 13px; }.lesson-card p { color: var(--muted); margin: 0 0 24px; }
.teacher-accent { border-top: 4px solid var(--coral); }.two-column { display: grid; grid-template-columns: 1.3fr .7fr; gap: 42px; }.teacher-columns { grid-template-columns: .7fr 1.3fr; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
table { width: 100%; border-collapse: collapse; } th, td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; } th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; } tbody tr:last-child td { border: 0; }
.status { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }.status.scheduled { background: #e7eef7; color: #345572; }.status.completed { background: var(--green-soft); color: var(--green); }.status.cancelled { background: var(--coral-soft); color: #9d442e; }
.status.pending-payment { background: #fff0c9; color: #7a5710; }
.status-button { border: 0; cursor: pointer; font-family: inherit; }
.upload-card, .login-card { padding: 30px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.form-stack, .upload-card { display: flex; flex-direction: column; gap: 18px; } label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: white; padding: 12px 14px; border-radius: 10px; color: var(--ink); outline: none; } input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,89,72,.1); } textarea { resize: vertical; }
.dropzone { padding: 28px; border: 1px dashed #aeb5b1; border-radius: 14px; text-align: center; }.dropzone span { color: var(--muted); font-weight: 400; }.dropzone input { border: 0; padding: 0; }
.button { border: 1px solid transparent; border-radius: 10px; padding: 11px 17px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }.button.primary { background: var(--green); color: white; }.button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }.button.small { padding: 7px 11px; font-size: 12px; }.button:disabled { opacity: .45; cursor: not-allowed; }
.file-list, .student-list { display: flex; flex-direction: column; gap: 10px; }.file-row, .student-row { display: flex; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }.file-icon, .avatar { flex: 0 0 42px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; background: var(--coral-soft); color: var(--coral); font-weight: 700; font-size: 11px; }.avatar { border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 16px; }.file-meta, .student-row > div:last-child { min-width: 0; flex: 1; display: flex; flex-direction: column; }.file-meta strong { overflow: hidden; text-overflow: ellipsis; }.file-meta span, .student-row span { color: var(--muted); font-size: 12px; }.file-row.compact { flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; }.inline-form input { min-width: 0; padding: 8px 10px; }.empty { color: var(--muted); padding: 24px; border: 1px dashed var(--line); border-radius: 14px; }.flash { padding: 14px 18px; margin-bottom: 22px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-weight: 600; }.flash.error { background: var(--coral-soft); color: #913a25; }
.telegram-link-form { display: grid; grid-template-columns: minmax(110px, 150px) auto; gap: 7px; }
.telegram-link-form input { min-width: 0; padding: 7px 9px; font-size: 12px; }
.notice-panel, .credential-card { margin-top: 28px; padding: 28px; border: 1px solid #ead39d; border-radius: 20px; background: #fff8e6; display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; align-items: center; }
.notice-panel h2, .credential-card h2 { font-size: 29px; }.notice-panel p, .credential-card p { color: var(--muted); margin: 10px 0 0; }.payment-request { background: var(--coral-soft); border-color: #efb4a4; }
.payment-cards { display: grid; gap: 10px; }.payment-card { padding: 14px 16px; display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid rgba(23,32,29,.11); border-radius: 12px; }.payment-card strong { flex: 1; }.payment-card > span, .payment-card > div { color: var(--muted); font-size: 12px; }
.check-action { flex-direction: row; align-items: center; cursor: pointer; }.check-action input { width: 18px; height: 18px; accent-color: var(--green); }.check-action span { color: var(--green); }
.credential-card { background: var(--green-soft); border-color: #abcdbf; }.credential-copy { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }.credential-copy label { grid-column: 1 / -1; }.credential-copy textarea { min-height: 84px; font-family: ui-monospace, Consolas, monospace; font-weight: 700; background: white; resize: none; }
.notification-list { display: grid; gap: 9px; }.notification-row { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }.notification-row.unread { border-left: 4px solid var(--coral); }.notification-row > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }.notification-row strong, .notification-row span { overflow-wrap: anywhere; }.notification-row span { color: var(--muted); font-size: 12px; }.compact-section { margin-top: 34px; }
.notification-tab { position: fixed; top: 46%; right: 0; z-index: 35; display: flex; align-items: center; gap: 7px; padding: 11px 10px 11px 8px; border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; color: var(--green); background: var(--card); box-shadow: var(--shadow); cursor: pointer; font-weight: 800; }.notification-tab:hover { background: var(--green-soft); }.notification-tab-arrow { font-size: 25px; line-height: .65; }.notification-tab-label { font-size: 11px; }.notification-tab b { min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border-radius: 999px; color: white; background: var(--coral); font-size: 10px; }
.notification-drawer { position: fixed; inset: 0 0 0 auto; z-index: 40; width: min(390px, calc(100vw - 32px)); display: flex; flex-direction: column; padding: 24px; border-left: 1px solid var(--line); background: #f7f5ef; box-shadow: -18px 0 40px rgba(23,32,29,.14); transform: translateX(105%); transition: transform .22s ease; }.notification-drawer.open { transform: none; }.notification-drawer-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }.notification-drawer-head h2 { font-size: 31px; }.notification-drawer .notification-list { min-height: 0; overflow-y: auto; padding: 16px 2px 24px; }.drawer-close, .notification-dismiss { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: white; cursor: pointer; font-size: 22px; line-height: 1; }.drawer-close:hover, .notification-dismiss:hover { color: #9d442e; border-color: #efb4a4; background: var(--coral-soft); }.notification-dismiss { width: 27px; height: 27px; font-size: 18px; }
.label-note { color: var(--muted); font-weight: 400; }.form-help { color: var(--muted); font-size: 12px; margin: -4px 0 0; }.admin-form { height: 100%; }.payment-inline { display: inline; }.student-search { max-width: 480px; margin: 0 0 9px; }.student-search-help { margin: 0 0 16px; }
.login-page { min-height: calc(100vh - 140px); display: grid; grid-template-columns: minmax(320px, 460px) 1fr; gap: 70px; align-items: center; }.login-card h1 { font-size: 52px; }.login-art { min-height: 570px; background: var(--green); border-radius: 32px; position: relative; overflow: hidden; }.orb { position: absolute; border-radius: 50%; }.orb.one { width: 340px; height: 340px; background: var(--coral); right: -40px; top: -70px; }.orb.two { width: 220px; height: 220px; border: 2px solid rgba(255,255,255,.5); left: 40px; bottom: 30px; box-shadow: 0 0 0 40px rgba(255,255,255,.04), 0 0 0 80px rgba(255,255,255,.03); }.quote { color: white; position: absolute; left: 60px; top: 190px; font: 700 clamp(45px, 6vw, 78px)/.95 'Playfair Display', serif; }.quote span { color: #aad0c2; }
.materials-cta { margin-top: 34px; padding: 25px 28px; display: flex; justify-content: space-between; align-items: center; gap: 28px; border: 1px solid #abcdbf; border-radius: 20px; background: linear-gradient(120deg, var(--green-soft), #f7f5ef); }.materials-cta h2 { font-size: 28px; }.materials-cta p { margin: 7px 0 0; color: var(--muted); }.student-materials-cta { border-color: #efb4a4; background: linear-gradient(120deg, var(--coral-soft), #f7f5ef); }
.dashboard-shortcuts { margin-top: 34px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dashboard-shortcuts .materials-cta { min-width: 0; height: 100%; margin-top: 0; }
.teacher-shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.teacher-shortcuts .materials-cta { align-items: flex-start; flex-direction: column; }
.teacher-shortcuts .materials-cta .button { margin-top: auto; }
.students-cta, .students-hero { border-color: #c7dace; background: linear-gradient(120deg, #e7f0e9, #f7f5ef); }
.teacher-students-page .students-create-section { margin-top: 34px; }
.student-create-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: 16px; box-shadow: none; }
.student-create-form > .form-help { grid-column: 1 / -1; margin: 0; }
.students-directory-section .section-head { align-items: end; }
.student-management-list { display: grid; gap: 14px; }
.student-management-card { min-width: 0; display: grid; gap: 18px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 8px 25px rgba(23,32,29,.04); }
.student-management-card[hidden], .student-search-empty[hidden] { display: none; }
.student-management-head { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; }
.student-management-head > .button { white-space: nowrap; }
.student-identity { min-width: 0; display: flex; align-items: center; gap: 14px; }
.student-identity > div { min-width: 0; }
.student-identity h3 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
.student-identity p { margin: 2px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.student-management-meta { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(85px, .4fr) minmax(0, 1fr); gap: 10px; margin: 0; }
.student-management-meta > div { min-width: 0; padding: 10px 13px; border-radius: 10px; background: #f7f7f3; }
.student-management-meta dt { color: var(--muted); font-size: 11px; }
.student-management-meta dd { margin: 2px 0 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.student-management-actions { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; padding-top: 17px; border-top: 1px solid var(--line); }
.student-telegram-form { min-width: 0; display: grid; grid-template-columns: minmax(130px, 230px) auto; gap: 10px; align-items: end; }
.student-telegram-form label { min-width: 0; }
.student-account-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; padding-bottom: 2px; }
.student-account-actions form { margin: 0; }
.student-search-empty { padding: 20px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; }
.calendar-cta { border-color: #cbd8e7; background: linear-gradient(120deg, #e7eef7, #f7f5ef); }
.subpage-hero { min-height: 230px; padding: 38px 42px; display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; border-radius: 28px; background: #e4ede8; border: 1px solid #c9d9d1; }.subpage-hero h1 { color: var(--green); font-size: clamp(42px, 5vw, 64px); }.subpage-hero .lead { margin-bottom: 0; }.student-library-hero { background: #fae9e2; border-color: #efc5b9; }
.materials-builder { margin-top: 30px; display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 22px; align-items: start; }.materials-sidebar, .materials-canvas { background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }.materials-sidebar { padding: 22px; position: sticky; top: 98px; }.materials-canvas { padding: 30px; min-height: 520px; }.builder-head, .canvas-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }.builder-head h2, .canvas-head h2 { font-size: 30px; }.count-badge { padding: 6px 10px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 11px; font-weight: 700; }
.material-tree { display: grid; gap: 5px; }.tree-item { min-width: 0; padding: 9px 10px 9px calc(10px + var(--depth) * 18px); display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 8px; border-radius: 9px; color: var(--ink); text-decoration: none; }.tree-item:hover { background: #f3f1eb; }.tree-item.active { color: var(--green); background: var(--green-soft); font-weight: 700; }.tree-item > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.tree-item small { color: var(--muted); }.tree-dot { width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; }.tree-item.active .tree-dot { background: currentColor; }.builder-form { display: grid; gap: 14px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }.compact-empty { padding: 16px; font-size: 12px; }
.material-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }.material-card { padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fbfaf6; }.material-card h3 { margin-top: 11px; }.material-card p { color: var(--muted); min-height: 45px; }.material-type { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }.material-type.material { color: #9d442e; background: var(--coral-soft); }
.publish-form { display: grid; gap: 16px; margin-top: 34px; padding: 26px; border-radius: 17px; background: #f3f1eb; }.publish-form .section-head { margin-bottom: 0; }.publish-form h2 { font-size: 29px; }.form-grid { display: grid; grid-template-columns: .65fr 1.35fr; gap: 14px; }.canvas-placeholder { min-height: 450px; display: grid; place-content: center; justify-items: center; text-align: center; }.canvas-placeholder > span { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); font: 600 25px 'Playfair Display', serif; }.canvas-placeholder h2 { margin-top: 20px; }.canvas-placeholder p { max-width: 480px; color: var(--muted); }
.teacher-tabs { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }.teacher-tabs a { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; background: var(--card); }.teacher-tabs a.active { color: white; border-color: var(--green); background: var(--green); }.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; padding: 12px 17px; border-radius: 11px; color: white; background: var(--green); box-shadow: var(--shadow); font-weight: 700; transform: translateY(24px); opacity: 0; pointer-events: none; transition: .2s ease; }.toast.visible { transform: none; opacity: 1; }.toast.error { background: #9d442e; }

/* Structured material tree and nested sections */
.tree-row { min-width: 0; padding-left: calc(var(--depth) * 18px); display: flex; align-items: center; gap: 4px; border-radius: 9px; }
.tree-row .tree-item { flex: 1; padding-left: 10px; }
.tree-actions { display: flex; align-items: center; gap: 2px; opacity: .35; transition: opacity .15s ease; }
.tree-row:hover .tree-actions, .tree-actions:focus-within { opacity: 1; }
.tree-actions form, .material-card-top form { margin: 0; }
.icon-button, .mini-icon { flex: 0 0 auto; border: 1px solid var(--line); color: var(--green); background: white; display: inline-grid; place-items: center; text-decoration: none; cursor: pointer; }
.icon-button { width: 36px; height: 36px; border-radius: 50%; font-size: 24px; line-height: 1; }
.mini-icon { width: 27px; height: 27px; padding: 0; border-radius: 8px; font-size: 18px; line-height: 1; }
.mini-icon:hover, .icon-button:hover { background: var(--green-soft); border-color: #abcdbf; }
.mini-icon.danger { color: #a33f2c; }
.mini-icon.danger:hover { background: var(--coral-soft); border-color: #efb4a4; }
.quick-section-form { display: grid; gap: 15px; margin-bottom: 28px; padding: 24px; border: 1px solid #abcdbf; border-radius: 17px; background: var(--green-soft); }
.rename-section-form { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(240px, 1.3fr) auto; align-items: end; gap: 14px; margin-bottom: 24px; padding: 20px; border: 1px solid #cbd8e7; border-radius: 17px; background: #f2f6fb; }.rename-section-form h2 { margin: 3px 0 0; font-size: 28px; }.rename-section-form .form-actions { white-space: nowrap; }
.quick-section-form h2 { font-size: 29px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.subsection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 30px; }
.subsection-card { min-width: 0; padding: 17px 18px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fbfaf6; }
.subsection-main { min-width: 0; flex: 1; display: grid; gap: 3px; color: var(--ink); text-decoration: none; }
.subsection-main > span { color: var(--coral); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.subsection-main > strong { overflow-wrap: anywhere; font-size: 16px; }
.subsection-main > small { color: var(--muted); }
a.subsection-card:hover, .subsection-card:has(.subsection-main:hover) { border-color: #abcdbf; background: var(--green-soft); }
.subsection-prompt { margin-bottom: 28px; }
.content-head { margin: 32px 0 18px; }
.content-head h2 { font-size: 28px; }
.material-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.teacher-label { color: var(--muted); font-size: 13px; }

/* Shared website / Telegram schedule */
.calendar-hero { background: #e7eef7; border-color: #cbd8e7; }
.teacher-calendar-hero { background: #e4ede8; border-color: #c9d9d1; }
.calendar-alert { margin-top: 24px; padding: 17px 20px; display: flex; flex-direction: column; gap: 3px; color: #7a5710; background: #fff0c9; border: 1px solid #ead39d; border-radius: 14px; }
.calendar-alert span { color: #74643d; }
.slot-builder { margin-top: 28px; padding: 25px 28px; display: grid; grid-template-columns: .75fr 1.25fr; gap: 28px; align-items: end; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.slot-builder h2 { font-size: 30px; }
.slot-builder p { margin: 8px 0 0; color: var(--muted); }
.slot-builder-form { display: grid; grid-template-columns: 1.3fr .8fr .8fr auto; gap: 10px; align-items: end; }
.calendar-shell { margin-top: 28px; padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.calendar-toolbar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 16px; margin-bottom: 15px; text-align: center; }
.calendar-toolbar .eyebrow { margin-bottom: 6px; }
.calendar-toolbar h2 { font-size: 34px; }
.month-arrow { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: #fbfaf6; text-decoration: none; font-size: 20px; }
.month-arrow:hover { border-color: #abcdbf; background: var(--green-soft); }
.calendar-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 17px; margin-bottom: 18px; color: var(--muted); font-size: 12px; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.calendar-legend i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.calendar-legend i.free { background: #9bc7b6; }.calendar-legend i.own { background: var(--coral); }.calendar-legend i.busy { background: #aeb5b1; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .1em; }
.calendar-weekdays span { padding: 8px; }
.calendar-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-day { min-width: 0; min-height: 92px; padding: 10px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; }
.calendar-day.outside { background: #f5f3ed; color: #9ca39f; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--green); }
.calendar-date { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 8px; }
.calendar-date strong { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; }
.calendar-day.today .calendar-date strong { color: white; background: var(--green); }
.calendar-date span { display: none; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.day-slots { display: grid; gap: 6px; }
.calendar-day-details { min-width: 0; }
.calendar-day-details > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; color: var(--muted); font-size: 12px; }
.calendar-day-details > summary::-webkit-details-marker { display: none; }
.slot-counts { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px 9px; }
.slot-counts b { color: var(--ink); }
.details-link { color: var(--green); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.calendar-day-details[open] .details-link { color: var(--coral); }
.calendar-day-details[open] .details-link::before { content: "Скрыть"; }
.calendar-day-details[open] .details-link { font-size: 0; }
.calendar-day-details[open] .details-link::before { font-size: 12px; }
.slot-list { display: grid; gap: 6px; margin-top: 8px; }
.lesson-slot { min-width: 0; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: #f8f7f2; font-size: 11px; }
.lesson-slot time { color: var(--ink); font-weight: 800; }
.lesson-slot > span, .slot-summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.free-slot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1px 6px; color: var(--green); background: #edf6f2; border-color: #c9e0d7; }
.free-slot button { grid-column: 1 / -1; padding: 3px 0 0; border: 0; color: var(--green); background: none; cursor: pointer; text-align: left; font-weight: 800; }
.free-slot button:disabled { color: var(--muted); cursor: not-allowed; }
.busy-slot { display: flex; gap: 6px; color: var(--muted); background: #f0efea; }
.own-slot { color: #8b3e2c; background: var(--coral-soft); border-color: #efb4a4; }
.slot-summary { min-width: 0; display: flex; gap: 6px; }
.slot-summary span { flex: 1; }
.slot-topic { margin: 5px 0 0; font-size: .82rem; line-height: 1.35; color: #6c382d; overflow-wrap: anywhere; }
.lesson-slot > small { display: block; color: var(--muted); margin-top: 3px; }
.slot-actions { margin-top: 6px; }
.slot-actions summary { color: inherit; cursor: pointer; font-weight: 800; }
.slot-actions[open] summary { margin-bottom: 8px; }
.slot-actions form { display: grid; gap: 7px; margin-top: 7px; }
.slot-actions label { font-size: 10px; }
.slot-actions select { min-width: 0; padding: 7px; font-size: 11px; }
.text-danger { padding: 3px 0; border: 0; color: #9d442e; background: none; cursor: pointer; text-align: left; font-weight: 700; }
.teacher-slot.free-slot { display: block; }
.teacher-slot.free-slot > summary { display: flex; gap: 6px; cursor: pointer; list-style: none; }
.teacher-slot.free-slot > summary::-webkit-details-marker { display: none; }
.teacher-slot.booked .slot-summary { font-weight: 700; }
.telegram-settings { margin: 24px 0 34px; padding: 24px 28px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); align-items: end; gap: 24px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); }
.telegram-settings.ready { border-color: #b9d8cc; background: #edf6f2; }
.telegram-settings.warning { border-color: #efc4b8; background: #fff3ef; }
.telegram-settings h2 { margin: 3px 0 6px; }
.telegram-settings p { margin: 0; color: var(--muted); }
.telegram-settings-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.telegram-settings-form input { width: 100%; }
.student-profile-hero { margin-bottom: 0; }
.profile-tools, .assignment-workspace { align-items: start; }
.profile-summary { padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.profile-summary h2 { font-size: 30px; margin: 5px 0 8px; }.profile-summary p { color: var(--muted); margin: 8px 0; }
.assignment-list { display: flex; flex-direction: column; gap: 14px; }
.assignment-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.assignment-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }.assignment-head h3 { margin: 10px 0 4px; }.assignment-head p { margin: 0; color: var(--muted); font-size: 12px; }
.assignment-comment { max-width: 100%; margin: 15px 0 0; overflow-wrap: anywhere; word-break: break-word; white-space: pre-wrap; }.assignment-comment.answer { padding: 12px; border-radius: 10px; background: var(--green-soft); }
.assignment-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }.assignment-files:empty { display: none; }.assignment-files a { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--green); font-size: 12px; font-weight: 700; text-decoration: none; background: #fff; }.response-files a { color: #8b3e2c; }
.assignment-response { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }.assignment-response summary { cursor: pointer; color: var(--green); font-weight: 800; }.assignment-response[open] summary { margin-bottom: 14px; }.compact-upload { gap: 12px; }.compact-upload .dropzone { padding: 18px; }.profile-calendar-section .calendar-shell { margin-top: 16px; }
.teacher-feedback { padding: 12px; border-radius: 10px; color: #68491a; background: #fff0c9; }
.assignments-cta { border-color: #cbd8e7; background: linear-gradient(120deg, #e7eef7, #f7f5ef); }
.assignments-hero { background: #e7eef7; border-color: #cbd8e7; }
.assignments-page-section { max-width: 920px; margin-inline: auto; }
.assignment-filter-bar { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.assignment-filter-bar label { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 700; }
.assignment-filter-bar input, .assignment-filter-bar select { width: 100%; }
.filter-empty { margin-top: 14px; }
.assignment-index-card .assignment-head { align-items: center; }
.file-picker { display: grid; gap: 10px; text-align: center; }
.file-picker > strong { font-size: 13px; }
.file-picker-list { display: grid; gap: 8px; }
.file-picker-item { display: grid; grid-template-columns: minmax(0, 1fr) 32px; align-items: center; gap: 8px; }
.file-picker-item input[type="file"] { min-width: 0; max-width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12px; }
.file-picker-item button { width: 32px; height: 32px; border: 1px solid #efb4a4; border-radius: 8px; color: #a33f2c; background: #fff3ef; cursor: pointer; font-size: 20px; line-height: 1; }
.file-picker-item button:hover { background: var(--coral-soft); }
.file-picker [data-file-picker-add] { justify-self: center; }
.lesson-notes-editor { display: grid; gap: 13px; padding: 18px; border: 1px solid #cbd8e7; border-radius: 14px; background: #f2f6fb; }
.lesson-notes-editor p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.assignment-notes { display: grid; gap: 8px; margin-top: 15px; padding: 13px; border: 1px solid #cbd8e7; border-radius: 11px; background: #f2f6fb; }
.assignment-notes > strong { color: #36536e; font-size: 13px; }
.assignment-notes > a { width: fit-content; color: var(--green); font-weight: 800; font-size: 13px; }
.materials-cta .button { flex: 0 0 auto; white-space: nowrap; }
.reports-cta, .reports-hero { border-color: #d7c5ea; background: linear-gradient(120deg, #f0eafb, #f7f5ef); }
.assignment-calendar-section { max-width: 1240px; margin-inline: auto; }
.assignment-calendar-shell, .reports-calendar-shell { max-width: 1240px; margin-inline: auto; }
.assignment-calendar-grid .calendar-day { min-height: 150px; }
.assignment-calendar-item { min-width: 0; display: grid; gap: 3px; padding: 7px 8px; border: 1px solid #cbd8e7; border-radius: 9px; color: var(--ink); text-decoration: none; background: #f2f6fb; font-size: 11px; }
.assignment-calendar-item span { color: #446b8e; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }.assignment-calendar-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.assignment-calendar-item.submitted { color: #79522a; border-color: #ead39d; background: #fff0c9; }.assignment-calendar-item.submitted span { color: #79522a; }
.assignment-completed-count { color: var(--green); font-size: 10px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.assignment-legend i.new-task { background: #8eb3d7; }.assignment-legend i.sent-task { background: #e2b85d; }.assignment-legend i.done-task { background: #7db69d; }
.selected-assignment-section { max-width: 920px; margin-inline: auto; }.assignment-detail-card { box-shadow: var(--shadow); }
.completed-assignments { max-width: 920px; margin-inline: auto; }.completed-assignments details { padding: 18px 20px; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }.completed-assignments summary { cursor: pointer; color: var(--green); font-weight: 800; }.completed-assignments summary span { display: inline-grid; min-width: 24px; height: 24px; place-items: center; margin-left: 6px; border-radius: 999px; color: white; background: var(--green); font-size: 12px; }.completed-assignment-list { display: grid; gap: 8px; margin-top: 16px; }.completed-assignment-list a { display: flex; justify-content: space-between; gap: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; background: #fbfaf6; }.completed-assignment-list a:hover { background: var(--green-soft); }.completed-assignment-list span { color: var(--muted); font-size: 12px; }
.assignment-complete-form { margin: 0; }.assignment-complete-form .check-action { white-space: nowrap; }
.report-workspace { align-items: start; }.report-day { min-height: 130px; }.report-day-item { padding: 7px 8px; border: 1px solid #d7c5ea; border-radius: 9px; background: #f7f2fc; font-size: 11px; }.report-day-item summary { cursor: pointer; color: #60427b; font-weight: 800; }.report-day-item[open] summary { margin-bottom: 7px; }.report-day-item p { margin: 0 0 8px; overflow-wrap: anywhere; white-space: pre-wrap; }
@media (max-width: 1100px) { .profile-name, .role { display: none; } }
@media (max-width: 900px) { .schedule-grid { grid-template-columns: 1fr 1fr; }.two-column, .login-page, .notice-panel, .credential-card { grid-template-columns: 1fr; }.login-art { display: none; }.profile-name, .role { display: none; }.hero { align-items: flex-start; gap: 32px; flex-direction: column; }.stats-row { width: 100%; flex-wrap: wrap; }.teacher-columns { grid-template-columns: 1fr; }.materials-builder { grid-template-columns: 1fr; }.materials-sidebar { position: static; }.material-cards { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .page { width: min(100% - 28px, 1240px); padding-top: 28px; }.topbar { padding: 0 14px; }.portal-nav a:first-child { display: none; }.portal-nav a { padding-inline: 7px; }.account-tools { gap: 6px; }.schedule-grid { grid-template-columns: 1fr; }.hero { padding: 28px; border-radius: 20px; }.hero h1 { font-size: 42px; }.stats-row { flex-direction: column; }.section { margin-top: 40px; }.file-row, .payment-card, .notification-row { align-items: flex-start; flex-wrap: wrap; }.file-meta { flex-basis: calc(100% - 60px); }.credential-copy { grid-template-columns: 1fr; }.credential-copy label { grid-column: auto; }.student-row { flex-wrap: wrap; }.materials-cta, .subpage-hero { align-items: flex-start; flex-direction: column; }.subpage-hero { padding: 28px; }.materials-canvas { padding: 20px; }.form-grid { grid-template-columns: 1fr; }.toast { left: 14px; right: 14px; bottom: 14px; } }

@media (max-width: 900px) {
  .dashboard-shortcuts { grid-template-columns: 1fr; }
  .student-management-actions { grid-template-columns: 1fr; }
  .student-account-actions { justify-content: flex-start; }
  .student-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-create-form > .button { justify-self: start; }
  .slot-builder { grid-template-columns: 1fr; }
  .slot-builder-form { grid-template-columns: repeat(3, 1fr); }
  .slot-builder-form .button { grid-column: 1 / -1; }
  .telegram-settings { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .topbar { height: auto; min-height: 76px; padding: 10px 14px; flex-wrap: wrap; gap: 8px; }
  .brand { min-height: 40px; }
  .account-tools { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .portal-nav { min-width: 0; display: flex; gap: 4px; overflow-x: auto; }
  .portal-nav a, .portal-nav a:first-child { display: block; flex: 0 0 auto; padding: 8px 7px; background: rgba(255,255,255,.58); text-align: center; font-size: 11px; white-space: nowrap; }
  .profile { gap: 0; }.moscow-clock { font-size: 11px; }
  .subsection-grid { grid-template-columns: 1fr; }
  .rename-section-form { grid-template-columns: 1fr; }
  .tree-actions { opacity: 1; }
  .calendar-shell { padding: 15px; }
  .calendar-toolbar { grid-template-columns: 38px 1fr 38px; gap: 8px; }
  .calendar-toolbar h2 { font-size: 28px; }
  .month-arrow { width: 36px; height: 36px; }
  .calendar-weekdays { display: none; }
  .calendar-grid { grid-template-columns: 1fr; gap: 8px; border: 0; }
  .calendar-day { min-height: 0; padding: 12px; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; border: 1px solid var(--line); border-radius: 12px; }
  .calendar-day.outside { display: none; }
  .calendar-date { margin: 0; align-items: flex-start; justify-content: flex-start; flex-direction: column; }
  .calendar-date span { display: block; }
  .slot-builder { padding: 22px; }
  .slot-builder-form { grid-template-columns: 1fr 1fr; }
  .slot-builder-form label:first-of-type, .slot-builder-form .button { grid-column: 1 / -1; }
  .telegram-link-form { width: 100%; grid-template-columns: minmax(0, 1fr) auto; }
  .telegram-settings { padding: 20px; }
  .telegram-settings-form { grid-template-columns: 1fr; }
  .notification-tab { top: auto; bottom: 18px; padding: 10px; border-right: 1px solid var(--line); border-radius: 999px; right: 14px; }
  .notification-tab-label { display: none; }
  .notification-drawer { width: min(100%, 420px); padding: 18px; }
  .assignment-filter-bar { grid-template-columns: 1fr; }
  .assignment-calendar-grid .calendar-day, .report-day { min-height: 0; }
  .completed-assignment-list a { align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (max-width: 600px) {
  .student-create-form { grid-template-columns: 1fr; }
  .student-management-card { padding: 18px; }
  .student-management-head { grid-template-columns: 1fr; }
  .student-management-head > .button { justify-self: start; }
  .student-management-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .student-management-meta > div:last-child { grid-column: 1 / -1; }
  .student-telegram-form { grid-template-columns: minmax(0, 1fr) auto; }
}
