/* =========================================================
   PRIMARY PLANNER — Paper Classroom theme
   ========================================================= */

:root {
  /* Palette */
  --paper:        #fbf3df;
  --paper-warm:   #fae9c8;
  --paper-dark:   #2a2438;
  --ink:          #2a2438;
  --ink-soft:     #5a4f6a;
  --line:         #2a2438;

  /* Day colors (crayon primaries) */
  --c-mon: #ff7aa9;
  --c-tue: #ffc24c;
  --c-wed: #5cd6b1;
  --c-thu: #5ea7ff;
  --c-fri: #b07cff;
  --c-sat: #ff945c;
  --c-sun: #c79fff;

  /* Sky */
  --sky-1: #ffeec5;
  --sky-2: #ffd6e0;
  --sky-3: #cfe8ff;

  /* 3D shadows */
  --shadow-card:  6px 8px 0 var(--ink);
  --shadow-pop:   10px 14px 0 var(--ink);
  --shadow-soft:  0 18px 36px rgba(42, 36, 56, .18);

  --radius:       18px;
  --radius-lg:    28px;
  --radius-pill:  999px;

  --hour-h:       72px;
}

[data-theme="plasticine"] {
  --paper:      #f6efe0;
  --paper-warm: #f1e3c5;
  --ink:        #3a2c4a;
  --line:       #3a2c4a;
  --c-mon: #ff8fa6; --c-tue: #ffd06b; --c-wed: #82e0c2; --c-thu: #8fb9ff; --c-fri: #c79fff;
}

[data-theme="chalkboard"] {
  --paper:      #1f3a36;
  --paper-warm: #2c4842;
  --ink:        #fff7e0;
  --ink-soft:   #d6cca8;
  --line:       #fff7e0;
  --sky-1: #1a322f; --sky-2: #25433d; --sky-3: #18302c;
  --shadow-card: 4px 6px 0 rgba(0,0,0,.5);
  --shadow-pop:  8px 10px 0 rgba(0,0,0,.6);
}

[data-theme="blocks"] {
  --paper:      #fff3d6;
  --paper-warm: #ffe3a3;
  --c-mon: #e3433f; --c-tue: #f5b316; --c-wed: #3aa86b; --c-thu: #2f7adc; --c-fri: #8b50d6;
}

/* =========================================================
   Base
   ========================================================= */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Baloo 2", "Fredoka", ui-rounded, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior-x: none;
}

body {
  background:
    radial-gradient(1200px 800px at 12% 0%, var(--sky-1) 0%, transparent 55%),
    radial-gradient(900px 700px at 92% 8%, var(--sky-2) 0%, transparent 50%),
    radial-gradient(900px 700px at 60% 100%, var(--sky-3) 0%, transparent 55%),
    var(--paper);
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { font-family: "Fredoka", sans-serif; font-weight: 600; margin: 0; }

/* Hide reduced motion if requested */
[data-motion="low"] *,
[data-motion="low"] *::before,
[data-motion="low"] *::after {
  animation-duration: 0.001s !important;
  transition-duration: 100ms !important;
}

/* =========================================================
   App layout
   ========================================================= */

#root {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  z-index: 1;
}

.app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 22px 28px 100px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
  max-width: 1620px;
  margin: 0 auto;
}

/* =========================================================
   Top bar
   ========================================================= */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--paper-warm);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  transform: rotate(-4deg);
}
.brand-mark svg { width: 36px; height: 36px; }

.brand h1 {
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.5px;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
}
.brand .subline {
  font-size: 15px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand .subline .pin {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--c-tue);
  border: 2px solid var(--ink);
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  font-weight: 700;
  font-size: 15px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tool-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 10px 0 var(--ink);
}
.tool-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 3px 0 var(--ink);
}
.tool-btn.icon-only { padding: 10px; }
.tool-btn svg { width: 18px; height: 18px; }

.tool-btn.tb-today { background: var(--c-tue); }
.tool-btn.tb-prev, .tool-btn.tb-next { background: var(--paper-warm); }
.tool-btn.account-chip {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #fff;
}

.sync-line {
  margin-top: -8px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

/* =========================================================
   Account gate
   ========================================================= */

.auth-page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  overflow: hidden;
}

.auth-card {
  position: relative;
  z-index: 3;
  width: min(520px, 100%);
  padding: 28px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow-pop);
}

.auth-brand {
  align-items: flex-start;
  margin-bottom: 22px;
}

.auth-brand h1 {
  font-size: 34px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-tabs button {
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-pill);
  background: #fff;
  box-shadow: 4px 5px 0 var(--ink);
}

.auth-tabs button.active {
  background: var(--c-tue);
}

.auth-field {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
}

.auth-field span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 3px solid rgba(42, 36, 56, 0.5);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.auth-error {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #ffe0e8;
  color: var(--ink);
  font-weight: 800;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  background: var(--c-wed);
}

.auth-note {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.tool-btn.tb-export { background: var(--c-wed); }
.tool-btn.tb-print { background: var(--c-thu); color: #fff; }
.tool-btn.tb-print svg { stroke: #fff; }

[data-theme="chalkboard"] .tool-btn { background: #fff7e0; color: #2a2438; }
[data-theme="chalkboard"] .tool-btn.tb-print { color: #fff; }

/* =========================================================
   Metric strip
   ========================================================= */

.metrics {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.metric {
  position: relative;
  padding: 14px 22px 14px 56px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  min-width: 180px;
}
.metric .m-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  border: 2.5px solid var(--ink);
}
.metric .m-icon svg { width: 20px; height: 20px; }
.metric .m-value {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
}
.metric .m-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin-top: 4px;
}
.metric.m-blocks .m-icon { background: var(--c-mon); }
.metric.m-hours  .m-icon { background: var(--c-thu); }
.metric.m-plan   .m-icon { background: var(--c-wed); }

/* =========================================================
   Main board
   ========================================================= */

.board-wrap {
  position: relative;
  min-height: 660px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: 64px repeat(var(--day-count, 5), minmax(180px, 1fr));
  gap: 12px;
  padding: 18px;
  background:
    repeating-linear-gradient(0deg, transparent 0 calc(var(--hour-h) - 1px), rgba(42,36,56,.07) calc(var(--hour-h) - 1px) var(--hour-h)),
    #fffaef;
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}

[data-theme="chalkboard"] .board {
  background:
    repeating-linear-gradient(0deg, transparent 0 calc(var(--hour-h) - 1px), rgba(255,247,224,.13) calc(var(--hour-h) - 1px) var(--hour-h)),
    #284540;
}

.time-axis {
  position: relative;
  padding-top: 110px;
}
.time-axis .time-tick {
  position: absolute;
  left: 0;
  right: 0;
  text-align: right;
  padding-right: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  transform: translateY(-50%);
}

.day-col {
  position: relative;
  display: flex;
  flex-direction: column;
}

.day-head {
  position: relative;
  height: 110px;
  margin-bottom: 6px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: var(--day-color, var(--c-mon));
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-end;
  padding: 12px 14px;
  overflow: hidden;
  transform: rotate(var(--head-tilt, -1deg));
  transition: transform .25s ease;
}
.day-head:hover { transform: rotate(0deg) translateY(-3px); }

.day-head .day-name {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.18);
  line-height: 1;
}
.day-head .day-date {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  margin-top: 4px;
}
.day-head .mascot {
  position: absolute;
  right: -6px;
  top: -8px;
  width: 64px;
  height: 64px;
  pointer-events: none;
}
.day-head .mascot svg { width: 100%; height: 100%; }

/* Tape pieces */
.tape {
  position: absolute;
  width: 44px;
  height: 14px;
  background: rgba(255, 220, 120, .7);
  border: 1px dashed rgba(42,36,56,.4);
  border-left: 1px solid rgba(42,36,56,.2);
  border-right: 1px solid rgba(42,36,56,.2);
  transform: rotate(-12deg);
  z-index: 4;
  pointer-events: none;
}
.tape.tl { top: -6px; left: -8px; }
.tape.tr { top: -6px; right: -8px; transform: rotate(14deg); }

/* Day shelf (where blocks sit) */
.day-shelf {
  position: relative;
  flex: 1;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: rgba(255,255,255,.6);
  min-height: calc(var(--hours, 10) * var(--hour-h));
  overflow: hidden;
  isolation: isolate;
  box-shadow: inset 0 -8px 0 rgba(42,36,56,.07);
  transition: background .2s ease;
}

[data-theme="chalkboard"] .day-shelf {
  background: rgba(255,247,224,.04);
}

.day-shelf::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 12%, rgba(255,255,255,.5), transparent 30%),
    repeating-linear-gradient(0deg, transparent 0 calc(var(--hour-h) - 1px), color-mix(in srgb, var(--day-color) 22%, transparent) calc(var(--hour-h) - 1px) var(--hour-h));
  opacity: .7;
}

.day-shelf.drop-target {
  background: color-mix(in srgb, var(--day-color) 18%, white);
  outline: 3px dashed var(--day-color);
  outline-offset: -8px;
}

/* =========================================================
   Calendar blocks (paper cards)
   ========================================================= */

.block {
  position: absolute;
  left: 8px;
  right: 8px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--block-color, var(--c-tue));
  box-shadow: var(--shadow-card);
  padding: 8px 10px 18px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  z-index: 2;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  container-type: size;
  container-name: block;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
  transform: rotate(var(--rot, -0.5deg));
  will-change: transform;
}

.block:hover {
  transform: rotate(0deg) translate(-2px, -3px);
  box-shadow: 9px 11px 0 var(--ink);
  z-index: 3;
}

.block.active {
  transform: rotate(0deg) translate(-3px, -4px) scale(1.02);
  box-shadow: 12px 14px 0 var(--ink);
  z-index: 5;
}

.block.dragging {
  cursor: grabbing;
  transform: rotate(2deg) scale(1.04);
  box-shadow: 14px 18px 0 rgba(42,36,56,.5);
  z-index: 20;
  transition: none;
  pointer-events: none;
}

.block .b-time {
  align-self: flex-start;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,.55);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block .b-title {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  min-width: 0;
}

.block .b-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(42,36,56,.78);
  min-width: 0;
}
.block .b-meta > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Adaptive density — shrink/hide pieces in tight blocks */
@container block (max-height: 110px) {
  .block { padding: 6px 9px 14px; }
  .block .b-title { font-size: 14px; -webkit-line-clamp: 1; }
  .block .b-meta { font-size: 10px; }
  .block .b-type-icon { width: 18px; height: 18px; }
  .block .b-type-icon svg { width: 12px; height: 12px; }
}
@container block (max-height: 78px) {
  .block { padding: 5px 8px 10px; gap: 2px; }
  .block .b-meta { display: none; }
  .block .b-time { font-size: 9px; padding: 0 6px; }
}
@container block (max-height: 56px) {
  .block { padding: 4px 8px 6px; gap: 1px; }
  .block .b-title { font-size: 12px; -webkit-line-clamp: 1; }
  .block .b-time { font-size: 8px; padding: 0 5px; border-width: 2px; }
  .block .b-progress { display: none; }
}
@container block (max-height: 36px) {
  .block { padding: 2px 7px 3px; }
  .block .b-title { font-size: 11px; }
  .block .b-time { font-size: 7px; padding: 0 4px; }
}
@container block (max-width: 120px) {
  .block .b-meta > span:last-child { display: none; }
}

.block .b-type-icon {
  width: 22px; height: 22px;
  border-radius: 7px;
  background: #fff;
  border: 2px solid var(--ink);
  display: grid; place-items: center;
}
.block .b-type-icon svg { width: 14px; height: 14px; }

.block .b-stickers {
  position: absolute;
  bottom: 4px;
  right: 6px;
  display: flex;
  gap: 2px;
}
.block .b-stickers .sticker-mini {
  width: 22px; height: 22px;
  transform: rotate(var(--r, 0deg));
}

.block .b-progress {
  position: absolute;
  left: 8px;
  bottom: 5px;
  display: flex;
  gap: 3px;
  z-index: 2;
}
.block .b-progress .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(42,36,56,.2);
  border: 1.5px solid var(--ink);
}
.block .b-progress .dot.on { background: var(--ink); }

/* Ghost preview while dragging */
.drop-ghost {
  position: absolute;
  left: 8px; right: 8px;
  border: 3px dashed var(--ink);
  border-radius: 16px;
  background: rgba(255,255,255,.4);
  pointer-events: none;
  z-index: 1;
  transition: top .06s linear, height .06s linear;
}

/* =========================================================
   Editor panel (slides in from right)
   ========================================================= */

.editor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42,36,56,.32);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.editor-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.editor {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  width: min(460px, 100%);
  background: var(--paper);
  border-left: 4px solid var(--ink);
  box-shadow: -12px 0 0 var(--ink), -22px 0 60px rgba(0,0,0,.2);
  z-index: 40;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 1.2, .4, 1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 22px 22px max(22px, env(safe-area-inset-bottom));
}
.editor.open { transform: translateX(0); }

.editor h2 {
  font-family: "Fredoka", sans-serif;
  font-size: 26px;
  margin: 4px 0 4px;
}
.editor .e-eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-soft);
}

.editor .close-btn {
  position: absolute;
  top: 16px; right: 16px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: var(--shadow-card);
  display: grid; place-items: center;
}
.editor .close-btn svg { width: 18px; height: 18px; }

.field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}
.field > label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field input[type="text"],
.field input[type="time"],
.field select,
.field textarea {
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  box-shadow: inset 0 -3px 0 rgba(42,36,56,.06);
}
.field textarea { resize: vertical; min-height: 70px; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus {
  box-shadow: var(--shadow-card);
  transform: translate(-1px,-1px);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--c);
  border: 3px solid var(--ink);
  box-shadow: 3px 4px 0 var(--ink);
  position: relative;
  transition: transform .15s ease;
}
.swatch:hover { transform: translate(-1px,-2px) rotate(-6deg); }
.swatch.selected::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px dashed var(--ink);
}

.repeat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.repeat-chip,
.repeat-actions button {
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: 3px 4px 0 var(--ink);
  font-weight: 800;
}

.repeat-chip {
  min-width: 54px;
  padding: 8px 10px;
}

.repeat-chip.selected {
  background: var(--c-wed);
  transform: translate(-1px, -1px);
  box-shadow: 5px 6px 0 var(--ink);
}

.repeat-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.repeat-actions button {
  padding: 7px 12px;
  background: var(--paper-warm);
}

.activity-row {
  display: grid;
  grid-template-columns: 1fr 70px 36px;
  gap: 8px;
  margin-top: 8px;
  align-items: start;
}
.activity-row textarea {
  grid-column: 1 / -1;
  min-height: 48px;
}
.activity-row .remove-act {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--c-mon);
  color: #fff;
  box-shadow: 3px 4px 0 var(--ink);
  display: grid; place-items: center;
}
.activity-row .remove-act svg { width: 14px; height: 14px; stroke: #fff; }

.add-activity {
  margin-top: 10px;
  padding: 8px 14px;
  background: var(--c-wed);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.editor-actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-danger {
  padding: 12px 18px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: var(--shadow-card);
  display: inline-flex;
  gap: 8px;
  align-items: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover {
  transform: translate(-2px,-2px);
  box-shadow: 8px 10px 0 var(--ink);
}
.btn-primary:active, .btn-secondary:active, .btn-danger:active {
  transform: translate(2px,3px); box-shadow: 2px 3px 0 var(--ink);
}
.btn-primary { background: var(--c-wed); }
.btn-secondary { background: #fff; }
.btn-danger { background: var(--c-mon); color: #fff; }
.btn-danger svg { stroke: #fff; }

/* =========================================================
   Sticker tray
   ========================================================= */

.sticker-tray {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: var(--shadow-pop);
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 25;
}
.sticker-tray .tray-label {
  font-family: "Fredoka", sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 0 6px;
  color: var(--ink-soft);
}
.sticker-tray .sticker {
  width: 40px; height: 40px;
  cursor: grab;
  transition: transform .2s ease;
}
.sticker-tray .sticker:hover {
  transform: scale(1.2) rotate(-8deg);
}
.sticker-tray .sticker svg { width: 100%; height: 100%; }

.sticker.dragging-sticker {
  cursor: grabbing;
}

/* Sticker placed on a block — sits in the top-right corner, doesn't cover content */
.placed-sticker {
  position: absolute;
  width: 26px; height: 26px;
  z-index: 6;
  pointer-events: none;
  transition: transform .2s ease;
  transform: rotate(var(--rot, 0deg));
}
.placed-sticker svg { width: 100%; height: 100%; filter: drop-shadow(1.5px 2px 0 rgba(0,0,0,.22)); }
@container block (max-height: 78px) {
  .placed-sticker { width: 20px; height: 20px; }
}
@container block (max-height: 56px) {
  .placed-sticker { width: 16px; height: 16px; }
}

/* =========================================================
   Background scene (clouds, sun, stars)
   ========================================================= */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.scene .cloud,
.scene .sun-bg,
.scene .star-bg,
.scene .planet-bg {
  position: absolute;
}

.scene .cloud { width: 160px; }
.scene .cloud svg { width: 100%; }

.scene .sun-bg {
  top: 80px; right: 8%;
  width: 220px; height: 220px;
  animation: spin-slow 60s linear infinite;
}

@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes float-1 {
  0%,100% { transform: translateY(0) translateX(0); }
  50%     { transform: translateY(-18px) translateX(10px); }
}
@keyframes float-2 {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-12px); }
}
@keyframes drift {
  from { transform: translateX(-200px); }
  to   { transform: translateX(calc(100vw + 200px)); }
}

.scene .cloud-1 { top: 18%; left: -200px; animation: drift 80s linear infinite; }
.scene .cloud-2 { top: 6%;  left: -200px; animation: drift 110s linear infinite 20s; opacity: .7; }
.scene .cloud-3 { top: 38%; left: -200px; animation: drift 95s linear infinite 40s; opacity: .85; }

.scene .planet-bg {
  bottom: 8%;
  right: 4%;
  width: 90px; height: 90px;
  animation: float-1 8s ease-in-out infinite;
}

.scene .star-bg {
  animation: float-2 4s ease-in-out infinite;
}

/* =========================================================
   Confetti
   ========================================================= */

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 14px; height: 18px;
  animation: confetti-fall 1.6s cubic-bezier(.2,.6,.2,1) forwards;
  border: 2px solid var(--ink);
  border-radius: 3px;
}

@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 1; }
}

/* =========================================================
   Status toast
   ========================================================= */

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translate(-50%, -80px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 200;
  transition: transform .35s cubic-bezier(.4,1.4,.5,1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.toast.show { transform: translate(-50%, 0); }
.toast svg { stroke: var(--paper); width: 16px; height: 16px; }
.toast.has-action { padding: 8px 8px 8px 18px; gap: 14px; }
.toast .toast-msg { display: inline-flex; align-items: center; gap: 8px; }
.toast .toast-action {
  background: var(--c-tue);
  color: var(--ink);
  border: 2px solid var(--paper);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: .2px;
}
.toast .toast-action:hover { transform: translateY(-1px); }

/* =========================================================
   Inline title edit (on the lesson card)
   ========================================================= */

.block .b-title-edit {
  font: inherit;
  color: inherit;
  background: rgba(255,255,255,.85);
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 2px 6px;
  margin: 0;
  width: 100%;
  font-weight: 700;
  outline: none;
}
.block .b-title-edit:focus { background: #fff; box-shadow: 0 0 0 3px var(--c-tue); }

/* =========================================================
   Smart add modal
   ========================================================= */

.smart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42, 36, 56, .45);
  z-index: 80;
  animation: smart-fade .2s ease;
}
@keyframes smart-fade { from { opacity: 0 } to { opacity: 1 } }

.smart-modal {
  position: fixed;
  z-index: 81;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 24px 26px 22px;
  animation: smart-pop .3s cubic-bezier(.4,1.4,.5,1);
}
@keyframes smart-pop {
  from { transform: translate(-50%, -45%) scale(.96); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.smart-modal .close-btn {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--paper-warm);
  border: 2px solid var(--ink);
  display: grid; place-items: center;
  cursor: pointer;
}
.smart-modal .close-btn svg { width: 16px; height: 16px; stroke: var(--ink); }
.smart-modal h2 { font-size: 26px; margin-bottom: 4px; }
.smart-modal h2 svg { width: 22px; height: 22px; }
.smart-modal .e-eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 800;
}
.smart-help { color: var(--ink-soft); margin: 8px 0 14px; font-size: 14px; }

.smart-textarea {
  width: 100%;
  min-height: 180px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
}
.smart-textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--c-tue); }
.smart-textarea:disabled { opacity: .6; }

.smart-error {
  margin-top: 12px;
  background: #ffe1e3;
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
}

.smart-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.smart-actions .btn-primary,
.smart-actions .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  font-weight: 800;
  cursor: pointer;
}
.smart-actions .btn-primary { background: var(--c-wed); box-shadow: 4px 5px 0 var(--ink); }
.smart-actions .btn-secondary { background: var(--paper-warm); box-shadow: 3px 4px 0 var(--ink); }
.smart-actions .btn-primary:hover,
.smart-actions .btn-secondary:hover { transform: translateY(-1px); }
.smart-actions .btn-primary:disabled,
.smart-actions .btn-secondary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.smart-actions svg { width: 16px; height: 16px; stroke: var(--ink); }

.smart-summary { font-weight: 700; margin: 4px 0 10px; }
.smart-warnings {
  list-style: none;
  padding: 8px 12px;
  margin: 0 0 12px;
  background: #fff6d1;
  border: 2px dashed var(--ink);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}
.smart-warnings li { margin: 2px 0; }

.smart-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 48vh;
  overflow-y: auto;
  padding-right: 2px;
}

.smart-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  cursor: pointer;
  transition: opacity .2s ease, transform .15s ease;
}
.smart-row:hover { transform: translateY(-1px); }
.smart-row.off { opacity: .5; }
.smart-row input[type="checkbox"] {
  margin-top: 6px;
  width: 18px; height: 18px;
  accent-color: var(--c-wed);
  cursor: pointer;
}
.smart-row-color {
  width: 10px;
  align-self: stretch;
  min-height: 36px;
  border-radius: 6px;
  border: 2px solid var(--ink);
  margin-top: 2px;
}
.smart-row-body { flex: 1; min-width: 0; }
.smart-row-title {
  width: 100%;
  font-weight: 700;
  font-size: 16px;
  border: none;
  background: transparent;
  padding: 2px 0;
  color: inherit;
}
.smart-row-title:focus {
  outline: none;
  border-bottom: 2px solid var(--c-tue);
}
.smart-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}
.smart-row-icon svg { width: 16px; height: 16px; stroke: var(--ink); }
.smart-row-meta select {
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--paper-warm);
  padding: 1px 6px;
  font: inherit;
  font-size: 13px;
}
.smart-row-time { color: var(--ink); font-weight: 700; }
.smart-row-dur { opacity: .8; }
.smart-row-date {
  background: var(--c-wed);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 800;
}
.smart-row-repeat {
  background: var(--c-fri);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 800;
}

.tool-btn.tb-smart {
  background: var(--c-fri);
}

.tool-btn.tb-duplicate {
  background: var(--c-sat, #c79fff);
}
.tool-btn.tb-duplicate:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tool-btn.tb-schedule {
  background: var(--c-mon, #ff7aa9);
}
.tool-btn.tb-apply {
  background: var(--c-wed, #5cd6b1);
}
.tool-btn.tb-done-template {
  background: var(--c-thu, #ffc24c);
}

.app.mode-template {
  background-image:
    linear-gradient(180deg, rgba(255, 215, 86, 0.18), rgba(255, 215, 86, 0)),
    var(--bg, transparent);
}
.app.mode-template .topbar h1::after {
  content: " · template";
  font-size: 0.55em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 6px;
  color: var(--ink-soft, #6e5e84);
}
.app.mode-template .day-date,
.app.mode-template .sync-line,
.app.mode-template .metrics {
  display: none;
}

.template-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 22px 12px;
  padding: 12px 18px;
  background: linear-gradient(95deg, #fff0c8, #ffe6dc);
  border: 3px solid var(--ink, #2a2438);
  border-radius: 18px;
  box-shadow: 6px 7px 0 var(--ink, #2a2438);
}
.template-banner-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink, #2a2438);
}
.template-banner-text strong {
  font-size: 15px;
}
.template-banner-cta {
  background: var(--c-thu, #ffc24c);
  border: 3px solid var(--ink, #2a2438);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 3px 4px 0 var(--ink, #2a2438);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.template-banner-cta:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 5px 0 var(--ink, #2a2438);
}
.template-banner-cta:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 2px 0 var(--ink, #2a2438);
}

.template-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 22px 12px;
  padding: 14px 20px;
  background: linear-gradient(95deg, #fff7d4, #ffe1ee);
  border: 3px dashed var(--ink, #2a2438);
  border-radius: 18px;
}
.template-empty-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink, #2a2438);
}
.template-empty-text strong {
  font-size: 15px;
}
.template-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--c-mon, #ff7aa9);
  border: 3px solid var(--ink, #2a2438);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 4px 5px 0 var(--ink, #2a2438);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.template-empty-cta:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 6px 0 var(--ink, #2a2438);
}
.template-empty-cta:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 3px 0 var(--ink, #2a2438);
}
.template-empty-cta svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 720px) {
  .template-banner, .template-empty {
    margin: 8px 12px;
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .template-banner-cta, .template-empty-cta {
    align-self: flex-start;
  }
}

@media (max-width: 720px) {
  .smart-modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 20px);
    padding: 18px 16px;
    border-radius: 18px;
  }
  .smart-modal h2 { font-size: 22px; }
  .smart-textarea { min-height: 140px; }
  .smart-list { max-height: 40vh; }
  .toast .toast-action { padding: 8px 14px; min-height: 36px; }
}

/* =========================================================
   Empty / new block button on shelf
   ========================================================= */

.day-shelf .add-here {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 3px dashed var(--ink);
  background: rgba(255,255,255,.7);
  opacity: 0;
  display: grid; place-items: center;
  transition: opacity .2s ease, transform .2s ease;
}
.day-shelf:hover .add-here {
  opacity: 1;
}
.day-shelf .add-here:hover {
  transform: translateX(-50%) scale(1.1);
  background: var(--c-tue);
}

/* =========================================================
   Hour line indicator
   ========================================================= */

.now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--c-mon);
  z-index: 6;
  pointer-events: none;
}
.now-line::before {
  content: "";
  position: absolute;
  left: -7px;
  top: -6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--c-mon);
  border: 3px solid var(--ink);
}
.now-line::after {
  content: "Now";
  position: absolute;
  left: 12px;
  top: -10px;
  background: var(--c-mon);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1100px) {
  .board { grid-template-columns: 48px repeat(var(--day-count, 5), minmax(150px, 1fr)); }
  .day-head .day-name { font-size: 18px; }
  .day-head .mascot { width: 50px; height: 50px; }
}

@media (max-width: 720px) {
  :root {
    --shadow-card: 4px 5px 0 var(--ink);
    --shadow-pop: 6px 8px 0 var(--ink);
    --hour-h: 64px;
  }

  html,
  body {
    overflow-x: hidden;
    overscroll-behavior-y: auto;
  }

  .app {
    padding:
      max(12px, env(safe-area-inset-top))
      max(10px, env(safe-area-inset-right))
      max(82px, calc(72px + env(safe-area-inset-bottom)))
      max(10px, env(safe-area-inset-left));
    gap: 12px;
  }

  .topbar {
    display: grid;
    gap: 12px;
  }

  .brand {
    gap: 10px;
    min-width: 0;
  }

  .brand h1 {
    font-size: 24px;
    line-height: 1.02;
  }

  .brand .subline {
    font-size: 13px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .brand-mark svg {
    width: 30px;
    height: 30px;
  }

  .toolbar {
    gap: 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding: 2px 2px 8px;
    margin-inline: -2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .toolbar::-webkit-scrollbar {
    display: none;
  }

  .tool-btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 9px 13px;
    font-size: 14px;
    box-shadow: 4px 5px 0 var(--ink);
  }

  .tool-btn:hover {
    transform: none;
    box-shadow: 4px 5px 0 var(--ink);
  }

  .tool-btn.account-chip {
    max-width: 190px;
  }

  .sync-line {
    margin-top: -4px;
    font-size: 12px;
  }

  .metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .metric {
    min-width: 0;
    padding: 10px 8px 10px 42px;
    border-width: 2px;
    border-radius: 16px;
    box-shadow: 3px 4px 0 var(--ink);
  }

  .metric .m-icon {
    left: 8px;
    width: 26px;
    height: 26px;
    border-width: 2px;
    border-radius: 8px;
  }

  .metric .m-icon svg {
    width: 15px;
    height: 15px;
  }

  .metric .m-value {
    font-size: 19px;
  }

  .metric .m-label {
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  .board-wrap {
    min-height: auto;
    overflow-x: auto;
    overflow-y: visible;
    margin-inline: -10px;
    padding: 0 10px 12px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .board-wrap::-webkit-scrollbar {
    display: none;
  }

  .board {
    min-width: 680px;
    grid-template-columns: 44px repeat(var(--day-count, 5), minmax(116px, 1fr));
    gap: 8px;
    padding: 10px;
    border-width: 2px;
    border-radius: 20px;
    box-shadow: 5px 6px 0 var(--ink);
    contain: layout paint;
  }

  .time-axis {
    padding-top: 78px;
  }

  .time-axis .time-tick {
    font-size: 10px;
    padding-right: 4px;
  }

  .day-col {
    scroll-snap-align: start;
  }

  .day-head {
    height: 78px;
    margin-bottom: 5px;
    padding: 9px 10px;
    border-width: 2px;
    border-radius: 16px;
    transform: none;
  }

  .day-head:hover {
    transform: none;
  }

  .day-head .day-name {
    font-size: 18px;
  }

  .day-head .day-date {
    font-size: 11px;
  }

  .day-head .mascot {
    width: 42px;
    height: 42px;
  }

  .tape {
    display: none;
  }

  .day-shelf {
    border-width: 2px;
    border-radius: 16px;
    min-height: calc(var(--hours, 10) * var(--hour-h));
  }

  .block {
    border-width: 2px;
    border-radius: 13px;
    padding: 7px 8px 16px;
    box-shadow: 3px 4px 0 var(--ink);
    transform: none;
    transition: none;
  }

  .block:hover,
  .block.active {
    transform: none;
    box-shadow: 4px 5px 0 var(--ink);
  }

  .block.dragging {
    transform: scale(1.02);
    box-shadow: 6px 8px 0 rgba(42,36,56,.45);
  }

  .block .b-time {
    font-size: 9px;
    padding: 1px 5px;
    border-width: 1.5px;
  }

  .block .b-title {
    font-size: 13px;
  }

  .block .b-meta {
    font-size: 10px;
  }

  .drop-ghost {
    border-width: 2px;
    border-radius: 13px;
  }

  .day-shelf .add-here {
    opacity: 1;
    width: 34px;
    height: 34px;
    border-width: 2px;
  }

  .editor {
    width: 100vw;
    width: 100dvw;
    border-left: 0;
    border-top: 3px solid var(--ink);
    box-shadow: 0 -8px 0 var(--ink), 0 -18px 44px rgba(0,0,0,.2);
    padding:
      max(18px, env(safe-area-inset-top))
      max(14px, env(safe-area-inset-right))
      max(92px, calc(76px + env(safe-area-inset-bottom)))
      max(14px, env(safe-area-inset-left));
  }

  .editor h2 {
    font-size: 22px;
    padding-right: 42px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .field input[type="text"],
  .field input[type="time"],
  .field select,
  .field textarea,
  .auth-field input {
    font-size: 16px;
  }

  .activity-row {
    grid-template-columns: 1fr 64px 36px;
  }

  .editor-actions {
    position: sticky;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 3;
    padding-top: 8px;
    background: linear-gradient(to top, var(--paper) 72%, transparent);
  }

  .sticker-tray {
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    transform: none;
    width: auto;
    max-width: none;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 7px 10px;
    gap: 8px;
    border-width: 2px;
    box-shadow: 4px 5px 0 var(--ink);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sticker-tray::-webkit-scrollbar {
    display: none;
  }

  .sticker-tray .tray-label {
    display: none;
  }

  .sticker-tray .sticker {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
  }

  .sticker-tray .sticker:hover {
    transform: none;
  }

  .scene .cloud,
  .scene .planet-bg,
  .scene .star-bg {
    display: none;
  }

  .scene .sun-bg {
    top: 70px;
    right: -34px;
    width: 150px;
    height: 150px;
    animation: none;
    opacity: .72;
  }

  .toast {
    top: max(12px, env(safe-area-inset-top));
    max-width: calc(100vw - 28px);
    text-align: center;
  }

  .auth-page {
    align-items: start;
    padding:
      max(18px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(18px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-card {
    margin-top: 42px;
    padding: 20px;
    border-radius: 22px;
    box-shadow: 6px 8px 0 var(--ink);
  }

  .auth-brand h1 {
    font-size: 27px;
  }

  .auth-tabs {
    gap: 8px;
  }

  .auth-tabs button {
    min-height: 44px;
    padding: 8px 10px;
    box-shadow: 3px 4px 0 var(--ink);
  }
}

/* Print */
@media print {
  html, body, .board, .board *, .day-head, .day-shelf, .block {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .scene, .sticker-tray, .toolbar, .editor, .editor-backdrop, .toast, .confetti-layer, .smart-modal, .smart-backdrop { display: none; }
  body { background: #fff; }
  .board { box-shadow: none; }
}
