/* Caledonia Books — corporate product UI. Independent of Direct. */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
  --ink: #12151a;
  --ink-soft: #3d4450;
  --muted: #6b7380;
  --line: #e6e9ee;
  --line-strong: #d0d5dd;
  --paper: #ffffff;
  --canvas: #f4f6f8;
  --sidebar: #0b1220;
  --sidebar-2: #111a2b;
  --accent: #1b4f72;
  --accent-hover: #163e5a;
  --accent-soft: rgba(27, 79, 114, 0.1);
  --hair: #c5cdd6;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-line: #fecdca;
  --success: #0b6e4f;
  --success-bg: #ecfdf3;
  --success-line: #abefc6;
  --warn: #9a6700;
  --warn-bg: #fffaeb;
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar-w: 232px;
  --shadow: 0 1px 2px rgba(18, 21, 26, 0.04), 0 8px 24px rgba(18, 21, 26, 0.04);
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --control-h: 2.45rem;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

h1, h2, h3 {
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 0.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
h1 { font-size: 1.35rem; }
h2 { font-size: 1.02rem; }
h3 { font-size: 0.92rem; }
p { margin: 0 0 0.85rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.48rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none !important;
  letter-spacing: -0.01em;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline {
  background: #fff;
  color: var(--ink) !important;
  border-color: var(--line-strong);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent) !important; background: var(--accent-soft); }
.btn-sm { padding: 0.28rem 0.65rem; font-size: 0.78rem; }
.btn-block { width: 100%; }
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger) !important;
  border-color: var(--danger-line);
}
.btn-danger:hover { background: #fce8e6; }
.inline { display: inline-block; margin: 0; }
.inline-form { display: inline; }
.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

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

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.nav-open, .nav-close, .nav-backdrop { display: none; }

.sidebar-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.15rem;
}

.app-sidebar {
  background: var(--sidebar);
  color: #fff;
  padding: 1.15rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid #1a2436;
}

.books-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  text-decoration: none !important;
  color: #fff !important;
}
.books-brand .mark {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 6px;
}
.books-brand .brand-mark {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.books-brand .brand-mark strong {
  color: #f3f5f8;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.books-brand .brand-mark span {
  color: #8aa0b8;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.side-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.48rem 0.7rem;
  border-radius: 6px;
  color: #c5d0dc;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}
.side-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  text-decoration: none;
}
.side-nav a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: inset 2px 0 0 #7ea4c4;
}
.side-nav .nav-icon {
  display: none;
}

.side-footer {
  margin-top: auto;
  padding: 0.85rem 0.7rem 0.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: #8aa0b8;
}
.side-footer a { color: #b7c8d8; text-decoration: none; }
.side-footer a:hover { color: #fff; }

.app-main { display: flex; flex-direction: column; min-width: 0; background: var(--canvas); }

.app-topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.app-topbar .eyebrow {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.12rem;
  font-weight: 600;
}
.app-topbar h1 { margin: 0; font-size: 1.2rem; font-weight: 600; }

.app-content {
  padding: 1.35rem 1.5rem 2.5rem;
  max-width: 1180px;
  width: 100%;
}

.topbar-filters { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.period-form label {
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.period-form input[type="month"] {
  padding: 0.28rem 0.45rem;
  font-size: 0.85rem;
  font-weight: 500;
  width: auto;
  min-height: 0;
  height: auto;
}

.unit-switch, .filter-bar { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.9rem; }
.app-topbar .unit-switch { margin-bottom: 0; justify-content: flex-end; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none !important;
  background: #fff;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on { background: var(--sidebar); color: #fff !important; border-color: var(--sidebar); }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
}
.panel + .panel { margin-top: 0.9rem; }
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.panel-header h2 { margin: 0; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}
.stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}
.stat-card .label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 0.3rem;
  font-weight: 600;
}
.stat-card .value {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-card .hint { font-size: 0.78rem; color: var(--muted); margin: 0.2rem 0 0; }
a.stat-card { text-decoration: none !important; color: inherit; display: block; }
a.stat-card:hover { border-color: var(--accent); }
.stat-card.accent { background: var(--sidebar); border-color: var(--sidebar); color: #fff; }
.stat-card.accent .label, .stat-card.accent .hint { color: #8aa0b8; }
.stat-card.accent .value { color: #fff; }

.table-wrap { overflow: auto; max-width: 100%; max-height: min(75vh, 56rem); }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.data th, table.data td {
  padding: 0.62rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 600;
  background: #fafbfc;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--line);
}
table.data th.sortable {
  cursor: pointer;
  user-select: none;
  padding-right: 1.2rem;
}
table.data th.sortable:hover { color: var(--ink); }
table.data th.sorted-asc::after,
table.data th.sorted-desc::after {
  content: "▲";
  font-size: 0.55rem;
  margin-left: 0.3rem;
  color: var(--accent);
}
table.data th.sorted-desc::after { content: "▼"; }
.table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin: 0 0 0.65rem;
}
.table-search { margin: 0; max-width: 18rem; }
.table-search input { min-width: 12rem; }
.table-find-count { font-size: 0.8rem; }
.unit-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.pw-reqs { margin: 0.35rem 0 0.7rem; padding-left: 1.15rem; color: var(--muted); font-size: 0.85rem; }
.pw-reqs li.on { color: #0b6e4f; }
.pw-reqs li.off { color: var(--muted); }
table.data tbody tr:hover { background: #f7f9fb; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td select,
table.data td input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]) {
  width: 100%;
  min-width: 0;
}
tr.total td { font-weight: 600; border-top: 1px solid var(--line-strong); background: #fafbfc; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
}
.profile-grid .panel { margin: 0; }
.profile-grid dl { margin: 0; }
.profile-grid dt {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.profile-grid dd { margin: 0.1rem 0 0.7rem; }
.profile-grid dd:last-child { margin-bottom: 0; }
.form-stack { display: flex; flex-direction: column; gap: 0.8rem; }
.form-stack > .btn { align-self: flex-start; }
.form-stack > h2 {
  margin: 0.55rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.form-stack > h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.review-form textarea { min-height: 3.4rem; }
.review-form textarea.tall { min-height: 6.5rem; }
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-end;
}
.form-row > label {
  flex: 1 1 11.5rem;
  min-width: 10rem;
}
.form-row > label.compact {
  flex: 0 1 8rem;
  min-width: 6.5rem;
}
.form-row > label.check {
  flex: 0 1 auto;
  min-width: 0;
  min-height: var(--control-h);
}
.form-row > .form-submit,
.form-row > div:has(> .btn) {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: var(--control-h);
}
.form-row > .form-submit .btn,
.form-row > div:has(> .btn) .btn {
  min-height: var(--control-h);
  white-space: nowrap;
}
.form-row + .note { margin-top: 0.7rem; }
.app-content > .form-row { margin-bottom: 1rem; }

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}
/* Untyped <input> is type=text in HTML but not in CSS — style it the same. */
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="file"]):not([type="range"]):not([type="color"]),
select, textarea {
  font: inherit;
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.48rem 0.65rem;
  width: 100%;
  box-shadow: none;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]):not([type="file"]):not([type="range"]):not([type="color"]),
select {
  height: var(--control-h);
  min-height: var(--control-h);
}
input[type="date"], input[type="month"] {
  height: auto;
}
input[type="file"] {
  font: inherit;
  font-weight: 400;
  color: var(--ink-soft);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.38rem 0.5rem;
  width: 100%;
  min-height: var(--control-h);
  box-shadow: none;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}
textarea { min-height: 6rem; height: auto; resize: vertical; }
label.check { flex-direction: row; align-items: center; font-weight: 500; gap: 0.45rem; }
label.check input { width: auto; height: auto; min-height: 0; }

.alert {
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.alert-error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.alert-success { background: var(--success-bg); border-color: var(--success-line); color: var(--success); }
.alert-warn { background: var(--warn-bg); border-color: #f5d565; color: var(--warn); }
.approve-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.7rem;
  background: #fafbfc;
}
.approve-card h3 { margin: 0 0 0.15rem; font-size: 1rem; }
.hire-id-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.7rem 0 0;
}
.hire-id-card img {
  width: 100%;
  max-height: 16rem;
  object-fit: contain;
  background: #f4f6f8;
  border: 1px solid var(--line);
  border-radius: 8px;
}
@media (max-width: 700px) {
  .hire-id-card { grid-template-columns: 1fr; }
}
.approve-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; margin-top: 0.65rem; }
.approve-actions form { margin: 0; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82em;
  background: #eef1f4;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.amt { font-variant-numeric: tabular-nums; }
.amt-neg { color: var(--danger); }
.amt-pos { color: var(--success); }
.amt-zero { color: var(--muted); }
.muted, .note { color: var(--muted); font-size: 0.84rem; }
details > summary { cursor: pointer; font-weight: 600; }
details.panel > summary { margin: 0; }
details.panel[open] > summary { margin-bottom: 0.85rem; }
.gross, .net { font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }

.pl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.9rem; }
.pl-col h2 { font-size: 0.95rem; }

.cat-form { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.cat-form select { min-width: 8rem; max-width: 12rem; width: auto; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78em;
  background: #eef1f4;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 0.3em;
}
.inbox-panel { position: relative; }
.inbox-head {
  align-items: center;
  position: sticky;
  top: 4.6rem;
  z-index: 15;
  background: #fff;
  padding: 0.65rem 0 0.55rem;
  margin: -0.35rem 0 0;
  border-bottom: 1px solid var(--line);
}
.inbox-toolbar { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.inbox-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  padding: 0 0.4rem;
  margin-left: 0.25rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
}
.inbox-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem 0.9rem;
  margin-top: 0.7rem;
  background: #fff;
}
.inbox-card.has-suggestion { border-color: #c5ddd2; background: #f7fbf8; }
.inbox-card-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.inbox-payee { margin: 0 0 0.1rem; font-size: 1.02rem; }
.inbox-amt { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inbox-suggest { margin: 0.45rem 0 0.7rem; font-size: 0.88rem; }
.suggest-why {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--success-bg);
  color: var(--success);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  margin-right: 0.25rem;
}
.inbox-book-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.inbox-book-row select {
  width: auto;
  min-width: 12rem;
  flex: 1 1 12rem;
}
.inbox-combo-wrap { flex: 1 1 16rem; min-width: 12rem; position: relative; }
.inbox-combo { position: relative; }
.inbox-js .inbox-select-hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.inbox-combo-input { width: 100%; }
.inbox-combo-list {
  position: absolute;
  z-index: 20;
  left: 0; right: 0;
  top: calc(100% + 4px);
  max-height: 16rem;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.inbox-combo-h {
  padding: 0.35rem 0.7rem 0.15rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.inbox-combo-opt {
  padding: 0.42rem 0.7rem;
  cursor: pointer;
  font-size: 0.88rem;
}
.inbox-combo-opt.is-active, .inbox-combo-opt:hover { background: var(--accent-soft); }
.inbox-combo-num { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; margin-right: 0.25rem; }
.inbox-combo-empty { padding: 0.6rem 0.7rem; color: var(--muted); font-size: 0.84rem; }
.unit-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.unit-chip { flex-direction: row; align-items: center; margin: 0; font-weight: 500; cursor: pointer; }
.unit-chip input { position: absolute; opacity: 0; pointer-events: none; }
.unit-chip span {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.unit-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.unit-chip input:checked + span {
  background: var(--sidebar);
  border-color: var(--sidebar);
  color: #fff;
}
.inbox-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 0.65rem; }
.remember-check { margin: 0; }
.inbox-lines {
  list-style: none;
  margin: 0.7rem 0 0;
  padding: 0.55rem 0 0;
  border-top: 1px solid var(--line);
}
.inbox-lines li {
  display: grid;
  grid-template-columns: 7rem 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.22rem 0;
  font-size: 0.84rem;
}
.inbox-line-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; justify-content: flex-end; }
.inbox-card.is-solo { border-style: dashed; }
.inbox-solo-note { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin: 0.45rem 0 0; }
.inbox-more { margin: 0.55rem 0 0; }
.ask-quick {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.55rem;
}
.ask-quick input { flex: 1 1 auto; min-width: 8rem; width: auto; }
.ask-quick.compact { margin: 0; }
.ask-form textarea { min-height: 4.2rem; }
.ask-to { max-width: 24rem; }
.ask-form .ask-to select { width: 100%; }
.ask-file { max-width: 28rem; }
.tx-note .tx-attach { margin-top: 0.55rem; max-width: 16rem; }
.tx-note .tx-attach img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  background: #eef1f4;
  border-radius: 4px;
}
.inbox-form-line { margin-top: 0.45rem; }
.banking-subnav, .people-subnav { margin-bottom: 1rem; }
.banking-subnav .nav-badge, .people-subnav .nav-badge { margin-left: 0.25rem; }
.tx-hero { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.tx-thread { list-style: none; margin: 0 0 1rem; padding: 0; }
.tx-note {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  margin-bottom: 0.5rem;
  background: #fafbfc;
}
.tx-note.kind-question { border-left: 3px solid var(--warn); }
.tx-note.kind-answer { border-left: 3px solid var(--success); }
.tx-note.kind-resolve { border-left: 3px solid var(--accent); }
.note-kind {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.review-open { color: var(--warn); font-weight: 600; }
.card-missing,
.card-house {
  display: none;
  margin: 0.6rem 0 0.2rem;
  padding: 0.85rem 1rem;
  background: var(--warn-bg, #fffaeb);
  border: 1px solid var(--warn-line, #fedf89);
  border-radius: var(--radius-sm);
}
form:has(#card-missing:checked) .card-missing { display: block; }
form:has(#card-billable option[value="1"]:checked) .card-house { display: block; }
.cs-fields { display: none; }
form.cs-form:has(#cs-required:checked) .cs-fields { display: block; }
form.cs-form .cs-fields h3 {
  margin: 0.35rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}
.cs-flag {
  display: inline-block;
  font-weight: 600;
  color: var(--warn);
}
.card-missing .lede { margin: 0 0 0.5rem; font-weight: 600; }
.card-assign { margin: 0.6rem 0 0; }
.card-assign select { min-width: 12rem; }
.meta-list { display: grid; grid-template-columns: 8rem 1fr; gap: 0.25rem 0.8rem; margin: 0.4rem 0 0; }
.meta-list dt { color: var(--muted); font-size: 0.82rem; }
.meta-list dd { margin: 0; }

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.receipt-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  background: #fff;
}
.receipt-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
  background: #eef1f4;
}
.receipt-card figcaption { font-size: 0.78rem; color: var(--muted); margin-top: 0.35rem; }
.receipt-pdf { display: block; padding: 1.5rem 0.5rem; text-align: center; font-weight: 600; }
.flag-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 0.12rem 0.5rem;
  white-space: nowrap;
}
.pill-paid, .pill-rec { background: #ecfdf3; color: #0b6e4f; }
.pill-open { background: #fffaeb; color: #9a6700; }
.pill-partial { background: #eef1f4; color: #3d4450; }
.pill-uncat { background: #fef3f2; color: #b42318; }
.pill-hold { background: #e8f0f6; color: #1b4f72; }
.row-paid { color: var(--ink-soft); }
.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1rem;
}
a.acct-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none !important;
  color: inherit;
  box-shadow: var(--shadow);
}
a.acct-card:hover { border-color: var(--accent); }
.acct-card .k {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.2rem;
}
.acct-card h2 { margin: 0 0 0.15rem; font-size: 1.05rem; }
.acct-card .bal {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 0.35rem 0 0.45rem;
}
.acct-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.acct-card.has-todo { border-color: #e6c35c; }
tr.uncat { background: #fff8f7; }
tr.uncat:hover { background: #ffefed; }
.reg-run { font-variant-numeric: tabular-nums; font-weight: 600; }
.inbox-bank {
  margin: 1.15rem 0 0.55rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}
.inbox-bank:first-of-type { border-top: 0; margin-top: 0.4rem; }
.inbox-bank h3 { margin: 0; font-size: 1rem; }
.inbox-bank .muted { margin: 0.15rem 0 0; }
.match-list { list-style: none; margin: 0.55rem 0 0; padding: 0; }
.match-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: start;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}
.match-list .muted { margin: 0; }
table.stmt.cols td.num, table.stmt.cols th.num { width: auto; min-width: 5.4rem; }
table.stmt.cols th.combined, table.stmt.cols td.combined {
  background: #f4f6f8;
  font-weight: 600;
}
@media (max-width: 640px) {
  .inbox-card-top { flex-direction: column; gap: 0.2rem; }
  .inbox-lines li { grid-template-columns: 1fr auto; }
  .inbox-book-row { flex-direction: column; align-items: stretch; }
  .form-row > label { flex: 1 1 100%; min-width: 0; }
}

.invite-banner {
  background: #fff;
  border: 1px solid var(--accent);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
.invite-banner h2 { margin: 0 0 0.3rem; }
.invite-link { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.invite-link input {
  flex: 1 1 16rem;
  min-width: 12rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}
tr.invite-new { background: var(--accent-soft); }

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.32rem;
  margin-left: auto;
  border-radius: 999px;
  background: #c2410c;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}

.feedback-box {
  margin-top: 2.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  max-width: 36rem;
}
.feedback-box summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.84rem;
}
.feedback-box details[open] summary { margin-bottom: 0.6rem; color: var(--ink); }
.feedback-box textarea { min-height: 4.5rem; }

.feedback-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.7rem;
  max-width: 46rem;
  scroll-margin-top: 5.5rem;
}
.feedback-item.status-new { border-left: 3px solid var(--accent); }
.feedback-item.status-read { border-left: 3px solid var(--line-strong); }
.feedback-item.status-done { opacity: 0.7; }
.feedback-item header { margin-bottom: 0.5rem; }
.feedback-item > p { white-space: pre-wrap; margin: 0; }
.feedback-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.55rem; }
.feedback-compose { margin-bottom: 1.1rem; max-width: 46rem; }
.feedback-compose h2 { margin: 0 0 0.35rem; font-size: 1rem; }
.feedback-compose textarea { min-height: 4.5rem; resize: vertical; }
.feedback-reply-count { margin: 0.75rem 0 0.35rem; font-size: 0.78rem; font-weight: 600; }
.feedback-thread { list-style: none; margin: 0 0 0.55rem; padding: 0; }
.feedback-comment {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.45rem;
  background: #fafbfc;
}
.feedback-comment header { margin-bottom: 0.25rem; }
.feedback-comment p { margin: 0; white-space: pre-wrap; }
.feedback-reply { margin-top: 0.75rem; }
.feedback-reply textarea { min-height: 3.2rem; resize: vertical; width: 100%; }

.aging-doc td { font-size: 0.82rem; background: #fafbfc; }
tr.rec-on { background: #f3f8f4; }
.close-ok td:first-child { color: var(--success); font-weight: 700; }
.close-warn td:first-child { color: var(--warn); font-weight: 700; }
.exceptions { margin-bottom: 1rem; }
.rec-kpis { margin-bottom: 1rem; }
.kpi-warn .value { color: var(--warn); }

.settings-menu {
  display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0 0 1rem;
}

/* Auth — quiet, centered, corporate */
body.auth-body { background: var(--canvas); }
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.auth-wrap { width: 100%; max-width: 400px; }
.auth-wrap .books-brand { margin-bottom: 1.5rem; color: var(--ink) !important; }
.auth-wrap .books-brand .brand-mark strong { color: var(--ink); font-size: 1.05rem; }
.auth-wrap .books-brand .brand-mark span { color: var(--muted); }
.auth-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1.6rem 1.5rem 1.4rem;
}
.auth-card h2 { margin: 0 0 0.25rem; font-size: 1.2rem; }
.auth-card .lede { color: var(--muted); margin-bottom: 1.25rem; }
.auth-foot { margin-top: 1.25rem; font-size: 0.8rem; color: var(--muted); text-align: center; }

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.1rem 0.42rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.tag-direct { background: #e8f1f8; color: #1b4f72; }
.tag-angel { background: #eef6ea; color: #3d5a1f; }
.item-sku { font-variant-numeric: tabular-nums; font-weight: 600; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .nav-open {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
  }
  .nav-open-bars {
    width: 1rem;
    height: 0.8rem;
    display: inline-block;
    background:
      linear-gradient(var(--ink), var(--ink)) 0 0 / 100% 1.5px no-repeat,
      linear-gradient(var(--ink), var(--ink)) 0 50% / 100% 1.5px no-repeat,
      linear-gradient(var(--ink), var(--ink)) 0 100% / 100% 1.5px no-repeat;
  }
  .nav-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: #fff;
    cursor: pointer;
  }
  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 18, 32, 0.45);
    z-index: 40;
  }
  .app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(84vw, 260px);
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .nav-toggle:checked ~ .app-sidebar { transform: translateX(0); }
  .nav-toggle:checked ~ .nav-backdrop { display: block; }
  .pl-grid { grid-template-columns: 1fr; }
}

/* Reports — statement density, KPIs first, then the numbers */
.rpt-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0 1.1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}
.rpt-nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none !important;
}
.rpt-nav a:not(.btn):hover { background: var(--accent-soft); color: var(--accent); }
.rpt-nav a.on {
  background: var(--sidebar);
  color: #fff !important;
}
.rpt-nav-gap { flex: 1 1 0.5rem; }

.rpt-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}
.rpt-kpi {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem 0.7rem;
  box-shadow: var(--shadow);
}
.rpt-kpi .label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.2rem;
}
.rpt-kpi .value {
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin: 0;
  color: var(--ink);
  line-height: 1.2;
}
.rpt-kpi .delta { margin: 0.28rem 0 0; font-size: 0.78rem; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }
.rpt-kpi.kpi-net { background: var(--sidebar); border-color: var(--sidebar); color: #fff; }
.rpt-kpi.kpi-net .label { color: #8aa0b8; }
.rpt-kpi.kpi-net .value { color: #fff; }
.rpt-kpi.kpi-net .delta.flat { color: #8aa0b8; }
.rpt-kpi.kpi-net .delta.up { color: #abefc6; }
.rpt-kpi.kpi-net .delta.down { color: #fecdca; }
.rpt-kpi.kpi-warn { border-color: var(--danger-line); background: var(--danger-bg); }
.rpt-kpi.kpi-warn .value { color: var(--danger); }

.rpt-flow {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.75rem 0.95rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.flow-row {
  display: grid;
  grid-template-columns: 4.2rem 1fr 7.2rem;
  gap: 0.65rem;
  align-items: center;
  font-size: 0.78rem;
}
.flow-label { color: var(--muted); font-weight: 600; }
.flow-track {
  display: block;
  height: 0.55rem;
  background: #eef1f4;
  border-radius: 999px;
  overflow: hidden;
}
.flow-bar { display: block; height: 100%; border-radius: 999px; }
.flow-bar.in { background: var(--accent); }
.flow-bar.cogs { background: #8aa0b8; }
.flow-bar.opex { background: #9a6700; }
.flow-bar.net-pos { background: var(--success); }
.flow-bar.net-neg { background: var(--danger); }
.flow-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

table.stmt {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}
table.stmt th {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--line-strong);
  background: #fafbfc;
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--line-strong);
}
table.stmt td { padding: 0.34rem 0.55rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.stmt td.num, table.stmt th.num { text-align: right; white-space: nowrap; width: 7.2rem; }
table.stmt tbody tr:hover { background: #f7f9fb; }
table.stmt .stmt-no {
  display: inline-block;
  min-width: 2.4rem;
  margin-right: 0.45rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
table.stmt .stmt-sec td {
  padding-top: 0.95rem;
  padding-bottom: 0.2rem;
  border-bottom: 0;
  background: transparent;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
table.stmt .stmt-empty td { border-bottom: 0; padding-top: 0.15rem; }
table.stmt .stmt-total td {
  font-weight: 600;
  border-top: 1px solid var(--ink);
  background: #fff;
}
table.stmt tr.stmt-sub td {
  font-weight: 600;
  background: #f4f6f8;
  border-top: 1px solid var(--line-strong);
}
table.stmt tr.stmt-net td {
  font-weight: 700;
  font-size: 0.95rem;
  border-top: 1px solid var(--ink);
  border-bottom: 3px double var(--ink);
  background: #fff;
}
table.stmt .stmt-amt { font-variant-numeric: tabular-nums; }
table.stmt .stmt-pct { color: var(--muted); }
table.stmt .stmt-memo { color: var(--ink-soft); font-size: 0.82rem; }
table.stmt.matrix th.combined, table.stmt.matrix td.combined {
  background: #f4f6f8;
  font-weight: 600;
}
table.stmt.matrix th { position: static; }
.stmt-panel .panel-header { margin-bottom: 0.45rem; }
.stmt-panel .panel-header .muted { margin: 0.15rem 0 0; }
.gl-filter { margin-bottom: 0.85rem; max-width: 28rem; }

.bs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
  align-items: start;
}
.bs-right { display: flex; flex-direction: column; gap: 0.9rem; }
.bs-sum { text-align: right; }
.bs-eq-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.2rem;
}
.bs-eq-value {
  font-size: 1.2rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin: 0;
  letter-spacing: -0.02em;
}

@media (max-width: 900px) {
  .rpt-kpis { grid-template-columns: 1fr 1fr; }
  .bs-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .rpt-kpis { grid-template-columns: 1fr; }
  table.stmt .col-pct { display: none; }
  .flow-row { grid-template-columns: 3.4rem 1fr 5.5rem; }
}

.payroll-print-head { display: none; }
.payroll-filter-row { margin-bottom: 0.6rem; }
.payroll-cols {
  margin: 0 0 0.9rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}
.payroll-cols summary {
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.payroll-col-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  margin-top: 0.7rem;
}
.payroll-col-grid .check { font-size: 0.82rem; }
.payroll-table-wrap { max-height: min(70vh, 52rem); }
.payroll-table th { position: sticky; top: 0; z-index: 1; }
.payroll-table th .payroll-sort {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
  width: 100%;
}
.payroll-table th.num .payroll-sort { text-align: right; }
.payroll-table th .payroll-sort:hover { color: var(--accent); }
.payroll-table tr.payroll-totals td {
  font-weight: 600;
  background: #f4f6f8;
}
.payroll-table tr.payroll-foot td {
  border-bottom: 0;
  background: #eef2f6;
  font-variant-numeric: tabular-nums;
}
.payroll-kpis { margin-bottom: 1rem; }

@media print {
  .app-sidebar, .app-topbar, .feedback-box, .nav-open, .rpt-nav, .no-print { display: none !important; }
  .app-shell { display: block; }
  .app-content { max-width: none; padding: 0; }
  .rpt-kpi, .panel { box-shadow: none; }
  table.stmt th { position: static; }
  .payroll-print-head {
    display: block;
    margin: 0 0 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 3px solid #0b1220;
  }
  .payroll-print-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
  }
  .payroll-print-brand img { width: 28px; height: 28px; }
  .payroll-print-brand strong {
    display: block;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
  }
  .payroll-print-brand span {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7380;
  }
  .payroll-print-meta { margin: 0.45rem 0 0; color: #3d4450; }
  .payroll-view { border: 0; padding: 0; }
  .payroll-table-wrap { max-height: none; overflow: visible; }
  .payroll-table th { position: static; }
  .payroll-table tbody tr:hover { background: transparent; }
  .app-content > p.note { display: none; }
}

.field-cap {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.3rem;
}
.rich-field { width: 100%; }
.rich { width: 100%; position: relative; }
.rich-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.35rem;
  background: #f7f8fa;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  user-select: none;
}
.rich-bar button {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.38rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.rich-bar button[data-cmd="bold"] { font-weight: 700; }
.rich-bar button[data-cmd="italic"] { font-style: italic; font-weight: 500; }
.rich-bar button:hover { border-color: var(--accent); color: var(--accent); }
.rich-ed {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 400 !important;
  line-height: 1.45;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 0.65rem 0.75rem;
  min-height: 10rem;
  outline: none;
  overflow: auto;
}
.rich-ed:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rich-ed.is-empty:before {
  content: attr(data-placeholder);
  color: var(--muted);
  font-weight: 400;
  pointer-events: none;
}
.rich-ed p, .rich-ed li, .rich-ed div { margin: 0 0 0.55rem; font-weight: 400; }
.rich-ed p:last-child { margin-bottom: 0; }
.rich-ed ul, .rich-ed ol { margin: 0 0 0.55rem; padding-left: 1.35rem; }
.rich-ed li { margin: 0.12rem 0; }
.rich-ed h3 { font-size: 1.05rem; margin: 0.7rem 0 0.35rem; font-weight: 700; }
.rich-ed h3:first-child { margin-top: 0; }
.rich-ed strong, .rich-ed b { font-weight: 700; }
.rich-ed em, .rich-ed i { font-style: italic; }
.rich-src {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.share-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1.05rem;
  background: var(--paper);
  box-shadow: var(--shadow);
  margin-top: 0.7rem;
}
.share-card.is-waiting {
  border-color: #f5d565;
  background: var(--warn-bg);
}
.share-card.is-archived { opacity: 0.78; }
.share-card-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}
.share-card h3 { margin: 0 0 0.2rem; font-size: 1.02rem; }
.share-card h3 a { color: inherit; }
.share-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.share-desc { margin: 0.35rem 0 0.45rem; color: var(--ink-soft); }
.share-card .share-desc { max-width: 46rem; }
.share-cats { margin-top: -0.45rem; }
.share-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.share-badge.wait { background: var(--warn-bg); color: var(--warn); }
.share-badge.archived { background: #eef1f4; color: var(--muted); }
@media (max-width: 640px) {
  .share-card-top { flex-direction: column; }
}

