/* Dialboard — the whiteboard for cold callers.
   Layout: one fixed, non-scrolling whiteboard that fills the screen. The surface is a
   stack of canvases (ghosting → structure → ink → animation → live stroke) under an HTML
   text layer; the tools sit in the aluminium marker tray along the bottom edge. */

/* self-hosted so the board works offline (Permanent Marker: Apache 2.0, Gochi Hand: OFL 1.1) */
@font-face {
  font-family: "Permanent Marker";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/permanent-marker-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Gochi Hand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/gochi-hand-latin.woff2) format("woff2");
}

:root {
  /* wall + board materials */
  --wall-1: #ddd6cb;
  --wall-2: #c3baad;
  --wall-glow: rgba(255, 250, 240, .55);
  --wall-shadow: rgba(48, 36, 22, .38);
  --surface-1: #fcfdfd;
  --surface-2: #eef1f2;
  --frame-1: #f5f7f9;
  --frame-2: #cfd4da;
  --frame-3: #9ba2aa;
  --frame-4: #7b828a;
  --plastic: #4f555c;
  /* dry-erase pigments (overwritten at runtime from MarkerInk.INK) */
  --ink-black: #25292e;
  --ink-blue: #1d4fb4;
  --ink-red: #c8312a;
  --ink-green: #168049;
  --ink-hint: rgba(37, 41, 46, .34);        /* faint marker ghosts (decoration only) */
  --ink-hint-strong: rgba(37, 41, 46, .66); /* hint text people need to read: ≥4.5:1 on the board */
  /* sticky notes */
  --note-yellow: #fdf07c;
  --note-pink: #ffc3d8;
  --note-green: #c8f1b5;
  --note-blue: #b7dffb;
  --note-ink: #25292e;
  /* type */
  --font-marker: "Permanent Marker", "Marker Felt", "Chalkboard SE", "Comic Sans MS", cursive;
  --font-hand: "Gochi Hand", "Marker Felt", "Bradley Hand", "Comic Sans MS", cursive;
  --font-ui: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* geometry */
  --frame-w: 14px;
  --tray-h: 60px;
  --pad: clamp(10px, 2.1vw, 28px);
  --gap: clamp(10px, 1.8vw, 26px);
  --noise: none;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall-1: #36383c;
    --wall-2: #1e1f22;
    --wall-glow: rgba(255, 238, 210, .10);
    --wall-shadow: rgba(0, 0, 0, .72);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wall-1: #36383c;
  --wall-2: #1e1f22;
  --wall-glow: rgba(255, 238, 210, .10);
  --wall-shadow: rgba(0, 0, 0, .72);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--wall-2);
  color: var(--ink-black);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ------------------------------------------------------------------ room / wall */

.room {
  height: 100%;
  display: grid;
  place-items: center;
  padding:
    max(14px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(14px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  background:
    radial-gradient(120% 90% at 18% -10%, var(--wall-glow), transparent 62%),
    radial-gradient(90% 70% at 100% 110%, rgba(0, 0, 0, .18), transparent 60%),
    var(--noise),
    linear-gradient(165deg, var(--wall-1), var(--wall-2));
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.room { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.board {
  width: 100%;
  height: 100%;
  max-width: 1560px;
  max-height: 1020px;
  min-width: 0;
  min-height: 0;
  justify-self: center;
  align-self: center;
}
.tray { min-width: 0; }
.tray-group { min-width: 0; }
.tray-group > * { flex-shrink: 0; }
/* invisible hit areas so every tool is at least ~40px tall to tap */
.marker::after { content: ""; position: absolute; inset: -12px -2px -10px; }
.cards::after, .spray::after { content: ""; position: absolute; inset: -8px -4px -8px; }

/* ------------------------------------------------------------------ aluminium frame */

.frame {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--frame-w) var(--frame-w) 0;
  border-radius: 12px;
  background:
    linear-gradient(180deg, var(--frame-1) 0%, var(--frame-2) 22%, var(--frame-3) 78%, var(--frame-4) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .85),
    inset 0 -1px 0 rgba(0, 0, 0, .3),
    inset 1px 0 0 rgba(255, 255, 255, .45),
    inset -1px 0 0 rgba(0, 0, 0, .18),
    0 34px 60px -24px var(--wall-shadow),
    0 10px 18px -8px var(--wall-shadow);
}
.frame::before { /* brushed metal grain */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .09) 0 1px, rgba(0, 0, 0, .035) 1px 2px, transparent 2px 4px);
  mix-blend-mode: overlay;
}
.corner {
  position: absolute;
  width: calc(var(--frame-w) + 12px);
  height: calc(var(--frame-w) + 12px);
  background: linear-gradient(145deg, #6b7178, var(--plastic) 55%, #33373c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 2px rgba(0, 0, 0, .35);
  z-index: 3;
  pointer-events: none;
}
.corner.tl { top: -2px; left: -2px; border-radius: 12px 4px 10px 4px; }
.corner.tr { top: -2px; right: -2px; border-radius: 4px 12px 4px 10px; }

/* ------------------------------------------------------------------ the writing surface */

.surface {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 3px;
  overflow: hidden;
  touch-action: none;
  cursor: crosshair;
  background:
    radial-gradient(130% 85% at 12% -5%, rgba(255, 255, 255, .95), transparent 58%),
    radial-gradient(80% 60% at 92% 108%, rgba(160, 170, 178, .16), transparent 70%),
    linear-gradient(178deg, var(--surface-1), var(--surface-2));
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, .2),
    inset 0 2px 5px rgba(0, 0, 0, .2),
    inset 0 -1px 0 rgba(255, 255, 255, .6);
}
.surface.tool-eraser { cursor: none; }

.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* the glossy reflection sits on top of the ink, like light on melamine */
.gloss {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background:
    linear-gradient(112deg, transparent 0 24%, rgba(255, 255, 255, .34) 31%, rgba(255, 255, 255, .06) 37%, transparent 44%),
    linear-gradient(112deg, transparent 0 47%, rgba(255, 255, 255, .16) 50%, transparent 54%),
    radial-gradient(140% 120% at 50% 50%, transparent 62%, rgba(90, 100, 110, .10));
  mix-blend-mode: screen;
}
.speckle {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: var(--noise);
  opacity: .55;
  mix-blend-mode: multiply;
}

/* ------------------------------------------------------------------ text layer */

.content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  gap: var(--gap);
}

.ink-marker, .ink-hand, .ink-field__ink { filter: url(#ink-rough); }
.ink-marker { font-family: var(--font-marker); font-weight: 400; }
.ink-hand { font-family: var(--font-hand); font-weight: 400; }

.head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "title calls stat";
  align-items: center;
  gap: 8px 28px;
  padding-right: 206px; /* room for the four magnets */
  min-height: 52px;
}
.head-title {
  grid-area: title;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 18px;
  min-width: 0;
}
.date {
  font-size: clamp(16px, 1.6vw, 24px);
  color: var(--ink-black);
  white-space: nowrap;
}
.title-field {
  --ink: var(--ink-black);
  font-family: var(--font-marker);
  font-size: clamp(22px, 2.9vw, 44px);
  text-transform: uppercase;
  color: var(--ink-black);
  max-width: 100%;
}

.stat {
  grid-area: stat;
  justify-self: end;
  text-align: center;
  padding: 10px 26px 8px;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 1;
  --ink: var(--ink-green);
}
.stat-main {
  display: block;
  font-size: clamp(16px, 1.9vw, 30px);
  color: var(--ink-black);
  white-space: nowrap;
}
.stat-main .val { color: var(--ink-green); }
.stat-sub {
  display: block;
  margin-top: 4px;
  font-size: clamp(13px, 1.15vw, 18px);
  color: var(--ink-black);
  opacity: .78;
  white-space: nowrap;
}

/* magnets */
.magnets {
  position: absolute;
  top: calc(var(--pad) - 2px);
  right: var(--pad);
  z-index: 6;
  display: flex;
  gap: 10px;
}
.magnet {
  --m: #d23a3a;
  width: 40px;
  height: 40px;
  border: 0;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .75) 0 7%, rgba(255, 255, 255, 0) 16%),
    radial-gradient(circle at 50% 45%, var(--m) 0 58%, color-mix(in srgb, var(--m) 70%, #000) 100%);
  box-shadow:
    0 4px 5px -1px rgba(0, 0, 0, .35),
    0 1px 1px rgba(0, 0, 0, .25),
    inset 0 -3px 4px rgba(0, 0, 0, .22),
    inset 0 2px 2px rgba(255, 255, 255, .25);
  transition: transform .15s ease, box-shadow .15s ease;
}
.magnet svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .25)); }
.magnet:hover { transform: translateY(-1px); }
.magnet:active { transform: translateY(1px) scale(.97); box-shadow: 0 2px 2px rgba(0, 0, 0, .3), inset 0 -2px 3px rgba(0, 0, 0, .25); }
.magnet.m-red { --m: #d43b35; }
.magnet.m-blue { --m: #2a63c9; }
.magnet.m-yellow { --m: #f0b81c; }
.magnet.m-green { --m: #2f9a59; }
.magnet[aria-pressed="true"] .mute { display: none; }
.magnet[aria-pressed="false"] .wave { display: none; }

:focus-visible {
  outline: 2.5px dashed var(--ink-blue);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ------------------------------------------------------------------ tally boxes */

.grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: var(--gap);
}

.box {
  --ink: var(--ink-blue);
  position: relative;
  container-type: size;
  min-width: 0;
  min-height: 0;
  padding: clamp(8px, 2.2vmin, 22px) clamp(10px, 2.6vmin, 26px) clamp(6px, 1.5vmin, 16px);
}
.box-in {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.box[data-color="black"] { --ink: var(--ink-black); }
.box[data-color="blue"] { --ink: var(--ink-blue); }
.box[data-color="red"] { --ink: var(--ink-red); }
.box[data-color="green"] { --ink: var(--ink-green); }

.box-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.box-titles { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.box-head.stack { flex-wrap: wrap; }
.box-head.stack .box-titles { flex-basis: 100%; }
.box-head.stack .count-wrap { margin-left: auto; }

.label {
  display: inline-block;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: text;
  text-align: left;
  font-size: clamp(15px, min(8.2cqw, 15cqh), 42px);
  line-height: 1.05;
  color: var(--ink);
  text-transform: uppercase;
  overflow-wrap: normal;
}
.sub {
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  cursor: text;
  text-align: left;
  font-size: clamp(13px, min(5.4cqw, 10cqh), 27px);
  line-height: 1.1;
  color: var(--ink-black);
  opacity: .82;
}
.count-wrap {
  position: relative;
  flex: none;
  text-align: right;
  padding: 2px 4px 0 10px;
}
.count {
  display: block;
  font-size: clamp(30px, min(19cqw, 30cqh), 120px);
  line-height: .92;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge {
  position: absolute;
  right: calc(100% + 6px);
  top: 18%;
  white-space: nowrap;
  font-size: clamp(12px, min(5cqw, 8cqh), 22px);
  color: var(--ink-red);
  transform: rotate(-8deg);
  transform-origin: right center;
  pointer-events: none;
}

.tally-area {
  position: relative;
  flex: 1 1 auto;
  min-height: 24px;
  margin: 6px 0 4px;
}
.area-hint {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(13px, min(5.2cqw, 9cqh), 24px);
  color: var(--ink-hint-strong);
  pointer-events: none;
  white-space: nowrap;
}

.box-foot {
  display: flex;
  align-items: center;
  gap: clamp(8px, 4cqw, 22px);
  min-height: 30px;
}
.plus {
  border: 0;
  background: none;
  padding: .32em .78em .26em;
  cursor: pointer;
  touch-action: manipulation;
  font-size: clamp(15px, min(6.6cqw, 11cqh), 30px);
  line-height: 1;
  color: var(--ink);
}
.plus:active { transform: translateY(1px); }
.goal {
  border: 0;
  background: none;
  padding: 4px 2px;
  cursor: text;
  font-size: clamp(13px, min(5cqw, 9cqh), 24px);
  color: var(--ink-black);
  opacity: .8;
}
.goal.empty { color: var(--ink-hint-strong); opacity: 1; }
.kbd {
  margin-left: auto;
  font-size: clamp(12px, min(4.2cqw, 8cqh), 20px);
  color: var(--ink-hint-strong);
  white-space: nowrap;
}

.box .body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.tally-area:not([data-more=""])[data-more]::after {
  content: attr(data-more) " more";
  position: absolute;
  right: 2px;
  bottom: -4px;
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--ink-hint);
}

/* deals box: tallies + the money ledger */
.box.deals .body { gap: 4px; }
.box.deals .count {
  color: var(--ink-green);
  font-size: clamp(24px, min(11.5cqw, 22cqh), 86px);
  padding-bottom: 6px;
}
.box.deals .tally-area { flex: 1 1 45%; min-height: 30px; }
.ledger-wrap { flex: 1 1 55%; min-height: 0; display: flex; flex-direction: column; }
.ledger {
  list-style: none;
  margin: 0;
  padding: 2px 0 0;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ledger.overflowing {
  -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent);
  mask-image: linear-gradient(180deg, #000 72%, transparent);
}
.ledger li { min-width: 0; }
.ledger .entry {
  border: 0;
  background: none;
  padding: 1px 0;
  cursor: text;
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: 100%;
  text-align: left;
}
.ledger .v {
  font-family: var(--font-marker);
  font-size: clamp(14px, min(6cqw, 9.5cqh), 28px);
  color: var(--ink-green);
  white-space: nowrap;
}
.ledger .v.unknown { color: var(--ink-hint-strong); }
.ledger .n {
  font-family: var(--font-hand);
  font-size: clamp(13px, min(5cqw, 8cqh), 24px);
  color: var(--ink-black);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ledger .new-deal { display: flex; align-items: baseline; gap: 6px; padding: 4px 6px; }
.ledger .new-deal .ink-field { --ink: var(--ink-green); font-family: var(--font-marker); font-size: clamp(16px, min(6cqw, 9.5cqh), 28px); flex: 1; min-width: 0; }
/* short boxes (phone strips, landscape phones): the +1 moves up beside the count */
@container (max-height: 170px) {
  .box-foot .kbd { display: none; }
}
@container (max-height: 140px) {
  .box-in {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "head foot" "body body";
    column-gap: 4px;
  }
  .box-head { grid-area: head; }
  .box-in > .body { grid-area: body; }
  .box-foot { grid-area: foot; align-self: start; min-height: 0; }
  .box-foot .goal { display: none; }
  .plus { padding: .3em .62em .22em; font-size: clamp(15px, 9cqh, 22px); }
  .tally-area { margin: 4px 0 0; }
}
@container (max-height: 96px) {
  .box .sub { display: none; }
}
@container (max-width: 200px) {
  .box-foot .goal { display: none; }
  .label { font-size: clamp(13px, 9cqw, 20px); }
}

/* when a deals box is a wide strip, put the ledger beside the tallies */
@container (min-aspect-ratio: 2/1) {
  .box.deals .body { flex-direction: row; gap: 14px; }
  .box.deals .tally-area { flex: 1 1 52%; }
  .box.deals .ledger-wrap { flex: 0 1 46%; justify-content: flex-end; }
}

/* inline editing of labels / goals */
.editing-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-family: var(--font-hand);
  font-size: 17px;
}
.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .25);
  padding: 0;
  cursor: pointer;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--ink-black); }
.chip-btn {
  border: 0;
  background: none;
  padding: 2px 4px;
  cursor: pointer;
  font-family: var(--font-hand);
  font-size: 17px;
  color: var(--ink-red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hint-line {
  position: absolute;
  left: var(--pad);
  bottom: 4px;
  z-index: 3;
  margin: 0;
  font-family: var(--font-hand);
  font-size: 15px;
  color: var(--ink-hint);
  pointer-events: none;
  white-space: nowrap;
}

/* ------------------------------------------------------------------ ink fields (typing) */

.ink-field {
  --ink: var(--ink-black);
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  min-width: 1.4em;
  max-width: 100%;
  line-height: 1.2;
}
.ink-field.label { font-family: var(--font-marker); }
.ink-field.sub, .ink-field.goal { font-family: var(--font-hand); }
.ink-field__input,
.ink-field__ink,
.ink-field__ph,
.ink-field__mirror {
  font: inherit;
  font-size: max(16px, 1em); /* iOS zooms into inputs smaller than 16px */
  letter-spacing: inherit;
  text-transform: inherit;
  line-height: 1.2;
  padding: .06em .18em;
  margin: 0;
  font-kerning: none;
  font-variant-ligatures: none;
}
.ink-field__input {
  display: block;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: transparent;
  caret-color: var(--ink);
  -webkit-text-fill-color: transparent;
  user-select: text;
  -webkit-user-select: text;
  border-radius: 4px;
}
.ink-field__input::selection { background: color-mix(in srgb, var(--ink) 22%, transparent); }
.ink-field__input:focus-visible { outline: none; }
.ink-field__ink,
.ink-field__ph {
  position: absolute;
  inset: 0;
  white-space: pre;
  overflow: hidden;
  pointer-events: none;
  color: var(--ink);
}
.ink-field__ink > span { white-space: pre; }
.ink-field__ph { color: var(--ink-hint-strong); filter: url(#ink-rough); }
.ink-field__mirror {
  position: absolute;
  visibility: hidden;
  white-space: pre;
  left: -9999px;
  top: 0;
}
.ch-new {
  background-image: linear-gradient(90deg, var(--ink) 0 50%, transparent 50% 100%);
  background-size: 205% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ch-write var(--d, 130ms) cubic-bezier(.3, .1, .4, 1) forwards;
  animation-delay: var(--delay, 0ms);
}
@keyframes ch-write { to { background-position: 0 0; } }

/* writing/erasing whole strings */
.writing {
  -webkit-mask-image: linear-gradient(90deg, #000 0 44%, transparent 56% 100%);
  mask-image: linear-gradient(90deg, #000 0 44%, transparent 56% 100%);
  -webkit-mask-size: 230% 100%;
  mask-size: 230% 100%;
  -webkit-mask-position: 100% 0;
  mask-position: 100% 0;
  animation: write var(--dur, 360ms) cubic-bezier(.35, .15, .45, 1) forwards;
  animation-delay: var(--delay, 0ms);
}
@keyframes write {
  to { -webkit-mask-position: 0 0; mask-position: 0 0; }
}
.erase-clone {
  position: absolute;
  pointer-events: none;
  margin: 0;
  animation: erase .3s ease-in forwards;
  z-index: 2;
}
@keyframes erase {
  0% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(6px) skewX(-8deg); }
}

.content.wiping .wipeable { animation: wipe-text var(--wipe, 1.2s) ease-in forwards; }
@keyframes wipe-text { 60% { opacity: .15; } 100% { opacity: 0; } }

/* ------------------------------------------------------------------ marker tray */

.tray {
  position: relative;
  z-index: 2;
  height: var(--tray-h);
  margin: 0 calc(var(--frame-w) * -1);
  padding: 0 calc(var(--frame-w) + 10px);
  display: flex;
  align-items: flex-end;
  gap: 14px;
  border-radius: 0 0 12px 12px;
  background:
    linear-gradient(180deg, #7d848c 0, #a9b0b7 6%, #dde1e5 24%, #cdd2d7 60%, #b2b8bf 84%, #8a9199 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 3px 4px rgba(0, 0, 0, .25);
}
.tray::before { /* the trough the markers rest in */
  content: "";
  position: absolute;
  left: calc(var(--frame-w) + 2px);
  right: calc(var(--frame-w) + 2px);
  top: 6px;
  height: 22px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, .06) 70%, rgba(255, 255, 255, 0));
  pointer-events: none;
}
.tray::after { /* brushed grain */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .1) 0 1px, rgba(0, 0, 0, .03) 1px 3px);
  mix-blend-mode: overlay;
}
.tray-group { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 12px; height: 100%; padding-bottom: 20px; }
.tray-spacer { flex: 1; }
.brand {
  position: relative;
  z-index: 1;
  align-self: center;
  margin-top: 16px;
  font: 800 9px/1 var(--font-ui);
  letter-spacing: .34em;
  color: rgba(40, 44, 50, .42);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
  white-space: nowrap;
}

/* a dry-erase marker lying in the tray */
.marker {
  --c: var(--ink-black);
  position: relative;
  width: 96px;
  height: 20px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  transform: translateY(0) rotate(0deg);
  transition: transform .22s cubic-bezier(.2, .9, .3, 1.3);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .3));
}
.marker[data-color="blue"] { --c: var(--ink-blue); }
.marker[data-color="red"] { --c: var(--ink-red); }
.marker[data-color="green"] { --c: var(--ink-green); }
.m-body {
  position: absolute;
  left: 30px;
  right: 0;
  top: 1px;
  bottom: 1px;
  border-radius: 3px 10px 10px 3px;
  background: linear-gradient(180deg, #ffffff 0%, #f1f3f5 35%, #d3d8dd 75%, #b9bfc6 100%);
  overflow: hidden;
}
.m-body::before { /* colour band + label */
  content: "";
  position: absolute;
  left: 10px;
  width: 30px;
  top: 0;
  bottom: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 70%, #000));
  opacity: .92;
}
.m-body::after { /* end plug */
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 9px;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 60%, #fff), var(--c) 60%, color-mix(in srgb, var(--c) 65%, #000));
}
.m-tip {
  position: absolute;
  left: 20px;
  top: 6px;
  width: 14px;
  height: 8px;
  border-radius: 6px 0 0 6px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c));
  opacity: 0;
  transition: opacity .15s;
}
.m-tip::after {
  content: "";
  position: absolute;
  right: -4px;
  top: -3px;
  width: 6px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, #f4f5f6, #c3c8cd);
}
.m-cap {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 20px;
  border-radius: 10px 3px 3px 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55) 0 12%, rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg, color-mix(in srgb, var(--c) 78%, #fff) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 62%, #000) 100%);
  transition: transform .22s cubic-bezier(.2, .9, .3, 1.2);
}
.m-cap::after { /* pocket clip */
  content: "";
  position: absolute;
  left: 8px;
  right: 6px;
  top: -2px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 60%, #fff), var(--c));
}
.marker[aria-pressed="true"] { transform: translateY(-18px) rotate(-5deg); }
.marker[aria-pressed="true"] .m-cap { transform: translate(-22px, 6px) rotate(-12deg); }
.marker[aria-pressed="true"] .m-tip { opacity: 1; }

/* felt eraser */
.eraser {
  position: relative;
  width: 78px;
  height: 30px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .22s cubic-bezier(.2, .9, .3, 1.3);
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .32));
}
.eraser::before {
  content: "";
  position: absolute;
  inset: 0 0 8px 0;
  border-radius: 9px 9px 3px 3px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 3px, transparent 3px 7px),
    linear-gradient(180deg, #4a5058, #2b2f34 70%, #1e2125);
}
.eraser::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 0;
  height: 9px;
  border-radius: 0 0 3px 3px;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 4px),
    linear-gradient(180deg, #d5d2cc, #b4b0a9);
}
.eraser[aria-pressed="true"] { transform: translateY(-14px) rotate(4deg); }

/* spray bottle for wiping the whole board */
.spray {
  position: relative;
  width: 30px;
  height: 46px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .3));
}
.spray .b-body {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 0;
  height: 30px;
  border-radius: 6px 6px 5px 5px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .1) 40%, rgba(0, 0, 0, .08)), linear-gradient(180deg, #8fd0f2, #4ea9d9);
}
.spray .b-label {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 7px;
  height: 11px;
  border-radius: 2px;
  background: #fff;
  font: 800 6px/11px var(--font-ui);
  letter-spacing: .06em;
  text-align: center;
  color: #2b5d86;
}
.spray .b-head {
  position: absolute;
  left: 7px;
  top: 2px;
  width: 18px;
  height: 14px;
  border-radius: 4px 7px 2px 2px;
  background: linear-gradient(180deg, #f6f7f8, #c4c9ce);
}
.spray .b-head::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 2px;
  width: 8px;
  height: 4px;
  border-radius: 2px;
  background: #c4c9ce;
}
.spray:active { transform: translateY(2px); }

/* eraser cursor that follows the pointer */
.eraser-cursor {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 7;
  width: 64px;
  height: 30px;
  margin: -15px 0 0 -32px;
  pointer-events: none;
  border-radius: 8px 8px 3px 3px;
  background:
    linear-gradient(180deg, #474d55, #262a2f 65%, #c9c5bf 66%, #b3afa8);
  box-shadow: 0 6px 10px -3px rgba(0, 0, 0, .4);
  opacity: .92;
  will-change: transform;
}
.wipe-rag {
  position: absolute;
  z-index: 8;
  left: 0;
  top: 0;
  width: 120px;
  height: 56px;
  margin: -28px 0 0 -60px;
  pointer-events: none;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, #474d55, #262a2f 65%, #c9c5bf 66%, #b3afa8);
  box-shadow: 0 10px 16px -6px rgba(0, 0, 0, .45);
  will-change: transform;
}

/* ------------------------------------------------------------------ sticky notes */

.notes {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding:
    max(16px, env(safe-area-inset-top, 0px))
    max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
  background: rgba(24, 20, 14, .26);
  animation: fade-in .18s ease-out;
}
@keyframes fade-in { from { opacity: 0; } }

.note {
  --paper: var(--note-yellow);
  --ink: var(--note-ink);
  position: relative;
  width: min(100%, 440px);
  max-height: min(86vh, 760px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 34px 26px 26px;
  color: var(--note-ink);
  font-family: var(--font-hand);
  font-size: 20px;
  line-height: 1.25;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .06) 0 22px, rgba(0, 0, 0, 0) 23px),
    linear-gradient(170deg, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 40%),
    linear-gradient(180deg, var(--paper), color-mix(in srgb, var(--paper) 88%, #a07a00));
  border-radius: 2px 2px 4px 26px / 2px 2px 4px 8px;
  box-shadow:
    0 24px 34px -16px rgba(0, 0, 0, .45),
    0 3px 6px rgba(0, 0, 0, .18);
  transform: rotate(var(--tilt, -1.2deg));
  animation: note-in .28s cubic-bezier(.2, .9, .25, 1.15);
  user-select: none;
  -webkit-user-select: none;
}
.note.wide { width: min(100%, 620px); }
.note.pink { --paper: var(--note-pink); }
.note.green { --paper: var(--note-green); }
.note.blue { --paper: var(--note-blue); }
@keyframes note-in {
  from { transform: rotate(calc(var(--tilt, -1.2deg) - 4deg)) translateY(18px) scale(.96); opacity: 0; }
}
.note h2 {
  margin: 0 0 10px;
  font-family: var(--font-marker);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.05;
  text-wrap: balance;
}
.note h3 {
  margin: 22px 0 8px;
  font-family: var(--font-marker);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: .02em;
}
.note p { margin: 0 0 10px; }
.note .muted { opacity: .7; }
.note .close {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--font-marker);
  font-size: 24px;
  line-height: 1;
}
.note-actions { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 18px; align-items: center; }
.note-btn {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 6px 4px;
  font-family: var(--font-marker);
  font-size: 20px;
  color: var(--note-ink);
  text-decoration: underline;
  text-decoration-thickness: 2.5px;
  text-underline-offset: 5px;
  touch-action: manipulation;
}
.note-btn.primary {
  padding: 8px 18px 7px;
  text-decoration: none;
  border: 2.5px solid var(--note-ink);
  border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px;
}
.note-btn.danger { color: #9f1f19; border-color: #9f1f19; } /* ≥5:1 on pink and yellow paper */
.note .ink-field:focus-within { box-shadow: inset 0 -2.5px 0 var(--ink-blue); border-radius: 2px; }
.note-btn:focus-visible, .chip:focus-visible, .outcome:focus-visible { outline: 2.5px solid var(--ink-blue); outline-offset: 2px; }
.note .row { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; padding: 3px 0; border-bottom: 1.5px dashed rgba(0, 0, 0, .14); }
.note .row b { font-family: var(--font-marker); font-weight: 400; white-space: nowrap; }
.big-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 4px; }
.big-stats div { text-align: center; }
.big-stats b { display: block; font-family: var(--font-marker); font-weight: 400; font-size: 30px; line-height: 1.05; }
.big-stats span { font-size: 16px; opacity: .8; }
.days { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 18px; }
.days th { font-family: var(--font-marker); font-weight: 400; font-size: 14px; text-align: right; padding: 2px 4px; opacity: .8; }
.days th:first-child, .days td:first-child { text-align: left; }
.days td { text-align: right; padding: 3px 4px; border-top: 1.5px dashed rgba(0, 0, 0, .14); white-space: nowrap; }
.days tr.today td { font-weight: 700; }
.table-scroll { overflow-x: auto; margin: 0 -4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0; }
.chip {
  border: 0;
  background: none;
  cursor: pointer;
  padding: 4px 2px;
  font-family: var(--font-marker);
  font-size: 16px;
  color: var(--note-ink);
  border-bottom: 2px solid currentColor;
  touch-action: manipulation;
}
.note .ink-field { font-family: var(--font-marker); font-size: 22px; min-width: 4em; border-bottom: 2px solid rgba(0, 0, 0, .35); }
.note .field-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.slider { width: 180px; accent-color: var(--note-ink); }
.qr { display: block; width: 168px; height: 168px; margin: 8px 0; background: #fff; padding: 8px; border-radius: 4px; image-rendering: pixelated; }
.linkbox {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  word-break: break-all;
  background: rgba(255, 255, 255, .55);
  padding: 8px 10px;
  border-radius: 4px;
  user-select: all;
  -webkit-user-select: all;
}

/* index cards in the tray */
.cards {
  position: relative;
  width: 46px;
  height: 34px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .28));
}
.c-card {
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: 0;
  height: 28px;
  border-radius: 2px;
  background: #fdfdf8;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .18);
}
.c-card.c3 { transform: rotate(-7deg) translate(-2px, -3px); background: #f3f1e6; }
.c-card.c2 { transform: rotate(4deg) translate(2px, -2px); background: #f7f6ee; }
.c-card.c1 {
  background:
    linear-gradient(180deg, transparent 0 7px, rgba(216, 56, 42, .55) 7px 8px, transparent 8px),
    repeating-linear-gradient(180deg, transparent 0 4px, rgba(27, 70, 194, .22) 4px 5px),
    #fffffb;
}
.cards:active { transform: translateY(2px); }
.cards:hover .c-card.c1 { transform: translateY(-2px); }

/* sticky-note variants for cards and dashboards */
.note.index-card {
  --paper: #fffffb;
  background:
    linear-gradient(180deg, transparent 0 58px, rgba(216, 56, 42, .5) 58px 60px, transparent 60px),
    repeating-linear-gradient(180deg, transparent 0 31px, rgba(27, 70, 194, .16) 31px 32px),
    #fffffb;
  border-radius: 4px;
}
.card-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: baseline;
  gap: 10px;
  padding: 2px 0;
  min-height: 32px;
}
.card-row.extra { grid-template-columns: 92px minmax(0, 1fr) 30px; }
.card-row.extra > .ink-field:first-child { font-family: var(--font-hand); font-size: 16px; color: rgba(37, 41, 46, .7); }
.card-label { font-family: var(--font-hand); font-size: 16px; color: rgba(37, 41, 46, .7); }
.note .card-row .ink-field { border-bottom: 0; font-family: var(--font-hand); font-size: 22px; width: 100% !important; min-width: 0; }
.card-x { border: 0; background: none; cursor: pointer; font-family: var(--font-marker); font-size: 20px; color: rgba(37, 41, 46, .55); padding: 0; }
.add-field { margin: 4px 0 6px; font-size: 15px; }
.card-call a { font-family: var(--font-marker); font-size: 18px; color: var(--ink-blue); }
.card-q { margin: 14px 0 8px; font-family: var(--font-marker); font-size: 18px; }
.outcomes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.outcome {
  min-height: 48px;
  padding: 8px 6px 6px;
  border: 2.5px solid currentColor;
  border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px;
  background: rgba(255, 255, 255, .6);
  cursor: pointer;
  font-family: var(--font-marker);
  font-size: 17px;
  line-height: 1.05;
  touch-action: manipulation;
}
.outcome {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 62px;
  transform-origin: 50% 90%;
  animation: idle-breeze 6s ease-in-out infinite;
  animation-delay: calc(var(--n, 0) * -1.3s);
}
.outcomes .outcome:nth-child(2) { --n: 1; }
.outcomes .outcome:nth-child(3) { --n: 2; }
.outcomes .outcome:nth-child(4) { --n: 3; }
.o-word { display: inline-flex; white-space: nowrap; }
.o-ch { display: inline-block; }
.o-sub {
  font-family: var(--font-hand);
  font-size: 13.5px;
  line-height: 1.1;
  color: var(--note-ink);
  opacity: .78;
  white-space: nowrap;
}
.o-sub.swap { animation: sub-swap .32s ease-out; }
.outcome:hover, .outcome:focus-visible, .outcome.pressed {
  animation: boil .42s steps(1) infinite, breeze 2.2s ease-in-out infinite;
  background: color-mix(in srgb, currentColor 7%, #fff);
}
.outcome:hover .o-ch, .outcome:focus-visible .o-ch, .outcome.pressed .o-ch {
  animation: ripple 1.1s ease-in-out infinite;
  animation-delay: calc(var(--i) * 70ms);
}
.outcome:active { transform: scale(.96) rotate(-1.5deg); }
.outcome.current { background: color-mix(in srgb, currentColor 12%, #fff); }
.outcome.current::after {
  content: "last time";
  position: absolute;
  top: -9px;
  right: 8px;
  padding: 0 4px;
  font-family: var(--font-hand);
  font-size: 12px;
  background: #fffffb;
}
/* hand-drawn "line boil": the outline redraws itself a few times a second */
@keyframes boil {
  0% { border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px; }
  33% { border-radius: 232px 24px 250px 14px / 24px 205px 26px 240px; }
  66% { border-radius: 262px 14px 212px 26px / 14px 242px 20px 222px; }
}
@keyframes breeze {
  0%, 100% { transform: rotate(-1.2deg) skewX(0deg) translateY(0); }
  25% { transform: rotate(1deg) skewX(-2.5deg) translateY(-2px); }
  50% { transform: rotate(-.4deg) skewX(1.8deg) translateY(-3px); }
  75% { transform: rotate(1.5deg) skewX(-1deg) translateY(-1px); }
}
@keyframes idle-breeze {
  0%, 100% { transform: rotate(-.6deg); }
  50% { transform: rotate(.6deg) translateY(-1px); }
}
@keyframes ripple {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-3px) rotate(-4deg); }
  60% { transform: translateY(1px) rotate(3deg); }
}
@keyframes sub-swap {
  from { opacity: 0; transform: translateY(5px) rotate(-2deg); }
  to { opacity: .78; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .outcome, .outcome:hover, .outcome:focus-visible, .outcome.pressed, .outcome .o-ch, .o-sub.swap { animation: none !important; }
}
.o-blue { color: var(--ink-blue); }
.o-red { color: var(--ink-red); }
.o-green { color: var(--ink-green); }
.o-black { color: var(--ink-black); }
@media (max-width: 480px) { .outcomes { grid-template-columns: repeat(2, minmax(0, 1fr)); } .card-row, .card-row.extra { grid-template-columns: 76px minmax(0, 1fr) 26px; } .card-row { grid-template-columns: 76px minmax(0, 1fr); } }

.note-actions.tight { margin-top: 6px; }
.nudge { font-family: var(--font-marker); font-size: 19px; margin: 0 0 12px; }
.field-label { min-width: 110px; opacity: .75; }

/* welcome back / scorecard period tiles */
.periods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 6px 0 4px; }
.period {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 10px 10px 8px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 6px 10px -8px rgba(0, 0, 0, .4);
  transform: rotate(var(--r, 0deg));
  min-width: 0;
}
.period.p0 { --r: -1.2deg; background: #fffdf0; }
.period.p1 { --r: .8deg; }
.period.p2 { --r: -.6deg; }
.period.p3 { --r: 1deg; }
.period.p4 { --r: -.9deg; }
.p-label { font-family: var(--font-marker); font-size: 15px; }
.p-big { font-family: var(--font-marker); font-weight: 400; font-size: 34px; line-height: 1; color: var(--ink-blue); }
.p-unit { font-size: 15px; margin-top: -2px; }
.p-line { font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.p-line.strong { font-family: var(--font-marker); font-size: 14px; color: var(--ink-green); margin-top: 3px; }
@media (max-width: 640px) { .periods { grid-template-columns: repeat(2, minmax(0, 1fr)); } .period.p0 { grid-column: span 2; } }

/* call list */
.search-row .ink-field { width: 100% !important; font-family: var(--font-hand); font-size: 19px; }
.lead-list { list-style: none; margin: 8px 0 0; padding: 0; }
.lead-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1.5px dashed rgba(0, 0, 0, .14);
}
.lead-open { border: 0; background: none; padding: 2px 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; min-width: 0; }
.lead-name { font-family: var(--font-marker); font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-biz { font-size: 15px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lead-out { font-family: var(--font-marker); font-size: 13px; padding: 2px 8px; border: 2px solid currentColor; border-radius: 12px 4px 12px 4px; white-space: nowrap; }
.lead-out.o-dial { color: var(--ink-blue); }
.lead-out.o-no { color: var(--ink-red); }
.lead-out.o-appt { color: var(--ink-green); }
.lead-out.o-deal { color: var(--ink-black); }
.lead-out.o-later { color: rgba(37, 41, 46, .55); }
.lead-tel { font-size: 15px; color: var(--ink-blue); white-space: nowrap; }
.lead-list .empty { padding: 12px 0; }
@media (max-width: 480px) { .lead-row { grid-template-columns: minmax(0, 1fr) auto; } .lead-tel { grid-column: 1 / -1; } }

/* how it works */
.howto { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
.howto li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 14px; align-items: center; }
.howto canvas { width: 92px; height: 46px; background: rgba(255, 255, 255, .72); border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.howto p { margin: 0; }
.howto .math { font-family: var(--font-marker); font-size: 17px; line-height: 1.35; }
@media (max-width: 420px) { .howto li { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; } .howto canvas { width: 72px; height: 36px; } }

/* calls: start calls / calling / finish the day (no clock on screen) */
.calls { grid-area: calls; justify-self: end; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.call-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 7px 16px 6px;
  border: 2.5px solid var(--ink-green);
  border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px;
  background: rgba(255, 255, 255, .55);
  color: var(--ink-green);
  cursor: pointer;
  touch-action: manipulation;
  font-size: clamp(15px, 1.5vw, 20px);
  white-space: nowrap;
}
.call-btn:hover { background: color-mix(in srgb, var(--ink-green) 8%, #fff); }
.call-btn.on { border-color: var(--ink-green); }
.call-btn.done { border-color: var(--ink-black); color: var(--ink-black); }
.call-play { width: 0; height: 0; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.call-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink-green) 50%, transparent); animation: call-pulse 1.8s ease-out infinite; }
@keyframes call-pulse { 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.call-finish { border: 0; background: none; padding: 2px 6px; cursor: pointer; font-size: 15px; color: var(--ink-hint-strong); text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .call-dot { animation: none; } }
@media (max-width: 760px) and (orientation: portrait) { .calls { flex-direction: row; gap: 8px; } .call-btn { min-height: 40px; padding: 5px 12px 4px; } }
.outcomes.kinds .outcome { min-height: 74px; }
.recap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0 4px; }
@media (max-width: 640px) { .recap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.photo { margin: 10px 0; padding: 10px 10px 14px; background: #fff; box-shadow: 0 10px 18px -12px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .15); transform: rotate(-.8deg); max-width: 100%; overflow: hidden; }
.photo + .photo { transform: rotate(.9deg); }
.photo-canvas { display: block; max-width: 100%; height: auto !important; border: 6px solid #c9ced4; border-radius: 4px; }
.day-open { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: var(--ink-blue); text-decoration: underline; text-underline-offset: 3px; }

/* guests: a sticky note on the board that saves the whiteboard to an account */
.save-tab {
  position: relative;
  z-index: 7;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 13px 7px;
  color: var(--note-ink);
  text-decoration: none;
  background: linear-gradient(180deg, var(--note-yellow), color-mix(in srgb, var(--note-yellow) 88%, #a07a00));
  border-radius: 2px 2px 3px 14px / 2px 2px 3px 5px;
  box-shadow: 0 10px 16px -10px rgba(0, 0, 0, .45), 0 2px 3px rgba(0, 0, 0, .14);
  transform: rotate(-2deg);
  transition: transform .2s cubic-bezier(.2, .9, .3, 1.3);
  touch-action: manipulation;
}
.save-tab:hover, .save-tab:focus-visible { transform: rotate(-1deg) translateY(-2px); }
.save-tab .save-main { font-size: clamp(14px, 1.5vw, 19px); line-height: 1.05; }
.save-tab .save-sub { font-size: 13.5px; opacity: .75; }
@media (max-width: 760px), (max-height: 520px) {
  .save-tab { padding: 5px 10px 4px; }
  .save-tab .save-sub { display: none; }
}
a.note-btn { display: inline-block; }

/* first-visit hint */
.coach {
  position: absolute;
  left: 50%;
  top: 56%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 16px 8px;
  max-width: 92%;
  text-align: center;
  color: var(--note-ink);
  background: linear-gradient(180deg, var(--note-blue), color-mix(in srgb, var(--note-blue) 88%, #2a5d86));
  border-radius: 2px 2px 3px 14px / 2px 2px 3px 5px;
  box-shadow: 0 10px 16px -10px rgba(0, 0, 0, .45), 0 2px 3px rgba(0, 0, 0, .14);
  transform: translate(-50%, -50%) rotate(-2.5deg);
  pointer-events: auto;
  animation: coach-in .5s cubic-bezier(.2, .9, .3, 1.3) .5s both;
}
.coach-main { font-size: clamp(16px, 2vw, 22px); }
.coach-sub { font-size: 15px; opacity: .8; }
.coach-link { border: 0; background: none; padding: 4px 6px; font-family: var(--font-hand); font-size: 15px; color: var(--ink-blue); text-decoration: underline; cursor: pointer; }
.coach.gone { transition: opacity .3s, transform .3s; opacity: 0; transform: translate(-50%, -60%) rotate(-6deg); }
@keyframes coach-in { from { opacity: 0; transform: translate(-50%, -40%) rotate(-6deg) scale(.9); } }
@media (prefers-reduced-motion: reduce) { .coach { animation: none; } }

/* moments: BOOKED!, CLOSED!, and little reactions */
.reaction {
  position: absolute;
  right: calc(100% + 4px);
  top: 4%;
  white-space: nowrap;
  font-size: clamp(14px, min(6cqw, 10cqh), 24px);
  pointer-events: none;
  animation: reaction 1.6s ease-out forwards;
  transform-origin: right center;
}
@keyframes reaction {
  0% { opacity: 0; transform: translateY(6px) rotate(var(--tilt, -6deg)) scale(.9); }
  14% { opacity: 1; transform: translateY(0) rotate(var(--tilt, -6deg)) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-14px) rotate(var(--tilt, -6deg)); }
}
.moment {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(252, 253, 253, .82), rgba(252, 253, 253, 0));
}
.moment-word {
  font-size: clamp(54px, 13vmin, 170px);
  line-height: 1;
  transform: rotate(-7deg);
  filter: url(#ink-rough);
}
.moment-sub {
  margin-top: 6px;
  font-size: clamp(18px, 3.2vmin, 34px);
  color: var(--ink-black);
  transform: rotate(-4deg);
}
.moment.wipe-out { animation: moment-wipe .42s ease-in forwards; }
@keyframes moment-wipe {
  to { opacity: 0; transform: translateX(28px) skewX(-10deg); filter: blur(1.5px); }
}

/* toast: a small sticky note that slaps on and peels off */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tray-h) + 30px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  max-width: min(86vw, 420px);
  padding: 12px 18px 10px;
  font-family: var(--font-hand);
  font-size: 20px;
  color: var(--note-ink);
  background: linear-gradient(180deg, var(--note-yellow), color-mix(in srgb, var(--note-yellow) 88%, #a07a00));
  box-shadow: 0 14px 22px -12px rgba(0, 0, 0, .45), 0 2px 4px rgba(0, 0, 0, .15);
  transform: translate(-50%, 20px) rotate(-1.5deg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .25s cubic-bezier(.2, .9, .3, 1.2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) rotate(-1.5deg); }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 760px) and (orientation: portrait) {
  .head {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "title title" "stat calls";
    padding-right: 124px;
    gap: 2px;
  }
  .stat { justify-self: start; padding: 8px 18px 6px 14px; margin-left: -6px; }
}
@media (max-width: 760px), (max-height: 520px) {
  :root { --frame-w: 9px; --tray-h: 54px; }
  .room { padding: max(8px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(8px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .head { padding-right: 124px; }
  .magnets { gap: 7px; }
  .magnet { width: 34px; height: 34px; }
  .magnet svg { width: 17px; height: 17px; }
  .marker { width: 74px; height: 17px; }
  .m-cap { width: 28px; height: 17px; }
  .m-body { left: 24px; }
  .m-body::before { left: 8px; width: 20px; }
  .m-tip { left: 15px; top: 5px; width: 11px; height: 7px; }
  .marker[aria-pressed="true"] { transform: translateY(-14px) rotate(-5deg); }
  .marker[aria-pressed="true"] .m-cap { transform: translate(-16px, 5px) rotate(-12deg); }
  .eraser { width: 58px; height: 26px; }
  .tray-group { gap: 6px; padding-bottom: 18px; }
  .tray { padding: 0 calc(var(--frame-w) + 6px); gap: 8px; }
  .brand { display: none; }
  #helpBtn { display: none; }
  .kbd { display: none; }
  .hint-line { display: none; }
}
@media (max-width: 420px) {
  .marker { width: clamp(36px, 10.5vw, 46px); }
  .m-cap { width: 44%; }
  .m-body { left: 38%; }
  .m-body::before { left: 6px; width: 10px; }
  .m-tip { left: 26%; }
  .eraser { width: clamp(38px, 11vw, 46px); }
  .cards { width: 38px; }
  .tray-group { gap: 3px; }
  .tray { gap: 4px; }
}
@media (max-height: 520px) {
  :root { --tray-h: 46px; --frame-w: 8px; --pad: 10px; --gap: 10px; }
  .head { min-height: 38px; gap: 4px 16px; padding-right: 112px; }
  .title-field { font-size: clamp(18px, 4.4vh, 30px); }
  .date { font-size: 15px; }
  .stat { padding: 6px 16px 4px; }
  .stat-main { font-size: clamp(14px, 3.6vh, 22px); }
  .stat-sub { font-size: 12px; margin-top: 2px; }
  .magnet { width: 30px; height: 30px; }
  .magnet svg { width: 15px; height: 15px; }
  .tray-group { padding-bottom: 14px; }
  .marker[aria-pressed="true"] { transform: translateY(-10px) rotate(-5deg); }
  .eraser[aria-pressed="true"] { transform: translateY(-9px) rotate(4deg); }
}

@media (prefers-reduced-motion: reduce) {
  .writing, .ch-new { animation-duration: 1ms !important; animation-delay: 0ms !important; }
  .note, .notes { animation: none; }
  .marker, .eraser, .m-cap { transition: none; }
}
