:root {
  --bg: #0a0c13;
  --p1: #11141f;
  --p2: #181c2b;
  --line: rgba(255,255,255,.09);
  --tx: #edf0f9;
  --tx2: #8e96ac;
  --br1: #8b5cf6;
  --br2: #22d3ee;
  --hot: #ff4d8d;
  --ok: #34d399;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--tx);
  font-family: Manrope, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; border: 0; }
a { color: inherit; }
::selection { background: rgba(139,92,246,.4); }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 14px;
  font-weight: 700; font-size: .92rem;
  background: var(--p2); color: var(--tx);
  border: 1px solid var(--line);
  transition: transform .15s, filter .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,.22); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--br1), #6d3ef0 55%, var(--br2));
  border: 0; color: #fff;
  box-shadow: 0 8px 28px rgba(139,92,246,.35);
}
.btn.hot {
  background: linear-gradient(135deg, var(--hot), #ff7a45);
  border: 0; color: #fff;
}
.btn.sm { padding: 8px 13px; border-radius: 11px; font-size: .84rem; }
.btn.ghost { background: transparent; }

#landing { min-height: 100dvh; overflow-x: hidden; position: relative; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; pointer-events: none; z-index: 0; }
.blob.b1 { width: 480px; height: 480px; background: #6d3ef0; top: -160px; left: -120px; }
.blob.b2 { width: 420px; height: 420px; background: #0e7490; top: 60px; right: -140px; }
.blob.b3 { width: 380px; height: 380px; background: #9d174d; top: 640px; left: 40%; opacity: .35; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.nav { display: flex; align-items: center; gap: 14px; padding: 18px 0; }
.logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: Unbounded, sans-serif; font-weight: 700; font-size: 1.02rem;
  letter-spacing: .02em; text-decoration: none;
}
.logo .ic {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--br1), var(--br2));
  font-size: 1rem; color: #fff;
}
.nav .spacer { flex: 1; }
.hero { padding: 56px 0 30px; text-align: center; }
.hero .pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: rgba(139,92,246,.14); border: 1px solid rgba(139,92,246,.35);
  color: #c4b5fd; margin-bottom: 22px;
}
.hero h1 {
  font-family: Unbounded, sans-serif; font-weight: 900;
  font-size: clamp(1.9rem, 5.4vw, 3.6rem);
  line-height: 1.12; margin: 0 0 18px; letter-spacing: -.01em;
}
.hero h1 .grad {
  background: linear-gradient(92deg, #a78bfa 5%, #22d3ee 50%, #ff4d8d 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.sub {
  color: var(--tx2); font-size: clamp(1rem, 2vw, 1.18rem);
  max-width: 640px; margin: 0 auto 30px; line-height: 1.55;
}
.hero .cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .btn.primary { padding: 15px 28px; font-size: 1.02rem; border-radius: 16px; }
.stats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.stat {
  min-width: 140px; flex: 1 1 140px; max-width: 240px; padding: 14px 20px; border-radius: 16px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.stat b { display: block; font-family: Unbounded, sans-serif; font-size: 1.3rem; }
.stat span { color: var(--tx2); font-size: .8rem; font-weight: 600; }
.stat.live {
  flex: 1 1 170px;
  border-color: rgba(139, 92, 246, .45);
  background: linear-gradient(180deg, rgba(139, 92, 246, .18), rgba(255, 255, 255, .04));
  box-shadow: 0 10px 28px rgba(139, 92, 246, .18);
}
.stat.live b {
  background: linear-gradient(92deg, #a78bfa 5%, #22d3ee 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-title {
  font-family: Unbounded, sans-serif; font-weight: 700;
  font-size: clamp(1.2rem, 3vw, 1.7rem); text-align: center; margin: 70px 0 8px;
}
.section-sub { text-align: center; color: var(--tx2); margin: 0 0 30px; }
.showcase {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; padding-bottom: 10px;
}
.mini-card {
  border-radius: 18px; border: 1px solid var(--line);
  background: var(--p1); overflow: hidden; cursor: pointer;
  transition: transform .18s, border-color .18s, box-shadow .18s;
  text-align: left; padding: 0; color: inherit;
}
.mini-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139,92,246,.55);
  box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.mini-clip { height: 190px; overflow: hidden; position: relative; pointer-events: none; }
.mini-clip .sheet {
  transform: scale(.36); transform-origin: top left;
  position: absolute; top: 12px; left: 12px;
  width: 700px !important; min-height: 0 !important;
  box-shadow: none;
}
.mini-clip .s-grid {
  display: grid !important;
  grid-template-columns: 52px repeat(5, 1fr);
  gap: 4px;
}
.mini-meta { padding: 12px 14px; display: flex; align-items: center; gap: 8px; }
.mini-meta b { font-size: .92rem; }
.mini-meta span { color: var(--tx2); font-size: .78rem; margin-left: auto; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.step { padding: 22px; border-radius: 18px; background: var(--p1); border: 1px solid var(--line); }
.step .n {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-family: Unbounded, sans-serif; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--br1), var(--br2)); margin-bottom: 14px;
}
.step b { display: block; margin-bottom: 6px; font-size: 1.02rem; }
.step p { margin: 0; color: var(--tx2); font-size: .9rem; line-height: 1.5; }
.donate-band {
  margin: 70px 0 0; padding: 30px; border-radius: 22px; text-align: center;
  background: linear-gradient(135deg, rgba(255,77,141,.13), rgba(255,122,69,.1));
  border: 1px solid rgba(255,77,141,.3);
}
.donate-band b { font-family: Unbounded, sans-serif; font-size: 1.15rem; display: block; margin-bottom: 8px; }
.donate-band p { color: var(--tx2); margin: 0 0 18px; }
footer.site {
  margin-top: 60px; padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  color: var(--tx2); font-size: .86rem;
}
footer.site .spacer { flex: 1; }
footer.site a { text-decoration: none; border-bottom: 1px dashed rgba(142,150,172,.4); }

#editor { display: none; flex-direction: column; height: 100dvh; }
body.mode-edit { overflow: hidden; }
body.mode-edit #landing { display: none; }
body.mode-edit #editor { display: flex; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: rgba(13,16,26,.85); backdrop-filter: blur(10px);
  flex-wrap: wrap;
}
.topbar .logo { font-size: .92rem; }
.topbar .spacer { flex: 1; }
.workspace { flex: 1; display: grid; grid-template-columns: 330px 1fr; min-height: 0; }
.side { overflow-y: auto; padding: 16px; border-right: 1px solid var(--line); background: var(--p1); }
.grp { margin-bottom: 22px; }
.grp > label {
  display: block; font-size: .7rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; color: var(--tx2);
  margin-bottom: 10px;
}
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg button {
  padding: 10px; border-radius: 12px; font-weight: 700; font-size: .88rem;
  background: var(--p2); color: var(--tx2); border: 1px solid var(--line);
}
.seg button.active {
  background: linear-gradient(135deg, var(--br1), #6d3ef0);
  color: #fff; border-color: transparent;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: .82rem;
  background: var(--p2); color: var(--tx2); border: 1px solid var(--line);
}
.chip.on { background: rgba(34,211,238,.16); border-color: rgba(34,211,238,.5); color: #67e8f9; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 38px; height: 38px; border-radius: 12px; font-size: 1.1rem; font-weight: 800;
  background: var(--p2); color: var(--tx); border: 1px solid var(--line);
}
.stepper b { font-family: Unbounded, sans-serif; min-width: 30px; text-align: center; }
.stepper span { color: var(--tx2); font-size: .8rem; }
.hint { color: var(--tx2); font-size: .78rem; line-height: 1.45; margin-top: 8px; }
.check {
  display: flex; align-items: center; gap: 10px; font-size: .88rem; font-weight: 600;
  padding: 6px 0; cursor: pointer;
}
.check input { width: 17px; height: 17px; accent-color: var(--br1); }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tbtn {
  padding: 11px 12px; border-radius: 13px; text-align: left;
  background: var(--p2); border: 1px solid var(--line); color: var(--tx);
  display: flex; flex-direction: column; gap: 7px;
  transition: border-color .15s, transform .15s;
}
.tbtn:hover { transform: translateY(-1px); }
.tbtn.active { border-color: var(--br1); box-shadow: 0 0 0 1px var(--br1); }
.tbtn .nm { font-weight: 700; font-size: .84rem; }
.tbtn .sw { display: flex; gap: 4px; }
.tbtn .sw i { width: 14px; height: 14px; border-radius: 5px; border: 1px solid rgba(255,255,255,.15); }
.custom-panel {
  border: 1px dashed rgba(139,92,246,.5); border-radius: 14px; padding: 12px;
  display: none; background: rgba(139,92,246,.05);
}
.custom-panel.show { display: block; }
.crow { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 5px 0; font-size: .85rem; font-weight: 600; }
.crow input[type=color] {
  width: 44px; height: 30px; border-radius: 8px; border: 1px solid var(--line);
  background: none; padding: 2px; cursor: pointer;
}
.crow select, .crow input[type=text] {
  background: var(--p2); border: 1px solid var(--line); color: var(--tx);
  border-radius: 9px; padding: 7px 9px; font: inherit; font-size: .84rem; max-width: 150px;
}
.crow input[type=range] { width: 140px; accent-color: var(--br1); }
.side select.wide, .side textarea.wide, .side input.wide {
  width: 100%; background: var(--p2); border: 1px solid var(--line); color: var(--tx);
  border-radius: 12px; padding: 10px 12px; font: inherit; font-size: .88rem;
}
.side textarea.wide { min-height: 88px; resize: vertical; margin-top: 8px; }
.side .btn { width: 100%; justify-content: center; margin-top: 8px; }
.slot-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.slot-btns .btn { width: auto; flex: 1; min-width: 92px; margin: 0; padding: 8px 10px; font-size: .78rem; }
.tcard {
  border: 1px solid var(--line); border-radius: 12px; padding: 10px;
  margin-bottom: 8px; background: var(--p2);
}
.tcard .top { display: flex; align-items: center; gap: 8px; }
.tcard .top strong { flex: 1; font-size: .8rem; }
.tcard .top button { width: 30px; height: 30px; margin: 0; padding: 0; border-radius: 8px; }
.tcard input[type=text], .tcard textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--tx);
  border-radius: 8px; padding: 7px 9px; font: inherit; font-size: .82rem; margin-top: 6px;
}
.tcard textarea { min-height: 52px; resize: vertical; }
.tcard .row2 { display: grid; grid-template-columns: 1fr 44px; gap: 8px; margin-top: 6px; align-items: center; }
.tcard input[type=color] {
  width: 44px; height: 32px; padding: 2px; border-radius: 8px;
  border: 1px solid var(--line); background: none; cursor: pointer;
}
.slot-list { display: grid; gap: 6px; margin-top: 10px; }
.slot-row {
  display: grid; grid-template-columns: 22px 22px 1fr auto auto; gap: 6px; align-items: center;
  background: var(--p2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px;
  font-size: .78rem; font-weight: 700;
}
.slot-row span { color: var(--tx2); font-weight: 600; }
.slot-row select {
  background: var(--bg); border: 1px solid var(--line); color: var(--tx);
  border-radius: 8px; padding: 4px 6px; font: inherit; font-size: .75rem;
}
.slot-row button { width: 28px; height: 28px; margin: 0; padding: 0; border-radius: 8px; background: var(--bg); color: var(--tx); border: 1px solid var(--line); }
.stage {
  overflow: auto; padding: 30px 24px 60px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 0) 0 0 / 26px 26px,
    var(--bg);
}
.week-tabs { display: none; gap: 8px; flex-wrap: wrap; justify-content: center; }
.week-tabs.show { display: flex; }
.week-tabs button {
  padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: .84rem;
  background: var(--p2); color: var(--tx2); border: 1px solid var(--line);
}
.week-tabs button.active { background: rgba(34,211,238,.16); border-color: rgba(34,211,238,.55); color: #67e8f9; }

.sheet {
  --s-bg: #f7f7f8;
  --s-card: #ffffff;
  --s-ink: #16181d;
  --s-mut: #6b7280;
  --s-acc: #6366f1;
  --s-line: rgba(22,24,29,.1);
  --s-rad: 18px;
  --s-hfont: Manrope, sans-serif;
  --s-font: Manrope, sans-serif;
  width: 780px;
  background: var(--s-bg);
  color: var(--s-ink);
  font-family: var(--s-font);
  border-radius: 26px;
  padding: 30px;
  display: flex; flex-direction: column; gap: 18px;
  position: relative; overflow: hidden;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
  flex-shrink: 0;
}
.s-head { position: relative; z-index: 2; }
.s-tagrow { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.s-tag {
  font-size: .68rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase;
  color: var(--s-acc);
}
.s-badge {
  font-size: .64rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  background: var(--s-acc); color: var(--s-bg);
}
.s-title {
  font-family: var(--s-hfont); font-weight: 800; font-size: 2rem;
  margin: 0; line-height: 1.1; outline: none;
}
.s-sub { color: var(--s-mut); font-size: .92rem; margin-top: 5px; outline: none; }
.s-grid { display: flex; flex-direction: column; gap: 7px; position: relative; z-index: 2; --days: 5; }
.s-headrow, .s-row {
  display: grid;
  grid-template-columns: 52px repeat(var(--days), minmax(0, 1fr));
  gap: 7px;
  align-items: stretch;
}
.s-row { border-radius: calc(var(--s-rad) * .45); }
.s-row.is-drag, .slot-row.is-drag, .tcard.is-drag { opacity: .38; }
.s-row.is-over { box-shadow: 0 0 0 2px var(--s-acc); }
.slot-row.is-over, .tcard.is-over { border-color: var(--br1); box-shadow: 0 0 0 1px var(--br1); }
.grip {
  display: flex; align-items: center; justify-content: center;
  letter-spacing: -.2em; font-size: .85rem; line-height: 1;
  color: var(--s-mut); cursor: grab; touch-action: none; user-select: none;
  -webkit-user-select: none;
}
.s-num .grip { width: 100%; height: 14px; margin-bottom: 1px; }
.slot-row .grip, .tcard .grip {
  width: 22px; height: 28px; color: var(--tx2); flex-shrink: 0;
}
.grip:active, .s-num:active .grip { cursor: grabbing; }
.drag-ghost {
  position: fixed; z-index: 220; pointer-events: none;
  opacity: .92; margin: 0 !important;
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
  transform: rotate(1.2deg);
}
.s-row.drag-ghost { background: color-mix(in srgb, var(--s-card) 80%, transparent); padding: 2px; }
body.is-sorting { cursor: grabbing; user-select: none; -webkit-user-select: none; }
body.is-sorting * { cursor: grabbing !important; }
.exporting .grip { display: none !important; }
.s-corner {
  display: grid; place-items: center;
  font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--s-mut);
}
.s-dayh {
  padding: 10px 4px; text-align: center;
  font-weight: 800; font-size: .78rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--s-acc);
  background: var(--s-dayh-bg, transparent);
  border-radius: calc(var(--s-rad) * .55);
}
.s-num {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--s-mut); cursor: grab; touch-action: none; user-select: none;
}
.s-num b { font-family: var(--s-hfont); font-size: 1rem; color: var(--s-ink); }
.s-time { font-size: .66rem; font-weight: 700; outline: none; white-space: nowrap; cursor: text; user-select: text; -webkit-user-select: text; }
.s-cell {
  background: var(--s-card);
  border: 1px solid var(--s-line);
  border-radius: calc(var(--s-rad) * .55);
  padding: 8px 10px; min-height: 52px;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  font-size: .82rem; font-weight: 800; line-height: 1.25;
  outline: none;
  transition: box-shadow .12s, background .15s;
  word-break: break-word;
}
.s-subj, .s-note { outline: none; word-break: break-word; display: block; min-width: 0; max-width: 100%; }
.s-subj {
  font-weight: 800; font-size: .9rem; line-height: 1.22;
  min-height: 1.1em; flex: 0 0 auto;
}
.s-note {
  font-weight: 500; font-size: .68rem; line-height: 1.2;
  color: var(--s-mut);
}
.s-subj:empty::before { content: "+"; color: var(--s-mut); opacity: .35; font-weight: 800; }
.s-note:empty { display: none; }
.s-cell:focus-within .s-note:empty { display: block; min-height: 1em; }
.s-note:empty::before { content: none; }
.s-cell:focus-within .s-note:empty::before { content: "каб. / учитель"; opacity: .38; font-weight: 500; }
.s-cell:focus-within, .s-title:focus, .s-sub:focus, .s-time:focus {
  box-shadow: 0 0 0 2px var(--s-acc);
  border-radius: calc(var(--s-rad) * .55);
}
.exporting .s-subj:empty::before, .exporting .s-note:empty::before { content: none; }
.exporting .s-note:empty { display: none !important; min-height: 0; }
.exporting .s-cell:focus-within, .exporting .s-title:focus, .exporting .s-sub:focus, .exporting .s-time:focus { box-shadow: none; }
.s-cell.cat-empty { background: color-mix(in srgb, var(--s-card) 55%, transparent); border-style: dashed; color: var(--s-mut); }
.s-cell.cat-math { background: color-mix(in srgb, #22c55e 34%, var(--s-card)); }
.s-cell.cat-rus { background: color-mix(in srgb, #3b82f6 34%, var(--s-card)); }
.s-cell.cat-lit { background: color-mix(in srgb, #a855f7 34%, var(--s-card)); }
.s-cell.cat-eng { background: color-mix(in srgb, #f59e0b 36%, var(--s-card)); }
.s-cell.cat-pe { background: color-mix(in srgb, #ef4444 32%, var(--s-card)); }
.s-cell.cat-sci { background: color-mix(in srgb, #14b8a6 34%, var(--s-card)); }
.s-cell.cat-hist { background: color-mix(in srgb, #d97706 34%, var(--s-card)); }
.s-cell.cat-art { background: color-mix(in srgb, #fb7185 34%, var(--s-card)); }
.s-cell.cat-it { background: color-mix(in srgb, #6366f1 36%, var(--s-card)); }
.s-cell.cat-tech { background: color-mix(in srgb, #a16207 32%, var(--s-card)); }
.s-cell.cat-hum { background: color-mix(in srgb, #64748b 28%, var(--s-card)); }
.s-cell.cat-p0 { background: color-mix(in srgb, #f472b6 32%, var(--s-card)); }
.s-cell.cat-p1 { background: color-mix(in srgb, #22d3ee 32%, var(--s-card)); }
.s-cell.cat-p2 { background: color-mix(in srgb, #a3e635 32%, var(--s-card)); }
.s-cell.cat-p3 { background: color-mix(in srgb, #c084fc 32%, var(--s-card)); }
.s-cell.cat-p4 { background: color-mix(in srgb, #fb923c 32%, var(--s-card)); }
.s-cell.cat-p5 { background: color-mix(in srgb, #38bdf8 32%, var(--s-card)); }
.s-cell.cat-p6 { background: color-mix(in srgb, #facc15 32%, var(--s-card)); }
.s-cell.cat-p7 { background: color-mix(in srgb, #818cf8 32%, var(--s-card)); }
.s-extra {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  position: relative; z-index: 2;
}
.s-box {
  background: var(--s-card);
  border: 1px solid var(--s-line);
  border-radius: calc(var(--s-rad) * .7);
  padding: 12px 14px;
}
.s-box h3 {
  margin: 0 0 10px; text-align: center;
  font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--s-acc);
}
.s-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.s-rules li {
  display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start;
  font-size: .78rem; line-height: 1.35; color: var(--s-ink);
}
.s-rules .n {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--s-acc); color: var(--s-bg); font-size: .65rem; font-weight: 800;
}
.s-teachers { display: grid; gap: 7px; }
.s-teach {
  display: grid; grid-template-columns: 5px 1fr auto; gap: 8px; align-items: center;
}
.s-teach .bar { width: 5px; height: 28px; border-radius: 99px; background: var(--s-acc); }
.s-teach strong { display: block; font-size: .82rem; }
.s-teach em { display: block; font-style: normal; font-size: .72rem; color: var(--s-mut); font-weight: 600; }
.s-teach .room {
  font-size: .68rem; font-weight: 800; color: var(--s-acc); white-space: nowrap;
  background: color-mix(in srgb, var(--s-acc) 16%, var(--s-card));
  padding: 4px 8px; border-radius: 999px;
}
.s-span {
  grid-column: 2 / -1;
  display: flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 8px 12px;
  border-radius: calc(var(--s-rad) * .55);
  font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  font-size: .85rem; outline: none; border: 1px solid var(--s-line);
}
.s-span:focus { box-shadow: 0 0 0 2px var(--s-acc); }
.s-span.kind-break {
  min-height: 26px; font-size: .78rem; letter-spacing: .06em;
  background: color-mix(in srgb, var(--s-mut) 18%, var(--s-card));
  color: var(--s-mut);
}
.s-span.kind-meal {
  background: color-mix(in srgb, #f59e0b 38%, var(--s-card));
  color: var(--s-ink);
}
.s-span.kind-walk {
  background: var(--s-acc); color: var(--s-bg); min-height: 40px; gap: 10px;
  text-transform: none; letter-spacing: 0;
}
.s-num .mini { font-size: .52rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--s-acc); }
.s-foot {
  display: flex; justify-content: flex-end; position: relative; z-index: 2;
  font-size: .68rem; font-weight: 700; color: var(--s-mut); opacity: .8;
}
.sheet.fmt-phone .s-extra, .sheet.fmt-story .s-extra { grid-template-columns: 1fr; }
.sheet.fmt-phone .s-box, .sheet.fmt-story .s-box { padding: 8px 10px; }
.sheet.fmt-phone .s-rules li, .sheet.fmt-phone .s-teach strong { font-size: .62rem; }
.sheet.no-wm .s-foot { display: none; }
.s-decor { position: absolute; inset: 0; pointer-events: none; z-index: 1; font-size: 1.4rem; }
.s-decor i { position: absolute; font-style: normal; opacity: .9; }
.s-decor i:nth-child(1) { top: 22px; right: 28px; }
.s-decor i:nth-child(2) { bottom: 48px; left: 20px; transform: rotate(-14deg); font-size: 1.1rem; }
.s-decor i:nth-child(3) { top: 46%; right: 12px; transform: rotate(12deg); font-size: .9rem; opacity: .5; }

.sheet.fmt-phone { width: 430px; min-height: 932px; justify-content: center; padding: 26px 20px; }
.sheet.fmt-phone .s-cell { font-size: .68rem; padding: 7px 6px; min-height: 42px; }
.sheet.fmt-phone .s-subj { font-size: .72rem; }
.sheet.fmt-phone .s-note { font-size: .56rem; }
.sheet.fmt-phone .s-dayh { font-size: .6rem; padding: 8px 2px; letter-spacing: .03em; }
.sheet.fmt-phone .s-title { font-size: 1.5rem; }
.sheet.fmt-phone .s-time { font-size: .56rem; }
.sheet.fmt-phone .s-grid { gap: 5px; }
.sheet.fmt-story { width: 540px; min-height: 960px; justify-content: center; }
.sheet.fmt-story .s-cell { font-size: .78rem; padding: 8px; }
.sheet.fmt-story .s-dayh { font-size: .66rem; }
.sheet.fmt-post { width: 540px; min-height: 675px; justify-content: center; }
.sheet.fmt-post .s-cell { font-size: .76rem; padding: 8px; min-height: 40px; }
.sheet.fmt-post .s-dayh { font-size: .66rem; }
.sheet.fmt-a4 { width: 794px; min-height: 1123px; border-radius: 0; justify-content: center; }
.sheet.fmt-auto {
  width: 1123px; height: 794px;
  aspect-ratio: 297 / 210;
  padding: 18px 22px 14px; gap: 10px;
  box-sizing: border-box;
}
.sheet.fmt-auto .s-title { font-size: 1.55rem; }
.sheet.fmt-auto .s-sub { font-size: .84rem; }
.sheet.fmt-auto .s-head { flex: 0 0 auto; }
.sheet.fmt-auto .s-extra {
  flex: 0 1 auto; max-height: 30%; min-height: 0; overflow: auto;
  gap: 8px;
}
.sheet.fmt-auto .s-box { padding: 8px 10px; }
.sheet.fmt-auto .s-box h3 { margin-bottom: 6px; }
.sheet.fmt-auto .s-rules { gap: 4px; }
.sheet.fmt-auto .s-rules li { font-size: .7rem; }
.sheet.fmt-auto .s-teach strong { font-size: .74rem; }
.sheet.fmt-auto .s-teach em { font-size: .64rem; }
.sheet.fmt-auto .s-grid { flex: 1 1 auto; min-height: 0; gap: 5px; }
.sheet.fmt-auto .s-headrow { flex: 0 0 auto; }
.sheet.fmt-auto .s-row { flex: 1 1 auto; min-height: 36px; }
.sheet.fmt-auto .s-cell,
.sheet.fmt-auto .s-num,
.sheet.fmt-auto .s-span { min-height: 0; height: 100%; }
.sheet.fmt-auto .s-cell { padding: 5px 8px; overflow: visible; }
.sheet.fmt-auto .s-subj { font-size: .82rem; }
.sheet.fmt-auto .s-note { font-size: .62rem; }
.sheet.fmt-auto .s-dayh { padding: 6px 4px; }
.sheet.fmt-auto .s-foot { flex: 0 0 auto; }

.th-y2k {
  --s-bg: linear-gradient(135deg, #ffd6f5 0%, #e3d4ff 45%, #cfe6ff 100%);
  --s-card: rgba(255,255,255,.72);
  --s-ink: #3b1d4f;
  --s-mut: #8a6aa5;
  --s-acc: #ff2fb3;
  --s-line: rgba(255,47,179,.28);
  --s-rad: 20px;
  --s-hfont: Unbounded, sans-serif;
  --s-dayh-bg: rgba(255,255,255,.5);
  background: var(--s-bg);
}
.th-y2k .s-title {
  background: linear-gradient(180deg, #7b2ff7, #ff2fb3);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.th-y2k .s-cell { backdrop-filter: blur(4px); border-width: 1.5px; }
.th-y2k .s-badge { color: #fff; }

.th-neon {
  --s-bg: #0b0614;
  --s-card: rgba(255,255,255,.045);
  --s-ink: #eafffa;
  --s-mut: #7d8aa3;
  --s-acc: #00ffc8;
  --s-line: rgba(0,255,200,.3);
  --s-rad: 14px;
  --s-hfont: "Space Grotesk", sans-serif;
  --s-font: "Space Grotesk", sans-serif;
  background:
    radial-gradient(ellipse 60% 40% at 80% 0%, rgba(176,38,255,.25), transparent 60%),
    radial-gradient(ellipse 50% 35% at 10% 100%, rgba(0,255,200,.14), transparent 60%),
    #0b0614;
}
.th-neon .s-title { color: #00ffc8; text-shadow: 0 0 22px rgba(0,255,200,.55); }
.th-neon .s-dayh { text-shadow: 0 0 14px rgba(0,255,200,.5); }
.th-neon .s-cell { box-shadow: inset 0 0 18px rgba(176,38,255,.07); }
.th-neon .s-badge { color: #0b0614; }

.th-kawaii {
  --s-bg: #fff0f6;
  --s-card: #ffffff;
  --s-ink: #5b3a4a;
  --s-mut: #b98da0;
  --s-acc: #ff7fab;
  --s-line: rgba(255,127,171,.3);
  --s-rad: 24px;
  --s-dayh-bg: #ffe1ec;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,209,232,.8) 0 42px, transparent 43px),
    radial-gradient(circle at 88% 8%, rgba(209,231,255,.8) 0 34px, transparent 35px),
    radial-gradient(circle at 92% 78%, rgba(255,244,199,.9) 0 38px, transparent 39px),
    #fff0f6;
}
.th-kawaii .s-dayh:nth-of-type(2n) { background: #dcefff; color: #4d7fb5; }
.th-kawaii .s-dayh:nth-of-type(3n) { background: #fff3cd; color: #ad8b2d; }
.th-kawaii .s-cell { border-width: 2px; border-style: dashed; }
.th-kawaii .s-badge { color: #fff; }

.th-notebook {
  --s-bg: #fdfcf5;
  --s-card: rgba(255,255,255,.35);
  --s-ink: #1e3a8a;
  --s-mut: #7c8db0;
  --s-acc: #d23c3c;
  --s-line: rgba(30,58,138,.35);
  --s-rad: 4px;
  --s-hfont: Caveat, cursive;
  --s-font: Caveat, cursive;
  background:
    linear-gradient(rgba(96,165,250,.18) 1px, transparent 1px) 0 0 / 100% 24px,
    linear-gradient(90deg, rgba(96,165,250,.18) 1px, transparent 1px) 0 0 / 24px 100%,
    linear-gradient(90deg, transparent 54px, rgba(210,60,60,.5) 54px 55px, transparent 55px),
    #fdfcf5;
}
.th-notebook .s-title { font-size: 2.5rem; font-weight: 700; }
.th-notebook .s-sub, .th-notebook .s-cell { font-size: 1.18rem; }
.th-notebook .s-subj { font-weight: 800; }
.th-notebook .s-note { font-size: .78rem; font-weight: 500; }
.th-notebook .s-cell { border: none; border-bottom: 2px solid rgba(30,58,138,.3); border-radius: 0; }
.th-notebook .s-dayh { font-family: Caveat, cursive; font-size: 1.25rem; text-transform: none; letter-spacing: 0; }
.th-notebook .s-time { font-size: .9rem; }
.th-notebook .s-badge { color: #fff; }

.th-brutal {
  --s-bg: #f4f1ea;
  --s-card: #ffffff;
  --s-ink: #0a0a0a;
  --s-mut: #555;
  --s-acc: #ff3b00;
  --s-line: #0a0a0a;
  --s-rad: 0px;
  --s-hfont: Unbounded, sans-serif;
  --s-font: "Space Grotesk", sans-serif;
  border: 3px solid #0a0a0a;
  border-radius: 0;
}
.th-brutal .s-cell { border-width: 2px; box-shadow: 3px 3px 0 #0a0a0a; }
.th-brutal .s-dayh { background: #0a0a0a; color: #f4f1ea; border-radius: 0; }
.th-brutal .s-title { text-transform: uppercase; }
.th-brutal .s-badge { border-radius: 0; color: #fff; }

.th-academia {
  --s-bg: #efe5cf;
  --s-card: #f8f1de;
  --s-ink: #382a1e;
  --s-mut: #8a7a64;
  --s-acc: #7a2020;
  --s-line: rgba(56,42,30,.22);
  --s-rad: 8px;
  --s-hfont: "Cormorant Garamond", serif;
  --s-font: "Cormorant Garamond", serif;
  background:
    radial-gradient(ellipse 90% 70% at 50% 0%, rgba(122,32,32,.06), transparent 70%),
    #efe5cf;
  border: 1px solid rgba(56,42,30,.35);
  outline: 1px solid rgba(56,42,30,.35);
  outline-offset: -8px;
}
.th-academia .s-title { font-size: 2.4rem; font-style: italic; font-weight: 600; }
.th-academia .s-cell { font-size: 1.02rem; }
.th-academia .s-subj { font-weight: 800; }
.th-academia .s-note { font-size: .72rem; font-weight: 500; }
.th-academia .s-dayh { font-size: .9rem; letter-spacing: .14em; }
.th-academia .s-badge { color: #efe5cf; }

.th-glass {
  --s-bg: linear-gradient(130deg, #5b21b6, #2563eb 48%, #db2777);
  --s-card: rgba(255,255,255,.14);
  --s-ink: #ffffff;
  --s-mut: rgba(255,255,255,.65);
  --s-acc: #fde68a;
  --s-line: rgba(255,255,255,.25);
  --s-rad: 20px;
  background: linear-gradient(130deg, #5b21b6, #2563eb 48%, #db2777);
}
.th-glass .s-cell { backdrop-filter: blur(8px); }
.th-glass .s-badge { color: #5b21b6; }

.th-sticker {
  --s-bg: #fef9c3;
  --s-card: #ffffff;
  --s-ink: #1f2937;
  --s-mut: #92890f;
  --s-acc: #16a34a;
  --s-line: #1f2937;
  --s-rad: 14px;
  --s-hfont: Unbounded, sans-serif;
  background:
    radial-gradient(circle at 1.5px 1.5px, rgba(31,41,55,.16) 1.5px, transparent 0) 0 0 / 20px 20px,
    #fef9c3;
}
.th-sticker .s-cell { border-width: 2px; box-shadow: 2px 3px 0 rgba(31,41,55,.9); transform: rotate(-.3deg); }
.th-sticker .s-cell:nth-child(2n) { transform: rotate(.4deg); }
.th-sticker .s-dayh { background: #1f2937; color: #fef9c3; border-radius: 999px; }
.th-sticker .s-badge { color: #fff; }

.th-vapor {
  --s-bg: #16082b;
  --s-card: rgba(12, 4, 28, .55);
  --s-ink: #fff7fb;
  --s-mut: #f9a8d4;
  --s-acc: #67e8f9;
  --s-line: rgba(103,232,249,.28);
  --s-rad: 18px;
  --s-hfont: Unbounded, sans-serif;
  background:
    linear-gradient(180deg, rgba(103,232,249,.0) 42%, rgba(236,72,153,.45) 72%, rgba(251,191,36,.7) 100%),
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(168,85,247,.45), transparent 60%),
    #16082b;
}
.th-vapor .s-title {
  background: linear-gradient(90deg, #67e8f9, #f0abfc, #fde68a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.th-vapor .s-dayh { text-shadow: 0 0 16px rgba(103,232,249,.5); }
.th-vapor .s-badge { color: #16082b; }

.pat-dots { background-image: radial-gradient(circle at 1.5px 1.5px, var(--s-line) 1.5px, transparent 0) !important; background-size: 22px 22px !important; background-color: var(--s-bg-c, #fff) !important; }
.pat-grid { background-image: linear-gradient(var(--s-line) 1px, transparent 1px), linear-gradient(90deg, var(--s-line) 1px, transparent 1px) !important; background-size: 24px 24px !important; background-color: var(--s-bg-c, #fff) !important; }
.pat-lines { background-image: linear-gradient(var(--s-line) 1px, transparent 1px) !important; background-size: 100% 26px !important; background-color: var(--s-bg-c, #fff) !important; }

#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(80px);
  background: #1c2233; color: var(--tx); border: 1px solid var(--line);
  padding: 13px 22px; border-radius: 14px; font-weight: 700; font-size: .9rem;
  box-shadow: 0 16px 50px rgba(0,0,0,.5); z-index: 90;
  transition: transform .25s ease; pointer-events: none; max-width: 90vw; text-align: center;
}
#toast.show { transform: translateX(-50%) translateY(0); }

.modal {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(6,8,14,.72); backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 20px;
}
.modal[hidden] { display: none !important; }
.modal-card {
  width: min(420px, 100%);
  background: #141824; border: 1px solid var(--line); border-radius: 22px;
  padding: 26px 24px; text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}
.modal-card h3 { font-family: Unbounded, sans-serif; margin: 0 0 10px; font-size: 1.15rem; }
.modal-card p { color: var(--tx2); margin: 0 0 18px; line-height: 1.5; }
.modal-card .btn { width: 100%; margin-top: 8px; }

@media (max-width: 940px) {
  .workspace { display: flex; flex-direction: column; overflow: auto; }
  .side { border-right: 0; border-top: 1px solid var(--line); order: 2; overflow: visible; }
  .stage { order: 1; padding: 16px 10px 24px; overflow-x: auto; align-items: flex-start; -webkit-overflow-scrolling: touch; }
  .sheet { width: 680px; }
  .sheet.fmt-auto { width: 1123px; height: 794px; }
  .s-extra { grid-template-columns: 1fr; }
  .sheet.fmt-phone, .sheet.fmt-story, .sheet.fmt-post, .sheet.fmt-a4 { width: 680px; min-height: 0; }
  #editor { height: auto; min-height: 100dvh; }
  body.mode-edit { overflow: auto; }
  .topbar { position: sticky; top: 0; z-index: 50; }
  .topbar .btn span.lbl { display: none; }
  .nav { gap: 8px; }
  .nav .btn { padding: 8px 11px; font-size: .78rem; border-radius: 10px; }
  .nav .logo { font-size: .88rem; }
  .hero { padding-top: 28px; }
}

@media print {
  @page { size: A4 landscape; margin: 6mm; }
  body { background: #fff !important; color: #000; }
  #landing, .topbar, .side, #toast, .modal, .week-tabs { display: none !important; }
  #editor, .workspace, .stage { display: block !important; height: auto !important; overflow: visible !important; background: #fff !important; padding: 0; }
  .sheet { box-shadow: none !important; border-radius: 0; }
  .sheet.fmt-auto {
    width: 285mm !important; height: 198mm !important;
    box-shadow: none !important;
  }
  .sheet.fmt-a4 {
    width: 198mm !important; min-height: 285mm !important; height: auto !important;
  }
}
