@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: block;
  src: url("../fonts/figtree-latin-wght-normal.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.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;
}

:root {
  --paper: #ffffff;
  --ink: #141414;
  --ink-soft: #3f3f3f;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --line-strong: #141414;
  --wash: #f4f4f4;
  --link: #0b4f9c;
  --danger: #8f1d1d;
  --ok: #1f6b3a;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.05), 0 10px 28px rgba(20, 20, 20, 0.06);
  --shadow-hover: 0 2px 8px rgba(20, 20, 20, 0.06), 0 16px 36px rgba(20, 20, 20, 0.08);
  --font-ui: "Figtree", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  --ease: 160ms ease-out;
  color-scheme: light;
}

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

html {
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

::selection {
  background: #d6d6d6;
  color: var(--ink);
}

:focus {
  outline: none;
}

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

[hidden] {
  display: none !important;
}

.skip {
  position: absolute;
  left: 20px;
  top: -48px;
  z-index: 2;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.skip:focus {
  top: 12px;
}

.header {
  background: var(--paper);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
  max-width: calc(68rem + 40px);
  margin: 0 auto;
  padding: 0 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  flex: 0 0 auto;
}

.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex: 0 0 auto;
}

.search {
  flex: 0 1 18rem;
  min-width: 0;
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: calc(40rem + 40px);
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.wrap-home {
  max-width: calc(68rem + 40px);
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.wrap-home h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.1;
}

h2 {
  margin: 32px 0 12px;
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.3;
}

.lede {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
}

.home-search {
  width: 100%;
  margin: 32px 0 0;
}

.home-search input {
  height: 52px;
  padding: 14px 18px;
  border-radius: 16px;
}

[data-category] {
  margin-top: 48px;
}

.cat,
.related h2 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: normal;
  text-transform: none;
}

.index {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 0;
  padding: 0;
}

.index a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px 22px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: background-color var(--ease), box-shadow var(--ease);
}

.index a:hover {
  background: var(--paper);
  box-shadow: var(--shadow-hover);
}

.tool-icon {
  display: block;
  width: 28px;
  height: 28px;
  color: var(--ink);
}

.tool-icon * {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-icon .solid {
  fill: currentColor;
  stroke: none;
}

.tool-icon text {
  fill: currentColor;
  stroke: none;
  font-family: Figtree, sans-serif;
  font-weight: 650;
}

.camera {
  display: block;
  width: 100%;
  max-height: 320px;
  margin-top: 16px;
  border-radius: 8px;
  background: var(--ink);
}

input[type="file"] {
  height: auto;
  min-height: 48px;
  padding: 12px 14px;
}

.tool-name {
  display: block;
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 650;
  line-height: 1.3;
}

.tool-desc {
  display: block;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

.empty {
  margin: 32px 0 0;
  color: var(--ink);
  font-size: 1rem;
}

.card {
  margin-top: 40px;
  padding: 24px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.tool-form {
  margin-top: 0;
}

.tool-form > :first-child,
.tool-form > .section-label:first-child {
  margin-top: 0;
}

.section-label {
  margin: 32px 0 12px;
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.3;
}

.stack {
  margin-top: 16px;
}

.stack:first-child,
.tool-form > .stack:first-child {
  margin-top: 0;
}

.stack label,
.legend-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.5;
}

input,
select {
  height: 48px;
  padding: 12px 14px;
}

textarea {
  display: block;
  min-height: calc(1.5em * 8 + 28px);
  padding: 12px 14px;
  resize: vertical;
}

textarea.short {
  min-height: calc(1.5em * 4 + 28px);
}

.search input {
  width: 100%;
  height: 44px;
  border-radius: 8px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--line-strong);
}

::placeholder {
  color: var(--muted);
  opacity: 1;
}

.mono,
.mono-input {
  font-family: var(--font-mono);
  font-weight: 400;
}

.invalid {
  border-color: var(--danger);
}

.field-error {
  display: block;
  margin-top: 4px;
  color: var(--danger);
  font-size: 0.875rem;
  line-height: 1.45;
}

.field-error[hidden] {
  display: none;
}

.pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 16px;
}

.pair .stack {
  margin-top: 0;
}

.checks {
  margin-top: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  cursor: pointer;
}

.check input {
  width: auto;
  height: auto;
  margin: 0;
  accent-color: var(--ink);
}

.check span {
  line-height: 1.4;
}

fieldset {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.mode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mode {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease);
}

.mode input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.mode span {
  border: 0;
  line-height: 1.2;
}

.mode:has(input:checked) {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

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

.mode input:focus-visible {
  outline: none;
}

.letter-pad {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pad {
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 650;
  cursor: pointer;
}

.pad:hover {
  background: var(--wash);
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.button {
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.button:hover:not(:disabled):not(.is-copied) {
  background: var(--wash);
}

.button-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.button-primary:hover:not(:disabled) {
  background: #2a2a2a;
  border-color: #2a2a2a;
}

.button-primary:active:not(:disabled) {
  background: #000000;
  border-color: #000000;
}

.button:disabled {
  border-color: var(--line);
  background: var(--paper);
  color: var(--muted);
  cursor: default;
}

.button-primary:disabled {
  background: var(--line);
  border-color: var(--line);
  color: var(--muted);
}

.button.is-copied,
.button.is-copied:hover {
  border-color: var(--ok);
  background: var(--paper);
  color: var(--ok);
}

.notice {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--wash);
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.45;
}

.notice + .section-label {
  margin-top: 0;
}

.result {
  margin-top: 20px;
  padding: 20px;
  border-radius: 16px;
  background: var(--wash);
}

.result-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.result-bar .button {
  margin: 0;
}

.result-label,
.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.45;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
}

.stat {
  flex: 1 1 calc(50% - 32px);
  min-width: 7.5rem;
}

.stat-value {
  display: block;
  margin-top: 4px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.mono {
  margin: 8px 0 0;
  font-size: 1.0625rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.result-bar + .mono,
.stats + .mono,
.stats + .hint,
.result > .mono:first-child {
  margin-top: 0;
}

.phrase {
  margin: 8px 0 0;
}

.preline {
  margin: 4px 0 0;
  white-space: pre-wrap;
}

.num-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.num-grid li,
.mega-game span {
  min-width: 3.25rem;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 1rem;
  text-align: center;
}

.mega-game {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mega-game + .mega-game {
  margin-top: 12px;
}

.dice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.die {
  display: grid;
  grid-template-columns: repeat(3, 12px);
  grid-template-rows: repeat(3, 12px);
  gap: 6px;
  width: 72px;
  height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.die span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.die span.on {
  background: var(--ink);
}

.wheel-wrap {
  position: relative;
  width: min(100%, 320px);
  margin: 20px auto 0;
}

.wheel-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

.wheel-pointer {
  position: absolute;
  top: -2px;
  left: 50%;
  z-index: 1;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-right: 9px solid transparent;
  border-left: 9px solid transparent;
  border-top: 16px solid var(--ink);
}

#remaining-label {
  margin-top: 16px;
}

.verdict {
  margin: 8px 0 0;
  font-weight: 650;
}

.verdict.is-bad {
  color: var(--danger);
}

.hint,
.footer p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.qr-paper {
  display: inline-block;
  padding: 16px;
  border-radius: 8px;
  background: var(--paper);
  line-height: 0;
}

.qr-paper img {
  display: block;
  max-width: 100%;
  height: auto;
}

.help {
  margin-top: 48px;
}

.help .lede {
  margin: 0;
}

.home-about {
  max-width: 40rem;
  margin: 48px 0 0;
  color: var(--ink-soft);
  font-size: 1.125rem;
  line-height: 1.5;
}

.help > p,
.prose p {
  margin: 0;
}

.prose {
  margin-top: 24px;
}

.prose p + p,
.help > p + p {
  margin-top: 16px;
}

.help ol {
  margin: 0;
  padding-left: 1.25rem;
}

.help li + li {
  margin-top: 8px;
}

.qa + .qa {
  margin-top: 20px;
}

.qa h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.4;
}

.qa p {
  margin: 8px 0 0;
}

.text-link {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--ease);
}

.text-link:hover {
  color: #08366b;
}

.actions .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.related {
  margin-top: 48px;
}

.footer {
  padding: 64px 20px 32px;
}

.footer-inner {
  max-width: calc(68rem + 40px);
  margin: 0 auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.month-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.month-nav .button,
.month-nav select,
.month-nav input {
  height: 44px;
}

.month-nav select,
.month-nav input {
  padding-top: 8px;
  padding-bottom: 8px;
}

.month-nav select {
  order: 1;
  width: 100%;
}

.month-nav input {
  order: 2;
  width: 100%;
}

.month-nav #prev {
  order: 3;
}

.month-nav #next {
  order: 4;
}

.month-nav #today {
  order: 5;
  grid-column: 1 / -1;
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
}

.cal-label,
.cal-day {
  text-align: center;
  font-size: 0.82rem;
}

.cal-label {
  color: var(--muted);
  font-size: 0.75rem;
}

.cal-day {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 8px 0;
  background: var(--paper);
}

.cal-day.is-out {
  visibility: hidden;
}

.cal-day.is-today {
  outline: 2px solid var(--ink);
}

.cal-day.is-holiday {
  background: var(--ink);
  color: var(--paper);
}

.cal-day.is-optional,
.cal-day.is-major {
  background: var(--wash);
}

.marks {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.marks li {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.bar {
  height: 8px;
  margin-top: 12px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.result .bar {
  background: var(--paper);
}

.bar span {
  display: block;
  height: 100%;
  background: var(--ink);
}

.timer {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
}

.clocks {
  display: grid;
  gap: 20px;
  margin-top: 20px;
}

.clocks .stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  flex: none;
}

.clocks .timer {
  display: block;
  margin-top: 4px;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  line-height: 1.15;
  white-space: nowrap;
}

.clocks .hint {
  display: block;
}

.laps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.laps li {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.hour-head,
.hour-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.hour-head {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.875rem;
}

.hour-row {
  margin-top: 8px;
}

.hour-row input,
.hour-row select {
  width: 100%;
  min-width: 0;
}

.triple {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.triple .stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-top: 0;
  min-width: 0;
}

.holiday-list {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.holiday-list li {
  display: grid;
  grid-template-columns: 6.6rem minmax(0, 1fr);
  gap: 2px 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.holiday-list .when {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.95rem;
}

.holiday-list strong {
  display: block;
  font-weight: 650;
}

.holiday-list .meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.875rem;
}

.units {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.units .stat-value {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: clamp(1.35rem, 4vw, 2rem);
}

.stats.even {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stats.even .stat {
  flex: none;
  min-width: 0;
}

.tool-form > .result-label {
  margin-top: 20px;
}

.tool-form > .timer {
  margin: 4px 0 0;
}

@media (max-width: 420px) {
  .holiday-list li,
  .stats.even {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 640px) {
  .month-nav:has(#today) {
    grid-template-columns: auto minmax(0, 1fr) 6.5rem auto auto;
  }

  .month-nav:not(:has(#today)) {
    grid-template-columns: auto minmax(0, 1fr) 6.5rem auto;
  }

  .month-nav select,
  .month-nav input,
  .month-nav #prev,
  .month-nav #next,
  .month-nav #today {
    order: 0;
    grid-column: auto;
    width: auto;
  }

  .month-nav select,
  .month-nav input {
    width: 100%;
  }

  .clocks {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

@media (min-width: 560px) {
  .pair {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

@media (min-width: 640px) {
  .index {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
}

@media (min-width: 720px) {
  .card {
    padding: 32px;
  }

  .stat {
    flex: 0 0 auto;
    min-width: 0;
  }
}

@media (min-width: 960px) {
  .wrap-home .index {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

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

.proportion {
  display: grid;
  gap: 8px;
}

.fraction-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  margin-top: 20px;
}

.tool-form:has(#fractions) > .stack:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tool-form:has(#fractions) > .stack:first-child label {
  margin-bottom: 0;
}

#count {
  width: 5.5rem;
}

.fraction-term {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fraction {
  display: flex;
  flex-direction: column;
  width: 4.75rem;
}

.fraction input {
  height: 44px;
  padding: 8px 6px;
  text-align: center;
}

.fraction-line {
  height: 2px;
  margin: 6px 0;
  background: var(--ink);
}

.fraction-row select {
  width: 4.25rem;
  height: 44px;
  padding: 8px 10px;
  text-align: center;
}

.sheet {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.sheet th,
.sheet td {
  padding: 6px 12px 6px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.diff {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.diff th,
.diff td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.diff th {
  width: 2.5rem;
  color: var(--muted);
  font-weight: 400;
  text-align: right;
}

.diff .replace,
.diff .insert {
  background: var(--wash);
}

.diff .delete {
  color: var(--muted);
}

.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.emoji {
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.emoji:hover {
  border-color: var(--ink);
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 8px;
}

.group-label {
  margin: 16px 0 8px;
  font-size: 0.95rem;
  font-weight: 650;
}

.is-peak {
  font-weight: 650;
}

.result {
  overflow-x: auto;
}

.actions button.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.split input {
  flex: 1 1 8rem;
  min-width: 0;
}

.split select {
  flex: 0 0 7.25rem;
  width: 7.25rem;
}

.split .field-error {
  flex: 1 0 100%;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--ink);
}

.swatch-other {
  background: var(--muted);
}

.chart-frame {
  position: relative;
  margin-top: 8px;
}

.chart-tip {
  position: absolute;
  z-index: 2;
  width: max-content;
  max-width: calc(100% - 8px);
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 0.8125rem;
  line-height: 1.4;
  pointer-events: none;
}

.chart-tip p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
}

.chart-tip-label {
  display: block;
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.chart-tip strong {
  margin-left: auto;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.chart svg,
#chart svg {
  display: block;
  width: 100%;
  height: auto;
}

#chart text {
  fill: var(--muted);
  font-family: inherit;
  font-size: 12px;
}

#chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}

#chart .line-total,
#chart .line-other {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

#chart .line-total,
#chart .dot-total {
  stroke: var(--ink);
}

#chart .line-other,
#chart .dot-other {
  stroke: var(--muted);
}

#chart .dot-total,
#chart .dot-other {
  fill: var(--paper);
  stroke-width: 2;
}

#chart .dot-total.is-on {
  fill: var(--ink);
}

#chart .dot-other.is-on {
  fill: var(--muted);
}

#chart .cursor {
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0;
}

#chart .cursor.is-on {
  opacity: 0.45;
}

#chart .plot-hit {
  fill: transparent;
  cursor: crosshair;
}

.sheet-scroll {
  max-height: 420px;
  overflow: auto;
  margin-top: 8px;
  scrollbar-gutter: stable;
}

.sheet-scroll .sheet {
  margin-top: 0;
}

.sheet-scroll .sheet th,
.sheet-scroll .sheet td {
  padding-right: 8px;
}

.sheet-scroll .sheet th {
  position: sticky;
  top: 0;
  background: var(--paper);
}

button.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.cost-add,
.cost-extra .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
}

.cost-extra {
  margin-top: 20px;
}

.cost-extra-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cost-extra-head .group-label,
.cost-extra-head .text-link {
  margin: 0;
}

.cost-extra-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 8px;
}

.cost-extra-grid .stack {
  margin-top: 0;
}

@media (min-width: 560px) {
  .cost-extra-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(8rem, 1fr) 11.5rem;
  }
}

.cost-split select {
  flex-basis: 11.5rem;
  width: 11.5rem;
}

.meter {
  height: 8px;
  margin-top: 16px;
  border-radius: 8px;
  background: var(--line);
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
}

