@import 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap';
:root {
  --bg: #f2f7fa;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --card-raised: #f9fafb;
  --ink: #101828;
  --muted: #5b6576;
  --line: #e5e7eb;
  --line-soft: #f2f4f7;
  --line-strong: #8a94a6;
  --btn-line: #d0d5dd;
  --accent: #155eef;
  --accent-ink: #ffffff;
  --accent-strong: #004eeb;
  --accent-wash: #eff4ff;
  --btn: #155eef;
  --btn-ink: #ffffff;
  --btn-hover: #004eeb;
  --ok: #067647;
  --ok-ink: #ffffff;
  --warn: #b54708;
  --warn-ink: #ffffff;
  --bad: #b42318;
  --bad-ink: #ffffff;
  --ok-wash: #ecfdf3;
  --warn-wash: #fffaeb;
  --bad-wash: #fef3f2;
  --focus: #155eef;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 8px;
  --radius-pill: 999px;
  --tap: 44px;
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --font: 'Inter', 'Inter var', Roboto, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow-card: none;
  --shadow-raise: none;
  --shadow-pop: 0 8px 24px -6px rgba(16, 24, 40, 0.18), 0 2px 6px -2px rgba(16, 24, 40, 0.08);
  --gutter: var(--sp-4);
  --empty-art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='64' fill='none'%3E%3Crect x='14' y='10' width='60' height='46' rx='6' fill='%23eff4ff' stroke='%23b2ccff' stroke-width='1.5'/%3E%3Cpath d='M14 22h60' stroke='%23b2ccff' stroke-width='1.5'/%3E%3Ccircle cx='23' cy='16' r='2' fill='%23b2ccff'/%3E%3Ccircle cx='31' cy='16' r='2' fill='%23b2ccff'/%3E%3Crect x='24' y='30' width='30' height='4' rx='2' fill='%23b2ccff'/%3E%3Crect x='24' y='40' width='20' height='4' rx='2' fill='%23d1e0ff'/%3E%3Ccircle cx='68' cy='48' r='11' fill='%23fff' stroke='%23155eef' stroke-width='1.5'/%3E%3Cpath d='m63.5 48 3 3 6-6' stroke='%23155eef' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (min-width: 900px) {
  :root {
    --tap: 36px;
    --gutter: var(--sp-5);
  }
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  min-height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100svh;
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tap) + 44px + env(safe-area-inset-bottom));
}
h1,
h2,
h3,
h4 {
  font-family: var(--font);
  line-height: 1.3;
  color: var(--ink);
}
h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
h2 {
  font-size: 16px;
  font-weight: 600;
  margin: var(--sp-5) 0 var(--sp-3);
}
h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--card);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  z-index: 40;
}
.skip:focus {
  left: 16px;
  z-index: 40;
}
.appbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--gutter);
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 600;
  font-size: 18px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.appbar-end {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
  min-width: 0;
  flex: 0 1 auto;
}
.who {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tenant-name {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.tenant-name::after {
  content: '·';
  margin-left: var(--sp-2);
}
#device-pairing {
  max-width: 38rem;
  overflow-wrap: anywhere;
}
#device-pairing h1 {
  margin-top: 0;
  color: var(--ink);
}
#device-pairing a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
#device-code-display {
  display: inline-block;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
}
#device-pairing input:not([type='checkbox']) {
  min-width: 0;
  width: 100%;
}
.jobbar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--gutter);
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.jobpick {
  display: flex;
  gap: var(--sp-2);
  flex: 0 0 auto;
}
.jobpick select {
  flex: 1 1 auto;
  font-weight: 500;
}
.jobpick .ghost {
  width: var(--tap);
  padding: 0;
  flex: 0 0 auto;
}
.jobpick .ghost .icon {
  width: 16px;
  height: 16px;
}
.jobstrip {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
  flex: 1 1 auto;
}
.jobstrip-main {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  min-width: 0;
  flex-wrap: wrap;
}
.jobstrip-main strong {
  font-size: 14px;
  font-weight: 600;
}
.jobstrip-main .meta {
  font-size: 12px;
  color: var(--muted);
}
.jobstrip-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  align-items: center;
}
.jobstrip-fact {
  display: inline-flex;
  gap: 6px;
  font-size: 12px;
}
.jobstrip-fact .k {
  color: var(--muted);
}
.jobstrip-fact .v {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.view {
  padding: var(--sp-4) var(--gutter) var(--sp-6);
  width: 100%;
}
.view > section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  align-items: stretch;
}
.view > section > h1 {
  margin: 0;
}
.view > section > h2 {
  margin: var(--sp-2) 0 0;
}
.pagehead {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.pagehead > :first-child {
  margin-right: auto;
}
.pagehead h1 {
  margin: 0;
}
.pagehead .desc {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.pagehead .row {
  padding-top: 0;
}
.pagehead-actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  align-items: center;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
}
.card:not(.stack) > * + * {
  margin-top: var(--sp-3);
}
.card > p {
  margin: 0;
}
.card > h2:first-child,
.card > h3:first-child {
  margin-top: 0;
}
.stack {
  display: grid;
  gap: var(--sp-3);
  min-width: 0;
}
@media (min-width: 900px) {
  .stack > button:not(.big) {
    justify-self: start;
  }
}
#books-body,
#cmp-body,
#queue-body,
#log-list,
.settings-pane {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
}
.settings-pane[hidden] {
  display: none;
}
.row {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.row > label:not(.row) {
  flex: 1 1 140px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  min-width: 0;
}
label.row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--ink);
  font-weight: 400;
}
label.row input[type='checkbox'] {
  order: -1;
}
.hint,
.meta {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.hint {
  margin: 0;
}
p.desc {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}
input,
textarea,
select {
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-height: var(--tap);
  width: 100%;
  min-width: 0;
}
@media (min-width: 900px) {
  input,
  textarea,
  select {
    font-size: 14px;
    padding: 6px 10px;
  }
}
input:hover,
textarea:hover,
select:hover {
  border-color: var(--muted);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
textarea {
  min-height: 84px;
  resize: vertical;
}
input[type='checkbox'] {
  min-height: auto;
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--accent);
}
input[type='color'] {
  padding: 2px;
  min-height: var(--tap);
  width: 64px;
}
input[type='file'] {
  padding: 7px 10px;
}
input:user-invalid,
input[aria-invalid='true'] {
  border-color: var(--bad);
}
button,
.ghost {
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  min-height: var(--tap);
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--btn-line);
  background: var(--card);
  color: #344054;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:hover,
.ghost:hover {
  background: var(--card-raised);
  text-decoration: none;
}
button.primary {
  background: var(--btn);
  color: var(--btn-ink);
  border-color: var(--btn);
}
button.primary:hover {
  background: var(--btn-hover);
  border-color: var(--btn-hover);
}
button.big {
  width: 100%;
  min-height: 72px;
  font-size: 18px;
  font-weight: 600;
  border-radius: var(--radius);
}
button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}
button[disabled] {
  opacity: 0.5;
  cursor: default;
}
button.danger,
.ghost.danger {
  color: var(--bad);
  background: var(--card);
}
button.danger:hover,
.ghost.danger:hover {
  background: var(--bad-wash);
  border-color: var(--bad);
  color: var(--bad);
}
.status {
  min-height: 1.3em;
  font-size: 13px;
  color: var(--muted);
  margin: var(--sp-1) 0 0;
  font-weight: 500;
}
.status.ok {
  color: var(--ok);
}
.status.bad {
  color: var(--bad);
}
.toggle {
  display: inline-flex;
  gap: 0;
  flex-wrap: nowrap;
}
.toggle button {
  border-radius: 0;
  margin-left: -1px;
}
.toggle button:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  margin-left: 0;
}
.toggle button:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.toggle button[aria-pressed='true'] {
  background: var(--accent-wash);
  color: var(--accent);
  border-color: var(--accent);
  position: relative;
  z-index: 1;
}
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.list li {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line-soft);
}
.list li:last-child {
  border-bottom: 0;
}
.list:has(> .empty) {
  border: 0;
  background: transparent;
}
.list li:has(> button.co-row) {
  padding: 0;
}
.list button.co-row {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: var(--sp-3) var(--sp-4);
  min-height: auto;
  font-weight: 400;
  color: var(--ink);
}
.list button.co-row:hover {
  background: var(--card-raised);
}
.list button.co-row strong {
  font-weight: 600;
  color: var(--accent);
}
.list button.co-row .pill {
  margin-left: var(--sp-2);
}
.list button.co-row .meta {
  display: block;
  margin-top: 2px;
}
.list .meta {
  font-size: 12px;
  color: var(--muted);
}
.list li > .row:last-child {
  margin-top: var(--sp-2);
}
@media (min-width: 641px) {
  .list li:has(> .row:last-child) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--sp-4);
    align-items: center;
  }
  .list li:has(> .row:last-child) > * {
    grid-column: 1;
  }
  .list li > .row:last-child {
    grid-column: 2;
    grid-row: 1 / span 9;
    margin-top: 0;
  }
}
.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--line-soft);
  color: #344054;
  white-space: nowrap;
}
.pill::first-letter {
  text-transform: uppercase;
}
.pill.info {
  color: var(--accent-strong);
  background: var(--accent-wash);
}
.pill.ok {
  color: var(--ok);
  background: var(--ok-wash);
}
.pill.warn {
  color: var(--warn);
  background: var(--warn-wash);
}
.pill.bad {
  color: var(--bad);
  background: var(--bad-wash);
}
.chip {
  display: inline-block;
  font-size: 12px;
  line-height: 18px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--card);
  white-space: nowrap;
}
.photos {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}
.photos:empty {
  display: none;
}
.photos img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}
.person {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  white-space: nowrap;
}
.avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-wash);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 600;
}
.empty {
  display: grid;
  gap: var(--sp-2);
  justify-items: center;
  text-align: center;
  padding: var(--sp-6) var(--sp-5);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.empty::before,
.grid td[colspan].meta::before,
.list > li.meta:only-child::before {
  content: '';
  display: block;
  width: 88px;
  height: 64px;
  margin: 0 auto var(--sp-2);
  background: var(--empty-art) center / contain no-repeat;
}
.empty p {
  margin: 0;
  font-size: 14px;
}
.empty button,
.empty a.ghost {
  margin-top: var(--sp-1);
}
p.empty {
  margin: 0;
}
.grid td[colspan].meta,
.list > li.meta:only-child {
  text-align: center;
  padding: var(--sp-6) var(--sp-4);
  font-size: 14px;
  white-space: normal;
}
.skel {
  display: grid;
  gap: var(--sp-2);
}
.skel-row {
  height: 46px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--card-raised) 25%, var(--line-soft) 37%, var(--card-raised) 63%);
  background-size: 400% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .skel-row {
    animation: skel-shimmer 1.4s ease infinite;
  }
}
@keyframes skel-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}
.toast {
  position: fixed;
  left: var(--sp-4);
  right: var(--sp-4);
  bottom: calc(var(--tap) + 56px + env(safe-area-inset-bottom));
  z-index: 30;
  margin: 0 auto;
  max-width: 480px;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}
.toast.bad {
  border-color: var(--bad);
}
.toast.ok {
  border-color: var(--ok);
}
.toast .toast-close {
  margin-left: auto;
  min-height: 28px;
  min-width: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
}
@media (min-width: 900px) {
  .toast {
    left: auto;
    right: var(--sp-5);
    bottom: auto;
    top: 64px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: toast-in 160ms ease;
  }
  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
.scroll-x {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--card);
}
table.grid {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
  background: var(--card);
}
.grid caption {
  text-align: left;
  padding: var(--sp-2) var(--sp-4);
}
.grid th,
.grid td {
  border-bottom: 1px solid var(--line-soft);
  padding: 10px var(--sp-4);
  text-align: left;
  white-space: nowrap;
}
.grid tbody tr:last-child > * {
  border-bottom: 0;
}
.grid thead th {
  background: var(--card-raised);
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.grid tbody th {
  font-weight: 500;
}
.grid tbody tr:hover {
  background: var(--card-raised);
}
.grid td.on {
  background: var(--accent);
  color: var(--accent-ink);
  text-align: center;
  font-weight: 600;
}
.grid td.num,
.grid th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.grid td.neg {
  color: var(--bad);
  font-weight: 500;
}
.grid td.ok {
  color: var(--ok);
}
.grid tr:last-child > th {
  font-weight: 600;
}
.grid th.today-col,
.grid td.today-col {
  background: var(--accent-wash);
}
.grid td.on.today-col {
  background: var(--accent);
}
.grid th.today-col {
  color: var(--accent-strong);
}
.grid .td-wrap {
  white-space: normal;
  min-width: 280px;
}
.grid .td-wrap > div + div {
  margin-top: 2px;
}
.grid td.check,
.grid th.check {
  width: 40px;
  padding-right: 0;
}
.grid td.actions {
  text-align: right;
}
.grid td.actions > .row-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.grid select {
  width: auto;
  min-width: 11ch;
  max-width: 100%;
}
.grid .edit-row td {
  white-space: normal;
  background: var(--card-raised);
}
.grid .edit-row td:empty {
  display: none;
}
.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  font-size: 13px;
  color: var(--muted);
  margin-top: calc(-1 * var(--sp-2));
}
.pager label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 13px;
  font-weight: 400;
}
.pager select {
  width: auto;
  min-height: 32px;
  padding: 2px 6px;
  font-size: 13px;
}
.pager button {
  width: 32px;
  min-height: 32px;
  padding: 0;
}
.rowmenu-btn {
  width: 32px;
  min-height: 32px;
  padding: 0;
}
.rowmenu-btn .icon {
  width: 16px;
  height: 16px;
}
.rowmenu {
  margin: 0;
  inset: auto;
  padding: var(--sp-1);
  min-width: 160px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
}
.rowmenu button,
.rowmenu a {
  display: flex;
  width: 100%;
  justify-content: flex-start;
  border: 0;
  background: transparent;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--ink);
}
.rowmenu button:hover,
.rowmenu a:hover {
  background: var(--card-raised);
}
.rowmenu button.danger {
  color: var(--bad);
  background: transparent;
}
.bulkbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding: var(--sp-2) var(--sp-3);
  background: var(--accent-wash);
  border: 1px solid #b2ccff;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-strong);
}
.bulkbar .spacer {
  flex: 1 1 auto;
}
@media (max-width: 640px) {
  .grid-cards,
  .grid-cards thead,
  .grid-cards tbody,
  .grid-cards tr,
  .grid-cards td {
    display: block;
    width: 100%;
  }
  .grid-cards thead {
    position: absolute;
    left: -9999px;
  }
  .grid-cards caption {
    display: block;
    padding: 0 0 var(--sp-2);
  }
  .grid-cards tr {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    background: var(--card);
  }
  .grid-cards tbody tr:hover {
    background: var(--card);
  }
  .grid-cards tr > th {
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid var(--line-soft);
    white-space: normal;
  }
  .grid-cards td {
    border-bottom: 1px solid var(--line-soft);
    padding: 8px 0;
    white-space: normal;
    display: flex;
    justify-content: space-between;
    gap: var(--sp-3);
    align-items: center;
  }
  .grid-cards tr > td:last-child {
    border-bottom: 0;
  }
  .grid-cards td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    flex: 0 0 auto;
  }
  .grid-cards td.num {
    text-align: right;
  }
  .grid-cards td.td-wrap {
    display: block;
    min-width: 0;
  }
  .grid-cards td.td-wrap[data-label]::before {
    display: block;
    margin-bottom: 2px;
  }
  .grid-cards td.check {
    width: 100%;
    padding-right: 0;
  }
  .grid-cards td.check input {
    width: 24px;
    height: 24px;
  }
  .grid-cards td.actions > .row-actions {
    display: flex;
    width: 100%;
  }
  .grid-cards td.actions > .row-actions > button:not(.rowmenu-btn) {
    flex: 1 1 auto;
    min-height: 44px;
  }
  .grid-cards .edit-row td {
    display: block;
  }
  .grid-cards td[colspan].meta {
    display: block;
  }
  .scroll-x:has(.grid-cards) {
    border: 0;
    background: transparent;
    border-radius: 0;
    overflow: visible;
  }
  table.grid.grid-cards {
    background: transparent;
  }
}
.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}
.tile,
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
  min-width: 0;
}
.tile .k,
.stat .k {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.tile .v,
.stat .v {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: var(--sp-1);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.tile .v.neg,
.stat .v.neg {
  color: var(--bad);
}
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-3);
}
.stat-ic {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent-wash);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stat-ic .icon {
  width: 18px;
  height: 18px;
}
.stat .sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
@media (max-width: 640px) {
  .tile,
  .stat {
    padding: var(--sp-3);
  }
  .tile .v,
  .stat .v {
    font-size: 18px;
  }
}
@media (min-width: 900px) {
  .tiles {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
}
.home-cols {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .home-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4);
  min-width: 0;
}
.panel > h2 {
  margin: 0 0 var(--sp-3);
  font-size: 14px;
}
.panel .empty {
  border: 0;
  padding: var(--sp-4);
}
.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}
button.mini {
  display: block;
  text-align: left;
  height: 100%;
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font-weight: 400;
  color: var(--ink);
}
button.mini:hover {
  border-color: var(--accent);
  background: var(--card);
}
.mini .n {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.mini .l {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-top: 2px;
}
.mini .s {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.crew-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.crew-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--line-soft);
}
.crew-list li:last-child {
  border-bottom: 0;
}
.crew-list .meta {
  display: block;
}
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp-1);
  border-bottom: 1px solid var(--line);
  max-width: 100%;
}
.seg [role='tab'] {
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  border-radius: 0;
  min-height: 40px;
  padding: 0 var(--sp-3);
  color: var(--muted);
  font-weight: 500;
  flex: 0 0 auto;
}
.seg [role='tab']:hover {
  color: var(--ink);
  background: transparent;
}
.seg [aria-selected='true'],
.seg [aria-selected='true']:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.pagehead .seg {
  border-bottom: 0;
  flex-wrap: nowrap;
  gap: 0;
}
.pagehead .seg [role='tab'] {
  border: 1px solid var(--btn-line);
  margin: 0 0 0 -1px;
  min-height: var(--tap);
  color: #344054;
  background: var(--card);
}
.pagehead .seg [role='tab']:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  margin-left: 0;
}
.pagehead .seg [role='tab']:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.pagehead .seg [aria-selected='true'],
.pagehead .seg [aria-selected='true']:hover {
  background: var(--accent-wash);
  color: var(--accent);
  border-color: var(--accent);
  position: relative;
  z-index: 1;
}
.tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  z-index: 5;
  padding: var(--sp-1) var(--sp-2) calc(var(--sp-1) + env(safe-area-inset-bottom));
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tabs button {
  flex: 1 0 auto;
  min-width: 58px;
  padding: var(--sp-2) 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  min-height: 52px;
  white-space: nowrap;
  flex-direction: column;
  gap: 3px;
  scroll-snap-align: center;
}
.tabs button .icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
}
.tabs button:hover {
  background: var(--card-raised);
  color: var(--ink);
}
.tabs button[aria-selected='true'],
.tabs button[aria-selected='true']:hover {
  color: var(--accent);
  background: var(--accent-wash);
}
.tabs button[hidden] {
  display: none;
}
@media (max-width: 899px) {
  .tabs {
    scroll-snap-type: x proximity;
  }
  .tabs::after {
    content: '';
    position: fixed;
    right: 0;
    bottom: 0;
    width: 26px;
    pointer-events: none;
    height: calc(60px + env(safe-area-inset-bottom));
    background: linear-gradient(to right, transparent, var(--bg-alt) 72%);
  }
}
@media (min-width: 900px) {
  body {
    padding-bottom: var(--sp-6);
  }
  .appbar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding-top: 0;
    padding-bottom: 0;
    gap: var(--sp-5);
    min-height: 52px;
  }
  .tabs {
    position: static;
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    padding: 0;
    gap: var(--sp-1);
    background: transparent;
  }
  .tabs button {
    flex: 0 0 auto;
    flex-direction: row;
    min-width: 0;
    min-height: 52px;
    padding: 0 10px;
    font-size: 14px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    border-top: 2px solid transparent;
  }
  .tabs button .icon {
    display: none;
  }
  .tabs button:hover {
    background: transparent;
    color: var(--ink);
  }
  .tabs button[aria-selected='true'],
  .tabs button[aria-selected='true']:hover {
    background: transparent;
    color: var(--accent);
    border-bottom-color: var(--accent);
  }
  .tabs button[data-go='queue'] {
    margin-left: 9px;
    position: relative;
    overflow: visible;
  }
  .tabs button[data-go='queue']::before {
    content: '';
    position: absolute;
    left: -7px;
    top: 16px;
    bottom: 16px;
    width: 1px;
    background: var(--btn-line);
  }
  .jobbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-5);
    padding-top: var(--sp-2);
    padding-bottom: var(--sp-2);
  }
  .jobpick {
    margin-left: auto;
  }
  .jobpick select {
    width: 320px;
    flex: 0 0 auto;
  }
  .jobstrip {
    flex-direction: row;
    align-items: center;
    gap: var(--sp-4);
    flex-wrap: wrap;
  }
  .tenant-name {
    display: inline;
  }
}
@media (max-width: 899px) {
  .tenant-name {
    display: none;
  }
}
@media (min-width: 900px) and (max-width: 1279px) {
  .tenant-name {
    display: none;
  }
  .appbar {
    gap: var(--sp-4);
  }
  .tabs button {
    padding: 0 6px;
  }
}
@media (min-width: 900px) and (max-width: 1099px) {
  .appbar {
    flex-wrap: wrap;
    row-gap: 0;
    padding-top: var(--sp-2);
  }
  .tabs {
    order: 3;
    flex-basis: 100%;
    margin: 0 -6px;
  }
  .tabs button {
    min-height: 44px;
  }
  .tabs button[data-go='queue']::before {
    top: 12px;
    bottom: 12px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button,
  .tabs button,
  .seg [role='tab'],
  input,
  textarea,
  select,
  .list button.co-row {
    transition:
      background-color 120ms ease,
      color 120ms ease,
      border-color 120ms ease;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
.gantt svg {
  display: block;
  background: var(--card);
}
.gantt svg text {
  font-family: inherit;
  fill: var(--ink);
}
.gantt svg .bar {
  cursor: pointer;
}
.gantt svg .bar:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
table.grid tbody tr[role='button'] {
  cursor: pointer;
}
table.grid tbody tr[role='button']:hover {
  background: var(--card-raised);
}
table.grid tbody tr[role='button']:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
details.card {
  padding: var(--sp-3) var(--sp-4);
}
details.card summary {
  cursor: pointer;
  font-weight: 500;
  padding: var(--sp-1) 0;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
details.card[open] summary {
  margin-bottom: var(--sp-3);
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: var(--sp-2);
}
#sched-edit input[type='color'] {
  padding: 2px;
  min-height: var(--tap);
  width: 64px;
}
.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.drawer {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  color: var(--ink);
}
.drawer::backdrop {
  background: rgba(16, 24, 40, 0.45);
}
.drawer[open] {
  display: flex;
  flex-direction: column;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  background: var(--card);
  flex: 0 0 auto;
}
.drawer-head h2 {
  margin: 0;
  font-size: 16px;
}
.drawer-close {
  background: none;
  border: 0;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0 var(--sp-2);
  cursor: pointer;
  color: var(--ink);
  border-radius: 6px;
  min-width: 44px;
  min-height: 44px;
}
.drawer-body {
  padding: var(--sp-4);
  overflow-y: auto;
  background: var(--card);
  flex: 1 1 auto;
}
.drawer-body > .card,
.drawer-body > form.card {
  border: 0;
  padding: 0;
  background: transparent;
}
.drawer-body > * > h2:first-child,
.drawer-body > * > h3:first-child {
  margin-top: 0;
}
@media (max-width: 699px) {
  .drawer[open] {
    justify-content: flex-end;
    animation: drawer-up 180ms ease-out;
  }
  .drawer-head {
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .drawer-body {
    max-height: 72vh;
    flex: 0 1 auto;
    padding-bottom: calc(var(--sp-4) + env(safe-area-inset-bottom, 0px));
  }
}
@media (min-width: 700px) {
  .drawer[open] {
    align-items: flex-end;
    animation: drawer-in 180ms ease-out;
  }
  .drawer-head,
  .drawer-body {
    width: min(480px, 100vw);
  }
  .drawer-body {
    max-height: calc(100vh - 72px);
  }
}
@keyframes drawer-in {
  from {
    transform: translateX(16px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes drawer-up {
  from {
    transform: translateY(16px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.skeleton {
  display: grid;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.skeleton span {
  display: block;
  height: 14px;
  border-radius: 7px;
  background: var(--line);
  opacity: 0.6;
  animation: pulse 1.3s ease-in-out infinite;
}
.skeleton span:nth-child(1) {
  width: 38%;
}
.skeleton span:nth-child(2) {
  width: 88%;
  animation-delay: 0.1s;
}
.skeleton span:nth-child(3) {
  width: 74%;
  animation-delay: 0.2s;
}
.skeleton span:nth-child(4) {
  width: 56%;
  animation-delay: 0.3s;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 0.75;
  }
}
.pane-error {
  border: 1px solid var(--bad);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: var(--bad-wash);
  padding: var(--sp-4);
  margin-bottom: var(--sp-4);
}
.pane-error p {
  margin: 0 0 var(--sp-2);
}
.pane-error .meta {
  color: var(--muted);
  font-size: 14px;
}
@media (prefers-reduced-motion: reduce) {
  .skeleton span {
    animation: none;
  }
  .drawer[open] {
    animation: none;
  }
}
.drawer-owned {
  display: none;
}
#drawer-body .drawer-owned {
  display: block;
}
.sched-window {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.sched-window p {
  margin: 0;
  font-size: 13px;
}
.sched-window .meta {
  color: var(--muted);
}
.sched-window .spacer {
  flex: 1 1 auto;
}
.sched-more > summary {
  cursor: pointer;
  font-weight: 500;
  padding: var(--sp-2) 0;
}
.sched-more[open] > summary {
  margin-bottom: var(--sp-2);
}
.linklike {
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  font: inherit;
  font-weight: 500;
  color: var(--accent);
  text-align: left;
  cursor: pointer;
}
.linklike:hover {
  color: var(--accent-strong);
  background: none;
  text-decoration: underline;
}
.status-pick {
  min-width: 12ch;
  padding: 4px 8px;
  min-height: 32px;
}
@media (max-width: 899px) {
  #clock-card > p {
    font-size: 16px;
  }
}
.ib-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  margin: 0;
  min-width: 0;
}
.ib-group legend {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  padding: 0 var(--sp-1);
}
@media (min-width: 700px) {
  .ib-group .grid input[type='number'] {
    width: 7rem;
    min-width: 0;
  }
  .ib-group .grid select {
    width: auto;
    min-width: 6.5rem;
  }
  .ib-group .grid td.check,
  .ib-group .grid th.check {
    width: 32px;
  }
  .ib-group .grid td[data-label='Item'] {
    min-width: 12rem;
  }
}
.ib-group tr.muted td {
  color: var(--muted);
}
.ib-total {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  margin: var(--sp-2) 0 0;
}
#invoice-form .row {
  flex-wrap: wrap;
  align-items: end;
}
.inv-lines {
  margin: var(--sp-1) 0 0;
  padding-left: 18px;
}
.inv-lines li {
  margin: 2px 0;
}
.grid td.neg,
.grid td .neg {
  color: var(--bad);
  font-weight: 600;
}
@media (min-width: 700px) {
  .drawer:has(#invoice-form) .drawer-head,
  .drawer:has(#invoice-form) .drawer-body {
    width: min(1080px, 100vw);
  }
}
