@property --strike {
  syntax: "<color>";
  inherits: false;
  initial-value: transparent;
}

@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
  src: url("/fonts/martian-mono-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Martian Mono";
  font-style: normal;
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
  src: url("/fonts/martian-mono-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/hanken-grotesk-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/hanken-grotesk-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Martian Mono Fallback";
  src: local("Courier New"), local("CourierNewPSMT");
  ascent-override: 92.3%;
  descent-override: 18.46%;
  line-gap-override: 0%;
  size-adjust: 108.33%;
}

@font-face {
  font-family: "Martian Mono Wide Fallback";
  src: local("Courier New"), local("CourierNewPSMT");
  ascent-override: 80%;
  descent-override: 16%;
  line-gap-override: 0%;
  size-adjust: 125%;
}

@font-face {
  font-family: "Hanken Grotesk Fallback";
  src: local("Arial"), local("ArialMT");
  ascent-override: 99.0668%;
  descent-override: 30.0173%;
  line-gap-override: 0%;
  size-adjust: 100.9419%;
}

:root {
  --mono: "Martian Mono", "Martian Mono Fallback", ui-monospace, monospace;
  --mono-wide: "Martian Mono", "Martian Mono Wide Fallback", ui-monospace, monospace;
  --sans: "Hanken Grotesk", "Hanken Grotesk Fallback", ui-sans-serif, system-ui, sans-serif;

  --counter: #c9cfbe;
  --counter-line: rgb(60 58 52 / 0.07);
  --paper: #fbf8f2;
  --well: #fefdfa;
  --well-fill: var(--paper-tex) 0 0 / 480px 480px, var(--well);
  --paper-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='480' height='480'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.3' numOctaves='5' stitchTiles='stitch' result='g'/%3E%3CfeDiffuseLighting in='g' surfaceScale='2.2' lighting-color='%23fff' result='l'%3E%3CfeDistantLight azimuth='225' elevation='50'/%3E%3C/feDiffuseLighting%3E%3CfeColorMatrix in='l' result='a' values='0 0 0 0 0.32 0 0 0 0 0.27 0 0 0 0 0.2 -0.16 -0.16 -0.16 0 0.4128'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.025' numOctaves='4' stitchTiles='stitch' result='m'/%3E%3CfeColorMatrix in='m' result='b' values='0 0 0 0 0.5 0 0 0 0 0.42 0 0 0 0 0.3 0.35 0 0 0 -0.13999999999999999'/%3E%3CfeMerge%3E%3CfeMergeNode in='b'/%3E%3CfeMergeNode in='a'/%3E%3C/feMerge%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23p%29'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.14 0 0 0 0 0.09 0 0 0 0 0.07 0 0 0 0.3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --paper-fill: var(--paper-tex) 0 0 / 480px 480px, var(--paper);
  --ink: #2e3040;
  --faded: #5f626e;
  --biro: #d6362c;
  --stripe: #f2b8c6;
  --on-counter-2: #3d4436;
  --tray: #b2baa5;
  --hover: rgb(46 48 64 / 0.06);
  --ring: rgb(46 48 64 / 0.9);

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --pen: cubic-bezier(0.55, 0.05, 0.35, 1);

  --tooth: 7px;
  --gutter: 16px;
  --roll-w: 420px;
  --entry-h: 72px;
  --kb: 0px;

  color-scheme: light;
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom));
  scroll-padding-top: 16px;
}

body {
  min-height: 100dvh;
  background-color: var(--counter);
  background-image: var(--paper-tex), var(--grain);
  background-size: 480px 480px, 140px 140px;
  background-position: 137px 211px, 0 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  font-synthesis: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.ic {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto 1fr;
  grid-template-areas: "top" "roll" "entry" "credit";
  justify-items: center;
  padding: 0 var(--gutter) calc(14px + env(safe-area-inset-bottom));
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

.top {
  grid-area: top;
  width: 100%;
  max-width: var(--roll-w);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 0 10px;
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 4px;
  margin-left: -4px;
  border-radius: 6px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.mark-icon {
  width: 18px;
  height: 22px;
  fill: none;
}

.mark-paper {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.mark-lines {
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.mark-strike {
  stroke: var(--biro);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.here {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  min-width: 94px;
  justify-content: center;
  padding: 0 10px;
  margin-right: 4px;
  border-radius: 6px;
  background: var(--paper-fill);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2b8a52;
  transition: background-color 200ms var(--ease-out);
}

.here[data-state="solo"] .dot {
  background: var(--faded);
}

.here[data-state="offline"] .dot {
  background: var(--biro);
}

.tool {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  color: var(--ink);
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.tool:active {
  transform: scale(0.97);
}

.tool .ic-b,
.tool[aria-pressed="false"] .ic-a {
  display: none;
}

.tool[aria-pressed="false"] .ic-b {
  display: block;
}

.side {
  display: none;
}

.roll {
  grid-area: roll;
  width: 100%;
  max-width: var(--roll-w);
  padding: 0 0 8px;
  filter: drop-shadow(0 1px 0.5px rgb(40 38 32 / 0.16)) drop-shadow(0 10px 16px rgb(40 38 32 / 0.13));
}

.paper {
  position: relative;
  background:
    linear-gradient(90deg, rgb(60 54 40 / 0.05), transparent 5%, transparent 95%, rgb(60 54 40 / 0.05)),
    var(--paper-fill);
  padding: calc(22px + var(--tooth)) 20px calc(20px + var(--tooth));
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  -webkit-mask:
    conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) 50% 0 / calc(var(--tooth) * 2) var(--tooth) repeat-x,
    conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 50% 100% / calc(var(--tooth) * 2) var(--tooth) repeat-x,
    linear-gradient(#000 0 0) 50% 50% / 100% calc(100% - var(--tooth) * 2 + 1px) no-repeat;
  mask:
    conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) 50% 0 / calc(var(--tooth) * 2) var(--tooth) repeat-x,
    conic-gradient(from -45deg at 50% 100%, #000 90deg, #0000 0) 50% 100% / calc(var(--tooth) * 2) var(--tooth) repeat-x,
    linear-gradient(#000 0 0) 50% 50% / 100% calc(100% - var(--tooth) * 2 + 1px) no-repeat;
}

.head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  text-align: center;
}

.logo {
  font-family: var(--mono-wide);
  font-stretch: 112.5%;
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.store {
  justify-self: stretch;
  margin-top: 10px;
  color: var(--faded);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: -0.005em;
}

.listname {
  width: 16ch;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font-family: var(--mono-wide);
  font-stretch: 112.5%;
  font-weight: 650;
  font-size: 16px;
  line-height: 24px;
  height: 24px;
  letter-spacing: -0.01em;
  color: var(--ink);
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: block;
  text-decoration: underline dotted rgb(46 48 64 / 0.45) 1.5px;
  text-underline-offset: 6px;
  cursor: text;
}

.listname::placeholder {
  color: var(--faded);
  font-weight: 500;
  opacity: 1;
}

.listname:focus {
  outline: none;
  text-decoration-color: transparent;
}

.namefield {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-width: 0;
  margin-top: 14px;
  padding: 6px 10px 6px 12px;
  border-radius: 6px;
  cursor: text;
  transition: background-color 160ms var(--ease-out);
}

.namefield::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px dashed rgb(46 48 64 / 0.32);
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms var(--ease-out), border-color 160ms var(--ease-out);
}

.namefield.is-empty::before {
  opacity: 1;
}

.namefield:focus-within {
  background: rgb(46 48 64 / 0.04);
}

.namefield:focus-within::before {
  opacity: 1;
  border-style: solid;
  border-color: var(--ink);
}

.name-pen {
  width: 16px;
  height: 16px;
  color: var(--faded);
  transition: color 160ms var(--ease-out), opacity 160ms var(--ease-out);
}

.namefield:focus-within .name-pen {
  opacity: 0;
}

.name-mirror {
  position: fixed;
  left: -10000px;
  top: 0;
  visibility: hidden;
  white-space: pre;
  pointer-events: none;
  font-family: var(--mono-wide);
  font-stretch: 112.5%;
  font-weight: 650;
  font-size: 16px;
  letter-spacing: -0.01em;
}



html:not(.ready) .roll,
html:not(.ready) .side,
html:not(.ready) .credit,
html:not(.ready) .fabdock,
html.slow:not(.ready) .namefield,
html.slow:not(.ready) #stamp-date {
  visibility: hidden;
  opacity: 0;
}

html.slow:not(.ready) .roll {
  visibility: visible;
  opacity: 1;
}

.roll,
.side,
.credit {
  transition:
    opacity 240ms var(--ease-out),
    visibility 0s;
}

html:not(.ready) .printed,
html.ready .loading {
  display: none;
}

.namefield,
#stamp-date {
  transition: opacity 220ms var(--ease-out);
}

.loading {
  display: grid;
  gap: 14px;
  padding: 18px 0 10px;
  opacity: 0;
  animation: loading-in 240ms var(--ease-out) forwards;
}

@keyframes loading-in {
  to {
    opacity: 1;
  }
}

.loading-line {
  position: relative;
  display: grid;
  grid-template-columns: 3ch 1fr auto;
  gap: 10px;
  align-items: center;
  overflow: hidden;
}

.loading-line i {
  height: 9px;
  border-radius: 2px;
  background: rgb(46 48 64 / 0.1);
}

.loading-line i:nth-child(3) {
  width: 5ch;
}

.loading-line::after {
  content: "";
  position: absolute;
  inset: -4px 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgb(251 248 242 / 0.85), transparent);
  transform: translateX(-100%);
  animation: print-head 1.2s linear infinite;
  animation-delay: var(--d, 0s);
}

@keyframes print-head {
  to {
    transform: translateX(260%);
  }
}

.loading p {
  margin-top: 4px;
  text-align: center;
  color: var(--faded);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.rule {
  border: 0;
  border-top: 1.5px dashed var(--ink);
  margin: 16px 0;
  opacity: 0.75;
}

.rule.close {
  margin: 8px 0 4px;
}

.cols {
  display: grid;
  grid-template-columns: 3ch 1fr auto;
  gap: 10px;
  color: var(--faded);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 0 22px 0 0;
}

.cols span:nth-child(2) {
  text-align: left;
}

.sec-label {
  padding: 14px 0 3px;
  color: var(--faded);
  font-family: var(--mono-wide);
  font-size: 12px;
  font-weight: 650;
  font-stretch: 112.5%;
  letter-spacing: -0.01em;
}

.lines {
  list-style: none;
  padding: 0;
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: 3ch minmax(0, 1fr) auto 14px;
  align-items: baseline;
  gap: 10px;
  width: calc(100% + 12px);
  margin: 0 -6px;
  padding: 7px 6px;
  border-radius: 4px;
  text-align: left;
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 14px;
  line-height: 1.45;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background-color 160ms var(--ease-out);
}

.row:active {
  background: var(--hover);
}

.n {
  color: var(--faded);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.name {
  overflow-wrap: anywhere;
}

.txt {
  --strike: transparent;
  background-image: linear-gradient(var(--strike), var(--strike));
  background-repeat: no-repeat;
  background-position: 0 58%;
  background-size: 0% 2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition:
    --strike 180ms var(--ease-out),
    background-size 0s linear 190ms,
    color 200ms var(--ease-out);
}

.q {
  color: var(--faded);
  font-size: 12.5px;
  white-space: nowrap;
  text-align: right;
}

.tick {
  width: 14px;
  height: 14px;
  align-self: center;
  fill: none;
  stroke: var(--biro);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transition:
    opacity 140ms var(--ease-out),
    clip-path 0s linear 140ms;
}

.row[aria-pressed="true"] .txt {
  --strike: var(--biro);
  background-size: 100% 2px;
  color: var(--faded);
  transition:
    --strike 0s,
    background-size 240ms var(--pen),
    color 240ms var(--ease-out);
}

.row[aria-pressed="true"] .tick {
  opacity: 1;
  clip-path: inset(0 0 0 0);
  transition:
    opacity 0s linear 220ms,
    clip-path 160ms var(--pen) 220ms;
}

.row::before,
.row::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
}

.row::before {
  background: rgb(214 54 44 / 0.1);
}

.row.pulse::before {
  animation: pulse 1400ms var(--ease-out);
}

@keyframes pulse {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.row::after {
  background: rgb(46 48 64 / 0.1);
  transition: opacity 120ms var(--ease-out);
}

.row.holding::after {
  opacity: 1;
  transition: opacity 340ms linear;
}

.sec-label.leaving {
  opacity: 0;
  transition: opacity 150ms var(--ease-out);
}

.line.leaving {
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 150ms var(--ease-out),
    transform 150ms var(--ease-out);
}

.empty {
  display: none;
  padding: 18px 0 6px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
}

.empty .faded {
  color: var(--faded);
  font-size: 12px;
}

.empty b {
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

.paper.is-empty .empty {
  display: block;
}

.paper.is-empty .hint,
.paper.is-empty .tally,
.paper.is-empty .cols,
.paper.is-empty .rule.close {
  display: none;
}

.tally {
  position: relative;
}

.totals {
  display: grid;
  gap: 4px;
  font-size: 13px;
  letter-spacing: -0.005em;
}

.totals div {
  display: flex;
  justify-content: space-between;
}

.totals dd {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.totals .big {
  margin-top: 4px;
  font-family: var(--mono-wide);
  font-stretch: 112.5%;
  font-weight: 800;
  font-size: 19px;
}

.stamp {
  position: absolute;
  right: 44px;
  top: 34px;
  padding: 3px 8px 2px;
  border: 2.5px solid var(--biro);
  border-radius: 4px;
  color: var(--biro);
  font-stretch: 112.5%;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: rotate(-7deg);
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  transition: opacity 160ms var(--ease-out);
}

.paper.all-got .stamp {
  opacity: 0.88;
}

.clear {
  display: block;
  margin: 14px auto 0;
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 12px;
  text-decoration: underline dotted 1.5px;
  text-underline-offset: 4px;
  color: var(--ink);
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.clear:active {
  transform: scale(0.97);
}

.clear[hidden] {
  display: none;
}

.foot {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.qr {
  width: 88px;
  height: 88px;
  fill: var(--ink);
  shape-rendering: crispEdges;
}

.foot p {
  color: var(--faded);
  font-size: 11.5px;
  line-height: 1.6;
}

.foot b {
  display: block;
  color: var(--ink);
  font-weight: 600;
}

.hint {
  margin-top: 16px;
  text-align: center;
  color: var(--faded);
  font-size: 11.5px;
  letter-spacing: 0.01em;
}

.endstripe {
  height: 5px;
  margin: 16px -20px 0;
  background: var(--stripe);
}

.thanks {
  margin-top: 12px;
  text-align: center;
  color: var(--faded);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.credit {
  grid-area: credit;
  align-self: end;
  width: 100%;
  max-width: var(--roll-w);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 2px 0;
  color: var(--on-counter-2);
  font-size: 12.5px;
}

.credit a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline 1px rgb(46 48 64 / 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 160ms var(--ease-out);
}

.writein {
  margin-top: 8px;
}

.writein-line {
  position: relative;
  display: grid;
  grid-template-columns: 3ch minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 -6px;
  padding: 3px 3px 3px 6px;
  border-radius: 5px;
  background: rgb(46 48 64 / 0.03);
  cursor: text;
  transition: background-color 160ms var(--ease-out);
}

.writein-line::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px dashed rgb(46 48 64 / 0.3);
  border-radius: inherit;
  pointer-events: none;
  transition: border-color 160ms var(--ease-out);
}

.writein-line:focus-within {
  background: var(--well-fill);
}

.writein-line:focus-within::before {
  border-style: solid;
  border-color: var(--ink);
}

.writein-n {
  color: var(--faded);
}

.writein input {
  min-width: 0;
  height: 30px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  caret-color: var(--biro);
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 14px;
}

@supports (-webkit-touch-callout: none) {
  .writein input {
    font-size: 16px;
    font-stretch: 75%;
  }
}

.writein input::placeholder {
  color: var(--faded);
  opacity: 1;
}

.suggest-wrap {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 280ms cubic-bezier(0.45, 0, 0.2, 1) 70ms;
}

.suggest-wrap.open {
  grid-template-rows: 1fr;
  transition: grid-template-rows 240ms var(--ease-out);
}

.suggest {
  min-height: 0;
  display: flex;
  gap: 6px;
  margin: 0 -8px;
  padding: 10px 8px 2px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}

.suggest::-webkit-scrollbar {
  display: none;
}

.sug {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px 0 7px;
  border-radius: 5px;
  background: var(--well-fill);
  box-shadow:
    inset 0 0 0 1px rgb(40 44 34 / 0.18),
    0 1px 0 rgb(40 44 34 / 0.1);
  color: var(--ink);
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 12.5px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  transition:
    opacity 150ms var(--ease-out) calc(var(--i, 0) * 12ms),
    transform 200ms var(--ease-out) calc(var(--i, 0) * 12ms);
}

.suggest-wrap.open .sug {
  opacity: 1;
  transform: none;
  transition:
    opacity 220ms var(--ease-out) calc(40ms + var(--i, 0) * 28ms),
    transform 260ms var(--ease-out) calc(40ms + var(--i, 0) * 28ms);
}

.sug .ic {
  width: 12px;
  height: 12px;
  color: var(--faded);
}

.sug::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  opacity: 0;
  transition: opacity 160ms var(--ease-out);
  pointer-events: none;
}

.suggest-wrap.open .sug:active {
  transform: scale(0.97);
  transition-delay: 0s;
}

.sug:focus-visible {
  outline-offset: 1px;
}

.entry-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px 0 7px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-weight: 600;
  font-size: 12.5px;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.entry-btn:active {
  transform: scale(0.97);
}

.entry-btn .ic {
  width: 14px;
  height: 14px;
}

.entry-btn:disabled {
  background: rgb(46 48 64 / 0.08);
  color: var(--faded);
  cursor: default;
}

.fabdock {
  grid-area: entry;
  position: sticky;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 20;
  width: 100%;
  max-width: var(--roll-w);
  height: 0;
  pointer-events: none;
}

.fab {
  position: absolute;
  right: 10px;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--ink);
  color: var(--paper);
  box-shadow:
    0 1px 1px rgb(20 22 30 / 0.3),
    0 10px 24px -6px rgb(20 22 30 / 0.45);
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  transition:
    opacity 180ms var(--ease-out),
    transform 220ms var(--ease-out);
}

.fab .ic {
  width: 26px;
  height: 26px;
  stroke-width: 1.8;
}

.fab.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.fab.show:active {
  transform: scale(0.95);
}

.entry-btn:disabled:active {
  transform: none;
}

.btn {
  display: inline-flex;
  font-family: var(--sans);
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border-radius: 6px;
  font-weight: 650;
  font-size: 14.5px;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.btn:active {
  transform: scale(0.97);
}

.btn .ic {
  width: 18px;
  height: 18px;
}

.btn.small {
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  background: var(--paper-fill);
  color: var(--ink);
}

.btn.solid {
  background: var(--ink);
  color: var(--paper);
}

.btn.ghost {
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px rgb(46 48 64 / 0.25);
}

.btn.wide {
  width: 100%;
}

.stubs {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
}

.stubs li {
  position: relative;
}

.stub {
  position: relative;
  display: grid;
  width: 100%;
  padding: 11px 44px 11px 14px;
  border-radius: 3px;
  background: var(--paper-fill);
  text-align: left;
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 12px;
  line-height: 1.6;
  box-shadow: 0 1px 0 rgb(46 48 64 / 0.14);
  transition: transform 160ms var(--ease-out);
}

.stub::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px var(--ring);
  opacity: 0;
  transition: opacity 160ms var(--ease-out);
  pointer-events: none;
}

.stub[aria-current="true"]::after {
  opacity: 1;
}

.stub:active {
  transform: scale(0.99);
}

.stub-name {
  font-family: var(--mono-wide);
  font-stretch: 112.5%;
  font-weight: 650;
  font-size: 14px;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stub-meta {
  color: var(--faded);
}

.stub-x {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: -16px;
  border-radius: 4px;
  color: var(--faded);
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out);
}

.stub-x .ic {
  width: 16px;
  height: 16px;
}

.delete-chit {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 7px;
  height: 34px;
  padding: 0 10px;
  margin-left: -10px;
  border-radius: 6px;
  color: #84201a;
  font-size: 13.5px;
  font-weight: 600;
  transition: background-color 160ms var(--ease-out), transform 160ms var(--ease-out);
}

.delete-chit .ic {
  width: 17px;
  height: 17px;
}

.delete-chit:active {
  transform: scale(0.97);
}

.delete-chit[hidden] {
  display: none;
}

#chits-sheet .delete-chit {
  justify-self: center;
  margin-left: 0;
}

.stubs-empty {
  color: var(--on-counter-2);
  font-size: 13.5px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom) + var(--kb));
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 2 * var(--gutter));
  min-height: 44px;
  padding: 6px 6px 6px 14px;
  border-radius: 8px;
  background: var(--paper-fill);
  color: var(--ink);
  box-shadow: 0 8px 20px rgb(46 48 64 / 0.22), 0 0 0 1px rgb(46 48 64 / 0.08);
  transform: translateX(-50%);
  font-size: 14px;
}

.toast[hidden] {
  display: none;
}

.toast-text {
  min-width: 0;
  padding: 6px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast-text:only-child {
  padding-right: 8px;
}

.toast-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 5px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 650;
  font-size: 13.5px;
  transition: transform 160ms var(--ease-out);
}

.toast-btn[hidden] {
  display: none;
}

.toast-btn:active {
  transform: scale(0.97);
}

.toast-btn .ic {
  width: 16px;
  height: 16px;
}

.tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms var(--ease-out);
}

.tip.on {
  opacity: 1;
}

.tip.instant {
  transition: none;
}

.sheet {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}

.sheet::backdrop {
  background: transparent;
}

.scrim {
  position: absolute;
  inset: 0;
  background: rgb(46 48 64 / 0.4);
}

.panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 48px);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--paper-fill);
  filter: drop-shadow(0 -6px 16px rgb(46 48 64 / 0.16));
}

.panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--tooth) * -1 + 0.5px);
  height: var(--tooth);
  background: conic-gradient(from 135deg at 50% 0, var(--paper) 90deg, #0000 0) 50% 0 / calc(var(--tooth) * 2) 100% repeat-x;
}

.panel-head {
  position: relative;
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  padding: 14px 12px 6px;
  touch-action: none;
}

.panel-head h2 {
  grid-column: 2;
  text-align: center;
  font-family: var(--mono-wide);
  font-stretch: 112.5%;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.panel-head .tool {
  grid-column: 3;
}

.grab {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 36px;
  height: 4px;
  margin-left: -18px;
  border-radius: 2px;
  background: rgb(46 48 64 / 0.18);
}

.panel-body {
  display: grid;
  gap: 16px;
  padding: 10px 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
}

.field-label {
  padding: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--faded);
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: rgb(46 48 64 / 0.06);
  box-shadow: inset 0 0 0 1.5px transparent;
  font-family: var(--mono);
  font-stretch: 87.5%;
  font-size: 16px;
  transition: box-shadow 160ms var(--ease-out);
}

.field input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.sections {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sec-opt {
  position: relative;
}

.sec-opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.sec-opt span {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 11px;
  border-radius: 5px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1.5px rgb(46 48 64 / 0.2);
  cursor: pointer;
  transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}

.sec-opt input:checked + span {
  background: var(--ink);
  color: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.sec-opt input:focus-visible + span {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}

.actions .btn.solid {
  min-width: 112px;
}

.sheet-note {
  color: var(--faded);
  font-size: 13px;
}

#chits-sheet .stub {
  background: #f1f0ea;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .tool:hover,
  .clear:hover,
  .stub-x:hover,
  .mark:hover {
    background: var(--hover);
  }

  .top .tool:hover,
  .top .mark:hover {
    background: rgb(251 250 245 / 0.45);
  }

  .row:hover {
    background: var(--hover);
  }

  .btn.small:hover {
    background: #fff;
  }

  .side .btn.small:hover {
    background: rgb(46 48 64 / 0.12);
  }

  .btn.solid:hover {
    background: #3b3e51;
  }

  .btn.ghost:hover {
    background: var(--hover);
  }

  .stub:hover::after {
    opacity: 0.35;
  }

  .stub[aria-current="true"]:hover::after {
    opacity: 1;
  }

  .stub-x:hover {
    color: var(--ink);
  }

  .delete-chit:hover {
    background: rgb(214 54 44 / 0.1);
  }

  .entry-btn:hover:not(:disabled),
  .fab:hover {
    background: #3b3e51;
  }

  .writein-line:hover:not(:focus-within) {
    background: rgb(46 48 64 / 0.05);
  }

  .sug:hover::after {
    opacity: 0.55;
  }

  .namefield:hover {
    background: rgb(46 48 64 / 0.05);
  }

  .namefield:hover .name-pen {
    color: var(--ink);
  }

  .toast-btn:hover {
    background: #3b3e51;
  }

  .sec-opt span:hover {
    background: var(--hover);
  }

  .sec-opt input:checked + span:hover {
    background: var(--ink);
  }

  .credit a:hover {
    text-decoration-color: var(--ink);
  }
}

@media (max-width: 359px) {
  :root {
    --gutter: 12px;
  }

  .paper {
    padding-left: 16px;
    padding-right: 16px;
  }

  .endstripe {
    margin-left: -16px;
    margin-right: -16px;
  }

  .here {
    padding: 0 8px;
  }

  .foot {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .qr {
    width: 76px;
    height: 76px;
  }
}

@media (max-height: 700px) and (max-width: 719px) {
  .tagline {
    display: none;
  }

  .paper {
    padding-top: 18px;
  }

  .logo {
    font-size: 24px;
  }

  .hint,
  .thanks {
    display: none;
  }
}

@media (min-width: 640px) {
  .panel {
    top: 50%;
    bottom: auto;
    left: 50%;
    right: auto;
    width: min(440px, calc(100vw - 48px));
    max-height: min(640px, calc(100dvh - 64px));
    margin: 0;
    translate: -50% -50%;
    padding-bottom: 0;
    filter: drop-shadow(0 16px 28px rgb(46 48 64 / 0.24));
  }

  .panel::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--tooth) * -1 + 0.5px);
    height: var(--tooth);
    background: conic-gradient(from -45deg at 50% 100%, var(--paper) 90deg, #0000 0) 50% 0 / calc(var(--tooth) * 2) 100% repeat-x;
  }

  .grab {
    display: none;
  }

  .panel-head {
    padding-top: 12px;
    touch-action: auto;
  }
}

@media (min-width: 768px) {
  :root {
    --side-w: 240px;
    --col-gap: 28px;
    --shift: calc((var(--side-w) + var(--col-gap)) / 2);
  }

  .app {
    grid-template-columns: var(--roll-w) var(--side-w);
    grid-template-rows: auto auto 1fr auto auto;
    grid-template-areas:
      "top top"
      "roll right"
      "roll left"
      "entry ."
      "credit .";
    justify-content: center;
    align-items: start;
    column-gap: var(--col-gap);
  }

  .top {
    max-width: none;
  }

  .narrow-only {
    display: none;
  }

  .side {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    align-self: start;
    gap: 22px;
    width: 100%;
    margin-top: var(--tooth);
    padding: 16px 16px 18px;
    border-radius: 12px;
    background: var(--paper-fill);
    box-shadow:
      0 1px 0.5px rgb(40 44 34 / 0.16),
      0 12px 24px -12px rgb(40 44 34 / 0.38);
  }

  .side-left {
    grid-area: left;
    gap: 12px;
  }

  .side-right {
    grid-area: right;
    margin-bottom: 8px;
  }

  .side .stub {
    background: rgb(46 48 64 / 0.045);
    box-shadow: none;
  }

  .side .btn.small {
    background: rgb(46 48 64 / 0.07);
  }

  .side kbd {
    background: var(--well);
    box-shadow:
      inset 0 0 0 1px rgb(40 44 34 / 0.16),
      0 1px 0 rgb(40 44 34 / 0.12);
  }

  .side h2 {
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 8px;
  }

  .side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .side-head h2 {
    margin: 0;
  }

  .stubs-side {
    max-height: min(420px, 50dvh);
    overflow-y: auto;
    margin: -4px;
    padding: 4px;
  }

  .linkbox {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .link-text {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--mono);
    font-stretch: 87.5%;
    font-size: 12px;
    color: var(--on-counter-2);
  }

  .keys {
    display: none;
  }

  .credit {
    max-width: none;
  }

  .toast {
    left: calc(50% - var(--shift));
  }
}

@media (min-width: 1100px) {
  :root {
    --side-w: 260px;
    --col-gap: 48px;
    --shift: 0px;
  }

  .app {
    grid-template-columns: minmax(0, 1fr) var(--roll-w) minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas:
      "top top top"
      "left roll right"
      ". entry ."
      ". credit .";
    justify-content: stretch;
    padding-left: 24px;
    padding-right: 24px;
  }

  .top {
    padding: 14px 0;
  }

  .side {
    position: sticky;
    top: 16px;
    max-width: var(--side-w);
    gap: 26px;
  }

  .side-left {
    justify-self: end;
    gap: 14px;
  }

  .side-right {
    justify-self: start;
    margin-bottom: 0;
  }

  .stubs-side {
    max-height: calc(100dvh - 190px);
  }

  .credit {
    max-width: var(--roll-w);
  }

  .side {
    grid-row: 2 / 5;
  }

  .hint {
    display: none;
  }
}

@media (min-width: 1100px) and (hover: hover) and (pointer: fine) {
  .keys {
    display: block;
  }

  .keys dl {
    display: grid;
    gap: 7px;
    font-size: 13.5px;
    color: var(--on-counter-2);
  }

  .keys dl div {
    display: grid;
    grid-template-columns: 76px 1fr;
    align-items: center;
  }

  .keys dt {
    display: flex;
    gap: 3px;
  }

  kbd {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 600;
    font-size: 12px;
    box-shadow: 0 1px 0 rgb(46 48 64 / 0.2);
  }
}

@media (min-width: 1100px) and (not ((hover: hover) and (pointer: fine))) {
  .hint {
    display: block;
  }
}

@media (min-width: 1600px) {
  :root {
    --roll-w: 480px;
    --side-w: 300px;
    --col-gap: 72px;
  }

  .paper {
    padding: 28px 26px 24px;
    font-size: 14px;
  }

  .endstripe {
    margin-left: -26px;
    margin-right: -26px;
  }

  .logo {
    font-size: 32px;
  }

  .row {
    font-size: 15px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .foot {
    grid-template-columns: 100px minmax(0, 1fr);
  }

  .qr {
    width: 100px;
    height: 100px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .loading-line::after {
    display: none;
  }
}
