@font-face {
  font-family: Mona;
  src: url("brand/mona-sans-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap
}

/*
  Caelion workspace
  Warm light and modern dark share one set of names. Gold marks what a person
  decides or is looking at: the payday, the stage that waits on someone, focus,
  the current page. Surfaces stay quiet so the figures can be read.
*/

:root {
  color-scheme: light;
  --rail: oklch(.93 .01 80);
  --rail-sub: oklch(.48 .012 72);
  --bg: oklch(.978 .004 84);
  --panel: oklch(.997 .002 84);
  --panel-2: oklch(.984 .0035 84);
  --ink: oklch(.255 .012 70);
  --secondary: oklch(.43 .012 70);
  --sub: oklch(.535 .011 72);
  --line: oklch(.906 .008 80);
  --line-soft: oklch(.942 .006 80);
  --line-strong: oklch(.84 .01 80);
  --hover: oklch(.953 .007 80);
  --active: oklch(.93 .01 80);
  --primary: oklch(.255 .012 70);
  --onprimary: oklch(.985 .004 84);
  --gold: oklch(.80 .115 82);
  --gold-deep: oklch(.71 .125 73);
  --on-gold: oklch(.27 .045 68);
  --gold-ink: oklch(.52 .105 70);
  --gold-soft: oklch(.955 .03 85);
  --gold-line: oklch(.87 .065 84);
  --accent: var(--gold-ink);
  --focus: oklch(.62 .13 68);
  --icon-glow: oklch(.80 .115 82 / .55);
  --icon-tint: oklch(.80 .115 82 / .3);
  --green: oklch(.47 .08 165);
  --green-bg: oklch(.955 .022 165);
  --amber: oklch(.52 .105 70);
  --amber-bg: oklch(.955 .03 85);
  --blue: oklch(.47 .07 250);
  --blue-bg: oklch(.955 .018 250);
  --red: oklch(.5 .15 30);
  --red-bg: oklch(.957 .022 30);
  --shadow: 0 1px 2px oklch(.3 .02 70 / .05);
  --shadow-md: 0 1px 2px oklch(.3 .02 70 / .05), 0 8px 24px -10px oklch(.3 .03 70 / .16);
  --shadow-lg: 0 2px 6px oklch(.3 .02 70 / .06), 0 28px 56px -18px oklch(.3 .03 70 / .28);
  --chart: oklch(.83 .015 80);
  --chart-last: oklch(.71 .125 73);
  /* Payroll cost ramp, checked with the dataviz validator (ordinal, light end 2.07:1) */
  --c-net: #804e0b;
  --c-withheld: #b17a21;
  --c-employer: #d7ab56;
  /* The payday card is a night sky in both themes */
  --night: oklch(.245 .012 70);
  --night-2: oklch(.195 .01 70);
  --night-ink: oklch(.955 .01 85);
  --night-sub: oklch(.77 .014 80);
  --night-line: oklch(1 0 0 / .1);
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --ease-spring: linear(0, .009, .035 2.1%, .141, .281 6.7%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1);
  --frame: 8px;
  --rail-w: 252px;
  --top-h: 58px
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --rail: oklch(.178 .005 75);
  --rail-sub: oklch(.68 .01 80);
  --bg: oklch(.207 .006 75);
  --panel: oklch(.237 .007 75);
  --panel-2: oklch(.258 .008 75);
  --ink: oklch(.935 .008 85);
  --secondary: oklch(.79 .01 80);
  --sub: oklch(.68 .01 80);
  --line: oklch(.315 .008 75);
  --line-soft: oklch(.278 .007 75);
  --line-strong: oklch(.41 .01 75);
  --hover: oklch(.272 .008 75);
  --active: oklch(.305 .01 75);
  --primary: oklch(.93 .01 85);
  --onprimary: oklch(.22 .01 75);
  --gold: oklch(.81 .115 82);
  --gold-deep: oklch(.72 .125 74);
  --on-gold: oklch(.24 .04 68);
  --gold-ink: oklch(.83 .105 83);
  --gold-soft: oklch(.31 .05 78);
  --gold-line: oklch(.46 .075 78);
  --focus: oklch(.8 .12 80);
  --icon-glow: oklch(.81 .115 82 / .45);
  --icon-tint: oklch(.81 .115 82 / .24);
  --green: oklch(.8 .08 165);
  --green-bg: oklch(.3 .04 165);
  --amber: oklch(.83 .105 83);
  --amber-bg: oklch(.31 .05 78);
  --blue: oklch(.8 .06 250);
  --blue-bg: oklch(.3 .035 250);
  --red: oklch(.78 .11 30);
  --red-bg: oklch(.31 .05 30);
  --shadow: 0 1px 2px oklch(0 0 0 / .28);
  --shadow-md: 0 1px 2px oklch(0 0 0 / .3), 0 10px 28px -10px oklch(0 0 0 / .55);
  --shadow-lg: 0 2px 6px oklch(0 0 0 / .35), 0 30px 60px -18px oklch(0 0 0 / .7);
  --chart: oklch(.45 .012 75);
  --chart-last: oklch(.81 .115 82);
  --c-net: #efcc83;
  --c-withheld: #ce9a43;
  --c-employer: #a36d24;
  --night: oklch(.262 .012 72);
  --night-2: oklch(.222 .01 72)
}

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

html {
  font: 430 15px/1.5 Mona, system-ui, sans-serif;
  font-synthesis: none;
  /* Mona's tabular figures use a slashed zero; proportional figures read as money */
  font-feature-settings: "tnum" 0;
  background: var(--rail);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--rail)
}

::selection {
  background: oklch(.80 .115 82 / .35)
}

a {
  color: inherit;
  text-decoration: none
}

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

button,
summary {
  cursor: pointer
}

button {
  color: inherit
}

img,
svg {
  display: block
}

input,
select,
textarea {
  min-width: 0
}

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

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

h1,
h2,
h3,
b,
strong {
  font-weight: 600
}

ul,
ol {
  padding-inline-start: 1.35em
}

small {
  font-size: .8rem
}

summary {
  list-style: none
}

summary::-webkit-details-marker {
  display: none
}

.icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  pointer-events: none
}

.icon svg {
  width: 100%;
  height: 100%;
  grid-area: 1/1
}

a,
button,
summary {
  -webkit-tap-highlight-color: transparent
}

.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap
}

.skip:focus {
  position: fixed;
  z-index: 40;
  top: 12px;
  left: 12px;
  background: var(--panel);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-md)
}

/* ---------- Shell ---------- */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr)
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 12px 12px;
  background: var(--rail);
  z-index: 12;
  view-transition-name: rail
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.22rem;
  font-weight: 620;
  font-stretch: 118%;
  letter-spacing: -.035em;
  line-height: 1;
  color: var(--ink)
}

.rail>.brand {
  padding: 6px 10px 0;
  margin-bottom: 22px
}

.brand img {
  width: 30px;
  height: 30px
}

.company-picker,
.account-picker,
.column-picker {
  position: relative
}

.company-picker>summary,
.account-picker>summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border-radius: var(--r-md);
  transition: background-color .15s
}

.company-picker>summary {
  padding: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow)
}

.company-picker>summary:hover,
.account-picker>summary:hover {
  background: var(--hover)
}

.company-picker[open]>summary {
  background: var(--panel)
}

.company-picker b,
.company-picker small,
.account-picker b,
.account-picker small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.company-picker summary>span:nth-child(2),
.account-picker summary>span:nth-child(2) {
  flex: 1;
  min-width: 0
}

.company-picker b,
.account-picker b {
  font-size: .86rem;
  font-weight: 590;
  letter-spacing: -.01em
}

.company-picker small,
.account-picker small {
  font-size: .74rem;
  color: var(--sub)
}

.account-picker small {
  color: var(--rail-sub)
}

/* The logo's spark is a white-gold glint: on light grounds the mark uses a deeper gold spark */
.mark-dark,
:root[data-theme="dark"] .mark-light {
  display: none
}

:root[data-theme="dark"] .mark-dark {
  display: block
}

.company-icon,
.avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  font-size: .76rem;
  font-weight: 650;
  font-stretch: 110%;
  letter-spacing: .02em
}

.company-icon {
  color: var(--on-gold);
  background: linear-gradient(160deg, var(--gold), var(--gold-deep));
  box-shadow: inset 0 1px 0 oklch(1 0 0 / .35)
}

.avatar {
  background: var(--active);
  color: var(--ink);
  border-radius: 50%
}

.company-picker summary>.icon,
.account-picker summary>.icon {
  width: 16px;
  height: 16px;
  color: var(--sub)
}

.picker-options,
.column-picker>div {
  position: absolute;
  z-index: 16;
  min-width: 100%;
  inset-inline-start: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 5px;
  margin-top: 6px;
  transform-origin: top center;
  animation: menu-in .18s var(--ease-out)
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(.98)
  }
}

.picker-options button,
.picker-options a {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 0;
  text-align: left;
  font-size: .84rem;
  padding: 8px 9px;
  border-radius: var(--r-xs);
  color: var(--ink)
}

.picker-options button .icon,
.picker-options a .icon {
  color: var(--secondary)
}

.picker-options button:hover,
.picker-options a:hover {
  background: var(--hover)
}

.picker-options .icon {
  width: 16px;
  height: 16px
}

.picker-options button>.icon:last-child {
  margin-left: auto;
  color: var(--gold-ink)
}

.account-picker {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding: 10px 0 0
}

.account-picker>summary {
  padding: 7px 8px
}

.account-picker .picker-options {
  bottom: calc(100% + 2px);
  transform-origin: bottom center
}

.main-nav {
  min-height: 0;
  flex: 1;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding: 4px 0 8px;
  margin: 0 -4px;
  padding-inline: 4px
}

.nav-group {
  margin-top: 14px
}

/* Each section folds away from its heading; ui.js remembers the choice */
.nav-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0 0 3px;
  padding: 5px 10px;
  border: 0;
  border-radius: var(--r-xs);
  background: none;
  font-size: .74rem;
  font-weight: 560;
  color: var(--rail-sub);
  text-align: left;
  transition: color .15s, background-color .15s
}

.nav-heading>span:not(.icon) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-right: auto
}

.nav-heading:hover {
  color: var(--ink);
  background: color-mix(in oklch, var(--hover) 70%, transparent)
}

.nav-heading .icon {
  width: 14px;
  height: 14px;
  opacity: 0;
  transition: opacity .15s, rotate .28s var(--ease-out)
}

.nav-heading:is(:hover, :focus-visible) .icon,
.nav-group.collapsed .nav-heading .icon {
  opacity: 1
}

.nav-group.collapsed .nav-heading .icon {
  rotate: -90deg
}

/* A folded section that holds the current page says so */
.nav-group.collapsed:has([aria-current]) .nav-heading>span:not(.icon)::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold-deep)
}

.nav-links {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .3s var(--ease-out), opacity .22s ease
}

.nav-links>div {
  min-height: 0;
  overflow: hidden;
  /* room for the current item's ring, which sits on its edge */
  margin: -2px -4px;
  padding: 2px 4px
}

.nav-group.collapsed .nav-links {
  grid-template-rows: 0fr;
  opacity: 0
}

.nav-group.collapsed+.nav-group {
  margin-top: 6px
}

.nav-group a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: .865rem;
  font-weight: 480;
  color: var(--secondary);
  transition: background-color .15s, color .15s
}

.nav-group a .icon {
  width: 18px;
  height: 18px;
  color: var(--rail-sub);
  transition: color .15s
}

.nav-group a:hover {
  background: var(--hover);
  color: var(--ink)
}

.nav-group a:hover .icon {
  color: var(--secondary)
}

.nav-group a[aria-current] {
  color: var(--ink);
  background: var(--panel);
  font-weight: 600;
  box-shadow: var(--shadow), 0 0 0 1px var(--line)
}

.nav-group a[aria-current] .icon {
  color: var(--gold-ink)
}

.nav-group a[aria-current] .icon .fill,
.tabbar a[aria-current] .icon .fill {
  fill: var(--icon-tint)
}

.work-area {
  min-width: 0;
  background: var(--bg);
  position: relative
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--top-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 clamp(18px, 3vw, 44px);
  background: color-mix(in oklch, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
  view-transition-name: topbar
}

.scrolled .topbar {
  border-bottom-color: var(--line)
}

.crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-right: auto;
  font-size: .84rem;
  white-space: nowrap;
  color: var(--sub)
}

.crumb strong {
  font-weight: 560;
  color: var(--ink);
  text-overflow: ellipsis;
  overflow: hidden
}

.crumb .icon {
  width: 14px;
  height: 14px;
  color: var(--line-strong)
}

.crumb-mark {
  display: none;
  margin-right: 4px
}

.crumb-mark img {
  width: 26px;
  height: 26px
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  min-width: 240px;
  padding: 0 6px 0 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r-md);
  color: var(--sub);
  font-size: .82rem;
  box-shadow: var(--shadow);
  transition: border-color .15s, background-color .15s
}

.search-trigger:hover {
  border-color: var(--line-strong)
}

.search-trigger .icon {
  width: 16px;
  height: 16px
}

.search-trigger span {
  margin-right: auto
}

kbd {
  font: 550 .68rem Mona, sans-serif;
  color: var(--sub);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  background: var(--panel-2);
  white-space: nowrap
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--r-md);
  color: var(--secondary);
  box-shadow: var(--shadow);
  transition: background-color .15s, color .15s, transform .12s var(--ease-out)
}

.icon-btn:hover {
  background: var(--hover);
  color: var(--ink)
}

.icon-btn:active {
  transform: scale(.94)
}

.icon-btn .icon {
  width: 18px;
  height: 18px
}

.theme-toggle .icon {
  grid-area: 1/1
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  gap: 2px;
  flex-shrink: 0;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  min-width: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--sub);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  transition: background-color 140ms ease, color 140ms ease;
}

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

.lang-btn.is-active {
  background: var(--active);
  color: var(--ink);
}

/* The glyph says what the two letters switch: the language. */
.lang-glyph {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 26px;
  margin-left: 3px;
  color: var(--sub);
}

.lang-glyph .icon {
  width: 15px;
  height: 15px;
}

.lang-switch:hover .lang-glyph {
  color: var(--ink);
}

.when-dark,
:root[data-theme="dark"] .when-light,
.menu-toggle,
.mobile-search,
.scrim,
.tabbar {
  display: none
}

:root[data-theme="dark"] .when-dark {
  display: inline-flex
}

.when-light {
  display: inline-flex
}

.workspace-content {
  padding: clamp(20px, 2.6vw, 36px) clamp(18px, 3vw, 44px) 72px;
  max-width: 1400px;
  margin: auto;
  outline: 0
}

/* Desktop: the work area sits in the frame like a sheet */
@media (min-width: 860px) {
  body:has(> .app-shell)::before {
    content: "";
    position: fixed;
    z-index: 11;
    inset: 0 0 auto;
    height: var(--frame);
    background: var(--rail);
    pointer-events: none
  }

  .work-area {
    margin: var(--frame) var(--frame) var(--frame) 0;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    min-height: calc(100dvh - 2 * var(--frame));
    box-shadow: var(--shadow)
  }

  .topbar {
    top: var(--frame);
    margin: -1px -1px 0;
    border: 1px solid var(--line);
    border-bottom-color: transparent;
    border-radius: var(--r-lg) var(--r-lg) 0 0
  }

  .scrolled .topbar {
    border-bottom-color: var(--line)
  }

  .topbar::before,
  .topbar::after {
    content: "";
    position: absolute;
    top: -1px;
    width: var(--r-lg);
    height: var(--r-lg);
    pointer-events: none
  }

  .topbar::before {
    left: -1px;
    background: radial-gradient(circle at 100% 100%, transparent calc(var(--r-lg) - .5px), var(--rail) var(--r-lg))
  }

  .topbar::after {
    right: -1px;
    background: radial-gradient(circle at 0 100%, transparent calc(var(--r-lg) - .5px), var(--rail) var(--r-lg))
  }
}

/* ---------- Page structure ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  margin: 4px 0 26px
}

.page-head>div:first-child {
  flex: 1 1 380px;
  min-width: 0
}

.page-head h1,
.auth-card h1 {
  font-size: clamp(1.85rem, 2.5vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -.035em;
  font-weight: 600;
  font-stretch: 112%;
  text-wrap: balance
}

.page-head p,
.panel-head p,
.muted,
.report-card p,
.statement-head p,
.more p {
  font-size: .9rem;
  line-height: 1.55;
  color: var(--secondary)
}

.page-head p {
  margin-top: 8px;
  max-width: 72ch
}

.actions,
.row-actions,
.form-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap
}

.page-head>.actions {
  justify-content: flex-end
}

.btn,
.small-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 7px 14px;
  font-size: .855rem;
  line-height: 1.2;
  font-weight: 570;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s, filter .15s, transform .12s var(--ease-out)
}

.btn:active,
.small-btn:active {
  transform: scale(.97)
}

.btn .icon {
  width: 16px;
  height: 16px
}

.btn.primary {
  background: var(--primary);
  color: var(--onprimary);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / .1), 0 1px 2px oklch(0 0 0 / .18)
}

.btn.primary:hover {
  background: color-mix(in oklch, var(--primary) 86%, var(--gold-deep))
}

.btn.secondary,
.small-btn {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow)
}

.btn.secondary .icon {
  color: var(--secondary)
}

.btn.secondary:hover,
.small-btn:hover {
  background: var(--hover);
  border-color: var(--line-strong)
}

.btn.gold {
  background: linear-gradient(180deg, var(--gold), var(--gold-deep));
  color: var(--on-gold);
  border-color: oklch(.62 .12 70 / .5);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / .4), 0 1px 2px oklch(.45 .1 70 / .3), 0 6px 16px -8px oklch(.6 .14 72 / .7)
}

.btn.gold:hover {
  filter: brightness(1.05) saturate(1.05)
}

.btn.compact,
.small-btn {
  min-height: 30px;
  font-size: .78rem;
  padding: 5px 11px;
  border-radius: var(--r-sm)
}

.small-btn {
  font-weight: 550
}

.btn:disabled,
.small-btn:disabled {
  opacity: .5;
  cursor: not-allowed
}

.text-link,
.back,
.auth-link a {
  color: var(--accent);
  font-size: .84rem;
  font-weight: 590
}

.text-link,
.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-underline-offset: .22em;
  text-decoration-thickness: 1px
}

.text-link .icon,
.back .icon {
  width: 16px;
  height: 16px
}

.back {
  color: var(--secondary);
  margin: 0 0 16px
}

.back:hover {
  color: var(--ink)
}

.text-link:hover,
.record-link:hover,
.auth-link a:hover {
  text-decoration: underline;
  text-underline-offset: .22em
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  min-width: 0
}

.panel h2,
.statement h2 {
  font-size: 1.02rem;
  font-weight: 620;
  line-height: 1.35;
  letter-spacing: -.02em
}

.panel h3 {
  font-size: .94rem;
  letter-spacing: -.015em
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 18px 22px
}

.panel-head p {
  font-size: .82rem;
  margin-top: 2px
}

.panel-head .actions {
  gap: 4px 14px
}

.panel-head.bare {
  padding: 0
}

.empty {
  color: var(--sub);
  padding: 28px;
  text-align: center;
  font-size: .87rem
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  background: var(--hover);
  color: var(--secondary);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 620
}

/* ---------- Overview ---------- */

.overview-head p {
  color: var(--sub)
}

.dashboard-top {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: stretch
}

.pay-card {
  /* Warm paper in light mode; the night card returns in dark mode */
  --card-ink: var(--ink);
  --card-sub: var(--secondary);
  --card-faint: var(--sub);
  --card-glass: oklch(.995 .004 85 / .6);
  --card-glass-line: oklch(.3 .02 70 / .09);
  --card-day: var(--ink);
  --card-outside: oklch(.3 .02 70 / .3);
  --card-period: oklch(.8 .115 82 / .24);
  --card-today: oklch(.255 .012 70 / .72);
  --card-track: oklch(.3 .02 70 / .1);
  --card-done: oklch(.3 .02 70 / .42);
  --card-done-ink: var(--ink);
  --card-current: var(--gold-ink);
  --card-pill-ink: var(--gold-ink);
  --card-pill-bg: oklch(.8 .115 82 / .16);
  --card-pill-line: oklch(.7 .12 74 / .3);
  --card-spark: oklch(.66 .13 70);
  --card-surface: oklch(.985 .008 84);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "copy cal" "stages stages";
  gap: 22px 36px;
  padding: 26px 28px 22px;
  border-radius: var(--r-xl);
  overflow: hidden;
  isolation: isolate;
  color: var(--card-ink);
  background:
    radial-gradient(70% 95% at 88% 0%, oklch(.93 .06 84 / .75), transparent 66%),
    radial-gradient(55% 75% at 0% 100%, oklch(.95 .03 80 / .6), transparent 72%),
    linear-gradient(165deg, oklch(.996 .004 85), oklch(.974 .014 82));
  box-shadow: 0 0 0 1px oklch(.84 .05 80 / .55), var(--shadow-md), inset 0 1px 0 oklch(1 0 0 / .9)
}

:root[data-theme="dark"] .pay-card {
  --card-ink: var(--night-ink);
  --card-sub: var(--night-sub);
  --card-faint: var(--night-sub);
  --card-glass: oklch(.2 .01 72 / .55);
  --card-glass-line: oklch(1 0 0 / .08);
  --card-day: oklch(.92 .01 85);
  --card-outside: oklch(.95 .01 85 / .3);
  --card-period: oklch(.81 .115 82 / .17);
  --card-today: oklch(.95 .01 85 / .75);
  --card-track: oklch(1 0 0 / .12);
  --card-done: oklch(.95 .01 85 / .55);
  --card-done-ink: oklch(.9 .01 85);
  --card-current: oklch(.9 .09 85);
  --card-pill-ink: oklch(.9 .09 85);
  --card-pill-bg: oklch(.81 .115 82 / .14);
  --card-pill-line: oklch(.81 .115 82 / .28);
  --card-spark: oklch(.93 .08 88);
  --card-surface: var(--night);
  background:
    radial-gradient(90% 120% at 100% 0%, oklch(.5 .08 78 / .26), transparent 62%),
    radial-gradient(60% 80% at 0% 100%, oklch(.42 .05 70 / .18), transparent 70%),
    linear-gradient(165deg, var(--night), var(--night-2));
  box-shadow: var(--shadow-lg), inset 0 1px 0 oklch(1 0 0 / .1), 0 0 0 1px oklch(.81 .115 82 / .14)
}

/* The armillary: an engraved 3D instrument drawn by tools/build_armillary.py */
.armillary {
  --arm-surface: var(--bg);
  --arm-pri-near: oklch(.50 .125 70 / .72);
  --arm-pri-mid: oklch(.54 .115 72 / .44);
  --arm-pri-far: oklch(.58 .095 74 / .20);
  --arm-sec-near: oklch(.54 .105 72 / .42);
  --arm-sec-mid: oklch(.58 .095 74 / .24);
  --arm-sec-far: oklch(.60 .080 76 / .10);
  --arm-fl-pri-near: oklch(.84 .12 84 / .30);
  --arm-fl-pri-mid: oklch(.78 .12 78 / .16);
  --arm-fl-pri-far: oklch(.72 .10 74 / .04);
  --arm-wl-pri-near: oklch(.66 .13 70 / .24);
  --arm-wl-pri-mid: oklch(.62 .12 68 / .14);
  --arm-wl-pri-far: oklch(.58 .10 66 / .05);
  --arm-fl-sec-near: oklch(.80 .11 82 / .14);
  --arm-fl-sec-mid: oklch(.76 .10 78 / .07);
  --arm-fl-sec-far: oklch(.72 .08 74 / .02);
  --arm-wl-sec-near: oklch(.66 .11 72 / .13);
  --arm-wl-sec-mid: oklch(.62 .10 70 / .07);
  --arm-wl-sec-far: oklch(.58 .08 68 / .02);
  --arm-ko-front: color-mix(in oklch, var(--arm-surface) 84%, transparent);
  --arm-ko-back: color-mix(in oklch, var(--arm-surface) 58%, transparent);
  --arm-glow-hot: oklch(.86 .12 84 / .36);
  --arm-glow-mid: oklch(.84 .12 82 / .16);
  --arm-glow-soft: oklch(.82 .11 80 / .04);
  --arm-spark-hi: oklch(.74 .13 80);
  --arm-spark-mid: oklch(.62 .13 74);
  --arm-spark-lo: oklch(.48 .12 66);
  --arm-reticle: oklch(.56 .11 72 / .28);
  --arm-rivet-stroke: oklch(.52 .12 70 / .62);
  --arm-rivet-fill: oklch(.86 .12 84 / .75);
  overflow: visible;
  pointer-events: none
}

:root[data-theme="dark"] .armillary {
  --arm-surface: var(--bg);
  --arm-pri-near: oklch(.91 .115 86 / .74);
  --arm-pri-mid: oklch(.82 .115 82 / .44);
  --arm-pri-far: oklch(.74 .095 78 / .19);
  --arm-sec-near: oklch(.85 .10 84 / .40);
  --arm-sec-mid: oklch(.78 .09 80 / .23);
  --arm-sec-far: oklch(.72 .08 76 / .10);
  --arm-fl-pri-near: oklch(.88 .12 86 / .24);
  --arm-fl-pri-mid: oklch(.78 .12 80 / .11);
  --arm-fl-pri-far: oklch(.68 .10 74 / .025);
  --arm-wl-pri-near: oklch(.74 .13 76 / .20);
  --arm-wl-pri-mid: oklch(.64 .12 72 / .10);
  --arm-wl-pri-far: oklch(.54 .10 68 / .03);
  --arm-fl-sec-near: oklch(.84 .11 84 / .11);
  --arm-fl-sec-mid: oklch(.74 .10 78 / .05);
  --arm-fl-sec-far: oklch(.66 .08 74 / .015);
  --arm-wl-sec-near: oklch(.72 .11 76 / .10);
  --arm-wl-sec-mid: oklch(.62 .10 72 / .045);
  --arm-wl-sec-far: oklch(.54 .08 68 / .015);
  --arm-ko-front: color-mix(in oklch, var(--arm-surface) 86%, transparent);
  --arm-ko-back: color-mix(in oklch, var(--arm-surface) 60%, transparent);
  --arm-glow-hot: oklch(.88 .13 85 / .38);
  --arm-glow-mid: oklch(.80 .12 80 / .16);
  --arm-glow-soft: oklch(.72 .10 76 / .04);
  --arm-spark-hi: oklch(.98 .05 94);
  --arm-spark-mid: oklch(.88 .12 85);
  --arm-spark-lo: oklch(.72 .13 76);
  --arm-reticle: oklch(.86 .10 84 / .26);
  --arm-rivet-stroke: oklch(.90 .11 86 / .58);
  --arm-rivet-fill: oklch(.88 .12 86 / .65)
}

.armillary .arm-st-pri-far {
  stop-color: var(--arm-pri-far)
}

.armillary .arm-st-pri-mid {
  stop-color: var(--arm-pri-mid)
}

.armillary .arm-st-pri-near {
  stop-color: var(--arm-pri-near)
}

.armillary .arm-st-sec-far {
  stop-color: var(--arm-sec-far)
}

.armillary .arm-st-sec-mid {
  stop-color: var(--arm-sec-mid)
}

.armillary .arm-st-sec-near {
  stop-color: var(--arm-sec-near)
}

.armillary .arm-fl-pri-far {
  stop-color: var(--arm-fl-pri-far)
}

.armillary .arm-fl-pri-mid {
  stop-color: var(--arm-fl-pri-mid)
}

.armillary .arm-fl-pri-near {
  stop-color: var(--arm-fl-pri-near)
}

.armillary .arm-wl-pri-far {
  stop-color: var(--arm-wl-pri-far)
}

.armillary .arm-wl-pri-mid {
  stop-color: var(--arm-wl-pri-mid)
}

.armillary .arm-wl-pri-near {
  stop-color: var(--arm-wl-pri-near)
}

.armillary .arm-fl-sec-far {
  stop-color: var(--arm-fl-sec-far)
}

.armillary .arm-fl-sec-mid {
  stop-color: var(--arm-fl-sec-mid)
}

.armillary .arm-fl-sec-near {
  stop-color: var(--arm-fl-sec-near)
}

.armillary .arm-wl-sec-far {
  stop-color: var(--arm-wl-sec-far)
}

.armillary .arm-wl-sec-mid {
  stop-color: var(--arm-wl-sec-mid)
}

.armillary .arm-wl-sec-near {
  stop-color: var(--arm-wl-sec-near)
}

.armillary .arm-glow-hot {
  stop-color: var(--arm-glow-hot)
}

.armillary .arm-glow-mid {
  stop-color: var(--arm-glow-mid)
}

.armillary .arm-glow-soft {
  stop-color: var(--arm-glow-soft)
}

.armillary .arm-glow-edge {
  stop-color: var(--arm-glow-soft);
  stop-opacity: 0
}

.armillary .arm-spark-hi {
  stop-color: var(--arm-spark-hi)
}

.armillary .arm-spark-mid {
  stop-color: var(--arm-spark-mid)
}

.armillary .arm-spark-lo {
  stop-color: var(--arm-spark-lo)
}

.armillary .arm-ko-front {
  fill: var(--arm-ko-front);
  stroke: none
}

.armillary .arm-ko-back {
  fill: var(--arm-ko-back);
  stroke: none
}

.armillary :is(.arm-edge, .arm-bezel, .arm-groove, .arm-hair, .arm-grad, .arm-pin, .arm-reticle-ring, .arm-reticle-ticks) {
  fill: none;
  vector-effect: non-scaling-stroke
}

.armillary .arm-edge-pri {
  stroke-width: 1.18px;
  stroke-linecap: butt
}

.armillary .arm-edge-sec {
  stroke-width: .78px;
  stroke-linecap: butt
}

.armillary .arm-edge-soft {
  stroke-width: .72px;
  stroke-linecap: butt;
  opacity: .72
}

.armillary .arm-bezel {
  stroke-width: .62px;
  stroke-linecap: butt;
  opacity: .55
}

.armillary .arm-groove {
  stroke-width: .55px;
  stroke-linecap: butt;
  opacity: .42
}

.armillary .arm-hair {
  stroke-width: .68px;
  stroke-linecap: butt
}

.armillary .arm-grad-minor {
  stroke-width: .72px;
  stroke-linecap: round;
  opacity: .74
}

.armillary .arm-grad-major {
  stroke-width: 1.15px;
  stroke-linecap: round;
  opacity: 1
}

.armillary .arm-pin {
  stroke-width: 1.15px;
  stroke-linecap: round
}

.armillary .arm-rivet-ring {
  fill: var(--arm-ko-front);
  stroke: var(--arm-rivet-stroke);
  stroke-width: .95px;
  vector-effect: non-scaling-stroke
}

.armillary .arm-rivet-dot {
  fill: var(--arm-rivet-fill);
  stroke: none
}

.armillary .arm-node {
  opacity: .82
}

.armillary .arm-reticle-ring {
  stroke: var(--arm-reticle);
  stroke-width: .75px;
  stroke-dasharray: 2 3
}

.armillary .arm-reticle-ticks {
  stroke: var(--arm-reticle);
  stroke-width: .85px;
  stroke-linecap: round
}

.armillary :is(.arm-spark, .arm-spark-inner, .arm-spark-facets) {
  fill: none;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  stroke-linecap: round
}

.armillary .arm-spark {
  stroke-width: 1.45px
}

.armillary .arm-spark-inner {
  stroke-width: .85px;
  opacity: .58
}

.armillary .arm-spark-facets {
  stroke-width: .65px;
  opacity: .38
}

/* In the payday card the instrument is centred on the payday itself; ui.js measures the day.
   The card-locked stage fades before the copy and stage bar regardless of weekday column,
   and hides the central sparkle when the payday pill itself acts as the core sun. */
.pay-rings-stage {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image:
    linear-gradient(to right, transparent 22%, rgb(0 0 0 / .35) 38%, #000 54%),
    linear-gradient(to top, rgb(0 0 0 / .22) 0%, #000 22%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to right, transparent 22%, rgb(0 0 0 / .35) 38%, #000 54%),
    linear-gradient(to top, rgb(0 0 0 / .22) 0%, #000 22%);
  mask-composite: intersect
}

.pay-rings {
  --arm-surface: var(--card-surface);
  position: absolute;
  left: var(--ax, 78%);
  top: var(--ay, 50%);
  width: 410px;
  height: 410px;
  translate: -50% -50%
}

.pay-card:has(.month-grid .payday) .pay-rings .arm-spark-group {
  display: none
}

.pay-card:has(.month-grid .payday) .pay-rings .arm-reticle {
  opacity: .9
}

.pay-rings .arm-glow {
  opacity: 1
}

.pay-copy {
  grid-area: copy;
  align-self: center;
  min-width: 0
}

.pay-label,
.eyeline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .8rem;
  font-weight: 560;
  color: var(--secondary)
}

.pay-label {
  color: var(--card-sub)
}

.pay-when {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--card-pill-ink);
  background: var(--card-pill-bg);
  box-shadow: inset 0 0 0 1px var(--card-pill-line);
  font-size: .74rem;
  font-weight: 620
}

.pay-copy h2 {
  font-size: clamp(2.3rem, 3.6vw, 3.4rem);
  font-weight: 560;
  font-stretch: 112%;
  letter-spacing: -.045em;
  line-height: 1;
  text-wrap: balance;
  margin: 14px 0 18px
}

.pay-copy .pay-date {
  white-space: nowrap
}

.pay-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin: 0 0 22px
}

.pay-facts dt {
  font-size: .74rem;
  color: var(--card-sub)
}

.pay-facts dd {
  margin-top: 3px;
  font-size: .95rem;
  font-weight: 580;
  letter-spacing: -.01em;
  white-space: nowrap
}

.pay-copy .btn {
  min-height: 38px;
  padding-inline: 16px
}

.pay-copy p {
  color: var(--card-sub);
  font-size: .86rem;
  line-height: 1.55;
  max-width: 44ch;
  margin-bottom: 20px
}

.mini-line,
.long-date,
.short-date,
.separator {
  display: inline
}

/* Payday calendar */
.calendar-mini {
  grid-area: cal;
  align-self: center;
  width: 268px;
  padding: 14px 14px 12px;
  border-radius: var(--r-lg);
  background: var(--card-glass);
  box-shadow: inset 0 0 0 1px var(--card-glass-line), 0 10px 30px -18px oklch(.4 .06 70 / .35);
  backdrop-filter: blur(2.5px) saturate(1.1);
  -webkit-backdrop-filter: blur(2.5px) saturate(1.1)
}

:root[data-theme="dark"] .calendar-mini {
  box-shadow: inset 0 0 0 1px var(--card-glass-line)
}

.calendar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 2px 10px
}

.calendar-head b {
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: -.01em
}

.calendar-head small {
  font-size: .72rem;
  color: var(--card-sub)
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
  text-align: center;
  font-size: .76rem
}

.month-grid>* {
  position: relative;
  height: 30px;
  display: grid;
  place-items: center;
  isolation: isolate
}

.month-grid .weekday {
  height: 22px;
  color: var(--card-faint);
  font-size: .68rem;
  font-weight: 560
}

.month-grid .day {
  font-weight: 520;
  color: var(--card-day)
}

.month-grid .outside {
  color: var(--card-outside)
}

.month-grid .in-period::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 3px 0;
  background: var(--card-period)
}

.month-grid .first::before {
  left: 3px;
  border-radius: 999px 0 0 999px
}

.month-grid .last::before {
  right: 3px;
  border-radius: 0 999px 999px 0
}

.month-grid .first.last::before {
  border-radius: 999px
}

.month-grid .today::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--card-today)
}

.month-grid .payday {
  color: var(--on-gold);
  font-weight: 700
}

.month-grid .payday::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: linear-gradient(160deg, oklch(.87 .1 86), var(--gold-deep));
  box-shadow: 0 0 0 3px oklch(.81 .115 82 / .2), 0 4px 14px -2px oklch(.72 .13 74 / .5)
}

.month-grid .payday.today::after {
  box-shadow: 0 0 0 2px var(--card-surface), 0 0 0 3.5px var(--card-today), 0 4px 14px -2px oklch(.72 .13 74 / .5)
}

.spark {
  position: absolute;
  top: -1px;
  right: 3px;
  width: 11px;
  height: 11px;
  color: var(--card-spark);
  filter: drop-shadow(0 0 2px oklch(.85 .12 85 / .9))
}

.calendar-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 12px 2px 0;
  padding: 0;
  list-style: none;
  font-size: .7rem;
  color: var(--card-sub)
}

.calendar-key li {
  display: inline-flex;
  align-items: center;
  gap: 6px
}

.calendar-key i {
  width: 14px;
  height: 8px;
  border-radius: 999px;
  background: var(--card-period)
}

.calendar-key .key-pay {
  width: 8px;
  background: var(--gold-deep)
}

.calendar-key .key-today {
  width: 8px;
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--card-today)
}

/* Pay run stages */
.run-stages {
  grid-area: stages;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 6px
}

.run-stages li {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: var(--card-faint);
  font-size: .76rem;
  font-weight: 520
}

.run-stages li i {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: var(--card-track)
}

.run-stages li.done i {
  background: var(--card-done)
}

.run-stages li.done {
  color: var(--card-done-ink)
}

.run-stages li.current {
  color: var(--card-current);
  font-weight: 640
}

.run-stages li.current i {
  background: linear-gradient(90deg, var(--gold-deep), oklch(.81 .115 82 / .35));
  box-shadow: 0 0 12px oklch(.81 .115 82 / .55)
}

.run-stages li span {
  display: flex;
  align-items: center;
  gap: 6px
}

.run-stages li span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  opacity: .7
}

.run-stages li.done span::before {
  background: currentColor;
  opacity: 1
}

.run-stages li.current span::before {
  background: currentColor;
  opacity: 1;
  box-shadow: 0 0 0 3px oklch(.81 .115 82 / .25)
}

/* Waiting on you */
.attention {
  display: flex;
  flex-direction: column;
  padding-bottom: 6px
}

.attention .panel-head {
  padding-bottom: 8px
}

.attention-row,
.mini-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  font-size: .87rem
}

.attention-row {
  margin: 0 12px;
  padding: 10px;
  border-top: 0;
  border-radius: var(--r-md);
  transition: background-color .15s
}

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

.attention-row>span:nth-child(2) {
  flex: 1;
  min-width: 0
}

.attention-row b,
.attention-row small {
  display: block
}

.attention-row b {
  font-size: .87rem;
  font-weight: 590
}

.attention-row small {
  font-size: .76rem;
  color: var(--sub);
  margin-top: 1px
}

.attention-row>.icon,
.report-card>div>.icon {
  width: 16px;
  height: 16px;
  color: var(--sub)
}

.attention-row .count {
  background: var(--gold-soft);
  color: var(--gold-ink)
}

.attention-row:hover>.icon:last-child {
  color: var(--ink)
}

.attention .empty {
  flex: 1;
  display: grid;
  place-content: center;
  gap: 6px;
  justify-items: center
}

.attention .empty .icon {
  width: 26px;
  height: 26px;
  color: var(--gold-ink)
}

.panel-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: auto 22px 0;
  padding: 14px 0 10px;
  border-top: 1px solid var(--line-soft);
  font-size: .83rem;
  font-weight: 560;
  color: var(--secondary);
  transition: color .15s
}

.panel-foot .icon {
  width: 15px;
  height: 15px
}

.panel-foot:hover {
  color: var(--ink)
}

.mini-row:hover span,
.report-card:hover h2 {
  color: var(--accent)
}

.tile-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: var(--r-md);
  background: var(--panel-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line)
}

.tile-icon .icon {
  width: 18px;
  height: 18px
}

/* Summary strip: an open ledger line rather than another box */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: stretch;
  margin: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line)
}

.metric-strip>div {
  min-width: 0;
  padding: 16px 24px 17px;
  display: flex;
  flex-direction: column
}

.metric-strip>div:first-child {
  padding-left: 2px
}

.metric-strip>div+div {
  border-left: 1px solid var(--line)
}

.metric-strip small {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: auto;
  font-size: .8rem;
  color: var(--secondary)
}

.metric-strip small .icon {
  display: none
}

.metric-strip strong {
  display: block;
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  font-weight: 580;
  font-stretch: 108%;
  letter-spacing: -.035em;
  line-height: 1.15;
  margin-top: 6px;
  overflow-wrap: anywhere
}

.metric-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 6px;
  font-size: .78rem;
  color: var(--sub)
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  color: var(--secondary)
}

.delta .icon {
  width: 13px;
  height: 13px
}

.delta.down .icon {
  transform: rotate(90deg)
}

.metric-figure {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px
}

.trend {
  width: 108px;
  height: 30px;
  flex: 0 0 auto;
  overflow: visible;
  margin-bottom: 4px
}

.trend polyline {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke
}

.trend circle {
  fill: var(--gold-deep);
  stroke: var(--bg);
  stroke-width: 2;
  vector-effect: non-scaling-stroke
}

/* Payroll cost chart */
.history-panel,
.data-panel,
.detail-panel,
.statement,
.more,
.chart-panel {
  margin-bottom: 16px
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  list-style: none;
  margin: -4px 22px 6px;
  padding: 0;
  font-size: .78rem;
  color: var(--secondary)
}

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

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px
}

.s-net {
  background: var(--c-net)
}

.s-withheld {
  background: var(--c-withheld)
}

.s-employer {
  background: var(--c-employer)
}

.chart {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  padding: 18px 22px 8px 12px
}

.chart-axis {
  position: relative;
  height: 200px;
  font-size: .7rem;
  color: var(--sub)
}

.chart-axis span {
  position: absolute;
  right: 10px;
  bottom: var(--at);
  transform: translateY(50%);
  line-height: 1;
  white-space: nowrap
}

.chart-cols {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  list-style: none;
  margin: 0;
  padding: 0;
  height: 200px;
  border-bottom: 1px solid var(--line-strong);
  background:
    repeating-linear-gradient(to top, var(--line-soft) 0 1px, transparent 1px calc(100% / var(--steps, 4)))
}

.chart-cols li {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 100%;
  min-width: 0
}

.chart-col {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(28px, 46%);
  height: var(--h);
  border-radius: 4px 4px 0 0;
  outline-offset: 4px;
  transform-origin: 50% 100%;
  transition: filter .15s
}

.chart-col::before {
  content: "";
  position: absolute;
  inset: calc(-1 * (200px - 100%)) -60% -1px;
  height: auto;
  border-radius: var(--r-sm) var(--r-sm) 0 0;
  background: var(--hover);
  opacity: 0;
  z-index: -1;
  transition: opacity .15s
}

.chart-cols li:hover .chart-col::before,
.chart-col:focus-visible::before {
  opacity: 1
}

.chart-col .seg {
  flex: 1 1 0;
  min-height: 1px
}

.chart-col .seg:first-child {
  border-radius: 4px 4px 0 0
}

.chart-col .net {
  background: var(--c-net)
}

.chart-col .withheld {
  background: var(--c-withheld)
}

.chart-col .employer {
  background: var(--c-employer)
}

.chart-cols li:hover .chart-col,
.chart-col:focus-visible {
  filter: brightness(1.06) saturate(1.05)
}

.chart-cols small {
  position: absolute;
  top: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: .72rem;
  color: var(--sub)
}

.chart-cols li:last-child small {
  color: var(--ink);
  font-weight: 600
}

.chart-total {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: .74rem;
  font-weight: 620;
  color: var(--ink)
}

.chart-foot {
  display: flex;
  justify-content: flex-end;
  padding: 28px 22px 16px
}

.chart-table {
  font-size: .8rem
}

.chart-table summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--secondary);
  font-weight: 560
}

.chart-table summary .icon {
  width: 15px;
  height: 15px;
  transition: transform .2s var(--ease-out)
}

.chart-table[open] summary .icon {
  transform: rotate(180deg)
}

.chart-table[open] {
  flex-basis: 100%
}

.chart-table .table-scroll {
  margin-top: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md)
}

.chart-tip {
  position: fixed;
  z-index: 30;
  min-width: 220px;
  padding: 10px 12px 11px;
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-size: .78rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .12s, transform .16s var(--ease-out)
}

.chart-tip.show {
  opacity: 1;
  transform: none
}

.chart-tip header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--sub);
  margin-bottom: 4px
}

.chart-tip header strong {
  color: var(--ink)
}

.chart-tip .tip-total {
  display: block;
  font-size: 1.1rem;
  font-weight: 620;
  letter-spacing: -.02em;
  margin-bottom: 8px
}

.chart-tip dl {
  display: grid;
  gap: 4px
}

.chart-tip dl div {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px
}

.chart-tip dl i {
  width: 12px;
  height: 3px;
  border-radius: 2px
}

.chart-tip dt {
  color: var(--secondary)
}

.chart-tip dd {
  font-weight: 600;
  text-align: right
}

/* Earlier single-series history, kept for templates that still use it */
.history-chart {
  display: flex;
  align-items: flex-end;
  gap: clamp(10px, 3vw, 48px);
  height: 140px;
  padding: 0 26px 14px
}

.history-chart a {
  display: grid;
  grid-template-rows: 16px minmax(0, 1fr) 18px;
  align-items: end;
  text-align: center;
  flex: 1;
  min-width: 0;
  height: 100%
}

.history-chart a i {
  display: block;
  justify-self: center;
  width: min(28px, 60%);
  height: var(--bar);
  min-height: 1px;
  background: var(--chart);
  border-radius: 4px 4px 0 0
}

.history-chart a:last-child i {
  background: var(--chart-last)
}

.history-chart a span,
.history-chart a small {
  font-size: .7rem;
  color: var(--secondary)
}

/* ---------- Tables ---------- */

.table-scroll {
  position: relative;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent
}

.data-panel {
  overflow: hidden
}

.data-panel>.table-scroll:first-child thead th {
  border-top: 0
}

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: .86rem;
  white-space: nowrap
}

th {
  font-weight: 550;
  color: var(--sub);
  font-size: .76rem;
  background: var(--panel-2);
  letter-spacing: 0
}

td,
th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft)
}

thead th {
  border-top: 1px solid var(--line-soft);
  border-bottom-color: var(--line)
}

th:first-child,
td:first-child {
  padding-left: 22px
}

th:last-child,
td:last-child {
  padding-right: 22px
}

tbody tr:last-child td {
  border-bottom: 0
}

tbody tr {
  transition: background-color .12s
}

tbody tr:hover {
  background: color-mix(in oklch, var(--panel-2) 70%, var(--hover))
}

td.num,
th.num {
  text-align: right
}

.record-link {
  color: var(--ink);
  font-weight: 600
}

.sub {
  display: block;
  color: var(--sub);
  font-size: .76rem;
  margin-top: 2px
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  font-size: .74rem;
  padding: 0 9px 0 8px;
  border-radius: 999px;
  line-height: 1;
  font-weight: 560;
  white-space: nowrap;
  background: var(--hover);
  color: var(--secondary);
  box-shadow: inset 0 0 0 1px var(--line-soft)
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sub)
}

.badge.green::before {
  background: var(--green)
}

.badge.blue::before {
  background: var(--blue)
}

.badge.amber {
  background: var(--gold-soft);
  color: var(--gold-ink);
  box-shadow: inset 0 0 0 1px var(--gold-line)
}

.badge.amber::before {
  background: var(--gold-deep)
}

.badge.red {
  background: var(--red-bg);
  color: var(--red);
  box-shadow: none
}

.badge.red::before {
  background: currentColor
}

.table-footer {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-top: 1px solid var(--line-soft);
  font-size: .78rem;
  color: var(--sub)
}

.table-footer nav {
  display: flex;
  align-items: center;
  gap: 6px
}

.table-footer nav a {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--ink);
  font-weight: 560
}

.table-footer nav a:hover {
  background: var(--hover)
}

/* ---------- Filters and forms ---------- */

.filterbar,
.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap
}

.filterbar {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-soft)
}

.filterbar>label,
.inline-form label,
.field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  font-size: .82rem;
  font-weight: 560;
  color: var(--ink)
}

input:not([type=checkbox]):not([type=hidden]):not([type=radio]),
textarea,
select {
  max-width: 100%
}

.field input:not([type=checkbox]):not([type=radio]),
.field select,
.field textarea,
.inline-form input:not([type=checkbox]):not([type=radio]),
.inline-form select,
.filterbar input:not([type=checkbox]),
.filterbar select,
.auth-form input {
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--panel);
  padding: 7px 11px;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 450;
  box-shadow: inset 0 1px 1px oklch(.3 .02 70 / .03);
  transition: border-color .15s, box-shadow .15s
}

:is(.field, .inline-form, .filterbar, .auth-form) :is(input, select, textarea):hover {
  border-color: color-mix(in oklch, var(--line-strong) 60%, var(--sub))
}

:is(.field, .inline-form, .filterbar, .auth-form) :is(input, select, textarea):focus-visible {
  outline: 0;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 24%, transparent)
}

.field select,
.inline-form select,
.filterbar select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b857c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5'/%3E%3Cpath d='m7 9 5-5 5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 15px
}

.field select[multiple] {
  background-image: none;
  padding-right: 11px
}

::placeholder {
  color: var(--sub);
  opacity: .85
}

input[type=checkbox],
input[type=radio] {
  accent-color: var(--gold-deep)
}

.field textarea {
  height: 104px;
  resize: vertical;
  line-height: 1.5
}

.field input[type=file] {
  height: auto;
  padding: 8px
}

.field input[type=file]::file-selector-button {
  font: 560 .8rem Mona, sans-serif;
  margin-right: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  background: var(--panel-2);
  color: var(--ink);
  padding: 5px 10px;
  cursor: pointer
}

.field input[type=checkbox] {
  align-self: flex-start;
  width: 18px;
  height: 18px
}

.field:has(input[type=checkbox]) {
  align-self: center
}

.field small {
  font-weight: 430;
  color: var(--sub);
  font-size: .76rem;
  line-height: 1.45
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--red)
}

.field .errorlist,
.errorlist,
.form-error {
  color: var(--red);
  font-size: .8rem
}

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

.form-error {
  grid-column: 1/-1;
  background: var(--red-bg);
  border-radius: var(--r-sm);
  padding: 10px 12px
}

.filterbar .search-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
  flex: 1 1 260px;
  max-width: 420px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding-left: 10px;
  background: var(--panel);
  transition: border-color .15s, box-shadow .15s
}

.filterbar .search-field:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 24%, transparent)
}

.search-field .icon {
  width: 16px;
  height: 16px;
  color: var(--sub)
}

.filterbar .search-field input {
  flex: 1;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent
}

.filterbar .btn {
  min-height: 38px
}

.column-picker summary {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 11px;
  font-size: .84rem;
  background: var(--panel)
}

.column-picker .icon {
  width: 15px;
  height: 15px
}

.column-picker>div {
  min-width: 200px
}

.column-picker label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: var(--r-xs);
  font-size: .82rem;
  font-weight: 450
}

.column-picker label:hover {
  background: var(--hover)
}

.form-pane {
  padding: 26px;
  max-width: 860px
}

.form-grid,
.facts,
.profile-grid,
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 22px
}

.form-grid>.field:has(textarea),
.form-grid>.field:has(input[type=file]),
.form-grid>.field:only-child {
  grid-column: 1/-1
}

.form-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line-soft);
  padding-top: 18px;
  margin-top: 22px
}

.form-pane h2 {
  margin-bottom: 16px
}

.form-pane>.btn {
  margin-top: 14px
}

/* Messages */
.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 18px
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--green-bg);
  color: color-mix(in oklch, var(--green) 80%, var(--ink));
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: .86rem;
  line-height: 1.5;
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--green) 18%, transparent);
  animation: message-in .35s var(--ease-out)
}

.message::before {
  content: "";
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m16 9-5.5 5.5L8 12'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m16 9-5.5 5.5L8 12'/%3E%3C/svg%3E") center/contain no-repeat
}

.message.error {
  background: var(--red-bg);
  color: var(--red);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--red) 18%, transparent)
}

.message.error::before,
.message.warning::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E")
}

.message.warning {
  background: var(--gold-soft);
  color: var(--gold-ink);
  box-shadow: inset 0 0 0 1px var(--gold-line)
}

.message.info {
  background: var(--blue-bg);
  color: var(--blue)
}

.message a {
  text-decoration: underline;
  text-underline-offset: .2em
}

.message+.message {
  margin-top: 6px
}

.messages .message+.message {
  margin-top: 0
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(-6px)
  }
}

/* ---------- Records ---------- */

.eyeline {
  color: var(--secondary);
  margin-bottom: 8px
}

.detail-panel,
.statement,
.issues {
  padding: 20px 22px
}

.detail-panel>h2,
.detail-panel>.muted,
.detail-panel>p,
.statement h3,
.issues {
  margin-bottom: 14px
}

.detail-panel>summary,
.more>summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600
}

.detail-panel>summary::after,
.more>summary::after {
  content: "";
  width: 16px;
  height: 16px;
  margin-left: auto;
  background: var(--sub);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .2s var(--ease-out)
}

.detail-panel[open]>summary::after,
.more[open]>summary::after {
  transform: rotate(180deg)
}

.detail-panel[open]>summary,
.more[open]>summary {
  margin-bottom: 12px
}

.issues {
  background: var(--gold-soft);
  color: var(--ink);
  border-color: var(--gold-line);
  box-shadow: none
}

.issues summary,
.more summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600
}

.issues summary {
  color: var(--gold-ink)
}

.issues summary .icon {
  width: 18px;
  height: 18px
}

.issues summary .count {
  background: oklch(.80 .115 82 / .25);
  color: var(--gold-ink)
}

.issues ul,
.more p {
  margin-top: 12px;
  font-size: .86rem
}

.issues ul {
  display: grid;
  gap: 5px;
  padding-inline-start: 1.2em;
  color: var(--secondary)
}

.issues li::marker {
  color: var(--gold-deep)
}

.audit-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--sub);
  font-size: .82rem;
  margin: 0 0 16px
}

.audit-line .icon {
  width: 16px;
  height: 16px;
  color: var(--gold-ink)
}

.facts {
  margin: 16px 0 0;
  gap: 16px 24px
}

.facts dt,
.statement-head small {
  font-size: .77rem;
  color: var(--sub)
}

.facts dd {
  margin-top: 3px;
  font-size: .9rem;
  font-weight: 500;
  overflow-wrap: anywhere
}

.person-title,
.statement-head,
.report-card>div {
  display: flex;
  align-items: center;
  gap: 16px
}

.portrait {
  display: grid;
  place-items: center;
  color: var(--on-gold);
  background: linear-gradient(160deg, var(--gold), var(--gold-deep));
  box-shadow: inset 0 1px 0 oklch(1 0 0 / .35), var(--shadow);
  font-size: 1.25rem;
  font-weight: 620;
  font-stretch: 110%;
  letter-spacing: .01em;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  flex: 0 0 auto
}

.large-number {
  display: block;
  font-size: 2.6rem;
  font-weight: 560;
  font-stretch: 110%;
  letter-spacing: -.045em;
  line-height: 1.1;
  margin-top: 10px
}

.large-number small {
  font-size: .82rem;
  letter-spacing: 0;
  color: var(--sub);
  font-weight: 460;
  font-stretch: 100%
}

.divider {
  height: 1px;
  background: var(--line-soft);
  margin: 18px 0
}

.mini-row {
  justify-content: space-between
}

.mini-row small {
  color: var(--sub)
}

.mini-row b {
  font-weight: 600;
  white-space: nowrap
}

.report-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px
}

.report-card {
  display: block;
  padding: 20px;
  transition: border-color .15s, box-shadow .2s var(--ease-out), transform .2s var(--ease-out)
}

.report-card>div,
.statement-head {
  justify-content: space-between
}

.report-card h2 {
  margin: 14px 0 4px
}

.report-card p {
  font-size: .84rem
}

.report-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px)
}

.statement {
  max-width: 820px
}

.statement h3 {
  margin-top: 24px
}

.statement-head strong {
  display: block;
  font-size: 2rem;
  font-weight: 580;
  font-stretch: 108%;
  letter-spacing: -.04em
}

.statement-head h2 {
  font-size: 1.45rem;
  letter-spacing: -.03em
}

.statement-head>div:last-child {
  text-align: right
}

.amounts>div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .88rem
}

.amounts dd {
  white-space: nowrap
}

.amounts .subtotal {
  font-weight: 650
}

/* ---------- Command search ---------- */

.palette {
  width: min(620px, calc(100vw - 24px));
  max-height: min(520px, calc(100dvh - 120px));
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  overflow: hidden
}

.palette[open] {
  display: flex;
  flex-direction: column;
  animation: palette-in .22s var(--ease-out)
}

.palette::backdrop {
  background: oklch(.2 .01 70 / .32);
  backdrop-filter: blur(2px);
  animation: fade-in .2s ease-out
}

@keyframes palette-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.985)
  }
}

@keyframes fade-in {
  from {
    opacity: 0
  }
}

.palette form {
  display: contents
}

.palette-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line)
}

.palette-input .icon {
  width: 18px;
  height: 18px;
  color: var(--sub)
}

.palette-input input {
  flex: 1;
  height: 54px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1rem
}

.palette-close {
  display: inline-flex;
  align-items: center;
  border: 0;
  padding: 0;
  background: none;
  color: var(--secondary);
  font-size: .86rem;
  font-weight: 560
}

.palette-close span {
  display: none
}

.palette-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow: auto;
  overscroll-behavior: contain
}

.palette-list .group {
  padding: 10px 10px 4px;
  font-size: .74rem;
  font-weight: 560;
  color: var(--sub)
}

.palette-list [role=option] {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  font-size: .9rem;
  cursor: pointer
}

.palette-list [role=option] .icon {
  width: 18px;
  height: 18px;
  color: var(--sub)
}

.palette-list [role=option] small {
  margin-left: auto;
  color: var(--sub);
  font-size: .76rem
}

.palette-list [aria-selected=true] {
  background: var(--hover)
}

.palette-list [aria-selected=true] .icon {
  color: var(--gold-ink)
}

.palette footer {
  display: flex;
  gap: 16px;
  padding: 9px 14px;
  border-top: 1px solid var(--line-soft);
  font-size: .74rem;
  color: var(--sub);
  background: var(--panel-2)
}

.palette footer span {
  display: inline-flex;
  align-items: center;
  gap: 6px
}

/* ---------- Sign in ---------- */

.auth-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: var(--bg);
  padding: 22px clamp(18px, 4vw, 56px) 48px
}

.auth-shell::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(48% 58% at 86% 84%, oklch(.88 .08 82 / .36), transparent 74%),
    radial-gradient(1px 1px at 12% 22%, var(--sub) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 9%, var(--sub) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 41% 30%, var(--gold-deep) 50%, transparent 51%),
    radial-gradient(1px 1px at 57% 14%, var(--sub) 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 26%, var(--sub) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 86% 12%, var(--gold-deep) 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 34%, var(--sub) 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 40%, var(--sub) 50%, transparent 51%);
}

:root[data-theme="dark"] .auth-shell::before {
  background:
    radial-gradient(48% 58% at 86% 84%, oklch(.55 .09 78 / .3), transparent 74%),
    radial-gradient(1px 1px at 12% 22%, var(--secondary) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 9%, var(--secondary) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 41% 30%, var(--gold) 50%, transparent 51%),
    radial-gradient(1px 1px at 57% 14%, var(--secondary) 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 26%, var(--secondary) 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 86% 12%, var(--gold) 50%, transparent 51%),
    radial-gradient(1px 1px at 93% 34%, var(--secondary) 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 40%, var(--secondary) 50%, transparent 51%)
}

.auth-stage {
  position: relative;
  width: min(420px, 100%);
  margin: clamp(56px, 13vh, 150px) auto 0
}

.auth-rings {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: 0;
  width: clamp(560px, 64vmax, 940px);
  height: auto;
  aspect-ratio: 1;
  translate: 22% 24%;
  -webkit-mask-image: radial-gradient(88% 88% at 62% 62%, #000 58%, rgb(0 0 0 / .32) 100%);
  mask-image: radial-gradient(88% 88% at 62% 62%, #000 58%, rgb(0 0 0 / .32) 100%)
}

.auth-rings .arm-glow {
  opacity: .68
}

.auth-rings .arm-reticle {
  opacity: .45
}

.auth-shell>header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px
}

.auth-header-actions {
  display: flex;
  align-items: center;
  gap: 10px
}

.auth-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in oklch, var(--panel) 84%, transparent);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .18s, border-color .18s, background .18s
}

.auth-nav-link:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--panel)
}

.auth-nav-link .icon {
  width: 14px;
  height: 14px
}

@media (max-width: 640px) {
  .auth-nav-link span:last-child {
    display: none
  }
  .auth-nav-link {
    padding: 0 9px
  }
}

.auth-card {
  width: 100%;
  padding: clamp(24px, 3.4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: color-mix(in oklch, var(--panel) 92%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg)
}

.auth-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  border-radius: var(--r-md);
  background: var(--gold-soft);
  box-shadow: inset 0 0 0 1px var(--gold-line)
}

.auth-mark .icon {
  width: 22px;
  height: 22px;
  color: var(--gold-ink)
}

.auth-card h1 {
  font-size: 1.85rem;
  margin-bottom: 8px
}

.auth-form {
  display: grid;
  gap: 15px;
  margin-top: 22px
}

.auth-form .field {
  gap: 7px
}

.auth-form .btn {
  margin-top: 4px;
  min-height: 42px
}

.auth-link {
  display: block;
  text-align: center;
  font-size: .84rem;
  color: var(--sub);
  margin-top: 18px
}

.sample-form {
  position: relative;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 20px
}

.sample-form::before {
  content: "or";
  content: attr(data-or);
  position: absolute;
  top: -.7em;
  left: 50%;
  transform: translateX(-50%);
  padding: 0 10px;
  font-size: .78rem;
  color: var(--sub);
  background: var(--panel)
}

.sample-form .btn {
  width: 100%;
  min-height: 42px
}

/* ---------- Wide screens ---------- */

@media(min-width:1600px) {
  :root {
    --rail-w: 268px
  }

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

  .chart-axis,
  .chart-cols {
    height: 230px
  }

  .chart-col::before {
    inset: calc(-1 * (230px - 100%)) -60% -1px
  }
}

@media(max-width:1180px) {
  :root {
    --rail-w: 228px
  }

  .rail {
    padding-left: 10px;
    padding-right: 10px
  }

  .workspace-content {
    padding-left: 24px;
    padding-right: 24px
  }

  .dashboard-top {
    grid-template-columns: minmax(0, 1fr)
  }

  .pay-card {
    padding: 22px 22px 20px
  }

  .report-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .search-trigger {
    min-width: 200px
  }
}

/* ---------- Tablet: the navigation becomes a drawer ---------- */

@media(max-width:859px) {
  html,
  body {
    background: var(--bg)
  }

  .app-shell {
    display: block
  }

  .rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    max-width: 86vw;
    transform: translateX(-102%);
    visibility: hidden;
    z-index: 32;
    border-right: 1px solid var(--line);
    transition: transform .32s var(--ease-out), visibility 0s .32s, box-shadow .32s;
    view-transition-name: none
  }

  .nav-open {
    overflow: hidden
  }

  .nav-open .rail {
    transform: translateX(0);
    visibility: visible;
    box-shadow: var(--shadow-lg);
    transition: transform .32s var(--ease-out), visibility 0s, box-shadow .32s
  }

  .scrim {
    display: block;
    position: fixed;
    z-index: 31;
    inset: 0;
    background: oklch(.2 .01 70 / .4);
    border: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s .3s
  }

  .nav-open .scrim {
    opacity: 1;
    visibility: visible;
    transition: opacity .3s ease
  }

  .menu-toggle {
    display: inline-grid
  }

  .topbar {
    height: 56px;
    padding: 0 18px
  }

  .workspace-content {
    padding-top: 22px
  }

  .dashboard-top {
    grid-template-columns: minmax(0, 1fr)
  }

  .pay-card {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "copy cal" "stages stages"
  }

  .calendar-mini {
    width: 268px
  }
}

/* ---------- Phones ---------- */

@media(max-width:640px) {
  .topbar {
    gap: 6px;
    padding: 0 12px 0 14px
  }

  .menu-toggle,
  .crumb>span,
  .crumb>.icon,
  .search-trigger>span:not(.icon),
  .search-trigger kbd {
    display: none
  }

  .crumb strong {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .2s, transform .25s var(--ease-out)
  }

  .past-title .crumb strong {
    opacity: 1;
    transform: none
  }

  .month-grid .quiet {
    display: none
  }

  .crumb-mark {
    display: block
  }

  .crumb strong {
    font-size: .98rem;
    font-weight: 620;
    letter-spacing: -.01em
  }

  .search-trigger {
    min-width: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center
  }

  .search-trigger .icon,
  .icon-btn .icon {
    width: 19px;
    height: 19px
  }

  .icon-btn {
    width: 36px;
    height: 36px
  }

  .workspace-content {
    padding: 18px 14px calc(96px + env(safe-area-inset-bottom))
  }

  .tabbar {
    position: fixed;
    z-index: 20;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in oklch, var(--panel) 86%, transparent);
    backdrop-filter: saturate(1.4) blur(16px);
    -webkit-backdrop-filter: saturate(1.4) blur(16px);
    border-top: 1px solid var(--line);
    view-transition-name: tabbar
  }

  .tabbar a,
  .tabbar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: 50px;
    padding: 6px 2px 4px;
    border: 0;
    border-radius: var(--r-md);
    background: none;
    color: var(--sub);
    font-size: .66rem;
    font-weight: 560;
    transition: color .15s, background-color .15s
  }

  .tabbar span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
  }

  .tabbar .icon {
    width: 22px;
    height: 22px
  }

  .tabbar a[aria-current] {
    color: var(--ink)
  }

  .tabbar a[aria-current] .icon {
    color: var(--gold-ink)
  }

  .tabbar :is(a, button):active {
    background: var(--hover)
  }

  .page-head {
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 14px
  }

  .page-head>div:first-child {
    flex-basis: 100%
  }

  .page-head>.actions {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    width: calc(100% + 28px);
    margin: 0 -14px;
    padding: 2px 14px 6px;
    scrollbar-width: none
  }

  .page-head>.actions::-webkit-scrollbar {
    display: none
  }

  .page-head>.actions>* {
    flex: 0 0 auto
  }

  .overview-head {
    flex-wrap: nowrap;
    align-items: flex-end
  }

  .overview-head>div:first-child {
    flex-basis: auto
  }

  .overview-head .btn {
    width: 40px;
    min-height: 40px;
    padding: 0;
    font-size: 0;
    gap: 0
  }

  .overview-head .btn .icon {
    width: 18px;
    height: 18px
  }

  .page-head h1 {
    font-size: 1.85rem
  }

  .page-head p {
    font-size: .86rem
  }

  .dashboard-top {
    gap: 12px
  }

  .pay-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "cal" "stages";
    gap: 20px;
    padding: 20px 18px 18px;
    border-radius: 18px
  }

  .pay-copy h2 {
    font-size: 2.6rem;
    margin: 12px 0 16px
  }

  /* The calendar sits under the text here, so the card-locked stage fades in from above */
  .pay-rings-stage {
    -webkit-mask-image: linear-gradient(to bottom, transparent 32%, #000 52%, #000 84%, rgb(0 0 0 / .22) 100%);
    mask-image: linear-gradient(to bottom, transparent 32%, #000 52%, #000 84%, rgb(0 0 0 / .22) 100%)
  }

  .pay-rings {
    width: 380px;
    height: 380px
  }

  .pay-facts {
    gap: 10px 22px
  }

  .pay-copy .btn {
    width: 100%;
    min-height: 44px
  }

  .calendar-mini {
    width: auto
  }

  .month-grid>* {
    height: 34px
  }

  .run-stages li {
    font-size: .7rem
  }

  .attention-row {
    margin: 0 8px
  }

  .metric-strip {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    margin: 16px 0
  }

  .metric-strip>div {
    padding: 14px 12px 14px 0
  }

  .metric-strip>div+div {
    border-left: 0
  }

  .metric-strip>div:nth-child(2n) {
    border-left: 1px solid var(--line);
    padding-left: 14px
  }

  .metric-strip>div:nth-child(n+3) {
    border-top: 1px solid var(--line)
  }

  .metric-strip>div:last-child:nth-child(odd) {
    grid-column: 1/-1
  }

  .metric-strip small {
    font-size: .74rem
  }

  .metric-strip strong {
    font-size: 1.45rem
  }

  .chart {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 14px 14px 6px 4px
  }

  .chart-axis,
  .chart-cols {
    height: 170px
  }

  .chart-col::before {
    inset: calc(-1 * (170px - 100%)) -40% -1px
  }

  .chart-axis span {
    right: 6px
  }

  .chart-legend {
    margin: -6px 16px 4px;
    gap: 6px 14px
  }

  .chart-total {
    display: none
  }

  .chart-foot {
    padding: 26px 16px 14px
  }

  .history-panel,
  .detail-panel,
  .data-panel,
  .statement,
  .chart-panel {
    margin-bottom: 12px
  }

  .report-grid,
  .profile-grid {
    grid-template-columns: 1fr;
    gap: 10px
  }

  .profile-grid .detail-panel {
    margin-bottom: 4px
  }

  .profile-grid {
    margin-bottom: 12px
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px
  }

  .form-pane,
  .detail-panel,
  .statement,
  .issues {
    padding: 16px
  }

  .form-footer {
    position: sticky;
    bottom: calc(70px + env(safe-area-inset-bottom));
    margin: 20px -16px -16px;
    padding: 12px 16px;
    background: color-mix(in oklch, var(--panel) 92%, transparent);
    backdrop-filter: blur(10px);
    border-radius: 0 0 var(--r-lg) var(--r-lg)
  }

  .form-footer .btn {
    flex: 1
  }

  .report-card {
    padding: 16px
  }

  .report-card h2 {
    margin-top: 8px
  }

  .panel-head {
    padding: 16px
  }

  .filterbar {
    padding: 12px 16px
  }

  .filterbar input[type=search] {
    width: 100%
  }

  .filterbar .search-field {
    flex: 1 1 100%;
    max-width: none
  }

  .panel-head .text-link {
    font-size: .8rem
  }

  .facts {
    gap: 13px
  }

  .portrait {
    width: 48px;
    height: 48px;
    font-size: 1rem;
    border-radius: 14px
  }

  .person-title {
    gap: 12px
  }

  th:first-child,
  td:first-child {
    padding-left: 16px
  }

  th:last-child,
  td:last-child {
    padding-right: 16px
  }

  /* Plain registers become stacked rows on a phone */
  .stack-table table,
  .stack-table tbody,
  .stack-table tr,
  .stack-table td {
    display: block;
    white-space: normal
  }

  .stack-table thead {
    display: none
  }

  .stack-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-soft)
  }

  .stack-table tbody tr:last-child {
    border-bottom: 0
  }

  .stack-table td {
    padding: 0;
    border: 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: .84rem;
    grid-column: 1/-1
  }

  .stack-table td:first-child {
    grid-column: 1;
    display: block;
    padding: 0
  }

  .stack-table td:first-child+td:has(.badge),
  .stack-table td.lead-badge {
    grid-column: 2;
    grid-row: 1;
    align-self: start
  }

  .stack-table td[data-label]:not(:first-child)::before {
    content: attr(data-label);
    color: var(--sub);
    font-size: .78rem
  }

  .stack-table td:has(.badge)::before,
  .stack-table td:has(.row-actions)::before,
  .stack-table td:empty {
    display: none
  }

  .stack-table td:has(.badge) {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end
  }

  .stack-table td:has(.row-actions) {
    padding-top: 6px
  }

  .stack-table .row-actions {
    width: 100%
  }

  .stack-table .row-actions>* {
    flex: 1
  }

  .stack-table .row-actions .small-btn {
    width: 100%;
    min-height: 36px
  }

  .stack-table td.empty {
    display: block;
    text-align: center
  }

  .table-scroll:not(.stack-table) td:first-child,
  .table-scroll:not(.stack-table) th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--panel)
  }

  .table-scroll:not(.stack-table) th:first-child {
    background: var(--panel-2)
  }

  /* a row's own heading belongs to the sheet, not to the table's head; and a statement's head has no fill */
  .table-scroll:not(.stack-table) tbody th:first-child,
  .table-scroll:not(.stack-table) .statement th:first-child {
    background: var(--panel)
  }

  .table-scroll:not(.stack-table) td:first-child::after,
  .table-scroll:not(.stack-table) th:first-child::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: -8px;
    width: 8px;
    background: linear-gradient(to right, oklch(.3 .02 70 / .06), transparent);
    opacity: 0;
    transition: opacity .2s
  }

  .table-scroll.scrolled-x td:first-child::after,
  .table-scroll.scrolled-x th:first-child::after {
    opacity: 1
  }

  /* held to half of the table's window when a long name would leave the other columns a sliver
     to pass through (ui.js measures it) */
  .table-scroll.first-held :is(td, th):first-child:not([colspan]) {
    min-width: var(--first-col);
    max-width: var(--first-col);
    white-space: normal;
    overflow-wrap: anywhere
  }

  /* a cell that spans its row has no column beside it to shade: its shadow would only stick out
     past the table and let a table that fits be dragged 8px sideways */
  .table-scroll:not(.stack-table) :is(td, th)[colspan]:first-child::after {
    content: none
  }

  .table-footer {
    padding: 12px 16px
  }

  .auth-shell {
    padding-top: 16px
  }

  .auth-stage {
    margin-top: 28px
  }

  .auth-rings {
    width: 124vw;
    translate: 26% 24%
  }

  .statement-head strong {
    font-size: 1.6rem
  }

  .palette {
    margin: 0;
    width: 100vw;
    max-width: none;
    max-height: none;
    height: 100dvh;
    border: 0;
    border-radius: 0
  }

  .palette footer {
    display: none
  }

  .palette-close kbd {
    display: none
  }

  .palette-close span {
    display: inline;
    padding: 8px 2px 8px 8px
  }
}

@media(max-width:370px) {
  .pay-copy h2 {
    font-size: 2.2rem
  }

  .month-grid>* {
    height: 30px
  }

  .tabbar a,
  .tabbar button {
    font-size: .6rem
  }
}

/* ---------- Page changes ---------- */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto
  }

  ::view-transition-old(root) {
    animation: vt-out .16s ease-in both
  }

  ::view-transition-new(root) {
    animation: vt-in .26s var(--ease-out) both
  }

  .armillary .orbit {
    stroke-dasharray: 1;
    animation: draw-orbit 1.45s var(--ease-out) both
  }

  .armillary .orbit.d-0 {
    animation-delay: .04s
  }

  .armillary .orbit.d-1 {
    animation-delay: .22s
  }

  .armillary .orbit.d-2 {
    animation-delay: .42s
  }

  .armillary .orbit.d-3 {
    animation-delay: .58s
  }

  .armillary :is(.arm-ko, .arm-face, .arm-wall) {
    animation: arm-fade .95s .62s ease-out both
  }

  .armillary :is(.arm-grad, .arm-node, .arm-pin, .arm-rivet-ring, .arm-rivet-dot, .arm-reticle-ring, .arm-reticle-ticks) {
    animation: arm-fade .85s .92s ease-out both
  }

  .armillary .arm-core {
    transform-box: view-box;
    transform-origin: 300px 300px;
    animation: arm-spark 1.1s .45s var(--ease-out) both
  }

  .chart-col {
    animation: column-in .7s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 60ms + 120ms)
  }

  .run-stages li.current i {
    animation: stage-glow 2.8s ease-in-out infinite
  }
}

@keyframes vt-out {
  to {
    opacity: 0
  }
}

@keyframes vt-in {
  from {
    opacity: 0;
    transform: translateY(6px)
  }
}

@keyframes draw-orbit {
  from {
    stroke-dashoffset: 1
  }

  to {
    stroke-dashoffset: 0
  }
}

@keyframes arm-fade {
  from {
    opacity: 0
  }
}

@keyframes arm-spark {
  from {
    opacity: 0;
    scale: .3
  }
}

@keyframes column-in {
  from {
    transform: scaleY(0)
  }
}

@keyframes stage-glow {
  50% {
    box-shadow: 0 0 18px oklch(.81 .115 82 / .85)
  }
}

/* The theme switch reveals the new appearance from the button */
::view-transition-old(root),
::view-transition-new(root) {
  mix-blend-mode: normal
}

.theme-reveal::view-transition-old(root),
.theme-reveal::view-transition-new(root) {
  animation: none
}

.theme-reveal .rail,
.theme-reveal .topbar,
.theme-reveal .tabbar {
  view-transition-name: none
}

@media(prefers-reduced-motion:reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important
  }
}

@media print {

  html,
  body,
  .app-shell,
  .work-area,
  .workspace-content {
    display: block !important;
    background: #fff !important;
    color: #111 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important
  }

  body::before,
  .rail,
  .topbar,
  .scrim,
  .skip,
  .tabbar,
  .palette,
  .actions,
  .back,
  .btn,
  .messages,
  .filterbar,
  .table-footer nav,
  .more,
  .text-link,
  .row-actions,
  .small-btn,
  .chart-table summary {
    display: none !important
  }

  .workspace-content {
    padding: 0;
    max-width: none
  }

  .panel {
    background: #fff;
    border-color: #bbb;
    box-shadow: none
  }

  .table-scroll {
    width: auto;
    overflow: visible
  }

  .table-scroll table {
    white-space: normal;
    font-size: 9pt
  }

  .table-scroll td,
  .table-scroll th {
    padding: 5px
  }

  .page-head {
    margin-bottom: 12px
  }

  .statement,
  .data-panel,
  .facts {
    break-inside: auto
  }

  .facts>div,
  .amounts>div,
  tr {
    break-inside: avoid
  }

  .panel-head h2,
  h3 {
    break-after: avoid
  }

  a {
    color: #111
  }

  .muted,
  .sub,
  .page-head p,
  .facts dt,
  .statement-head small,
  .panel-head p {
    color: #444
  }

  .table-scroll th {
    background: #eee;
    color: #222
  }
}
