:root {
  --ink: #222222;
  --muted: #696969;
  --paper: #ffffff;
  --panel: #ffffff;
  --line: #d3d3d3;
  --green: #599dd6;
  --green-dark: #486b9a;
  --brand-blue: #599dd6;
  --brand-blue-dark: #486b9a;
  --brand-charcoal: #202020;
  --brand-deep: #486b9a;
  --brand-surface: #f9f9f9;
  --gold: #d7a931;
  --row-ink: #333333;
  --row-muted: #666666;
  --red: #a33b35;
  --shadow: 0 12px 35px rgb(34 34 34 / 8%);
}

.identity-links-card {
  max-width: 58rem;
}

.identity-link-list {
  display: grid;
  gap: 0;
}

.identity-link-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 1fr);
  padding: 1rem 0;
}

.identity-link-row:last-child {
  border-bottom: 0;
}

.identity-link-row p,
.identity-link-row small {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.identity-link-form {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.identity-link-form select {
  min-width: 0;
  width: 100%;
}

@media (max-width: 42rem) {
  .identity-link-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .identity-link-form {
    align-items: stretch;
    flex-direction: column;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ticket-first prototype shell */
.ticket-first-page {
  margin: 0 auto;
  max-width: 48rem;
  padding-bottom: 6.5rem;
}

.ticket-first-heading {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.ticket-controls {
  align-items: center;
  background: rgb(255 255 255 / 96%);
  border-bottom: 1px solid transparent;
  display: flex;
  gap: 0.7rem;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.55rem 0;
  position: sticky;
  top: 4rem;
  transition: background-color 160ms ease, border-color 160ms ease;
  z-index: 2;
}

.ticket-controls.is-stuck {
  background: rgb(245 245 245 / 97%);
  border-bottom-color: #dddddd;
}

.ticket-search {
  flex: 1;
}

.ticket-search input {
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  padding: 0.55rem 0.85rem;
  width: 100%;
}

.ticket-search input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgb(89 157 214 / 28%);
  outline: 0;
}

.ticket-filter-buttons {
  display: flex;
  gap: 0.25rem;
}

.ticket-filter-buttons .button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  padding: 0.45rem 0.7rem;
}

.ticket-filter-buttons .button.is-active {
  background: var(--green);
  color: white;
}

.ticket-first-heading h1 {
  font-size: clamp(2.15rem, 7vw, 3.35rem);
  margin-bottom: 0.55rem;
}

.ticket-first-heading p:last-child,
.ticket-detail-hero > p:last-child {
  color: var(--muted);
  margin-bottom: 0;
}

.eyebrow {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.13em;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.client-groups,
.buffer-groups,
.timesheet-days {
  display: grid;
  gap: 1.35rem;
}

.client-group-heading {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.client-group-heading h2,
.client-group-heading p {
  margin-bottom: 0;
}

.client-group-heading > span,
.client-group-heading > strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.ticket-cards,
.buffer-group {
  display: grid;
  gap: 0;
}

.ticket-detail-card,
.ticket-state-card,
.timesheet-day-card,
.ticket-cards,
.buffer-group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 7px 24px rgb(25 48 33 / 5%);
}

.ticket-cards {
  overflow: hidden;
}

.ticket-card {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.65rem;
  grid-template-columns: 2.15rem minmax(0, 1fr) auto;
  padding: 0.62rem 0.7rem;
}

.ticket-card.internal-time-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.internal-time-options > summary {
  color: #333;
  cursor: pointer;
  padding: 0.85rem;
}

.internal-time-options[open] > summary {
  border-bottom: 1px solid var(--line);
}

.ticket-mark {
  align-items: center;
  align-self: stretch;
  background: transparent;
  border: 0;
  cursor: pointer;
  display: flex;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0;
  width: 2.15rem;
}

.ticket-mark span {
  background: var(--paper);
  border: 2px solid #ababab;
  border-radius: 50%;
  height: 0.85rem;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
  width: 0.85rem;
}

.ticket-mark:hover span,
.ticket-mark:focus-visible span {
  border-color: var(--brand-blue);
  transform: scale(1.15);
}

.ticket-mark.is-marked span {
  background: var(--gold);
  border-color: #b77f00;
}

.ticket-mark:disabled {
  cursor: wait;
  opacity: 0.55;
}

.ticket-filter-empty {
  color: var(--muted);
  padding: 1.5rem 0;
  text-align: center;
}

.ticket-card:last-of-type {
  border-bottom: 0;
}

.ticket-card-main {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: block;
  font: inherit;
  min-width: 0;
  padding: 0.15rem;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.ticket-card-main h3,
.buffer-card h3 {
  color: var(--row-ink);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.35;
  margin: 0 0 0.24rem;
}

.ticket-card-main h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-card-main > p,
.buffer-card-link > div > p:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0;
}

.ticket-card-meta {
  align-items: center;
  display: flex;
  gap: 0.45rem;
  min-width: 0;
  white-space: nowrap;
}

.ticket-card-meta > strong {
  color: var(--row-ink);
  font-size: 0.72rem;
  font-weight: 400;
}

.ticket-card-meta .status-pill {
  font-weight: 400;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill,
.buffer-state {
  background: #f3f3f3;
  border: 1px solid #d0d0d0;
  border-radius: 999px;
  color: var(--row-ink);
  font-size: 0.66rem;
  font-weight: 400;
  line-height: 1;
  padding: 0.35rem 0.5rem;
}

.quick-add-button {
  border-radius: 8px;
  font-size: 0.78rem;
  min-height: 2.2rem;
  padding: 0.38rem 0.65rem;
  white-space: nowrap;
}

.ticket-inspector {
  background: var(--panel);
  border: 0;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 55px rgb(23 32 27 / 18%);
  color: var(--ink);
  height: 100dvh;
  inset: 0 0 0 auto;
  margin: 0;
  max-width: min(30rem, 92vw);
  overflow: auto;
  padding: 1.25rem;
  width: 100%;
}

.ticket-inspector::backdrop {
  background: rgb(15 25 19 / 30%);
  backdrop-filter: blur(1px);
}

.ticket-inspector-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.ticket-inspector-heading h2 {
  font-size: 1.25rem;
  margin-bottom: 0.35rem;
}

.ticket-inspector-updated {
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 1rem;
}

.ticket-inspector .ticket-detail-grid {
  gap: 0.2rem 1rem;
  grid-template-columns: minmax(6.5rem, 0.8fr) minmax(0, 1.2fr);
}

.ticket-inspector .ticket-detail-grid > div {
  display: contents;
}

.ticket-inspector .ticket-detail-grid dt,
.ticket-inspector .ticket-detail-grid dd {
  border: 0;
  margin: 0;
  padding: 0.35rem 0;
}

.ticket-inspector .ticket-detail-grid dd {
  font-weight: 400;
  text-align: right;
}

.ticket-notes {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.2rem;
}

.ticket-notes h3 {
  color: var(--row-ink);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
}

.ticket-note {
  background: var(--brand-surface);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
}

.ticket-note-meta {
  color: var(--row-muted);
  font-size: 0.68rem;
  margin: 0 0 0.3rem;
}

.ticket-note-body {
  color: var(--row-ink);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.ticket-note-body p:last-child,
.ticket-notes-status {
  margin-bottom: 0;
}

.ticket-notes-status {
  color: var(--muted);
  font-size: 0.75rem;
}

.ticket-inspector-add {
  margin-top: 1.25rem;
  width: 100%;
}

.ticket-state-card {
  padding: 1.4rem;
}

.ticket-state-card h2 {
  margin-bottom: 0.35rem;
}

.ticket-state-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 750;
  margin-bottom: 1.25rem;
  text-decoration: none;
}

.ticket-detail-hero {
  margin-bottom: 1.5rem;
}

.ticket-detail-hero h1 {
  font-size: clamp(2rem, 7vw, 3rem);
  margin: 0.25rem 0 0.75rem;
}

.ticket-detail-card {
  padding: 1.25rem;
}

.ticket-detail-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.ticket-detail-grid > div {
  border-top: 1px solid var(--line);
  padding: 0.8rem 0;
}

.ticket-detail-grid dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  text-transform: uppercase;
}

.ticket-detail-grid dd {
  font-weight: 700;
  margin: 0.15rem 0 0;
}

.floating-quick-add {
  bottom: 6.1rem;
  box-shadow: 0 12px 30px rgb(23 71 42 / 24%);
  position: fixed;
  right: max(1rem, calc((100vw - 48rem) / 2));
  z-index: 8;
}

.quick-add-sheet {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 55px rgb(23 32 27 / 20%);
  inset: auto 0 0;
  margin: auto;
  max-height: min(90vh, 42rem);
  max-width: 48rem;
  padding: 0.75rem 1.25rem max(1.5rem, env(safe-area-inset-bottom));
  width: 100%;
}

.quick-add-sheet::backdrop {
  background: rgb(15 25 19 / 45%);
  backdrop-filter: blur(2px);
}

.quick-sheet-handle {
  background: #c8d0ca;
  border-radius: 999px;
  height: 0.28rem;
  margin: 0 auto 1.1rem;
  width: 2.8rem;
}

.quick-sheet-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.quick-sheet-heading h2 {
  margin-bottom: 0.25rem;
}

.quick-sheet-heading p:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 1.1rem;
}

.quick-add-form {
  display: grid;
  gap: 0.7rem;
}

.quick-add-form label {
  font-size: 0.85rem;
  font-weight: 800;
}

.quick-add-form textarea {
  font: inherit;
  min-height: 9rem;
  resize: vertical;
  width: 100%;
}

.quick-add-submit {
  min-height: 3.2rem;
  width: 100%;
}

.field-help {
  color: var(--muted);
  font-size: 0.75rem;
  margin: 0;
  text-align: center;
}

.mobile-tab-bar {
  align-items: stretch;
  background: var(--brand-charcoal);
  border: 0;
  border-top: 2px solid var(--gold);
  bottom: 0;
  box-shadow: 0 -8px 28px rgb(23 32 27 / 10%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  left: 0;
  overflow: visible;
  padding-bottom: env(safe-area-inset-bottom);
  position: fixed;
  width: 100vw;
  z-index: 7;
}

.mobile-tab {
  align-items: center;
  color: white;
  display: flex;
  flex-direction: column;
  font-size: 0.69rem;
  font-weight: 750;
  gap: 0.1rem;
  justify-content: center;
  min-height: 3.65rem;
  padding: 0.35rem 0.7rem;
  text-decoration: none;
}

button.mobile-tab {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

button.mobile-tab:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.mobile-tab-action {
  overflow: visible;
}

.mobile-tab-action .mobile-tab-icon {
  align-items: center;
  background: var(--brand-blue);
  border: 2px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 4px 14px rgb(0 0 0 / 32%);
  display: inline-flex;
  font-size: 1.55rem;
  height: 2.9rem;
  justify-content: center;
  margin-top: -0.65rem;
  transition: transform 120ms ease, box-shadow 120ms ease;
  width: 2.9rem;
}

.mobile-tab-action:hover .mobile-tab-icon,
.mobile-tab-action:focus-visible .mobile-tab-icon {
  box-shadow: 0 5px 18px rgb(89 157 214 / 55%);
  transform: translateY(-2px);
}

.mobile-tab.active {
  background: var(--brand-blue);
  color: white;
}

.mobile-tab:focus-visible {
  outline: 2px solid white;
  outline-offset: -4px;
}

.mobile-tab-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.mobile-tab-icon-wrap {
  display: inline-flex;
  position: relative;
}

.mobile-tab-badge {
  align-items: center;
  background: var(--gold);
  border: 2px solid var(--brand-charcoal);
  border-radius: 999px;
  color: var(--brand-charcoal);
  display: inline-flex;
  font-size: 0.58rem;
  font-weight: 850;
  height: 1.15rem;
  justify-content: center;
  min-width: 1.15rem;
  padding: 0 0.22rem;
  position: absolute;
  right: -0.72rem;
  top: -0.5rem;
}

.mobile-tab-badge.is-processing {
  animation: buffer-status-pulse 1.1s ease-in-out infinite alternate;
  background: var(--brand-blue);
  color: white;
}

@keyframes buffer-status-pulse {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.quick-add-status {
  color: var(--brand-charcoal);
  font-size: 0.9rem;
  margin: 0;
}

.buffer-attention-banner {
  align-items: center;
  background: #fff8df;
  border: 1px solid #e8d38f;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  color: var(--row-ink);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
}

.buffer-attention-banner > span:first-child {
  display: grid;
  gap: 0.12rem;
}

.buffer-attention-banner strong {
  font-size: 0.9rem;
}

.buffer-attention-banner small,
.buffer-attention-banner > span:last-child {
  color: var(--row-muted);
  font-size: 0.72rem;
}

.buffer-attention-banner > span:last-child {
  font-weight: 750;
  white-space: nowrap;
}

.buffer-attention-banner:hover,
.buffer-attention-banner:focus-visible {
  background: #fff3c8;
  border-color: var(--gold);
}

.timesheet-period-panel {
  align-items: center;
  background: var(--brand-surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 0.65rem;
  flex-wrap: wrap;
}

.timesheet-period-toggle {
  display: flex;
  gap: 0.25rem;
}

.timesheet-period-toggle .button {
  background: white;
  color: var(--row-ink);
  padding: 0.45rem 0.75rem;
}

.timesheet-period-toggle .button.is-active {
  background: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
  color: white;
}

.timesheet-period-summary {
  display: grid;
  text-align: right;
}

.timesheet-period-summary span {
  color: var(--row-muted);
  font-size: 0.72rem;
}

.timesheet-period-summary strong {
  color: var(--row-ink);
  font-size: 1rem;
  font-weight: 650;
}

.timesheet-period-summary small {
  color: #725817;
  font-size: 0.7rem;
}

.timesheet-freshness {
  color: var(--row-muted);
  flex-basis: 100%;
  font-size: 0.72rem;
  margin: -0.2rem 0 0;
  text-align: right;
}

.buffer-back-link {
  margin-bottom: 0.8rem;
}

.buffer-card {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.buffer-card-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  display: block;
  font: inherit;
  min-width: 0;
  padding: 0.72rem 0.8rem;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.buffer-card-copy {
  display: grid;
  gap: 0.13rem;
  min-width: 0;
}

.buffer-card-title {
  color: var(--row-ink);
  font-size: 0.92rem;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buffer-card-context,
.buffer-card-description {
  color: var(--muted);
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buffer-card-description.missing {
  color: #8a6510;
  font-style: italic;
}

.buffer-card:last-of-type {
  border-bottom: 0;
}

.buffer-card:has(.buffer-card-link:hover),
.buffer-card:has(.buffer-card-link:focus-visible) {
  background: #f9f9f9;
}

.buffer-card.processing {
  opacity: 0.72;
}

.buffer-card.needs-context .buffer-state {
  background: #fff3cf;
  border-color: #eed88e;
  color: #725817;
}

.buffer-card-action {
  align-items: center;
  display: flex;
  padding-right: 0.8rem;
}

.buffer-card-action form,
.buffer-review-panel form {
  margin: 0;
}

.review-toggle {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  gap: 0.4rem;
  padding: 0.4rem 0;
  white-space: nowrap;
}

.review-toggle > span {
  align-items: center;
  background: var(--panel);
  border: 1.5px solid #afbab1;
  border-radius: 5px;
  display: inline-flex;
  height: 1.15rem;
  justify-content: center;
  width: 1.15rem;
}

.review-toggle.checked {
  color: var(--row-ink);
}

.review-toggle.checked > span {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.buffer-batch-footer {
  align-items: center;
  background: #f2fafd;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.8rem;
}

.buffer-batch-footer div {
  display: grid;
}

.buffer-batch-footer strong {
  color: var(--green-dark);
  font-size: 0.82rem;
}

.buffer-batch-footer span {
  color: var(--muted);
  font-size: 0.7rem;
}

.buffer-card-time {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin-top: 0.55rem !important;
}

.buffer-card-time span,
.buffer-card-time strong {
  font-size: 0.72rem;
  font-weight: 400;
}

.buffer-card-time span {
  color: var(--row-muted);
}

.buffer-card-time strong {
  color: var(--row-ink);
}

.buffer-editor-form,
.danger-zone,
.confirmation-popover,
.buffer-review-panel,
.buffer-amendment-panel,
.original-capture {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.buffer-review-panel {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 1rem;
}

.buffer-review-panel strong {
  color: var(--green-dark);
}

.buffer-review-panel p {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.2rem 0 0;
}

.buffer-editor-form {
  padding: 1.15rem;
}

.buffer-inspector-heading {
  padding-right: 2.25rem;
}

.buffer-inspector-heading p:last-child,
.buffer-amendment-panel > p {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 0.7rem;
}

.inspector-corner-close {
  float: right;
  position: sticky;
  top: 0;
  z-index: 1;
}

.inspector-loading {
  color: var(--muted);
  padding: 2rem 0;
  text-align: center;
}

.buffer-editor-form textarea,
.buffer-editor-form input,
.buffer-editor-form select {
  width: 100%;
}

.buffer-editor-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.buffer-editor-grid.compact .field-wide {
  grid-column: 1 / -1;
}

.buffer-amendment-panel,
.original-capture {
  margin-top: 1rem;
  padding: 1rem;
}

.buffer-amendment-panel form {
  display: grid;
  gap: 0.65rem;
}

.buffer-amendment-panel textarea {
  width: 100%;
}

.buffer-amendment-panel .button {
  justify-self: end;
}

.original-capture summary {
  color: var(--green-dark);
  cursor: pointer;
  font-weight: 700;
}

.original-capture p {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.7rem 0 0;
  white-space: pre-wrap;
}

.buffer-editor-form .field {
  display: grid;
  gap: 0.35rem;
}

.buffer-editor-form .field label {
  font-size: 0.76rem;
  font-weight: 800;
}

.field-help.left {
  text-align: left;
}

.buffer-editor-actions {
  border-top: 1px solid var(--line);
  margin-top: 1.25rem;
  padding-top: 1rem;
  text-align: right;
}

.danger-zone {
  margin-top: 1rem;
  padding: 1rem;
}

.danger-zone summary {
  color: var(--red);
  cursor: pointer;
  font-weight: 800;
}

.danger-zone p {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.7rem 0;
}

.danger-button {
  border-color: #d8aaa7;
  color: var(--red);
}

.confirmation-popover {
  inset: 50% auto auto 50%;
  margin: 0;
  max-width: min(28rem, calc(100vw - 2rem));
  padding: 1.25rem;
  transform: translate(-50%, -50%);
  width: 100%;
}

.confirmation-popover::backdrop {
  background: rgb(15 25 19 / 45%);
  backdrop-filter: blur(2px);
}

.confirmation-popover > p {
  color: var(--muted);
}

.confirmation-popover .warning-copy {
  background: #fff8df;
  border-radius: 10px;
  color: #644f17;
  padding: 0.75rem;
}

.confirmation-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
}

.confirmation-actions form {
  margin: 0;
}

.connectwise-review-page {
  max-width: 52rem;
}

.connectwise-review-warning,
.connectwise-receipt-banner {
  background: #f2fafd;
  border: 1px solid #b8d8ee;
  border-radius: 10px;
  color: var(--row-ink);
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
}

.connectwise-review-warning {
  display: grid;
  gap: 0.25rem;
}

.connectwise-review-warning span,
.connectwise-receipt-banner span {
  color: var(--muted);
  font-size: 0.78rem;
}

.connectwise-review-list {
  display: grid;
  gap: 0.85rem;
}

.connectwise-review-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.connectwise-review-card header {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.8rem;
}

.connectwise-review-card header span,
.connectwise-review-notes > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.connectwise-review-card dl {
  display: grid;
  gap: 0.45rem 1rem;
  grid-template-columns: minmax(6rem, 0.35fr) minmax(0, 1fr);
  margin: 0;
}

.connectwise-review-card dt,
.connectwise-review-card dd {
  margin: 0;
}

.connectwise-review-card dt {
  color: var(--muted);
  font-size: 0.75rem;
}

.connectwise-review-card dd {
  color: var(--row-ink);
  font-size: 0.82rem;
}

.connectwise-review-notes {
  border-top: 1px solid var(--line);
  margin-top: 0.85rem;
  padding-top: 0.75rem;
}

.connectwise-review-notes p {
  margin: 0.35rem 0 0;
  white-space: pre-wrap;
}

.connectwise-final-confirmation {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin: 1rem 0 5rem;
  padding: 1rem;
}

.connectwise-final-confirmation > label {
  align-items: flex-start;
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.connectwise-final-confirmation input[type="checkbox"] {
  margin-top: 0.2rem;
}

.connectwise-receipt-banner {
  display: grid;
  gap: 0.65rem;
}

.connectwise-receipt-banner p {
  display: grid;
  gap: 0.15rem;
  margin: 0;
}

.connectwise-receipt-banner .is-warning {
  border-left: 3px solid var(--gold);
  padding-left: 0.75rem;
}

.inline-notice,
.empty-day {
  color: var(--muted);
  font-size: 0.82rem;
}

.inline-notice {
  background: #fff8df;
  border: 1px solid #eed78f;
  border-radius: 12px;
  padding: 0.8rem 1rem;
}

.timesheet-day-card {
  overflow: hidden;
}

.timesheet-day .client-group-heading {
  margin-bottom: 0.5rem;
}

.timesheet-day .client-group-heading h2 {
  font-size: 1rem;
}

.timesheet-day .client-group-heading p {
  color: var(--muted);
  font-size: 0.72rem;
}

.empty-day {
  margin: 0;
  padding: 0.8rem 1rem;
}

.timesheet-entries {
  display: grid;
  margin: 0;
}

.timesheet-entry {
  align-items: center;
  appearance: none;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.85rem 1rem;
  text-align: left;
  width: 100%;
}

.timesheet-entry:hover,
.timesheet-entry:focus-visible {
  background: var(--brand-surface);
}

.timesheet-entry:last-of-type {
  border-bottom: 0;
}

.timesheet-entry h3,
.timesheet-entry p {
  margin-bottom: 0;
}

.timesheet-entry h3 {
  color: var(--row-ink);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.35;
}

.timesheet-entry .eyebrow {
  color: var(--row-muted);
  font-weight: 400;
}

.timesheet-entry > div > p:last-child {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.2rem;
}

.timesheet-source-badge {
  background: #fff3cf;
  border: 1px solid #eed88e;
  border-radius: 999px;
  color: #725817;
  display: inline-block;
  font-size: 0.66rem;
  margin-top: 0.28rem;
  padding: 0.1rem 0.38rem;
}

.timesheet-entry-time {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  white-space: nowrap;
}

.timesheet-entry-time span {
  color: var(--muted);
}

.timesheet-entry-time strong {
  color: var(--row-ink);
  font-size: 0.9rem;
  font-weight: 400;
}

.timesheet-inspector dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  margin: 1rem 0;
}

.timesheet-inspector dt,
.timesheet-inspector dd {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 0.65rem 0;
}

.timesheet-inspector dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding-right: 1rem;
  text-transform: uppercase;
}

.timesheet-inspector dd {
  text-align: right;
}

.inspector-notes {
  background: var(--brand-surface);
  border-radius: 8px;
  padding: 0.85rem;
}

.inspector-notes p:last-child {
  margin-bottom: 0;
  white-space: pre-wrap;
}

@media (max-width: 640px) {
  .ticket-controls {
    top: 3.55rem;
  }

  .page-shell {
    padding: 1.5rem 1rem 5.5rem;
  }

  .site-header {
    padding: 0.8rem 1rem;
  }

  .ticket-first-heading {
    margin-bottom: 1.35rem;
  }

  .ticket-card {
    gap: 0.55rem;
    padding: 0.58rem 0.65rem;
  }

  .ticket-inspector {
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -18px 55px rgb(23 32 27 / 20%);
    height: auto;
    inset: auto 0 0;
    margin: auto;
    max-height: 86dvh;
    max-width: none;
    padding: 1rem;
  }

  .ticket-detail-grid {
    grid-template-columns: 1fr;
  }

  .buffer-editor-grid {
    grid-template-columns: 1fr;
  }

  .buffer-editor-grid.compact .field-wide {
    grid-column: auto;
  }

  .floating-quick-add {
    bottom: 5.3rem;
    left: 1rem;
    right: 1rem;
    width: calc(100vw - 2rem);
  }

  .buffer-batch-footer,
  .buffer-review-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .buffer-batch-footer .button,
  .buffer-review-panel .review-toggle {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 460px) {
  .ticket-card {
    grid-template-columns: 1.8rem minmax(0, 1fr) 2.25rem;
  }

  .ticket-mark {
    width: 1.8rem;
  }

  .button.quick-add-button {
    border-radius: 50%;
    display: grid;
    font-size: 1.35rem;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
    place-items: center;
    width: 2.25rem;
  }

  .quick-add-label {
    display: none;
  }

  .quick-add-compact {
    display: block;
    font-family: Arial, sans-serif;
    font-weight: 400;
    line-height: 1;
    transform: translateY(-0.04em);
  }

  .timesheet-period-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .timesheet-period-toggle .button {
    flex: 1;
    text-align: center;
  }

  .timesheet-period-summary {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    text-align: left;
  }

  .timesheet-freshness {
    text-align: left;
  }
}

@media (min-width: 461px) {
  .quick-add-compact {
    display: none;
  }
}

a {
  color: var(--brand-blue-dark);
  text-decoration-color: var(--brand-blue);
  text-decoration-thickness: 2px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--brand-deep);
}

h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.15rem;
  line-height: 1.3;
}

.site-header {
  align-items: center;
  background: rgb(32 32 32 / 96%);
  border-top: 3px solid var(--brand-blue);
  display: flex;
  justify-content: space-between;
  padding: 1rem max(1.25rem, calc((100vw - 1120px) / 2));
  position: sticky;
  top: 0;
  backdrop-filter: blur(16px);
  z-index: 10;
}

.site-header nav {
  align-items: center;
  display: flex;
  gap: 1rem;
}

.site-header nav form {
  margin: 0;
}

.account-nav {
  gap: 1.25rem;
}

.profile-trigger {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--gold);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  gap: 0.45rem;
  padding: 0.45rem 0;
}

.profile-caret {
  border-left: 0.28rem solid transparent;
  border-right: 0.28rem solid transparent;
  border-top: 0.42rem solid currentColor;
  flex: none;
  height: 0;
  transform: translateY(0.06rem);
  width: 0;
}

.profile-menu {
  inset: 4.5rem 1.25rem auto auto;
  padding: 0.85rem;
  width: min(23rem, calc(100vw - 2rem));
}

.profile-menu-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.2rem 0.2rem 0.8rem;
}

.profile-menu-heading strong {
  font-size: 1rem;
}

.profile-menu-heading p {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0.2rem 0 0;
}

.profile-menu-links {
  border-top: 1px solid var(--line);
}

.profile-menu-link {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  justify-content: space-between;
  padding: 0.75rem 0.25rem;
  text-align: left;
  text-decoration: none;
  width: 100%;
}

.profile-menu-link:hover,
.profile-menu-link:focus-visible {
  color: var(--green);
}

.profile-menu-links form {
  margin: 0;
}

.profile-menu-toggle span:last-child {
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 800;
}

.sign-out-link {
  color: var(--red);
}

.brand {
  color: white;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.page-shell {
  margin: 0 auto;
  max-width: 1120px;
  padding: 3rem 1.25rem 6rem;
}

.impersonation-banner {
  background: #6b240f;
  color: white;
  padding: 0.65rem max(1.25rem, calc((100vw - 1120px) / 2));
  position: sticky;
  top: 4.25rem;
  z-index: 9;
}

.impersonation-banner form {
  display: inline-block;
  margin-left: 0.75rem;
}

.banner-button {
  background: white;
  border-color: white;
  color: #6b240f;
  padding: 0.35rem 0.65rem;
}

.context-preview-selector {
  background: #fff8df;
  border: 1px solid #eed78f;
  border-radius: 12px;
  margin: 1.5rem 0;
  padding: 1rem;
}

.context-preview-selector p:last-of-type {
  margin-bottom: 0.75rem;
}

.review-context-picker {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
  padding: 1rem;
}

.review-context-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.review-context-heading h2 {
  margin-bottom: 0.25rem;
}

.read-only-badge {
  background: #e9f7fc;
  border: 1px solid #a9dff2;
  border-radius: 999px;
  color: var(--green-dark);
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.28rem 0.55rem;
  text-transform: uppercase;
}

.member-picker-form {
  display: grid;
  gap: 0.45rem;
}

.member-picker-form select {
  min-height: 3.15rem;
  width: 100%;
}

.field-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
}

.selected-context-state {
  align-items: center;
  display: grid;
  gap: 0.15rem 1rem;
  grid-template-columns: 1fr auto;
}

.selected-context-state strong,
.selected-context-state span {
  display: block;
}

.selected-context-state span {
  color: var(--muted);
  font-size: 0.82rem;
}

.selected-context-state form {
  grid-column: 2;
  grid-row: 1 / span 2;
  margin: 0;
}

.compact-button {
  padding: 0.45rem 0.7rem;
}

.picker-status {
  margin: 0.75rem 0 0;
}

.prompt-preview {
  background: #f7f7f7;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
}

.prompt-preview summary {
  cursor: pointer;
  font-weight: 800;
}

.prompt-preview pre {
  background: #17201b;
  border-radius: 9px;
  color: #e9f7fc;
  font-size: 0.78rem;
  max-height: 36rem;
  overflow: auto;
  padding: 1rem;
  white-space: pre-wrap;
}

.inspector-link {
  background: #f2f5f1;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
  font-weight: 800;
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
  text-decoration: none;
}

.inspector {
  background: #f2f5f1;
  border: 1px solid var(--line);
  border-radius: 18px;
  margin-bottom: 1.25rem;
  padding: clamp(1rem, 3vw, 1.5rem);
}

.inspector-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.inspector details {
  border-top: 1px solid var(--line);
  padding: 0.8rem 0;
}

.inspector summary {
  cursor: pointer;
  font-weight: 800;
}

.inspector pre {
  background: #17201b;
  border-radius: 9px;
  color: #e7f0e7;
  font-size: 0.75rem;
  max-height: 34rem;
  overflow: auto;
  padding: 1rem;
  white-space: pre-wrap;
}

.inspector-scope {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  margin: 1rem 0;
}

.inspector-scope > div {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}

.inspector-scope span {
  color: var(--muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inspector-scope strong {
  display: block;
  margin-top: 0.2rem;
}

.no-write-inspector,
.no-write-banner {
  background: #fff8df;
  border: 1px solid #eed78f;
  border-radius: 10px;
  color: #614d10;
}

.no-write-inspector {
  margin-bottom: 0.5rem;
  padding: 0.8rem 0.9rem;
}

.no-write-inspector p {
  margin: 0.2rem 0 0;
}

.preview-status,
.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

.preview-status {
  margin-left: 0.75rem;
}

.preview-controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.preview-controls .preview-status {
  margin-left: 0;
}

.selected-context-state,
.preview-context-summary {
  background: #e8f5eb;
  border: 1px solid #b9d8c1;
  border-radius: 10px;
  margin-top: 0.9rem;
  padding: 0.8rem 0.9rem;
}

.selected-context-state {
  margin-bottom: 0;
}

.reviewer-readiness {
  border-top: 1px solid #eed78f;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
}

.readiness-results {
  display: grid;
  gap: 0.45rem;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.readiness-choice {
  background: #fbfcfa;
  border: 1px solid #bdc9bf;
  border-radius: 9px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  padding: 0.7rem 0.8rem;
  text-align: left;
  width: 100%;
}

.readiness-choice:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(40 101 62 / 14%);
  outline: none;
}

.preview-context-summary h3 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}

.preview-context-summary p,
.preview-context-summary ul {
  margin-bottom: 0.5rem;
}

.preview-context-summary ul {
  max-height: 18rem;
  overflow: auto;
}

.context-availability {
  font-weight: 750;
}

.exact-composition {
  border-top: 1px solid var(--line);
  margin-top: 0.9rem;
  padding-top: 0.75rem;
}

.inspection-result {
  background: #eef8fc;
  border: 1px solid #a9dff2;
  border-radius: 14px;
  padding: 1rem;
  min-width: 0;
}

.inspection-result h2 {
  margin-bottom: 0.8rem;
}

.inspection-entry {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 0.65rem;
  padding: 0.8rem;
  min-width: 0;
}

.inspection-entry h3,
.inspection-entry p:last-child {
  margin-bottom: 0;
}

.inspection-entry .muted {
  margin-bottom: 0.35rem;
}

.clarification-list {
  margin-bottom: 0;
}

.proposal-status {
  margin: -0.35rem 0 0;
  text-align: right;
}

.proposal-context-notice {
  background: #fff7e6;
  border: 1px solid #d8bb7b;
  border-radius: 10px;
  margin-bottom: 1rem;
  padding: 0.8rem;
}

.proposal-context-notice p {
  margin-bottom: 0.65rem;
}

.real-context-review-gate h2 {
  margin-bottom: 0.45rem;
}

.real-context-review-gate p:last-child {
  margin-bottom: 0;
}

.hero {
  max-width: 760px;
  padding: 2rem 0 1.5rem;
}

.hero > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.15rem;
}

.eyebrow {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
  padding: clamp(1.25rem, 3vw, 2rem);
}

.auth-panel {
  max-width: 520px;
}

.warning,
.ambiguity,
.clarification {
  background: #fff8df;
  border: 1px solid #eed78f;
  border-radius: 12px;
  color: #614d10;
  margin-bottom: 1.5rem;
  padding: 1rem;
}

.errors,
.flash-alert {
  background: #fff0ef;
  border-color: #eab9b5;
  color: #762a26;
}

.flash {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
}

.flash-notice {
  background: #e9f7fc;
  color: var(--green-dark);
}

.field {
  margin-bottom: 1rem;
}

.field label,
.revision-form > label {
  display: block;
  font-size: 0.82rem;
  font-weight: 750;
  margin-bottom: 0.35rem;
}

input,
select,
textarea {
  background: #ffffff;
  border: 1px solid #b7b7b7;
  border-radius: 9px;
  color: var(--ink);
  font: inherit;
  padding: 0.72rem 0.82rem;
  width: 100%;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgb(89 157 214 / 28%);
  outline: none;
}

.button {
  background: #f3f3f3;
  border: 1px solid #b7b7b7;
  border-radius: 9px;
  color: var(--green-dark);
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-weight: 750;
  padding: 0.68rem 1rem;
  text-decoration: none;
  width: auto;
}

.button-primary {
  background: var(--brand-blue-dark);
  border-color: var(--brand-blue-dark);
  color: white;
}

.button-secondary {
  background: #e9f7fc;
}

.button-danger {
  background: #fff0ef;
  border-color: #eab9b5;
  color: var(--red);
}

.button:disabled,
button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.capture-shell,
.review-shell {
  margin: 0 auto;
  max-width: 760px;
  min-width: 0;
  width: 100%;
}

.capture-shell {
  padding-top: clamp(1rem, 8vh, 5rem);
}

.capture-intro {
  margin-bottom: 1.5rem;
  max-width: 650px;
}

.capture-intro h1 {
  margin-bottom: 0.75rem;
}

.capture-intro > p:last-child {
  color: var(--muted);
}

.capture-form {
  display: grid;
  gap: 0.9rem;
  min-width: 0;
  width: 100%;
}

.note-label {
  font-size: 1rem;
  margin-bottom: -0.4rem;
}

.capture-input {
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--shadow);
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  line-height: 1.5;
  min-height: 10rem;
  padding: 1.1rem;
}

.capture-submit {
  align-items: center;
  display: inline-flex;
  gap: 0.45rem;
  justify-self: end;
  min-height: 3rem;
  padding-inline: 1.35rem;
}

.button-icon {
  fill: none;
  height: 1.15rem;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 1.15rem;
}

.capture-shell-minimal {
  max-width: 720px;
  padding-top: clamp(0.75rem, 4vh, 2.5rem);
}

.capture-shell-minimal > h1 {
  font-size: clamp(2rem, 7vw, 3rem);
  margin-bottom: 1.5rem;
}

.primary-member-picker {
  margin-bottom: 1.15rem;
}

.primary-member-picker select {
  background: var(--panel);
  box-shadow: 0 6px 20px rgb(25 48 33 / 5%);
}

.minimal-capture-form {
  gap: 0.8rem;
}

.minimal-capture-form > * {
  max-width: 100%;
  min-width: 0;
}

.minimal-capture-form .capture-input {
  min-height: 10rem;
}

.external-control-form {
  display: none;
}

.auxiliary-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 0.75rem 0;
}

.auxiliary-panel > summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 750;
}

.auxiliary-panel[open] > summary {
  color: var(--ink);
  margin-bottom: 0.85rem;
}

.note-heading-row {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.note-heading-row .note-label {
  margin: 0;
}

.note-utilities {
  align-items: flex-start;
  display: flex;
  gap: 0.9rem;
  justify-content: space-between;
  margin-top: -0.4rem;
}

.note-utility-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.inline-warning {
  color: var(--red);
  font-size: 0.8rem;
  margin: -0.3rem 0 0;
}

.utility-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 650;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted), transparent 55%);
  text-underline-offset: 0.18rem;
}

.utility-link:hover,
.utility-link:focus-visible {
  color: var(--ink);
}

.context-popover {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgb(14 30 20 / 22%);
  color: var(--ink);
  max-height: min(80vh, 48rem);
  max-width: calc(100vw - 2rem);
  overflow: auto;
  padding: 1rem;
  width: min(34rem, calc(100vw - 2rem));
}

.context-popover::backdrop {
  background: rgb(16 28 20 / 24%);
}

.popover-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.popover-heading h2 {
  font-size: 1.1rem;
  margin: 0 0 0.2rem;
}

.popover-heading p,
.popover-help {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0;
}

.popover-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0;
}

.standing-instruction-popover textarea {
  background: white;
  font-size: 0.92rem;
  margin-top: 0.3rem;
  min-height: 5.5rem;
}

.standing-instruction-popover .popover-help {
  margin: 0.35rem 0 0;
}

.settings-popover,
.compact-popover {
  width: min(30rem, calc(100vw - 2rem));
}

.settings-popover textarea {
  background: white;
  min-height: 7rem;
}

.settings-destination {
  border: 0;
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
}

.settings-destination legend {
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 0.15rem;
}

.settings-destination label {
  align-items: center;
  display: flex;
  gap: 0.45rem;
}

.settings-destination input[type="radio"] {
  padding: 0;
  width: auto;
}

.settings-destination small,
.settings-destination-unavailable {
  color: var(--muted);
}

.popover-actions {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.popover-status {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

.diagnostics-popover {
  width: min(42rem, calc(100vw - 2rem));
}

.diagnostic-section + .diagnostic-section {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1rem;
}

.diagnostic-section h3 {
  font-size: 0.95rem;
  margin: 0 0 0.4rem;
}

.diagnostic-section p {
  font-size: 0.84rem;
}

.technical-diagnostics > summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 750;
}

.generation-spinner {
  animation: generation-spin 0.75s linear infinite;
  border: 2px solid rgb(255 255 255 / 45%);
  border-radius: 50%;
  border-top-color: white;
  display: inline-block;
  height: 1rem;
  margin-right: 0.45rem;
  vertical-align: -0.15rem;
  width: 1rem;
}

.generation-spinner[hidden] {
  display: none;
}

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

.prompt-glossary {
  background: color-mix(in srgb, var(--panel), var(--brand-soft) 20%);
  border-radius: 10px;
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem;
}

.prompt-glossary p {
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.45;
  margin: 0 0 0.45rem;
}

.prompt-glossary p:last-child {
  margin-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .generation-spinner {
    animation-duration: 1.5s;
  }
}

.capture-shell-minimal .prompt-preview pre,
.model-response-popover pre {
  background: #17201b;
  border-radius: 9px;
  color: #e7f0e7;
  font-size: 0.75rem;
  max-height: 34rem;
  overflow: auto;
  padding: 1rem;
  white-space: pre-wrap;
}

.prompt-copy-actions {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin: 0.8rem 0;
}

.prompt-messages {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.prompt-message {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
  padding: 0.9rem;
}

.prompt-message h4 {
  color: var(--green-dark);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.7rem;
  text-transform: uppercase;
}

.capture-shell-minimal .prompt-messages pre {
  background: transparent;
  border-radius: 0;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.55;
  margin: 0;
  max-height: none;
  max-width: 100%;
  overflow: visible;
  overflow-wrap: anywhere;
  padding: 0;
  white-space: pre-wrap;
}

.capture-shell-minimal .preview-status {
  margin-left: 0;
}

.capture-shell-minimal .preview-context-summary {
  margin-top: 0.75rem;
}

.capture-shell-minimal .inspection-result {
  margin-top: 0.25rem;
}

.inspection-result-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.inspection-result-heading h2 {
  margin-bottom: 0.75rem;
}

.proposal-record-heading {
  min-width: 0;
}

.proposal-date {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.proposal-billing {
  background: #eef8fc;
  border: 1px solid #a9dff2;
  border-radius: 999px;
  color: var(--green-dark);
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.28rem 0.55rem;
}

.proposal-extra {
  border-top: 1px solid var(--line);
  margin-top: 0.8rem;
  padding-top: 0.7rem;
}

.proposal-extra-heading {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  margin: 0 0 0.65rem;
}

.entry-validation-message {
  background: #fff8df;
  border: 1px solid #eed78f;
  border-radius: 8px;
  color: #614d10;
  font-size: 0.82rem;
  margin: 0.65rem 0 0;
  padding: 0.5rem 0.65rem;
}

.settings-shell {
  margin: 0 auto;
  max-width: 720px;
}

.settings-heading {
  margin: 1rem 0 1.75rem;
}

.settings-heading > p:last-child {
  color: var(--muted);
  margin-bottom: 0;
}

.settings-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  padding: 1.1rem;
}

.settings-panel h2 {
  margin-bottom: 0.3rem;
}

.settings-form {
  display: grid;
  gap: 0.75rem;
}

.settings-form textarea {
  background: white;
  min-height: 8rem;
}

.settings-dev-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.settings-developer-panel {
  border-left: 3px solid var(--gold);
}

.settings-status-list {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}

.settings-status-list > div {
  align-items: baseline;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
}

.settings-status-list dt {
  color: var(--muted);
  font-size: 0.8rem;
}

.settings-status-list dd {
  margin: 0;
  text-align: right;
}

.model-response-trigger {
  flex: 0 0 auto;
  margin-top: 0.15rem;
}

.model-response-popover {
  width: min(62rem, calc(100vw - 2rem));
}

.model-response-popover pre {
  margin-bottom: 0;
}

.copy-region + .copy-region {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1rem;
}

.copy-region-heading {
  align-items: baseline;
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.copy-region-heading h3 {
  font-size: 0.9rem;
  margin: 0;
}

.copy-control {
  margin-left: auto;
}

.copy-status {
  color: var(--muted);
  font-size: 0.72rem;
  min-height: 1em;
}

.clarification-list li {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.inspection-entry-header {
  align-items: flex-start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.inspection-entry-header h3 {
  margin: 0;
}

.inspection-entry-compact-header {
  align-items: flex-start;
}

.inspection-entry-overview {
  min-width: 0;
}

.inspection-entry-date,
.inspection-entry-target-context {
  color: var(--muted);
  font-size: 0.76rem;
  margin: 0;
}

.inspection-entry-date {
  font-weight: 750;
  margin-bottom: 0.15rem;
}

.inspection-entry-target-context {
  margin-top: 0.15rem;
}

.inspection-entry-billing {
  background: #edf5ee;
  border: 1px solid #c9dfcd;
  border-radius: 999px;
  color: var(--green-dark);
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.24rem 0.48rem;
}

.inspection-entry-narrative {
  margin: 0.7rem 0;
  overflow-wrap: anywhere;
}

.inspection-entry-details {
  border-top: 1px solid var(--line);
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  min-width: 0;
}

.inspection-entry-details-heading {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  margin: 0 0 0.6rem;
}

.proposal-field-group + .proposal-field-group {
  border-top: 1px solid var(--line);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.proposal-field-group h4 {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

.entry-assumption-list {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.7rem 0 0;
  padding-left: 1.2rem;
}

.proposal-field-group .proposal-field-list {
  margin: 0;
}

.inspection-entry-incomplete {
  border-color: #d6a62c;
}

.entry-status-badge {
  background: #fff3cc;
  border-radius: 999px;
  color: #614d10;
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.5rem;
}

.proposal-field-list {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.8rem 0 0;
}

.proposal-field {
  background: #f7f9f6;
  border: 1px solid transparent;
  border-radius: 8px;
  min-width: 0;
  padding: 0.5rem 0.6rem;
}

.proposal-field dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.proposal-field dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.proposal-field .copy-control {
  display: block;
  margin: 0.35rem 0 0;
}

.proposal-field-invalid {
  background: #fff8df;
  border-color: #d6a62c;
}

.proposal-field-invalid p {
  color: #614d10;
  font-size: 0.76rem;
  margin: 0.25rem 0 0;
}

.entry-issue-list {
  color: #614d10;
  font-size: 0.82rem;
  margin: 0.75rem 0 0;
}

.proposal-editor {
  border-top: 1px solid var(--line);
  margin-top: 0.85rem;
  padding-top: 0.7rem;
}

.proposal-editor > summary {
  color: var(--green-dark);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 800;
}

.proposal-edit-form {
  border: 0;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.8rem;
  padding: 0;
}

.proposal-edit-fixed-fields {
  display: grid;
  gap: 0.45rem;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.proposal-edit-fixed-field {
  background: #f7f9f6;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.5rem 0.6rem;
}

.proposal-edit-fixed-field dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.proposal-edit-fixed-field dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
}

.proposal-edit-fixed-field-invalid {
  background: #fff8df;
  border-color: #d6a62c;
}

.proposal-edit-fixed-field small {
  color: #614d10;
  display: block;
  font-size: 0.72rem;
  margin-top: 0.25rem;
}

.proposal-edit-control {
  display: grid;
  font-size: 0.78rem;
  font-weight: 750;
  gap: 0.25rem;
}

.proposal-edit-control:has(textarea),
.proposal-edit-actions {
  grid-column: 1 / -1;
}

.proposal-edit-control input,
.proposal-edit-control select,
.proposal-edit-control textarea {
  background: white;
  font-size: 0.92rem;
  font-weight: 450;
  min-width: 0;
}

.proposal-edit-control input[type="checkbox"] {
  justify-self: start;
  width: auto;
}

.proposal-edit-control-invalid input,
.proposal-edit-control-invalid select,
.proposal-edit-control-invalid textarea {
  background: #fff8df;
  border-color: #d6a62c;
}

.proposal-edit-issue {
  color: #614d10;
  font-size: 0.72rem;
  font-weight: 550;
  line-height: 1.35;
}

.proposal-edit-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
  margin-top: 0.2rem;
}

.capture-shell-minimal .proposal-status {
  color: var(--muted);
  font-size: 0.82rem;
  margin: -0.25rem 0 0;
  min-height: 1.25rem;
  text-align: right;
}

@media (max-width: 620px) {
  .proposal-field-list {
    grid-template-columns: 1fr;
  }

  .proposal-edit-form {
    grid-template-columns: 1fr;
  }

  .proposal-edit-fixed-fields {
    grid-template-columns: 1fr;
  }

  .inspection-result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .model-response-trigger {
    margin-top: -0.45rem;
  }
}

.review-heading {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.review-heading h1 {
  font-size: clamp(2rem, 8vw, 3.15rem);
  margin-bottom: 0;
}

.source-note {
  background: #f1f8fb;
  border-radius: 14px;
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
}

.source-note-label {
  color: var(--muted);
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}

.source-note p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.no-write-banner {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem 0.9rem;
}

.no-write-banner span {
  font-size: 0.82rem;
}

.primary-actions,
.edit-actions {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  margin: 1.25rem 0;
}

.primary-actions form {
  margin: 0;
}

.proposal-list {
  display: grid;
  gap: 0.8rem;
}

.proposal-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.proposal-topline {
  align-items: flex-start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.proposal-company {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.proposal-topline h2 {
  font-size: 1rem;
  margin-bottom: 0.1rem;
}

.proposal-target {
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 0;
}

.proposal-time {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
}

.proposal-time strong {
  font-size: 1.05rem;
}

.proposal-time span {
  color: var(--muted);
  font-size: 0.75rem;
}

.proposal-narrative {
  margin: 0.8rem 0;
}

.proposal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.proposal-meta span {
  background: #f4f8fa;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.48rem;
}

.proposal-meta .meta-warning {
  background: #fff8df;
  color: #614d10;
}

.proposal-meta .meta-override {
  background: #f6e6ff;
  color: #6e2a82;
}

.proposal-form {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
}

.proposal-form-section h3,
.proposal-evidence h3 {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.55rem;
  text-transform: uppercase;
}

.proposal-field-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.proposal-field-grid > div {
  background: #f9f9f9;
  border-radius: 9px;
  min-width: 0;
  padding: 0.55rem 0.65rem;
}

.proposal-field-grid dt {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.proposal-field-grid dd {
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
}

.proposal-evidence,
.command-preview {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 0.8rem;
}

.proposal-evidence summary,
.command-preview summary {
  color: var(--green);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.evidence-grid {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.proposal-evidence pre,
.command-preview pre {
  background: #17201b;
  border-radius: 9px;
  color: #e7f0e7;
  font-size: 0.7rem;
  max-height: 22rem;
  overflow: auto;
  padding: 0.8rem;
  white-space: pre-wrap;
}

.command-preview > p {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.6rem 0;
}

.field-unavailable {
  color: #8a4e21;
  font-style: italic;
}

.batch-edit-fields {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1rem 0 0;
  padding: 1rem 0 0;
}

.batch-edit-fields legend {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0 0.4rem 0 0;
}

.batch-edit-fields label,
.batch-edit-fields .field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 750;
  margin-bottom: 0.35rem;
}

.omit-control {
  align-items: center;
  display: flex !important;
  gap: 0.5rem;
  margin-bottom: 0.8rem !important;
}

.omit-control input {
  height: 1.1rem;
  margin: 0;
  width: 1.1rem;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--green);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.6rem 0;
  text-decoration: underline;
}

.manual-editor {
  background: #f6f8f5;
  border-radius: 12px;
  margin-top: 0.5rem;
  padding: 0.9rem;
}

.manual-heading {
  align-items: center;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

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

.edit-actions {
  background: rgb(244 247 242 / 94%);
  bottom: 0;
  border-top: 1px solid var(--line);
  margin-bottom: 0;
  padding: 0.8rem 0;
  position: sticky;
}

.success-panel {
  background: #e9f7fc;
  border: 1px solid #a9dff2;
  border-radius: 18px;
  margin-bottom: 1.25rem;
  padding: 1.25rem;
}

.success-panel h2 {
  font-size: 1.4rem;
}

.capture-again {
  margin: 2rem 0;
}

.version-history {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 1rem;
}

.version-history summary {
  cursor: pointer;
  font-weight: 750;
  margin-bottom: 0.7rem;
}

.page-heading,
.entry-heading,
.version-bar {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.page-heading h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0;
}

.status {
  background: #f1f8fb;
  border-radius: 999px;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.3rem 0.65rem;
  white-space: nowrap;
}

.status-rejected {
  background: #fff0ef;
  color: var(--red);
}

.status-accepted {
  background: #e9f7fc;
  color: var(--green-dark);
}

.source-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  margin-bottom: 0;
  white-space: pre-wrap;
}

.version-bar {
  background: #f1f8fb;
  border-radius: 13px;
  padding: 0.9rem 1rem;
}

.version-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.version-links a {
  border-radius: 6px;
  padding: 0.2rem 0.45rem;
  text-decoration: none;
}

.version-links a.active {
  background: var(--green);
  color: var(--brand-charcoal);
}

.entry-stack {
  display: grid;
  gap: 1.25rem;
}

.entry-card {
  margin-bottom: 0;
}

.entry-heading h2 {
  margin-bottom: 0;
}

.field-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.entry-actions {
  border-top: 1px solid var(--line);
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
}

.entry-actions form,
.accept-box form {
  margin: 0;
}

.revision-form {
  margin-top: 1.25rem;
}

.inline-form {
  display: flex;
  gap: 0.6rem;
}

.inline-form input[type="text"] {
  flex: 1;
}

.accept-box {
  align-items: center;
  background: #edf6ef;
  border: 1px solid #bdd9c3;
  border-radius: 12px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-top: 1.5rem;
  padding: 1rem;
}

.accept-box p {
  margin-bottom: 0;
}

.history-list {
  display: grid;
}

.history-item {
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 0;
  text-decoration: none;
}

.history-item:last-child {
  border-bottom: 0;
}

.history-item small {
  color: var(--muted);
}

@media (max-width: 760px) {
  .page-shell {
    padding-top: 1.5rem;
  }

  .page-heading,
  .entry-heading,
  .version-bar,
  .accept-box {
    align-items: flex-start;
    flex-direction: column;
  }

  .field-grid,
  .code-grid,
  .inspector-scope,
  .proposal-field-grid {
    grid-template-columns: 1fr;
  }

  .inline-form {
    flex-direction: column;
  }

  .selected-context-state {
    grid-template-columns: 1fr;
  }

  .selected-context-state form {
    grid-column: 1;
    grid-row: auto;
    margin-top: 0.5rem;
  }

  .site-header {
    padding-block: 0.75rem;
  }

  .site-header nav a:not(:first-child) {
    display: none;
  }

  .account-nav {
    gap: 0.75rem;
  }

  .profile-trigger {
    font-size: 0.9rem;
  }

  .profile-menu {
    inset: 3.9rem 0.75rem auto 0.75rem;
    width: auto;
  }

  .page-shell {
    padding-inline: 0.9rem;
  }

  .review-heading {
    align-items: flex-start;
  }

  .review-heading .status {
    margin-top: 0.35rem;
  }

  .capture-submit,
  .primary-actions .button,
  .primary-actions form,
  .primary-actions form .button {
    width: 100%;
  }

  .primary-actions,
  .edit-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .proposal-topline {
    gap: 0.6rem;
  }

  .proposal-billing {
    font-size: 0.68rem;
    padding: 0.24rem 0.42rem;
  }

  .proposal-narrative {
    font-size: 0.92rem;
  }

  .settings-status-list > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.1rem;
  }

  .settings-status-list dd {
    text-align: left;
  }

  .proposal-time strong {
    font-size: 0.95rem;
  }

  .compact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .edit-actions .muted {
    text-align: center;
  }
}
