/*
 * Journal prompt deck (tools.ts): a deck on the stage's glass with one card face up on top. A card is the app's: a
 * warm surface lit from above in its theme's star colour, the prompt in the site's italic serif, a star and the card's
 * number in two corners like a playing card's. Drawing tosses the card aside and turns the next one over as it lands;
 * a kept card wears the amber glow of the thing the magpie holds. On paper the whole deck, or the kept cards, print as
 * cards to cut out: dark ink, dashed lines, no sky. Under Reduce Motion nothing moves (site.css stops it all).
 */

.tool-journal-prompts {
  --card-radius: 26px;
  --deal: cubic-bezier(0.2, 0.9, 0.25, 1.1);
  --toss: cubic-bezier(0.3, 0.7, 0.45, 1);
  --lit-fill: linear-gradient(180deg, #ffd08a, #ff9a4d);
  --face-top: #563c32;
  --face-mid: #402c25;
  --face-bottom: #30211c;
  --back-top: #3c251f;
  --back-bottom: #211519;
  --stage-pad: clamp(20px, 4vw, 36px);
  --card-width: 21.5rem;
}

/* Each theme wears a star of the sky, and a darker ink of it on paper. */

.theme-all {
  --tone: #ffb071;
  --tone-rgb: 255 176 113;
  --ink-tone: #8a3a0c;
}

.theme-head {
  --tone: #ffe7d1;
  --tone-rgb: 255 231 209;
  --ink-tone: #6e5242;
}

.theme-today {
  --tone: #ff9a4d;
  --tone-rgb: 255 154 77;
  --ink-tone: #a8480c;
}

.theme-wins {
  --tone: #f0c25a;
  --tone-rgb: 240 194 90;
  --ink-tone: #875f00;
}

.theme-people {
  --tone: #5fd0c2;
  --tone-rgb: 95 208 194;
  --ink-tone: #11665d;
}

.theme-plans {
  --tone: #c4a2f0;
  --tone-rgb: 196 162 240;
  --ink-tone: #5d3f95;
}

.theme-felt {
  --tone: #f28aa2;
  --tone-rgb: 242 138 162;
  --ink-tone: #a12e4a;
}

/* The star every icon here is drawn from, defined once; and words for a screen reader alone. */

.jp-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.jp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip-path: inset(50%);
}

/* The stage keeps a tossed card and a riffled deck inside its glass. */
.jp-stage {
  overflow: hidden;
  overflow: clip;
}

.jp-noscript {
  margin: 0 0 24px;
  padding: 18px 22px;
  color: var(--ink-2);
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.jp-noscript p {
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 700;
}

.jp-noscript ul {
  margin: 0;
  padding-left: 1.2em;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-style: italic;
  line-height: 1.5;
}

.jp-noscript li::marker {
  color: var(--accent);
}

/* Themes: a chip each, with its star's colour; one row that scrolls on a phone. */

.jp-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 clamp(26px, 4vw, 40px);
}

.jp-chip {
  gap: 8px;
  white-space: nowrap;
}

.jp-dot {
  flex: none;
  width: 9px;
  height: 9px;
  background: var(--tone);
  border-radius: 50%;
  box-shadow: 0 0 8px rgb(var(--tone-rgb) / 0.65);
}

.jp-chip[aria-pressed="true"] .jp-dot {
  box-shadow: 0 0 0 2px rgb(43 30 26 / 0.6);
}

@media (max-width: 719px) {
  .jp-themes {
    flex-wrap: nowrap;
    justify-content: flex-start;
    margin-right: calc(-1 * var(--stage-pad));
    margin-left: calc(-1 * var(--stage-pad));
    padding: 6px var(--stage-pad);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(
      90deg,
      transparent,
      #000 16px,
      #000 calc(100% - 30px),
      transparent
    );
    mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 30px), transparent);
  }

  .jp-themes::-webkit-scrollbar {
    display: none;
  }

  .jp-themes::after {
    flex: none;
    width: 1px;
    content: "";
  }

  .jp-chip {
    flex: none;
  }
}

/* The play: the deck with its controls, and the page to write on; side by side where there is room. */

.jp-play {
  display: grid;
  gap: clamp(30px, 6vw, 44px);
}

@media (min-width: 860px) {
  .jp-play {
    grid-template-columns: var(--card-width) minmax(0, 1fr);
    align-items: start;
    gap: 46px;
  }
}

.jp-deal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Warm light on the table, under the deck. */
.jp-deal::before {
  position: absolute;
  top: -12%;
  left: 50%;
  width: 150%;
  height: 92%;
  background: radial-gradient(closest-side, rgb(255 154 77 / 0.15), transparent);
  transform: translateX(-50%);
  pointer-events: none;
  content: "";
}

/* The table: the deck, two cards of it showing under the one in play. */

.jp-table {
  position: relative;
  z-index: 1;
  width: min(100% - 28px, var(--card-width));
  aspect-ratio: 5 / 7;
  margin-top: 4px;
  perspective: 1600px;
}

@media (min-width: 860px) {
  .jp-table {
    width: 100%;
  }
}

.jp-table::before,
.jp-table::after {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgb(255 154 77 / 0.12), transparent 60%),
    linear-gradient(170deg, var(--back-top), var(--back-bottom));
  border: 1px solid rgb(255 176 113 / 0.26);
  border-radius: var(--card-radius);
  box-shadow: 0 26px 48px -28px rgb(0 0 0 / 0.9);
  transition: transform 420ms var(--spring);
  content: "";
}

.jp-table::before {
  transform: translate(-12px, 7px) rotate(-5deg);
}

.jp-table::after {
  transform: translate(10px, 11px) rotate(3.5deg);
}

/* About to draw: the deck's top card shifts, ready. */
@media (hover: hover) {
  .jp-deal:has(.jp-draw:hover) .jp-table::after {
    transform: translate(16px, 4px) rotate(6deg);
  }
}

.jp-card {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-style: preserve-3d;
}

.jp-card.is-down {
  cursor: pointer;
}

.jp-tilt {
  width: 100%;
  height: 100%;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform 520ms var(--ease-out);
}

.jp-tilt.is-tilting {
  transition-duration: 140ms;
}

.jp-flip {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 700ms var(--deal);
}

.jp-card.is-down .jp-flip {
  transform: rotateY(180deg);
}

.jp-card.is-instant .jp-flip {
  transition: none;
}

.jp-face {
  position: absolute;
  inset: 0;
  border-radius: var(--card-radius);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* The face: a warm card lit from above in its theme's colour, framed like a playing card. */

.jp-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 30px 96px;
  color: var(--ink);
  text-align: center;
  background:
    radial-gradient(140% 80% at 50% -8%, rgb(var(--tone-rgb) / 0.2), transparent 60%),
    linear-gradient(172deg, var(--face-top) 0%, var(--face-mid) 55%, var(--face-bottom) 100%);
  border: 1px solid rgb(255 226 200 / 0.2);
  box-shadow:
    inset 0 1px 0 rgb(255 244 234 / 0.16),
    0 40px 70px -34px rgb(0 0 0 / 0.9),
    0 12px 26px -16px rgb(0 0 0 / 0.65);
  transition:
    border-color 320ms ease,
    box-shadow 320ms ease;
}

.jp-front::before {
  position: absolute;
  inset: 12px;
  border: 1px solid rgb(var(--tone-rgb) / 0.3);
  border-radius: 16px;
  pointer-events: none;
  transition: border-color 320ms ease;
  content: "";
}

/* A sheen that follows the pointer (journal-prompts.js sets where). */
.jp-front::after {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at var(--mx, 50%) var(--my, 0%),
    rgb(255 244 234 / 0.13),
    transparent 46%
  );
  border-radius: inherit;
  opacity: var(--shine, 0);
  pointer-events: none;
  transition: opacity 320ms ease;
  content: "";
}

.jp-card.is-kept .jp-front,
.jp-ghost.is-kept .jp-front {
  border-color: var(--lit);
  box-shadow:
    inset 0 1px 0 rgb(255 244 234 / 0.2),
    0 0 0 1px var(--lit),
    0 0 54px -6px var(--lit-glow),
    0 40px 70px -34px rgb(0 0 0 / 0.9);
}

.jp-card.is-kept .jp-front::before,
.jp-ghost.is-kept .jp-front::before {
  border-color: rgb(255 176 113 / 0.55);
}

.jp-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  color: var(--tone);
  font-size: 0.8125rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.jp-corner svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  filter: drop-shadow(0 0 5px rgb(var(--tone-rgb) / 0.75));
}

.jp-corner-top {
  top: 26px;
  left: 26px;
}

.jp-corner-bottom {
  right: 26px;
  bottom: 26px;
  transform: rotate(180deg);
}

.jp-kicker {
  margin: 0;
  color: var(--tone);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.jp-prompt {
  margin: 14px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.5rem, 1.25rem + 0.85vw, 1.9375rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.24;
  text-wrap: balance;
}

.jp-prompt.is-long {
  font-size: clamp(1.375rem, 1.15rem + 0.7vw, 1.6875rem);
}

/* Keep: a star on the card. Kept, it fills with the amber of the thing the magpie holds. */

.jp-keep {
  position: absolute;
  bottom: 30px;
  left: 50%;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 20px 8px 15px;
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 800;
  background: rgb(255 236 220 / 0.08);
  border: 1px solid rgb(255 220 190 / 0.22);
  border-radius: 999px;
  cursor: pointer;
  transform: translateX(-50%);
  transition:
    color 200ms ease,
    background-color 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease,
    transform 200ms var(--spring);
  -webkit-tap-highlight-color: transparent;
}

.jp-keep svg {
  width: 18px;
  height: 18px;
  overflow: visible;
  fill: none;
  stroke: var(--accent-text);
  stroke-width: 1.8;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .jp-keep:hover {
    background: rgb(255 236 220 / 0.14);
    border-color: rgb(255 176 113 / 0.5);
  }
}

.jp-keep:active {
  transform: translateX(-50%) scale(0.95);
}

.jp-keep[aria-pressed="true"] {
  color: var(--on-accent);
  background: var(--lit-fill);
  border-color: transparent;
  box-shadow:
    0 0 0 4px rgb(255 154 77 / 0.2),
    0 10px 30px -6px var(--lit-glow);
}

.jp-keep[aria-pressed="true"] svg {
  fill: var(--on-accent);
  stroke: var(--on-accent);
}

.jp-keep.pop svg,
.jp-mark.pop svg {
  animation: jp-star 560ms var(--spring);
}

@keyframes jp-star {
  40% {
    transform: scale(1.75) rotate(30deg);
  }
}

/* The back: the deck's own, a constellation around one amber star. */

.jp-back {
  background:
    repeating-linear-gradient(45deg, rgb(255 220 190 / 0.032) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(-45deg, rgb(255 220 190 / 0.032) 0 1px, transparent 1px 12px),
    linear-gradient(170deg, var(--back-top), var(--back-bottom));
  border: 1px solid rgb(255 176 113 / 0.34);
  box-shadow:
    inset 0 1px 0 rgb(255 244 234 / 0.1),
    0 40px 70px -34px rgb(0 0 0 / 0.9),
    0 12px 26px -16px rgb(0 0 0 / 0.65);
  transform: rotateY(180deg);
}

.jp-back::before {
  position: absolute;
  inset: 12px;
  border: 1px solid rgb(255 176 113 / 0.3);
  border-radius: 16px;
  content: "";
}

.jp-back-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.jp-back-star {
  transform-box: fill-box;
  transform-origin: center;
}

.jp-back-word {
  position: absolute;
  right: 0;
  bottom: 42px;
  left: 0;
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
}

/* Waiting for the first draw: the card breathes. */
.jp-card.is-waiting {
  animation: jp-bob 3.4s ease-in-out infinite;
}

.jp-card.is-waiting .jp-back-star {
  animation: jp-breathe 2.6s ease-in-out infinite;
}

@keyframes jp-bob {
  50% {
    transform: translateY(-7px) rotate(-0.8deg);
  }
}

@keyframes jp-breathe {
  50% {
    opacity: 0.8;
    transform: scale(1.14);
  }
}

/* A deal: the card leaves the deck, lifts as it turns over, and lands. The old one is tossed aside. */
.jp-card.is-dealing {
  animation: jp-deal 700ms var(--deal);
}

@keyframes jp-deal {
  0% {
    transform: translate(10px, 11px) rotate(3.5deg) scale(0.97);
  }

  42% {
    transform: translate(0, -22px) rotate(-1.5deg) scale(1.045);
  }
}

.jp-ghost {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  animation: jp-toss 440ms var(--toss) forwards;
}

.jp-ghost .jp-front {
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
}

/* A flick: quick off the top, so the new card is seen as soon as it turns. */
@keyframes jp-toss {
  30% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-92%, 10%) rotate(-18deg) scale(0.92);
  }
}

/* A shuffle: the deck riffles out and back, and the card in play hops over to join it. */
.jp-table.is-shuffling::before {
  animation: jp-riffle-left 760ms var(--deal);
}

.jp-table.is-shuffling::after {
  animation: jp-riffle-right 760ms var(--deal);
}

.jp-card.is-shuffling {
  animation: jp-hop 760ms var(--deal);
}

@keyframes jp-riffle-left {
  45% {
    transform: translate(-56%, -3%) rotate(-14deg);
  }
}

@keyframes jp-riffle-right {
  45% {
    transform: translate(56%, 2%) rotate(12deg);
  }
}

@keyframes jp-hop {
  45% {
    transform: translateY(-18px) scale(0.98);
  }
}

/* Under the deck: shuffle and draw, how far in you are, and what you kept. */

.jp-controls {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: clamp(30px, 5vw, 36px);
}

.jp-draw {
  min-width: 10.5rem;
}

.tool-journal-prompts .tool-button svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jp-shuffle.pop svg {
  animation: jp-spin 760ms var(--deal);
}

@keyframes jp-spin {
  to {
    transform: rotate(360deg);
  }
}

.jp-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  justify-content: center;
  margin: 16px 0 0;
  color: var(--ink-3);
  font-size: 0.875rem;
  font-weight: 700;
}

.jp-drawn .tool-count {
  color: var(--ink);
  font-weight: 850;
}

.jp-kept-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 34px;
  padding: 4px 13px 4px 11px;
  color: var(--ink-2);
  text-decoration: none;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition:
    color 200ms ease,
    background-color 200ms ease,
    border-color 200ms ease;
}

.jp-kept-link svg {
  width: 13px;
  height: 13px;
  fill: var(--ink-4);
  transition: fill 200ms ease;
}

.jp-kept-link .tool-count {
  font-weight: 850;
}

@media (hover: hover) {
  .jp-kept-link:hover {
    color: var(--ink);
  }
}

.jp-kept-link.has-kept {
  color: var(--accent-text);
  background: rgb(255 138 51 / 0.1);
  border-color: rgb(255 176 113 / 0.42);
}

.jp-kept-link.has-kept svg {
  fill: var(--lit);
  filter: drop-shadow(0 0 5px var(--lit-glow));
}

.jp-note {
  position: relative;
  z-index: 1;
  max-width: 22rem;
  min-height: 1.45em;
  margin: 12px auto 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.45;
  text-align: center;
}

/* The page to write on: lined like a notebook, the prompt beside it (or over it, on a phone). */

.jp-write {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.jp-write-head {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 12px;
}

.jp-write-label {
  color: var(--ink);
  font-size: 1.1875rem;
  font-weight: 800;
}

.jp-write-hint {
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.jp-echo {
  margin: 0 0 14px;
  padding: 2px 0 2px 14px;
  color: var(--ink-2);
  font-family: var(--serif);
  font-size: 1.125rem;
  font-style: italic;
  line-height: 1.4;
  border-left: 2px solid var(--tone);
}

textarea.jp-field {
  min-height: 13rem;
  padding: 13px 18px;
  font-size: 1.0625rem;
  line-height: 1.75;
  background-color: rgb(20 13 15 / 0.55);
  background-image: linear-gradient(
    transparent calc(100% - 1px),
    rgb(255 220 190 / 0.08) calc(100% - 1px)
  );
  background-attachment: local;
  background-position: 0 13px;
  background-size: 100% 1.75em;
  caret-color: var(--accent);
}

@media (min-width: 860px) {
  .jp-echo {
    display: none;
  }

  textarea.jp-field {
    /* As tall as the card beside it, less the label over it: the page ends where the card does. */
    min-height: calc(var(--card-width) * 7 / 5 - 2.45rem);
  }
}

/* The way to a page: a track that fills, and a star that lights at 10, 25, 50 and 100 words. */

.jp-progress {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 16px;
  padding-bottom: 14px;
}

.jp-count {
  flex: none;
  min-width: 5.25rem;
  margin: 0;
  color: var(--ink-3);
  font-size: 0.9375rem;
  font-weight: 700;
}

.jp-count .tool-count {
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 850;
}

.jp-track {
  position: relative;
  flex: 1;
  height: 6px;
  margin: 0 10px 0 4px;
  background: rgb(255 236 220 / 0.09);
  border-radius: 999px;
}

.jp-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #ff9a4d, #ffd08a);
  border-radius: inherit;
  box-shadow: 0 0 12px rgb(255 154 77 / 0.55);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 360ms var(--ease-out);
}

.jp-mark {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
}

.jp-mark.at-10 {
  left: 10%;
}

.jp-mark.at-25 {
  left: 25%;
}

.jp-mark.at-50 {
  left: 50%;
}

.jp-mark.at-100 {
  left: 100%;
}

.jp-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: #4a372f;
  stroke: rgb(255 220 190 / 0.3);
  stroke-width: 1.4;
  transition:
    fill 240ms ease,
    stroke 240ms ease;
}

.jp-mark.is-on svg {
  fill: url(#jp-gold);
  stroke: rgb(255 208 138 / 0.9);
  filter: drop-shadow(0 0 6px rgb(255 154 77 / 0.9));
}

.jp-mark-label {
  position: absolute;
  top: 23px;
  left: 50%;
  color: var(--ink-4);
  font-size: 0.6875rem;
  font-weight: 800;
  white-space: nowrap;
  transform: translateX(-50%);
  transition: color 240ms ease;
}

.jp-mark.at-100 .jp-mark-label {
  right: -4px;
  left: auto;
  transform: none;
}

.jp-mark.is-on .jp-mark-label {
  color: var(--accent-text);
}

.jp-cheer {
  min-height: 1.5em;
  margin: 8px 0 0;
  color: var(--accent-text);
  font-size: 0.9375rem;
  font-weight: 800;
}

.jp-write-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

@media (max-width: 859px) {
  .jp-write-actions {
    justify-content: center;
  }
}

.tool-button.jp-copy.is-done {
  color: var(--on-accent);
  background: var(--private);
  box-shadow: 0 10px 26px -12px rgb(95 208 194 / 0.9);
}

/* Your prompts: the kept cards, small, in their own colours. */

.jp-kept {
  margin-top: clamp(38px, 6vw, 54px);
  padding-top: clamp(26px, 4vw, 34px);
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.jp-kept-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  justify-content: space-between;
}

.jp-kept-title {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0;
  font-size: clamp(1.3125rem, 1.2rem + 0.5vw, 1.5rem);
  font-weight: 800;
  line-height: 1.2;
}

.jp-kept-title:focus {
  outline: none;
}

.tool-count.jp-kept-count {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 850;
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition:
    color 240ms ease,
    background-color 240ms ease,
    box-shadow 240ms ease;
}

.jp-kept.has-kept .jp-kept-count {
  color: var(--on-accent);
  background: var(--lit-fill);
  border-color: transparent;
  box-shadow: 0 0 22px -2px var(--lit-glow);
}

/* The badge's own pop: it swells and glows, its number staying dark on the amber. */
.tool-count.jp-kept-count.pop {
  animation: jp-badge 480ms var(--spring);
}

@keyframes jp-badge {
  40% {
    box-shadow: 0 0 34px 2px var(--lit-glow);
    transform: scale(1.3);
  }
}

.jp-kept-hint {
  margin: 0;
  color: var(--ink-3);
  font-size: 0.9375rem;
}

.jp-kept-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr));
  gap: 14px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.jp-kept-list:empty {
  display: none;
}

.jp-kept-empty {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  margin: 20px 0 0;
  padding: 18px 22px;
  color: var(--ink-3);
  font-size: 0.9375rem;
  line-height: 1.45;
  text-align: center;
  border: 1.5px dashed rgb(255 220 190 / 0.2);
  border-radius: 18px;
}

.jp-kept-empty svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: var(--ink-4);
}

.jp-mini {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 9.5rem;
  margin: 0;
  padding: 16px 16px 10px 18px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgb(var(--tone-rgb) / 0.16), transparent 60%),
    linear-gradient(172deg, #4b332b, #33241f);
  border: 1px solid rgb(255 226 200 / 0.16);
  border-radius: 18px;
  box-shadow: 0 20px 40px -26px rgb(0 0 0 / 0.85);
  transition:
    border-color 260ms ease,
    box-shadow 260ms ease;
}

.jp-mini.is-current {
  border-color: var(--lit);
  box-shadow:
    0 0 0 1px var(--lit),
    0 0 32px -8px var(--lit-glow);
}

.jp-mini-kicker {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 0;
  color: var(--tone);
  font-size: 0.6875rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.jp-mini-kicker svg {
  flex: none;
  width: 11px;
  height: 11px;
  fill: currentColor;
}

.jp-mini-prompt {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  font-style: italic;
  font-weight: 500;
  line-height: 1.32;
}

.jp-mini-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: auto -8px 0;
  padding-top: 6px;
}

.jp-mini-actions button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  color: var(--ink-3);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 750;
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

@media (hover: hover) {
  .jp-mini-actions button:hover {
    color: var(--ink);
    background: var(--well);
  }
}

.jp-mini-actions .jp-mini-write {
  color: var(--accent-text);
}

.jp-mini-actions svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jp-mini.is-leaving {
  pointer-events: none;
  animation: jp-leave 280ms ease forwards;
}

@keyframes jp-leave {
  to {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
  }
}

/* On a phone the two print buttons stack, the same width. */
@media (max-width: 559px) {
  .jp-print .tool-button {
    flex: 1 1 100%;
  }
}

/* Paper: hidden on the screen. */
.jp-sheet {
  display: none;
}

@media print {
  @page {
    margin: 12mm;
  }

  main.tool-journal-prompts {
    width: auto;
    margin: 0;
  }

  .tool-journal-prompts .tool-head,
  .jp-themes,
  .jp-play,
  .jp-kept {
    display: none !important;
  }

  .jp-stage {
    overflow: visible;
  }

  .jp-sheet {
    display: block;
    color: #1e1418;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .jp-sheet-brand {
    margin: 0;
    color: #8a3a0c;
    font-size: 7.5pt;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .jp-sheet-title {
    margin: 1.5mm 0 0;
    color: #1e1418;
    font-size: 17pt;
    font-weight: 800;
    line-height: 1.15;
  }

  .jp-sheet-note {
    margin: 1.5mm 0 5mm;
    color: #5a4338;
    font-size: 9pt;
    line-height: 1.4;
  }

  .jp-sheet-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4mm;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .jp-sheet-card {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    height: 54mm;
    margin: 0;
    padding: 4.5mm 4.5mm 3.5mm;
    border: 0.35mm dashed #a8907f;
    border-radius: 3.5mm;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .jp-sheet-kicker {
    display: flex;
    gap: 1.5mm;
    align-items: center;
    color: var(--ink-tone);
    font-size: 6.5pt;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .jp-sheet-kicker svg {
    flex: none;
    width: 2.6mm;
    height: 2.6mm;
    fill: currentColor;
  }

  .jp-sheet-prompt {
    display: flex;
    flex: 1;
    align-items: center;
    margin: 1.5mm 0;
    color: #1e1418;
    font-family: var(--serif);
    font-size: 12pt;
    font-style: italic;
    font-weight: 500;
    line-height: 1.28;
  }

  .jp-sheet-number {
    align-self: flex-end;
    color: #a8907f;
    font-size: 6.5pt;
    font-weight: 800;
  }

  .jp-sheet-foot {
    margin: 5mm 0 0;
    color: #7a6458;
    font-size: 8pt;
  }

  .jp-print-kept .jp-sheet-card:not(.is-kept),
  .jp-print-kept .jp-for-deck,
  :root:not(.jp-print-kept) .jp-for-kept {
    display: none;
  }
}
