@import url("/static/styles.css");

/* Public pages share the ntl38.beer visual language. */
html { color-scheme: light; }
body { min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

/* Multipage header, adapted to the original header. */
.topbar { position: static; display: block; min-height: 0; border: 0; background: transparent; backdrop-filter: none; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 92px; border-bottom: 1px solid var(--line); gap: 32px; }
.topbar .brand { display: flex; align-items: center; min-width: 235px; gap: 10px; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); color: var(--accent-dark); background: var(--paper-deep); font: 700 13px var(--serif); }
.topbar .brand > span:last-child { font: 600 17px var(--serif); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { position: relative; padding: 12px 0; color: var(--muted); font-size: 14px; }
.nav a::after { position: absolute; right: 0; bottom: 1px; left: 0; height: 2px; content: ""; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 180ms ease; }
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.admin-link { color: var(--accent-dark); font-size: 12px; }

/* Home. */
.hero { display: grid; grid-template-columns: 1.25fr .75fr; align-items: end; min-height: 455px; padding: 72px 4vw 68px; border-bottom: 1px solid var(--line); gap: 7vw; }
.hero-main { padding: 0; border: 0; background: transparent; box-shadow: none; }
.hero-main h1 { margin-bottom: 23px; font: 400 clamp(52px, 7vw, 84px)/.95 var(--serif); letter-spacing: -.055em; }
.hero p.lead { max-width: 540px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 30px; }
.btn { display: inline-flex; min-height: 0; align-items: center; justify-content: center; padding: 11px 14px; border: 1px solid var(--line); border-radius: 0; color: var(--ink); background: rgba(255,253,248,.45); font-size: 12px; transition: transform 180ms ease, background 180ms ease; }
.btn:hover { transform: translateY(-1px); background: var(--white); }
.btn.primary { border-color: var(--ink); color: var(--white); background: var(--ink); }
.btn.danger { border-color: rgba(159,52,39,.35); color: var(--accent-dark); background: rgba(214,91,61,.05); }
.btn.ghost { background: transparent; }
.hero-side { display: grid; align-self: center; border: 1px solid var(--line); background: var(--paper-deep); box-shadow: var(--shadow); }
.metric { display: grid; grid-template-columns: 1fr auto; align-items: baseline; padding: 17px 22px; border-bottom: 1px solid var(--line); gap: 10px; }
.metric:last-child { border-bottom: 0; }
.metric strong { grid-row: 1 / span 2; grid-column: 2; margin: 0; color: var(--ink); font: 32px var(--serif); letter-spacing: -.04em; }
.metric .muted:first-child { color: var(--accent-dark); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.metric .muted:last-child { font-size: 11px; }

.section { padding: 38px 0 44px; border-bottom: 1px solid var(--line); }
.section:last-of-type { padding-bottom: 82px; border-bottom: 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; gap: 22px; }
.section-head h2 { margin: 0; font: 400 clamp(28px,3vw,40px)/1 var(--serif); letter-spacing: -.04em; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.card { overflow: hidden; border: 1px solid var(--line); border-radius: 0; background: rgba(255,253,248,.42); }
.card-pad { padding: 24px; }
.empty { padding: 24px; color: var(--muted); font: italic 18px/1.35 var(--serif); }
.row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; padding: 15px 19px; border-bottom: 1px dashed var(--line); gap: 18px; }
.row:last-child { border-bottom: 0; }
.row strong { display: block; font: 18px var(--serif); }
.row small, .muted { display: block; color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; padding: 4px 8px; border: 0; border-radius: 999px; color: var(--accent-dark); background: rgba(214,91,61,.08); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.lesson-row { display: grid; grid-template-columns: 112px minmax(0,1fr) auto; align-items: center; padding: 14px 18px; border-bottom: 1px dashed var(--line); gap: 18px; }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row strong { display: block; font: 18px var(--serif); }
.lesson-time { color: var(--accent-dark); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,320px),1fr)); gap: 1px; padding: 1px; background: var(--line); }
.news-card { min-height: 190px; padding: 24px; border: 0; border-radius: 0; background: var(--white); }
.news-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.news-meta time { color: var(--muted); font-size: 12px; }
.news-card h3 { margin: 19px 0 9px; font: 25px/1.05 var(--serif); letter-spacing: -.03em; }
.news-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-line; }

/* Diary. */
.page-head { padding: 70px 0 28px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0; font: 400 clamp(44px,6vw,76px)/.95 var(--serif); letter-spacing: -.055em; }
.page-head .lead { max-width: 520px; margin: 17px 0 0; line-height: 1.6; }
.week-nav { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; border-bottom: 1px solid var(--line); gap: 14px; }
.week-nav-group { display: flex; flex-wrap: wrap; gap: 8px; }
.week-picker { display: inline-flex; align-items: center; gap: 7px; padding: 0 4px; color: var(--muted); font-size: 11px; }
.week-picker input { min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 0; color: var(--ink); background: var(--paper); }
#week-label { color: var(--muted); font-size: 12px; }
.diary { display: grid; padding: 26px 0 80px; gap: 14px; }
.day { overflow: hidden; border: 1px solid var(--line); border-radius: 0; background: rgba(255,253,248,.35); }
.day.today { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.day-head { display: flex; align-items: baseline; justify-content: space-between; padding: 17px 21px; border-bottom: 1px solid var(--line); gap: 18px; }
.day-head h2 { margin: 0; font: 26px var(--serif); letter-spacing: -.03em; }
.day-head strong { color: var(--accent-dark); font-size: 11px; text-transform: uppercase; }
.day-grid { display: grid; grid-template-columns: 1.08fr .92fr; }
.day-column { padding: 18px 20px; }
.day-column + .day-column { border-left: 1px solid var(--line); }
.day-column h3 { margin: 0 0 10px; color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.day-column .lesson-row { margin: 0 -20px; }
.hw { padding: 13px 0; border-bottom: 1px dashed var(--line); }
.hw:last-child { border-bottom: 0; }
.hw strong { display: block; font: 18px var(--serif); }
.hw p { margin: 5px 0 8px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.event { margin: 8px 0 13px; padding: 12px 13px; border-left: 3px solid var(--accent); background: rgba(214,91,61,.07); }
.event strong { font: 18px var(--serif); }

/* Materials. */
.materials { display: grid; grid-template-columns: 1fr 1fr; padding: 28px 0 80px; gap: 10px 18px; }
.material { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 17px 19px; border: 1px solid var(--line); border-radius: 0; background: rgba(255,253,248,.42); gap: 16px; }
.materials-group { padding-top: 28px; }
.materials-group + .materials-group { margin-top: 12px; }
.materials-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.materials-group-head h2 { margin: 0; font: 400 30px/1.1 var(--serif); letter-spacing: -.035em; }
.materials-group-head span { color: var(--muted); font-size: 12px; }
.materials-group .materials { grid-template-columns: 1fr; max-width: 760px; }
.news-grid { grid-template-columns: 1fr; gap: 12px; padding: 0; background: transparent; }
.news-card { min-height: 0; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,253,248,.55); }
.material strong { font: 20px var(--serif); }
.material span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.material a { color: var(--accent-dark); font-size: 12px; }
.library-tools { display: flex; align-items: center; gap: 14px; padding: 24px 0 0; }
.library-tools label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.library-tools input { width: min(420px, 100%); min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 0; color: var(--ink); background: var(--white); outline: none; }
.library-tools input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(214,91,61,.08); }
.note-sheet[hidden] { display: none; }

.footer { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 25px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.footer .shell { width: 100%; }

/* Admin keeps the same paper/editorial design, but is denser. */
.admin-body { background: var(--paper); }
.admin-shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 38px 0 60px; }
.login-card { width: min(430px, calc(100% - 28px)); margin: 12vh auto; padding: 30px; border: 1px solid var(--line); border-radius: 0; background: var(--white); box-shadow: var(--shadow); }
.login-card h1, .admin-top h1 { margin: 0; font: 400 44px/.95 var(--serif); letter-spacing: -.045em; }
.form { display: grid; margin-top: 22px; gap: 13px; }
.field { display: grid; gap: 6px; }
.field label, .field > span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.field input, .field textarea, .field select { width: 100%; min-height: 42px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 0; outline: none; color: var(--ink); background: var(--white); }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(214,91,61,.08); }
.field textarea { min-height: 118px; resize: vertical; }
.admin-top { display: flex; align-items: end; justify-content: space-between; padding-bottom: 24px; border-bottom: 1px solid var(--line); gap: 18px; }
.tabs { display: flex; flex-wrap: wrap; padding: 18px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.tab { padding: 8px 12px; border: 1px solid var(--line); border-radius: 0; color: var(--muted); background: transparent; }
.tab.active { border-color: var(--accent); color: var(--white); background: var(--accent); }
.admin-grid { display: grid; grid-template-columns: 1.05fr .95fr; padding-top: 18px; gap: 18px; }
.admin-list .row { grid-template-columns: minmax(0,1fr) auto; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.editor { position: sticky; top: 18px; align-self: start; padding: 24px; border: 1px solid var(--line); border-radius: 0; background: rgba(255,253,248,.62); }
.editor h2 { margin: 0 0 4px; font: 27px var(--serif); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.notice, .error { margin: 10px 0; padding: 11px 12px; border-left: 3px solid #8c6b2f; background: #f3e9d7; color: #735b2d; }
.error { border-color: var(--accent-dark); background: rgba(214,91,61,.08); color: #7f3024; }
.schedule-editor { display: grid; gap: 8px; }
.schedule-edit-row { display: grid; grid-template-columns: 52px 74px 74px 1fr 86px; align-items: center; gap: 8px; }
.schedule-edit-row input { min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 0; background: var(--white); }
.hidden { display: none !important; }

.admin-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: -1px; }
.admin-stat { padding: 22px; border: 1px solid var(--line); background: rgba(255,253,248,.52); }
.admin-stat strong { display: block; margin-top: 8px; font: 32px var(--serif); }
.admin-stat span { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 800px) {
  .shell, .footer { width: min(100% - 28px, 600px); }
  .topbar-inner { flex-wrap: wrap; min-height: auto; padding: 18px 0 14px; gap: 18px; }
  .topbar .brand { min-width: 0; }
  .admin-link { margin-left: auto; }
  .nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; gap: 22px; scrollbar-width: thin; }
  .nav a { white-space: nowrap; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 68px 10px 54px; gap: 36px; }
  .hero-side { width: min(380px,100%); justify-self: end; }
  .news-grid, .materials, .day-grid, .admin-grid { grid-template-columns: 1fr; }
  .day-column + .day-column { border-top: 1px solid var(--line); border-left: 0; }
  .section-head { align-items: start; flex-direction: column; }
  .admin-top { align-items: flex-start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
}

/* Экспериментальный слой: лёгкая редакционная композиция. */
body:not(.admin-body) { overflow-x: hidden; }
body:not(.admin-body)::after {
  position: fixed;
  top: 18vh;
  right: -180px;
  z-index: -1;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(182,66,46,.12);
  border-radius: 50%;
  content: "";
  pointer-events: none;
  box-shadow: -110px 80px 0 -80px rgba(48,75,117,.14), -200px 180px 0 -150px rgba(182,66,46,.12);
}
body:not(.admin-body) .hero-main { position: relative; }
body:not(.admin-body) .hero-main::before {
  position: absolute;
  top: -24px;
  left: -22px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 18px 0 0 rgba(182,66,46,.3), 36px 0 0 rgba(182,66,46,.12);
  content: "";
}
body:not(.admin-body) .hero-side { transform: rotate(1deg); transition: transform 260ms ease, box-shadow 260ms ease; }
body:not(.admin-body) .hero-side:hover { transform: rotate(0) translateY(-4px); box-shadow: 0 18px 36px rgba(55,44,32,.12); }
body:not(.admin-body) .news-card, body:not(.admin-body) .material { position: relative; overflow: hidden; transition: transform 220ms ease, border-color 220ms ease, background 220ms ease; }
body:not(.admin-body) .news-card::before, body:not(.admin-body) .material::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  content: "";
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 220ms ease;
}
body:not(.admin-body) .news-card:hover, body:not(.admin-body) .material:hover { transform: translateX(4px); border-color: rgba(182,66,46,.4); background: rgba(255,253,250,.9); }
body:not(.admin-body) .news-card:hover::before, body:not(.admin-body) .material:hover::before { transform: scaleY(1); }
body:not(.admin-body) .materials-group-head h2::before { display: inline-block; width: 24px; height: 2px; margin: 0 10px 8px 0; background: var(--accent); content: ""; }
.material-filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0 2px; }
.material-filters button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: transparent; cursor: pointer; }
.material-filters button.is-active { border-color: var(--accent); color: #fff; background: var(--accent); }
body:not(.admin-body)::after, body:not(.admin-body) .hero-main::before { display: none; }
body:not(.admin-body) .hero-side, body:not(.admin-body) .news-card, body:not(.admin-body) .material { transform: none; transition: none; }
body:not(.admin-body) .news-card::before, body:not(.admin-body) .material::before { display: none; }
body:not(.admin-body) .hero-main, body:not(.admin-body) .hero-side, body:not(.admin-body) .section,
body:not(.admin-body) .page-head, body:not(.admin-body) .diary, body:not(.admin-body) .materials-layout,
body:not(.admin-body) .notes-page, body:not(.admin-body) .status-dot { animation: none; }
@media (prefers-reduced-motion: reduce) {
  body:not(.admin-body) .hero-side, body:not(.admin-body) .news-card, body:not(.admin-body) .material { transform: none; transition: none; }
}

@media (max-width: 520px) {
  .shell, .footer { width: calc(100% - 20px); }
  .brand-mark { display: none; }
  .topbar .brand > span:last-child { font-size: 16px; }
  .hero { padding-right: 2px; padding-left: 2px; }
  .hero-main h1 { font-size: clamp(54px,18vw,82px); }
  .hero-side { justify-self: stretch; }
  .section { padding: 30px 0 36px; }
  .week-nav { align-items: flex-start; flex-direction: column; }
  .week-picker { width: 100%; justify-content: space-between; }
  .week-picker input { flex: 0 1 170px; }
  .lesson-row { grid-template-columns: 90px minmax(0,1fr); }
  .lesson-row .badge { grid-column: 2; justify-self: start; }
  .material { grid-template-columns: 1fr; }
  .material a { justify-self: start; }
  .library-tools { align-items: flex-start; flex-direction: column; gap: 8px; }
  .library-tools input { width: 100%; }
  .admin-stats { grid-template-columns: 1fr; }
  .schedule-edit-row { grid-template-columns: 42px 64px 64px 1fr; }
  .schedule-edit-row input:last-child { grid-column: 4; }
}

/* Admin panel refresh: same controls and API, clearer workspace. */
.admin-body { min-height: 100vh; padding: 34px 20px; }
.login-card, .admin-shell { width: min(1120px, 100%); margin: 0 auto; }
.login-card { max-width: 520px; margin-top: 8vh; padding: clamp(26px, 5vw, 52px); border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 253, 248, .78); box-shadow: var(--shadow); }
.admin-mark { display: inline-grid; width: 52px; height: 52px; place-items: center; margin-bottom: 28px; border-radius: 12px; color: #fff; background: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.login-card h1, .admin-top h1 { margin-bottom: 10px; font-size: clamp(36px, 6vw, 58px); }
.admin-lead { max-width: 540px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.login-card .form { margin-top: 28px; }
.login-card .btn.primary { width: 100%; }
.admin-top { display: flex; align-items: end; justify-content: space-between; padding: 20px 0 30px; border-bottom: 1px solid var(--line); gap: 24px; }
.admin-top .admin-lead { margin-bottom: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 7px; padding: 20px 0; }
.tab { padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: rgba(255,253,248,.5); cursor: pointer; transition: background 180ms ease, color 180ms ease, transform 180ms ease; }
.tab:hover { transform: translateY(-1px); color: var(--ink); background: var(--white); }
.tab.active { border-color: var(--ink); color: var(--white); background: var(--ink); }
#overview-panel, #work-panel { animation: ntl-fade-up 260ms ease both; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.admin-stat { padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,253,248,.55); }
.admin-stat strong { display: block; margin-top: 10px; font: 32px var(--serif); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); align-items: start; gap: 16px; }
.admin-list, .editor { min-width: 0; }
.editor { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,253,248,.55); }
.editor h2 { margin-top: 0; font: 28px var(--serif); }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.error { margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(159,52,39,.3); border-radius: 7px; color: var(--accent-dark); background: rgba(214,91,61,.07); font-size: 13px; }
@media (max-width: 760px) {
  .admin-body { padding: 18px 12px; }
  .admin-top { align-items: flex-start; flex-direction: column; }
  .admin-top .actions { width: 100%; }
  .admin-top .actions .btn { flex: 1; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .tab, #overview-panel, #work-panel { animation: none; transition: none; } }

/* Единый стиль публичных страниц. */
body:not(.admin-body) .topbar-inner,
body:not(.admin-body) .shell,
body:not(.admin-body) .site-shell,
body:not(.admin-body) .notes-shell { max-width: 1180px; }
body:not(.admin-body) .topbar-inner { min-height: 86px; }
body:not(.admin-body) .page-head,
body:not(.admin-body) .section-heading { padding-top: 64px; }
body:not(.admin-body) .page-head h1,
body:not(.admin-body) .section-heading h1 { font-size: clamp(48px, 7vw, 78px); }
body:not(.admin-body) .card,
body:not(.admin-body) .day,
body:not(.admin-body) .news-card,
body:not(.admin-body) .material,
body:not(.admin-body) .note-sheet,
body:not(.admin-body) .source-card { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,253,248,.52); box-shadow: none; }
body:not(.admin-body) .news-card,
body:not(.admin-body) .material { padding: 22px 24px; }
body:not(.admin-body) .section-head h2,
body:not(.admin-body) .materials-group-head h2 { font-size: clamp(28px, 4vw, 40px); }
body:not(.admin-body) .footer { margin-top: 48px; }

/* Полная единая визуальная система публичной части сайта. */
body:not(.admin-body) {
  --paper: #f7f3eb;
  --paper-deep: #eee8dc;
  --ink: #20201e;
  --muted: #716d66;
  --line: #d6d1c8;
  --accent: #b6422e;
  --accent-dark: #943323;
  --white: #fffdfa;
  background: var(--paper);
  color: var(--ink);
}
body:not(.admin-body)::before { opacity: .08; }
body:not(.admin-body) .topbar { background: rgba(244,241,235,.92); }
body:not(.admin-body) .topbar-inner { width: min(1180px, calc(100% - 48px)); margin: auto; border-bottom: 1px solid var(--line); }
body:not(.admin-body) .brand-copy strong { font-size: 18px; }
body:not(.admin-body) .brand-copy small { font-size: 11px; }
body:not(.admin-body) .nav { gap: 8px; }
body:not(.admin-body) .nav a { padding: 10px 13px; border-radius: 6px; }
body:not(.admin-body) .nav a.active { background: rgba(182,66,46,.08); }
body:not(.admin-body) .hero { min-height: 430px; padding: 76px 0 70px; border-bottom: 1px solid var(--line); }
body:not(.admin-body) .hero-main h1 { max-width: 760px; font-size: clamp(54px, 8vw, 92px); }
body:not(.admin-body) .hero-side { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,253,250,.62); box-shadow: none; }
body:not(.admin-body) .section { padding: 48px 0; border-bottom: 1px solid var(--line); }
body:not(.admin-body) .section-head { margin-bottom: 22px; }
body:not(.admin-body) .section-head h2,
body:not(.admin-body) .page-head h1,
body:not(.admin-body) .section-heading h1,
body:not(.admin-body) .materials-group-head h2 { font-weight: 400; }
body:not(.admin-body) .news-grid,
body:not(.admin-body) .materials-group .materials { display: grid; grid-template-columns: 1fr; max-width: 900px; gap: 12px; }
body:not(.admin-body) .news-card,
body:not(.admin-body) .material { display: grid; grid-template-columns: 1fr auto; min-height: 0; padding: 24px 26px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,253,250,.64); }
body:not(.admin-body) .news-card { display: block; padding: 25px 28px 27px; border-left: 4px solid transparent; background: rgba(255,253,250,.72); }
body:not(.admin-body) .news-card:hover { border-left-color: var(--accent); background: rgba(255,253,250,.9); }
body:not(.admin-body) .news-card h3 { max-width: 720px; margin: 18px 0 10px; font-size: clamp(24px, 3vw, 32px); line-height: 1.08; }
body:not(.admin-body) .news-card p { max-width: 760px; font-size: 14px; line-height: 1.7; }
body:not(.admin-body) .news-meta { align-items: center; }
body:not(.admin-body) .news-meta time { color: var(--accent-dark); font-weight: 650; }
body:not(.admin-body) .page-head { padding: 76px 0 30px; }
body:not(.admin-body) .library-tools { padding: 24px 0 8px; }
body:not(.admin-body) .library-tools input { width: min(680px, 100%); border-radius: 6px; }
body:not(.admin-body) .materials-group { padding-top: 34px; }
body:not(.admin-body) .materials-group-head { max-width: 900px; }
body:not(.admin-body) .day { border-radius: 7px; background: rgba(255,253,250,.55); }
body:not(.admin-body) .day-head { padding: 21px 24px; }
body:not(.admin-body) .lesson-row, body:not(.admin-body) .hw { padding-top: 16px; padding-bottom: 16px; }
body:not(.admin-body) .notes-shell .note-sheet { border: 1px solid var(--line); border-radius: 7px; background: rgba(255,253,250,.55); }
body:not(.admin-body) .footer { padding-top: 30px; border-top: 1px solid var(--line); }
@media (max-width: 800px) {
  body:not(.admin-body) .topbar-inner { width: calc(100% - 28px); }
  body:not(.admin-body) .hero { padding: 56px 0; }
  body:not(.admin-body) .hero-main h1 { font-size: clamp(48px, 14vw, 76px); }
  body:not(.admin-body) .news-card, body:not(.admin-body) .material { grid-template-columns: 1fr; gap: 14px; }
  body:not(.admin-body) .news-card a, body:not(.admin-body) .material a { justify-self: start; }
}

/* Небольшое обновление без смены исходной стилистики. */
.topbar-inner { min-height: 84px; }
.btn, .week-nav-group button, .week-picker input { border-radius: 7px; }
.card, .day, .notes-subjects details, .source-card, .note-sheet { border-radius: 8px; }
.btn:hover, .source-card:hover { box-shadow: 0 8px 22px rgba(55, 44, 32, .10); }
.row:hover, .lesson-row:hover, .material-item:hover { background: rgba(214, 91, 61, .045); }
@media (max-width: 800px) { .topbar-inner { gap: 18px; } .day-grid { grid-template-columns: 1fr; } }

@keyframes ntl-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes ntl-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 91, 61, .16); }
  50% { box-shadow: 0 0 0 5px rgba(214, 91, 61, 0); }
}
.hero-main, .hero-side, .section, .page-head, .diary, .materials-layout, .notes-page { animation: ntl-fade-up 420ms ease both; }
.section:nth-of-type(2) { animation-delay: 60ms; }
.section:nth-of-type(3) { animation-delay: 120ms; }
.card, .day, .material-item, .note-sheet, .source-card, .news-card { transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease; }
.card:hover, .day:hover, .note-sheet:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(55, 44, 32, .10); }
.status-dot { animation: ntl-pulse 2.4s ease-in-out infinite; }
.btn:active, .week-nav-group button:active { transform: translateY(1px) scale(.98); }
@media (prefers-reduced-motion: reduce) {
  .hero-main, .hero-side, .section, .page-head, .diary, .materials-layout, .notes-page,
  .status-dot { animation: none; }
  .card, .day, .material-item, .note-sheet, .source-card, .news-card { transition: none; }
}

/* Notes use the same shell as the new pages, not the legacy standalone layout. */
.notes-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.notes-shell .topbar { width: auto; }
.notes-shell .topbar-inner { width: 100%; }
.notes-shell .notes-page { padding: 70px 0 80px; }
.notes-shell .section-heading { display: flex; align-items: end; justify-content: space-between; padding-bottom: 28px; border-bottom: 1px solid var(--line); gap: 24px; }
.notes-shell .section-heading h1 { margin: 0; font: 400 clamp(48px, 7vw, 82px)/.95 var(--serif); letter-spacing: -.055em; }
.notes-shell .notes-toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; }
.notes-shell .notes-toc a { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--accent-dark); background: rgba(255,253,248,.5); font-size: 12px; }
.notes-weeks { display: flex; flex-wrap: wrap; gap: 24px; margin: 22px 0 0; }
.notes-weeks button { padding: 8px 0; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font: inherit; font-size: 13px; cursor: pointer; }
.notes-weeks button:hover, .notes-weeks button.is-active { border-bottom-color: var(--accent); color: var(--ink); }
.notes-shell .notes-list { display: grid; gap: 14px; padding-top: 28px; }
.notes-shell .note-sheet { padding: 30px clamp(22px, 4vw, 48px); border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.notes-shell .note-sheet .eyebrow { color: var(--accent-dark); }
.notes-shell .note-sheet h2 { margin: 0 0 22px; font: 400 clamp(30px, 4vw, 48px)/1.03 var(--serif); letter-spacing: -.045em; }
.notes-shell .note-sheet h3 { margin: 26px 0 9px; font: 400 23px/1.2 var(--serif); }
.notes-shell .note-sheet p, .notes-shell .note-sheet li, .notes-shell .note-sheet dd { color: var(--muted); font-size: 14px; line-height: 1.7; }
.notes-shell .source-pages { padding-top: 64px; }
.notes-shell .source-pages .section-heading h2 { margin: 0; font: 400 clamp(32px, 5vw, 54px)/1 var(--serif); letter-spacing: -.045em; }
.notes-shell .footer { width: 100%; }
.footer-links { display: inline-flex; flex-wrap: wrap; gap: 18px; margin-left: 20px; }
.footer-links a { color: var(--accent-dark); }
.footer > .shell { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

@media (max-width: 800px) {
  .notes-shell { width: min(100% - 28px, 600px); }
  .notes-shell .section-heading { display: block; }
  .notes-shell .notes-page { padding-top: 48px; }
}

@media (max-width: 520px) {
  .notes-shell { width: calc(100% - 20px); }
  .notes-shell .note-sheet { padding: 24px 18px; }
  .footer-links { margin-left: 0; }
  .footer > .shell { align-items: flex-start; flex-direction: column; gap: 10px; }
}
