/* Yacht Workspace — Inventory module. Uses the Workspace look (sidebar, header,
   tokens); only what is specific to tables and status is defined here. */

:root {
  --inv-red: var(--danger);
  --inv-green: var(--success);
  --inv-amber: #b7791f;
  --inv-red-soft: color-mix(in srgb, var(--inv-red) 13%, transparent);
  --inv-amber-soft: color-mix(in srgb, var(--inv-amber) 15%, transparent);
  --inv-green-soft: color-mix(in srgb, var(--inv-green) 13%, transparent);
}

:root[data-theme="dark"] {
  --inv-amber: #e3b455;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --inv-amber: #e3b455;
  }
}

.module-root[hidden] {
  display: none !important;
}

.minimal-counter-warning {
  color: var(--inv-amber);
}

.minimal-counter-warning .minimal-counter-dot {
  background: var(--inv-amber);
}

.inv-scroll {
  padding: 18px 28px 80px;
  scrollbar-gutter: stable; /* a scrollbar appearing never changes the layout width */
}

/* ---------- header controls ---------- */

.inv-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inv-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--tab-hover);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.inv-pill.expired {
  background: var(--inv-red-soft);
  color: var(--inv-red);
}

.inv-pill.soon {
  background: var(--inv-amber-soft);
  color: var(--inv-amber);
}

.inv-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inv-spacer {
  flex: 1;
}

.inv-count {
  font-size: 12.5px;
  color: var(--text-faint);
}

.inv-search {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  min-width: 200px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
}

.inv-search:focus-within {
  border-color: var(--text-muted);
}

.inv-search-icon svg {
  width: 14px;
  height: 14px;
}

.inv-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.inv-search-input::-webkit-search-cancel-button {
  cursor: pointer;
}

.inv-select {
  height: 32px;
  max-width: 190px;
  padding: 0 30px 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* Filter drop-downs live in one capsule, divided by thin lines */
.inv-filter-cap {
  display: inline-flex;
  align-items: stretch;
  min-width: 0;
  max-width: 100%;
  height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.inv-fsel {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  min-width: 0;
  transition: background 0.15s;
}

.inv-fsel + .inv-fsel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border-strong);
  pointer-events: none;
}

.inv-fsel::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  background: var(--text-faint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5'/%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 12 12' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}

/* the end cells follow the capsule's curve, so hover, tint and focus ring stay round */
.inv-fsel:first-child {
  border-top-left-radius: 999px;
  border-bottom-left-radius: 999px;
}

.inv-fsel:last-child {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
}

.inv-fsel:hover {
  background: var(--tab-hover);
}

.inv-fsel:has(select:focus-visible) {
  background: var(--tab-hover);
  box-shadow: inset 0 0 0 1px var(--text-muted);
}

/* every filter is the same width; they only shrink together when the window is narrow */
.inv-fsel {
  flex: 0 1 150px;
  width: 150px;
}

.inv-fsel .inv-select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: auto;
  padding: 0 34px 0 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  text-overflow: ellipsis;
}

.inv-fsel .inv-select.inv-select-plan {
  max-width: none;
}

.inv-fsel-dot {
  display: none;
  position: absolute;
  right: 29px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--text);
  pointer-events: none;
}

/* A filter that is set: dark dot and a soft tint */
.inv-fsel:has(option:checked:not(:first-child)) {
  background: var(--accent-soft);
}

.inv-fsel:has(option:checked:not(:first-child)) .inv-fsel-dot {
  display: block;
}

.inv-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 15px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.inv-btn:hover {
  background: var(--tab-hover);
}

.inv-btn svg {
  width: 14px;
  height: 14px;
}

.inv-btn-primary {
  border-color: transparent;
  background: var(--text);
  color: var(--bg-elevated);
  font-weight: 600;
}

.inv-btn-primary:hover {
  background: var(--text);
  opacity: 0.88;
}

.inv-more svg,
.inv-print svg {
  width: 17px;
  height: 17px;
}

/* ---------- table ---------- */

.inv-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 235px);
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
}

.inv-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}

.inv-th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 38px;
  padding: 0 4px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.inv-th-inner {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.inv-th-inner .inv-th-menu {
  flex-shrink: 0;
}

.inv-th-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.inv-th-label:hover {
  background: var(--tab-hover);
  color: var(--text);
}

.inv-th-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-th-tracked {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--inv-amber);
  flex-shrink: 0;
}

.inv-sort svg {
  width: 11px;
  height: 11px;
  display: block;
}

.inv-th-menu,
.inv-add-col,
.inv-row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  position: relative;
}

.inv-th-menu {
  opacity: 0;
}

.inv-th:hover .inv-th-menu,
.inv-th-menu:focus-visible {
  opacity: 1;
}

.inv-th-menu svg,
.inv-add-col svg,
.inv-row-btn svg {
  width: 14px;
  height: 14px;
}

.inv-th-menu:hover,
.inv-add-col:hover,
.inv-row-btn:hover {
  background: var(--tab-hover);
  color: var(--text);
}

.inv-row-btn.danger:hover {
  color: var(--danger);
}

.inv-th-rename {
  width: 160px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--text-muted);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
}

/* Overview rows: the status dot sits right against the first column */
.inv-th-dot,
.inv-td-dot {
  width: 22px;
  padding-left: 10px;
  padding-right: 0;
}

/* Category tables: row number with the status dot beside it */
.inv-th-rownum,
.inv-td-rownum {
  padding: 0 4px 0 6px;
  text-align: right;
  white-space: nowrap;
}

.inv-th-rownum {
  color: var(--text-faint);
  font-weight: 600;
}

.inv-rownum {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.inv-rownum .inv-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
}

.inv-td-plan {
  padding: 0;
}

.inv-th-actions,
.inv-td-actions {
  width: 1%;
  white-space: nowrap;
  padding-right: 8px;
}

.inv-td {
  height: 38px;
  padding: 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.inv-row:last-child .inv-td {
  border-bottom: none;
}

.inv-row:hover .inv-td {
  background: var(--row-hover);
}

.inv-row.inv-flash .inv-td {
  background: color-mix(in srgb, var(--inv-amber) 18%, transparent);
  transition: background 1.6s ease-out;
}

.inv-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  field-sizing: fixed;
  min-width: 0;
  text-overflow: ellipsis;
  height: 36px;
  padding: 0 10px;
  border: none;
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
}

.inv-td-number .inv-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 70px;
}

.inv-input:focus {
  box-shadow: inset 0 0 0 1.5px var(--text-muted);
  background: var(--bg);
  border-radius: 4px;
}

.inv-td-date .inv-input {
  min-width: 128px;
  font-variant-numeric: tabular-nums;
}

.inv-input::-webkit-calendar-picker-indicator {
  opacity: 0.45;
  cursor: pointer;
}

/* status colours */

.inv-dot {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}

.inv-dot.status-expired {
  background: var(--inv-red);
}

.inv-dot.status-soon {
  background: var(--inv-amber);
}

.inv-dot.status-ok {
  background: var(--inv-green);
}

.inv-td-date.tracked .inv-input {
  font-weight: 500;
}

.inv-td-date.tracked.status-expired .inv-input {
  color: var(--inv-red);
}

.inv-td-date.tracked.status-soon .inv-input {
  color: var(--inv-amber);
}

.inv-td-date.tracked.status-ok .inv-input {
  color: var(--inv-green);
}

/* Fire Plan marker */

.inv-plan {
  display: inline-flex;
  color: var(--text-faint);
  opacity: 0.45;
}

.inv-plan svg {
  width: 15px;
  height: 15px;
}

.inv-plan.linked {
  color: var(--text);
  opacity: 1;
}

/* Plan location: muted outline when not placed, solid dark pin when placed */
.inv-plan-cell:not(.linked) .inv-plan {
  color: var(--text-faint);
  opacity: 0.8;
}

.inv-plan-cell.linked .inv-plan svg {
  width: 15px;
  height: 15px;
}

.inv-row-actions {
  display: flex;
  align-items: center;
  gap: 1px;
  opacity: 0;
}

.inv-row:hover .inv-row-actions,
.inv-row:focus-within .inv-row-actions,
.inv-row-btn.has-files {
  opacity: 1;
}

.inv-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  box-sizing: border-box;
  border-radius: 7px;
  background: var(--text);
  color: var(--bg-elevated);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.inv-empty {
  padding: 36px 12px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13.5px;
}

.inv-empty-title {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
}

/* ---------- overview ---------- */

/* Group dashboard: big numbers on the page; the number carries the colour */
.inv-dash-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 0;
}

.inv-dash-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 0 28px;
  border: none;
  border-left: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.inv-dash-stat:first-child {
  padding-left: 0;
  border-left: none;
}

.inv-dash-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.inv-dash-label {
  font-size: 12.5px;
  color: var(--text-muted);
  text-underline-offset: 3px;
}

.inv-dash-stat:hover .inv-dash-label {
  color: var(--text);
  text-decoration: underline;
}

.inv-dash-stat:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 4px;
  border-radius: 6px;
}

.inv-dash-stat.expired .inv-dash-value {
  color: var(--inv-red);
}

.inv-dash-stat.soon .inv-dash-value {
  color: var(--inv-amber);
}

.inv-overview-table .inv-td-text {
  padding: 0 10px;
  white-space: nowrap;
}

.inv-overview-table .inv-td-main {
  white-space: normal;
  min-width: 220px;
}

.inv-row-link {
  cursor: pointer;
}

.inv-row-link:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: -2px;
}

.inv-due {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.inv-due.status-expired {
  background: var(--inv-red-soft);
  color: var(--inv-red);
}

.inv-due.status-soon {
  background: var(--inv-amber-soft);
  color: var(--inv-amber);
}

.inv-due.status-ok {
  background: var(--inv-green-soft);
  color: var(--inv-green);
}

.inv-due-col {
  margin-left: 8px;
  font-size: 12px;
  color: var(--text-faint);
}

.inv-more-btn {
  margin: 12px auto 0;
  display: flex;
}

/* ---------- menu ---------- */

.inv-menu {
  position: fixed;
  z-index: 300;
  min-width: 220px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-popover);
}

.inv-menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 30px;
  padding: 0 10px 0 4px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.inv-menu-item:hover:not(:disabled),
.inv-menu-item:focus-visible {
  background: var(--tab-hover);
  outline: none;
}

.inv-menu-item:disabled {
  color: var(--text-faint);
  cursor: default;
}

.inv-menu-item.danger {
  color: var(--danger);
}

.inv-menu-check {
  display: inline-flex;
  width: 18px;
  justify-content: center;
}

.inv-menu-check svg {
  width: 13px;
  height: 13px;
}

.inv-menu-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--border);
}

/* ---------- Print / Export current view: the card of the printer icon in the header ---------- */

.inv-menu-view {
  width: 300px;
  max-width: calc(100vw - 16px);
}

.inv-menu-head {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 7px 10px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.inv-menu-cap {
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.inv-menu-head b {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.inv-menu-head span:not(.inv-menu-cap) {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.inv-menu-note {
  margin-top: 4px;
  padding: 8px 10px 5px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.4;
}

.inv-menu-item.has-icon {
  height: 34px;
  gap: 10px;
  padding-left: 10px;
  color: var(--text-muted);
}

.inv-menu-item.has-icon:hover:not(:disabled) {
  color: var(--text);
}

.inv-menu-item.has-icon .inv-menu-check {
  width: 16px;
}

.inv-menu-item.has-icon .inv-menu-check svg {
  width: 16px;
  height: 16px;
}


/* ---------- item details ---------- */

.inv-detail {
  width: min(760px, calc(100vw - 32px));
  max-height: 88vh;
}

.inv-detail-kicker {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.inv-detail-title {
  margin: 2px 0 16px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.inv-detail-section {
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.inv-detail-section .export-label {
  margin-bottom: 8px;
}

.inv-detail-sechead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.inv-detail-sechead .export-label {
  margin-bottom: 0;
}

.inv-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  font-size: 13.5px;
}

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

.inv-detail-inline {
  display: flex;
  gap: 8px;
}

.inv-detail-input {
  flex: 1;
  height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--bg);
}

.inv-hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-faint);
}

.inv-plan-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.inv-plan-state.linked {
  color: var(--text);
}

.inv-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.inv-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: var(--text-faint);
  text-underline-offset: 3px;
  cursor: pointer;
}

.inv-file-size {
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- groups ---------- */

.inv-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 2px 12px 2px 12px;
  margin: 0 0 2px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-faint);
  font-size: 12.5px;
  font-weight: 600;
  flex-shrink: 0;
}

.inv-group-head:hover {
  background: var(--tab-hover);
  color: var(--text);
}

.inv-group-head.active {
  color: var(--text);
  background: var(--tab-hover);
}

.inv-group-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-group-empty {
  padding: 4px 12px 8px 40px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.inv-add-group {
  margin-top: 0;
}

.inv-group-sub {
  padding: 0 0 2px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.inv-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* Wide screens: the breadcrumb takes no height (it hangs in the strip above the title), so the title and the dashboard are at exactly the same height in a group and in a category.
   It stays in the header's own flow, so its left edge is the title's left edge whatever the menu is doing. */
@media (min-width: 761px) {
  .main-header > .inv-crumb {
    height: 0;
    margin-bottom: -10px; /* the header's row gap */
    overflow: visible;
    position: relative;
    top: -1px;
    line-height: 15px;
    white-space: nowrap;
  }
}

.inv-crumb-link {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--text-muted);
  cursor: pointer;
}

.inv-crumb-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.inv-crumb-here {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  align-content: start;
}

.inv-cat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 112px;
  padding: 14px 16px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.inv-cat-card:hover {
  border-color: var(--border-strong);
}

.inv-cat-card-name {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.inv-cat-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inv-cat-card .inv-plan-chip {
  margin-top: auto;
}

.inv-cat-card-add {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-style: dashed;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  font-size: 13.5px;
}

.inv-cat-card-add:hover {
  background: var(--tab-hover);
  color: var(--text);
}

.inv-plan-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.inv-plan-chip.off {
  border-style: dashed;
  color: var(--text-faint);
  font-weight: 500;
}

.inv-plan-chip .inv-plan svg {
  width: 11px;
  height: 11px;
}

.inv-scroll ~ * .tab-title-display,
.module-root .main-header .tab-title-display {
  max-width: min(420px, 60%);
}

.inv-select.inv-select-plan {
  max-width: none;
}

/* ---------- collapsible groups ---------- */

.inv-group-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: -4px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.inv-group-toggle:hover {
  background: var(--control-active-bg);
}

.inv-group-toggle svg {
  width: 13px;
  height: 13px;
  transition: transform 0.12s ease;
}

.inv-group-head.collapsed .inv-group-toggle svg {
  transform: rotate(-90deg);
}

@media (prefers-reduced-motion: reduce) {
  .inv-group-toggle svg {
    transition: none;
  }
}

/* ---------- group header, plan card, plan view ---------- */

.inv-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.inv-btn.danger {
  color: var(--danger);
}

.inv-plan-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
}

.inv-plan-card-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.inv-plan-card-icon {
  display: inline-flex;
  color: var(--text-muted);
  flex-shrink: 0;
}

.inv-plan-card-icon svg {
  width: 20px;
  height: 20px;
}

.inv-plan-card-text {
  min-width: 0;
}

.inv-plan-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}

.inv-plan-card-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(520px, 60vw);
}

.inv-plan-card-meta {
  font-size: 12.5px;
  color: var(--text-muted);
}

.inv-plan-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-scroll.inv-scroll-fill {
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
}

.inv-plan-bar {
  align-items: center;
}

.inv-plan-bar-name {
  font-size: 13.5px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-plan-frame {
  flex: 1;
  min-height: 420px;
  display: flex;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.inv-plan-pdf {
  flex: 1;
  width: 100%;
  border: none;
}

.inv-plan-msg {
  margin: auto;
  padding: 24px;
  color: var(--text-faint);
  font-size: 13.5px;
  text-align: center;
}

.inv-plan-empty {
  margin: auto;
  max-width: 420px;
}

.inv-plan-empty-action {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

/* ---------- expiring-by range ---------- */

.inv-range {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.inv-range-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.inv-range-switch button {
  padding: 0 11px;
  white-space: nowrap;
}

.inv-range-date {
  display: inline-flex;
}

.inv-range-text {
  font-size: 12.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- plan layer eye ---------- */

.inv-loc-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 20px;
  margin-right: -2px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.85;
}

.inv-loc-toggle.off {
  color: var(--text-faint);
  opacity: 0.75;
}

.inv-loc-toggle svg {
  width: 14px;
  height: 14px;
}

.tab-item:hover .inv-loc-toggle,
.inv-loc-toggle:hover,
.inv-loc-toggle:focus-visible {
  opacity: 1;
}

.inv-loc-toggle:hover {
  background: var(--control-active-bg);
}

button.inv-plan-chip {
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

button.inv-plan-chip:hover {
  background: var(--tab-hover);
}

.inv-plan-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  color: var(--text-faint);
  font-size: 13px;
  white-space: nowrap;
}

.inv-plan-cell.linked {
  color: var(--text);
}

.inv-plan-cell .inv-plan svg {
  width: 14px;
  height: 14px;
}

/* ---------- add column dialog ---------- */

.inv-addcol {
  width: min(420px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 18px;
}

.inv-addcol-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

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

.inv-addcol-input {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.inv-addcol-input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--text-muted);
}

.inv-addcol-types {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-addcol-type {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.inv-addcol-type:hover:not(:disabled) {
  background: var(--tab-hover);
}

.inv-addcol-type.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text);
}

.inv-addcol-type:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.inv-addcol-type-name {
  font-size: 13.5px;
  font-weight: 600;
}

.inv-addcol-type-hint {
  font-size: 12px;
  color: var(--text-muted);
}

.inv-addcol-track {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.inv-addcol-track[hidden] {
  display: none;
}

/* ---------- column widths ---------- */

.inv-table-fixed {
  table-layout: fixed;
  min-width: 0;
}

.inv-table-fixed .inv-th,
.inv-table-fixed .inv-td {
  overflow: hidden;
}

.inv-table-fixed .inv-th {
  overflow: visible;
}

.inv-table-fixed .inv-th-actions,
.inv-table-fixed .inv-td-actions {
  width: auto;
}

.inv-th-fill,
.inv-td-fill {
  padding: 0;
}

.inv-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 3;
  width: 9px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.inv-resizer::after {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 4px;
  width: 1px;
  background: var(--border-strong);
  transition: background 0.1s, width 0.1s, left 0.1s;
}

.inv-resizer:hover::after,
.inv-resizer:focus-visible::after,
.inv-resizer.dragging::after {
  left: 3px;
  width: 3px;
  border-radius: 2px;
  background: var(--text-muted);
}

body.inv-col-resizing,
body.inv-col-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

/* ---------- plan viewer and markers ---------- */

button.inv-plan-cell {
  height: 36px;
  margin: 0 4px;
  padding: 0 8px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

button.inv-plan-cell:hover {
  background: var(--tab-hover);
  color: var(--text);
}

button.inv-plan-cell.linked {
  color: var(--text);
}

.inv-plan-frame {
  flex-direction: column;
}

.inv-pv {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.inv-pv-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.inv-pv-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.inv-pv-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 9px;
}

.inv-pv-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.inv-pv-page-input {
  width: 48px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: center;
}

.inv-pv-count,
.inv-pv-zoom {
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.inv-pv-zoom {
  min-width: 40px;
  text-align: center;
}

.inv-pv-hint {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
}

.inv-pv-banner {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--inv-amber-soft);
  color: var(--text);
}

.inv-pv-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px;
  background: color-mix(in srgb, var(--text) 8%, var(--bg));
  cursor: grab;
  user-select: none;
  overscroll-behavior: none;
  touch-action: pan-x pan-y;
}

.inv-pv-scroll.panning {
  cursor: grabbing;
}

.inv-pv-page {
  position: relative;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 6px 20px rgba(0, 0, 0, 0.12);
}

.inv-pv-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.inv-pv-canvas.inv-pv-detail {
  position: absolute;
  pointer-events: none;
}

.inv-pv-canvas.inv-pv-detail[hidden] {
  display: none;
}

.inv-pv.placing .inv-pv-page {
  cursor: crosshair;
}

.inv-pv-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  container-type: inline-size; /* markers size themselves from the page width */
  --mk-size: 0.033;
}

.inv-marker {
  position: absolute;
  z-index: 1;
  width: calc(var(--mk-size) * 100%);
  aspect-ratio: 1;
  margin: calc(var(--mk-size) * -50%) 0 0 calc(var(--mk-size) * -50%);
  padding: 0;
  border: max(1px, calc(var(--mk-size) * 7cqw)) solid rgba(255, 138, 0, 0.45);
  border-radius: 50%;
  background: rgba(255, 138, 0, 0.14);
  box-sizing: border-box;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.inv-marker:hover,
.inv-marker:focus-visible {
  z-index: 3;
  border-color: rgba(255, 120, 0, 0.95);
  background: rgba(255, 138, 0, 0.42);
  box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.28);
  transform: scale(1.15);
  outline: none;
}

.inv-marker.unlocked {
  border-style: dashed;
  border-color: rgba(255, 120, 0, 0.8);
  cursor: grab;
}

/* resize handle: only on an unlocked marker, at its lower right edge */
.inv-marker-grip {
  position: absolute;
  left: 85.4%;
  top: 85.4%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  box-sizing: border-box;
  border: 2px solid rgb(255, 120, 0);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: nwse-resize;
  pointer-events: auto;
  z-index: 5;
}

.inv-marker.resizing {
  z-index: 4;
  background: rgba(255, 138, 0, 0.3);
}

.inv-marker.dragging {
  cursor: grabbing;
  z-index: 4;
  background: rgba(255, 138, 0, 0.5);
}

.inv-marker.pending {
  border-style: dashed;
  border-color: rgba(255, 120, 0, 0.95);
  background: rgba(255, 138, 0, 0.3);
  pointer-events: none;
}

.inv-pv.placing .inv-marker {
  pointer-events: none;
  opacity: 0.6;
}

.inv-marker.pulse {
  z-index: 3;
  animation: inv-marker-pulse 0.9s ease-out 3;
}

@keyframes inv-marker-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 138, 0, 0.8);
  }
  100% {
    box-shadow: 0 0 0 22px rgba(255, 138, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .inv-marker,
  .inv-marker.pulse {
    transition: none;
    animation: none;
  }
  .inv-marker.pulse {
    box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.6);
  }
}

/* ---------- marker popup ---------- */

.inv-pop {
  position: fixed;
  z-index: 10000;
  width: min(364px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.2);
}

.inv-pop-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 10px 10px 14px;
  border-bottom: 1px solid var(--border);
}

.inv-pop-titlewrap {
  flex: 1;
  min-width: 0;
}

.inv-pop-cat {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-faint);
}

.inv-pop-title {
  font-size: 14.5px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.inv-pop-close {
  flex-shrink: 0;
}

.inv-pop-rows {
  padding: 8px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.inv-pop-row {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 8px;
  font-size: 13px;
}

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

.inv-pop-value {
  overflow-wrap: anywhere;
}

.inv-pop-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 14px 6px;
  border-top: 1px solid var(--border);
}

.inv-pop-note {
  padding: 0 14px 12px;
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- add marker picker ---------- */

.inv-pick {
  width: min(460px, calc(100vw - 32px));
}

.inv-pick-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.inv-pick-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.inv-pick-item:hover {
  background: var(--tab-hover);
}

.inv-pick-item.selected {
  border-color: var(--text);
  background: var(--bg-elevated);
}

.inv-pick-main {
  font-size: 13.5px;
  font-weight: 600;
}

.inv-pick-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.inv-pick-sub.placed {
  color: var(--inv-amber);
}

.inv-pick .export-confirm-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.inv-pop-row .inv-due {
  justify-self: start;
}

/* ---------- editable marker popup, remove choice ---------- */

.inv-pop-row {
  align-items: center;
}

.inv-pop-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.inv-pop-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-overflow: ellipsis;
}

.inv-pop-input:hover {
  border-color: var(--border-strong);
}

.inv-pop-input:focus {
  outline: none;
  border-color: var(--text-muted);
  background: var(--bg-elevated);
}

.inv-pop-field .inv-due {
  flex-shrink: 0;
}

.inv-pop-field .inv-due[hidden] {
  display: none;
}

.inv-remove {
  width: min(420px, calc(100vw - 32px));
}

.inv-remove-name {
  font-size: 13.5px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.inv-remove-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.inv-remove-opt:hover {
  background: var(--tab-hover);
}

.inv-remove-opt.danger .inv-addcol-type-name {
  color: var(--danger);
}

.inv-remove-opt.danger:hover {
  border-color: var(--danger);
}

.inv-plan-bar .inv-count {
  margin-left: -4px;
}

/* ---------- notes ---------- */

.inv-note-flag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  color: var(--text-muted);
  vertical-align: middle;
  flex-shrink: 0;
}

.inv-note-flag svg {
  width: 14px;
  height: 14px;
}

.inv-row-btn.note {
  color: var(--text-muted);
}

.inv-note-text {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  resize: vertical;
}

.inv-note-text:focus {
  outline: none;
  border-color: var(--text-muted);
}

.inv-marker.has-note::after {
  content: "i";
  position: absolute;
  top: -26%;
  right: -26%;
  width: 58%;
  height: 58%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #5f6f86;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: calc(var(--mk-size) * 30cqw);
  line-height: 1;
  box-shadow: 0 0 0 max(1px, calc(var(--mk-size) * 5cqw)) #fff;
  pointer-events: none;
}

/* ---------- Check Mode ---------- */

.inv-pv-body {
  flex: 1;
  min-height: 0;
  display: flex;
}

.inv-pv-body .inv-pv-scroll {
  flex: 1;
  min-width: 0;
}

.inv-pv-panel {
  width: 270px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--bg-elevated);
}

.inv-pv-panel[hidden] {
  display: none;
}

.inv-pv-panel-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
}

.inv-pv-progress-text {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.inv-pv-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--tab-hover);
  overflow: hidden;
}

.inv-pv-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--inv-green);
  transition: width 0.2s ease;
}

.inv-pv-panel-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

.inv-pv-filter {
  align-self: flex-start;
}

.inv-pv-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.inv-pv-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.inv-pv-row:hover {
  background: var(--tab-hover);
}

.inv-pv-row-mark {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 138, 0, 0.8);
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  line-height: 13px;
  text-align: center;
  font-weight: 700;
}

.inv-pv-row.ok .inv-pv-row-mark {
  border-color: var(--inv-green);
  background: var(--inv-green);
}

.inv-pv-row-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.inv-pv-row-main {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-pv-row-sub {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-pv-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.inv-pv-check-banner {
  background: color-mix(in srgb, var(--inv-green) 18%, transparent);
}

/* markers while checking: orange = still to check, green = checked */
.inv-marker.chk-unchecked {
  border-color: rgba(255, 120, 0, 0.95);
  background: rgba(255, 138, 0, 0.32);
}

.inv-marker.chk-ok,
.inv-marker.chk-followup {
  border-color: rgba(26, 140, 76, 0.95);
  background: rgba(40, 175, 95, 0.5);
}

.inv-marker.chk-ok:hover,
.inv-marker.chk-followup:hover {
  background: rgba(40, 175, 95, 0.75);
}

/* inspection popup */
.inv-inspect {
  width: min(340px, calc(100vw - 16px));
}

.inv-pop-open-note {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--tab-hover);
  color: var(--text);
  font-size: 12.5px;
  white-space: pre-wrap;
}

.inv-pop-open-note .inv-note-flag {
  margin-left: 0;
  margin-top: 1px;
}

.inv-inspect-state {
  padding: 0 14px 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.inv-inspect-state.done {
  color: var(--inv-green);
  font-weight: 600;
}

.inv-inspect-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 14px 12px;
}

.inv-inspect-actions[hidden],
.inv-inspect-form[hidden] {
  display: none;
}

.inv-inspect-actions .inv-btn {
  justify-content: center;
  height: 36px;
  font-weight: 600;
}

.inv-inspect-ok {
  border-color: transparent;
  background: var(--inv-green);
  color: #fff;
}

.inv-inspect-ok:hover {
  background: var(--inv-green);
  opacity: 0.88;
}

.inv-inspect-followup {
  color: var(--text);
}

.inv-inspect-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 14px;
}

.inv-inspect-formrow {
  display: flex;
  gap: 8px;
}

.inv-inspect-formrow .inv-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* summary and history */
.inv-sum-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.inv-sum-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.inv-sum-value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.inv-sum-label {
  font-size: 12px;
  color: var(--text-muted);
}

.inv-sum-cell.ok .inv-sum-value {
  color: var(--inv-green);
}

.inv-sum-cell.warn .inv-sum-value {
  color: var(--inv-amber);
}

.inv-sum-cell.note .inv-sum-value {
  color: var(--text);
}

.inv-sum-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.inv-sum-note {
  display: flex;
  flex-direction: column;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--tab-hover);
}

.inv-sum-note span {
  color: var(--text-muted);
}

.inv-summary-dialog,
.inv-history {
  width: min(480px, calc(100vw - 32px));
}

.inv-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}

.inv-history-item {
  border: 1px solid var(--border);
  border-radius: 10px;
}

.inv-history-item summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}

.inv-history-date {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.inv-history-nums {
  flex: 1;
  color: var(--text-muted);
}

.inv-history-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 10px;
}

.inv-sum-note {
  background: var(--tab-hover);
}

.inv-pop-notes {
  height: auto;
  min-height: 48px;
  padding: 5px 8px;
  resize: vertical;
}

.inv-pop-row:has(.inv-pop-notes) {
  align-items: start;
}

/* ---------- group markers ---------- */

.inv-marker.group {
  border-color: color-mix(in srgb, var(--mk, #ff8a00) 55%, transparent);
  background: color-mix(in srgb, var(--mk, #ff8a00) 20%, transparent);
  color: color-mix(in srgb, var(--mk, #ff8a00) 55%, #000);
  font-family: system-ui, sans-serif;
  font-weight: 700;
  font-size: calc(var(--mk-size) * 46cqw);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.inv-marker.group.wide {
  font-size: calc(var(--mk-size) * 36cqw);
}

.inv-marker.group:hover,
.inv-marker.group:focus-visible {
  border-color: var(--mk, #ff8a00);
  background: color-mix(in srgb, var(--mk, #ff8a00) 45%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mk, #ff8a00) 30%, transparent);
}

.inv-marker.group.unlocked {
  border-color: var(--mk, #ff8a00);
}

.inv-marker.group.chk-unchecked {
  border-color: rgba(255, 120, 0, 0.95);
  background: rgba(255, 138, 0, 0.32);
  color: #8a4300;
}

.inv-marker.group.chk-ok {
  border-color: rgba(26, 140, 76, 0.95);
  background: rgba(40, 175, 95, 0.5);
  color: #0d5a31;
}

/* plan location cell */
.inv-plan-cell-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button.inv-plan-cell {
  max-width: calc(100% - 8px);
}


/* item pickers */
.inv-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inv-picker-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.inv-link-btn {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  text-decoration: underline;
  cursor: pointer;
}

.inv-pick-item {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.inv-pick-textcol {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.inv-pick-main,
.inv-pick-sub {
  overflow: hidden;
  text-overflow: ellipsis;
}

.inv-pick-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  color: var(--bg-elevated);
  font-size: 12px;
  line-height: 15px;
  text-align: center;
  font-weight: 700;
}

.inv-pick-item.selected .inv-pick-check {
  background: var(--text);
  border-color: var(--text);
}

.inv-viewitems {
  width: min(480px, calc(100vw - 32px));
}

.inv-swatches {
  display: flex;
  gap: 8px;
}

.inv-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: var(--sw);
  cursor: pointer;
  padding: 0;
}

.inv-swatch.on {
  box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 4px var(--text);
}

/* group popup */
.inv-group-pop {
  width: min(420px, calc(100vw - 16px));
}

.inv-group-pop .inv-group-search {
  margin: 8px 14px 6px;
  width: auto;
}

.inv-group-pop .inv-pick-list {
  margin: 0 14px 6px;
  max-height: min(320px, 45vh);
}

.inv-pop-itemlist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 14px 8px;
  max-height: 150px;
  overflow-y: auto;
}

.inv-pop-listrow {
  font-size: 12.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--tab-hover);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-pop-listrow.more {
  background: transparent;
  color: var(--text-muted);
}

/* group inspection */
.inv-group-inspect {
  width: min(400px, calc(100vw - 16px));
}

.inv-gi-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 10px 8px;
  max-height: min(340px, 50vh);
  overflow-y: auto;
}

.inv-gi-row {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 6px 8px;
}

.inv-gi-row.done {
  background: color-mix(in srgb, var(--inv-green) 8%, transparent);
}

.inv-gi-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-gi-text {
  flex: 1;
  min-width: 0;
}

.inv-gi-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.inv-gi-actions .inv-btn {
  height: 28px;
  padding: 0 9px;
  font-size: 12.5px;
}

.inv-gi-ok {
  border-color: transparent;
  background: var(--inv-green);
  color: #fff;
}

.inv-gi-form {
  padding: 8px 0 2px;
}

.inv-plan-chip:not(.off) .inv-plan {
  color: var(--text);
  opacity: 1;
}

.inv-plan-chip.off .inv-plan {
  color: var(--text-faint);
  opacity: 1;
}

/* dates: only the text changes colour, centred like every other cell */
.inv-input[type="date"] {
  display: flex;
  align-items: center;
  line-height: normal;
  font-family: inherit;
  font-size: 13.5px;
  padding-top: 0;
  padding-bottom: 0;
}

.inv-input[type="date"]::-webkit-datetime-edit,
.inv-input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

.inv-td-date.tracked .inv-input {
  font-weight: 400;
}

/* notes column */
button.inv-notes-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 2px 6px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0.85;
}

button.inv-notes-cell svg {
  width: 16px;
  height: 16px;
}

button.inv-notes-cell:hover {
  background: var(--tab-hover);
  color: var(--text);
  opacity: 1;
}

button.inv-notes-cell.has {
  color: var(--text);
  opacity: 1;
}

.inv-notes-pop {
  width: min(380px, calc(100vw - 16px));
}

.inv-notes-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 4px;
}

.inv-notes-body .inv-note-text {
  min-height: 110px;
}

.inv-notes-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 14px;
}

.inv-rownum {
  transform: translateY(-1px);
}

/* ---------- date badges ---------- */

.inv-td-date.tracked .inv-input {
  display: inline-flex;
  width: auto;
  max-width: calc(100% - 12px);
  height: 26px;
  margin: 5px 6px;
  padding: 0 8px 0 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.inv-td-date.tracked.status-expired .inv-input {
  background: var(--inv-red-soft);
  color: var(--inv-red);
}

.inv-td-date.tracked.status-soon .inv-input {
  background: var(--inv-amber-soft);
  color: var(--inv-amber);
}

.inv-td-date.tracked.status-ok .inv-input {
  background: var(--inv-green-soft);
  color: var(--inv-green);
}

.inv-td-date.tracked .inv-input:focus {
  box-shadow: 0 0 0 1.5px currentColor;
  border-radius: 999px;
}

.inv-td-date.tracked .inv-input::-webkit-calendar-picker-indicator {
  margin-left: 4px;
  opacity: 0.7;
}

/* ---------- sidebar attention dot ---------- */

.inv-attn-dot {
  width: 7px;
  height: 7px;
  margin-left: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}

.inv-attn-dot.expired {
  background: var(--inv-red);
}

.inv-attn-dot.soon {
  background: var(--inv-amber);
}

/* ---------- group dashboard ---------- */

.inv-section-head {
  margin: 18px 0 8px;
}

.inv-section-head .export-label {
  margin: 0;
}

.inv-group-toolbar {
  margin-bottom: 0;
}

/* Group summary: sits on the page, no frame */
.inv-zone {
  margin-bottom: 20px;
}

.inv-zone-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 10px;
}

.inv-zone-head .export-label {
  margin: 0;
}

.inv-zone-scope {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.inv-zone-scope svg {
  width: 13px;
  height: 13px;
}

/* Results panel: the filtered list */
.inv-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.inv-results-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.inv-results-title {
  font-size: 15px;
  font-weight: 700;
}

.inv-results-head .inv-link-btn {
  color: var(--text-muted);
  text-underline-offset: 3px;
}

.inv-results .inv-list-host .inv-table-wrap {
  margin-top: 0;
}

.inv-scroll > .inv-range {
  margin-bottom: 14px;
}

/* ---------- column drag and drop ---------- */

.inv-table-wrap {
  position: relative;
}

.inv-rownum {
  transform: none;
}

/* ---------- date badge: symmetric and centred ---------- */

.inv-td-date.tracked .inv-input {
  position: relative;
  justify-content: center;
  align-items: center;
  /* Fixed width with no side padding: the date sits dead centre. */
  width: 104px;
  min-width: 0;
  max-width: calc(100% - 12px);
  height: 26px;
  margin: 5px 8px;
  padding: 0;
  line-height: 1;
  text-align: center;
}

.inv-td-date.tracked .inv-input::-webkit-datetime-edit,
.inv-td-date.tracked .inv-input::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
  text-align: center;
}

/* The whole badge opens the calendar; no icon to unbalance the text. */
.inv-td-date.tracked .inv-input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

/* ---------- sidebar: fixed dot slot ---------- */

.inv-attn-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 20px;
  flex-shrink: 0;
}

.inv-attn-dot {
  margin-left: 0;
}

/* ---------- sidebar hierarchy: groups above their categories ---------- */

.inv-group-head {
  min-height: 32px;
  padding: 3px 10px 3px 8px;
  margin: 2px 0 3px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.inv-group-head:hover,
.inv-group-head.active {
  background: var(--tab-hover);
}

.inv-cat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 8px 17px;
  padding-left: 4px;
  border-left: 1.5px solid var(--border-strong);
}

.inv-cat-list .tab-item {
  font-weight: 400;
}

.inv-group-empty {
  padding-left: 30px;
}

/* ---------- column drag: columns slide apart ---------- */

.inv-th-inner {
  cursor: grab;
}

body.inv-col-dragging,
body.inv-col-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

.col-shifting {
  will-change: transform;
}

/* The grabbed column leaves its slot; only a light ghost follows the pointer. */
.col-lifted {
  opacity: 0;
  transition: none !important;
}

.inv-col-gap {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  box-sizing: border-box;
  border-left: 2px solid var(--text-muted);
  border-right: 2px solid var(--text-muted);
  background: color-mix(in srgb, var(--text) 5%, transparent);
  pointer-events: none;
  transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1), opacity 0.15s;
}

.inv-col-gap.done {
  opacity: 0;
}

.inv-col-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  padding: 5px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  pointer-events: none;
  opacity: 0.96;
  transition: opacity 0.15s;
}

.inv-col-ghost.done {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .col-shifting,
  .inv-col-gap {
    transition: none !important;
  }
}

/* ---------- row selection ---------- */

button.inv-rownum {
  display: inline-block;
  min-width: 22px;
  padding: 3px 4px;
  border: none;
  border-radius: 5px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
  text-align: right;
  cursor: pointer;
}

button.inv-rownum:hover {
  background: var(--control-active-bg);
  color: var(--text);
}

.inv-row.selected .inv-td,
.inv-row.selected:hover .inv-td {
  background: color-mix(in srgb, var(--text) 9%, transparent);
}

.inv-row.selected .inv-td-rownum {
  box-shadow: inset 3px 0 0 var(--text);
}

.inv-row.selected button.inv-rownum {
  color: var(--text);
  font-weight: 700;
}

.inv-row.selected .inv-row-actions {
  opacity: 1;
}

/* ---------- decks ---------- */

.inv-deck-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  text-overflow: ellipsis;
  background-image: none;
}

.inv-deck-select:hover {
  background: var(--tab-hover);
}

.inv-deck-select option {
  color: var(--text);
  background: var(--bg-elevated);
}

.deck-editor {
  width: min(460px, calc(100vw - 32px));
}

.deck-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
}

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

.deck-row .inv-addcol-input {
  flex: 1;
  min-width: 0;
}

.deck-use {
  min-width: 52px;
  font-size: 12px;
  color: var(--text-faint);
  text-align: right;
  white-space: nowrap;
}

.deck-row .inv-row-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.deck-add {
  display: flex;
  gap: 8px;
}

.deck-add .inv-addcol-input {
  flex: 1;
}

.deck-error {
  font-size: 12.5px;
  color: var(--danger);
}

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

/* ---------- check scope ---------- */

.inv-scope {
  width: min(440px, calc(100vw - 32px));
}

.inv-scope-tabs {
  align-self: flex-start;
}

.inv-scope-list {
  max-height: 280px;
}

.inv-pv-panel-scope {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.deck-also {
  max-width: 120px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tab-hover);
  color: var(--text-muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.deck-existing:empty {
  display: none;
}

.deck-existing select {
  flex: 1;
}

/* ---------- typed dates with a calendar button ---------- */

.inv-date {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.inv-date .inv-date-text {
  flex: 1;
  min-width: 0;
}

.inv-date-text::placeholder {
  color: var(--text-faint);
  opacity: 0.85;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.inv-td-date.tracked .inv-date-text {
  flex: 0 0 auto;
}

.inv-date-text.invalid {
  box-shadow: inset 0 0 0 1.5px var(--inv-red);
  border-radius: 6px;
}

.inv-td-date.tracked .inv-date-text.invalid {
  border-radius: 999px;
}

.inv-date-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0.75;
}

.inv-date-btn svg {
  width: 14px;
  height: 14px;
}

.inv-date-btn:hover,
.inv-date-btn:focus-visible {
  background: var(--tab-hover);
  color: var(--text);
  opacity: 1;
}

.inv-date-native {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.inv-date-compact .inv-input {
  height: 28px;
  border-radius: 7px;
  background: var(--bg);
  font-size: 13px;
}

/* ---------- table scrollbars take their own space ---------- */

.inv-table-wrap::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

.inv-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.inv-table-wrap::-webkit-scrollbar-thumb {
  background-color: color-mix(in srgb, var(--text) 28%, transparent);
  border: 4px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.inv-table-wrap::-webkit-scrollbar-thumb:hover {
  background-color: color-mix(in srgb, var(--text) 42%, transparent);
}

.inv-table-wrap::-webkit-scrollbar-corner {
  background: transparent;
}

/* ---------- date field in the table: only the value or the placeholder ---------- */

button.inv-date-text {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

button.inv-date-text:hover {
  background: var(--tab-hover);
}

button.inv-date-text.is-empty {
  color: var(--text-faint);
  letter-spacing: 0.02em;
}

.inv-td-date.tracked button.inv-date-text {
  display: block;
  width: 104px;
  text-align: center;
  line-height: 26px;
  height: 26px;
}

.inv-td-date.tracked button.inv-date-text:hover {
  filter: brightness(0.96);
}

/* ---------- date window ---------- */

.inv-datepop {
  width: 268px;
  padding: 12px;
  z-index: 10001;
}

.inv-datepop-input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
}

.inv-datepop-input.invalid {
  border-color: var(--inv-red);
  box-shadow: 0 0 0 1px var(--inv-red);
}

.inv-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.inv-cal-title {
  font-size: 13px;
  font-weight: 600;
}

.inv-cal-arrow {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.inv-cal-arrow:hover {
  background: var(--tab-hover);
  color: var(--text);
}

.inv-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.inv-cal-dow {
  padding: 4px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
}

.inv-cal-day {
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.inv-cal-day:hover {
  background: var(--tab-hover);
}

.inv-cal-day.today {
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.inv-cal-day.selected {
  background: var(--text);
  color: var(--bg-elevated);
  font-weight: 600;
}

.inv-cal-foot {
  display: flex;
  justify-content: flex-end;
  min-height: 18px;
  margin-top: 6px;
}

.inv-cal-foot:empty {
  display: none;
}

/* ---------- sidebar utilities ---------- */


.inv-export {
  width: min(460px, calc(100vw - 32px));
}

.inv-export .inv-addcol-type {
  cursor: pointer;
}

.inv-export .inv-addcol-type select {
  margin-top: 8px;
  width: 100%;
}

/* ---------- item id and QR ---------- */

.inv-itemid {
  display: inline-block;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--tab-hover);
  color: var(--text);
  font: 12.5px ui-monospace, Menlo, monospace;
  overflow-wrap: anywhere;
  user-select: all;
}

.inv-qr {
  width: min(560px, calc(100vw - 32px));
}

.inv-qr-body {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.inv-qr-preview {
  width: 210px;
  height: 210px;
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.inv-qr-preview svg {
  display: block;
  width: 100%;
  height: 100%;
}

.inv-qr-info {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inv-qr-idrow {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.inv-qr-label {
  width: 52px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.inv-qr-link {
  font-size: 11.5px;
}

.inv-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ---------- scanner ---------- */

.inv-scan {
  width: min(480px, calc(100vw - 32px));
}

.inv-scan-view {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  background: #111;
  overflow: hidden;
}

.inv-scan-view[hidden] {
  display: none;
}

.inv-scan-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inv-scan-frame {
  position: absolute;
  inset: 18%;
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.inv-scan-status {
  min-height: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.inv-scan-problem {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: var(--inv-red-soft);
  color: var(--text);
  font-size: 13.5px;
}

.inv-scan-problem[hidden] {
  display: none;
}

.inv-scan-manual {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.inv-scan-manual .inv-addcol-input {
  flex: 1;
  min-width: 180px;
}


/* ---------- item profile ---------- */

.inv-profile-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.inv-profile-titles {
  flex: 1;
  min-width: 0;
}

.inv-profile-head .inv-detail-title {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
}

.inv-profile-status {
  display: inline-flex;
  margin-top: 2px;
}

.inv-profile-close {
  flex-shrink: 0;
}

.inv-profile-sec {
  padding: 10px 0;
}

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

.inv-pf {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.inv-pf.wide {
  grid-column: 1 / -1;
}

.inv-pf-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.inv-pf-input {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.inv-pf-input:hover {
  border-color: var(--border-strong);
}

.inv-pf-input:focus {
  outline: none;
  border-color: var(--text-muted);
  background: var(--bg-elevated);
}

select.inv-pf-input {
  cursor: pointer;
}

.inv-pf-date {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.inv-pf-date .inv-td-date {
  display: inline-flex;
  flex-shrink: 0;
}

.inv-pf-date .inv-date {
  min-width: 0;
}

.inv-pf-date button.inv-date-text,
.inv-range-date button.inv-date-text {
  height: 26px;
  line-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--bg);
  border: 1px solid var(--border);
  width: 112px;
  text-align: center;
}

.inv-pf-date .inv-td-date.tracked button.inv-date-text {
  border-color: transparent;
}

.inv-pf-datetext {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 0;
}

.inv-profile-sec .inv-detail-inline {
  align-items: center;
}

.inv-profile-sec .inv-detail-inline .inv-itemid {
  flex: 1;
  min-width: 0;
}

.inv-profile-sec .inv-note-text {
  min-height: 56px;
}

/* ---------- item profile: header and Done stay in view ---------- */

.export-modal.inv-detail {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 14px;
}

.inv-detail-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -8px;
  padding: 0 8px;
}

.inv-profile-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-elevated);
  padding-bottom: 2px;
}

.export-modal.inv-detail > .export-modal-actions {
  flex-shrink: 0;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ---------- item profile: summary, dates, fixed row ---------- */

.inv-pf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 10px;
}

.inv-pf-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--bg-muted, var(--bg));
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-pf-chip.on {
  color: var(--text);
}

.inv-profile-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.inv-pf-datecard {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 4px 10px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-width: 0;
}

.inv-pf-datecard .inv-pf-label {
  grid-column: 1 / -1;
}

.inv-pf-datecard .inv-pf-datetext[hidden] {
  display: none;
}

.inv-profile-trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.inv-profile-trio.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inv-pf-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.inv-pf-panel .export-label {
  margin-bottom: 0;
}

.inv-pf-panel .inv-note-text {
  width: 100%;
  box-sizing: border-box;
  min-height: 92px;
  resize: vertical;
}

.inv-pf-panel .inv-detail-inline {
  width: 100%;
  align-items: center;
}

.inv-pf-panel .inv-plan-state {
  align-items: flex-start;
  font-size: 13px;
}

.inv-pf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inv-pf-idline {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
}

.inv-pf-idline .inv-itemid {
  flex: 1;
  min-width: 0;
}

@media (max-width: 640px) {
  .inv-profile-grid,
  .inv-profile-trio,
  .inv-profile-trio.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inv-profile-trio > .inv-pf-panel:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 440px) {
  .inv-profile-grid,
  .inv-profile-dates,
  .inv-profile-trio,
  .inv-profile-trio.two {
    grid-template-columns: minmax(0, 1fr);
  }
}

.inv-pv-edit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inv-pv-edit[hidden] {
  display: none;
}

/* ---------- status pill with a Notes mark ---------- */

.inv-pill-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.inv-pill-note {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #5f6f86;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
  box-shadow: 0 0 0 1.5px var(--bg-elevated);
  cursor: help;
}

/* ---------- the blue Notes "i", same as on the plan markers ---------- */

.inv-note-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  margin-left: 6px;
  border-radius: 50%;
  background: #5f6f86;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
  vertical-align: middle;
  cursor: help;
}

.inv-note-i[hidden] {
  display: none;
}

/* ---------- item profile: photo and attachments row ---------- */

.inv-profile-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.inv-pf-att .inv-detail-sechead {
  width: 100%;
  margin-bottom: 0;
}

.inv-pf-att .inv-file,
.inv-pf-att .inv-hint {
  width: 100%;
  box-sizing: border-box;
}

.inv-photo-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

/* The frame never changes size: the picture is fitted inside it, never stretched. */
.inv-photo-frame {
  flex: none;
  width: 120px;
  height: 90px;
  padding: 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-faint);
  font: inherit;
  cursor: pointer;
}

.inv-photo-frame:hover {
  border-color: var(--text-muted);
}

.inv-photo-frame:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.inv-photo-frame.has-photo {
  background: color-mix(in srgb, var(--text) 6%, var(--bg));
  cursor: zoom-in;
}

.inv-photo-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.inv-photo-img[hidden] {
  display: none;
}

.inv-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.inv-photo-empty-icon svg {
  width: 22px;
  height: 22px;
}

.inv-photo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.inv-photo-actions .inv-btn svg {
  width: 14px;
  height: 14px;
}

.inv-photocap .inv-scan-video {
  object-fit: contain;
}

/* full-size photo */
.inv-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.84);
  cursor: zoom-out;
}

.inv-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.inv-lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.inv-lightbox-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  text-align: center;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
  pointer-events: none;
}

@media (max-width: 640px) {
  .inv-profile-duo {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- press and hold to edit a marker ---------- */

.inv-marker {
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.inv-marker.holding {
  animation: inv-marker-hold 450ms linear forwards;
}

@keyframes inv-marker-hold {
  from {
    box-shadow: 0 0 0 0 rgba(255, 138, 0, 0);
  }
  to {
    box-shadow: 0 0 0 7px rgba(255, 138, 0, 0.5);
  }
}

@media (pointer: coarse) {
  .inv-marker-grip {
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .inv-marker.holding {
    animation: none;
    box-shadow: 0 0 0 5px rgba(255, 138, 0, 0.5);
  }
}

/* ---------- moving rows ---------- */

.inv-rownum-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.inv-rowgrip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-faint);
  cursor: grab;
  opacity: 0;
  touch-action: none;
  transition: opacity 0.12s ease;
}

.inv-rowgrip svg {
  width: 13px;
  height: 13px;
}

.inv-row:hover .inv-rowgrip,
.inv-rowgrip:focus-visible,
.inv-row.selected .inv-rowgrip {
  opacity: 1;
}

.inv-rowgrip:hover {
  color: var(--text);
  background: var(--control-active-bg);
}

.inv-rowgrip.off {
  cursor: not-allowed;
}

.inv-row:hover .inv-rowgrip.off {
  opacity: 0.4;
}

.inv-rowgrip:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

@media (pointer: coarse) {
  .inv-rowgrip {
    opacity: 0.7;
    width: 22px;
  }
}

/* The grabbed row leaves its place; a ghost follows the pointer and a line
   shows where the row will land. */
.inv-row.row-lifted .inv-td {
  opacity: 0.35;
}

body.inv-row-dragging,
body.inv-row-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}

.inv-row-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  max-width: 380px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  pointer-events: none;
}

.inv-row-line {
  position: fixed;
  z-index: 9999;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  pointer-events: none;
}

/* ---------- check mode: scrolling inspect window ---------- */

.inv-pop-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.inv-inspect-formbar {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.inv-inspect-formbar[hidden] {
  display: none;
}

/* ---------- check in progress: banner at the top of Inventory ---------- */

.inv-checkbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 40px 0;
  background: var(--panel-bg);
  flex-shrink: 0;
}

.inv-checkbar[hidden] {
  display: none;
}

.inv-checkcard {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--inv-amber) 45%, var(--border));
  border-radius: 12px;
  background: var(--inv-amber-soft);
}

.inv-checkcard-dot {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--inv-amber);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--inv-amber) 55%, transparent);
  animation: inv-check-pulse 2s ease-out infinite;
}

@keyframes inv-check-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--inv-amber) 55%, transparent);
  }
  70%,
  100% {
    box-shadow: 0 0 0 8px transparent;
  }
}

.inv-checkcard-text {
  flex: 1 1 220px;
  min-width: 0;
}

.inv-checkcard-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 13.5px;
  color: var(--text);
}

.inv-checkcard-scope {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.inv-checkcard-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.inv-checkcard-prog {
  flex: 0 1 190px;
  min-width: 130px;
}

.inv-checkcard-count {
  margin-bottom: 4px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.inv-checkcard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inv-checkcard-more {
  font-size: 12px;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .inv-checkcard-dot {
    animation: none;
  }
}

/* ---------- Soft ink inventory chrome (light theme). Fonts unchanged. ---------- */

:root[data-theme="light"] {
  --inv-red-soft: #f8ece8;
  --inv-green-soft: #e7f3ed;
  --inv-amber-soft: #f6f0e6;
}

:root[data-theme="light"] .inv-pill {
  height: 28px;
  background: #f3f0eb;
  border: none;
}

:root[data-theme="light"] .inv-pill.expired {
  background: #f8ece8;
  color: #b5523e;
}

:root[data-theme="light"] .inv-table-wrap {
  border-radius: 14px;
  border-color: rgba(28, 27, 25, 0.08);
  background: transparent;
}

:root[data-theme="light"] .sidebar .inv-attn-dot.expired {
  background: #e07a68;
}

:root[data-theme="light"] .sidebar .inv-loc-toggle {
  color: #c9c6c0;
}

:root[data-theme="light"] .sidebar .inv-loc-toggle.off {
  color: #7d838b;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --inv-red-soft: #f8ece8;
    --inv-green-soft: #e7f3ed;
    --inv-amber-soft: #f6f0e6;
  }
  :root:not([data-theme="dark"]) .inv-pill {
    height: 28px;
    background: #f3f0eb;
    border: none;
  }
  :root:not([data-theme="dark"]) .inv-pill.expired {
    background: #f8ece8;
    color: #b5523e;
  }
  :root:not([data-theme="dark"]) .inv-table-wrap {
    border-radius: 14px;
    border-color: rgba(28, 27, 25, 0.08);
    background: transparent;
  }
  :root:not([data-theme="dark"]) .sidebar .inv-attn-dot.expired {
    background: #e07a68;
  }
  :root:not([data-theme="dark"]) .sidebar .inv-loc-toggle {
    color: #c9c6c0;
  }
  :root:not([data-theme="dark"]) .sidebar .inv-loc-toggle.off {
    color: #7d838b;
  }
}

/* Plan header: the Show/Hide markers switch wraps under the title when the window is narrow */
.main-header-controls-row:has(.inv-marker-switch) {
  flex-wrap: wrap;
  row-gap: 8px;
}

.inv-marker-switch {
  margin-left: 2px;
}

/* ---------- category page: dashboard + toolbar now sit in the scrolling area ---------- */

/* Category controls: the Items line with the actions on the right, search and filters below */
.inv-cat-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "head actions"
    "bar bar";
  align-items: center;
  gap: 10px 12px;
  margin-bottom: 12px;
}

.inv-cat-items-head {
  grid-area: head;
  margin: 0;
}

.inv-cat-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 8px;
}

.inv-cat-toolbar {
  grid-area: bar;
  margin: 0;
}

.inv-cat-toolbar .inv-search {
  flex: 0 1 200px;
  width: 200px;
  min-width: 0;
}

/* Category dashboard when it sits in the page header, right of the title */
.main-header-controls-row:has(.inv-zone-compact) {
  flex-wrap: wrap;
  row-gap: 8px;
}

.main-header-controls-row:has(.inv-hdr-spacer) .inv-more {
  margin-left: 0 !important;
}

/* name, then its dashboard, then flexible space, then the controls on the right */
.inv-hdr-spacer {
  flex: 1 1 0;
  min-width: 0;
}

.inv-zone-compact {
  margin: 0 0 0 28px;
  min-width: 0;
}

.inv-zone-compact .inv-zone-head {
  margin-bottom: 4px;
}

.inv-zone-compact .inv-zone-scope {
  display: none;
}

.inv-zone-compact .inv-dash-value {
  font-size: 26px;
}

.inv-zone-compact .inv-dash-stat {
  padding: 0 18px;
}

.inv-zone-compact .inv-dash-stat:first-child {
  padding-left: 0;
}

.inv-zone-compact .inv-dash-stat:last-child {
  padding-right: 0;
}

.inv-table-host .inv-table-wrap {
  /* the list reaches down to the same distance from the sheet's bottom edge as it has from its left edge (28px) */
  max-height: calc(100vh - var(--yw-bn, 0px) - 243px);
}

/* ---------- group items table: fixed columns, filtering only changes the rows ---------- */

@media (min-width: 761px) {
  .inv-overview-table {
    table-layout: fixed;
    width: 100%;
    min-width: 960px;
  }

  .inv-overview-table th:nth-child(1) { width: 52px; }
  .inv-overview-table th:nth-child(2) { width: 150px; }
  .inv-overview-table th:nth-child(3) { width: 96px; }
  .inv-overview-table th:nth-child(4) { width: 210px; }
  .inv-overview-table th:nth-child(6) { width: 200px; }
  .inv-overview-table th:nth-child(7) { width: 12px; }

  .inv-overview-table .inv-td-text:not(.inv-td-main) {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .inv-overview-table .inv-td-main {
    min-width: 0;
  }
}

.inv-cat-items-head {
  min-height: 22px;
}

/* Header: [ name: the whole row, one line, cut with … ] [ plan switch ] [ menu ]. The dashboard is not in the header any more: it sits on the Items line below,
   so the name only has to stop before the plan switch (with a gap). */
@media (min-width: 761px) {
  .main-header-controls-row:has(.inv-hdr-spacer) {
    flex-wrap: nowrap;
    min-height: 40px;
    margin-top: 8px;
    align-items: center;
  }

  .main-header-controls-row .inv-hdr-spacer {
    display: none;
  }

  .main-header .main-header-controls-row:has(.inv-hdr-spacer) .tab-title-display {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    margin-right: 28px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    white-space: nowrap;
  }

  .main-header .main-header-controls-row:has(.inv-hdr-spacer) .tab-title-display.editing {
    display: block;
  }

  .inv-hdr-spacer {
    display: none;
  }

  /* room for a two-line name, so a long name never changes the header's height either */
  .main-header-controls-row:has(.inv-zone-compact) {
    min-height: 66px;
  }

  .main-header-controls-row:has(.inv-hdr-spacer) .inv-zone-compact {
    flex: 0 0 auto;
    margin: 0 24px;
  }

  .inv-zone-compact .inv-dash-stat {
    padding: 0 13px;
  }
}

/* not enough room beside the name: the dashboard takes its own line under it */
@media (min-width: 761px) and (max-width: 1180px) {
  .main-header-controls-row:has(.inv-hdr-spacer) {
    flex-wrap: wrap;
  }

  .main-header-controls-row:has(.inv-hdr-spacer) .inv-zone-compact {
    order: 5;
    flex: 1 0 100%;
    margin: 6px 0 0;
  }

  .inv-zone-compact .inv-dash-stat:first-child {
    padding-left: 0;
  }
}

/* ---------- Add column | Add row: one pill, two sections ---------- */

.inv-split-btn {
  display: inline-flex;
  align-items: stretch;
  height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.inv-split-part {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s;
}

.inv-split-part + .inv-split-part {
  border-left: 1px solid var(--border-strong);
}

.inv-split-part:hover {
  background: var(--tab-hover);
}

.inv-split-part:focus-visible {
  outline: none;
  background: var(--tab-hover);
  box-shadow: inset 0 0 0 1px var(--text-muted);
}

/* ---------- tighter category and group pages ---------- */

.inv-scroll:has(.inv-cat-controls),
.inv-scroll:has(.inv-results) {
  padding-top: 12px;
}

.inv-cat-controls {
  gap: 8px 12px;
  margin-bottom: 10px;
}

/* Plan location: the pin alone is the whole control (solid = linked, faint = not linked) */
button.inv-plan-cell {
  min-width: 36px;
  justify-content: center;
}

.inv-plan-cell .inv-plan svg {
  width: 16px;
  height: 16px;
}

/* Group marker popup: the number of items, stated on its own line */
.inv-pop-total {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 14px 0; /* same left edge as the title and the search box */
  font-size: 14px;
  color: var(--text-muted);
}

.inv-pop-total-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ---------- the dashboard on the Items line (wide windows) ---------- */

.inv-results-head,
.inv-cat-items-head {
  flex-wrap: wrap;
  row-gap: 8px;
}

.inv-results-head .inv-zone-compact {
  margin: 0 0 0 26px;
  align-self: center;
}

.inv-results-head .inv-zone-compact .inv-zone-head {
  margin-bottom: 2px;
}

.inv-results-head .inv-zone-compact .export-label {
  font-size: 10px;
  letter-spacing: 0.08em;
}

.inv-results-head .inv-zone-compact .inv-dash-value {
  font-size: 20px;
}

.inv-results-head .inv-zone-compact .inv-dash-label {
  font-size: 11.5px;
}

.inv-results-head .inv-zone-compact .inv-dash-stat {
  padding: 0 14px;
}

.inv-results-head .inv-zone-compact .inv-dash-stat:first-child {
  padding-left: 0;
}


/* ====================================================================================================
   Inventory, Soft surface (approved design): the header and its controls are one quiet surface that sits a little above the table.
   Text and thin line icons only: no pills, boxes or filled buttons; hovering changes colour only. Same look for categories and groups.
   ==================================================================================================== */

.module-root {
  --inv-tone-base: var(--tab-hover);
  --inv-soft-bg: var(--toolbar-bg);
  --inv-soft-shadow: none;
}

:root[data-theme="dark"] .module-root {
  --inv-tone-base: #252523;
  --inv-soft-shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .module-root {
    --inv-tone-base: #252523;
    --inv-soft-shadow: none;
  }
}

.module-root .main-header.inv-soft {
  gap: 0;
  padding-top: 14px;
  padding-right: 28px;
  padding-bottom: 0;
  padding-left: 28px;
  background: var(--inv-soft-bg);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: var(--inv-soft-shadow);
  position: relative;
  z-index: 3;
}

/* the line above the name: the breadcrumb of a category, the module name above a group */
.module-root .main-header.inv-soft > .inv-crumb {
  position: static;
  height: auto;
  margin: 0;
  overflow: visible;
  min-height: 0;
  padding: 0;
  font-size: 12.5px;
  line-height: 18px;
  white-space: nowrap;
}

.module-root .main-header.inv-soft .main-header-controls-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  min-height: 29px;
  margin: 12px 0 4.5px;
}

.module-root .main-header.inv-soft .main-header-controls-row .tab-title-display {
  display: block;
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  margin: 0 0 0 -5px;
  padding: 0 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 24px;
  line-height: 29px;
}

.module-root .main-header.inv-soft .main-header-controls-row .tab-title-display.editing {
  display: block;
}

.module-root .inv-hdr-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: none;
  margin-left: auto;
}

.module-root .inv-hdr-right .inv-more,
.module-root .inv-hdr-right .inv-print {
  margin-left: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.module-root .inv-more,
.module-root .inv-print {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-faint);
}

.module-root .inv-more:hover,
.module-root .inv-print:hover,
.module-root .inv-print[aria-expanded="true"] {
  background: transparent;
  color: var(--text);
}

/* the print icon in a view that has no list to print: it stays in its place, greyed, so nothing next to it moves */
.module-root .inv-print.is-off,
.module-root .inv-print.is-off:hover {
  color: var(--text-faint);
  opacity: 0.45;
  cursor: default;
}

/* ---------- Show on Plan: a pin, the words and a small switch (green when on); "Hidden from Plan" beside it when off ---------- */

.module-root .inv-plan-sw {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.12s;
}

.module-root .inv-plan-sw:hover {
  background: transparent;
  color: var(--text);
}

.module-root .inv-plan-sw-pin {
  display: inline-flex;
  width: 15px;
  height: 15px;
}

.module-root .inv-plan-sw-pin svg {
  width: 15px;
  height: 15px;
}

.module-root .inv-plan-sw-trk {
  position: relative;
  flex: none;
  width: 30px;
  height: 17px;
  border-radius: 9px;
  border: 1.4px solid var(--text-faint);
  background: color-mix(in srgb, var(--text-faint) 28%, transparent);
  transition: background 0.14s, border-color 0.14s;
}

.module-root .inv-plan-sw-trk::after {
  content: "";
  position: absolute;
  top: 2.5px;
  left: 2.5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform 0.14s, background 0.14s;
}

.module-root .inv-plan-sw.on .inv-plan-sw-trk {
  background: var(--success);
  border-color: var(--success);
}

.module-root .inv-plan-sw.on .inv-plan-sw-trk::after {
  transform: translateX(13px);
  background: var(--accent-contrast);
}

@media (prefers-reduced-motion: reduce) {
  .module-root .inv-plan-sw-trk,
  .module-root .inv-plan-sw-trk::after {
    transition: none;
  }
}

/* ---------- Inventory / Plan tabs of a group: two words with an underline ---------- */

.module-root .inv-hdr-right .inv-tabs {
  display: flex;
  gap: 2px;
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.module-root .inv-hdr-right .inv-tabs button,
.module-root .inv-marker-switch button {
  height: auto;
  padding: 3px 10px 5px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-faint);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  transition: color 0.12s;
}

/* the chosen tab is bolder; the bold text is also laid out, unseen, in the other one, so a tab is always as wide as its bold word and the controls beside it never shift */
.module-root .inv-hdr-right .inv-tabs button,
.module-root .inv-hdr-right .inv-tabs button.active {
  margin: 0; /* the generic active tab of the calendar switch is pulled 2 px outwards, which would shift both words */
  display: inline-flex;
  flex: none;
  flex-direction: column;
  align-items: center;
}

.module-root .inv-hdr-right .inv-tabs button::after {
  content: attr(data-label);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 650;
  pointer-events: none;
}

.module-root .inv-hdr-right .inv-tabs button:hover,
.module-root .inv-marker-switch button:hover {
  background: transparent;
  color: var(--text);
}

.module-root .inv-hdr-right .inv-tabs button.active,
.module-root .inv-marker-switch button.active {
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-weight: 650;
  border-bottom-color: var(--text);
}

/* ---------- the band: figures as filters, the actions, the search and the filters ---------- */

.module-root .inv-band {
  display: block;
}

.module-root .inv-band-row {
  display: flex;
  align-items: flex-end;
  gap: 8px 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.module-root .inv-seg {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0 30px;
}

.module-root .inv-seg-btn {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 7px 0 10px;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-faint);
  font: inherit;
  font-size: 15.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.12s;
}

.module-root .inv-seg-btn:hover {
  color: var(--text);
}

.module-root .inv-seg-btn.on {
  color: var(--text);
  font-weight: 650;
  border-bottom-color: var(--text);
}

.module-root .inv-seg-n {
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.module-root .inv-seg-btn.expired .inv-seg-n {
  color: var(--inv-red);
}

.module-root .inv-seg-btn.soon .inv-seg-n {
  color: var(--inv-amber);
}

.module-root .inv-band-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  padding-bottom: 10px;
}

/* On a computer the actions of the toolbar (Add row, New category, Decks on this plan...) end where the printer icon above them ends, not under the menu button and the account
   circle: the right edge is set back by the menu button, the gap before it and, on the hosted site, the room the account circle needs (--inv-more-clear, see hosted-adapter.js). */
@media (min-width: 761px) {
  .module-root {
    --inv-more-w: 28px;
    --inv-hdr-gap: 16px;
  }

  .module-root .inv-band-actions {
    margin-right: calc(var(--inv-more-w) + var(--inv-hdr-gap) + var(--inv-more-clear, 0px));
  }
}

.module-root .inv-act {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.12s;
}

.module-root .inv-act:hover {
  background: transparent;
  color: var(--text);
}

.module-root .inv-act svg {
  width: 15px;
  height: 15px;
}

.module-root .inv-band-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 12px 0;
}

.module-root .inv-band-bar .inv-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  min-width: 56px;
}

.module-root .inv-band-bar .inv-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
}

.module-root .inv-band-bar .inv-search,
.module-root .inv-cat-toolbar .inv-search {
  display: flex;
  align-items: center;
  gap: 9px;
  height: auto;
  width: 240px;
  min-width: 0;
  flex: 0 1 240px;
  padding: 3px 0;
  border: none;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
  color: var(--text-faint);
}

.module-root .inv-band-bar .inv-search:focus-within {
  border-bottom-color: var(--text);
  color: var(--text);
}

.module-root .inv-band-bar .inv-search-input {
  font-size: 14px;
}

.module-root .inv-band-bar .inv-search-input::placeholder {
  color: var(--text-faint);
}

/* the filters are plain words with a small arrow */
.module-root .inv-band-bar .inv-filter-cap {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  height: auto;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.module-root .inv-band-bar .inv-fsel {
  position: relative;
  flex: none;
  width: auto;
  border-radius: 0;
  background: transparent;
}

.module-root .inv-band-bar .inv-fsel::before {
  display: none;
}

.module-root .inv-band-bar .inv-fsel::after {
  right: 0;
  width: 11px;
  height: 11px;
  margin-top: -5px;
}

.module-root .inv-band-bar .inv-fsel:hover,
.module-root .inv-band-bar .inv-fsel:has(select:focus-visible),
.module-root .inv-band-bar .inv-fsel:has(option:checked:not(:first-child)) {
  background: transparent;
  box-shadow: none;
}

.module-root .inv-band-bar .inv-fsel .inv-select {
  width: auto;
  padding: 0 17px 0 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  transition: color 0.12s;
}

.module-root .inv-band-bar .inv-fsel:hover .inv-select,
.module-root .inv-band-bar .inv-fsel:has(option:checked:not(:first-child)) .inv-select {
  color: var(--text);
}

.module-root .inv-band-bar .inv-fsel-dot {
  display: none !important;
}

.module-root .inv-band-bar .inv-link-btn {
  color: var(--text-faint);
  font-size: 13px;
}

/* ---------- Expiring within (group): written like the tabs ---------- */

.module-root .inv-band > .inv-range {
  align-items: baseline;
  gap: 0 16px;
  margin: 2.5px 0 0;
  padding: 0;
  border-bottom: 1px solid var(--border);
}

.module-root .inv-band .inv-range-label {
  padding-bottom: 7px;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 400;
}

.module-root .inv-band .inv-range-switch {
  display: flex;
  gap: 2px;
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.module-root .inv-band .inv-range-switch button {
  height: auto;
  padding: 3px 10px 7px;
  margin-bottom: -1px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-faint);
  font: inherit;
  font-size: 13.5px;
  font-weight: 400;
  transition: color 0.12s;
}

.module-root .inv-band .inv-range-switch button:hover {
  background: transparent;
  color: var(--text);
}

.module-root .inv-band .inv-range-switch button.active {
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-weight: 650;
  border-bottom-color: var(--text);
}

.module-root .inv-band .inv-range-text {
  padding-bottom: 7px;
  font-size: 13px;
}

/* the Plan tab's toolbar */
.module-root .inv-band-plan .inv-band-row {
  padding-top: 6px;
  align-items: flex-end;
}

.module-root .inv-band-plan .inv-marker-switch {
  display: flex;
  margin: 0;
  padding: 0;
  gap: 24px;
  border: none;
  border-radius: 0;
  background: transparent;
  height: auto;
}

.module-root .inv-band-plan .inv-marker-switch button {
  padding: 7px 0 10px;
  margin-bottom: -1px;
  font-size: 15.5px;
}

.module-root .inv-plan-file {
  padding-bottom: 10px;
  color: var(--text-faint);
  font-size: 12.5px;
}

.module-root .inv-band-plan {
  padding-bottom: 12px;
}

/* ---------- the page under the header ---------- */

.module-root .inv-scroll {
  padding: 0 28px 28px;
  background: var(--bg-elevated);
}

.module-root .inv-scroll:has(> .inv-table-host),
.module-root .inv-scroll:has(> .inv-results) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.module-root .inv-table-host,
.module-root .inv-results,
.module-root .inv-list-host {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.module-root .inv-table-host .inv-table-wrap,
.module-root .inv-list-host .inv-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  border: none;
  border-radius: 0;
  background: transparent;
}

.module-root .inv-table-host,
.module-root .inv-results {
  padding-top: 0;
}

/* headings of the table: small capitals, no dividers, no boxes on hover */
.module-root .inv-th {
  height: 36px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-faint);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.module-root .inv-th-label:hover {
  background: transparent;
  color: var(--text);
}

.module-root .inv-th-menu:hover,
.module-root .inv-add-col:hover,
.module-root .inv-row-btn:hover {
  background: transparent;
  color: var(--text);
}

.module-root .inv-add-col {
  border-radius: 0;
}

/* dates: coloured text with a small dot, no filled pills */
.module-root .inv-due {
  position: relative;
  padding: 0 0 0 13px;
  border-radius: 0;
  background: transparent;
  font-weight: 400;
}

.module-root .inv-due::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: currentColor;
}

.module-root .inv-due.status-expired,
.module-root .inv-due.status-soon,
.module-root .inv-due.status-ok {
  background: transparent;
}

.module-root .inv-td-date.tracked {
  position: relative;
}

.module-root .inv-td-date.tracked::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--border-strong);
  pointer-events: none;
}

.module-root .inv-td-date.tracked.status-expired::before {
  background: var(--inv-red);
}

.module-root .inv-td-date.tracked.status-soon::before {
  background: var(--inv-amber);
}

.module-root .inv-td-date.tracked.status-ok::before {
  background: var(--inv-green);
}

.module-root .inv-td-date.tracked .inv-input,
.module-root .inv-td-date.tracked.status-expired .inv-input,
.module-root .inv-td-date.tracked.status-soon .inv-input,
.module-root .inv-td-date.tracked.status-ok .inv-input {
  display: block;
  width: 100%;
  max-width: none;
  height: 36px;
  margin: 0;
  padding: 0 10px 0 24px;
  border-radius: 0;
  background: transparent;
  font-weight: 400;
  text-align: left;
}

.module-root .inv-td-date.tracked .inv-input:focus {
  box-shadow: inset 0 -1.5px 0 currentColor;
  border-radius: 0;
}

/* the plan page: the empty state's action is a plain text action, and an empty toolbar draws nothing */
.module-root .inv-band-plan .inv-band-row:empty {
  display: none;
}

.module-root .inv-plan-empty .inv-btn,
.module-root .inv-plan-empty .inv-btn-primary,
.module-root .inv-empty .inv-btn-primary {
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  opacity: 1;
}

.module-root .inv-plan-empty .inv-btn:hover,
.module-root .inv-empty .inv-btn-primary:hover {
  background: transparent;
  color: var(--text-muted);
  opacity: 1;
}

/* menu closed: the header leaves room for the button that opens it; the band keeps lining up with the table */
.module-root.side-collapsed .main-header.inv-soft {
  padding-left: 62px;
}

.module-root.side-collapsed .main-header.inv-soft > .inv-band {
  margin-left: -34px;
}

/* the group's list is no longer a box of its own */
.module-root .inv-results {
  gap: 0;
  padding: 0;
  border: none;
  border-radius: 0;
}

.module-root .inv-fsel .inv-select {
  field-sizing: content;
}

.module-root .inv-more-btn {
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
}

.module-root .inv-more-btn:hover {
  background: transparent;
  color: var(--text);
}

/* on a phone the page itself scrolls, header band included */
@media (max-width: 760px) {
  .module-root .main-header.inv-soft {
    padding: 8px 14px 0 62px;
    box-shadow: none;
  }

  .module-root .inv-scroll,
  .module-root .inv-scroll:has(> .inv-table-host),
  .module-root .inv-scroll:has(> .inv-results) {
    display: block;
    overflow: auto;
    padding: 0 14px 80px;
  }

  .module-root .inv-band.in-scroll {
    margin: 0 -14px 6px;
    padding: 0 14px;
    background: var(--inv-soft-bg);
    border-bottom: 1px solid var(--border-strong);
    box-shadow: var(--inv-soft-shadow);
  }

  .module-root .inv-table-host,
  .module-root .inv-results,
  .module-root .inv-list-host {
    display: block;
  }

  .module-root .inv-table-host .inv-table-wrap,
  .module-root .inv-list-host .inv-table-wrap {
    max-height: none;
  }

  .module-root .main-header.inv-soft .main-header-controls-row {
    flex-wrap: wrap;
    margin: 6px 0 6px;
  }

  .module-root .inv-hdr-right {
    gap: 10px;
  }

  .module-root .inv-seg {
    gap: 0 18px;
  }

  .module-root .inv-seg-btn {
    font-size: 14px;
  }

  .module-root .inv-seg-n {
    font-size: 13.5px;
  }

  .module-root .inv-band-actions {
    margin-left: 0;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 10px 0 2px;
    width: 100%;
  }

  .module-root .inv-band-row {
    border-bottom: none;
  }

  .module-root .inv-band .inv-range-switch {
    flex-wrap: wrap;
    justify-content: flex-start;
    width: auto;
    max-width: 100%;
    margin: 0;
  }

  .module-root .inv-band .inv-range-switch button,
  .module-root .inv-band .inv-range-switch button.active {
    padding: 3px 7px 7px;
    flex: 0 0 auto;
    font-size: 12.5px;
  }

  .module-root .inv-band > .inv-range {
    gap: 0 6px;
  }

  .module-root .inv-seg-btn {
    font-size: 13.5px;
    gap: 6px;
  }

  .module-root .inv-seg {
    gap: 0 14px;
  }

  .module-root .main-header.inv-soft .main-header-controls-row .tab-title-display {
    white-space: normal;
    overflow: visible;
    line-height: 1.2;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  /* group items: lines, not cards */
  .module-root .inv-overview-table .inv-row-link {
    margin: 0;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .module-root .inv-band-row > .inv-seg {
    width: 100%;
    border-bottom: 1px solid var(--border);
  }

  /* the name and the menu share the first line; the Inventory | Plan tabs take the second */
  .module-root .inv-hdr-right {
    display: contents;
  }

  .module-root .main-header.inv-soft .main-header-controls-row .tab-title-display {
    order: 1;
    flex: 1 1 0;
    font-size: 22px;
  }

  .module-root .main-header.inv-soft .main-header-controls-row .inv-more,
  .module-root .main-header.inv-soft .main-header-controls-row .inv-print {
    order: 2;
    margin: 0;
  }

  .module-root .main-header.inv-soft .main-header-controls-row .inv-tabs {
    order: 3;
    flex: 1 0 100%;
  }

  /* the Show on Plan switch takes the row under the tabs, in both views */
  .module-root .main-header.inv-soft .main-header-controls-row .inv-plan-sw {
    order: 4;
    flex: 1 0 100%;
    padding: 2px 0 4px;
  }

  .module-root .inv-toolbar .inv-filter-toggle {
    height: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
  }

  .module-root .inv-toolbar .inv-filter-toggle.on {
    color: var(--text);
  }

  /* items are lines, not cards: a hairline between them, no box, no grey fields */
  .module-root .inv-table .inv-row {
    margin: 0;
    padding: 12px 0 12px;
    border: none;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
  }

  .module-root .inv-table-fixed .inv-td:not(.inv-col-primary) .inv-input {
    padding-left: 2px;
    border-radius: 0;
    background: transparent;
  }

  .module-root .inv-table-fixed .inv-td-date.tracked .inv-input {
    padding-left: 18px;
  }

  .module-root .inv-table-fixed .inv-td-date.tracked::before {
    left: 2px;
    top: auto;
    bottom: 14px;
    margin-top: 0;
  }

  .module-root .inv-band-bar .inv-search,
  .module-root .inv-cat-toolbar .inv-search {
    flex: 1 1 100%;
    width: auto;
  }
}

/* ====================================================================================================
   Inventory windows, Quiet: every Inventory window and pop-up takes the Workspace windows' look (style.css, ".yw-win").
   A small title with a cross in the corner (no Cancel / Close / Done), small-capital captions, fields that are a line to write on,
   plain text actions (the main one bold), plain option rows, square tick boxes. No pills, boxes or filled buttons.
   ==================================================================================================== */

/* the frame: the window classes keep their own widths (the shared .yw-win rule would set one width for all) */
.export-modal.yw-win.inv-addcol,
.export-modal.yw-win.inv-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  padding: 22px 24px 18px;
  border-radius: 16px;
}

.export-modal.yw-win.inv-detail {
  width: min(760px, calc(100vw - 32px));
  gap: 0;
  padding-bottom: 16px;
}

.export-modal.yw-win.inv-pick,
.export-modal.yw-win.deck-editor,
.export-modal.yw-win.inv-export {
  width: min(460px, calc(100vw - 32px));
}

.export-modal.yw-win.inv-history,
.export-modal.yw-win.inv-viewitems,
.export-modal.yw-win.inv-scan {
  width: min(480px, calc(100vw - 32px));
}

.export-modal.yw-win.inv-scope {
  width: min(440px, calc(100vw - 32px));
}

.export-modal.yw-win.inv-qr {
  width: min(560px, calc(100vw - 32px));
}

.yw-win .inv-addcol-title {
  margin: 0 0 2px;
  font-size: 17px;
}

.yw-win .inv-hint,
.yw-win .inv-remove-name {
  color: var(--text-faint);
  font-size: 13.5px;
  font-weight: 400;
}

.yw-win .inv-remove-name {
  color: var(--text);
  font-weight: 600;
}

/* captions */
.yw-win .export-label,
.yw-win .inv-pf-label {
  margin: 0;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.yw-win .inv-detail-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--text-faint);
}

/* fields: a line to write on */
.yw-win .inv-addcol-input,
.yw-win .inv-pf-input,
.yw-win .inv-pop-input,
.yw-win .inv-note-text,
.yw-win .inv-select,
.yw-win .inv-input,
.yw-win .inv-detail-input {
  height: auto;
  min-height: 0;
  padding: 4px 2px 6px;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 13.5px;
}

.yw-win textarea.inv-note-text {
  padding: 6px 2px;
  line-height: 1.5;
  resize: none;
}

.yw-win .inv-addcol-input:hover,
.yw-win .inv-pf-input:hover,
.yw-win .inv-pop-input:hover,
.yw-win .inv-note-text:hover {
  border-bottom-color: var(--text-faint);
  background: transparent;
}

.yw-win .inv-addcol-input:focus,
.yw-win .inv-pf-input:focus,
.yw-win .inv-pop-input:focus,
.yw-win .inv-note-text:focus,
.yw-win .inv-select:focus,
.yw-win .inv-input:focus {
  outline: none;
  border-bottom-color: var(--text);
  background: transparent;
}

.yw-win select.inv-pf-input,
.yw-win select.inv-select,
.yw-win select.inv-input {
  max-width: 100%;
  padding-right: 20px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8680' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") right 0 center / 14px no-repeat;
}

/* option rows (column type, what the marker stands for, what to remove, which item) */
.yw-win .inv-addcol-types,
.yw-win .inv-pick-list {
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.yw-win .inv-addcol-type,
.yw-win .inv-remove-opt,
.yw-win .inv-pick-item {
  gap: 2px;
  padding: 8px 0 8px 12px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
}

.yw-win .inv-addcol-type:hover:not(:disabled),
.yw-win .inv-remove-opt:hover,
.yw-win .inv-pick-item:hover {
  background: transparent;
  color: var(--text);
}

.yw-win .inv-addcol-type.selected,
.yw-win .inv-pick-item.selected {
  border: 0;
  border-left: 2px solid var(--text);
  background: transparent;
  box-shadow: none;
  color: var(--text);
}

.yw-win .inv-addcol-type-name,
.yw-win .inv-pick-main {
  font-size: 13.5px;
  font-weight: 600;
}

.yw-win .inv-addcol-type-hint,
.yw-win .inv-pick-sub {
  font-size: 12.5px;
  color: var(--text-faint);
}

.yw-win .inv-remove-opt.danger,
.yw-win .inv-remove-opt.danger:hover {
  background: transparent;
}

.yw-win .inv-addcol-track {
  gap: 8px;
}

/* actions: plain words, the main one bold */
.yw-win .export-modal-actions {
  justify-content: flex-end;
  align-items: center;
  gap: 22px;
  margin-top: 8px;
  padding: 0;
  border: 0;
}

.yw-win .export-cancel-btn,
.yw-win .export-confirm-btn,
.yw-win .inv-btn,
.yw-win .inv-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: auto;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.yw-win .export-confirm-btn,
.yw-win .inv-btn-primary {
  color: var(--text);
  font-weight: 650;
}

.yw-win .export-cancel-btn:hover,
.yw-win .export-confirm-btn:hover:not(:disabled),
.yw-win .inv-btn:hover,
.yw-win .inv-btn-primary:hover {
  background: transparent !important;
  color: var(--text) !important;
  opacity: 1;
}

.yw-win .inv-btn.danger,
.yw-win .inv-btn.danger:hover {
  color: var(--danger) !important;
}

.yw-win .export-confirm-btn:disabled,
.yw-win .inv-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.yw-win .inv-btn svg {
  width: 16px;
  height: 16px;
}

/* status words: colour and a dot, no pill (the doubled class outranks the theme rules that tint the pill) */
.yw-win .inv-due.inv-due,
.yw-win .inv-pill.inv-pill {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12.5px;
  font-weight: 600;
}

.yw-win .inv-pill.inv-pill.expired,
.yw-win .inv-pill.inv-pill.soon,
.yw-win .inv-pill.inv-pill.ok,
.yw-win .inv-due.inv-due.status-expired,
.yw-win .inv-due.inv-due.status-soon,
.yw-win .inv-due.inv-due.status-ok {
  background: transparent;
}

.yw-win .inv-due::before,
.yw-win .inv-pill.expired::before,
.yw-win .inv-pill.soon::before,
.yw-win .inv-pill.ok::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  vertical-align: 1px;
}

/* a date in the profile is a line to write on, its state told by the colour of the figures */
.yw-win :is(.inv-pf-date, .inv-pf-datecard) button.inv-date-text,
.yw-win .inv-range-date button.inv-date-text,
.yw-win :is(.inv-pf-date, .inv-pf-datecard) .inv-td-date.tracked .inv-input,
.yw-win :is(.inv-pf-date, .inv-pf-datecard) .inv-td-date.tracked.status-expired .inv-input,
.yw-win :is(.inv-pf-date, .inv-pf-datecard) .inv-td-date.tracked.status-soon .inv-input,
.yw-win :is(.inv-pf-date, .inv-pf-datecard) .inv-td-date.tracked.status-ok .inv-input,
.yw-win :is(.inv-pf-date, .inv-pf-datecard) .inv-td-date.tracked button.inv-date-text {
  width: 112px;
  height: auto;
  padding: 4px 2px 6px;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13.5px;
  line-height: 1.4;
  text-align: left;
}

.yw-win :is(.inv-pf-date, .inv-pf-datecard) button.inv-date-text:hover {
  background: transparent;
  border-bottom-color: var(--text-faint);
  filter: none;
}

/* the item's facts as plain words */
.yw-win .inv-pf-chips {
  gap: 4px 14px;
}

.yw-win .inv-pf-chip {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-faint);
  font-size: 12.5px;
}

.yw-win .inv-pf-chip.on {
  color: var(--text-muted);
}

.yw-win .inv-pf-datecard {
  padding: 0;
  border: 0;
  border-radius: 0;
}

.yw-win .inv-itemid {
  padding: 2px 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.yw-win .inv-detail-section,
.yw-win .inv-profile-trio {
  border-top: 1px solid var(--border);
}

/* the profile: the cross is the window's own; the body scrolls under the title */
.export-modal.yw-win.inv-detail > .export-modal-actions {
  display: none;
}

.yw-win .inv-profile-head {
  padding-right: 34px;
}

.yw-win .inv-profile-head .inv-detail-title {
  margin: 2px 0 8px;
  font-size: 17px;
}

.yw-win .inv-profile-status {
  flex-shrink: 0;
  margin-top: 4px;
}

/* the check windows' summary and history */
.yw-win .inv-sum-cell,
.yw-win .inv-history-item {
  border-radius: 0;
}

/* pop-ups next to a marker or a cell take the same look */
.inv-pop.yw-win {
  position: fixed;
  width: min(364px, calc(100vw - 16px));
  border: 0;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  font-size: 13.5px;
}

.inv-pop.yw-win .inv-pop-head {
  padding: 18px 44px 8px 20px;
  border-bottom: 0;
}

.inv-pop.yw-win .inv-pop-cat {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.inv-pop.yw-win .inv-pop-title {
  margin-top: 2px;
  font-size: 15.5px;
  font-weight: 700;
}

.inv-pop.yw-win .inv-pop-close {
  right: 12px;
  top: 14px;
}

.inv-pop.yw-win .inv-pop-rows {
  padding: 4px 20px 8px;
}

.inv-pop.yw-win .inv-pop-foot {
  gap: 4px 22px;
  padding: 8px 20px 14px;
  border-top: 0;
}

.inv-pop.yw-win .inv-pop-note {
  padding: 0 20px 14px;
}

.inv-pop.yw-win .inv-notes-body {
  padding: 4px 20px 0;
}

.inv-pop.yw-win .inv-notes-foot {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 10px 20px 16px;
  border-top: 0;
}

.inv-pop.yw-win .inv-pop-scroll {
  padding-left: 20px;
  padding-right: 20px;
}

.inv-pop.yw-win .inv-inspect-actions {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.inv-pop.yw-win .inv-inspect-formrow {
  padding: 8px 20px 14px;
  gap: 22px;
  border-top: 0;
}

/* the camera's problem message is plain words with a red edge, not a pink box */
.yw-win .inv-scan-problem {
  padding: 0 0 0 12px;
  border-left: 2px solid var(--danger);
  border-radius: 0;
  background: transparent;
}

/* tabs inside a window: underlined, like the Workspace Repeat window */
.yw-win .inv-scope-tabs,
.yw-win .cal-view-switch {
  align-self: stretch;
  display: flex;
  gap: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid var(--border);
}

.yw-win .inv-scope-tabs button,
.yw-win .inv-scope-tabs button.active,
.yw-win .cal-view-switch button,
.yw-win .cal-view-switch button.active {
  flex: none;
  height: auto;
  margin: 0 18px -1px 0;
  padding: 5px 2px 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
}

.yw-win .inv-scope-tabs button.active,
.yw-win .cal-view-switch button.active {
  border-bottom-color: var(--text);
  color: var(--text);
  font-weight: 650;
}

.yw-win .inv-scope-tabs button:hover:not(.active),
.yw-win .cal-view-switch button:hover:not(.active) {
  background: transparent;
  color: var(--text);
}

/* choosing several items: the tick box carries the choice, so the row has no left bar */
.yw-win .inv-pick-item:has(.inv-pick-check),
.yw-win .inv-pick-item:has(.inv-pick-check).selected {
  gap: 10px;
  padding-left: 0;
  border-left: 0;
}

.yw-win .inv-pick-check {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--text-faint);
  border-radius: 4px;
  font-size: 11px;
  line-height: 13px;
}

.yw-win .inv-pick-item.selected .inv-pick-check {
  border-color: var(--text);
}

.yw-win .inv-picker-top .inv-addcol-input,
.yw-win .inv-group-search {
  width: 100%;
  box-sizing: border-box;
}

.yw-win .inv-picker-count,
.yw-win .inv-link-btn {
  font-size: 12.5px;
}

/* the list inside a pop-up lines up with its title */
.inv-pop.yw-win .inv-pick-item,
.inv-pop.yw-win .inv-pick-item.selected {
  padding-left: 0;
  border-left: 0;
}

.inv-pop.yw-win .inv-group-search {
  width: auto;
  margin: 8px 20px 6px;
}

.inv-pop.yw-win .inv-pick-list {
  margin: 0 20px 6px;
  max-height: min(320px, 45vh);
}

.inv-pop.yw-win .inv-pop-total {
  padding-left: 20px;
  padding-right: 20px;
}

.inv-pop.yw-win .inv-pop-itemlist,
.inv-pop.yw-win .inv-gi-list {
  padding-left: 20px;
  padding-right: 20px;
}

.inv-pop.yw-win .inv-pop-listrow {
  padding: 3px 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.inv-pop.yw-win .inv-gi-row {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}

.inv-pop.yw-win .inv-gi-row.done {
  background: transparent;
}

/* inspecting an item: plain words, the OK in green */
.yw-win .inv-inspect-actions .inv-btn {
  justify-content: flex-start;
  height: auto;
  padding: 6px 2px;
  font-weight: 600;
}

.yw-win .inv-inspect-ok,
.yw-win .inv-gi-ok {
  background: transparent;
  color: var(--inv-green);
}

.yw-win .inv-inspect-ok:hover,
.yw-win .inv-gi-ok:hover {
  background: transparent !important;
  color: var(--inv-green) !important;
  filter: brightness(0.85);
}

.yw-win .inv-gi-actions {
  gap: 14px;
}

.yw-win .inv-gi-actions .inv-btn {
  height: auto;
  padding: 2px;
  font-size: 13px;
  white-space: nowrap;
}

.inv-pop.yw-win.inv-group-inspect {
  width: min(440px, calc(100vw - 16px));
}

.inv-pop-scroll .inv-inspect-state {
  padding-left: 0;
  padding-right: 0;
}

.inv-pop.yw-win .inv-gi-state,
.inv-group-inspect > .inv-inspect-state {
  padding: 0 20px 8px;
}

.inv-pop.yw-win .inv-inspect-actions,
.inv-pop.yw-win .inv-inspect-form {
  padding-left: 0;
  padding-right: 0;
}

/* the check's figures: four plain columns divided by hairlines */
.yw-win .inv-sum-grid {
  gap: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.yw-win .inv-sum-cell {
  padding: 10px 12px;
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 0;
}

.yw-win .inv-sum-cell:first-child {
  padding-left: 0;
  border-left: 0;
}

.yw-win .inv-sum-note {
  padding: 6px 0;
  border-radius: 0;
  background: transparent;
  border-bottom: 1px solid var(--border);
}

.yw-win .inv-history-list {
  gap: 0;
}

.yw-win .inv-history-item {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.yw-win .inv-history-item summary {
  padding: 8px 0;
}

.yw-win .inv-history-body {
  padding: 0 0 10px;
}

.export-modal.yw-win.inv-detail > .yw-win-close {
  z-index: 5;
}

.yw-win .inv-pop-scroll .inv-pop-rows {
  padding-left: 0;
  padding-right: 0;
}

/* the photo's empty frame: a hairline, no grey fill */
.yw-win .inv-pf-photo .inv-photo-frame,
.yw-win .inv-photo-empty,
.yw-win .inv-photo-thumb {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* the picture viewer's cross: a plain cross, no round fill */
.inv-lightbox-close,
.inv-lightbox-close:hover {
  background: transparent;
  color: #fff;
}


/* ---------- printing the current view ---------- */

.inv-print-root {
  display: none;
}

@media print {
  html.inv-printing,
  html.inv-printing body {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  html.inv-printing body > *:not(.inv-print-root) {
    display: none !important;
  }

  html.inv-printing .inv-print-root {
    display: block;
    position: static;
    width: auto;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #111;
    font: 10pt/1.35 -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .inv-print-root h1 {
    margin: 0;
    font-size: 16pt;
    font-weight: 700;
    color: #111;
  }

  .inv-print-sub {
    margin: 1.5mm 0 3mm;
    color: #555;
  }

  .inv-print-chips {
    margin: 0 0 3mm;
  }

  .inv-print-chips span {
    display: inline-block;
    margin: 0 1.5mm 1.5mm 0;
    padding: 0 2.5mm;
    border: 0.3mm solid #aaa;
    border-radius: 3mm;
    font-size: 9pt;
    color: #333;
  }

  .inv-print-root table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
  }

  .inv-print-root.tight table {
    font-size: 8.5pt;
  }

  .inv-print-root.dense table {
    font-size: 7.5pt;
  }

  .inv-print-root thead {
    display: table-header-group;
  }

  .inv-print-root th {
    padding: 1.2mm 1.6mm;
    border-bottom: 0.4mm solid #555;
    color: #444;
    font-size: 0.9em;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: left;
    text-transform: uppercase;
  }

  .inv-print-root td {
    padding: 1.2mm 1.6mm;
    border-bottom: 0.2mm solid #ccc;
    color: #111;
    overflow-wrap: break-word;
    vertical-align: top;
  }

  .inv-print-root td.date,
  .inv-print-root td:first-child,
  .inv-print-root th:first-child {
    white-space: nowrap;
  }

  .inv-print-root tr {
    break-inside: avoid;
  }

  .inv-print-root th:first-child,
  .inv-print-root td:first-child {
    width: 8mm;
    color: #666;
  }

  .inv-print-root td.expired {
    color: #a33f2c;
    font-weight: 600;
  }

  .inv-print-root td.soon {
    color: #8a5d0f;
    font-weight: 600;
  }
}


/* dragging a category into another group (left menu): no drawing of its own. The headings and the rows between glide like the rows of one group do. */
.sidebar .inv-group-head.row-shifting,
.sidebar .inv-group-empty.row-shifting {
  transition: transform 0.18s ease;
}


/* ---------- Duplicate category window and the new row in the menu ---------- */

.inv-dup .inv-dup-size {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 12px;
}

.inv-dup .inv-addcol-track {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inv-dup .inv-dup-note {
  margin-top: 8px;
}

.tab-item.inv-nav-flash {
  animation: inv-nav-flash 1.6s ease-out;
}

@keyframes inv-nav-flash {
  0% {
    background: rgba(255, 255, 255, 0.22);
  }
  100% {
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-item.inv-nav-flash {
    animation: none;
    background: rgba(255, 255, 255, 0.12);
  }
}
