/* Design system for the Cook County appeal workbench. Tokens and rules are in DESIGN.md. */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/web/fonts/PublicSans-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/web/fonts/PublicSans-Medium.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/web/fonts/PublicSans-SemiBold.woff2") format("woff2");
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/web/fonts/PublicSans-Bold.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --canvas: #f3f4f6;
  --sheet: #ffffff;
  --ink: #1a1d23;
  --slate: #5f6876;
  --line: #e2e5ea;
  --plat: #2b4fb4;
  --plat-hover: #24439a;
  --plat-soft: #e9eefb;
  --open: #1e7b4b;
  --open-soft: #e6f3ec;
  --attention: #9a5b00;
  --attention-soft: #fbf1df;
  --stop: #b42318;
  --stop-soft: #fbe9e7;
  --hover: rgba(26, 29, 35, 0.04);
  --pressed: rgba(26, 29, 35, 0.08);
  --shadow: 0 1px 2px rgba(26, 29, 35, 0.06), 0 10px 30px rgba(26, 29, 35, 0.1);
  --radius-control: 6px;
  --radius-sheet: 12px;
  --nav-w: 240px;
  --rail-w: 300px;
  --topbar-h: 64px;
  --ease: 140ms ease-out;
  --font: "Public Sans", "Helvetica Neue", Arial, sans-serif;
}

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

html {
  height: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  transition: grid-template-columns var(--ease);
}

body[data-nav="collapsed"] {
  --nav-w: 64px;
}

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

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

a {
  color: var(--plat);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

svg {
  display: block;
  width: 16px;
  height: 16px;
  flex: none;
}

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

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

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 50;
  padding: 8px 12px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.skip:focus {
  top: 12px;
}

/* Buttons and controls */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--sheet);
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}

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

.button:active {
  background: var(--pressed);
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.button.primary {
  background: var(--plat);
  border-color: var(--plat);
  color: #fff;
}

.button.primary:hover {
  background: var(--plat-hover);
  border-color: var(--plat-hover);
}

.button.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--plat);
}

.button.quiet:hover {
  background: var(--plat-soft);
}

.button.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--slate);
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

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

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-button:has(input:focus-visible) {
  outline: 2px solid var(--plat);
  outline-offset: 2px;
}

.field {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--slate);
}

input[type="text"],
input:not([type]),
input[inputmode] {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--sheet);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: border-color var(--ease), box-shadow var(--ease);
}

input:hover {
  border-color: #c9ced6;
}

input:focus {
  outline: 0;
  border-color: var(--plat);
  box-shadow: 0 0 0 3px var(--plat-soft);
}

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

input::placeholder {
  color: #6b7380;
}

kbd.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--canvas);
  color: var(--slate);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
}

.field-error {
  min-height: 0;
  color: var(--stop);
  font-size: 13px;
}

.field-error:empty {
  display: none;
}

/* Navigation */

.nav {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: var(--canvas);
  overflow: hidden;
}

.nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 40px;
  padding: 0 4px;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
}

.wordmark:hover {
  text-decoration: none;
}

.wordmark .mark {
  width: 28px;
  height: 28px;
  color: var(--plat);
}

.wordmark-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-list {
  display: grid;
  gap: 2px;
  margin-top: 20px;
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-control);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  transition: background var(--ease);
}

.nav-list a:hover {
  background: var(--hover);
  text-decoration: none;
}

.nav-list a[aria-current="true"] {
  background: var(--sheet);
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav-list a svg {
  color: var(--slate);
}

.nav-list a[aria-current="true"] svg {
  color: var(--plat);
}

.nav-list .label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px #c9ced6;
  flex: none;
}

.dot[data-status="ok"] {
  background: var(--open);
  box-shadow: none;
}

.dot[data-status="partial"],
.dot[data-status="miss"] {
  background: var(--attention);
  box-shadow: none;
}

.dot[data-status="stop"],
.dot[data-status="error"] {
  background: var(--stop);
  box-shadow: none;
}

.dot[data-status="loading"] {
  background: var(--plat);
  box-shadow: none;
  animation: pulse 900ms ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}

.nav-foot {
  margin-top: auto;
}

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--sheet);
  text-align: left;
  cursor: pointer;
  transition: background var(--ease);
}

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

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--plat-soft);
  color: var(--plat);
  font-size: 12px;
  font-weight: 600;
  flex: none;
}

.identity-text {
  display: grid;
  min-width: 0;
  line-height: 1.3;
}

.identity-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity-meta {
  font-size: 12px;
  color: var(--slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-nav="collapsed"] .wordmark-text,
body[data-nav="collapsed"] .nav-list .label,
body[data-nav="collapsed"] .nav-list .dot,
body[data-nav="collapsed"] .identity-text {
  display: none;
}

body[data-nav="collapsed"] .nav {
  padding: 12px 8px;
}

body[data-nav="collapsed"] .nav-head {
  flex-direction: column;
  height: auto;
  gap: 12px;
}

body[data-nav="collapsed"] .nav-list a {
  justify-content: center;
  padding: 0;
}

body[data-nav="collapsed"] .identity {
  justify-content: center;
  padding: 8px 0;
}

/* App column */

.app {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--topbar-h);
  padding: 12px 24px;
  background: rgba(243, 244, 246, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 320px;
  max-width: 520px;
}

.search-field svg {
  position: absolute;
  left: 10px;
  color: var(--slate);
  pointer-events: none;
}

.search-field input {
  padding-left: 34px;
  padding-right: 36px;
}

.search-field kbd {
  position: absolute;
  right: 8px;
}

.search {
  position: relative;
}

.search .field-error {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 5;
  padding: 6px 10px;
  border-radius: var(--radius-control);
  background: var(--stop-soft);
  box-shadow: var(--shadow);
}

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

.progress {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  height: 32px;
  border-radius: 999px;
  background: var(--plat-soft);
  color: var(--plat);
  font-size: 12px;
  font-weight: 500;
}

.progress::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid var(--plat);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.progress:not(:empty) {
  display: inline-flex;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.surface {
  flex: 1;
  padding: 24px;
}

.foot {
  padding: 16px 24px 24px;
  color: var(--slate);
  font-size: 12px;
}

/* Landing */

body[data-view="case"] .landing,
body[data-view="landing"] .case {
  display: none;
}

.landing {
  max-width: 560px;
  margin: 48px auto 0;
  display: grid;
  gap: 32px;
}

.landing h1 {
  font-size: 28px;
  line-height: 34px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.landing .lead {
  margin-top: 8px;
  color: var(--slate);
  max-width: 48ch;
}

.landing-pin {
  display: grid;
  gap: 24px;
  padding: 24px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius-sheet);
}

.landing-pin .button {
  justify-self: start;
}

.landing h2 {
  font-size: 16px;
  font-weight: 600;
}

.landing .what {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.landing .what li {
  display: flex;
  gap: 12px;
  color: var(--ink);
}

.landing .what svg {
  margin-top: 3px;
  color: var(--plat);
}

/* The PIN plate */

.pin-plate {
  display: inline-grid;
  grid-auto-flow: column;
  justify-content: start;
  justify-self: start;
  gap: 14px;
  font-variant-numeric: tabular-nums;
}

.pin-plate .group {
  display: grid;
  gap: 2px;
  text-align: left;
}

.pin-plate .digits {
  font-size: 40px;
  line-height: 44px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pin-plate .group-name {
  font-size: 12px;
  line-height: 16px;
  color: var(--slate);
}

.pin-plate.small {
  gap: 6px;
}

.pin-plate.small .digits {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}

.pin-plate.small .group-name {
  display: none;
}

/* Case layout */

.case {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
  gap: 24px;
  align-items: start;
}

.rail {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  display: grid;
  gap: 16px;
  order: 2;
}

.card {
  padding: 16px;
  background: var(--sheet);
  border-radius: var(--radius-sheet);
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.card .meta {
  margin-top: 8px;
}

.check-list {
  display: grid;
  gap: 4px;
}

.check-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 0 6px;
  margin: 0 -6px;
  border-radius: var(--radius-control);
  color: var(--ink);
  font-size: 13px;
}

.check-list a:hover {
  background: var(--hover);
  text-decoration: none;
}

.check-list .label {
  flex: 1;
}

.check-list .note {
  color: var(--slate);
  font-size: 12px;
  text-align: right;
}

.next {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.next svg {
  margin-top: 2px;
  color: var(--plat);
}

.rail-window + .rail-window {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.rail-window .label {
  font-size: 13px;
  font-weight: 500;
}

.rail-window .days {
  font-size: 20px;
  line-height: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rail-window .days[data-tone="stop"] {
  color: var(--stop);
}

.rail-window .days[data-tone="attention"] {
  color: var(--attention);
}

.rail-window .days[data-tone="ok"] {
  color: var(--open);
}

.rail-window .days[data-tone="closed"],
.window .phase[data-tone="closed"] {
  color: var(--slate);
}

/* Window bars (used in the rail and in the filing windows section) */

progress.window-bar {
  display: block;
  width: 100%;
  height: 6px;
  margin: 8px 0 6px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
  -webkit-appearance: none;
  appearance: none;
}

progress.window-bar::-webkit-progress-bar {
  background: var(--line);
  border-radius: 999px;
}

progress.window-bar::-webkit-progress-value {
  background: var(--plat);
  border-radius: 999px;
}

progress.window-bar::-moz-progress-bar {
  background: var(--plat);
  border-radius: 999px;
}

progress.window-bar[data-phase="closed"]::-webkit-progress-value {
  background: #c9ced6;
}

progress.window-bar[data-phase="closed"]::-moz-progress-bar {
  background: #c9ced6;
}

.window-dates {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--slate);
}

/* The case sheet and its sections */

.sheet-stack {
  order: 1;
  min-width: 0;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius-sheet);
}

.sheet {
  padding: 24px;
}

.sheet + .sheet,
[data-section] + [data-section] .sheet {
  border-top: 1px solid var(--line);
}

body[data-stopped="true"] [data-section]:not([data-section="parcel"]) {
  display: none;
}

body[data-stopped="true"] .dock-wrap {
  display: none !important;
}

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.sheet-head h2 {
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  margin-right: auto;
}

.sheet-head .source {
  margin-left: auto;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate);
  background: var(--canvas);
}

.state[data-tone="ok"] {
  color: var(--open);
  background: var(--open-soft);
}

.state[data-tone="attention"] {
  color: var(--attention);
  background: var(--attention-soft);
}

.state[data-tone="stop"] {
  color: var(--stop);
  background: var(--stop-soft);
}

.state[data-tone="plat"] {
  color: var(--plat);
  background: var(--plat-soft);
}

.waiting {
  color: var(--slate);
}

.lead {
  max-width: 68ch;
}

.meta,
.quiet {
  color: var(--slate);
  font-size: 12px;
  line-height: 16px;
}

.meta + .meta {
  margin-top: 4px;
}

.prose {
  max-width: 68ch;
}

.prose + .prose {
  margin-top: 8px;
}

.panel {
  display: grid;
  gap: 8px;
  padding: 12px 16px;
  border-left: 3px solid var(--slate);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  background: var(--canvas);
  max-width: 68ch;
}

.panel[data-tone="attention"] {
  border-color: var(--attention);
  background: var(--attention-soft);
}

.panel[data-tone="stop"] {
  border-color: var(--stop);
  background: var(--stop-soft);
}

.panel[data-tone="ok"] {
  border-color: var(--open);
  background: var(--open-soft);
}

.panel .button {
  justify-self: start;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

/* Section loading skeleton: the wrapper carries data-loading while the pull is in flight. */

[data-loading] .sheet > :not(.sheet-head) {
  display: none;
}

[data-loading] .sheet::after {
  content: "";
  display: block;
  height: 56px;
  border-radius: var(--radius-control);
  background: linear-gradient(90deg, var(--canvas) 0%, #e9ebef 50%, var(--canvas) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/* Source control: one per row or card, closed by default */

details.source {
  font-size: 12px;
  color: var(--slate);
}

details.source summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  list-style: none;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
}

details.source summary::-webkit-details-marker {
  display: none;
}

details.source summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  margin-right: 2px;
  transition: transform var(--ease);
}

details.source[open] summary::before {
  transform: rotate(45deg);
}

details.source summary:hover {
  color: var(--ink);
  background: var(--hover);
}

details.source .source-body {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--canvas);
  overflow-wrap: anywhere;
  max-width: 68ch;
}

/* Parcel header */

.case-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 40px;
}

.parcel-facts {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.parcel-facts .address {
  font-size: 20px;
  line-height: 26px;
  font-weight: 600;
}

.parcel-facts .facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  color: var(--slate);
}

.parcel-facts .facts .fact-class {
  color: var(--ink);
  font-weight: 500;
}

.case-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 16px;
}

.pick-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.pick-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.pick-list .pick-text {
  flex: 1;
  min-width: 200px;
  display: grid;
}

.pick-list .pick-text .meta {
  font-size: 13px;
}

/* Tables */

.table-scroll,
.scroll {
  position: relative;
  overflow-x: auto;
  margin: 0 -24px;
  padding: 0 24px;
}

.scroll[data-tall] {
  max-height: min(560px, 70vh);
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.table th,
.table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.table th:first-child,
.table td:first-child {
  padding-left: 0;
}

.table th:last-child,
.table td:last-child {
  padding-right: 0;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--sheet);
  color: var(--slate);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.table tbody tr:hover > td,
.table tbody tr:hover > th {
  background: var(--hover);
}

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

.table td.num {
  white-space: nowrap;
}

.table tbody th {
  font-weight: 500;
  white-space: nowrap;
}

.table tr.sub td {
  padding-top: 2px;
  padding-bottom: 8px;
  border-bottom: 0;
  color: var(--slate);
  font-size: 12px;
}

.table tr.sub + tr td,
.table tr.source-row td {
  border-bottom: 1px solid var(--line);
}

.table tr.source-row td {
  padding-top: 0;
  padding-bottom: 10px;
}

.table tr.source-row:hover > td,
.table tr.sub:hover > td {
  background: transparent;
}

.table tr.below td {
  color: var(--slate);
}

.table .cell-empty {
  color: var(--slate);
}

/* Values table: year, mailed, certified, Board, arithmetic */

.values-table td:nth-child(n + 2),
.values-table th:nth-child(n + 2) {
  text-align: right;
}

.values-table td:first-child {
  font-weight: 500;
}

.values-table tr.sub td:first-child {
  font-weight: 400;
}

/* Key-figure grid */

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

.figures > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.figures dt {
  font-size: 12px;
  line-height: 16px;
  color: var(--slate);
}

.figures dd {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.figures dd.big {
  font-size: 20px;
  line-height: 26px;
  font-weight: 600;
}

.figures-title {
  grid-column: 1 / -1;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--slate);
}

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--canvas);
  max-width: 68ch;
}

.check[data-tone="ok"] {
  background: var(--open-soft);
}

.check[data-tone="attention"] {
  background: var(--attention-soft);
}

.check svg {
  margin-top: 2px;
}

.check[data-tone="ok"] svg {
  color: var(--open);
}

.check[data-tone="attention"] svg {
  color: var(--attention);
}

/* Owner figures */

.owner-table input {
  min-height: 32px;
  max-width: 160px;
  text-align: right;
}

.owner-table input[name^="period-"] {
  text-align: left;
  max-width: 180px;
}

.owner-table td:nth-child(2),
.owner-table th:nth-child(2),
.owner-table td:nth-child(4),
.owner-table th:nth-child(4),
.owner-table td:nth-child(5),
.owner-table th:nth-child(5) {
  text-align: right;
}

.owner-table .diff[data-tone="up"] {
  color: var(--stop);
}

.owner-table .diff[data-tone="down"] {
  color: var(--open);
}

.owner-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  margin-top: 16px;
}

.owner-foot .field {
  flex: 1 1 200px;
  max-width: 280px;
}

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

.exhibit-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.exhibit-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-size: 13px;
}

.exhibit-list .kind {
  color: var(--slate);
  font-size: 12px;
}

.exhibit-list .name {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.exhibit-list .size {
  color: var(--slate);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.exhibit-list .hash {
  grid-column: 1 / -1;
  color: var(--slate);
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* Filing windows */

.windows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 4px;
}

.window {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.window h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
}

.window .phase {
  margin-top: 4px;
  font-size: 20px;
  line-height: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.window .phase[data-tone="stop"] {
  color: var(--stop);
}

.window .phase[data-tone="attention"] {
  color: var(--attention);
}

.window .window-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--slate);
}

.window .recheck {
  color: var(--attention);
  font-weight: 500;
}

/* Draft */

.sentences {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  max-width: 68ch;
}

.sentence {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: var(--radius-control);
}

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

.sentence [contenteditable] {
  font-size: 15px;
  line-height: 24px;
  border-radius: 4px;
}

.sentence [contenteditable]:focus {
  outline: 2px solid var(--plat);
  outline-offset: 4px;
}

.sentence .cites {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--slate);
}

.edited {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--plat);
}

.removed {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--canvas);
  color: var(--slate);
  max-width: 68ch;
}

.removed:empty {
  display: none;
}

.removed h3 {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}

.removed .reason {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--sheet);
  font-size: 12px;
  color: var(--attention);
}

/* Sources appendix */

.source-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.source-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow-wrap: anywhere;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  font-size: 13px;
}

.source-list .dataset {
  font-weight: 500;
}

.source-list .source-url {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--slate);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.source-list a.source-url {
  color: var(--plat);
}

.source-list .stamp {
  color: var(--slate);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* Toasts, dialog, phone dock */

.toasts {
  position: fixed;
  bottom: 24px;
  left: calc(var(--nav-w) + (100vw - var(--nav-w)) / 2);
  z-index: 40;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 10px 14px;
  border-radius: var(--radius-control);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: rise var(--ease);
}

.toast[data-kind="error"] {
  background: var(--stop);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 24px;
  border: 0;
  border-radius: var(--radius-sheet);
  box-shadow: var(--shadow);
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(26, 29, 35, 0.4);
}

dialog h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

dialog form {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 3px;
  border-radius: var(--radius-control);
  background: var(--canvas);
}

.segmented label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  cursor: pointer;
}

.segmented input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.segmented label:has(input:checked) {
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(26, 29, 35, 0.1);
}

.segmented label:has(input:focus-visible) {
  outline: 2px solid var(--plat);
  outline-offset: 1px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dock {
  display: none;
}

/* Components that the section markup uses */

.sheet > * + * {
  margin-top: 12px;
}

.sheet > .sheet-head + * {
  margin-top: 0;
}

.sheet-head .state:empty {
  display: none;
}

.sheet-head .button {
  margin-left: 4px;
}

.subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px !important;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
}

.subhead .count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--slate);
  font-size: 12px;
  font-weight: 500;
}

.footnote {
  max-width: 72ch;
}

.panel-text {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.panel-text svg {
  margin-top: 3px;
  color: var(--slate);
}

.panel[data-tone="attention"] .panel-text svg {
  color: var(--attention);
}

.panel[data-tone="stop"] .panel-text svg {
  color: var(--stop);
}

.panel[data-tone="ok"] .panel-text svg {
  color: var(--open);
}

.panel-actions {
  padding-left: 26px;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 72ch;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--canvas);
  color: var(--ink);
  font-size: 13px;
  line-height: 19px;
}

.notice svg {
  margin-top: 2px;
  color: var(--plat);
}

.hint {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--slate);
  font-size: 12px;
}

.hints span + kbd {
  margin-left: 10px;
}

.empty-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

/* Source control details */

.source-name {
  color: var(--ink);
  font-weight: 500;
}

.source-id {
  margin-left: 4px;
  color: var(--slate);
  font-weight: 400;
}

a.source-url {
  color: var(--plat);
}

.sheet-foot {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* Parcel */

.case-head {
  align-items: center;
  gap: 16px 32px;
}

.case-pin {
  padding: 12px 16px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sheet);
  background: linear-gradient(var(--sheet), var(--sheet)) padding-box;
  box-shadow: inset 0 -3px 0 var(--plat-soft);
}

.case-sources {
  align-items: center;
}

.pick-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 24px;
  transition: border-color var(--ease), background var(--ease);
}

.pick-list li:hover {
  border-color: #c9ced6;
  background: var(--hover);
}

.pick-list .pick-text {
  gap: 4px;
}

.pick-address {
  font-weight: 500;
}

.pick-sources {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

/* Worksheet */

.figure-groups {
  display: grid;
  gap: 20px;
}

.figure-group {
  display: grid;
  gap: 10px;
}

.figure-group .figures {
  margin-top: 0;
}

h3.figures-title {
  padding-top: 0;
  border-top: 0;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--ink);
}

.figure-group + .figure-group {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.check p {
  max-width: 64ch;
}

/* Owner's figures */

.owner-form {
  display: grid;
  gap: 8px;
}

.owner-table th[scope="row"] {
  width: 34%;
  font-weight: 500;
  white-space: normal;
}

.figure-label {
  display: block;
}

.owner-table label.period {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  color: var(--slate);
  font-size: 12px;
  font-weight: 400;
}

.owner-table label.period input {
  min-height: 28px;
  max-width: 160px;
  font-size: 12px;
  text-align: left;
}

.owner-table th[scope="row"] > .meta {
  display: block;
  margin-top: 4px;
  font-weight: 400;
}

.owner-table td.diff[data-empty="true"] {
  color: var(--slate);
  font-weight: 400;
}

.owner-table td {
  vertical-align: top;
}

.owner-table td.assessor,
.owner-table td.diff {
  padding-top: 14px;
}

.owner-table td.own {
  width: 170px;
}

.owner-table td.own input {
  margin-left: auto;
  display: block;
}

.owner-table td.period input {
  max-width: 200px;
}

.owner-table .echo {
  display: block;
  margin-top: 3px;
  color: var(--slate);
  font-size: 12px;
  line-height: 16px;
}

.owner-table td.period .echo {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.owner-table td.period .meta {
  display: block;
  padding-top: 8px;
}

.owner-table td.diff {
  font-weight: 500;
  white-space: nowrap;
}

.owner-table tbody tr:hover > td,
.owner-table tbody tr:hover > th {
  background: transparent;
}

.owner-foot .field input {
  min-height: 36px;
}

.file-button svg {
  color: var(--slate);
}

/* Sales */

.comps-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.comps-controls .field {
  width: 140px;
}

.basis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 24px;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--canvas);
}

.basis-cell {
  display: grid;
  gap: 2px;
  align-content: start;
}

.basis-cell.wide {
  grid-column: 1 / -1;
}

.basis dt {
  color: var(--slate);
  font-size: 12px;
  line-height: 16px;
}

.basis dd {
  font-variant-numeric: tabular-nums;
}

.basis dd.big {
  font-size: 20px;
  line-height: 26px;
  font-weight: 600;
}

.tick-bar {
  display: grid;
  gap: 2px;
  margin-top: 16px !important;
}

.tick-bar strong {
  font-weight: 600;
}

.tick-bar p span {
  color: var(--slate);
}

.comps-table caption {
  caption-side: bottom;
  padding: 8px 0;
  text-align: left;
}

.comps-table td,
.comps-table th {
  padding-left: 8px;
  padding-right: 8px;
}

.comps-table .tick {
  width: 32px;
}

.table th button.sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.table th button.sort:hover {
  background: var(--hover);
  color: var(--ink);
}

.table th button.sort::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.35;
}

.table th[aria-sort="ascending"] button.sort,
.table th[aria-sort="descending"] button.sort {
  color: var(--ink);
}

.table th[aria-sort="ascending"] button.sort::after {
  border-top: 0;
  border-bottom: 4px solid currentColor;
  opacity: 1;
}

.table th[aria-sort="descending"] button.sort::after {
  opacity: 1;
}

.comps-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--plat);
  cursor: pointer;
}

.comps-table tr.picked > td {
  background: var(--plat-soft);
}

.comps-table tr.picked:hover > td {
  background: #e1e8f9;
}

.comps-table .date {
  white-space: nowrap;
}

.comps-table .doc {
  white-space: nowrap;
}

.doc-line {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.icon-button.copy {
  width: 26px;
  height: 26px;
}

.comps-table .doc .meta {
  display: block;
}

.comps-table .strong {
  font-weight: 600;
}

.comps-table .gap .meta {
  display: block;
  text-align: right;
}

.comps-table .src details.source .source-body {
  position: absolute;
  right: 0;
  z-index: 3;
  width: 260px;
  box-shadow: var(--shadow);
  background: var(--sheet);
}

.comps-table .src {
  position: relative;
  text-align: right;
  white-space: nowrap;
}

.comps-table td.reason {
  min-width: 150px;
}

.comps-table .reason .state {
  height: auto;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: var(--radius-control);
  line-height: 16px;
  white-space: normal;
}

.comps-table .date .reason {
  display: block;
  width: max-content;
  max-width: 190px;
  height: auto;
  min-height: 22px;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-control);
  line-height: 16px;
  white-space: normal;
}

.comps-table .sale-source > .source-body {
  display: none !important;
}

.comps-table .sale-source > summary {
  padding: 4px;
  margin: -4px;
  color: var(--slate);
}

.comps-table .sale-source > summary::before {
  display: none;
}

.comps-table .sale-source[open] > summary {
  color: var(--plat);
}

.comps-table tr.source-expand > td {
  padding-top: 0;
  padding-bottom: 12px;
  background: var(--sheet);
  white-space: normal;
}

.comps-table tr.source-expand .source-body {
  display: grid;
  gap: 4px;
  max-width: none;
  margin: 0;
  font-size: 12px;
  color: var(--slate);
  overflow-wrap: anywhere;
}

.comps-table tr.source-expand .source-body p {
  margin: 0;
}

.comps-table tr.source-expand:hover > td {
  background: var(--sheet);
}

.comps-controls .field-error {
  flex-basis: 100%;
}

details.below-line {
  margin-top: 24px !important;
}

details.below-line > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  padding: 8px 0;
  cursor: pointer;
  list-style: none;
}

details.below-line > summary::-webkit-details-marker {
  display: none;
}

details.below-line > summary .subhead {
  margin-top: 0 !important;
}

details.below-line > summary .subhead::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--ease);
}

details.below-line[open] > summary .subhead::before {
  transform: rotate(45deg);
}

details.below-line > summary:hover .subhead {
  color: var(--plat);
}

.owner-table input[aria-invalid="true"] {
  border-color: var(--stop);
  box-shadow: 0 0 0 3px var(--stop-soft);
}

.owner-table .field-note {
  display: block;
  margin-top: 3px;
  color: var(--stop);
  font-size: 12px;
  line-height: 16px;
  text-align: right;
}

dialog .field-error {
  margin-top: -8px;
}

/* Filing windows */

.window[data-phase="closed"] {
  background: var(--canvas);
}

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

.window .tax-year {
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--slate);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.window .recheck {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Draft */

.sentences {
  list-style: none;
  counter-reset: sentence;
}

.sentence {
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 8px;
  counter-increment: sentence;
}

.sentence::before {
  content: counter(sentence);
  grid-row: 1 / span 2;
  padding-top: 3px;
  color: var(--slate);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.sentence [contenteditable] {
  grid-column: 2;
  cursor: text;
}

.sentence-meta {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sentence-meta:empty {
  display: none;
}

.cites {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cite {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--slate);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.removed ul {
  display: grid;
  gap: 6px;
}

.removed-text {
  text-decoration: line-through;
  text-decoration-color: rgba(95, 104, 118, 0.6);
}

/* Sources and exhibits */

.source-list .source-id {
  font-size: 12px;
}

/* Navigation additions */

.nav-group-label {
  margin: 20px 10px 6px;
  color: var(--slate);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.nav-list + .nav-group-label {
  margin-top: 16px;
}

.case-nav {
  margin-top: 0;
}

.nav-list a[aria-disabled="true"] {
  color: #9aa2ae;
}

.nav-list a[aria-disabled="true"] svg {
  color: #b5bbc4;
}

.nav-list a[aria-disabled="true"]:hover {
  background: transparent;
}

.nav-foot {
  display: grid;
  gap: 8px;
}

.role-switch {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
}

.role-switch label {
  gap: 6px;
}

.role-switch svg {
  color: currentColor;
}

body[data-nav="collapsed"] .nav-group-label,
body[data-nav="collapsed"] .role-switch .label {
  display: none;
}

body[data-nav="collapsed"] .role-switch {
  grid-auto-flow: row;
}

body[data-nav="collapsed"] .role-switch label {
  padding: 0;
}

/* Landing additions */

.landing {
  max-width: 600px;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.landing-pin .hints {
  margin-top: -8px;
}

.landing .what strong {
  font-weight: 600;
}

.landing .what span {
  color: var(--slate);
}

.landing .what strong {
  color: var(--ink);
}

/* Top bar actions */

body[data-view="landing"] .case-action {
  display: none;
}

.actions .file-button svg,
.actions .button svg {
  color: currentColor;
}

/* Rail cards */

.case-card {
  display: grid;
  gap: 6px;
}

.case-card .pin-plate {
  justify-self: start;
}

.case-card .pin-plate.small .digits {
  font-size: 15px;
  font-weight: 600;
}

.case-card-title {
  font-size: 15px;
  line-height: 21px;
  font-weight: 600;
}

.case-progress {
  display: grid;
  gap: 2px;
  margin-top: 6px;
}

.case-progress .window-bar {
  margin: 0;
}

.check-list {
  margin-top: 6px;
}

.check-list a svg {
  color: var(--slate);
}

.check-list a[data-tone="ok"] svg {
  color: var(--open);
}

.check-list a[data-tone="attention"] svg {
  color: var(--attention);
}

.check-list a[data-tone="stop"] svg {
  color: var(--stop);
}

.check-list a .dot {
  margin: 0 4px;
}

.check-list a[data-tone="todo"] .label {
  font-weight: 600;
}

.next {
  align-items: flex-start;
}

.next > div {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.windows-card h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.rail-window {
  display: grid;
  gap: 2px;
  padding: 6px;
  margin: 0 -6px;
  border-radius: var(--radius-control);
  color: var(--ink);
}

a.rail-window:hover {
  background: var(--hover);
  text-decoration: none;
}

.rail-window.missing .meta {
  font-size: 12px;
}

.rail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
}

/* The dock: jump links and print, floating at the bottom of the work surface */

.dock-wrap {
  display: none;
}

body[data-view="case"] .dock-wrap {
  position: fixed;
  bottom: 16px;
  left: calc(var(--nav-w) + (100vw - var(--nav-w)) / 2);
  z-index: 30;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}

body[data-view="case"] .dock-wrap > * {
  pointer-events: auto;
}

.dock-hints {
  padding: 6px 12px;
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

body[data-view="case"] .dock {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: var(--radius-sheet);
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.dock a,
.dock button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 68px;
  padding: 7px 8px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

.dock a:hover,
.dock button:hover {
  background: var(--hover);
  text-decoration: none;
}

.dock a[aria-current="true"] {
  background: var(--ink);
  color: #fff;
}

.dock-count {
  padding: 0 10px 0 8px;
  color: var(--slate);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dock-sep {
  width: 1px;
  height: 28px;
  margin: 0 4px;
  background: var(--line);
}

body[data-view="case"] .surface {
  padding-bottom: 140px;
}

body[data-view="case"] .toasts {
  bottom: 148px;
}

.toast[data-kind="info"] {
  background: var(--ink);
}

.topbar-brand,
.avatar-button {
  display: none;
}

.avatar-button {
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

/* Round three: mini-map, dock keys, stale line, row flash */

.stale-line {
  flex-basis: 100%;
  margin-top: -4px;
  color: var(--slate);
  font-size: 13px;
  line-height: 19px;
}

.dock-keys {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 10px 0 8px;
  border-right: 1px solid var(--line);
  color: var(--slate);
  font-size: 12px;
  white-space: nowrap;
}

.dock-keys span {
  margin-left: 3px;
}

.map-card {
  display: grid;
  gap: 8px;
}

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

.map-head h2 {
  margin-bottom: 0 !important;
}

.segmented.small {
  padding: 2px;
}

.segmented.small button {
  min-height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--slate);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.segmented.small button[aria-pressed="true"] {
  background: var(--sheet);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(26, 29, 35, 0.1);
}

.distance-map {
  width: 100%;
  height: auto;
}

.distance-map .axis,
.distance-map .tick {
  stroke: #c9ced6;
  stroke-width: 1.5;
}

.distance-map .tick-label {
  fill: var(--slate);
  font-size: 9px;
  text-anchor: middle;
}

.distance-map .subject {
  fill: var(--ink);
}

.distance-map circle {
  fill: var(--sheet);
  stroke: var(--plat);
  stroke-width: 2;
  transition: r var(--ease);
}

.distance-map circle[data-ticked="true"] {
  fill: var(--plat);
}

.distance-map circle[data-below="true"] {
  stroke: var(--attention);
}

.distance-map a:hover circle,
.distance-map a:focus-visible circle {
  r: 7;
}

.distance-map a:focus-visible {
  outline: none;
}

.comps-table tr.flash > td {
  background: #fff4cf !important;
  transition: background 600ms ease-out;
}

/* Responsive */

@media (min-width: 1200px) {
  .rail {
    max-height: calc(100vh - var(--topbar-h) - 48px);
    overflow-y: auto;
    margin: -8px -8px 0;
    padding: 8px 8px 24px;
    scrollbar-width: thin;
  }

  body[data-view="case"] .dock-wrap,
  body[data-view="case"] .toasts {
    left: calc(var(--nav-w) + 24px + (100vw - var(--nav-w) - 72px - var(--rail-w)) / 2);
  }
}

@media (max-width: 1199px) {
  .case {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    order: 0;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
}

@media (max-width: 900px) {
  body {
    grid-template-columns: minmax(0, 1fr);
  }

  .nav {
    display: none;
  }

  .topbar {
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    backdrop-filter: none;
    background: var(--canvas);
  }

  .topbar-brand {
    display: flex;
    grid-column: 1;
    grid-row: 1;
  }

  .actions {
    grid-column: 2;
    grid-row: 1;
    gap: 6px;
  }

  .search {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: nowrap;
  }

  .search-field {
    flex: 1 1 auto;
    max-width: none;
  }

  .search-field kbd,
  .hints {
    display: none;
  }

  .search-field input {
    padding-right: 10px;
  }

  .search .field-error {
    position: absolute;
  }

  .search {
    position: relative;
    flex-wrap: wrap;
  }

  .search .field-error {
    position: static;
    flex-basis: 100%;
  }

  .progress:not(:empty) {
    position: fixed;
    left: 50%;
    bottom: 84px;
    z-index: 35;
    transform: translateX(-50%);
    box-shadow: var(--shadow);
    white-space: nowrap;
  }

  .search .field-error {
    position: static;
    flex-basis: 100%;
    box-shadow: none;
  }

  .landing-pin {
    padding: 20px 16px;
  }

  .landing-pin .pin-plate .digits {
    font-size: 24px;
    line-height: 28px;
  }

  .landing-pin .pin-plate {
    gap: 8px;
  }

  .avatar-button {
    display: inline-flex;
  }

  .toasts,
  body[data-view="case"] .toasts {
    top: auto;
    bottom: 84px;
    left: 16px;
    right: 16px;
    width: auto;
    max-width: none;
    transform: none;
  }

  .toast {
    width: 100%;
  }


  .surface {
    padding: 16px 16px 96px;
  }

  .foot {
    padding: 16px 16px 96px;
  }

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

  .sheet {
    padding: 16px;
  }

  .table-scroll,
  .scroll {
    margin: 0 -16px;
    padding: 0 16px;
  }

  .table thead th {
    position: static;
  }

  body[data-view="case"] .dock-wrap {
    left: 50%;
    bottom: 12px;
    width: max-content;
    max-width: calc(100vw - 16px);
  }

  .dock-hints,
  .dock-keys,
  .dock-count,
  .dock-sep {
    display: none !important;
  }

  body[data-view="case"] .dock {
    border-radius: 999px;
  }

  .dock a,
  .dock button {
    min-width: 58px;
    padding: 7px 4px 6px;
    border-radius: 999px;
    font-size: 11px;
  }

  #print-case {
    display: none;
  }

  .actions {
    justify-content: flex-end;
  }

  .actions .button .label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .actions .button {
    flex: 0 0 auto;
    width: 36px;
    padding: 0;
  }

  .owner-table th[scope="row"] {
    width: auto;
    min-width: 140px;
  }

  .case-card .check-list,
  .case-card .case-progress {
    display: none;
  }

  .case-card .next {
    margin-top: 4px;
  }

  .landing {
    margin-top: 16px;
  }

  .pin-plate .digits {
    font-size: 28px;
    line-height: 32px;
  }

  .pin-plate {
    gap: 10px;
  }
}

@media (max-width: 640px) {
  .owner-form .table-scroll {
    overflow: visible;
  }

  .owner-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .owner-table,
  .owner-table tbody {
    display: block;
  }

  .owner-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  .owner-table th[scope="row"],
  .owner-table td {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0 !important;
    border: 0;
    text-align: left;
  }

  .owner-table th[scope="row"] {
    grid-column: 1 / -1;
  }

  .owner-table td.diff {
    grid-column: 1 / -1;
    white-space: normal;
  }

  .owner-table td.num,
  .owner-table td.own {
    width: auto;
    text-align: left;
  }

  .owner-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--slate);
    font-size: 12px;
    font-weight: 400;
  }

  .owner-table td.own input {
    margin-left: 0;
    text-align: left;
  }

  .owner-table .echo {
    text-align: left;
  }

  .owner-table label.period input {
    max-width: none;
    flex: 1;
  }
  .figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
  }

  .parcel-facts .address {
    font-size: 16px;
    line-height: 22px;
  }

}

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

/* Firm pages: sign in, create a firm, invites, the docket and members */

body[data-view="page"] .landing,
body[data-view="page"] .case,
body[data-view="page"] .case-action,
body:not([data-view="page"]) .page,
body[data-session="in"] [data-session="out"],
body[data-session="out"] [data-session="in"],
body:not([data-session]) [data-session] {
  display: none;
}

.page {
  max-width: 1120px;
  margin: 32px auto 0;
  display: grid;
  gap: 16px;
}

.page-head h1,
.auth-card h1 {
  font-size: 28px;
  line-height: 34px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

.auth-card h1 {
  font-size: 20px;
  line-height: 26px;
}

.auth {
  max-width: 400px;
  margin: 24px auto 0;
  display: grid;
  gap: 16px;
}

.auth-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-card .button.primary {
  min-height: 44px;
}

input[type="email"],
input[type="password"],
input[type="search"],
select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

input[readonly] {
  background: var(--canvas);
}

.field .hint {
  font-size: 12px;
  color: var(--slate);
}

.docket-search,
.invite-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.docket-search input {
  flex: 1 1 260px;
}

.invite-form .field {
  flex: 1 1 200px;
}

.invite-link {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}

.invite-link .field {
  flex: 1 1 320px;
}

.empty-docket {
  display: grid;
  gap: 16px;
  max-width: 640px;
  padding: 32px;
}

.empty-docket h2 {
  font-size: 20px;
  margin: 0;
}

.steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  line-height: 21px;
}

.case-link {
  font-weight: 600;
  white-space: nowrap;
}

.days[data-tone="ok"] {
  color: var(--open);
  font-weight: 600;
}

.days[data-tone="attention"] {
  color: var(--attention);
  font-weight: 600;
}

.pager {
  display: flex;
  gap: 8px;
}

.pending {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.save-card .button {
  margin-top: 8px;
}

.conflict-card {
  border: 1px solid var(--stop);
  background: var(--stop-soft);
}
