/* Урок Просто — мини-превью документов (up-sheets.css). Корень страницы .up (up-kit.css), компоненты up-sh-*.
   Разметку даёт up_sheets.py: <span class="up-sh is-row|is-tile|is-large" data-fmt="…"><span class="up-sh-box"><span class="up-sh-paper">…
   Лист (.up-sh-paper) живёт в «родном» размере — портрет 340×460, техкарта 460×330, слайд 460×259 — и масштабируется
   transform: scale(var(--up-sh-k)); коробка (.up-sh-box) считается в итоговом размере, поэтому тень, скругление и обрезка
   не плывут. Родной размер техкарты — 460×350. Лист всегда белая «бумага»: цвета заданы явно, тёмная тема меняет только тень и сцену. */
.up-sh { --up-sh-k: 1; --up-sh-w: 340px; --up-sh-h: 460px; position: relative; display: inline-grid; place-items: center; flex: 0 0 auto; vertical-align: middle; pointer-events: none; }
.up-sh[data-fmt="techmap"] { --up-sh-w: 460px; --up-sh-h: 350px; }
.up-sh[data-fmt="presentation"] { --up-sh-w: 460px; --up-sh-h: 259px; }
.up-sh-box { position: relative; display: block; width: calc(var(--up-sh-w) * var(--up-sh-k)); height: calc(var(--up-sh-h) * var(--up-sh-k)); overflow: hidden;
  border-radius: 3px; background: #fff; box-shadow: 0 1px 2px rgba(31, 27, 58, .14), 0 0 0 1px rgba(31, 27, 58, .09);
  transition: transform .3s var(--spring-soft), box-shadow .2s var(--ease-out); }
.up[data-theme="dark"] .up-sh-box { box-shadow: 0 2px 6px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .1); }
.up-sh-paper { position: absolute; left: 0; top: 0; width: var(--up-sh-w); height: var(--up-sh-h); padding: 26px 28px; overflow: hidden;
  transform: scale(var(--up-sh-k)); transform-origin: 0 0; display: grid; align-content: start; gap: 9px;
  background: #fff; color: #1f1b3a; font-family: var(--font-sans); font-size: 11px; line-height: 15px; font-weight: 400; letter-spacing: 0; text-align: left; white-space: normal; }
.up-sh-paper > * { min-width: 0; }

/* ---------- размеры ---------- */
/* значок в строке: слот 64×64, лист вписан (портрет 46×62, техкарта 62×45, слайд 62×35) */
.up-sh.is-row { --up-sh-k: .135; width: 64px; height: 64px; }
.up-sh.is-row .up-sh-box { border-radius: 2px; }
/* плитка: сцена 4:3 на всю ширину карточки, лист прижат к верху и обрезан снизу; масштаб — по ширине сцены */
.up-sh.is-tile { --up-sh-k: .56; display: grid; width: 100%; aspect-ratio: 4 / 3; align-items: start; justify-items: center; padding-top: 7%; overflow: hidden;
  border-radius: 12px; background: rgba(31, 27, 58, .05); container-type: inline-size; }
.up[data-theme="dark"] .up-sh.is-tile { background: rgba(255, 255, 255, .06); }
.up-sh.is-tile .up-sh-box { border-radius: 4px 4px 0 0; box-shadow: 0 1px 2px rgba(31, 27, 58, .12), 0 10px 24px -12px rgba(31, 27, 58, .45), 0 0 0 1px rgba(31, 27, 58, .08); }
.up-sh.is-tile[data-fmt="presentation"] { align-items: center; padding-top: 0; }
.up-sh.is-tile[data-fmt="presentation"] .up-sh-box, .up-sh.is-tile[data-fmt="techmap"] .up-sh-box { border-radius: 4px; }
.up-sh.is-tile[data-fmt="techmap"] { padding-top: 8%; }
/* масштаб по ширине сцены: портрет ~79 % ширины, альбомные (техкарта, слайд) ~92 % */
@container (max-width: 199px) { .up-sh-box { --up-sh-k: .38; } .up-sh[data-fmt="techmap"] .up-sh-box, .up-sh[data-fmt="presentation"] .up-sh-box { --up-sh-k: .33; } }
@container (min-width: 200px) and (max-width: 239px) { .up-sh-box { --up-sh-k: .46; } .up-sh[data-fmt="techmap"] .up-sh-box, .up-sh[data-fmt="presentation"] .up-sh-box { --up-sh-k: .40; } }
@container (min-width: 240px) and (max-width: 299px) { .up-sh-box { --up-sh-k: .56; } .up-sh[data-fmt="techmap"] .up-sh-box, .up-sh[data-fmt="presentation"] .up-sh-box { --up-sh-k: .48; } }
@container (min-width: 300px) and (max-width: 359px) { .up-sh-box { --up-sh-k: .66; } .up-sh[data-fmt="techmap"] .up-sh-box, .up-sh[data-fmt="presentation"] .up-sh-box { --up-sh-k: .58; } }
@container (min-width: 360px) { .up-sh-box { --up-sh-k: .78; } .up-sh[data-fmt="techmap"] .up-sh-box, .up-sh[data-fmt="presentation"] .up-sh-box { --up-sh-k: .68; } }
/* крупный лист: родной размер (340 / 460 px); больше — переопределите --up-sh-k на .up-sh.is-large */
.up-sh.is-large { --up-sh-k: 1; }
.up-sh.is-large .up-sh-box { border-radius: 6px; box-shadow: 0 1px 2px rgba(31, 27, 58, .14), 0 20px 44px -18px rgba(31, 27, 58, .5), 0 0 0 1px rgba(31, 27, 58, .07); }
.up-sh.is-large .up-sh-paper { border-radius: 6px; }

/* ---------- общие детали листа ---------- */
.up-sh-bar { display: block; height: 5px; border-radius: 3px; background: #e6e3ef; }
.up-sh-head { display: grid; gap: 3px; text-align: center; }
.up-sh-title { display: block; font-weight: 700; font-size: 14px; line-height: 18px; }
.up-sh-title.is-c { text-align: center; }
.up-sh-topic { display: block; font-weight: 600; font-size: 12px; line-height: 16px; color: #2a2462; }
.up-sh-sub, .up-sh-mut, .up-sh-note { color: #5f5b76; }
.up-sh-mut { font-weight: 400; }
.up-sh-note { display: block; font-size: 10px; line-height: 14px; }
.up-sh-h2 { display: block; font-weight: 700; font-size: 12px; line-height: 16px; margin-top: 2px; }
.up-sh-p { display: block; }
.up-sh-p .up-sh-bar { display: inline-block; vertical-align: middle; }
.up-sh-stage { display: grid; gap: 4px; }
.up-sh-stage > b { display: block; }
/* таблицы техкарты и «своего урока» */
.up-sh-meta { display: grid; grid-template-columns: 84px minmax(0, 1fr); border: 1px solid #d9d5e6; border-bottom: 0; }
.up-sh-mk, .up-sh-mv { display: block; padding: 3px 7px; border-bottom: 1px solid #d9d5e6; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-sh-mk { background: #f7f6fb; font-weight: 600; border-right: 1px solid #d9d5e6; }
.up-sh-table { display: grid; grid-template-columns: minmax(0, 1.5fr) 44px minmax(0, 1.4fr) minmax(0, 1.3fr) minmax(0, .9fr); border-top: 1px solid #d9d5e6; border-left: 1px solid #d9d5e6; font-size: 10px; line-height: 13px; }
.up-sh-th, .up-sh-td { display: grid; align-content: start; gap: 3px; padding: 4px 5px; border-right: 1px solid #d9d5e6; border-bottom: 1px solid #d9d5e6; min-width: 0; }
.up-sh-th { background: #f2f0f8; font-weight: 700; }
.up-sh-td.is-b { font-weight: 600; }
.up-sh-td .up-sh-bar { height: 4px; }
/* рабочий лист и контрольная */
.up-sh-blank { display: inline-block; width: 48px; height: 1px; margin: 0 2px; vertical-align: baseline; border-bottom: 1px solid #1f1b3a; }
.up-sh-blank.is-l { width: 120px; }
.up-sh-lvl { display: block; color: #5f5b76; font-weight: 700; font-size: 10px; line-height: 14px; letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }
.up-sh-task { display: flex; align-items: center; gap: 6px; }
.up-sh-task > b { flex: 0 0 auto; }
.up-sh-task .up-sh-bar { flex: 1 1 auto; }
.up-sh-rule { display: block; height: 14px; border-bottom: 1px solid #b9b4cc; }
.up-sh-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 14px; padding-left: 14px; }
.up-sh-opt { display: flex; align-items: center; gap: 5px; }
.up-sh-opt > b { flex: 0 0 auto; font-weight: 600; }
.up-sh-opt .up-sh-bar { flex: 1 1 auto; height: 4px; }
/* карточки */
.up-sh-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.up-sh-card { display: grid; gap: 4px; padding: 8px; border: 1px dashed #b9b4cc; border-radius: 6px; }
.up-sh-card > b { font-size: 11px; }
/* диктант: линованная бумага и пропуски */
.up-sh-lined { display: block; padding: 2px 0 0; background: repeating-linear-gradient(transparent 0 17px, #ece9f3 17px 18px); background-position: 0 -3px; line-height: 18px; }
.up-sh-lined .up-sh-p { line-height: 18px; }
.up-sh-gap { display: inline-block; width: 11px; height: 1px; vertical-align: baseline; border-bottom: 1.5px solid #4b40b8; }
/* свой урок: наш бланк */
.up-sh-own-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.up-sh-own-tag { display: inline-flex; align-items: center; height: 16px; padding: 0 6px; border-radius: 999px; background: #e2f7ee; color: #12875b; font-size: 9.5px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.up-sh-own-list { display: grid; gap: 5px; }
.up-sh-own-row { display: grid; grid-template-columns: 14px minmax(0, auto) minmax(0, 1fr); align-items: center; gap: 6px; }
.up-sh-own-row .up-sh-bar { height: 4px; }
.up-sh-own-chk { display: grid; place-items: center; width: 14px; height: 14px; border-radius: 999px; background: #e2f7ee; color: #12875b; }
/* слайд презентации: оформление по data-sl (Классическая, Лазурь, Тетрадь, Мята, Бумага, Радуга) */
.up-sh[data-fmt="presentation"] .up-sh-paper { --sl-bg: #ffffff; --sl-ink: #1f2937; --sl-acc: #1d4ed8; --sl-mut: #5f5b76; --sl-pic: #f1f3f9;
  padding: 0; background: var(--sl-bg); color: var(--sl-ink); gap: 0; }
.up-sh[data-sl="azure"] .up-sh-paper { --sl-bg: #e8f0fd; --sl-ink: #1f2937; --sl-acc: #1d4ed8; --sl-pic: #ffffff; }
.up-sh[data-sl="notebook"] .up-sh-paper { --sl-bg: #f7f9fc; --sl-ink: #1b2340; --sl-acc: #4338ca; --sl-pic: #ffffff;
  background-image: repeating-linear-gradient(transparent 0 23px, #dfe4f0 23px 24px); }
.up-sh[data-sl="mint"] .up-sh-paper { --sl-bg: #d6ece3; --sl-ink: #1b2e25; --sl-acc: #276749; --sl-mut: #3f5a4d; --sl-pic: #ffffff; }
.up-sh[data-sl="paper"] .up-sh-paper { --sl-bg: #efe7d8; --sl-ink: #2b2118; --sl-acc: #9a3b2e; --sl-mut: #6b5a4a; --sl-pic: #faf6ee; }
.up-sh[data-sl="rainbow"] .up-sh-paper { --sl-bg: #fffbf3; --sl-ink: #1f2937; --sl-acc: #2563eb; --sl-pic: #ffffff;
  background-image: linear-gradient(90deg, #ff6b57, #ffc83d, #22c39a, #36a9f5, #8b6cff); background-size: 100% 6px; background-repeat: no-repeat; background-position: 0 0; }
.up-sh-sl-top { position: absolute; left: 32px; top: 24px; font-size: 12px; line-height: 16px; color: var(--sl-mut); }
.up-sh-sl-mid { position: absolute; left: 32px; right: 32px; top: 56px; bottom: 56px; display: flex; align-items: center; gap: 24px; }
.up-sh-sl-title { flex: 1 1 0; min-width: 0; font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 32px; letter-spacing: -.01em; color: var(--sl-ink);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.up-sh-pic { flex: 0 0 150px; align-self: stretch; display: grid; place-items: center; border-radius: 10px; background: var(--sl-pic); color: var(--sl-acc); opacity: .9; }
.up-sh-sl-foot { position: absolute; left: 32px; right: 32px; bottom: 22px; display: flex; align-items: center; justify-content: space-between; }
.up-sh-sl-acc { display: block; width: 56px; height: 5px; border-radius: 3px; background: var(--sl-acc); }
.up-sh-sl-n { font-size: 11px; line-height: 14px; color: var(--sl-mut); font-variant-numeric: tabular-nums; }
.up-sh[data-sl="rainbow"] .up-sh-sl-acc { background: linear-gradient(90deg, #ff6b57, #ffc83d, #22c39a, #36a9f5, #8b6cff); width: 96px; }

@media (prefers-reduced-motion: reduce) {
  .up-sh-box { transition: none; }
}
