/* V7 daily scene only. Keep the source worksheet, fitPaper and zoom geometry intact. */
.daily-scene .open-keyword-door {
  position:relative;
  isolation:isolate;
  perspective:850px;
  padding-left:14px;
}
.daily-scene .open-keyword-door::before {
  content:"";
  position:absolute;
  left:8px;
  top:50%;
  transform:translateY(-50%);
  width:calc(100% - 8px);
  height:min(400px,100%);
  border:7px solid #a87955;
  border-radius:5px;
  background:#523b30;
  box-shadow:inset 9px 5px 16px #251c19aa,0 2px 0 #fff6;
  pointer-events:none;
}
.daily-scene .open-keyword-door::after {
  content:"";
  position:absolute;
  left:9px;
  top:50%;
  transform:translateY(-50%);
  width:8px;
  height:min(380px,calc(100% - 12px));
  border-radius:2px;
  background:linear-gradient(to bottom,#9b7956 15%,#d0ad71 15% 23%,#9b7956 23% 77%,#d0ad71 77% 85%,#9b7956 85%);
  box-shadow:1px 0 2px #34251f88;
  pointer-events:none;
}
.daily-scene .open-door-panel {
  z-index:1;
  transform-origin:left center;
  transform:rotateY(27deg);
  border-radius:5px;
  box-shadow:7px 9px 12px #271c2344;
}
.daily-scene .open-door-panel::after {
  content:"";
  position:absolute;
  top:-3px;
  right:-8px;
  width:6px;
  height:calc(100% + 6px);
  background:#8c342d;
  border-radius:0 3px 3px 0;
  transform:skewY(-8deg);
  transform-origin:left top;
  pointer-events:none;
}
@media (min-width:651px) {
  .daily-scene .editor-layout {
    /* A portrait-sized desk, not a landscape box around a portrait sheet.
       410px accounts for the door, tools, gaps and the existing fitPaper inset. */
    width:min(100%,calc(70.7dvh + 410px));
    margin-inline:auto;
  }
  .daily-scene .scene-stage { grid-template-rows:minmax(0,1fr); }
  .daily-scene .open-door-panel { min-height:min(400px,100%); }
}
@media (min-width:651px) and (max-height:700px) {
  .daily-scene .editor-header { min-height:64px; padding-block:8px; }
  .daily-scene .daily-garland { flex-basis:54px; }
  .daily-scene .daily-garland svg { height:30px; }
  .daily-scene .garland-charm { width:32px; height:43px; top:calc(var(--charm-drop) * .36); }
  .daily-scene .garland-charm::before { height:5px; flex-basis:5px; }
  .daily-scene .garland-charm img { max-width:32px; max-height:38px; }
  .daily-scene .editor-layout { width:min(100%,calc(70.7dvh + 455px)); }
}
@media (max-width:650px) {
  /* Stack the keyword doorway above the paper rather than stealing a third
     of a phone's drawing width. The original tools still lead the scene. */
  .daily-scene .scene-stage { grid-template-columns:minmax(0,1fr); gap:12px; }
  .daily-scene .open-keyword-door {
    position:relative;
    top:auto;
    justify-self:center;
    width:min(300px,calc(100% - 12px));
    height:112px;
    padding:0 0 0 14px;
  }
  .daily-scene .open-keyword-door::before { height:112px; }
  .daily-scene .open-keyword-door::after { height:100px; }
  .daily-scene .open-door-panel {
    flex-direction:row;
    gap:8px;
    min-height:112px;
    max-height:none;
    padding:10px;
    transform:rotateY(18deg);
  }
  .daily-scene .door-keyword {
    writing-mode:horizontal-tb;
    font-size:24px;
    letter-spacing:.03em;
    max-width:88px;
    line-height:1.3;
  }
  .daily-scene .door-english { font-size:10px; max-width:66px; }
  .daily-scene #door-art { display:block; max-width:42px; max-height:64px; margin:0; }
  .daily-scene button,.daily-scene summary,.daily-scene input,.daily-scene #resources summary { min-height:44px; }
}

/* Undo stays outside the collapsed fine-tools, before all drawing modes. */
.daily-scene .undo-step{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;padding:10px 12px;margin:0 0 8px;border:1px solid var(--green);border-radius:7px;background:var(--paper);color:var(--green);font:700 13px var(--font);cursor:pointer;flex:none}
.daily-scene .undo-step:disabled{color:#716b60;border-color:#b9ae99;background:#f1eadc;cursor:default}
.daily-scene .undo-step:not(:disabled):hover{background:#e8efe7}
@media(min-width:651px){.daily-scene .palette{grid-template-columns:repeat(auto-fit,minmax(44px,1fr))}}
@media(max-width:650px){.daily-scene .paper-scroll{overscroll-behavior:auto}.daily-scene .tools-panel>.undo-step{order:0;margin:0}.daily-scene .tools-panel>.palette{justify-content:flex-start;padding:2px;min-height:48px}}
