/* A note for tomorrow: a square canary sticky in the margin beside the scene the writer stopped in, a touch
   crooked, its sticky top edge a shade darker. Writing it is the same sticky, bigger, in a dialog. */
.tomorrow { display: contents; }

.tomorrow__sticky {
  position: absolute;
  left: calc(100% + 1.4rem);
  z-index: 2;
  width: 11.5rem;
  min-height: 9rem;
  padding: 1.1rem 0.9rem 0.6rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(to bottom, rgb(0 0 0 / 0.05) 0 0.9rem, transparent 0.9rem),
    linear-gradient(to top left, rgb(0 0 0 / 0.08), transparent 30%),
    #fff59d;
  color: #2b2a24;
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.15), 3px 8px 14px rgb(0 0 0 / 0.28);
  rotate: 2deg;
  color-scheme: light;
}
.tomorrow__sticky--fresh { animation: sticky-pressed 450ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
@keyframes sticky-pressed { from { opacity: 0; scale: 1.2; translate: 1rem -0.6rem; } }

.tomorrow__body { margin: 0; font: 1.2rem/1.3 var(--font-hand); overflow-wrap: anywhere; }
.tomorrow__label { font-weight: 700; }
.tomorrow__when { margin: 0.4rem 0 0; color: #7a6f45; font: 0.9rem/1 var(--font-hand); }

.tomorrow__tear { margin: auto 0 0; padding-top: 0.5rem; text-align: right; }
.tomorrow__done {
  padding: 0.15rem 0.5rem;
  border: 0;
  border-radius: 4px;
  background: none;
  color: #5c5330;
  font: 0.95rem var(--font-hand);
  cursor: pointer;
}
.tomorrow__done:hover, .tomorrow__done:focus-visible { background: rgb(0 0 0 / 0.07); color: #2b2a24; }

/* No room in the margin: stuck on the paper's edge, smaller. */
@container (max-width: 64rem) {
  .tomorrow__sticky { left: auto; right: -0.6rem; width: 9.5rem; min-height: 0; padding-top: 0.9rem; margin-top: 2.2rem; }
  .tomorrow__body { font-size: 1.05rem; }
}
@container (max-width: 30rem) {
  .tomorrow__sticky { right: -0.4rem; width: 7.5rem; padding: 0.75rem 0.55rem 0.3rem; }
  .tomorrow__body { font-size: 0.92rem; line-height: 1.25; }
  .tomorrow__done { font-size: 0.85rem; }
}

/* Writing it. */
.tomorrow-pad {
  width: min(22rem, calc(100vw - 32px));
  margin: 14vh auto auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  color-scheme: light;
}
.tomorrow-pad::backdrop { background: rgb(0 0 0 / 0.45); }
.tomorrow-pad[open] .tomorrow-pad__sticky { animation: sticky-pressed 350ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }

.tomorrow-pad__sticky {
  padding: 1.4rem 1.25rem 1rem;
  background:
    linear-gradient(to bottom, rgb(0 0 0 / 0.05) 0 1.1rem, transparent 1.1rem),
    linear-gradient(to top left, rgb(0 0 0 / 0.08), transparent 30%),
    #fff59d;
  color: #2b2a24;
  box-shadow: 0 2px 2px rgb(0 0 0 / 0.15), 6px 18px 40px rgb(0 0 0 / 0.45);
  rotate: -1deg;
  font-family: var(--font-hand);
}
.tomorrow-pad__heading { margin: 0; font: 800 1.1rem/1.4 var(--font-ui); }
.tomorrow-pad__scene { margin: 0.3rem 0 0; color: #6b6030; font-size: 0.9rem; text-transform: uppercase; overflow-wrap: anywhere; }
.tomorrow-pad__writing {
  display: block;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: max(16px, 1.35rem) / 1.35 var(--font-hand);
  resize: none;
  outline: none;
}
.tomorrow-pad__writing::placeholder { color: rgb(43 42 36 / 0.4); }
.tomorrow-pad__hint { margin: 0.5rem 0 0; color: #6b6030; font: 0.85rem/1.35 var(--font-ui); }
.tomorrow-pad__actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.9rem; }
.tomorrow-pad__button {
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 6px;
  background: #2b2a24;
  color: #fff59d;
  font: 1rem var(--font-hand);
  cursor: pointer;
}
.tomorrow-pad__button--quiet { background: none; color: inherit; }
.tomorrow-pad__button--quiet:hover { background: rgb(0 0 0 / 0.07); }
.tomorrow-pad__button kbd { margin-left: 0.4em; font: inherit; font-size: 0.85em; opacity: 0.7; }

@media (hover: none) and (max-width: 40rem) {
  .tomorrow-pad__button kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .tomorrow__sticky--fresh, .tomorrow-pad[open] .tomorrow-pad__sticky { animation: none; }
}
@media print {
  .tomorrow, .tomorrow-pad { display: none !important; }
}
