/* One physical page, shared by every rendering surface. */
.sheet.paper-sheet {
  --row-gap: 6px; --cell-py: 7px; --section-gap: 12px;
  --lesson-size: 16px; --note-size: 12px; --day-size: 13px;
  width: var(--paper-w); min-height: var(--paper-h); height: var(--paper-h);
  max-height: none; padding: 6mm; gap: var(--section-gap); justify-content: flex-start;
  border-radius: 3px; --s-pad-x: 6mm; font-synthesis: none;
  font-family: var(--s-font); font-weight: 400; letter-spacing: normal;
}
.sheet.paper-sheet.fmt-a5 { --lesson-size: 14.67px; --note-size: 11px; --day-size: 12px; --cell-py: 4px; --row-gap: 4px; --section-gap: 8px; padding: 5mm; --s-pad-x: 5mm; }
.sheet.paper-sheet.fmt-a4 { --lesson-size: 16px; }
.sheet.paper-sheet[data-density="compact"] { --cell-py: 3px; --row-gap: 3px; --section-gap: 6px; }
.sheet.paper-sheet[data-density="tight"] { --cell-py: 2px; --row-gap: 2px; --section-gap: 5px; }
.sheet.paper-sheet .s-head { flex: 0 0 auto; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 14px; padding-bottom: 9px; border-bottom: 1px solid var(--s-line); }
.sheet.paper-sheet .s-title { font-size: 25px; font-weight: 600; line-height: 1.2; white-space: normal; overflow: visible; overflow-wrap: anywhere; letter-spacing: -.025em; background: none; color: var(--s-ink); -webkit-text-fill-color: currentColor; text-shadow: none; }
.sheet.paper-sheet .s-tagrow { grid-column: 2; grid-row: 1; justify-content: flex-end; max-width: 260px; flex-wrap: wrap; }
.sheet.paper-sheet .s-tag { font: 500 10px/1.3 Manrope, sans-serif; letter-spacing: .1em; color: var(--s-label-ink, var(--s-acc)); overflow-wrap: anywhere; }
.sheet.paper-sheet .s-sub { grid-column: 1 / -1; text-align: left; white-space: normal; overflow: visible; overflow-wrap: anywhere; font: 400 11px/1.35 Manrope, sans-serif; color: var(--s-mut); }
.sheet.paper-sheet .s-sub:empty { display: none; }
.sheet.paper-sheet .s-badge { font: 500 10px/1.3 Manrope, sans-serif; letter-spacing: 0; text-transform: none; }
.sheet.paper-sheet .s-grid { flex: 1 0 auto; min-height: min-content; gap: var(--row-gap); --time-col: 64px; }
.sheet.paper-sheet .s-headrow, .sheet.paper-sheet .s-row { gap: var(--row-gap); }
.sheet.paper-sheet .s-headrow { flex: 0 0 auto; }
.sheet.paper-sheet .s-row { flex: 1 0 auto; min-height: min-content; }
.sheet.paper-sheet .s-row:has(.s-span) { flex: 0 0 auto; }
.sheet.paper-sheet .s-cell { padding: var(--cell-py) 6px; min-height: min-content; height: auto; border-width: 1px; border-radius: min(8px, var(--s-rad)); font-size: var(--lesson-size); font-weight: var(--body-weight, 400); line-height: 1.32; letter-spacing: normal; gap: 2px; backdrop-filter: none; }
.sheet.paper-sheet .s-subj { font-size: calc(var(--lesson-size) * var(--s-zoom, 1)); font-weight: var(--body-weight, 400); line-height: 1.32; letter-spacing: normal; text-shadow: none; overflow: visible; word-break: normal; overflow-wrap: anywhere; }
.sheet.paper-sheet .s-note { font-size: calc(var(--note-size) * var(--s-zoom, 1)); line-height: 1.3; font-weight: 400; letter-spacing: normal; color: inherit; opacity: .8; overflow: visible; overflow-wrap: anywhere; }
.sheet.paper-sheet .s-dayh { padding: 5px 3px; font-size: var(--day-size); font-weight: 600; line-height: 1.3; letter-spacing: .025em; text-shadow: none; overflow-wrap: anywhere; }
.sheet.paper-sheet .s-time { font: 400 13.33px/1.22 Manrope, sans-serif; letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; }
.sheet.paper-sheet .s-num { height: auto; }
.sheet.paper-sheet .s-span { font: 400 10px/1.25 Manrope, sans-serif; min-height: 15px; height: auto; padding: 1px 7px; letter-spacing: .02em; text-transform: none; overflow-wrap: anywhere; }
.sheet.paper-sheet .s-foot { flex: 0 0 auto; font: 400 9px/1.3 Manrope, sans-serif; padding-top: 2px; }
.sheet.paper-sheet .s-foot-logo { width: 30px; height: 10px; }
.sheet.paper-sheet .s-extra { flex: 0 0 auto; gap: 8px; grid-template-columns: 1fr 1fr; }
.sheet.paper-sheet .s-box { padding: 8px 10px; }
.sheet.paper-sheet .s-box h3 { font: 600 10px/1.3 Manrope, sans-serif; letter-spacing: .025em; text-align: left; color: var(--s-label-ink, var(--s-acc)); margin: 0 0 7px; }
.sheet.paper-sheet .s-rules, .sheet.paper-sheet .s-teachers { gap: 5px; grid-auto-rows: auto; align-content: start; }
.sheet.paper-sheet .s-rules li { grid-template-columns: 14px 1fr; align-items: start; gap: 5px; font: 400 11px/1.35 Manrope, sans-serif; overflow-wrap: anywhere; }
.sheet.paper-sheet .s-rules .n { background: none; color: var(--s-ink); font: 500 10px/1.5 Manrope, sans-serif; width: auto; height: auto; }
.sheet.paper-sheet .s-teach { grid-template-columns: 3px minmax(0, 1fr) auto; gap: 6px; }
.sheet.paper-sheet .s-teach strong { font: 500 11px/1.3 Manrope, sans-serif; overflow-wrap: anywhere; }
.sheet.paper-sheet .s-teach em { font: 400 10px/1.3 Manrope, sans-serif; overflow-wrap: anywhere; }
.sheet.paper-sheet .s-teach .bar { width: 3px; min-height: 0; }
.sheet.paper-sheet .s-teach .room { font: 400 10px/1.3 Manrope, sans-serif; padding: 2px 4px; white-space: normal; max-width: 75px; overflow-wrap: anywhere; color: var(--s-ink); }
.sheet.paper-sheet.fmt-a5 .s-title { font-size: 21px; }
.sheet.paper-sheet[data-density="tight"] .s-head { padding-bottom: 5px; }
.sheet.paper-sheet[data-density="tight"] .s-box { padding: 5px 7px; }
.sheet.paper-sheet[data-density="tight"] .s-rules, .sheet.paper-sheet[data-density="tight"] .s-teachers { gap: 3px; }
.sheet.paper-sheet.reading-clear, .sheet.paper-sheet.reading-large { --s-font: Manrope, sans-serif; --s-zoom: 1; }
.sheet.paper-sheet.reading-clear :is(.s-subj, .s-note, .s-dayh),
.sheet.paper-sheet.reading-large :is(.s-subj, .s-note, .s-dayh) { font-family: Manrope, sans-serif; }
.sheet.paper-sheet.reading-large { --lesson-size: 18px; --note-size: 12px; --day-size: 14px; }
.sheet.paper-sheet.font-caveat.reading-theme { --lesson-size: 21px; --note-size: 16px; --day-size: 17px; }
.sheet.paper-sheet.font-caveat.reading-theme.fmt-a5 { --lesson-size: 19px; --note-size: 15px; --day-size: 16px; }
.sheet.paper-sheet.th-y2k { --s-mut: #655172; --s-label-ink: #8e286e; }
.sheet.paper-sheet.th-y2k .s-dayh { color: #8e286e; }
.sheet.paper-sheet.th-kawaii { --s-mut: #795969; --s-acc: #a33f68; }
.sheet.paper-sheet.th-kawaii .s-dayh { color: #754354; }
.sheet.paper-sheet.th-notebook { --s-mut: #445c8d; }
.sheet.paper-sheet.th-academia { --s-mut: #665640; }
.sheet.paper-sheet.th-brutal { border-width: 1px; }
.sheet.paper-sheet.th-brutal .s-cell { box-shadow: 1px 1px 0 #0a0a0a; }
.sheet.paper-sheet.th-minecraft .s-cell { box-shadow: inset 1px 1px 0 #fff6; }
.sheet.paper-sheet.th-russia .s-cell { box-shadow: none; }
.sheet.paper-sheet.th-glass { --s-card: #f1ebff; --s-ink: #2c1b48; --s-mut: #5a456e; }
.sheet.paper-sheet.th-glass .s-head, .sheet.paper-sheet.th-glass .s-foot { --s-ink: #fff; --s-mut: #fff; }
.sheet.paper-sheet.th-glass .s-time { color: #fff; }
.sheet.paper-sheet.th-neon { --s-mut: #b8bdcf; }
.sheet.paper-sheet.th-vapor { --s-mut: #cec3e3; }
/* The paper treatment retains a theme's accent and subject colours. */
.sheet.paper-sheet.print-friendly {
  background: #fff !important; --s-bg: #fff; --s-bg-c: #fff; --s-card: #fff;
  --s-ink: #202735; --s-mut: #525d6d; --s-acc: var(--paper-accent);
  --s-label-ink: var(--paper-accent); --s-line: #dce1e8;
  border: 0; outline: 0; color: #202735;
}
.sheet.paper-sheet.print-friendly::before, .sheet.paper-sheet.print-friendly::after,
.sheet.paper-sheet.print-friendly .s-decor { display: none; }
.sheet.paper-sheet.print-friendly .s-head { --s-ink: #202735; --s-mut: #525d6d; border-color: #dce1e8; }
.sheet.paper-sheet.print-friendly .s-title { color: #202735; }
.sheet.paper-sheet.print-friendly .s-dayh { background: color-mix(in srgb, var(--paper-accent) 8%, white); color: var(--paper-accent); }
.sheet.paper-sheet.print-friendly .s-cell { background: color-mix(in srgb, var(--subject-color, #94a3b8) 11%, #fff); border: 1px solid #e1e5eb; box-shadow: none; }
.sheet.paper-sheet.print-friendly .s-cell.is-painted { background: color-mix(in srgb, var(--cell-fill) 14%, #fff); }
.sheet.paper-sheet.print-friendly .s-cell.cat-empty { background: #fafbfc; border-style: dashed; }
.sheet.paper-sheet.print-friendly :is(.s-time, .s-sub, .s-foot) { color: #525d6d; background: transparent; }
.sheet.paper-sheet.print-friendly .s-span { background: #f1f3f6; color: #475365; border-color: #e4e7ec; }
.sheet.paper-sheet.print-friendly .s-span.kind-meal { background: #fff5df; color: #785922; }
.sheet.paper-sheet.print-friendly .s-span.kind-walk { background: #eaf5ef; color: #2b6342; }
.sheet.paper-sheet.print-friendly .s-badge { background: var(--paper-accent); color: white; }
.cat-math { --subject-color: #22c55e; }.cat-rus { --subject-color: #3b82f6; }.cat-lit { --subject-color: #a855f7; }.cat-eng { --subject-color: #f59e0b; }.cat-pe { --subject-color: #ef4444; }.cat-sci { --subject-color: #14b8a6; }.cat-hist { --subject-color: #d97706; }.cat-art { --subject-color: #fb7185; }.cat-it { --subject-color: #6366f1; }.cat-tech { --subject-color: #a16207; }.cat-hum { --subject-color: #64748b; }
.cat-p0 { --subject-color: #f472b6; }.cat-p1 { --subject-color: #22d3ee; }.cat-p2 { --subject-color: #a3e635; }.cat-p3 { --subject-color: #c084fc; }.cat-p4 { --subject-color: #fb923c; }.cat-p5 { --subject-color: #38bdf8; }.cat-p6 { --subject-color: #facc15; }.cat-p7 { --subject-color: #818cf8; }
/* Keep the overflowing content visible in the editor; exports ask for a larger page. */
.sheet.paper-sheet[data-fits="false"] { height: auto; }
.sheet.paper-sheet[data-fits="false"]::after { content: none; }
#printHost { position: fixed; left: -20000px; top: 0; pointer-events: none; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--br2); outline-offset: 3px; }
.layout-controls { padding: 16px; margin: -2px -4px 24px; border: 1px solid color-mix(in srgb, var(--br1) 30%, var(--line)); border-radius: 16px; background: linear-gradient(155deg, #8b5cf60c, transparent); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 20px; font-size: 11px; font-weight: 700; color: var(--tx); }
.new-label { font-size: 10px; color: var(--tx2); font-weight: 400; }
.layout-controls > label { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 12px; margin: 12px 0 6px; }
.layout-controls select { font-size: 12px; font-weight: 500; padding: 10px 8px; }
.output-seg { display: flex; gap: 4px; padding: 4px; margin: 12px 0; border-radius: 11px; background: var(--bg); border: 1px solid var(--line); }
.output-seg button { flex: 1; background: transparent; color: var(--tx2); border-radius: 7px; padding: 8px; font-size: 12px; font-weight: 500; }
.output-seg button[aria-pressed="true"] { background: var(--p2); color: var(--tx); box-shadow: 0 2px 8px #0002; }
.a5-preset { width: 100%; margin-top: 14px; font-size: 12px; color: #c7b7ff; background: #8b5cf615; border-color: #8b5cf640; }
html.site-light .a5-preset { color: #6137a0; }
.layout-controls .hint { margin-bottom: 0; line-height: 1.55; font-size: 11px; }
.export-note { font-size: 12px; line-height: 1.8; color: var(--tx); }
.canvas-toolbar { align-self: stretch; width: 100%; display: flex; gap: 16px; align-items: center; justify-content: space-between; margin: -4px 0 2px; }
.canvas-toolbar > div { display: flex; align-items: center; gap: 12px; }
.canvas-eyebrow { font-size: 10px; font-weight: 500; letter-spacing: .12em; color: var(--tx2); }
#paperLabel { padding: 5px 9px; border-radius: 6px; border: 1px solid var(--line); font-size: 11px; font-weight: 500; }
.save-status { color: var(--tx2); font-size: 11px; display: flex; gap: 6px; align-items: center; }
.save-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }
.layout-status { width: 100%; align-self: stretch; margin-bottom: 6px; font-size: 12px; line-height: 1.5; color: var(--tx2); }
.layout-status.is-warning { padding: 12px 14px; color: #f6cf82; background: #f59e0b12; border: 1px solid #f59e0b40; border-radius: 12px; }
html.site-light .layout-status.is-warning { color: #805914; }
.layout-status button { color: inherit; background: transparent; text-decoration: underline; font-size: inherit; padding: 5px 8px; }
.grp > label.check { font-weight: 500; letter-spacing: normal; text-transform: none; font-size: 12px; line-height: 1.5; }
.tbtn { transition: border-color .15s, background .15s; }
.tbtn.active { outline: 1px solid var(--br1); outline-offset: 1px; }
.hero { padding-top: 64px; }
.hero h1 { font-weight: 700; letter-spacing: -.045em; line-height: 1.18; }
.hero p.sub { max-width: 650px; }
.hero-preview { max-width: 850px; margin: 42px auto 0; padding: 18px; border: 1px solid #8b5cf635; border-radius: 22px; background: linear-gradient(145deg, var(--p2), var(--p1)); box-shadow: 0 26px 90px #0003; transform: rotate(-1deg); }
.hero-preview-caption, .hero-preview-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--tx2); text-align: left; }
.hero-preview-caption { margin: 0 2px 14px; }
.hero-preview-caption i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #34d399; margin-right: 7px; }
.hero-sheet-window { overflow: hidden; border-radius: 6px; position: relative; }
.hero-sheet-window .sheet { transform-origin: top left; box-shadow: none; }
.hero-preview-foot { justify-content: center; gap: 24px; margin-top: 14px; font-size: 10px; }
.style-filters { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 22px 0 26px; }
.style-filters button { font-size: 12px; color: var(--tx2); padding: 9px 17px; border: 1px solid var(--line); border-radius: 999px; background: transparent; }
.style-filters button.active { background: var(--tx); color: var(--bg); border-color: var(--tx); }
.mini-clip { height: 185px; background: var(--p2); }
.mini-clip .sheet.paper-sheet { width: var(--paper-w) !important; min-height: var(--paper-h) !important; top: 12px; left: 12px; transform: scale(.295); }
.mini-clip .sheet.paper-sheet .s-grid { display: flex !important; gap: var(--row-gap); }
.mini-meta { align-items: start; padding: 14px; }
.mini-meta b { font-size: 12px; font-weight: 600; }
.mini-meta span { font-size: 10px; }
.pw-print-settings { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.pw-print-settings label { min-width: 0; font-size: 11px; color: var(--tx2); display: grid; gap: 5px; }
.pw-print-settings select { width: 100%; min-width: 0; font-size: 12px; }
.pw-print-settings .check { grid-column: 1 / -1; display: flex; }
.pw-result .layout-status { margin-top: 6px; }
@media (max-width: 720px) {
  body.mode-edit.compact #sheet.paper-sheet { width: var(--paper-w) !important; height: var(--paper-h) !important; min-height: var(--paper-h) !important; }
  body.mode-edit.compact #sheet.paper-sheet[data-fits="false"] { height: auto !important; }
  .canvas-eyebrow { display: none; }
  .canvas-toolbar { margin: 2px 0 6px; }
  .save-status { font-size: 10px; }
  .hero { padding-top: 32px; }
  .hero-preview { padding: 10px; margin-top: 30px; border-radius: 14px; transform: none; }
  .hero-preview-caption { font-size: 9px; gap: 5px; }
  .hero-preview-caption > span:last-child { white-space: nowrap; }
  .hero-preview-foot { gap: 12px; font-size: 8px; margin-top: 10px; }
  .layout-controls { margin: 0 0 24px; }
  .topbar-actions { overflow-x: auto; }
  .topbar-actions .btn { white-space: nowrap; flex-shrink: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media print {
  @page { margin: 0; }
  html, body, body.mode-edit, body.phone-wizard { width: auto !important; height: auto !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; background: white !important; }
  body > :not(#printHost) { display: none !important; }
  body #printHost { display: block !important; position: static; width: auto; height: auto; margin: 0; padding: 0; }
  #printHost .sheet.paper-sheet { width: var(--paper-w) !important; height: var(--paper-h) !important; min-height: 0 !important; margin: 0 !important; transform: none !important; box-shadow: none !important; border-radius: 0; overflow: hidden !important; break-inside: avoid; }
  #printHost * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
/* A5 gives the timetable priority: a single header line and compact reference lists. */
.sheet.paper-sheet.fmt-a5 .s-head { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.sheet.paper-sheet.fmt-a5 .s-sub { grid-column: 3; grid-row: 1; text-align: right; font-size: 10px; }
.sheet.paper-sheet.fmt-a5 .s-tagrow { grid-column: 2; }
.sheet.paper-sheet.fmt-a5 .s-teach > div:nth-child(2) { font: 400 10px/1.3 Manrope, sans-serif; }
.sheet.paper-sheet.fmt-a5 .s-teach strong, .sheet.paper-sheet.fmt-a5 .s-teach em { display: inline; font-size: 10px; line-height: 1.3; }
.sheet.paper-sheet.fmt-a5 .s-teach strong { margin-right: 5px; }
.sheet.paper-sheet.fmt-a5 .s-teach .room { padding: 1px 3px; font-size: 9px; }
.sheet.paper-sheet[data-density="tight"] .s-box h3 { margin-bottom: 4px; }
.sheet.paper-sheet.fmt-a5[data-density="tight"] { --row-gap: 2px; --section-gap: 4px; }
.sheet.paper-sheet.th-russia .s-time { padding: 0; }
.sheet.paper-sheet.th-minecraft .s-box { border-width: 1px; }
.sheet.paper-sheet.th-minecraft { border-width: 1px; }

@media (hover: hover) {
  .sheet.paper-sheet .s-num .grip { opacity: .15; height: 16px; transition: opacity .15s; }
  .sheet.paper-sheet .s-row:hover .grip, .sheet.paper-sheet .s-num .grip:focus { opacity: 1; }
}

.sheet.paper-sheet .s-note { white-space: pre-line; }
.sheet.paper-sheet.th-glass:not(.print-friendly) .s-box h3 { color: #6243a5; }
.sheet.paper-sheet.th-glass:not(.print-friendly) .s-tag { color: #fff; }

.sheet.paper-sheet .s-extra.single-box { grid-template-columns: 1fr; }
.pw-print-settings select { background: var(--p2); color: var(--tx); border: 1px solid var(--line); border-radius: 10px; padding: 9px 8px; font: inherit; font-size: 12px; }
.pw-result { overflow-y: auto; overscroll-behavior: contain; padding-bottom: 4px; }
#toast { opacity: 0; visibility: hidden; transition: transform .2s, opacity .2s, visibility .2s; }
#toast.show { opacity: 1; visibility: visible; }
@media (max-width: 480px) {
  .nav { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .nav > .spacer { display: none; }
  .nav .site-theme-btn { justify-self: end; }
  body.compact .nav-cta { grid-column: 1 / -1; display: flex; flex-direction: row; width: 100%; min-width: 0; gap: 8px; }
  body.compact .nav-cta .btn { flex: 1; min-height: 38px; }
}

.sheet.paper-sheet.reading-large .s-time{font-size:14.67px}
.sheet.paper-sheet .s-note-time{font-size:13.33px;line-height:1.22;font-weight:400;font-variant-numeric:tabular-nums;opacity:1}
.sheet.paper-sheet.reading-large .s-note-time{font-size:14.67px}

.s-time-part{white-space:nowrap;display:inline-block}
@media(max-width:760px){.day-slot .s-time{font-size:14px;font-weight:400;flex-wrap:wrap}}
