/* Weather Palettes: a daylight studio, cut and pasted. Kit colours and fonts only (kit.css). */

:root {
  --cobalt: var(--ak-accent-2);
  --tape: color-mix(in srgb, var(--ak-accent) 34%, var(--ak-surface));
  --tape-edge: color-mix(in srgb, var(--ak-accent) 55%, var(--ak-ink-muted));
  --wobble: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --wobble-b: 15px 225px 15px 255px / 255px 15px 225px 15px;
  --paper-drop: drop-shadow(0 2px 1px color-mix(in srgb, var(--ak-ink) 22%, transparent));
  --torn-bottom: polygon(0 0, 100% 0, 100% 92%, 96% 97%, 91% 93%, 85% 99%, 79% 94%, 72% 100%, 66% 95%, 59% 99%, 52% 94%, 45% 100%, 38% 95%, 31% 99%, 24% 94%, 17% 100%, 10% 95%, 4% 99%, 0 94%);
  --torn-both: polygon(0 3%, 6% 0, 13% 4%, 21% 1%, 30% 4%, 39% 0, 48% 3%, 57% 0, 66% 4%, 75% 1%, 84% 4%, 92% 0, 100% 3%, 100% 96%, 93% 100%, 85% 96%, 77% 100%, 68% 97%, 59% 100%, 50% 96%, 41% 100%, 32% 97%, 23% 100%, 14% 96%, 6% 100%, 0 97%);
  --torn-tab: polygon(2% 6%, 20% 0, 46% 5%, 70% 0, 98% 4%, 100% 50%, 97% 96%, 74% 100%, 50% 95%, 24% 100%, 0 95%, 3% 50%);
  --gap: clamp(4px, 1.2dvh, 10px);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  overflow: hidden;
  color: var(--ak-ink);
  font-family: var(--ak-font-body);
  background-color: var(--ak-bg);
  background-image: var(--ak-bg-art), var(--ak-backdrop-layer, none);
  background-size: var(--ak-bg-size), cover;
  background-position: center, center top;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, .wp-card:focus-visible { outline: 3px solid var(--ak-focus); outline-offset: 3px; }

/* Cut-out letters: each one snipped and pasted a touch uneven. */
.cut { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.02em; }
.cut > span { display: inline-block; rotate: var(--r, 0deg); translate: 0 var(--y, 0); }
.cut > span.gap { width: 0.28em; }

/* ---------- the play screen ---------- */

.wp {
  display: grid;
  height: 100dvh;
  width: min(100%, 620px);
  margin: 0 auto;
  padding:
    calc(var(--ac-status-h, 64px) + 4px)
    max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left));
  gap: var(--gap);
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  grid-template-areas:
    "logo weathers"
    "tools stage"
    "chips chips"
    "dials dials"
    "tabs tabs";
  touch-action: manipulation;
  visibility: hidden;
}
/* The tool stays out of sight until the opening hands over, so the opening has one clear path. */
body.wp-ready .wp { visibility: visible; }

/* The small logo beside the weathers, with Hint or Today under it; the three pictures stand along the card's edge. */
.wp-head { display: contents; }
.wp-brand {
  grid-area: logo;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.wp-logo {
  width: 66px;
  height: auto;
  rotate: -3deg;
}
.wp-hint {
  min-height: 48px;
  min-width: 56px;
  padding: 0 12px;
  border: 2px solid var(--ak-ink);
  border-radius: var(--wobble);
  background: var(--ak-accent);
  color: var(--ak-ink);
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: 22px;
  rotate: 2deg;
}
.wp-mocks {
  grid-area: tools;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding: 2px;
}
.wp-today-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  min-width: 64px;
  padding: 0 6px;
  border: 2px solid var(--ak-ink);
  border-radius: var(--wobble-b);
  background: var(--ak-surface);
  color: var(--ak-ink);
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: 20px;
  rotate: -2deg;
}
.wp-today-tab[hidden] { display: none; }
.wp-today-tab.is-new::after {
  content: '';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ak-ink);
  border-radius: 50%;
  background: var(--ak-accent);
}
/* Each picture tab is a live thumbnail in your colours, so all three are always in view. */
.wp-mock {
  --mini: clamp(36px, calc(8dvh - 18px), 56px);
  flex: none;
  display: grid;
  justify-items: center;
  gap: 1px;
  min-height: 48px;
  min-width: 66px;
  padding: 4px 4px 2px;
  border: 2px solid transparent;
  border-radius: var(--wobble-b);
  background: var(--ak-surface);
  color: var(--ak-ink);
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  filter: var(--paper-drop);
}
.wp-mock-mini { display: block; width: var(--mini); height: var(--mini); }
.wp-mock-mini svg { display: block; width: 100%; height: 100%; }
.wp-mock-word { padding: 1px 4px; }
.wp-mock:nth-child(2) { rotate: 1.5deg; }
.wp-mock:nth-child(3) { rotate: -1deg; }
.wp-mock[aria-pressed="true"] { border-color: var(--ak-ink); }
.wp-mock[aria-pressed="true"] .wp-mock-word { background: var(--ak-ink); color: var(--ak-bg); }

/* Eight weather cards, cut from the painted sheet. */
.wp-weathers {
  grid-area: weathers;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px 4px;
}
.wp-weather {
  container-type: inline-size;
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 48px;
  min-width: 0;
  padding: 2px;
  border: 2px solid transparent;
  border-radius: var(--wobble-b);
  background: color-mix(in srgb, var(--ak-surface) 88%, var(--ak-accent));
  text-align: left;
}
.wp-weather:nth-child(odd) { rotate: -1deg; }
.wp-weather:nth-child(3n) { rotate: 1.5deg; }
.wp-weather-art {
  --g: 20px;
  --k: calc(var(--g) / 82);
  flex: none;
  width: var(--g);
  height: var(--g);
  border-radius: 3px;
  background-color: var(--ak-surface);
  background-image: url("art/weather-cards.png");
  background-repeat: no-repeat;
  background-size: calc(384 * var(--k)) auto;
  background-position: calc((var(--x) + 4) * -1 * var(--k)) calc((var(--y) + 18) * -1 * var(--k));
}
.wp-weather-word {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 0.95;
  overflow-wrap: normal;
  word-break: keep-all;
}
@container (max-width: 79px) {
  .wp-weather-art { display: none; }
  .wp-weather-word { text-align: center; padding-left: 2px; }
}
.wp-kept {
  position: absolute;
  top: -6px;
  right: -4px;
  display: none;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid var(--ak-ink);
  border-radius: 50%;
  background: var(--ak-surface);
  color: var(--ak-ink);
  rotate: 8deg;
}
.wp-weather.is-kept .wp-kept { display: grid; }
.wp-weather[aria-pressed="true"] {
  border-color: var(--ak-ink);
  background: var(--ak-choice-selected-bg);
  color: var(--ak-choice-selected-ink);
}
.wp-weather[aria-pressed="true"]::after {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  width: 34px;
  height: 12px;
  background: var(--tape);
  border-left: 1px dashed var(--tape-edge);
  border-right: 1px dashed var(--tape-edge);
  translate: -50% 0;
  rotate: -4deg;
}

/* The stage: one big gesso card, taped at two corners, turned a degree. */
.wp-stage {
  grid-area: stage;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  justify-items: center;
}
.wp-stage.has-tag { padding-bottom: calc(var(--tag-h, 56px) * 0.55); }
.wp-stage.has-tag .wp-card { padding-bottom: calc(3.5% + var(--tag-h, 56px) * 0.5); }
.wp-cardcell {
  container-type: size;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}
.wp-card {
  position: relative;
  margin: 0;
  width: min(100cqw - 16px, (100cqh - 12px) * 1.06);
  height: calc(100cqh - 12px);
  padding: 3.5%;
  background: var(--ak-surface);
  border: 2px solid var(--ak-ink);
  border-radius: 3px 6px 4px 7px;
  rotate: 1deg;
  filter: var(--paper-drop);
  touch-action: none;
  cursor: grab;
}
.wp-card::before,
.wp-card::after {
  content: '';
  position: absolute;
  width: 72px;
  height: 22px;
  background: var(--tape);
  border-left: 2px dotted var(--tape-edge);
  border-right: 2px dotted var(--tape-edge);
  z-index: 1;
}
.wp-card::before { top: -10px; left: -22px; rotate: -32deg; }
.wp-card::after { bottom: -10px; right: -22px; rotate: -32deg; }
.wp-card { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
/* A printer's colour bar along the foot of the proof: the five chips and the palette's name in marker. */
.wp-proof {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px dashed var(--ak-ink-muted);
}
.wp-proof[hidden] { display: none; }
.wp-proof i { flex: none; width: 15px; height: 11px; border: 1px solid var(--ak-ink); }
.wp-proof i:nth-child(1) { background: var(--c0); }
.wp-proof i:nth-child(2) { background: var(--c1); }
.wp-proof i:nth-child(3) { background: var(--c2); }
.wp-proof i:nth-child(4) { background: var(--c3); }
.wp-proof i:nth-child(5) { background: var(--c4); }
.wp-proof-name {
  min-width: 0;
  margin-left: auto;
  padding-left: 6px;
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  rotate: -1deg;
}
.wp-card-cap {
  margin: 0 0 2px;
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: clamp(18px, 2.4dvh, 22px);
  line-height: 1.1;
  color: var(--ak-ink);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wp-mock-art { width: 100%; height: 100%; min-height: 0; }
/* Before a weather is picked: an unpainted pencil sketch waiting for colour. */
.is-blank .mock > rect,
.is-blank .mock > circle,
.is-blank .mock > path,
.is-blank .mock > ellipse { stroke: var(--ak-ink-muted); stroke-width: 2.5; stroke-dasharray: 7 5; }
.wp-chips.is-blank .wp-chip-fill { stroke: var(--ak-ink-muted); stroke-width: 12; stroke-dasharray: 24 18; }
.mock-marks { fill: none; stroke: var(--ak-accent-2); stroke-width: 4; stroke-dasharray: 9 6; }
.mock-marks > g { display: none; }
.wp-card[data-open="0"] .mock-marks > g[data-role="0"],
.wp-card[data-open="1"] .mock-marks > g[data-role="1"],
.wp-card[data-open="2"] .mock-marks > g[data-role="2"],
.wp-card[data-open="3"] .mock-marks > g[data-role="3"],
.wp-card[data-open="4"] .mock-marks > g[data-role="4"] { display: inline; }
.wp-mock-art svg { display: block; width: 100%; height: 100%; }

/* The contrast tag: cobalt masking tape with the eye, gesso lettering. */
.wp-tag {
  position: absolute;
  z-index: 2;
  bottom: -4px;
  left: 0;
  right: 0;
  margin: 0 auto;
  min-height: 52px;
  width: min(100%, 420px);
  display: flex;
  align-items: center;
  border-style: solid;
  border-width: 0 18px 0 62px;
  border-image-source: url("art/contrast-tag.png");
  border-image-slice: 0 36 0 124 fill;
  border-image-repeat: stretch;
  color: var(--ak-bg);
  font-weight: 700;
  font-size: clamp(15px, 2.1dvh, 17px);
  line-height: 1.2;
  rotate: -1.2deg;
}
.wp-tag[hidden] { display: none; }
.wp-tag-text { padding: 6px 4px; }

/* Five torn swatch chips, each its own small tilt. */
.wp-chips {
  grid-area: chips;
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  padding-top: 6px;
}
.wp-chip {
  --chip-size: min(60px, 15vw, 7dvh);
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: none;
  rotate: var(--tilt, 0deg);
}
.wp-chip-paper {
  position: relative;
  display: block;
  width: var(--chip-size);
  height: var(--chip-size);
  min-width: 44px;
  min-height: 44px;
}
.wp-chip-paper img,
.wp-chip-paper svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.wp-chip-fill { fill: var(--chip, var(--ak-surface)); }
.wp-chip-name {
  position: relative;
  z-index: 1;
  margin-top: -2px;
  padding: 0 2px;
  background: var(--ak-surface);
  color: var(--ak-ink);
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: clamp(14px, 4.4cqw, 20px);
  line-height: 1.1;
  white-space: nowrap;
  border-radius: 2px 6px 3px 5px;
}
.wp-chip[aria-pressed="true"] { translate: 0 -6px; rotate: 0deg; }
.wp-chip[aria-pressed="true"]::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  width: 46px;
  height: 14px;
  background: var(--tape);
  border-left: 2px dotted var(--tape-edge);
  border-right: 2px dotted var(--tape-edge);
  translate: -50% 0;
  rotate: 3deg;
  z-index: 1;
}
.wp-chip[aria-pressed="true"] .wp-chip-name { background: var(--ak-ink); color: var(--ak-bg); }

/* The dial strip: torn gesso with three charcoal-ruled sliders. */
.wp-dials { grid-area: dials; min-width: 0; }
.wp-dial-strip {
  position: relative;
  display: grid;
  gap: 0;
  padding: 6px 12px 12px;
  background: var(--ak-surface);
  clip-path: var(--torn-bottom);
  rotate: -0.6deg;
}
.wp-dial-empty {
  margin: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--ak-ink);
  text-align: center;
}
.wp-dial-how {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ak-ink);
}
.wp-dial-how[hidden] { display: none; }
.wp-dial {
  display: grid;
  grid-template-columns: 86px 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 4px;
  min-height: 48px;
}
.wp-track {
  position: relative;
  display: block;
  min-width: 0;
}
.wp-track input { display: block; }
.wp-end {
  position: absolute;
  bottom: -1px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: var(--ak-ink);
  pointer-events: none;
}
.wp-end-l { left: 2px; }
.wp-end-r { right: 2px; }
.wp-step {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid var(--ak-ink);
  border-radius: 48% 52% 46% 54% / 54% 46% 52% 48%;
  background: var(--ak-bg);
  color: var(--ak-ink);
}
.wp-step:active { background: var(--ak-accent); }
.wp-dial[hidden], .wp-dial-empty[hidden] { display: none; }
.wp-dial label { display: grid; line-height: 1.05; }
.wp-dial-name { font-family: var(--ak-font-display); font-weight: 700; font-size: 22px; }
.wp-dial-val { font-family: var(--ak-font-body); font-size: 14px; font-weight: 700; color: var(--ak-ink-muted); }
.wp-dial-sub { font-size: 13px; color: var(--ak-ink-muted); }

.wp-dial input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 46px;
  margin: 0;
  background: transparent;
  touch-action: none;
}
.wp-dial input[type="range"]::-webkit-slider-runnable-track {
  height: 20px;
  border: 2px solid var(--ak-ink);
  border-radius: 10px 6px 10px 6px;
  background:
    repeating-linear-gradient(90deg, var(--ak-ink) 0 2px, transparent 2px 12.5%) center bottom / 100% 6px no-repeat,
    var(--track, var(--ak-surface));
}
.wp-dial input[type="range"]::-moz-range-track {
  height: 20px;
  border: 2px solid var(--ak-ink);
  border-radius: 10px 6px 10px 6px;
  background:
    repeating-linear-gradient(90deg, var(--ak-ink) 0 2px, transparent 2px 12.5%) center bottom / 100% 6px no-repeat,
    var(--track, var(--ak-surface));
}
.wp-dial input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 44px;
  height: 44px;
  margin-top: -14px;
  border: 4px solid var(--ak-ink);
  box-shadow: 0 0 0 2px var(--ak-surface);
  border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%;
  background: var(--thumb, var(--ak-accent));
}
.wp-dial input[type="range"]::-moz-range-thumb {
  width: 40px;
  height: 40px;
  border: 4px solid var(--ak-ink);
  box-shadow: 0 0 0 2px var(--ak-surface);
  border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%;
  background: var(--thumb, var(--ak-accent));
}

/* Four cobalt tabs along the bottom edge. */
.wp-tabs {
  grid-area: tabs;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.wp-tab {
  min-height: 52px;
  border: 0;
  background: var(--cobalt);
  color: var(--ak-bg);
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: 26px;
  clip-path: var(--torn-tab);
  filter: var(--paper-drop);
}
.wp-tab:nth-child(1) { rotate: -1.5deg; }
.wp-tab:nth-child(2) { rotate: 1deg; translate: 0 -2px; background: var(--ak-ink); }
.wp-tab:nth-child(3) { rotate: -0.5deg; }
.wp-tab:nth-child(4) { rotate: 2deg; }
.wp-tab:active { background: var(--ak-btn-active); }

/* ---------- landscape: picture in the middle, weathers left, tools right ---------- */

@media (orientation: landscape) {
  .wp {
    width: min(100%, 1240px);
    grid-template-columns: minmax(130px, 0.55fr) minmax(0, 1.25fr) minmax(300px, 1.3fr);
    grid-template-rows: auto auto auto auto minmax(0, 1fr);
    grid-template-areas:
      "logo stage chips"
      "weathers stage chips"
      "weathers stage dials"
      "weathers stage tabs"
      "weathers stage .";
    column-gap: clamp(8px, 2vw, 24px);
  }
  .wp-brand { flex-direction: row; justify-content: flex-start; }
  .wp-logo { width: auto; height: min(34px, 9dvh); }
  .wp-mocks {
    grid-area: stage;
    z-index: 2;
    flex-direction: row;
    align-self: start;
    justify-self: center;
    gap: 6px;
    overflow: visible;
  }
  .wp-mock { --mini: 34px; min-width: 60px; font-size: 16px; }
  .wp-stage { padding-top: 64px; }
  .wp-hint, .wp-today-tab { min-width: 56px; padding: 0 6px; font-size: 18px; }
  .wp-weathers { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
  .wp-chip { --chip-size: min(64px, 6vw, 12dvh); grid-template-rows: 20px auto 20px; }
  .wp-chip-paper { grid-row: 2; }
  .wp-chip-name { grid-row: 3; font-size: 16px; }
  /* Labels take turns above and below, so neighbours never run together. */
  .wp-chip:nth-child(even) .wp-chip-name { grid-row: 1; margin: 0 0 -2px; }
  .wp-chip[aria-pressed="true"]::before { top: 12px; }
  .wp-dial { min-height: min(48px, 12dvh); }
  .wp-today-tab { rotate: 1deg; }
}

@media (orientation: landscape) and (max-height: 460px) {
  .wp-dial { min-height: 44px; }
  .wp-dial input[type="range"] { height: 44px; }
  .wp { row-gap: 4px; }
  .wp-chips { padding-top: 0; }
  .wp-chip { grid-template-rows: 15px auto 15px; }
  .wp-chip-name { font-size: 14px; line-height: 1; }
  .wp-dial-strip { padding: 0 8px 6px; }
  .wp-dial-name { font-size: 17px; line-height: 1; }
  .wp-dial-val { display: block; font-size: 12px; }
  .wp-weathers { gap: 4px; }
  .wp-weather { height: 48px; }
  .wp-weather-word { font-size: 17px; line-height: 0.88; }
  .wp-dial-sub { display: none; }
  .wp-dial { grid-template-columns: 54px 46px minmax(0, 1fr) 46px; gap: 3px; }
  .wp-dial-how { display: none; }
  .wp-step { width: 46px; height: 44px; }
  .wp-tab { min-height: 48px; font-size: 24px; }
  .wp-tag { min-height: 46px; font-size: 14px; bottom: 0; }
}

@media (orientation: landscape) and (min-width: 1100px) and (min-height: 700px) {
  .wp { grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.5fr) minmax(360px, 1fr); }
  .wp-stage { padding-top: 84px; }
  .wp-mock { --mini: 52px; font-size: 20px; }
  .wp-weather { min-height: 60px; }
  .wp-weather-art { --g: 30px; }
  .wp-weather-word { font-size: 22px; }
  .wp-chip { --chip-size: 84px; }
  .wp-chip-name { font-size: 20px; }
  .wp-chip { grid-template-rows: 26px auto 26px; }
  .wp-dial { min-height: 58px; }
  .wp-dial-name { font-size: 26px; }
  .wp-tab { min-height: 60px; font-size: 30px; }
  .wp-logo { height: 64px; }
}

@media (orientation: portrait) and (max-height: 800px) {
  .wp-dial-sub { display: none; }
  .wp-dial { grid-template-columns: 74px 48px minmax(0, 1fr) 48px; }
}

@media (orientation: portrait) and (max-height: 699px) {
  .wp-dial-how { display: none; }
}

@media (orientation: portrait) and (max-height: 700px) {
  .wp-mocks { gap: 4px; }
  .wp-mock-word { font-size: 15px; }
  .wp-chip { --chip-size: min(56px, 15vw, 8dvh); }
}

/* ---------- in-page sheets ---------- */

.wp-sheet {
  position: fixed;
  inset: 0;
  z-index: 27;
  display: grid;
  place-items: center;
  padding: calc(var(--ac-status-h, 64px) + 8px) 14px max(14px, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--ak-ink) 28%, transparent);
}
.wp-sheet[hidden] { display: none; }
.wp-sheet-panel {
  position: relative;
  width: min(100%, 440px);
  max-height: 100%;
  overflow-y: auto;
  padding: 26px 20px 24px;
  background: var(--ak-surface);
  color: var(--ak-ink);
  clip-path: var(--torn-both);
  rotate: -1deg;
}
.wp-sheet-title {
  margin: 0 0 8px;
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1.05;
}
.wp-sheet-title .cut > span:nth-child(3n + 1) { background: var(--ak-accent); padding: 0 2px; }
.wp-sheet-body { margin: 0 0 16px; font-size: 18px; line-height: 1.4; }
.wp-sheet-small { margin: 10px 0 0; font-size: 15px; color: var(--ak-ink-muted); }
.wp-sheet-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.wp-btn {
  min-height: 52px;
  padding: 0 18px;
  border: 2px solid var(--ak-ink);
  border-radius: var(--wobble);
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: 23px;
}
.wp-btn-go { background: var(--cobalt); color: var(--ak-bg); border-color: var(--cobalt); rotate: 1deg; }
.wp-btn-quiet { background: var(--ak-bg); color: var(--ak-ink); rotate: -1deg; }
.wp-btn svg { vertical-align: -5px; margin-right: 6px; }

.wp-name-field { display: grid; gap: 4px; }
.wp-name-label { font-weight: 700; font-size: 17px; }
.wp-name-field input {
  min-height: 52px;
  padding: 0 12px;
  border: 0;
  border-bottom: 3px solid var(--ak-ink);
  background: var(--ak-bg);
  color: var(--ak-ink);
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: 28px;
}
.wp-name-field input::placeholder { color: var(--ak-ink-muted); }
.wp-name-count { justify-self: end; font-size: 14px; color: var(--ak-ink-muted); }
.wp-idea {
  display: grid;
  gap: 2px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--tape);
  rotate: 0.8deg;
}
.wp-idea-head { font-size: 14px; font-weight: 700; color: var(--ak-ink); }
.wp-idea-name { font-family: var(--ak-font-display); font-weight: 700; font-size: 26px; }
.wp-idea-clue { font-size: 16px; }

/* ---------- the shelf ---------- */

.wp-shelf {
  position: fixed;
  inset: 0;
  z-index: 26;
  overflow-y: auto;
  padding:
    calc(var(--ac-status-h, 64px) + 8px)
    max(14px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  background-color: var(--ak-bg);
  background-image: var(--ak-backdrop-layer, var(--ak-bg-art));
  background-size: cover;
  background-position: center;
}
.wp-shelf[hidden] { display: none; }
.wp-shelf > * { width: min(100%, 760px); margin-left: auto; margin-right: auto; }
.wp-shelf-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.wp-shelf-title {
  margin: 0;
  padding: 2px 14px;
  background: var(--ak-surface);
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: 36px;
  clip-path: var(--torn-tab);
  rotate: -2deg;
}
.wp-where {
  margin-top: 10px;
  margin-bottom: 12px;
  padding: 4px 10px;
  width: fit-content;
  max-width: 100%;
  background: var(--ak-surface);
  color: var(--ak-ink-muted);
  font-size: 15px;
}
.wp-today {
  position: relative;
  display: grid;
  gap: 4px;
  max-width: 420px;
  margin: 18px 0 22px;
  padding: 16px 16px 14px;
  background: var(--ak-surface);
  clip-path: var(--torn-bottom);
  rotate: 1.5deg;
}
.wp-today-head { font-weight: 700; font-size: 15px; color: var(--ak-ink-muted); }
.wp-today-word { font-family: var(--ak-font-display); font-weight: 700; font-size: 34px; line-height: 1; }
.wp-today-clue { font-size: 18px; margin-bottom: 6px; }
.wp-today .wp-btn { justify-self: start; }
.wp-today-brief { margin: 2px 0 8px; padding: 6px 10px; background: var(--tape); font-size: 16px; line-height: 1.35; }
.wp-strips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 26px 22px;
  padding-bottom: 20px;
}
.wp-shelf-empty {
  margin: 0;
  padding: 14px 16px;
  background: var(--ak-surface);
  font-size: 18px;
}
.wp-strip-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: end;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 10px solid color-mix(in srgb, var(--ak-accent) 45%, var(--ak-ink));
}
.wp-strip {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 384 / 159;
  padding: 0;
  border: 0;
  background: none;
  rotate: var(--tilt, 0deg);
}
.wp-strip img, .wp-strip svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wp-strip-off {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ak-ink);
  border-radius: var(--wobble-b);
  background: var(--ak-surface);
}
.wp-strip-line {
  grid-column: 1 / -1;
  margin: 0;
  padding: 4px 8px;
  background: var(--ak-surface);
  font-size: 15px;
  line-height: 1.3;
}

/* ---------- the reason beat: the print taped up, the strip on the ledge ---------- */

.wp-pinup {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  padding: calc(var(--ac-status-h, 64px) + 10px) 16px max(16px, env(safe-area-inset-bottom));
  background-color: var(--ak-bg);
  background-image: var(--ak-backdrop-layer, var(--ak-bg-art));
  background-size: cover;
  background-position: center;
}
.wp-pinup[hidden] { display: none; }
.wp-print {
  position: relative;
  margin: 0;
  width: min(64vw, 36dvh, 340px);
  padding: 10px 10px 26px;
  background: var(--ak-surface);
  rotate: -1.5deg;
  filter: var(--paper-drop);
}
.wp-print img { display: block; width: 100%; height: auto; }
.wp-print::before, .wp-print::after {
  content: '';
  position: absolute;
  top: -12px;
  width: 70px;
  height: 22px;
  background: var(--tape);
  border-left: 2px dotted var(--tape-edge);
  border-right: 2px dotted var(--tape-edge);
}
.wp-print::before { left: -18px; rotate: -30deg; }
.wp-print::after { right: -18px; rotate: 30deg; }
.wp-ledge {
  width: min(92vw, 440px);
  display: grid;
  justify-items: center;
  gap: 8px;
}
.wp-ledge-strip {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 384 / 159;
  box-shadow: 0 10px 0 color-mix(in srgb, var(--ak-accent) 45%, var(--ak-ink));
}
.wp-ledge-strip img, .wp-ledge-strip svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wp-ledge-tape {
  position: absolute;
  right: 18%;
  top: -10px;
  width: 64px;
  height: 22px;
  background: var(--tape);
  border-left: 2px dotted var(--tape-edge);
  border-right: 2px dotted var(--tape-edge);
  rotate: 6deg;
}
.wp-slip {
  margin: 0;
  padding: 8px 12px;
  max-width: 100%;
  background: var(--ak-surface);
  font-size: 17px;
  line-height: 1.35;
  clip-path: var(--torn-bottom);
  rotate: 0.8deg;
}

/* ---------- the guided first move ---------- */

.wp-guide {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}
.wp-guide[hidden] { display: none; }
.wp-ring {
  position: fixed;
  border: 4px solid var(--cobalt);
  border-radius: 14px;
  box-shadow: 0 0 0 3px var(--ak-surface);
}
.wp-arrow {
  position: fixed;
  width: 28px;
  height: 44px;
  color: var(--cobalt);
}
.wp-caption {
  position: fixed;
  margin: 0;
  padding: 10px 14px;
  background: var(--ak-surface);
  color: var(--ak-ink);
  border: 3px solid var(--ak-ink);
  border-radius: var(--wobble);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

/* ---------- motion: slow and papery, only when it's welcome ---------- */

@media (prefers-reduced-motion: no-preference) {
  :root:not(.ac-still) .wp-card.is-turn .wp-mock-art { animation: wp-settle 420ms cubic-bezier(0.22, 1, 0.36, 1); }
  :root:not(.ac-still) .wp-chip.is-shiver .wp-chip-paper { animation: wp-shiver 300ms ease-out; }
  :root:not(.ac-still) .wp-tag.is-on { animation: wp-peel-on 520ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  :root:not(.ac-still) .wp-tag.is-off { animation: wp-peel-off 420ms ease-in both; }
  :root:not(.ac-still) .wp-ring { animation: wp-pulse 1600ms ease-in-out infinite; }
  :root:not(.ac-still) .wp-print { animation: wp-tape-up 700ms cubic-bezier(0.22, 1, 0.36, 1) both; }
  :root:not(.ac-still) .wp-ledge-strip { animation: wp-slide-in 760ms cubic-bezier(0.22, 1, 0.36, 1) 160ms both; }
  :root:not(.ac-still) .wp-ledge-tape { animation: wp-press 360ms ease-out 760ms both; }
  :root:not(.ac-still) .wp-slip { animation: wp-settle 500ms ease-out 600ms both; }
  :root:not(.ac-still) .wp-dial-strip.is-open { animation: wp-settle 320ms ease-out; }
  :root:not(.ac-still) .wp-chip { transition: translate 280ms ease, rotate 280ms ease; }
  :root:not(.ac-still) .wp.is-washing .mock *,
  :root:not(.ac-still) .wp.is-washing .wp-chip-fill { transition: fill 800ms ease, stroke 800ms ease, stroke-width 800ms ease; }
}

@keyframes wp-settle { from { opacity: 0.2; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
@keyframes wp-shiver {
  0% { rotate: 0deg; }
  30% { rotate: 1.2deg; }
  60% { rotate: -0.8deg; }
  100% { rotate: 0deg; }
}
@keyframes wp-peel-on {
  from { clip-path: inset(0 100% 0 0); rotate: -4deg; }
  to { clip-path: inset(0 0 0 0); rotate: -1.2deg; }
}
@keyframes wp-peel-off {
  from { clip-path: inset(0 0 0 0); rotate: -1.2deg; }
  to { clip-path: inset(0 0 0 100%); rotate: 3deg; }
}
@keyframes wp-pulse {
  0%, 100% { scale: 1; opacity: 1; }
  50% { scale: 1.06; opacity: 0.75; }
}
@keyframes wp-tape-up {
  from { opacity: 0; translate: 0 -18px; rotate: -5deg; }
  to { opacity: 1; translate: 0 0; rotate: -1.5deg; }
}
@keyframes wp-slide-in {
  from { opacity: 0; translate: 60vw 0; }
  to { opacity: 1; translate: 0 0; }
}
@keyframes wp-press {
  from { opacity: 0; scale: 1.4; }
  to { opacity: 1; scale: 1; }
}

/* ---------- the ending print: always whole on screen ---------- */

/* The site's ending card centres itself; "safe" keeps the top reachable when the words run long. */
html body #activity-chrome-ending.site-inspicacity { justify-content: safe center; }
html body #activity-chrome-ending.site-inspicacity .ac-work img { max-height: 34dvh; width: auto; margin: 0 auto; }
html body #activity-chrome-ending.site-inspicacity .ac-lines { font-size: 16px; }

@media (orientation: landscape) and (max-height: 600px) {
  /* Sideways: the taped print on the left, its words and button on the right. */
  html body #activity-chrome-ending.site-inspicacity { padding: 10px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left)); }
  html body #activity-chrome-ending.site-inspicacity .ac-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "work verdict" "work lines" "work actions";
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px 22px;
    width: min(100%, 820px);
    height: calc(100dvh - 44px);
    padding: 22px 22px 14px 28px;
    text-align: left;
  }
  html body #activity-chrome-ending.site-inspicacity .ac-number { display: none; }
  html body #activity-chrome-ending.site-inspicacity .ac-verdict { grid-area: verdict; font-size: 26px; }
  html body #activity-chrome-ending.site-inspicacity .ac-lines { grid-area: lines; min-height: 0; overflow-y: auto; font-size: 15px; line-height: 1.35; }
  html body #activity-chrome-ending.site-inspicacity .ac-work { grid-area: work; align-self: center; border-width: 8px 8px 18px; }
  html body #activity-chrome-ending.site-inspicacity .ac-work img { max-height: calc(100dvh - 110px); }
  html body #activity-chrome-ending.site-inspicacity .ac-actions { grid-area: actions; justify-content: flex-start; }

  /* The reason beat: print and shelf strip side by side. */
  .wp-pinup { grid-auto-flow: column; align-content: center; justify-content: center; align-items: center; gap: 28px; }
  .wp-print { width: min(34vw, (100dvh - var(--ac-status-h, 64px) - 80px) * 0.556); }
  .wp-ledge { width: min(46vw, 400px); }
}

@media (orientation: portrait) and (max-height: 780px) {
  html body #activity-chrome-ending.site-inspicacity { padding-top: 16px; padding-bottom: 16px; }
  html body #activity-chrome-ending.site-inspicacity .ac-card { padding-top: 26px; gap: 6px; }
  html body #activity-chrome-ending.site-inspicacity .ac-work img { max-height: 26dvh; }
  html body #activity-chrome-ending.site-inspicacity .ac-lines { font-size: 15px; line-height: 1.3; }
}

/* The site's note has nothing to press, so a tap goes through it to the tab beneath (and still clears it). */
html body #activity-chrome-toast { pointer-events: none; }

/* ---------- before the sketchbook opens: a taped graph-paper sheet with the title ---------- */

.wp-preboot {
  position: fixed;
  inset: 0;
  z-index: 39;
  display: grid;
  place-items: center;
  padding: 24px;
  background-color: var(--ak-bg);
  background-image:
    linear-gradient(color-mix(in srgb, var(--ak-bg) 80%, transparent), color-mix(in srgb, var(--ak-bg) 80%, transparent)),
    url("art/studio-wall.jpg");
  background-size: cover;
  background-position: center;
}
.wp-preboot-sheet {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(100%, 440px);
  padding: 34px 26px 30px;
  background-color: var(--ak-surface);
  background-image:
    linear-gradient(color-mix(in srgb, var(--ak-accent-2) 14%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ak-accent-2) 14%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  clip-path: var(--torn-both);
  rotate: -1.5deg;
}
.wp-preboot-logo { width: min(78%, 320px); height: auto; rotate: -3deg; }
.wp-preboot-note,
.wp-preboot-last {
  margin: 0;
  padding: 10px 14px;
  background: var(--tape);
  color: var(--ak-ink);
  font-family: var(--ak-font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.25;
  text-align: center;
  rotate: 1.5deg;
}
.wp-preboot-last { background: var(--ak-surface); border: 2px solid var(--ak-ink); font-size: 20px; rotate: -1deg; }
.wp-preboot-last[hidden] { display: none; }
