/* Fins: the structure every theme shares.

   This stylesheet lays the interface out and names the values a theme has to
   give. A theme's own stylesheet is loaded after this one. It gives those
   values and restyles whatever its look needs, so a screen has one template
   and looks right in every theme.

   A theme sets, on :root:
     type      --font --line --fs-base --fs-tiny --fs-small --fs-note --fs-body
               --fs-figure --fs-h2 --fs-title --fs-hero
               --w-strong --w-h2 --w-title --w-figure --w-hero
     colour    --ground --text --muted --surface --hairline --edge --track --soft
               --good --good-fill --spent --spent-fill --alert --alert-text
               --book-home --book-business --book-combined
     shape     --gutter --gap --nav-space --radius-card --radius-control
               --shadow-card --meter-height --meter-radius
   and for each book, on [data-book]:
               --accent --accent-deep --accent-ink --on-accent

   The page is always right-to-left, so sides are named start and end. Sums of
   money are left-to-right runs inside it: mark them with dir="ltr".

   A size that depends on data comes from the pct-N classes at the end of this
   file, because the Content Security Policy allows no style attribute.
*/

:root {
  --accent-tint: color-mix(in srgb, var(--accent) 12%, transparent);
  --focus: var(--accent);
}

/* --- Elements --------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--line);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

h1,
h2,
h3 {
  font-size: inherit;
  font-weight: inherit;
}

b,
strong {
  font-weight: var(--w-strong);
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-deep);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

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

[hidden] {
  display: none !important;
}

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

.skip {
  position: absolute;
  top: -100px;
  inset-inline-start: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.skip:focus {
  top: 8px;
}

.icon {
  flex: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon--small {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.icon--bold {
  width: 24px;
  height: 24px;
  stroke-width: 2.2;
}

/* --- The shell: navigation beside or under the screen ----------------------- */

.app {
  max-width: 40rem;
  margin-inline: auto;
  padding: max(8px, env(safe-area-inset-top, 0px)) var(--gutter)
    calc(var(--nav-space) + env(safe-area-inset-bottom, 0px));
}

.app__main,
.content {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
}

.nav {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid var(--hairline);
}

/* One column for each place on the bar, five at most (nav.MOST_ON_THE_BAR).
   A column is never narrower than its word, so that on a narrow phone a long
   word takes room from its neighbours instead of running into them. */
.nav__tabs {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-auto-columns: minmax(min-content, 1fr);
  grid-auto-flow: column;
}

.nav__tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 54px;
  color: var(--muted);
  font-size: var(--fs-tiny);
  font-weight: 500;
  text-decoration: none;
}

.nav__tab:hover {
  color: var(--text);
}

.nav__tab[aria-current] {
  color: var(--accent);
  font-weight: 700;
}

.nav__badge {
  position: absolute;
  top: 4px;
  inset-inline-end: calc(50% - 26px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--alert);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* Settings sit in the side menu on a wide screen and in the header on a phone. */
.nav__more {
  display: none;
}

/* On a phone the screens past the fourth wait behind "עוד", in a sheet that
   opens over the bar. It is a popover: the browser opens it from the button,
   and closes it on a tap outside it or on Escape. */
.nav__tab--rest {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0 solid transparent;
  background: transparent;
  font-family: inherit;
  line-height: inherit;
  cursor: pointer;
}

.nav__sheet {
  position: fixed;
  inset-block: auto calc(var(--nav-space) + env(safe-area-inset-bottom, 0px));
  inset-inline: auto var(--gutter);
  width: min(17rem, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - var(--nav-space) - 24px);
  margin: 0;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--text);
  list-style: none;
}

.nav__sheet:popover-open {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav__sheet::backdrop {
  background: color-mix(in srgb, var(--text) 22%, transparent);
}

@media (max-width: 59.99rem) {
  .nav__sheet .nav__tab {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    height: 48px;
    padding: 0 12px;
    border-radius: calc(var(--radius-card) / 2);
    font-size: var(--fs-body);
  }

  .nav__sheet .nav__tab[aria-current] {
    background: var(--accent-tint);
  }

  .nav__sheet .nav__badge {
    position: static;
    margin-inline-start: auto;
  }
}

.nav__cash {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}

.nav__cash:hover {
  background: var(--accent-deep);
  color: var(--on-accent);
}

.nav__cash-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- The header: title, book, month ----------------------------------------- */

.top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "title month settings"
    "books books books";
  align-items: center;
  gap: var(--gap) 4px;
}

.top__title {
  grid-area: title;
  font-size: var(--fs-title);
  font-weight: var(--w-title);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.top__settings {
  grid-area: settings;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--text);
}

.monthpicker {
  grid-area: month;
  display: flex;
  align-items: center;
}

.monthpicker__step {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--muted);
}

.monthpicker__step[aria-disabled] {
  opacity: 0.35;
}

.monthpicker__label {
  min-width: 56px;
  font-size: var(--fs-note);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.books {
  grid-area: books;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.books__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  color: var(--muted);
  font-size: var(--fs-note);
  font-weight: 500;
  text-decoration: none;
}

.books__item:hover {
  color: var(--text);
}

.books__item[aria-current] {
  color: var(--text);
  font-weight: 600;
}

/* Colour is never the only cue: each book also has its name, and a mark or an icon. */
.books__mark {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.books__item--home .books__mark {
  background: var(--book-home);
}

.books__item--business .books__mark {
  background: var(--book-business);
}

.books__item--combined .books__mark {
  background: var(--book-combined);
}

.books .icon {
  display: none;
}

/* --- A wide screen: the navigation becomes a side menu ---------------------- */

@media (min-width: 60rem) {
  .app {
    display: grid;
    grid-template-columns: 216px minmax(0, 1fr);
    align-items: start;
    gap: 14px 22px;
    max-width: 1180px;
    padding: 12px 20px 28px;
  }

  .nav {
    position: sticky;
    inset: auto;
    top: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 0;
    border: 0;
    background: none;
  }

  .nav__tabs {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }

  .nav__tab {
    flex-direction: row;
    justify-content: flex-start;
    gap: 9px;
    height: 48px;
    padding: 0 14px;
    border-radius: 16px;
    font-size: var(--fs-body);
  }

  .nav__tab[aria-current] {
    background: var(--accent-tint);
  }

  .nav__badge {
    position: static;
    margin-inline-start: auto;
  }

  .nav__more {
    display: block;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--hairline);
  }

  /* A wide menu has room for every screen: the sheet is the rest of the list. */
  .nav__tab--rest {
    display: none;
  }

  .nav__sheet,
  .nav__sheet:popover-open {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: auto;
    max-height: none;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    color: inherit;
  }

  .nav__cash {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: var(--fs-note);
    font-weight: 600;
  }

  .nav__cash .icon {
    width: 20px;
    height: 20px;
  }

  .nav__cash-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
  }

  .top {
    grid-template-columns: minmax(140px, 1fr) minmax(260px, 340px) auto;
    grid-template-areas: "title books month";
    align-items: end;
    gap: 12px 16px;
  }

  .top__settings {
    display: none;
  }

  .cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: var(--gap);
  }
}

/* --- The leading figure of a screen ----------------------------------------- */

.lead {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lead__label {
  font-size: var(--fs-note);
  font-weight: 500;
}

.lead__amount {
  font-size: var(--fs-hero);
  font-weight: var(--w-hero);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: right;
}

.lead__currency {
  margin-right: 0.1em;
  font-size: 0.46em;
}

.lead__note {
  font-size: var(--fs-note);
}

/* The room above the bar is for the label of its mark. */
.lead__bar {
  margin-top: 30px;
}

.lead__ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  font-size: var(--fs-small);
}

/* A theme shows progress as a bar or as a ring. The template holds both. */
.lead__ring {
  display: none;
}

.ring {
  position: relative;
  flex: none;
  width: 92px;
  height: 92px;
}

.ring__track {
  fill: rgb(255 255 255 / 0.1);
  stroke: rgb(255 255 255 / 0.28);
  stroke-width: 9;
}

.ring__fill {
  fill: none;
  stroke: currentColor;
  stroke-width: 9;
  stroke-linecap: round;
}

.ring__text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-tiny);
  font-weight: 500;
  line-height: 1.1;
}

.ring__figure {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* --- A bar that fills ------------------------------------------------------- */

.meter {
  position: relative;
  height: var(--meter-height);
  border-radius: var(--meter-radius);
  background: var(--track);
}

.meter__fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--pct);
  border-radius: inherit;
  background: var(--accent);
}

.meter--good .meter__fill {
  background: var(--good-fill);
}

.meter--spent .meter__fill {
  background: var(--spent-fill);
}

.meter__mark {
  position: absolute;
  inset-block: -5px;
  inset-inline-start: var(--pct);
  width: 3px;
  margin-inline-start: -1.5px;
  border-radius: 2px;
  background: var(--text);
}

/* The label is centred over a mark in the middle of the bar and leans inwards
   as the mark nears either end, so it never sticks out past the bar. */
.meter__mark-label {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(calc(var(--pct) - 100%));
  font-size: var(--fs-tiny);
  font-weight: 600;
  white-space: nowrap;
}

/* --- A pair of figures ------------------------------------------------------ */

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

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.stat__label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-note);
  font-weight: 700;
}

.stat--in .icon {
  color: var(--good);
}

.stat--out .icon {
  color: var(--spent);
}

.stat__figure {
  font-size: var(--fs-figure);
  font-weight: var(--w-figure);
  letter-spacing: -0.02em;
  text-align: right;
}

.stat__note {
  color: var(--muted);
  font-size: var(--fs-small);
}

.stat .meter {
  margin-top: 6px;
}

/* --- A titled part of a screen, and the surface inside it ------------------- */

.block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.block__title {
  margin: 12px 6px 0;
  font-size: var(--fs-h2);
  font-weight: var(--w-h2);
  letter-spacing: -0.01em;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.text-muted {
  color: var(--muted);
}

.text-small {
  font-size: var(--fs-small);
}

.text-note {
  font-size: var(--fs-note);
}

/* --- Buttons and links that act --------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--soft);
  color: var(--text);
  font-size: var(--fs-body);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  color: var(--text);
}

.btn .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.btn--main {
  background: var(--accent);
  color: var(--on-accent);
}

.btn--main:hover {
  background: var(--accent-deep);
  color: var(--on-accent);
}

.btn--wide {
  display: flex;
  width: 100%;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--text);
  font-size: var(--fs-note);
  font-weight: 500;
  text-decoration: none;
}

.pill:hover {
  color: var(--text);
}

.pill[aria-current] {
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

/* One of a few, chosen with a tap. Each choice is a button that acts at once,
   so there is nothing to save. The one in force carries a tick, so colour is
   not the only cue. */
.choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--soft);
  color: var(--text);
  text-align: start;
}

.choice[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.choice__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice__name {
  font-size: var(--fs-body);
  font-weight: 600;
}

.choice__hint {
  color: var(--muted);
  font-size: var(--fs-small);
}

.choice__mark {
  flex: none;
  visibility: hidden;
  color: var(--accent);
}

.choice[aria-pressed="true"] .choice__mark {
  visibility: visible;
}

/* A link to work that is waiting, such as lines to file. Each theme draws it
   its own way: a filled button, an outlined one, a row with an arrow. */
.prompt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-body);
  font-weight: 600;
  text-decoration: none;
}

.prompt:hover {
  background: var(--accent-deep);
  color: var(--on-accent);
}

.prompt .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.prompt__more {
  display: none;
}

/* --- Small labels ----------------------------------------------------------- */

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

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: var(--fs-tiny);
  font-weight: 600;
  white-space: nowrap;
}

.tag--good {
  background: color-mix(in srgb, var(--good) 12%, transparent);
  color: var(--good);
}

.tag--alert {
  background: color-mix(in srgb, var(--alert) 12%, transparent);
  color: var(--alert-text);
}

/* A tag that names a book is solid, so it cannot be taken for a status. */
.tag--home {
  background: var(--book-home);
  color: #fff;
}

.tag--business {
  background: var(--book-business);
  color: #fff;
}

.tag--combined {
  background: var(--book-combined);
  color: #fff;
}

/* --- A remark inside a card ------------------------------------------------- */

.note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: var(--fs-note);
}

.note .icon {
  margin-top: 1px;
}

/* Something went wrong. Two classes, so that a theme's own .note does not win. */
.note.note--alert {
  background: color-mix(in srgb, var(--alert) 12%, transparent);
  color: var(--alert-text);
}

/* --- An account, and the dated lines under it ------------------------------- */

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

.account__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
}

.account__icon .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.account__body {
  flex: 1;
  min-width: 0;
}

.account__name {
  font-weight: 500;
}

.account__sub {
  color: var(--muted);
  font-size: var(--fs-small);
}

.account__figure {
  font-size: var(--fs-figure);
  font-weight: var(--w-figure);
  letter-spacing: -0.02em;
}

.rows {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
}

.row__date {
  flex: none;
  width: 40px;
  text-align: center;
}

.row__day {
  display: block;
  font-size: var(--fs-base);
  font-weight: 700;
  line-height: 1.1;
}

.row__month {
  display: block;
  color: var(--muted);
  font-size: var(--fs-tiny);
}

.row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.row__name {
  font-size: var(--fs-body);
  font-weight: 500;
}

.row__figures {
  flex: none;
  text-align: left;
}

.row__amount {
  display: block;
  font-size: var(--fs-body);
  font-weight: 600;
}

.row__sub {
  display: block;
  color: var(--muted);
  font-size: var(--fs-small);
}

/* --- Form fields ------------------------------------------------------------ */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field__label {
  font-size: var(--fs-note);
  font-weight: 600;
}

.field__hint {
  color: var(--muted);
  font-size: var(--fs-small);
}

.field__error {
  color: var(--alert-text);
  font-size: var(--fs-small);
  font-weight: 600;
}

.input[aria-invalid="true"] {
  border-color: var(--alert);
}

/* Never under 16px: a smaller field makes a phone zoom in when it is tapped. */
.input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-size: max(1rem, var(--fs-body));
}

.input:focus-visible {
  outline-offset: 0;
  border-color: var(--accent);
}

/* One of a few, chosen inside a form and sent with it. A .choice acts at
   once; this one waits for the form's button. The mark in it says which is
   chosen, and the frame around it only repeats that. */
.picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-inline: 10px 14px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-control);
  font-size: var(--fs-note);
  cursor: pointer;
}

.pick__input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.pick:has(.pick__input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 600;
}

/* The ring goes around the whole choice, since that is what takes the tap. */
.pick__input:focus-visible {
  outline: 0;
}

.pick:has(.pick__input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* --- The day the data reaches ----------------------------------------------- */

/* A line under the figures of a screen, saying how far the bank's data goes. */
.reach {
  margin-inline: 6px;
  color: var(--muted);
  font-size: var(--fs-small);
}

/* --- A screen with made-up figures ------------------------------------------ */

/* The strip above a sample of a screen, where its theme and its case are
   chosen, and the line on a screen that is not built yet that leads there. */
.sample {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: var(--gap);
  border-bottom: 1px dashed var(--edge);
}

.sample__note {
  color: var(--muted);
  font-size: var(--fs-small);
}

.sample-link {
  color: var(--muted);
  font-size: var(--fs-small);
  text-align: center;
}

/* --- A screen with nothing on it, and a page outside the shell -------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 48px 16px;
  color: var(--muted);
  text-align: center;
}

.empty__title {
  color: var(--text);
  font-size: var(--fs-h2);
  font-weight: var(--w-h2);
}

.plain {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px var(--gutter);
}

.plain__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  max-width: 26rem;
  padding: 24px 20px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.plain__title {
  font-size: var(--fs-figure);
  font-weight: var(--w-title);
  letter-spacing: -0.02em;
}

/* --- Waiting for an answer -------------------------------------------------- */

/* htmx puts .htmx-request on whatever sent a request until the answer comes.
   Its own rules for this would be inline, so they are switched off and live here. */
.htmx-indicator {
  visibility: hidden;
  opacity: 0;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  visibility: visible;
  opacity: 1;
  transition: opacity 200ms ease-in;
}

/* --- The device's own settings ---------------------------------------------- */

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

@media (forced-colors: active) {
  .meter,
  .card,
  .stat,
  .nav__tabs {
    border: 1px solid CanvasText;
  }

  .meter__fill,
  .meter__mark,
  .books__mark {
    forced-color-adjust: none;
    background: CanvasText;
  }
}

/* --- Sizes that depend on data ---------------------------------------------- */

/* pct-N sets how far along something is, from 0 to 100. The part that carries
   the class decides what that means: a bar's fill takes it as its width, a
   mark as its place along the bar. */
.pct-0 { --pct: 0%; } .pct-1 { --pct: 1%; } .pct-2 { --pct: 2%; } .pct-3 { --pct: 3%; } .pct-4 { --pct: 4%; }
.pct-5 { --pct: 5%; } .pct-6 { --pct: 6%; } .pct-7 { --pct: 7%; } .pct-8 { --pct: 8%; } .pct-9 { --pct: 9%; }
.pct-10 { --pct: 10%; } .pct-11 { --pct: 11%; } .pct-12 { --pct: 12%; } .pct-13 { --pct: 13%; } .pct-14 { --pct: 14%; }
.pct-15 { --pct: 15%; } .pct-16 { --pct: 16%; } .pct-17 { --pct: 17%; } .pct-18 { --pct: 18%; } .pct-19 { --pct: 19%; }
.pct-20 { --pct: 20%; } .pct-21 { --pct: 21%; } .pct-22 { --pct: 22%; } .pct-23 { --pct: 23%; } .pct-24 { --pct: 24%; }
.pct-25 { --pct: 25%; } .pct-26 { --pct: 26%; } .pct-27 { --pct: 27%; } .pct-28 { --pct: 28%; } .pct-29 { --pct: 29%; }
.pct-30 { --pct: 30%; } .pct-31 { --pct: 31%; } .pct-32 { --pct: 32%; } .pct-33 { --pct: 33%; } .pct-34 { --pct: 34%; }
.pct-35 { --pct: 35%; } .pct-36 { --pct: 36%; } .pct-37 { --pct: 37%; } .pct-38 { --pct: 38%; } .pct-39 { --pct: 39%; }
.pct-40 { --pct: 40%; } .pct-41 { --pct: 41%; } .pct-42 { --pct: 42%; } .pct-43 { --pct: 43%; } .pct-44 { --pct: 44%; }
.pct-45 { --pct: 45%; } .pct-46 { --pct: 46%; } .pct-47 { --pct: 47%; } .pct-48 { --pct: 48%; } .pct-49 { --pct: 49%; }
.pct-50 { --pct: 50%; } .pct-51 { --pct: 51%; } .pct-52 { --pct: 52%; } .pct-53 { --pct: 53%; } .pct-54 { --pct: 54%; }
.pct-55 { --pct: 55%; } .pct-56 { --pct: 56%; } .pct-57 { --pct: 57%; } .pct-58 { --pct: 58%; } .pct-59 { --pct: 59%; }
.pct-60 { --pct: 60%; } .pct-61 { --pct: 61%; } .pct-62 { --pct: 62%; } .pct-63 { --pct: 63%; } .pct-64 { --pct: 64%; }
.pct-65 { --pct: 65%; } .pct-66 { --pct: 66%; } .pct-67 { --pct: 67%; } .pct-68 { --pct: 68%; } .pct-69 { --pct: 69%; }
.pct-70 { --pct: 70%; } .pct-71 { --pct: 71%; } .pct-72 { --pct: 72%; } .pct-73 { --pct: 73%; } .pct-74 { --pct: 74%; }
.pct-75 { --pct: 75%; } .pct-76 { --pct: 76%; } .pct-77 { --pct: 77%; } .pct-78 { --pct: 78%; } .pct-79 { --pct: 79%; }
.pct-80 { --pct: 80%; } .pct-81 { --pct: 81%; } .pct-82 { --pct: 82%; } .pct-83 { --pct: 83%; } .pct-84 { --pct: 84%; }
.pct-85 { --pct: 85%; } .pct-86 { --pct: 86%; } .pct-87 { --pct: 87%; } .pct-88 { --pct: 88%; } .pct-89 { --pct: 89%; }
.pct-90 { --pct: 90%; } .pct-91 { --pct: 91%; } .pct-92 { --pct: 92%; } .pct-93 { --pct: 93%; } .pct-94 { --pct: 94%; }
.pct-95 { --pct: 95%; } .pct-96 { --pct: 96%; } .pct-97 { --pct: 97%; } .pct-98 { --pct: 98%; } .pct-99 { --pct: 99%; }
.pct-100 { --pct: 100%; }
