:root {
  --paper: #fff4fb;
  --paper-2: #ffe3f2;
  --ink: #2b1148;
  --muted: #7a4d7e;
  --gold: #ff4db8;
  --cadmium: #ff3d6e;
  --prussian: #5b6cff;
  --sage: #12d18a;
  --card: #ffffff;
  --line: rgba(43, 17, 72, 0.1);
  --shadow: 0 12px 0 rgba(255, 61, 110, 0.12);
  --nav: 92px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --nav-clearance: 22px;
  --content-bottom: calc(var(--nav) + var(--safe-b) + var(--nav-clearance));
  --lime: #c8ff4d;
  --sky: #5ce1ff;
  --grape: #9b5cff;
  --stroke: #2b1148;
  --fill: #2b1148;
  --on-fill: #ffffff;
  --nav-bg: rgba(255, 244, 251, 0.96);
}

html, body {
  height: 100%;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}
#root {
  height: 100%;
  overflow: hidden;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Nunito, Outfit, system-ui, sans-serif;
  background:
    radial-gradient(900px 420px at 110% -10%, #ffb7e4 0%, transparent 55%),
    radial-gradient(700px 380px at -20% 10%, #c9b7ff 0%, transparent 50%),
    radial-gradient(500px 300px at 50% 100%, #baf7ff 0%, transparent 45%),
    var(--paper);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

:root { --app-w: 480px; }

.shell {
  height: 100%;
  max-width: var(--app-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.app {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  padding: calc(12px + var(--safe-t)) 16px 24px;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scroll-padding-bottom: 24px;
}

h1, h2, h3 {
  font-family: Fredoka, Fraunces, sans-serif;
  font-weight: 650;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
h1 { font-size: 1.85rem; margin: 0 0 6px; }
h2 { font-size: 1.25rem; margin: 0 0 10px; }
p { margin: 0 0 10px; }

h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
h1 .ico { width: 1.1em; height: 1.1em; }

.kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cadmium);
  font-weight: 800;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kicker .ico { width: 16px; height: 16px; letter-spacing: 0; }

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-width: 0; }
.space { justify-content: space-between; }
.stack { display: grid; gap: 10px; min-width: 0; }
.min-wrap { min-width: 0; flex: 1 1 auto; }
.title-text {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  max-width: 100%;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; min-width: 0; }
.grid > * { min-width: 0; max-width: 100%; }

.ico {
  width: 1.35em;
  height: 1.35em;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: currentColor;
  vertical-align: -0.25em;
}
.ico svg { width: 100%; height: 100%; display: block; overflow: visible; }
.nav .ico { width: 34px; height: 34px; margin: 0 auto 4px; display: grid; }
.subject .ico { width: 34px; height: 34px; color: #fff; filter: drop-shadow(0 2px 0 rgba(0,0,0,.12)); }
.btn .ico { width: 22px; height: 22px; }

.card {
  background: var(--card);
  border: 3px solid #2b1148;
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 6px 0 #2b1148;
  min-width: 0;
  overflow: hidden;
}

.subject {
  min-height: 124px;
  min-width: 0;
  max-width: 100%;
  text-align: left;
  border: 3px solid #2b1148;
  border-radius: 24px;
  padding: 12px;
  background: var(--card);
  box-shadow: 0 6px 0 #2b1148;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #fff;
  transform: rotate(-0.4deg);
  animation: card-in 0.5s ease both;
  overflow: hidden;
}
.subject:nth-child(even) { transform: rotate(0.6deg); }
.subject:active { transform: translateY(3px); box-shadow: 0 3px 0 #2b1148; }
.subject .swatch { display: none; }
.subject b { font-size: 0.95rem; line-height: 1.2; font-family: Fredoka, sans-serif; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.subject span { color: rgba(255,255,255,.85); font-size: 0.75rem; font-weight: 800; overflow-wrap: anywhere; word-break: break-word; }

.btn {
  border: 3px solid #2b1148;
  border-radius: 999px;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  min-height: 52px;
  box-shadow: 0 5px 0 #2b1148;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}
.btn.gold { background: linear-gradient(180deg, #ffdf4d, #ffb300); color: #2b1148; }
.btn.red { background: linear-gradient(180deg, #ff7aa2, #ff3d6e); }
.btn.ghost {
  background: #fff;
  color: var(--ink);
}
.btn.block { width: 100%; }
a.btn { text-decoration: none; }
.btn:disabled { opacity: 0.5; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #2b1148; }
.quiet-link {
  display: inline-block;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--ink);
  text-underline-offset: 3px;
}

.chip {
  border: 2px solid #2b1148;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 40px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip.on { background: #2b1148; color: #fff; }

.field {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 3px solid #2b1148;
  background: #fff;
  border-radius: 16px;
  padding: 12px 14px;
  min-height: 48px;
}
.err { color: var(--cadmium); font-weight: 800; min-height: 1.2em; }
label { font-weight: 800; display: block; }
textarea.field { min-height: 180px; resize: vertical; line-height: 1.45; }

.nav {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-top: 3px solid var(--stroke);
  padding: 8px 4px calc(8px + var(--safe-b));
  z-index: 20;
}
.nav button {
  border: 0;
  background: transparent;
  min-height: 68px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  gap: 0;
}
.nav button.on { color: var(--cadmium); }

.hero {
  background: linear-gradient(160deg, #ff4db8 0%, #ff8a3d 48%, #ffd84d 100%);
  border-radius: 28px;
  padding: 18px;
  border: 3px solid #2b1148;
  margin-bottom: 16px;
  box-shadow: 0 8px 0 #2b1148;
  color: #2b1148;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.hero .kicker { color: #2b1148; }
.hero .muted, .hero .small { color: rgba(43, 17, 72, 0.78); }
.hero::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  animation: blob 4s ease-in-out infinite;
}
.hero-stickers { position: absolute; inset: 0; pointer-events: none; }
.sticker { position: absolute; width: 30px; height: 30px; }
.sticker.s1 { top: 10px; right: 14px; color: #fff; }
.sticker.s2 { bottom: 12px; right: 46px; color: #2b1148; }
.sticker.s3 { top: 44px; right: 72px; color: #c8ff4d; }
.sticker.s4 { bottom: 16px; right: 8px; color: #ff3d6e; }

.now-lesson { display: grid; gap: 6px; margin-bottom: 12px; min-width: 0; }
.now-lesson > .ico { width: 36px; height: 36px; }
.now-lesson .kicker { color: inherit; opacity: 0.9; }
.now-lesson b { font-family: Fredoka, sans-serif; font-size: 1.15rem; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }

.grade {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: Fredoka, sans-serif;
  font-size: 1.6rem;
  background: var(--ink);
  color: #fff;
  border: 3px solid #2b1148;
}
.grade.g5 { background: #12d18a; color: #073; }
.grade.g4 { background: #5b6cff; }
.grade.g3 { background: #ffd84d; color: #2b1148; }
.grade.g2 { background: #ff8a3d; }
.grade.g1 { background: #ff3d6e; }

.flash {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 22px;
  font-family: Fredoka, sans-serif;
  font-size: 1.25rem;
}
.progress {
  height: 10px;
  background: #ffd0ea;
  border-radius: 99px;
  overflow: hidden;
  border: 2px solid #2b1148;
}
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #ff4db8, #ffd84d); }

.photo-row { display: flex; gap: 8px; overflow-x: auto; }
.photo-row img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 14px;
  border: 3px solid #2b1148;
}

.option {
  width: 100%;
  text-align: left;
  border: 3px solid #2b1148;
  background: var(--card);
  border-radius: 16px;
  padding: 14px;
  min-height: 52px;
  font-weight: 700;
}
.option.ok { background: #c8ffde; }
.option.bad { background: #ffd0dc; }

.hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  opacity: 0;
}
.group-title {
  margin: 18px 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.steps {
  margin: 0;
  padding-left: 1.3em;
  text-align: left;
  font-weight: 700;
}
.steps li { margin: 0 0 8px; }

.install {
  background: #2b1148;
  color: #fff;
  border-radius: 20px;
  padding: 12px 14px;
  font-size: 0.9rem;
  border: 3px solid #2b1148;
}

.qr-box {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}
.qr-box img {
  width: 220px;
  height: 220px;
  background: #fff;
  border: 3px solid #2b1148;
  border-radius: 20px;
  padding: 10px;
}
.qr-box h2 { margin: 0; }

.banner {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: #2b1148;
  color: #fff;
  border-radius: 22px;
  padding: 14px;
  border: 3px solid #2b1148;
  box-shadow: 0 6px 0 #ff3d6e;
}
.banner .kicker { color: #ffd84d; }
.dots { display: flex; gap: 6px; }
.dot {
  width: 30px;
  height: 30px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  background: rgba(255,255,255,.45);
  font-weight: 800;
  border: 2px solid #2b1148;
}
.dot.on { background: #c8ff4d; }
.cal { display: grid; gap: 8px; }
.month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}
.month-dow {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
  padding: 2px 0 4px;
}
.day-cell {
  min-height: 52px;
  border: 2px solid #2b1148;
  border-radius: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  padding: 6px 2px 4px;
  font-weight: 800;
}
.day-cell.out { visibility: hidden; }
.day-cell.today { background: #ffd84d; }
.day-cell.on { background: #2b1148; color: #fff; }
.day-n { font-size: 0.88rem; line-height: 1; }
.day-dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; min-height: 6px; }
.day-dot {
  width: 7px;
  height: 7px;
  border-radius: 99px;
  display: block;
}
.cal-pop-bg {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(43, 17, 72, 0.46);
  display: grid;
  place-items: end center;
  padding: 16px 12px var(--content-bottom);
}
.cal-pop {
  width: min(var(--app-w), 100%);
  max-height: min(72dvh, 560px);
  overflow: auto;
  text-align: left;
}
.cal-pop-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 2px solid rgba(43, 17, 72, 0.08);
  min-width: 0;
}
.cal-pop-item:last-child { border-bottom: 0; }
.cal-pop-item-body { min-width: 0; }
.cal-pop-item-body b { display: block; margin-bottom: 2px; overflow-wrap: anywhere; word-break: break-word; }
.cal-pop-item .chip { flex-shrink: 0; }
@media (max-width: 420px) {
  .cal-pop-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .cal-pop-item .tag { grid-column: 1 / -1; }
}
.event { text-align: left; width: 100%; min-width: 0; }
.event b, .event p { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.event .row { width: 100%; }
.event .row .chip { flex-shrink: 0; }
.tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--cadmium);
}
.timer {
  font-family: Fredoka, sans-serif;
  font-size: 2.6rem;
  text-align: center;
  padding: 8px 0;
}
select.field { appearance: auto; }

.slot {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: stretch;
}
.slot-time {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  padding-top: 10px;
}
.slot-card {
  text-align: left;
  min-height: 58px;
  border-radius: 18px;
  border: 3px solid #2b1148;
  box-shadow: 0 4px 0 #2b1148;
  padding: 8px 10px;
  color: #fff;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.slot-card .ico { width: 22px; height: 22px; color: #fff; }
.slot-card span { font-size: 0.72rem; font-weight: 700; opacity: 0.88; }
.slot-card.empty {
  background: #fff;
  color: var(--muted);
}
.slot-card.empty .ico { color: var(--muted); }
.slot-time.now { color: var(--ink); font-weight: 900; }
.slot-card.past { opacity: 0.45; }
.slot-card.urnik-next { box-shadow: 0 4px 0 #2b1148, 0 0 0 3px #ffd84d; }
.slot-card.is-focus { box-shadow: 0 4px 0 #2b1148, 0 0 0 3px #5ce1ff; }
.slot-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: #ffd84d;
  color: #2b1148;
  border-radius: 8px;
  padding: 1px 6px;
}
.slot-badge.next { background: #5ce1ff; }
.go-map { border-color: #ff3d6e; }
.urnik-foot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 2px dashed rgba(43, 17, 72, 0.2);
  opacity: 0.92;
}
.btn.quiet {
  background: transparent;
  color: var(--muted);
  border-style: dashed;
  box-shadow: none;
  min-height: 44px;
  font-size: 0.9rem;
}
.btn.quiet:active { transform: none; box-shadow: none; }
.confirm-save { background: #fff4c8; }
.urnik-note { background: #fff4c8; }
.urnik-warn { background: #ffd0dc; }
.quiz-correct { background: #c8ffde; font-weight: 800; }
.quiz-incorrect { background: #ffd0dc; font-weight: 800; }
.school-map {
  position: relative;
  border: 3px solid #2b1148;
  border-radius: 18px;
  overflow: hidden;
  background: #f4f0ea;
}
.school-map img { width: 100%; display: block; }
.school-map .pin {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  background: #ff3d6e;
  border: 3px solid #2b1148;
  border-radius: 50%;
  box-shadow: 0 3px 0 #2b1148;
}
.pick-sub .ico { width: 16px; height: 16px; color: #fff; }
.day-tabs { flex-wrap: nowrap; overflow-x: auto; }
.urnik-now {
  animation: glow 1.6s ease-in-out infinite;
}
.picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 50vh;
  overflow: auto;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(10deg); }
}
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0); filter: saturate(1); }
  50% { transform: scale(1.18) rotate(12deg); filter: saturate(1.4); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(12deg); }
  75% { transform: rotate(-12deg); }
}
@keyframes pop {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.14); }
}
@keyframes zap {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-3px) rotate(8deg); }
}
@keyframes spin-slow {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}
@keyframes tick {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(12deg); }
}
@keyframes blob {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-12px, 10px) scale(1.15); }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px) scale(.96); }
  to { opacity: 1; }
}
@keyframes glow {
  0%, 100% { box-shadow: 0 4px 0 #2b1148, 0 0 0 0 rgba(255, 216, 77, .6); }
  50% { box-shadow: 0 4px 0 #2b1148, 0 0 0 6px rgba(255, 216, 77, 0); }
}

.motion-bounce { animation: bounce 1.4s ease-in-out infinite; }
.motion-float { animation: float 2.4s ease-in-out infinite; }
.motion-wiggle { animation: wiggle 1.8s ease-in-out infinite; }
.motion-twinkle { animation: twinkle 1.6s ease-in-out infinite; }
.motion-pulse { animation: pulse 1.3s ease-in-out infinite; }
.motion-shake { animation: shake 1.5s ease-in-out infinite; }
.motion-pop { animation: pop 1.8s ease-in-out infinite; }
.motion-zap { animation: zap 0.9s ease-in-out infinite; }
.motion-spin-slow { animation: spin-slow 8s linear infinite; }
.motion-tick { animation: tick 2s ease-in-out infinite; }

.subject .ico { animation-duration: 2.2s; }
.subject:nth-child(2) .ico { animation-delay: .15s; }
.subject:nth-child(3) .ico { animation-delay: .3s; }
.subject:nth-child(4) .ico { animation-delay: .45s; }

.mins-list { display: grid; gap: 0; }
.mins-all {
  background: var(--paper-2);
  border: 2px solid #2b1148;
  border-radius: 18px;
  padding: 8px 10px 10px;
  margin-bottom: 6px;
}
.mins-all .mins-row { border-bottom: 0; padding: 8px 0 10px; }
.mins-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 2px solid rgba(43, 17, 72, 0.08);
}
.mins-row:last-child { border-bottom: 0; }
.mins-dot {
  width: 12px;
  height: 12px;
  border-radius: 99px;
  border: 2px solid #2b1148;
}
.mins-info { min-width: 0; }
.mins-info b { display: block; font-size: 0.95rem; line-height: 1.2; }
.mins-info span { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 700; margin-top: 2px; }
.mins-step {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--paper);
  border: 2px solid #2b1148;
  border-radius: 999px;
  padding: 3px;
}
.mins-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 99px;
  background: #2b1148;
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0;
  box-shadow: none;
}
.mins-btn:active { transform: scale(0.94); }
.mins-val {
  min-width: 40px;
  text-align: center;
  font-family: Fredoka, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}

.snov {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.snov-photo-wrap { display: grid; gap: 6px; min-width: 0; }
.snov-photo {
  border: 3px solid #2b1148;
  border-radius: 18px;
  overflow: auto;
  background: #1a0b28;
  min-height: 160px;
  max-height: 32vh;
  box-shadow: 0 5px 0 #2b1148;
}
.snov-photo img {
  width: 100%;
  height: auto;
  display: block;
  max-width: none;
}
.snov-photo.empty {
  background: #fff;
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
}
.snov-photo.zoom {
  position: fixed;
  inset: 0;
  z-index: 40;
  border-radius: 0;
  min-height: 100%;
}
.snov-photo.zoom img { max-height: 100dvh; width: auto; margin: 0 auto; object-fit: contain; }
.snov-hint {
  margin: 0;
  padding: 6px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
}
.snov-thumbs { display: flex; gap: 6px; overflow-x: auto; }
.snov-thumb {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid #2b1148;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.snov-thumb.on { outline: 3px solid #ff4db8; }
.snov-thumb img { width: 100%; height: 100%; object-fit: cover; }
.note-pane {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 6px;
}
.note-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fff;
  padding: 8px;
  border: 3px solid #2b1148;
  border-radius: 16px;
  box-shadow: 0 4px 0 #2b1148;
}
.note-tool {
  min-width: 36px;
  min-height: 36px;
  border: 2px solid #2b1148;
  border-radius: 10px;
  background: #fff;
  font-weight: 800;
}
.note-tool.lab { padding: 0 10px; font-size: 0.78rem; }
.note-tool.imp { background: #ffd84d; }
.note-lab {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.note-swatch {
  width: 22px;
  height: 22px;
  border: 2px solid #2b1148;
  border-radius: 99px;
  padding: 0;
}
.note-doc {
  min-height: 220px;
  max-height: min(58vh, 480px);
  overflow: auto;
  border: 3px solid #2b1148;
  border-radius: 16px;
  background: #fff;
  padding: 12px 14px;
  line-height: 1.5;
  box-shadow: 0 5px 0 #2b1148;
}
.note-doc:focus { outline: 3px solid #ff4db8; }
.note-doc p { margin: 0 0 8px; }
.note-circle {
  border: 2.5px solid #ff3d6e;
  border-radius: 999px;
  padding: 1px 8px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.note-imp {
  background: linear-gradient(180deg, #ffe566, #ffd84d);
  border: 2px solid #2b1148;
  border-radius: 8px;
  padding: 0 7px 0 4px;
  font-weight: 800;
}
.note-imp::before { content: "★ "; color: #ff3d6e; }
.note-doc ul { margin: 0 0 8px; padding-left: 1.2em; }
.quote-card {
  text-align: left;
}
.quote-card q {
  font-family: Fredoka, sans-serif;
  font-size: 1.15rem;
  quotes: "„" "“";
}
.quote-card footer {
  margin-top: 8px;
  font-weight: 800;
  color: var(--muted);
}

@media (min-width: 720px) {
  :root { --app-w: 820px; }
  .app { padding-left: 24px; padding-right: 24px; }
  .grid { grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
  .snov {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
    align-items: stretch;
  }
  .snov-photo { min-height: 360px; max-height: min(70vh, 640px); }
  .note-doc { min-height: 360px; max-height: min(70vh, 640px); }
  .hero { padding: 26px 28px; }
  h1 { font-size: 2.15rem; }
  .subject { min-height: 140px; }
  .month { gap: 8px; }
  .day-cell { min-height: 64px; }
}

@media (min-width: 1024px) {
  :root { --app-w: 980px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .nav .ico { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .ico, .hero::after, .subject, .urnik-now { animation: none !important; }
}

.laura-staging-banner {
  position: sticky;
  top: 0;
  z-index: 4000;
  background: #3b2f00;
  color: #ffe08a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 6px 10px;
}

.theme-pick { display: grid; gap: 8px; }
.theme-card {
  width: 100%;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 3px solid var(--stroke);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  padding: 10px;
  box-shadow: 0 4px 0 var(--stroke);
}
.theme-card.on { outline: 3px solid var(--gold); outline-offset: 2px; }
.theme-swatch {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  border: 2px solid var(--stroke);
}
.theme-copy { display: grid; gap: 2px; min-width: 0; }
.theme-copy b { font-family: Fredoka, sans-serif; }
.theme-copy span { color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.theme-swatch-sushi { background: linear-gradient(160deg, #ff4db8, #ffd84d); }
.theme-swatch-rock { background: linear-gradient(145deg, #141414 20%, #e10600 72%, #f5b301); }
.theme-swatch-classic { background: linear-gradient(160deg, #f7f1e6, #8c734a); }

[data-theme="rock"] {
  --paper: #101114;
  --paper-2: #1a1c22;
  --ink: #f4efe6;
  --muted: #b7b1a6;
  --gold: #e10600;
  --cadmium: #f5b301;
  --card: #1b1d24;
  --stroke: #f4efe6;
  --fill: #e10600;
  --on-fill: #fff8ef;
  --nav-bg: rgba(16, 17, 20, 0.96);
  --line: rgba(244, 239, 230, 0.16);
  color-scheme: dark;
}
[data-theme="rock"] body {
  font-family: Archivo, Nunito, sans-serif;
  background:
    radial-gradient(720px 380px at 110% -10%, rgba(225, 6, 0, 0.45), transparent 55%),
    radial-gradient(520px 280px at -20% 0%, rgba(245, 179, 1, 0.2), transparent 50%),
    #0c0d10;
}
[data-theme="rock"] h1,
[data-theme="rock"] h2,
[data-theme="rock"] h3,
[data-theme="rock"] .subject b,
[data-theme="rock"] .timer,
[data-theme="rock"] .theme-copy b {
  font-family: Oswald, Fredoka, sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
[data-theme="rock"] .card,
[data-theme="rock"] .hero,
[data-theme="rock"] .subject,
[data-theme="rock"] .field,
[data-theme="rock"] .chip,
[data-theme="rock"] .btn,
[data-theme="rock"] .day-cell,
[data-theme="rock"] .theme-card {
  border-color: #f4efe6;
  border-radius: 8px;
  box-shadow: 4px 4px 0 #e10600;
}
[data-theme="rock"] .hero {
  background: linear-gradient(145deg, #1a1a1a 0%, #3a0a0a 48%, #e10600 100%);
  color: #f4efe6;
}
[data-theme="rock"] .hero .kicker,
[data-theme="rock"] .hero .muted,
[data-theme="rock"] .hero .small { color: #f4efe6; }
[data-theme="rock"] .btn {
  background: #e10600;
  color: #fff8ef;
  border-radius: 8px;
}
[data-theme="rock"] .btn.ghost {
  background: #14161c;
  color: #f4efe6;
}
[data-theme="rock"] .btn.gold {
  background: linear-gradient(180deg, #f5b301, #e10600);
  color: #1a1208;
}
[data-theme="rock"] .chip { background: #14161c; color: #f4efe6; }
[data-theme="rock"] .chip.on { background: #e10600; color: #fff8ef; }
[data-theme="rock"] .field { background: #12141a; color: #f4efe6; }
[data-theme="rock"] .nav button.on { color: #f5b301; }
[data-theme="rock"] .day-cell { background: #14161c; color: #f4efe6; }
[data-theme="rock"] .day-cell.today { background: #f5b301; color: #1a1208; }
[data-theme="rock"] .day-cell.on { background: #e10600; color: #fff8ef; }

[data-theme="classic"] {
  --paper: #f4efe6;
  --paper-2: #e7dfd2;
  --ink: #1c2430;
  --muted: #6e655b;
  --gold: #8c734a;
  --cadmium: #6e5833;
  --card: #fffdf8;
  --stroke: #1c2430;
  --fill: #1c2430;
  --on-fill: #f7f1e6;
  --nav-bg: rgba(244, 239, 230, 0.96);
  --line: rgba(28, 36, 48, 0.12);
  color-scheme: light;
}
[data-theme="classic"] body {
  font-family: Outfit, Nunito, sans-serif;
  background:
    radial-gradient(800px 380px at 100% -10%, rgba(140, 115, 74, 0.18), transparent 55%),
    radial-gradient(600px 320px at -10% 0%, rgba(28, 36, 48, 0.06), transparent 50%),
    #f4efe6;
}
[data-theme="classic"] h1,
[data-theme="classic"] h2,
[data-theme="classic"] h3,
[data-theme="classic"] .subject b,
[data-theme="classic"] .timer,
[data-theme="classic"] .theme-copy b {
  font-family: "Cormorant Garamond", Fraunces, serif;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
[data-theme="classic"] .card,
[data-theme="classic"] .hero,
[data-theme="classic"] .subject,
[data-theme="classic"] .field,
[data-theme="classic"] .chip,
[data-theme="classic"] .btn,
[data-theme="classic"] .day-cell,
[data-theme="classic"] .theme-card {
  border-width: 1px;
  border-color: #c4b49a;
  box-shadow: 0 12px 28px rgba(28, 36, 48, 0.08);
}
[data-theme="classic"] .card,
[data-theme="classic"] .hero,
[data-theme="classic"] .subject,
[data-theme="classic"] .field,
[data-theme="classic"] .day-cell { border-radius: 16px; }
[data-theme="classic"] .hero {
  background: linear-gradient(165deg, #fffdf8 0%, #e7d7b8 100%);
  color: #1c2430;
}
[data-theme="classic"] .hero .kicker,
[data-theme="classic"] .hero .muted,
[data-theme="classic"] .hero .small { color: #1c2430; }
[data-theme="classic"] .btn {
  background: #1c2430;
  color: #f7f1e6;
  border-color: #1c2430;
  box-shadow: none;
}
[data-theme="classic"] .btn.ghost {
  background: transparent;
  color: #1c2430;
  border-color: #c4b49a;
}
[data-theme="classic"] .btn.gold {
  background: #8c734a;
  color: #fffdf8;
}
[data-theme="classic"] .chip { background: #fffdf8; }
[data-theme="classic"] .chip.on { background: #1c2430; color: #f7f1e6; border-color: #1c2430; }
[data-theme="classic"] .field { background: #fffdf8; }
[data-theme="classic"] .nav { border-top-color: #c4b49a; }
[data-theme="classic"] .nav button.on { color: #8c734a; }
[data-theme="classic"] .day-cell.today { background: #e7d7b8; }
[data-theme="classic"] .day-cell.on { background: #1c2430; color: #f7f1e6; }

