: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; background: var(--bg); }
body {
  color: var(--tx);
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", 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;
  box-shadow: 0 8px 28px rgba(255, 77, 141, .32);
}
#exportHost {
  position: fixed;
  left: 0; top: 0;
  z-index: 200;
  pointer-events: none;
  overflow: visible;
}
body.capturing #phoneWizard { visibility: hidden; }
body.capturing #exportHost .sheet {
  transform: none !important;
  opacity: 1 !important;
}
.btn.sm { padding: 8px 13px; border-radius: 11px; font-size: .84rem; }
.btn[data-thanks] b {
  font-family: Unbounded, sans-serif; font-weight: 800; font-size: .82em;
  opacity: .9;
}

#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-mark {
  width: 58px; height: 18px;
  display: block; flex: none;
  overflow: visible;
  color: inherit;
}
.logo-mark path, .s-foot-logo path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.logo .ic { display: none; }
.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 .cta-row.cta-extra { margin-top: 12px; }
.hero .btn.primary,
.hero .btn.hot { padding: 15px 28px; font-size: 1.02rem; border-radius: 16px; }
.cta-ways {
  margin: 14px 0 0; color: var(--tx2); font-size: .86rem; font-weight: 600;
}
.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; }
.foot-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--tx2);
  font: inherit;
  font-size: .86rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.foot-link:hover { color: var(--tx); }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: var(--tx2);
  background: var(--p2);
  border: 1px solid var(--line);
  flex: none;
  transition: transform .15s, border-color .15s, color .15s;
}
.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.22);
  color: var(--tx);
}
.icon-btn svg { width: 18px; height: 18px; display: block; }
button.icon-btn { padding: 0; }
.site-theme-btn { flex-shrink: 0; width: 38px; height: 38px; min-width: 38px; color: var(--tx); }
.site-theme-btn .icon-moon { display: none; }
html.site-light .site-theme-btn .icon-sun { display: none; }
html.site-light .site-theme-btn .icon-moon { display: block; }
.icon-btn-rub {
  font-family: Manrope, system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
  letter-spacing: 0;
}
.foot-logo {
  font-family: Manrope, sans-serif; font-weight: 600; font-size: .86rem;
  color: var(--tx2); letter-spacing: 0;
}
.foot-logo .logo-mark { width: 46px; height: 14px; }
.foot-logo:hover { color: var(--tx); }

#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; }
.topbar-start, .topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.topbar-actions { flex-wrap: wrap; }
.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 1fr; gap: 6px; }
.seg button {
  padding: 10px 6px; border-radius: 12px; font-weight: 700; font-size: .82rem;
  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); }
.paint-palette { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.psw {
  width: 28px; height: 28px; border-radius: 8px; padding: 0;
  border: 2px solid transparent; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.psw.on {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--br1);
}
.psw.auto {
  width: auto; min-width: 28px; padding: 0 8px;
  font-size: .62rem; font-weight: 800; letter-spacing: .04em;
  color: #e5e7eb; background: #1c2130;
}
body.paint-mode .s-cell { cursor: cell; }
body.paint-mode .s-cell.cat-empty { cursor: not-allowed; }
body.paint-mode .s-cell .s-subj,
body.paint-mode .s-cell .s-note { pointer-events: none; }
.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-actions { display: flex; align-items: center; gap: 6px; }
.crow-actions .btn { width: auto; margin: 0; padding: 7px 10px; font-size: .78rem; }
.bg-thumb {
  width: 36px; height: 24px; border-radius: 6px; flex: none;
  background-size: cover; background-position: center;
  border: 1px solid var(--line);
}
.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 select:disabled { opacity: .45; }
.crow input[type=range] { width: 140px; accent-color: var(--br1); }
.crow em {
  font-style: normal; color: var(--tx2); font-weight: 700;
  margin-left: 6px; font-variant-numeric: tabular-nums;
}
.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-x: hidden; overflow-y: auto; padding: 30px 40px 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);
}
.sheet-fit {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex: none;
}
body.capturing .sheet-fit,
body.printing .sheet-fit,
body.preview-open .sheet-fit {
  overflow: visible;
  height: auto !important;
}
.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; }

.subject-tray {
  --s-card: var(--p2);
  --s-line: var(--line);
  --s-rad: 14px;
  --s-ink: var(--tx);
  --s-mut: var(--tx2);
  --s-acc: #67e8f9;
  width: 100%;
  max-width: 900px;
  background: color-mix(in srgb, var(--p2) 88%, #000);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px 14px;
  box-sizing: border-box;
}
.subject-tray-label {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tx2);
  margin-bottom: 4px;
}
.subject-tray .hint { margin: 0 0 10px; }
.subject-tray-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tray-chip.s-cell {
  min-height: 0;
  padding: 8px 11px;
  font-size: .78rem;
  width: auto;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  flex: 0 0 auto;
}
.tray-chip.on { box-shadow: 0 0 0 2px #67e8f9; }
.tray-chip.is-lift { box-shadow: 0 0 0 2px var(--s-acc); }
body.tray-pick .s-cell.cat-empty,
body.tray-drag .s-cell.cat-empty {
  box-shadow: 0 0 0 2px color-mix(in srgb, #67e8f9 75%, transparent);
  cursor: copy;
}
body.capturing .subject-tray,
body.printing .subject-tray,
body.preview-open .subject-tray { display: none !important; }

.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;
  --s-zoom: 1;
  --s-pad-x: 30px;
  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: visible;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
  flex-shrink: 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.s-head {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.s-tagrow { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; }
.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: 1.35rem;
  margin: 0; line-height: 1.15; outline: none;
  text-align: left; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s-sub {
  color: var(--s-mut); font-size: .92rem; margin: 0; outline: none;
  text-align: right; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.s-grid { display: flex; flex-direction: column; gap: 7px; position: relative; z-index: 2; --days: 5; --time-col: 4.4em; }
.s-headrow, .s-row {
  display: grid;
  grid-template-columns: var(--time-col) 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, .s-cell.is-drag { opacity: .38; }
.s-row.is-over { box-shadow: 0 0 0 2px var(--s-acc); }
.s-cell.is-over { box-shadow: 0 0 0 2px var(--s-acc); }
.s-cell.is-lift { 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 {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 6;
  width: 22px; height: 28px; margin: 0;
  transform: translate(calc(-100% - var(--s-pad-x) - 12px), -50%);
  border-radius: 8px;
  color: #c9cedb;
  background: #1c2233;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.12);
}
.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; }
.s-cell.drag-ghost { margin: 0; }
body.is-sorting { cursor: grabbing; user-select: none; -webkit-user-select: none; }
body.is-sorting * { cursor: grabbing !important; }
.exporting { overflow: hidden !important; }
.exporting .grip { display: none !important; }
.exporting .s-num { padding: 0 4px; }
.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);
  min-width: 0;
  outline: none; cursor: text;
}
.s-dayh:focus { box-shadow: 0 0 0 2px color-mix(in srgb, var(--s-acc) 55%, transparent); }
.s-num {
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; position: relative;
  color: var(--s-mut); user-select: none;
  min-width: 0; width: 100%;
  box-sizing: border-box;
  overflow: visible;
}
.s-num b { display: none; }
.s-time {
  display: block;
  font-size: .74rem; font-weight: 700; outline: none; white-space: nowrap;
  cursor: text; user-select: text; -webkit-user-select: text;
  text-align: center; width: 100%; min-width: 0; box-sizing: border-box;
}
.s-cell {
  background: var(--s-card);
  border: 1px solid var(--s-line);
  border-radius: calc(var(--s-rad) * .55);
  padding: 8px 10px; min-height: 44px; height: auto;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 2px;
  text-align: center;
  font-size: .82rem; font-weight: 800; line-height: 1.25;
  outline: none;
  transition: box-shadow .12s, background .15s;
  word-break: break-word;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  user-select: none; -webkit-user-select: none;
}
.s-cell:has(.s-note:not(:empty)) { padding-top: 7px; padding-bottom: 7px; }
.s-cell:focus-within { user-select: text; -webkit-user-select: text; }
.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; width: 100%; text-align: center;
}
.s-note {
  font-weight: 500; font-size: .68rem; line-height: 1.2;
  color: var(--s-mut); width: 100%; text-align: center;
}
.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, .exporting .s-dayh: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-cell.is-painted {
  background: color-mix(in srgb, var(--cell-fill) 42%, var(--s-card));
  border-style: solid;
}
.s-extra {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  position: relative; z-index: 2;
  align-items: stretch;
}
.s-box {
  background: var(--s-card);
  border: 1px solid var(--s-line);
  border-radius: calc(var(--s-rad) * .7);
  padding: 12px 14px;
  display: flex; flex-direction: column; min-height: 0;
}
.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);
  flex: none;
}
.s-rules {
  list-style: none; margin: 0; padding: 0;
  flex: 1 1 auto; display: grid; gap: 7px;
  grid-auto-rows: 1fr; align-content: stretch;
}
.s-rules li {
  display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: center;
  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 {
  flex: 1 1 auto; display: grid; gap: 7px;
  grid-auto-rows: 1fr; align-content: stretch;
}
.s-teach {
  display: grid; grid-template-columns: 5px 1fr auto; gap: 8px; align-items: center;
}
.s-teach .bar { width: 5px; min-height: 22px; height: 100%; align-self: stretch; 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: 24px; padding: 5px 12px;
  border-radius: calc(var(--s-rad) * .55);
  font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  font-size: .78rem; outline: none; border: 1px solid var(--s-line);
  height: auto;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.s-span:focus { box-shadow: 0 0 0 2px var(--s-acc); }
.s-span.kind-break {
  min-height: 18px; font-size: .7rem; letter-spacing: .06em; padding: 4px 12px;
  background: color-mix(in srgb, var(--s-mut) 18%, var(--s-card));
  color: var(--s-mut);
}
.s-span.kind-meal {
  min-height: 22px; padding: 4px 12px;
  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: 28px; gap: 10px; padding: 5px 12px;
  text-transform: none; letter-spacing: 0;
}
.s-num .mini { display: none; }
.s-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 7px;
  position: relative; z-index: 2;
  font-size: .72rem; font-weight: 700; color: var(--s-mut); opacity: .85;
}
.s-foot-logo {
  width: 48px; height: 15px; display: block; flex: none;
  overflow: visible; color: inherit;
}
.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; }
.s-decor i:nth-child(4) { bottom: 28px; right: 22px; transform: rotate(-8deg); font-size: 1rem; opacity: .7; }

.sheet.fmt-phone { width: 430px; min-height: 932px; justify-content: center; padding: 26px 20px; --s-pad-x: 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.05rem; }
.sheet.fmt-phone .s-time { font-size: .68rem; }
.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; }
/* Paper geometry is defined in print-layout.css. */

.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: 1.55rem; 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: 1.45rem; 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; }

.th-minecraft {
  --s-bg: #7ec0ee;
  --s-card: #c6a15b;
  --s-ink: #3b2410;
  --s-mut: #6b4a24;
  --s-acc: #5a8c32;
  --s-line: #3b2410;
  --s-rad: 0px;
  --s-hfont: "Press Start 2P", Unbounded, sans-serif;
  --s-font: Manrope, sans-serif;
  border: 4px solid #3b2410;
  border-radius: 0;
  background:
    linear-gradient(#5a8c32, #3d6b22) 0 100% / 100% 16% no-repeat,
    repeating-linear-gradient(90deg, #8b5a2b 0 14px, #7a4e24 14px 28px) 0 84% / 100% 16% no-repeat,
    repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 8px, transparent 8px 16px) 0 0 / 100% 28% no-repeat,
    #7ec0ee;
}
.th-minecraft .s-title {
  font-size: .62rem; line-height: 1.35; letter-spacing: 0;
  text-shadow: 2px 2px 0 #3b2410; color: #fff;
}
.th-minecraft .s-tag, .th-minecraft .s-dayh {
  font-family: "Press Start 2P", Unbounded, sans-serif;
  font-size: .48rem; letter-spacing: 0; text-transform: none;
}
.th-minecraft .s-dayh {
  background: #5a8c32; color: #f4f1c8; border-radius: 0;
  border: 2px solid #3b2410; padding: 8px 4px;
}
.th-minecraft .s-cell {
  border-width: 3px; border-radius: 0;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.28), inset 2px 2px 0 rgba(255,255,255,.28);
}
.th-minecraft .s-span { border-radius: 0; }
.th-minecraft .s-badge { border-radius: 0; color: #fff; background: #5a8c32; }
.th-minecraft .s-num b { font-family: "Press Start 2P", sans-serif; font-size: .7rem; }
.th-minecraft .s-box { border-radius: 0; border-width: 3px; }
.th-minecraft .s-num, .th-minecraft .s-time { color: #111; }
.th-minecraft .s-time { font-weight: 800; }

.th-potter {
  --s-bg: #140c10;
  --s-card: rgba(62, 18, 24, .86);
  --s-ink: #f3e6c4;
  --s-mut: #c4a574;
  --s-acc: #c9a227;
  --s-line: rgba(201, 162, 39, .45);
  --s-rad: 6px;
  --s-hfont: Cinzel, "Cormorant Garamond", serif;
  --s-font: "Cormorant Garamond", serif;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(201,162,39,.2), transparent 55%),
    radial-gradient(circle at 12% 88%, rgba(122,31,43,.4), transparent 40%),
    radial-gradient(circle at 1px 1px, rgba(243,230,196,.22) 1px, transparent 0) 0 0 / 28px 28px,
    #140c10;
  border: 1px solid rgba(201,162,39,.55);
  outline: 1px solid rgba(201,162,39,.25);
  outline-offset: -7px;
}
.th-potter::before,
.th-potter::after {
  pointer-events: none; position: absolute; z-index: 3;
  font-size: 1.35rem; opacity: .42; line-height: 1;
}
.th-potter::before { content: "⚡"; top: 16px; right: 22px; }
.th-potter::after { content: "✦"; bottom: 36px; left: 18px; transform: rotate(-12deg); font-size: 1.1rem; }
.th-potter .s-title {
  font-size: 1.15rem; font-weight: 700; letter-spacing: .04em;
  color: #e8c872;
  text-shadow: 0 0 18px rgba(201,162,39,.35);
}
.th-potter .s-dayh {
  letter-spacing: .14em; border-radius: 4px; font-weight: 800;
}
.th-potter .s-headrow .s-dayh:nth-child(2) { background: #7a1f2b; color: #e8c872; }
.th-potter .s-headrow .s-dayh:nth-child(3) { background: #1a472a; color: #c5d5c8; }
.th-potter .s-headrow .s-dayh:nth-child(4) { background: #0e1a40; color: #c9d4e8; }
.th-potter .s-headrow .s-dayh:nth-child(5) { background: #c9a227; color: #2a1e0a; }
.th-potter .s-headrow .s-dayh:nth-child(6) { background: #7a1f2b; color: #e8c872; }
.th-potter .s-headrow .s-dayh:nth-child(7) { background: #1a472a; color: #c5d5c8; }
.th-potter .s-cell { border-width: 1.5px; }
.th-potter .s-subj { font-weight: 700; font-size: 1.02rem; }
.th-potter .s-badge { color: #140c10; background: #c9a227; }
.th-potter .s-box { border-color: rgba(201,162,39,.4); }

.th-russia {
  --s-bg: #ffffff;
  --s-card: rgba(255,255,255,.94);
  --s-ink: #111827;
  --s-mut: #4b5563;
  --s-acc: #0039a6;
  --s-line: rgba(17,24,39,.16);
  --s-rad: 10px;
  --s-hfont: Unbounded, sans-serif;
  background:
    linear-gradient(#ffffff 0 33.34%, #0039a6 33.34% 66.66%, #d52b1e 66.66% 100%);
}
.th-russia .s-title { color: #0b1f4a; text-shadow: 0 1px 0 rgba(255,255,255,.7); }
.th-russia .s-sub { color: #1e3a5f; }
.th-russia .s-dayh:nth-child(2) { background: #fff; color: #0039a6; }
.th-russia .s-dayh:nth-child(3),
.th-russia .s-dayh:nth-child(6) { background: #0039a6; color: #fff; }
.th-russia .s-dayh:nth-child(4),
.th-russia .s-dayh:nth-child(7) { background: #d52b1e; color: #fff; }
.th-russia .s-dayh:nth-child(5) { background: #fff; color: #d52b1e; }
.th-russia .s-cell {
  box-shadow: 0 6px 16px rgba(0,0,0,.12);
  border-color: rgba(0,57,166,.22);
}
.th-russia .s-badge { color: #fff; background: #0039a6; }
.th-russia .s-num, .th-russia .s-time { color: #111; }
.th-russia .s-time {
  background: rgba(255,255,255,.94);
  border-radius: 6px;
  padding: 3px 2px;
  font-weight: 800;
}

.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); }

#donateNudge {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  z-index: 91;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  justify-content: center;
  max-width: min(540px, 92vw);
  background: #1c2233; color: var(--tx);
  border: 1px solid var(--line);
  padding: 12px 14px; border-radius: 16px;
  box-shadow: 0 16px 50px rgba(0,0,0,.5);
  font-weight: 600; font-size: .86rem;
}
#donateNudge[hidden] { display: none !important; }
#donateNudge p { margin: 0; flex: 1 1 200px; line-height: 1.35; }

.modal {
  position: fixed; inset: 0; z-index: 120;
  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; }
.donate-qr {
  margin: 4px auto 16px;
  width: 236px; max-width: 100%;
  padding: 12px; border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
}
.donate-qr img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; display: block; }
.donate-qr-cap {
  display: block; margin-top: 8px; font-size: .72rem; font-weight: 700;
  color: #4b5563; letter-spacing: .01em;
}
.donate-band .cta-row { margin-top: 0; }

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 140;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 18px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--p1) 92%, #000);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
}
.cookie-banner[hidden] { display: none !important; }
.cookie-banner-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
}
.cookie-banner-copy { flex: 1 1 240px; min-width: 0; }
.cookie-banner-copy b {
  display: block;
  font-family: Unbounded, sans-serif;
  font-size: .92rem;
  margin-bottom: 6px;
}
.cookie-banner-copy p {
  margin: 0;
  color: var(--tx2);
  font-size: .84rem;
  line-height: 1.45;
}
.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: none;
}
.cookie-card {
  width: min(480px, 100%);
  text-align: left;
}
.cookie-policy {
  max-height: min(52vh, 360px);
  overflow: auto;
  margin: 0 0 14px;
  padding-right: 4px;
}
.cookie-policy p {
  color: var(--tx2);
  margin: 0 0 12px;
  line-height: 1.55;
  font-size: .9rem;
  text-align: left;
}
.cookie-policy a { color: var(--br2); }
.cookie-card .btn { width: 100%; margin-top: 8px; }
@media (max-width: 600px) {
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 14px; }
  .cookie-banner-actions { width: 100%; }
  .cookie-banner-actions .btn { flex: 1; }
}

.cal-card { width: min(400px, 100%); }
.cal-hint { color: var(--tx2); font-size: .88rem; margin: 0 0 16px; line-height: 1.45; }
.cal-field { margin-bottom: 14px; text-align: left; }
.cal-field label {
  display: block; font-weight: 700; font-size: .84rem; margin-bottom: 6px;
}
.cal-field input,
.cal-field select {
  width: 100%; box-sizing: border-box;
  background: var(--p2); border: 1px solid var(--line); color: var(--tx);
  border-radius: 12px; padding: 10px 12px; font: inherit; font-size: .9rem;
}
.cal-field-hint {
  display: block; font-size: .72rem; color: var(--tx2); margin-top: 4px; font-weight: 600;
}
.cal-actions { display: flex; gap: 10px; margin-top: 18px; }
.cal-actions .btn { flex: 1; margin-top: 0; width: auto; }
.cal-actions .btn:disabled { opacity: .45; pointer-events: none; cursor: not-allowed; }
.cal-empty {
  text-align: left; font-size: .86rem; font-weight: 700; line-height: 1.4;
  color: #fecaca; background: rgba(248, 113, 113, .12);
  border: 1px solid rgba(248, 113, 113, .28);
  border-radius: 12px; padding: 10px 12px; margin: 0 0 14px;
}
.cal-empty[hidden] { display: none !important; }
.cal-seg { display: flex; gap: 14px; flex-wrap: wrap; }
.cal-seg .check { margin: 0; }

.compact-only, .day-editor { display: none !important; }

.preview-scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6, 8, 14, .92);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
.preview-scrim[hidden] { display: none !important; }
.preview-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; flex: none;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 26, .95);
}
.preview-bar b { font-size: .88rem; }
.preview-bar .spacer { flex: 1; }
.preview-port {
  flex: 1; overflow: auto;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 12px 8px 28px;
  -webkit-overflow-scrolling: touch;
}

html.site-light {
  color-scheme: light;
  --bg: #f3f5fb;
  --p1: #ffffff;
  --p2: #e8ecf6;
  --line: rgba(20, 28, 48, .12);
  --tx: #141824;
  --tx2: #5c657a;
}
html.site-light .btn:hover,
html.site-light .icon-btn:hover {
  border-color: rgba(20, 28, 48, .28);
}
html.site-light .blob { opacity: .18; }
html.site-light .blob.b3 { opacity: .12; }
html.site-light .hero .pill {
  color: #5b21b6;
  background: rgba(139, 92, 246, .1);
  border-color: rgba(139, 92, 246, .28);
}
html.site-light .stat {
  background: rgba(255, 255, 255, .78);
}
html.site-light .stat.live {
  background: linear-gradient(180deg, rgba(139, 92, 246, .12), rgba(255, 255, 255, .82));
  box-shadow: 0 10px 28px rgba(139, 92, 246, .12);
}
html.site-light .mini-card:hover {
  box-shadow: 0 16px 40px rgba(20, 28, 48, .12);
}
html.site-light .topbar {
  background: rgba(255, 255, 255, .88);
}
html.site-light .chip.on,
html.site-light .week-tabs button.active,
html.site-light .day-tab.active {
  background: rgba(8, 145, 178, .12);
  border-color: rgba(8, 145, 178, .42);
  color: #0e7490;
}
html.site-light .tbtn .sw i { border-color: rgba(20, 28, 48, .14); }
html.site-light .psw { box-shadow: inset 0 0 0 1px rgba(20, 28, 48, .16); }
html.site-light .psw.on { border-color: #141824; }
html.site-light .psw.auto {
  color: #1f2937;
  background: #e5e7eb;
}
html.site-light .stage {
  background:
    radial-gradient(circle at 1px 1px, rgba(20, 28, 48, .07) 1px, transparent 0) 0 0 / 26px 26px,
    var(--bg);
}
html.site-light .subject-tray {
  background: color-mix(in srgb, var(--p2) 72%, #fff);
  --s-acc: #0e7490;
}
html.site-light .tray-chip.on { box-shadow: 0 0 0 2px #0e7490; }
html.site-light .s-num .grip {
  color: #4b5563;
  background: #fff;
  border-color: rgba(20, 28, 48, .12);
  box-shadow: 0 2px 10px rgba(20, 28, 48, .12);
}
html.site-light #toast,
html.site-light #donateNudge {
  background: #fff;
  box-shadow: 0 16px 50px rgba(20, 28, 48, .16);
}
html.site-light .modal {
  background: rgba(20, 28, 48, .38);
}
html.site-light .modal-card {
  background: #fff;
  box-shadow: 0 30px 80px rgba(20, 28, 48, .16);
}
html.site-light .cookie-banner {
  background: rgba(255,255,255,.94);
  box-shadow: 0 18px 50px rgba(20,28,48,.16);
}
html.site-light .cal-empty {
  color: #9f1239;
  background: rgba(244, 63, 94, .08);
  border-color: rgba(190, 18, 60, .25);
}
html.site-light .preview-scrim {
  background: rgba(243, 245, 251, .96);
}
html.site-light .preview-bar {
  background: rgba(255, 255, 255, .95);
}
html.site-light ::placeholder { color: var(--tx2); opacity: .85; }

@media (max-width: 1100px) {
  body.mode-edit:not(.compact) { overflow: auto; }
  body.mode-edit:not(.compact) #editor { height: auto; min-height: 100dvh; }
  body.mode-edit:not(.compact) .workspace {
    display: flex; flex-direction: column; overflow: auto;
  }
  body.mode-edit:not(.compact) .stage {
    order: 1; width: 100%;
    padding: 16px 20px 28px 36px;
    overflow-x: hidden; overflow-y: visible;
    align-items: stretch;
  }
  body.mode-edit:not(.compact) .side {
    order: 2; width: 100%; border-right: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  body.mode-edit:not(.compact) .topbar { position: sticky; top: 0; z-index: 50; }
}

@media (max-width: 720px) {
  body.mode-edit.compact { overflow: auto; }
  body.mode-edit.compact #editor { height: auto; min-height: 100dvh; }
  body.mode-edit.compact .workspace {
    display: flex; flex-direction: column; overflow: visible; min-height: 0;
  }
  body.mode-edit.compact .stage {
    order: 1; width: 100%;
    padding: 12px 12px 8px;
    overflow: visible; align-items: stretch;
  }
  body.mode-edit.compact .side {
    order: 2; width: 100%; border-right: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  body.mode-edit.compact .topbar {
    position: sticky; top: 0; z-index: 50;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 8px;
  }
  body.mode-edit.compact .topbar .spacer { display: none; }
  body.mode-edit.compact .topbar-start {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 38px;
    align-items: center;
    width: 100%;
    min-width: 0;
  }
  body.mode-edit.compact .topbar-start .logo {
    min-width: 0;
    overflow: hidden;
  }
  body.mode-edit.compact .topbar-start .site-theme-btn {
    margin-left: 0;
    grid-column: 3;
  }
  body.mode-edit.compact .topbar-actions {
    width: 100%;
  }
  body.mode-edit.compact .desktop-only,
  body.mode-edit.compact .desktop-fmt-hint { display: none !important; }
  body.mode-edit.compact .compact-only {
    display: flex !important; width: auto;
  }
  body.mode-edit.compact .side .hint.compact-only {
    display: block !important; width: 100%;
  }
  body.mode-edit.compact .day-editor {
    display: flex !important;
    flex-direction: column; gap: 10px; width: 100%;
  }
  body.mode-edit.compact:not(.preview-open):not(.capturing):not(.printing) #sheet {
    position: fixed !important;
    left: 0; top: 0;
    opacity: 0; pointer-events: none; z-index: -1;
  }
  body.mode-edit.compact:not(.preview-open):not(.capturing):not(.printing) #sheetFit {
    height: 0 !important;
    overflow: hidden;
    pointer-events: none;
  }
  body.mode-edit.compact.preview-open #sheet,
  body.mode-edit.compact.capturing #sheet {
    display: flex !important;
    opacity: 1;
    pointer-events: none;
    flex-shrink: 0;
  }
  body.mode-edit.compact.capturing #sheet {
    position: relative !important;
    left: auto; top: auto; z-index: 1;
    transform: none !important;
    opacity: 1;
  }
  body.mode-edit.compact.preview-open #sheet {
    position: relative !important;
    left: auto; top: auto; z-index: 1;
  }
  body.mode-edit.compact #sheet.fmt-auto { width: 1123px !important; height: auto !important; min-height: 794px !important; max-height: none !important; }
  body.mode-edit.compact #sheet.fmt-a4 { width: 794px !important; }
  body.mode-edit.compact #sheet.fmt-a5 { width: 794px !important; height: auto !important; min-height: 559px !important; max-height: none !important; }
  body.mode-edit.compact #sheet.fmt-phone { width: 430px !important; }
  body.mode-edit.compact #sheet.fmt-story,
  body.mode-edit.compact #sheet.fmt-post { width: 540px !important; }
  body.mode-edit.compact #sheet .s-extra { grid-template-columns: 1fr 1fr; }
  body.mode-edit.compact #sheet.fmt-phone .s-extra,
  body.mode-edit.compact #sheet.fmt-story .s-extra { grid-template-columns: 1fr; }

  .day-editor-head {
    display: grid; gap: 4px;
    padding: 4px 2px 2px;
  }
  .day-editor-head .s-title {
    font-size: 1.15rem; white-space: normal;
    overflow: visible; text-overflow: unset;
    color: var(--tx);
  }
  .day-editor-head .s-sub {
    text-align: left; font-size: .82rem;
    white-space: normal; overflow: visible;
  }
  .day-editor-head .s-dayh {
    justify-self: start;
    margin-top: 6px;
    padding: 6px 10px;
    font-size: .78rem;
    color: var(--br1);
    background: var(--p2);
    border: 1px solid var(--line);
    text-transform: none;
    letter-spacing: .02em;
    cursor: text;
  }
  .day-tabs {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 2px 10px;
    position: sticky; top: 108px; z-index: 8;
    background: var(--bg);
  }
  .day-tab {
    min-width: 0;
    padding: 10px 2px;
    border-radius: 12px;
    font-weight: 800; font-size: .72rem;
    letter-spacing: .04em; text-transform: uppercase;
    background: var(--p2); color: var(--tx2); border: 1px solid var(--line);
  }
  .day-tab.off {
    background: transparent;
    border-style: dashed;
    opacity: .5;
  }
  .day-tab.on {
    background: var(--p2);
    border-style: solid;
    opacity: 1;
  }
  .day-tab.active {
    background: rgba(34, 211, 238, .16);
    border-color: rgba(34, 211, 238, .55);
    border-style: solid;
    color: #67e8f9;
    opacity: 1;
  }
  .day-slots { display: grid; gap: 8px; }
  .day-slot {
    display: grid;
    grid-template-columns: 32px minmax(3.6em, 4.4em) minmax(0, 1fr);
    gap: 8px; align-items: stretch;
  }
  .day-slot .grip {
    width: 32px; min-height: 48px; height: auto;
    color: var(--tx2); background: var(--p2);
    border-radius: 10px; border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
  }
  .day-slot .s-time {
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700; color: var(--tx);
    background: var(--p2); border: 1px solid var(--line);
    border-radius: 12px; padding: 6px 4px;
    text-align: center; width: 100%; white-space: normal; line-height: 1.2;
  }
  .day-slot .s-cell, .day-slot .s-span {
    min-height: 52px; margin: 0;
  }
  .day-slot .s-span { grid-column: 3; }
  .day-editor-hint { margin: 4px 2px 0; }
  .pw-shell { width: 100%; }
}

@media (max-width: 940px) {
  .topbar .btn span.lbl { display: none; }
  .nav { gap: 8px; }
  .nav .site-theme-btn { width: 36px; height: 36px; min-width: 36px; }
  .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: 4mm; }
  html, body, body.mode-edit, #sheet, #sheet * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  html, body, body.mode-edit {
    background: #fff !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  #landing, .topbar, .side, #toast, .modal, .week-tabs, #donateNudge, .subject-tray,
  body.mode-edit.compact .topbar,
  body.mode-edit.compact .side,
  body.mode-edit.compact .compact-only,
  body.mode-edit.compact .day-editor,
  body.mode-edit.compact .preview-scrim,
  .day-editor, .preview-scrim, .compact-only {
    display: none !important;
  }
  body.mode-edit.compact #editor,
  body.mode-edit.compact .workspace,
  body.mode-edit.compact .stage,
  body.mode-edit.compact #sheetFit,
  #editor, .workspace, .stage, #sheetFit {
    display: block !important;
    height: auto !important;
    width: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    padding: 0 !important;
    transform: none !important;
  }
  .sheet {
    box-shadow: none !important; border-radius: 0; overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  body.mode-edit.compact #sheet,
  body.mode-edit.compact:not(.preview-open):not(.capturing) #sheet,
  body.mode-edit.compact.printing #sheet,
  #sheet {
    display: flex !important;
    opacity: 1 !important;
    position: relative !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    z-index: 1 !important;
    pointer-events: auto !important;
  }
  .s-num .grip { display: none !important; }
  .s-subj:empty::before, .s-note:empty::before { content: none !important; }
  .s-note:empty { display: none !important; min-height: 0; }
  body.mode-edit.compact #sheet.fmt-auto,
  .sheet.fmt-auto {
    width: 285mm !important; height: auto !important; min-height: 0 !important;
    box-shadow: none !important;
  }
  body.mode-edit.compact #sheet.fmt-a5,
  .sheet.fmt-a5 {
    width: 202mm !important; height: auto !important; min-height: 140mm !important; max-height: none !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  body.mode-edit.compact #sheet.fmt-a4,
  .sheet.fmt-a4 {
    width: 198mm !important; min-height: 285mm !important; height: auto !important;
  }
  #phoneWizard { display: none !important; }
}

.nav-cta { display: contents; }
body.compact .nav-cta {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  flex: 0 0 auto;
  width: max-content;
  min-width: 8.2em;
}
body.compact .nav-cta .btn {
  display: flex !important;
  width: 100%;
  box-sizing: border-box;
  justify-content: center;
}

body.phone-wizard {
  overflow: hidden;
  height: 100dvh;
}
body.phone-wizard #landing { pointer-events: none; }

#phoneWizard {
  position: fixed; inset: 0; z-index: 85;
  display: flex; justify-content: center;
  background: var(--bg); color: var(--tx);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
  overflow: hidden;
}
#phoneWizard[hidden] { display: none !important; }
.pw-shell {
  height: 100%;
  max-height: 100dvh;
  width: min(440px, 100%);
  display: flex; flex-direction: column;
  min-height: 0;
  padding: 8px 14px 10px;
  box-sizing: border-box;
  padding-bottom: calc(10px + var(--pw-kb, 0px));
  background: var(--bg);
}
.pw-head {
  display: flex; align-items: center; gap: 8px;
  flex: none; min-height: 40px;
}
.pw-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--p2); color: var(--tx); border: 1px solid var(--line);
  font-size: 1.05rem; font-weight: 700;
}
.pw-progress {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tx2);
}
.pw-dots { display: flex; gap: 5px; }
.pw-dots i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--line); display: block;
}
.pw-dots i.on { background: var(--br1); }
.pw-q {
  font-family: Unbounded, sans-serif; font-weight: 700;
  font-size: 1.05rem; margin: 8px 0 6px; line-height: 1.25; flex: none;
}
.pw-lead {
  margin: 0 0 8px; color: var(--tx2); font-size: .82rem; font-weight: 600; flex: none;
}
.pw-body { flex: none; }
.pw-body.pw-grow {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  gap: 12px;
  overflow: hidden;
  padding: 4px 8px 0;
}
.pw-preview-wrap {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; pointer-events: none; margin: 6px 0;
}
.pw-preview {
  display: flex; justify-content: center; align-items: flex-start;
  max-width: 100%; max-height: 100%; overflow: hidden;
}
.pw-preview .sheet { flex-shrink: 0; }
.pw-preview .grip { display: none !important; }
.pw-foot {
  flex: none; display: flex; gap: 8px;
  padding-top: 8px;
}
.pw-foot .btn { flex: 1; margin: 0; }
.pw-skip { margin: 0 0 6px; font-size: .72rem; color: var(--tx2); font-weight: 600; text-align: center; }
.pw-days { display: flex; gap: 4px; }
.pw-days .chip { flex: 1; padding: 8px 0; text-align: center; min-width: 0; }
.pw-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 4px 0;
}
.pw-stepper { display: flex; align-items: center; gap: 8px; }
.pw-stepper button {
  width: 36px; height: 36px; border-radius: 11px; font-size: 1.1rem; font-weight: 800;
  background: var(--p2); color: var(--tx); border: 1px solid var(--line);
}
.pw-stepper b { font-family: Unbounded, sans-serif; min-width: 28px; text-align: center; }
.pw-fields {
  display: flex; flex-direction: column; gap: 6px; margin-top: 6px;
}
.pw-field {
  display: flex; flex-direction: column; gap: 1px;
  padding: 6px 12px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--p1);
  font-size: .72rem; font-weight: 700; color: var(--tx2);
}
.pw-field input {
  width: 100%; border: 0; background: transparent; color: var(--tx);
  font: inherit; font-size: .95rem; font-weight: 800; padding: 2px 0 0;
  outline: none;
}
.pw-times {
  margin-top: 6px;
  max-height: 28vh;
  overflow: auto;
  display: flex; flex-direction: column; gap: 6px;
  padding: 2px 0 4px;
  -webkit-overflow-scrolling: touch;
}
.pw-time-row {
  display: grid;
  grid-template-columns: 6.2em minmax(0, 1fr);
  gap: 8px; align-items: center;
}
.pw-clock-btn {
  width: 100%;
  background: var(--p1); border: 1px solid var(--line); color: var(--tx);
  border-radius: 12px; padding: 9px 6px; font: inherit; font-weight: 800;
  text-align: center; font-size: .95rem;
}
.pw-kind {
  width: 100%;
  background: var(--p1); border: 1px solid var(--line); color: var(--tx);
  border-radius: 12px; padding: 9px 8px; font: inherit; font-weight: 800;
  font-size: .82rem;
}
.pw-time-row span { font-size: .78rem; font-weight: 700; color: var(--tx2); min-width: 0; }
.pw-clock {
  position: absolute; inset: 0; z-index: 6;
  background: rgba(8, 10, 18, .55);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
}
.pw-clock-card {
  width: min(420px, 100%);
  background: var(--p1);
  border: 1px solid var(--line);
  border-radius: 22px 22px 16px 16px;
  padding: 14px 14px 16px;
  box-shadow: 0 -12px 40px rgba(0,0,0,.28);
}
.pw-clock-title {
  margin: 0 0 10px; text-align: center;
  font-weight: 800; font-size: .82rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--tx2);
}
.pw-clock-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  height: 11.2em;
}
.pw-clock-col {
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--p2);
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}
.pw-clock-col button {
  display: block; width: 100%;
  height: 2.8em; scroll-snap-align: center;
  background: transparent; color: var(--tx);
  font: inherit; font-weight: 800; font-size: 1.05rem;
  border-radius: 0;
}
.pw-clock-col button.on {
  background: rgba(139,92,246,.22);
  color: #fff;
}
.pw-clock-actions { display: flex; gap: 8px; margin-top: 12px; }
.pw-clock-actions .btn { flex: 1; margin: 0; }
html.site-light .pw-clock { background: rgba(20, 28, 48, .38); }
html.site-light .pw-clock-card { background: #fff; }
html.site-light .pw-clock-col button.on { color: #4c1d95; }
.pw-yours {
  display: flex; flex-wrap: wrap; gap: 8px; flex: none;
  min-height: 44px; margin: 0 0 2px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--p1);
  position: relative;
  z-index: 1;
  overflow: hidden;
}
.pw-yours .pw-empty { color: var(--tx2); font-size: .82rem; font-weight: 600; padding: 6px 0; }
.pw-catalog {
  flex: 1 1 auto; min-height: 0; overflow: auto;
  display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start;
  padding: 12px 12px 16px;
  -webkit-overflow-scrolling: touch;
}
.pw-chip {
  padding: 8px 11px; border-radius: 999px; font-weight: 700; font-size: .8rem;
  border: 1px solid var(--line); background: var(--p2); color: var(--tx);
  min-height: 0; height: auto; width: auto; max-width: 100%; flex: 0 0 auto;
}
.pw-chip.on {
  box-shadow: inset 0 0 0 2px var(--br1);
  outline: none;
}
.pw-chip.add { border-style: dashed; color: var(--tx2); }
.pw-layout {
  flex: 1 1 0%;
  min-height: 0;
  height: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.pw-layout[hidden] { display: none !important; }
.pw-weeks { display: flex; gap: 6px; flex: none; }
.pw-weeks button {
  flex: 1; padding: 8px 10px; border-radius: 999px; font-weight: 700; font-size: .82rem;
  background: var(--p2); color: var(--tx2); border: 1px solid var(--line);
}
.pw-weeks button.active { background: rgba(34,211,238,.16); border-color: rgba(34,211,238,.55); color: #67e8f9; }
.pw-day-tabs {
  display: flex; gap: 4px; flex: none; overflow-x: auto;
}
.pw-day-tabs button {
  flex: 1; min-width: 40px; padding: 8px 4px; border-radius: 10px;
  font-weight: 800; font-size: .78rem;
  background: var(--p2); color: var(--tx2); border: 1px solid var(--line);
  position: relative;
}
.pw-day-tabs button.active { color: var(--tx); border-color: var(--br1); background: rgba(139,92,246,.14); }
.pw-day-tabs button.has::after {
  content: ""; position: absolute; top: 5px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
}
.pw-split {
  flex: 1 1 0%;
  min-height: 0;
  height: 0;
  display: flex;
  flex-direction: column;
}
.pw-slots {
  flex: 2 1 0%; min-height: 0; overflow: auto;
  display: flex; flex-direction: column; gap: 3px;
  justify-content: flex-start;
  -webkit-overflow-scrolling: touch;
}
.pw-slot {
  flex: 0 0 auto;
  display: grid; grid-template-columns: 2.7em minmax(0, 1fr); gap: 6px; align-items: center;
}
.pw-slot.is-span { grid-template-columns: 2.7em minmax(0, 1fr); }
.pw-slot .pw-time {
  display: flex; align-items: center; justify-content: center;
  font-size: .64rem; font-weight: 800; color: var(--tx2);
  line-height: 1.1;
}
.pw-slot .s-cell {
  min-height: 24px; height: auto; max-height: 36px; padding: 2px 6px;
  pointer-events: auto; user-select: none;
  font-size: .76rem;
  overflow: hidden;
}
.pw-slot .s-cell .s-subj { font-size: .76rem; min-height: 0; line-height: 1.15; }
.pw-slot .s-span {
  min-height: 0; height: 12px; padding: 0 6px; font-size: .58rem;
  line-height: 12px; pointer-events: none;
}
.pw-slot .s-span.kind-break,
.pw-slot .s-span.kind-meal {
  min-height: 0; height: 12px; padding: 0 6px; font-size: .56rem;
  line-height: 12px;
}
.pw-palette {
  flex: 1 1 0%; min-height: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
  align-content: flex-start; align-items: flex-start;
  overflow: auto; padding: 8px 6px 6px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line);
  background: var(--p1);
  border-radius: 12px;
}
.pw-palette .pw-chip { flex: none; }
.pw-palette .pw-chip.on {
  box-shadow: inset 0 0 0 2px #67e8f9;
  outline: none;
}
#phoneWizard.pw-pick .pw-slot .s-cell.cat-empty {
  box-shadow: 0 0 0 2px color-mix(in srgb, #67e8f9 75%, transparent);
}
.pw-themes {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch; flex: none;
}
.pw-themes .tbtn {
  flex: 0 0 132px; margin: 0;
}
.pw-result {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.pw-result[hidden] { display: none !important; }
.pw-result-actions { display: flex; flex-direction: column; gap: 8px; flex: none; }
.pw-result-actions .btn { width: 100%; margin: 0; }
.pw-custom-bar {
  flex: none; display: flex; gap: 8px; align-items: center;
  padding: 8px 0 4px;
}
.pw-custom-bar[hidden] { display: none !important; }
.pw-custom-bar input {
  flex: 1; min-width: 0;
  background: var(--p2); border: 1px solid var(--line); color: var(--tx);
  border-radius: 12px; padding: 11px 12px; font: inherit; font-size: .92rem;
}
.pw-dialog {
  position: absolute; inset: 0; z-index: 2;
  background: rgba(6, 8, 14, .62);
  display: grid; place-items: center; padding: 20px;
}
.pw-dialog[hidden] { display: none !important; }
.pw-dialog-card {
  width: min(360px, 100%);
  background: var(--p1); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px 16px; text-align: center;
}
.pw-dialog-card p { margin: 0 0 14px; font-weight: 700; line-height: 1.4; }
.pw-dialog-actions { display: flex; flex-direction: column; gap: 8px; }
.pw-dialog-actions .btn { width: 100%; margin: 0; }
html.site-light .pw-dialog { background: rgba(20, 28, 48, .38); }
html.site-light .pw-dialog-card { background: #fff; }
html.site-light .pw-weeks button.active { color: #0e7490; }

@media (min-width: 721px) {
  #phoneWizard {
    background: rgba(6, 8, 18, .62);
    padding: 0;
  }
  html.site-light #phoneWizard {
    background: rgba(20, 28, 48, .42);
  }
  .pw-shell {
    box-shadow: 0 0 0 1px var(--line), 0 18px 64px rgba(0, 0, 0, .38);
  }
}
