:root {
  color-scheme: light;
  --bg: #0c2340;
  --bg-deep: #07182d;
  --panel: #ffffff;
  --panel-soft: #f7fafc;
  --line: #c4ced4;
  --line-strong: #8fa5b8;
  --text: #102238;
  --muted: #52657a;
  --accent: #003087;
  --accent-hover: #001f5c;
  --accent-soft: #edf4ff;
  --yankees-gray: #c4ced4;
  --warn: #763628;
  --warn-bg: #fff2ed;
  --warn-line: #cf806b;
  --missing-bg: #edf5fa;
  --missing-bg-strong: #e3eef6;
  --missing-line: #9db6ca;
  --missing-line-hover: #7698b5;
  --source-bg: #dceef3;
  --source-bg-hover: #c9e4eb;
  --source-bg-active: #b3d7e1;
  --source-line: #6fa6b5;
  --success: #146c43;
  --success-bg: #ecf8f0;
  --danger: #a4262c;
  --panel-border: #ffffff;
  --shadow: 0 16px 42px rgba(3, 17, 34, 0.24), 0 2px 8px rgba(3, 17, 34, 0.1);
  --control-border: #cfd8e2;
  --control-border-hover: #9fb0c1;
  --focus-ring: 0 0 0 3px rgba(0, 48, 135, 0.13);
  --navy: var(--bg);
  --ink: var(--text);
  --font-ui: var(--font-body);
  --font-body: "Neue Haas Grotesk Text Pro", "Neue Haas Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-header: Cheltenham, "ITC Cheltenham", "Cheltenham Std", Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -20%, rgba(255, 255, 255, 0.1), transparent 380px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 260px),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.shell {
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(420px, 1fr);
  align-items: stretch;
  gap: 18px;
  height: 100vh;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
}

.pane {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
  box-shadow: none;
}

.input-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.review-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.input-pane header,
.top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.input-pane header {
  margin-bottom: 12px;
  justify-content: flex-end;
}

.input-pane > .thread-panel {
  margin-top: 0;
}

.top-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex: 1 1 100%;
  min-width: 220px;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-header);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

h1 {
  font-size: 27px;
  color: var(--bg);
  flex: 0 0 auto;
}

h2 {
  font-size: 18px;
  color: var(--bg);
}

p {
  color: var(--muted);
  line-height: 1.4;
}

textarea {
  display: block;
  width: 100%;
  height: calc(100vh - 190px);
  min-height: 420px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #ffffff;
  padding: 12px;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
}

textarea:focus {
  background: #ffffff;
}

textarea::placeholder {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
}

.hidden {
  display: none !important;
}

.thread-panel {
  position: relative;
  border: 2px solid var(--panel-border);
  border-radius: 10px;
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.thread-panel,
.thread-panel:focus-within,
.thread-panel > textarea,
.thread-panel > textarea:hover,
.thread-panel > textarea:focus,
.thread-panel > textarea:active {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
}

.thread-panel:has(#threadInput:placeholder-shown)::after {
  content: "";
  position: absolute;
  top: 74px;
  left: calc(12px + 25.5ch);
  z-index: 2;
  width: 2px;
  height: 17px;
  border-radius: 1px;
  background: var(--text);
  animation: paste-caret-blink 1s steps(1, end) infinite;
  pointer-events: none;
}

@keyframes paste-caret-blink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

.thread-panel-head {
  position: relative;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  height: 60px;
  min-height: 60px;
  border-bottom: 2px solid var(--panel-border);
  border-radius: 8px 8px 0 0;
  background: var(--bg);
  padding: 12px 18px;
}

.thread-panel-head h2,
.review-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: #ffffff;
  font-family: var(--font-header);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  min-width: 0;
}

.panel-title-icon {
  display: none;
}

.thread-panel-head button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.extractor-warning {
  display: grid;
  gap: 2px;
  border-bottom: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn);
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.25;
}

.extractor-warning strong {
  font-weight: 900;
  text-transform: uppercase;
}

.extractor-warning span {
  font-weight: 700;
}

.thread-view {
  display: grid;
  align-content: start;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 160px),
    var(--bg);
}

.thread-view.empty {
  display: block;
  color: rgba(255, 255, 255, 0.84);
  background: var(--bg);
}

.thread-raw {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  resize: none;
  border: 0 !important;
  border-radius: 0;
  outline: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  -webkit-appearance: none;
  appearance: none;
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  caret-color: var(--text);
  color: var(--text);
  font: 14px/1.45 var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
}

#threadInput,
#threadInput:hover,
#threadInput:active,
.thread-raw:focus,
.thread-raw:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
}

.email-card {
  border: 1px solid rgba(196, 206, 212, 0.92);
  border-radius: 7px;
  background: #ffffff;
  padding: 10px 12px;
  min-width: 0;
  box-shadow: 0 6px 16px rgba(3, 17, 34, 0.18);
  text-transform: none;
  font-weight: 500;
}

.email-header {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border-bottom: 1px solid #d8e0e7;
  padding-bottom: 7px;
  margin-bottom: 7px;
}

.email-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.email-meta {
  min-width: 0;
}

.email-meta-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.email-meta-top strong {
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.15;
  font-weight: 800;
}

.email-meta-top span,
.email-sub {
  color: var(--muted);
  font-size: 11.5px;
}

.email-meta-top span {
  flex: 0 0 auto;
  text-align: right;
}

.email-sub {
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.email-body {
  color: var(--text);
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
  text-transform: none;
  font-weight: 500;
}

.email-body.empty {
  color: var(--muted);
}

.email-body p {
  margin: 0 0 6px;
  color: var(--text);
  text-transform: none;
  font-weight: 500;
}

.email-body p:last-child,
.email-body ul:last-child {
  margin-bottom: 0;
}

.email-body ul {
  margin: 0 0 6px;
  padding-left: 18px;
}

.source-highlight {
  position: relative;
  display: inline-block;
  border-radius: 4px;
  background: var(--source-bg);
  color: inherit;
  padding: 0 2px;
  box-shadow: inset 0 -1px 0 var(--source-line);
  cursor: help;
}

.source-highlight:hover {
  background: var(--source-bg-hover);
}

.source-highlight-active {
  background: var(--source-bg-active);
  box-shadow:
    inset 0 -1px 0 #467f8f,
    0 0 0 3px rgba(78, 151, 169, 0.42);
  animation: sourcePulse 1.4s ease-out;
}

@keyframes sourcePulse {
  0% {
    box-shadow:
      inset 0 -1px 0 #467f8f,
      0 0 0 0 rgba(78, 151, 169, 0.68);
  }
  100% {
    box-shadow:
      inset 0 -1px 0 #467f8f,
      0 0 0 8px rgba(78, 151, 169, 0);
  }
}

.source-highlight:hover::after,
.source-highlight:focus::after {
  content: attr(data-source-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  z-index: 20;
  transform: translateX(-50%);
  width: max-content;
  max-width: 240px;
  border-radius: 6px;
  background: #111827;
  color: #ffffff;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: normal;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.22);
  pointer-events: none;
}

.source-highlight:hover::before,
.source-highlight:focus::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 2px);
  z-index: 21;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #111827;
  pointer-events: none;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

button {
  border: 1px solid var(--bg);
  background: var(--bg);
  color: white;
  border-radius: 6px;
  min-height: 36px;
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(12, 35, 64, 0.12);
}

button:hover:not(:disabled) {
  border-color: var(--bg-deep);
  background: var(--bg-deep);
}

button.secondary {
  background: var(--bg);
  color: #ffffff;
  border-color: var(--bg);
}

button.secondary:hover:not(:disabled) {
  border-color: var(--bg-deep);
  background: var(--bg-deep);
  color: #ffffff;
}

button.secondary.danger {
  border-color: var(--danger);
  background: #fff4f2;
  color: var(--danger);
}

button.secondary.danger:hover:not(:disabled) {
  border-color: var(--danger);
  background: var(--danger);
  color: #ffffff;
}

button.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-color: var(--bg);
  background: var(--bg);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

button.small-button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 12px;
  white-space: nowrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.status {
  min-height: 0;
  margin: 0 0 4px;
  color: var(--muted);
  font-weight: 650;
  font-size: 12px;
  line-height: 1.2;
}

.queue {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.queue-drawer {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(7, 24, 45, 0.62);
}

.queue-drawer.hidden {
  display: none;
}

.queue-drawer-card {
  width: min(480px, 100%);
  height: 100%;
  border-left: 1px solid var(--line);
  background: #ffffff;
  box-shadow: -18px 0 48px rgba(3, 17, 34, 0.32);
  padding: 16px;
  overflow: auto;
}

#queueDrawer .queue-drawer-card,
#jobHistoryDrawer .queue-drawer-card {
  width: min(1500px, calc(100vw - 22px));
  height: min(780px, calc(100vh - 22px));
  border: 2px solid var(--panel-border);
  border-radius: 10px;
  padding: 18px;
}

#queueDrawer .queue-drawer-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.queue-drawer .queue-list {
  max-height: none;
}

.toast-host {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line-strong);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 12px 14px;
  box-shadow: 0 16px 42px rgba(3, 17, 34, 0.26);
  animation: toast-in 180ms ease-out;
}

.toast-needs-action {
  border-left-color: var(--warn-line);
}

.toast strong {
  font-size: 14px;
}

.toast span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.toast-exiting {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.queue-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(170px, 220px) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.queue-filter {
  display: grid;
  gap: 4px;
}

.queue-filter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.queue-filter select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
}

.queue-filter-summary {
  align-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  text-align: right;
  text-transform: none;
  padding-bottom: 4px;
}

.queue-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.queue-list.queue-grid {
  display: block;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

#queueDrawer .queue-list.queue-grid,
#queueDrawer .queue-list.empty {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}

.queue-list.empty {
  display: block;
  color: var(--muted);
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  text-align: left;
  padding: 8px;
}

.queue-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.queue-load {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.queue-load:hover:not(:disabled),
.queue-load:focus-visible {
  background: transparent;
  color: var(--text);
}

.queue-remove {
  align-self: center;
  min-height: 30px;
  padding: 0 10px;
  border-color: var(--bg);
  background: var(--bg);
  color: #ffffff;
  font-size: 11px;
}

.queue-title,
.queue-meta {
  display: block;
  overflow-wrap: anywhere;
}

.queue-title {
  font-weight: 800;
}

.queue-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.queue-item.status-needs_review {
  border-left: 4px solid var(--warn-line);
}

.queue-item.status-error {
  border-left: 4px solid var(--danger);
}

.queue-item.status-processed,
.queue-item.status-reviewed {
  border-left: 4px solid var(--success);
}

.review-grid-table {
  display: grid;
  min-width: 940px;
  width: 100%;
  font-size: 10.8px;
  line-height: 1.16;
}

.review-grid-row {
  display: grid;
  grid-template-columns: 62px minmax(108px, 0.9fr) minmax(145px, 1.18fr) minmax(145px, 1.12fr) 54px minmax(118px, 0.92fr) minmax(146px, 1.06fr) 68px 88px;
  gap: 7px;
  align-items: stretch;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.review-grid-row:last-child {
  border-bottom: 0;
}

.review-grid-head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 38px;
  background: var(--bg);
  color: #ffffff;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.review-grid-head span {
  display: flex;
  align-items: center;
  padding: 9px 6px;
  min-width: 0;
}

.review-grid-cell {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  padding: 8px 6px;
  overflow: hidden;
  color: var(--text);
  overflow-wrap: anywhere;
}

.review-grid-cell strong,
.review-grid-cell span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.review-grid-cell strong {
  font-size: 11.4px;
}

.review-grid-cell span {
  color: var(--muted);
}

.cell-renter span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-grid-row.status-needs_review {
  box-shadow: inset 4px 0 0 var(--warn-line);
}

.review-grid-row.status-error {
  box-shadow: inset 4px 0 0 var(--danger);
}

.review-grid-row.status-reviewed,
.review-grid-row.status-processed {
  box-shadow: inset 4px 0 0 var(--success);
}

.review-grid-row.status-dismissed,
.review-grid-row.status-deleted {
  box-shadow: inset 4px 0 0 var(--danger);
}

.queue-status-pill,
.queue-status-note {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 7px;
  background: #eef3f8;
  color: var(--text);
  font-size: 9.5px;
  white-space: nowrap;
}

.queue-status-note {
  background: var(--warn-bg);
  color: var(--warn);
}

.queue-status-note.stale {
  background: #fdecec;
  color: var(--danger);
}

.queue-row-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.queue-open,
.queue-remove {
  min-width: 0;
  min-height: 32px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 10px;
  white-space: nowrap;
}

.queue-open {
  border-color: var(--bg);
  background: var(--bg);
  color: #ffffff;
  width: 44px;
}

.queue-row-actions .queue-remove {
  border-color: #b42318;
  background: #fff4f2;
  color: #b42318;
  font-size: 16px;
  line-height: 1;
  width: 32px;
}

.job-history-list {
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

.job-history-list.history-grid {
  max-height: none;
}

.job-history-list.empty {
  display: block;
  color: var(--muted);
}

.job-item.job-item-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.14);
}

.job-item.status-clean {
  box-shadow: inset 4px 0 0 var(--success);
}

.job-item.status-needs_review,
.job-item.status-running {
  box-shadow: inset 4px 0 0 var(--warn-line);
}

.job-item.status-error,
.job-item.status-failed {
  box-shadow: inset 4px 0 0 var(--danger);
}

.job-history-table .review-grid-cell {
  min-height: 54px;
}

#jobHistoryDrawer .queue-drawer-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-outreach {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(170px, 0.72fr) minmax(190px, 0.78fr) minmax(330px, 1.35fr);
  gap: 9px 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid #d8e1e9;
  border-radius: 8px;
  background: #f7fafc;
}

.history-outreach-control {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.history-outreach-control > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.history-outreach-control select,
.history-outreach-control input,
.history-outreach-control textarea {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  padding: 6px 9px;
  text-transform: none;
}

.history-showing-schedule {
  display: grid;
  grid-template-columns: minmax(125px, 1.25fr) minmax(95px, 0.75fr);
  gap: 6px;
}

.history-showing-schedule select {
  cursor: pointer;
}

.history-outreach-control textarea {
  height: 54px;
  min-height: 54px;
  resize: vertical;
  line-height: 1.3;
}

.history-apartment-picker {
  display: grid;
  gap: 4px;
  max-height: 78px;
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--control-border);
  border-radius: 6px;
  background: #ffffff;
}

.history-apartment-option {
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 3px 5px;
  border-radius: 5px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.history-apartment-option:hover {
  background: #f3f7fb;
}

.history-apartment-option.is-selected {
  background: var(--accent-soft);
  color: var(--accent-hover);
  box-shadow: inset 0 0 0 1px rgba(0, 48, 135, 0.2);
}

.history-apartment-option input {
  width: 15px;
  height: 15px;
  min-height: 15px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.history-apartment-option small {
  color: var(--muted);
  font-size: 10px;
}

.history-apartment-empty {
  padding: 7px;
  color: var(--muted);
  font-size: 11px;
}

.history-message-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.history-message-heading > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.history-message-heading #historyTemplateSelect {
  width: auto;
  min-width: 145px;
  min-height: 24px;
  padding: 2px 6px;
  font-size: 10px;
}

.history-listing-filter {
  border-radius: 7px;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.history-listing-filter.is-active {
  margin: -5px;
  padding: 5px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px rgba(0, 48, 135, 0.22);
}

.history-listing-filter.is-active > span {
  color: var(--accent);
}

.history-listing-filter.is-active .history-apartment-picker {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: var(--focus-ring);
}

.history-outreach-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-select-all,
.history-row-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
  cursor: pointer;
}

.history-select-all input,
.history-row-select input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.history-row-select:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.46;
}

.history-selection-summary {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

#historySendSelectedBtn {
  margin-left: auto;
  min-width: 150px;
}

.job-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.job-main {
  min-width: 0;
}

.job-title,
.job-meta {
  display: block;
  overflow-wrap: anywhere;
}

.job-title {
  font-weight: 800;
}

.job-meta,
.job-counts {
  color: var(--muted);
  font-size: 12px;
}

.job-badge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: #f9fbfd;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.job-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.job-issues {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.job-issues ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.job-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
}

.job-actions button,
.job-actions a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.job-details.hidden {
  display: none;
}

.job-details {
  grid-column: 1 / -1;
  max-height: 260px;
  margin: 0 8px 8px;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbff;
  color: var(--text);
  font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.review-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  height: 60px;
  min-height: 60px;
  margin: 0;
  padding: 12px 18px;
  border: 0;
  border-bottom: 2px solid var(--panel-border);
  border-radius: 8px 8px 0 0;
  background: var(--bg);
}

.review-head-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.review-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.review-head-inline-action {
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.075);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.08);
}

.review-head-inline-action svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.review-head-inline-action:hover:not(:disabled),
.review-head-inline-action:focus-visible {
  background: var(--accent-soft);
  color: var(--bg-deep);
}

.viewer-identity-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 250px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.viewer-identity-chip[data-auth-mode="shared"] {
  background: rgba(153, 198, 211, 0.14);
  border-color: rgba(153, 198, 211, 0.36);
}

.viewer-identity-chip[data-auth-mode="google"] {
  background: rgba(107, 193, 255, 0.12);
  border-color: rgba(107, 193, 255, 0.3);
}

.viewer-identity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
}

.viewer-identity-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.viewer-identity-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.viewer-identity-text strong,
.viewer-identity-text span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-identity-text strong {
  font-size: 10px;
  letter-spacing: 0.05em;
  line-height: 1.1;
}

.viewer-identity-text span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.1;
}

.viewer-identity-switch {
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: none;
}

.viewer-identity-switch:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38);
}

.review-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.viewer-scope-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 7px 18px;
  border-bottom: 1px solid #dde5ec;
  background: linear-gradient(180deg, #f7fbff, #eef4fb);
}

.viewer-scope-label {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.admin-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-filter input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.desktop-actions,
.mobile-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.review-head-actions button.secondary,
.review-head-actions a.secondary {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.055);
  color: #ffffff;
  min-height: 36px;
  padding-inline: 10px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.review-head-actions button.secondary:hover:not(:disabled),
.review-head-actions a.secondary:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.notification-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding-inline: 10px;
}

.notification-button.is-icon {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.notification-button.is-muted {
  background: var(--bg-deep);
  border-color: var(--bg-deep);
}

.notification-log {
  display: none;
}

.notification-log.ok {
  color: #0a5c2f;
}

.notification-log.warn {
  color: var(--warn);
}

.notification-log.error {
  color: #a4262c;
}

.notification-settings-card {
  max-width: 620px;
}

.listing-alias-card {
  max-width: 560px;
}

.settings-reason {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.4;
}

.settings-field {
  display: grid;
  gap: 6px;
}

.settings-field span {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 14px 0;
}

.settings-actions button {
  min-height: 42px;
}

.settings-help {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.settings-help strong {
  display: block;
  margin-bottom: 8px;
  color: var(--navy);
}

.settings-help p {
  margin: 6px 0;
}

.settings-help span {
  color: var(--muted);
  font-weight: 800;
}

.badge {
  border-radius: 999px;
  background: var(--bg);
  color: #ffffff;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  margin-top: 0;
  padding: 9px 18px 8px;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.fields.empty {
  display: block;
  color: var(--muted);
}

.field {
  display: grid;
  grid-template-columns: 195px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 0;
  padding: 1px 0;
  min-width: 0;
  background: #ffffff;
  box-shadow: none;
  cursor: pointer;
}

.field label {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 0;
  line-height: 1.2;
  cursor: pointer;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid #d8dde6;
  border-radius: 5px;
  outline: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.3;
  min-height: 30px;
  background: #ffffff;
  padding: 5px 9px;
  text-transform: none;
}

.field textarea {
  display: block;
  min-height: 44px;
  height: 44px;
  resize: vertical;
  font-family: inherit;
  font-weight: 700;
}

.field.blank-field input,
.field.blank-field textarea,
.field.blank-field .radio-stack,
.field.blank-field .review-datetime input,
.field.blank-field .review-datetime select {
  border-color: var(--missing-line);
  background: var(--missing-bg);
  box-shadow: inset 0 0 0 1px rgba(87, 119, 145, 0.12);
}

.field.blank-field .radio-option {
  background: var(--missing-bg);
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.12);
}

.listing-picker {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.listing-picker-row {
  display: block;
}

.listing-suggestions {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbff;
  padding: 7px;
}

.listing-suggestions.error {
  border-color: var(--danger);
  background: #fff3f2;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.listing-suggestions-note,
.listing-suggestions-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

.listing-option-choice {
  width: 100%;
  min-height: 30px;
  justify-content: flex-start;
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--text);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 8px;
}

.listing-option-choice:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.required-mark {
  color: var(--warn);
}

.fillout-label::after {
  content: ":";
}

.radio-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  padding-top: 0;
  min-width: 0;
  overflow: hidden;
}

.radio-option {
  display: flex !important;
  align-items: center;
  gap: 6px;
  width: max-content;
  min-height: 20px;
  border: 0;
  border-radius: 0;
  padding: 0;
  border: 1px solid #d8dde6;
  border-radius: 5px;
  padding: 6px 9px;
  margin: 0 !important;
  color: var(--text) !important;
  font-size: 12px !important;
  font-weight: 800 !important;
}

.radio-option input {
  width: 13px;
  min-height: 13px;
  height: 13px;
  margin: 0;
  padding: 0;
  box-shadow: none;
}

.datetime-review-field {
  align-items: center;
}

.review-datetime {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 120px;
  gap: 7px;
  align-items: end;
}

.review-picker-group {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 5px;
  min-width: 0;
  align-items: stretch;
}

.review-picker-group.review-strict-picker-group {
  grid-template-columns: minmax(0, 1fr);
}

.review-strict-picker-group select {
  appearance: auto;
  cursor: pointer;
  padding-right: 24px;
}

.compact-time-control {
  display: grid !important;
  gap: 3px;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  line-height: 1.1 !important;
}

.compact-time-control span {
  text-transform: uppercase;
}

.review-datetime input,
.review-datetime select {
  width: 100%;
  border: 1px solid #d8dde6;
  border-radius: 5px;
  min-height: 30px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 5px 8px;
}

.review-native-picker {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px !important;
  height: 100%;
  min-height: 30px !important;
  padding: 0 !important;
  opacity: 0.01;
  pointer-events: none;
}

.picker-icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  min-height: 30px;
  border: 1px solid #d8dde6;
  border-radius: 5px;
  background: #ffffff;
  color: var(--bg);
  padding: 0;
}

.picker-icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.picker-icon-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ready-notice {
  display: grid;
  gap: 4px;
  border: 1px solid var(--success);
  border-radius: 8px;
  background: #eef8f0;
  color: #173b1f;
  padding: 12px;
  margin-bottom: 12px;
}

.ready-notice.hidden {
  display: none;
}

.ready-notice.attention {
  border-color: var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn);
}

.ready-notice strong {
  font-size: 16px;
}

.ready-notice span {
  font-size: 14px;
}

.popup {
  margin-top: 8px;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: 8px;
  padding: 10px 12px;
}

.popup.hidden {
  display: none;
}

.warnings {
  width: 100%;
  margin: 0;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: 8px;
  padding: 8px 10px;
  max-height: 96px;
  overflow: auto;
}

.warnings.hidden {
  display: none;
}

.warnings-title {
  font-weight: 800;
  font-size: 13px;
  margin-bottom: 4px;
}

.warnings ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.25;
}

.warnings li + li {
  margin-top: 2px;
}

.submit-bar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 66px;
  margin-top: auto;
  padding: 7px 18px 12px;
  border-top: 0;
  background: #ffffff;
}

.submit-bar button {
  min-height: 36px;
  font-size: 12px;
}

.submit-actions {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.submit-actions #dismissReviewBtn {
  justify-self: start;
  min-width: 104px;
  border-color: #b42318;
  background: #fff4f2;
  color: #b42318;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.submit-actions #dismissReviewBtn:hover:not(:disabled) {
  background: #ffe7e1;
  border-color: #912018;
  color: #912018;
}

.submit-actions #dismissReviewBtn svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.submit-bar #fillBtn {
  grid-column: 2;
  justify-self: center;
  min-width: 260px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-color: var(--bg);
  background: var(--bg);
  color: #ffffff;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(12, 35, 64, 0.12);
}

.submit-bar #forceSubmitBtn {
  grid-column: 2;
  justify-self: center;
  min-width: 260px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-color: #b95f49;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(154, 52, 18, 0.1);
}

.submit-bar #forceSubmitBtn:hover:not(:disabled) {
  border-color: #944432;
  background: #ffe7df;
  color: #61271c;
}

.submit-bar #forceSubmitBtn.hidden {
  display: none;
}

.force-submit-prompt {
  grid-column: 1 / -1;
  justify-self: stretch;
  display: grid;
  gap: 2px;
  max-width: 100%;
  border: 1px solid var(--warn-line);
  border-radius: 6px;
  background: var(--warn-bg);
  color: var(--warn);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.25;
}

.force-submit-prompt.hidden {
  display: none;
}

.nav-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  white-space: nowrap;
}

.desktop-actions .nav-action[aria-label],
.viewer-identity-switch[aria-label],
.icon-button[aria-label],
.picker-icon-button[aria-label],
.queue-remove[aria-label] {
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  .desktop-actions .nav-action[aria-label]::after,
  .viewer-identity-switch[aria-label]::after,
  .icon-button[aria-label]::after,
  .picker-icon-button[aria-label]::after,
  .queue-remove[aria-label]::after {
    position: absolute;
    z-index: 2000;
    top: calc(100% + 7px);
    left: 50%;
    width: max-content;
    max-width: min(240px, calc(100vw - 20px));
    padding: 5px 8px;
    transform: translate(-50%, -2px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: #071b33;
    color: #ffffff;
    box-shadow: 0 5px 14px rgba(3, 17, 34, 0.28);
    content: attr(aria-label);
    font: 700 11px/1.2 var(--font-body);
    letter-spacing: 0;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    text-transform: none;
    transition: opacity 100ms ease, transform 100ms ease;
    white-space: nowrap;
  }

  .desktop-actions .nav-action[aria-label]:hover::after,
  .desktop-actions .nav-action[aria-label]:focus-visible::after,
  .viewer-identity-switch[aria-label]:hover::after,
  .viewer-identity-switch[aria-label]:focus-visible::after,
  .icon-button[aria-label]:hover::after,
  .icon-button[aria-label]:focus-visible::after,
  .picker-icon-button[aria-label]:hover::after,
  .picker-icon-button[aria-label]:focus-visible::after,
  .queue-remove[aria-label]:hover::after,
  .queue-remove[aria-label]:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  .desktop-actions .nav-action[aria-label]:last-child::after {
    right: 0;
    left: auto;
    transform: translate(0, -2px);
  }

  .desktop-actions .nav-action[aria-label]:last-child:hover::after,
  .desktop-actions .nav-action[aria-label]:last-child:focus-visible::after {
    transform: translate(0, 0);
  }
}

.nav-action svg {
  display: none;
}

.review-head-actions .notification-button.is-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.review-head-actions .notification-button.is-icon span {
  display: none;
}

html.fillout-pwa-ux .review-head-actions .notification-button svg,
html.fillout-pwa-ux .review-head-actions button.secondary.notification-button svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.fillout-pwa-ux .review-head-actions .notification-button span,
html.fillout-pwa-ux .review-head-actions button.secondary.notification-button span {
  display: block;
}

.paste-thread-action {
  display: none;
}

.nav-action span {
  color: currentColor;
}

.nav-action .nav-count {
  display: none;
}

@media (max-width: 900px) {
  .review-head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 0;
  }

  .mobile-top-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 8px;
    height: 100%;
    min-width: 0;
  }

  .mobile-top-actions .nav-action,
  .mobile-top-actions button.secondary.nav-action {
    color: #ffffff !important;
  }

  .desktop-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 850;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    min-height: calc(66px + env(safe-area-inset-bottom));
    padding: 6px max(8px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    border-top: 1px solid rgba(196, 206, 212, 0.92);
    background: #ffffff;
    box-shadow: 0 -10px 28px rgba(3, 17, 34, 0.18);
    align-items: stretch;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
  }

  .desktop-actions > .nav-action,
  .desktop-actions > button.secondary.nav-action {
    width: 100%;
    max-width: none;
  }

  .review-head-actions .nav-action,
  .review-head-actions button.secondary.nav-action {
    position: relative;
    display: grid;
    grid-template-rows: 24px 18px;
    place-items: center;
    gap: 1px;
    min-width: 0;
    min-height: 54px;
    padding: 4px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--bg);
    box-shadow: none;
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
  }

  .review-head-actions .nav-action:hover:not(:disabled),
  .review-head-actions .nav-action:focus-visible {
    background: var(--accent-soft);
    color: var(--bg-deep);
  }

  .review-head-actions .nav-action svg {
    display: block;
    flex: 0 0 21px;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  .review-head-actions .nav-action span {
    display: block;
    max-width: 100%;
    overflow: visible;
    color: currentColor;
    font-size: clamp(8px, 2.2vw, 9px);
    font-weight: 850;
    line-height: 1.1;
    text-align: center;
    text-overflow: clip;
  }

  .review-head-actions .nav-action .nav-count {
    position: absolute;
    top: 2px;
    left: calc(50% + 8px);
    display: inline-grid;
    place-items: center;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-family: var(--font-ui);
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 0 1px #ffffff;
  }

  .review-head-actions .nav-action.notification-button {
    width: auto;
    min-width: 0;
    min-height: 54px;
    grid-template-rows: 24px 18px;
    padding: 4px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--bg);
  }

  .review-head-actions .nav-action.notification-button.is-icon {
    width: auto;
    min-width: 0;
    font-size: 10px;
  }

  .review-head-actions .nav-action.notification-button.is-icon span {
    display: block;
  }

  .review-head-actions .notification-button svg {
    display: block;
    width: 20px;
    height: 20px;
  }

  .review-head-actions .paste-thread-action,
  .review-head-actions button.secondary.paste-thread-action {
    display: inline-flex;
    width: auto;
    min-width: 156px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    padding: 0 4px;
  }

  .review-head-actions .paste-thread-action svg {
    display: none !important;
  }

  .review-head-actions .paste-thread-action span {
    display: block !important;
    color: #ffffff;
    font-family: var(--font-header);
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .paste-thread-action.is-active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.48);
  }

  .desktop-actions .notification-button,
  .desktop-actions button.secondary.notification-button {
    display: grid;
  }

  #jobHistoryBtn {
    order: 1;
  }

  #reviewListBtn {
    order: 2;
  }

  #newReviewBtn {
    order: 3;
  }

  #notifyBtn {
    order: 4;
  }
}

.submit-bar #fillBtn:disabled {
  opacity: 1;
}

.submit-bar #fillBtn::after {
  content: "›";
  font-size: 20px;
  line-height: 1;
  transform: translateY(-1px);
}

.fillout-result {
  display: none !important;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbfd;
}

.fillout-result.hidden {
  display: none;
}

.workflow-animation {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(12, 35, 64, 0.08);
  animation: workflowFadeIn 160ms ease-out;
}

.workflow-animation-card {
  min-width: 280px;
  max-width: min(420px, 88vw);
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 24px 30px;
  border: 2px solid var(--bg);
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  text-align: center;
  box-shadow: 0 22px 50px rgba(12, 35, 64, 0.26);
  animation: workflowCardIn 220ms cubic-bezier(0.2, 0.9, 0.2, 1.2);
}

.workflow-animation-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--bg);
  color: #ffffff;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
}

.workflow-animation-card strong,
.workflow-animation-card span {
  font-family: "Neue Haas Grotesk Display Pro", "Neue Haas Grotesk Text Pro", Inter, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0;
}

.workflow-animation-card strong {
  font-size: 18px;
  font-weight: 900;
}

.workflow-animation-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workflow-animation.next .workflow-animation-icon {
  animation: workflowArrow 520ms ease-in-out;
}

.workflow-animation-out {
  animation: workflowFadeOut 180ms ease-in forwards;
}

.review-pane.queue-flash {
  animation: queuePaneFlash 700ms ease-out;
}

@keyframes workflowFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes workflowFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes workflowCardIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes workflowArrow {
  0% { transform: translateX(-8px); }
  45% { transform: translateX(7px); }
  100% { transform: translateX(0); }
}

@keyframes queuePaneFlash {
  0% { box-shadow: 0 0 0 0 rgba(78, 151, 169, 0); }
  35% { box-shadow: 0 0 0 4px rgba(78, 151, 169, 0.34), 0 0 28px rgba(78, 151, 169, 0.24); }
  100% { box-shadow: 0 0 0 0 rgba(78, 151, 169, 0); }
}

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

.result-box {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: white;
  min-width: 0;
}

.result-box h3 {
  margin: 0 0 6px;
  font-size: 13px;
}

.result-box ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.result-box li {
  margin: 2px 0;
}

.popup-title {
  font-weight: 800;
  color: var(--warn);
  margin-bottom: 5px;
  font-size: 15px;
}

.popup-body {
  white-space: pre-wrap;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.32;
}

.choice {
  display: block;
  margin: 6px 0;
  font-size: 14px;
}

.choice input {
  margin-right: 8px;
}

.datetime-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 64px 74px 84px;
  gap: 8px;
  margin: 7px 0 0 22px;
}

.datetime-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.datetime-row input,
.datetime-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 32px;
  padding: 0 8px;
  background: white;
  color: var(--text);
  font: inherit;
}

.date-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.datetime-date-picker {
  padding: 0 4px;
}

.datetime-row input[type="number"] {
  appearance: textfield;
}

.datetime-row input[type="number"]::-webkit-outer-spin-button,
.datetime-row input[type="number"]::-webkit-inner-spin-button {
  opacity: 1;
}

.datetime-row select {
  appearance: auto;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 24, 45, 0.68);
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 22px 60px rgba(3, 17, 34, 0.34);
  padding: 16px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.modal-head h2 {
  font-size: 18px;
}

.modal-body {
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 14px;
  white-space: pre-wrap;
}

.paste-thread-card {
  width: min(860px, calc(100vw - 32px));
  border-color: var(--line);
}

.paste-thread-card .modal-body {
  display: grid;
  gap: 10px;
  white-space: normal;
}

.modal-note {
  margin: 0;
  color: var(--muted);
  font-weight: 650;
}

.listing-alias-body {
  display: grid;
  gap: 12px;
  white-space: normal;
}

.linked-listing-review-body {
  display: grid;
  gap: 12px;
  white-space: normal;
}

.linked-listing-review-body p,
.linked-listing-review-body ul {
  margin: 0;
}

.linked-listing-review-body ul {
  padding-left: 18px;
  color: var(--danger);
  font-weight: 700;
}

.listing-alias-hint {
  color: var(--text);
  font-size: 12px;
}

.field.linked-listing-warning .fillout-label {
  color: var(--danger);
}

.field.linked-listing-warning input,
.field.linked-listing-warning textarea,
.field.linked-listing-warning .radio-stack,
.field.linked-listing-warning .review-date-display,
.field.linked-listing-warning .review-time-display {
  border-color: var(--danger);
  background: #fff3f2;
  box-shadow: inset 0 0 0 1px rgba(164, 38, 44, 0.12);
}

.field.linked-listing-warning .listing-suggestions {
  border-color: rgba(164, 38, 44, 0.28);
  background: #fff8f7;
}

.linked-listing-warning-note {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.paste-thread-text {
  height: min(54vh, 520px);
  min-height: 300px;
  resize: vertical;
  border-color: var(--line-strong);
  background: #ffffff;
}

.modal-choices {
  display: grid;
  gap: 8px;
}

.modal-choice {
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  cursor: pointer;
}

.modal-choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.modal-choice input {
  margin-right: 8px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
}

pre {
  max-height: 300px;
  overflow: auto;
  background: #101820;
  color: #e8eef5;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
}

#jsonOut.hidden {
  display: none;
}

.login-body {
  min-height: 100vh;
  background: var(--navy);
  color: var(--ink);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  padding: 28px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.1;
  color: var(--navy);
}

.login-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 16px;
}

.login-error {
  border: 1px solid #b94a48;
  background: #fff3f2;
  color: #8a2522;
  border-radius: 6px;
  padding: 10px 12px;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-google {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--bg);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.login-google:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.login-form label {
  font-weight: 800;
  color: var(--navy);
}

.login-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  font: inherit;
}

.login-form input:focus {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.login-form button {
  margin-top: 6px;
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
    height: calc(100dvh - 1px);
  }

  .shell {
    display: block;
    width: 100%;
    height: calc(100dvh - 1px);
    min-height: 0;
    padding: 8px 8px calc(70px + env(safe-area-inset-bottom));
    overflow: hidden;
  }

  .input-pane {
    display: none;
  }

  .review-pane {
    height: 100%;
    overflow: hidden;
  }

  .review-head {
    height: 50px;
    min-height: 50px;
    padding: 6px 12px;
  }

  .review-head-left {
    gap: 8px;
  }

  .review-title-row {
    gap: 6px;
  }

  .review-head-inline-action {
    width: 26px;
    min-width: 26px;
    min-height: 26px;
  }

  .viewer-identity-chip {
    max-width: 132px;
    padding: 4px 8px;
    gap: 6px;
  }

  .viewer-identity-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
  }

  .viewer-identity-icon svg {
    width: 12px;
    height: 12px;
  }

  .viewer-identity-text strong {
    font-size: 9px;
  }

  .viewer-identity-text span {
    font-size: 8px;
  }

  .viewer-identity-switch {
    min-height: 20px;
    padding: 0 7px;
    font-size: 8px;
  }

  .review-head h2 {
    font-size: 17px;
  }

  .viewer-scope-bar {
    min-height: 34px;
    padding: 5px 12px;
    gap: 8px;
  }

  .viewer-scope-label,
  .admin-filter {
    font-size: 10px;
  }

  .status {
    padding: 0 12px;
  }

  .mobile-thread-view {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 8px 10px;
    background: var(--bg);
  }

  .mobile-thread-view.empty {
    display: none;
    color: rgba(255, 255, 255, 0.84);
  }

  body.mobile-thread-mode .mobile-thread-view {
    display: grid;
    align-content: start;
    gap: 8px;
  }

  body.mobile-thread-mode .mobile-thread-view.empty {
    display: block;
    padding: 14px;
    color: rgba(255, 255, 255, 0.84);
    font-size: 13px;
    line-height: 1.35;
  }

  body.mobile-thread-mode .fields,
  body.mobile-thread-mode .submit-bar,
  body.mobile-thread-mode #readyNotice,
  body.mobile-thread-mode #popup,
  body.mobile-thread-mode #status {
    display: none !important;
  }

  .fields {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 6px 12px 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .field {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 0;
  }

  .field label {
    font-size: 10.5px;
    line-height: 1.05;
  }

  .field input,
  .review-datetime input,
  .review-datetime select {
    min-height: 32px;
    font-size: 16px;
    padding: 3px 8px;
  }

  .radio-stack {
    gap: 3px 7px;
  }

  .radio-option {
    width: auto;
    min-height: 28px;
    border: 1px solid #d8dde6;
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 11.5px !important;
  }

  .radio-option input {
    width: 12px;
    height: 12px;
    min-height: 12px;
  }

  .review-datetime {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .review-picker-group {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 5px;
  }

  .picker-icon-button {
    width: 42px;
    min-width: 42px;
    min-height: 34px;
  }

  .review-native-picker {
    width: 42px !important;
    min-height: 34px !important;
  }

  .compact-time-control {
    gap: 1px;
    font-size: 10px !important;
  }

  .submit-bar {
    min-height: 58px;
    padding: 5px 12px 7px;
  }

  .submit-actions {
    gap: 8px;
  }

  .submit-actions #dismissReviewBtn {
    min-width: 42px;
    width: 42px;
    padding: 0;
  }

  .submit-actions #dismissReviewBtn span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .submit-bar #fillBtn {
    font-size: 11px;
    min-height: 34px;
  }

  .submit-bar #forceSubmitBtn {
    font-size: 11px;
    min-height: 34px;
    min-width: 180px;
  }

  .force-submit-prompt {
    font-size: 11px;
    padding: 7px 8px;
  }

  .datetime-row {
    grid-template-columns: 1fr 1fr;
    margin-left: 0;
  }

  .datetime-row .date-field {
    grid-column: 1 / -1;
  }

  #queueDrawer .queue-drawer-card,
  #jobHistoryDrawer .queue-drawer-card {
    width: calc(100vw - 12px);
    height: calc(100dvh - 88px - env(safe-area-inset-bottom));
    margin-bottom: calc(70px + env(safe-area-inset-bottom));
    padding: 12px;
    overflow: hidden;
  }

  .queue-head {
    align-items: flex-start;
  }

  .queue-filter-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .queue-filter-summary {
    text-align: left;
    padding-bottom: 0;
  }

  .queue-drawer-actions {
    gap: 6px;
  }

  .queue-drawer-actions button.secondary {
    min-height: 32px;
    padding: 0 8px;
    font-size: 11px;
  }

  .queue-list.queue-grid,
  .job-history-list.history-grid {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal {
    align-items: flex-end;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .modal-card {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 92px - env(safe-area-inset-bottom));
  }

  .notification-settings-card {
    padding: 12px;
  }

  .notification-settings-card .modal-head {
    margin-bottom: 8px;
  }

  .notification-settings-card .modal-body {
    margin-bottom: 0;
  }

  .notification-settings-card .settings-reason {
    margin-bottom: 10px;
    font-size: 15px;
    line-height: 1.25;
  }

  .notification-settings-card .settings-actions {
    margin: 10px 0;
  }

  .notification-settings-card .settings-help {
    padding: 10px;
    font-size: 13px;
    line-height: 1.25;
  }
}

@media (min-width: 901px) {
  html.fillout-site-ux body {
    height: auto;
    overflow: hidden;
  }

  html.fillout-site-ux .shell {
    display: grid;
    grid-template-columns: minmax(380px, 1fr) minmax(420px, 1fr);
    gap: 18px;
    height: 100vh;
    min-height: 0;
    padding: 16px;
    overflow: hidden;
  }

  html.fillout-site-ux .input-pane {
    display: flex;
  }

  html.fillout-site-ux .review-pane {
    height: 100%;
    overflow: hidden;
  }

  html.fillout-site-ux .review-head {
    height: 60px;
    min-height: 60px;
    padding: 12px 18px;
  }

  html.fillout-site-ux .viewer-identity-chip {
    max-width: 260px;
  }

  html.fillout-site-ux .review-head-actions {
    display: flex;
  }

  html.fillout-site-ux .viewer-scope-bar {
    padding-inline: 18px;
  }

  html.fillout-site-ux .desktop-actions,
  html.fillout-site-ux .mobile-top-actions {
    position: static;
    display: flex;
    min-height: 0;
    padding: 0;
    border-top: 0;
    background: transparent;
    box-shadow: none;
    grid-template-columns: none;
  }

  html.fillout-site-ux .paste-thread-action {
    display: none !important;
  }

  html.fillout-site-ux .fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 9px 18px 8px;
    overflow-y: auto;
  }

  html.fillout-site-ux .field {
    grid-template-columns: 195px minmax(0, 1fr);
    gap: 12px;
    padding: 1px 0;
  }

  html.fillout-site-ux .field label {
    font-size: 12px;
    line-height: 1.2;
  }

  html.fillout-site-ux .field input,
  html.fillout-site-ux .field textarea,
  html.fillout-site-ux .review-datetime input,
  html.fillout-site-ux .review-datetime select {
    min-height: 34px;
    font-size: 13px;
    padding: 4px 10px;
  }

  html.fillout-site-ux .field textarea {
    height: 38px;
    min-height: 38px;
  }

  html.fillout-site-ux .submit-bar {
    min-height: 66px;
    padding: 7px 18px 12px;
  }

  html.fillout-site-ux .submit-actions #dismissReviewBtn {
    min-width: 104px;
    width: auto;
  }

  html.fillout-site-ux .submit-actions #dismissReviewBtn span:last-child {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
}

@media (min-width: 901px) and (max-height: 800px) {
  html.fillout-site-ux .shell {
    padding: 10px;
    gap: 12px;
  }

  html.fillout-site-ux .thread-panel-head,
  html.fillout-site-ux .review-head {
    height: 50px;
    min-height: 50px;
    padding: 8px 18px;
  }

  html.fillout-site-ux .thread-panel-head h2,
  html.fillout-site-ux .review-head h2 {
    font-size: 20px;
  }

  html.fillout-site-ux .review-head-actions button.secondary,
  html.fillout-site-ux .review-head-actions a.secondary {
    min-height: 32px;
    padding-inline: 9px;
    font-size: 11px;
  }

  html.fillout-site-ux .fields {
    gap: 2px;
    padding: 5px 18px 4px;
    overflow-y: auto;
  }

  html.fillout-site-ux .field {
    min-height: 28px;
    padding: 0;
  }

  html.fillout-site-ux .field label {
    font-size: 11px;
    line-height: 1.05;
  }

  html.fillout-site-ux .field input,
  html.fillout-site-ux .review-datetime input,
  html.fillout-site-ux .review-datetime select {
    min-height: 28px;
    padding: 2px 9px;
    font-size: 12px;
    line-height: 1.1;
  }

  html.fillout-site-ux .radio-stack {
    gap: 4px 7px;
  }

  html.fillout-site-ux .radio-option {
    min-height: 28px;
    padding: 2px 8px;
    font-size: 11px !important;
  }

  html.fillout-site-ux .radio-option input {
    width: 12px;
    height: 12px;
    min-height: 12px;
  }

  html.fillout-site-ux .review-datetime {
    gap: 6px;
  }

  html.fillout-site-ux .compact-time-control {
    gap: 1px;
    font-size: 10px !important;
  }

  html.fillout-site-ux .warnings {
    padding: 5px 8px;
    font-size: 11px;
    line-height: 1.15;
  }

  html.fillout-site-ux .warnings-title {
    margin-bottom: 2px;
    font-size: 11px;
  }

  html.fillout-site-ux .submit-bar {
    min-height: 54px;
    gap: 5px;
    padding: 4px 18px 7px;
  }

  html.fillout-site-ux .submit-bar button {
    min-height: 32px;
    font-size: 11px;
  }
}

/* Appearance-only refinement. Layout and responsive structure remain unchanged. */
::selection {
  background: rgba(0, 48, 135, 0.18);
  color: var(--text);
}

.thread-panel,
.review-pane {
  border-color: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.thread-panel-head,
.review-head {
  background: linear-gradient(180deg, #102a49 0%, var(--bg) 100%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

.thread-panel-head h2,
.review-head h2 {
  letter-spacing: 0.055em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.review-head-actions button.secondary,
.review-head-actions a.secondary,
.viewer-identity-switch {
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease;
}

.review-head-actions button.secondary,
.review-head-actions a.secondary {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.075);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.08);
}

.viewer-identity-chip {
  max-width: clamp(140px, 13vw, 180px);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.1);
}

.viewer-scope-bar {
  border-bottom-color: #d8e1e9;
  background: linear-gradient(180deg, #f9fbfd 0%, #f1f5f9 100%);
  box-shadow: inset 0 -1px 0 rgba(12, 35, 64, 0.025);
}

.viewer-scope-label,
.admin-filter,
.field label,
.queue-filter span {
  letter-spacing: 0.018em;
}

button,
.job-actions a.secondary,
.login-google {
  border-radius: 7px;
  letter-spacing: 0.012em;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease,
    transform 100ms ease;
}

button:active:not(:disabled),
.job-actions a.secondary:active,
.login-google:active {
  transform: translateY(1px);
}

button:focus-visible,
.job-actions a.secondary:focus-visible,
.login-google:focus-visible,
.viewer-identity-switch:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 48, 135, 0.28);
}

.email-card {
  border-color: #d3dce5;
  border-radius: 9px;
  box-shadow: 0 5px 14px rgba(3, 17, 34, 0.15);
}

.email-avatar {
  background: linear-gradient(145deg, #173b65, var(--bg));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.email-header {
  border-bottom-color: #dde4eb;
}

.field label {
  color: #172a40;
}

.field input,
.field textarea,
.review-datetime input,
.review-datetime select,
.queue-filter select,
.datetime-row input,
.datetime-row select,
.login-form input,
.paste-thread-text {
  border-color: var(--control-border);
  border-radius: 6px;
  background-color: #fdfefe;
  box-shadow: inset 0 1px 1px rgba(12, 35, 64, 0.025);
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.field input:hover,
.field textarea:hover,
.review-datetime input:hover,
.review-datetime select:hover,
.queue-filter select:hover,
.datetime-row input:hover,
.datetime-row select:hover,
.login-form input:hover,
.paste-thread-text:hover {
  border-color: var(--control-border-hover);
}

.field input:focus,
.field textarea:focus,
.review-datetime input:focus,
.review-datetime select:focus,
.queue-filter select:focus,
.datetime-row input:focus,
.datetime-row select:focus,
.login-form input:focus,
.paste-thread-text:focus {
  outline: 0;
  border-color: var(--accent);
  background-color: #ffffff;
  box-shadow: var(--focus-ring);
}

.field input::placeholder,
.field textarea::placeholder,
.review-datetime input::placeholder,
.paste-thread-text::placeholder {
  color: #718195;
  opacity: 1;
}

.field.blank-field input,
.field.blank-field textarea,
.field.blank-field .radio-stack,
.field.blank-field .review-datetime input,
.field.blank-field .review-datetime select {
  border-color: var(--missing-line);
  background: linear-gradient(180deg, var(--missing-bg) 0%, var(--missing-bg-strong) 100%);
  box-shadow: inset 0 1px 2px rgba(57, 91, 119, 0.07);
}

.field.blank-field input:hover,
.field.blank-field textarea:hover,
.field.blank-field .review-datetime input:hover,
.field.blank-field .review-datetime select:hover {
  border-color: var(--missing-line-hover);
}

.radio-option {
  border-color: var(--control-border);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(12, 35, 64, 0.04);
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    color 140ms ease;
}

.radio-option:hover {
  border-color: var(--control-border-hover);
  background: #f8fafc;
}

.radio-option:has(input:checked) {
  border-color: #7d9fc5;
  background: var(--accent-soft);
  color: var(--accent) !important;
  box-shadow:
    inset 0 0 0 1px rgba(0, 48, 135, 0.05),
    0 1px 2px rgba(12, 35, 64, 0.05);
}

.radio-option input,
.admin-filter input,
.modal-choice input,
.choice input {
  accent-color: var(--accent);
}

.field.blank-field .radio-option {
  border-color: var(--missing-line);
  background: linear-gradient(180deg, var(--missing-bg) 0%, var(--missing-bg-strong) 100%);
}

.field.blank-field .radio-option:has(input:checked) {
  border-color: #7d9fc5;
  background: var(--accent-soft);
}

.picker-icon-button {
  border-color: var(--control-border);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(12, 35, 64, 0.04);
}

.picker-icon-button:hover:not(:disabled) {
  border-color: #7d9fc5;
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.warnings,
.ready-notice,
.popup,
.force-submit-prompt {
  box-shadow: 0 2px 8px rgba(12, 35, 64, 0.05);
}

.submit-bar {
  border-top: 1px solid #e4e9ef;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  box-shadow: 0 -5px 16px rgba(12, 35, 64, 0.035);
}

.submit-bar #fillBtn {
  background: linear-gradient(180deg, #123357 0%, var(--bg) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 3px 8px rgba(12, 35, 64, 0.18);
}

.submit-bar #fillBtn:hover:not(:disabled) {
  background: linear-gradient(180deg, #0d2949 0%, var(--bg-deep) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 4px 10px rgba(12, 35, 64, 0.22);
}

.queue-drawer,
.modal {
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#queueDrawer .queue-drawer-card,
#jobHistoryDrawer .queue-drawer-card,
.modal-card,
.login-card {
  border-color: #d6dee7;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(3, 17, 34, 0.34);
}

.queue-list.queue-grid {
  border-color: #d6dee7;
  box-shadow: inset 0 1px 2px rgba(12, 35, 64, 0.035);
}

.review-grid-head {
  background: linear-gradient(180deg, #102a49 0%, var(--bg) 100%);
}

.review-grid-row:not(.review-grid-head):hover {
  background: #f8fafc;
}

.toast {
  border-color: #cbd6e0;
  border-radius: 10px;
  box-shadow: 0 18px 44px rgba(3, 17, 34, 0.24);
}

.login-card {
  border-top: 4px solid var(--accent);
}

@media (min-width: 901px) and (max-width: 1150px) {
  html.fillout-site-ux .review-head {
    gap: 7px;
  }

  html.fillout-site-ux .review-head-left {
    gap: 8px;
  }

  html.fillout-site-ux .viewer-identity-chip {
    max-width: 110px;
    gap: 5px;
    padding: 4px 7px;
  }

  html.fillout-site-ux .viewer-identity-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
  }

  html.fillout-site-ux .viewer-identity-text strong {
    max-width: 32px;
  }

  html.fillout-site-ux .viewer-identity-text span {
    display: none;
  }

  html.fillout-site-ux .viewer-identity-switch {
    min-height: 22px;
    padding: 0 6px;
    font-size: 8px;
  }

  html.fillout-site-ux .review-head-actions,
  html.fillout-site-ux .desktop-actions {
    gap: 5px;
  }

  html.fillout-site-ux .review-head-actions button.secondary,
  html.fillout-site-ux .review-head-actions a.secondary {
    min-height: 32px;
    padding-inline: 6px;
    font-size: 9.5px;
  }

  html.fillout-site-ux .field {
    grid-template-columns: 165px minmax(0, 1fr);
    gap: 10px;
  }

  html.fillout-site-ux .review-datetime {
    grid-template-columns: minmax(120px, 1fr) minmax(84px, 100px);
    gap: 5px;
  }
}

@media (max-width: 900px) {
  .review-pane {
    box-shadow: 0 12px 30px rgba(3, 17, 34, 0.2);
  }

  .review-head {
    gap: 7px;
  }

  .review-head-left {
    gap: 5px;
  }

  .review-title-row {
    gap: 5px;
  }

  .viewer-identity-chip {
    max-width: 112px;
    gap: 4px;
    padding: 3px 5px;
  }

  .viewer-identity-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
  }

  .viewer-identity-text strong {
    max-width: 44px;
  }

  .viewer-identity-text span {
    display: none;
  }

  .viewer-identity-switch {
    min-height: 18px;
    padding: 0 4px;
    font-size: 7px;
  }

  .review-head h2 {
    font-size: 16px;
  }

  .review-head-inline-action {
    width: 24px;
    min-width: 24px;
    min-height: 24px;
  }

  .review-head-inline-action svg {
    width: 14px;
    height: 14px;
  }

  .review-head-actions .paste-thread-action,
  .review-head-actions button.secondary.paste-thread-action {
    min-width: 142px;
  }

  .review-head-actions .paste-thread-action span {
    font-size: 16px;
  }

  .field label {
    letter-spacing: 0.012em;
  }

  .radio-option {
    box-shadow: 0 1px 2px rgba(12, 35, 64, 0.045);
  }

  .desktop-actions {
    border-top-color: #dbe2e9;
    background: rgba(255, 255, 255, 0.985);
    box-shadow: 0 -8px 24px rgba(3, 17, 34, 0.14);
  }

  .review-head-actions .nav-action:hover:not(:disabled),
  .review-head-actions .nav-action:focus-visible {
    border-radius: 7px;
  }

  .review-head-actions .nav-action svg {
    stroke-width: 1.9;
  }

  #queueDrawer .queue-head h2,
  #jobHistoryDrawer .queue-head h2 {
    font-size: 16px;
    line-height: 1.05;
  }

  .queue-drawer-actions {
    flex: 0 0 auto;
    gap: 5px;
  }

  .queue-drawer-actions button.secondary {
    padding-inline: 5px;
    font-size: 9.5px;
    white-space: nowrap;
  }

  .submit-bar #fillBtn {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.08),
      0 3px 8px rgba(12, 35, 64, 0.16);
  }
}

@media (max-width: 370px) {
  .review-head {
    gap: 14px;
  }

  .review-head-actions .paste-thread-action,
  .review-head-actions button.secondary.paste-thread-action {
    min-width: 124px;
  }

  .review-head-actions .paste-thread-action span {
    font-size: 14px;
  }
}

/* Keep the complete form visible on phones without changing desktop spacing. */
@media (max-width: 900px) {
  body {
    height: 100dvh;
  }

  .shell {
    height: 100dvh;
    padding: 6px 8px calc(62px + env(safe-area-inset-bottom));
  }

  .review-head {
    height: 46px;
    min-height: 46px;
    padding-block: 4px;
  }

  .viewer-scope-bar {
    justify-content: flex-end;
    min-height: 18px;
    padding: 1px 8px;
  }

  .viewer-scope-label {
    display: none;
  }

  .viewer-scope-bar:has(.admin-filter.hidden) {
    display: none;
  }

  .admin-filter {
    gap: 4px;
    font-size: 8px;
  }

  .admin-filter input {
    width: 11px;
    height: 11px;
  }

  .status:empty {
    display: none;
  }

  .fields {
    gap: 0;
    padding: 3px 10px 4px;
  }

  .field {
    gap: 0;
  }

  .field label {
    font-size: 9.5px;
    line-height: 1;
  }

  .field input,
  .field textarea,
  .review-datetime input,
  .review-datetime select {
    min-height: 28px;
    font-size: 16px;
    line-height: 1.1;
    padding: 2px 7px;
  }

  .field textarea {
    height: 30px;
    min-height: 30px;
  }

  .radio-stack {
    gap: 1px 5px;
  }

  .radio-option {
    min-height: 25px;
    padding: 1px 7px;
    font-size: 11px !important;
  }

  .review-datetime {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 5px;
  }

  .compact-time-control {
    gap: 0;
  }

  .compact-time-control > span {
    display: none;
  }

  .review-picker-group {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 4px;
  }

  .picker-icon-button {
    width: 36px;
    min-width: 36px;
    min-height: 28px;
  }

  .review-native-picker {
    width: 36px !important;
    min-height: 28px !important;
  }

  .submit-bar {
    min-height: 50px;
    padding: 4px 10px 5px;
  }

  .submit-bar #fillBtn,
  .submit-bar #forceSubmitBtn {
    min-height: 32px;
  }

  .desktop-actions {
    min-height: calc(58px + env(safe-area-inset-bottom));
    padding-block: 3px calc(3px + env(safe-area-inset-bottom));
  }

  .review-head-actions .nav-action,
  .review-head-actions button.secondary.nav-action,
  .review-head-actions .nav-action.notification-button {
    min-height: 50px;
    grid-template-rows: 22px 16px;
    padding-block: 3px;
  }
}

@media (max-width: 900px) and (max-height: 720px) {
  .shell {
    padding: 4px 6px calc(55px + env(safe-area-inset-bottom));
  }

  .review-head {
    height: 40px;
    min-height: 40px;
  }

  .viewer-scope-bar {
    min-height: 15px;
    padding-block: 0;
  }

  .fields {
    padding-block: 2px 3px;
  }

  .field label {
    font-size: 9px;
  }

  .field input,
  .field textarea,
  .review-datetime input,
  .review-datetime select {
    min-height: 23px;
    padding-block: 0;
  }

  .field textarea {
    height: 23px;
    min-height: 23px;
  }

  .radio-option {
    min-height: 21px;
    padding-block: 0;
  }

  .picker-icon-button,
  .review-native-picker {
    min-height: 23px !important;
  }

  .submit-bar {
    min-height: 40px;
    padding-block: 2px 3px;
  }

  .submit-bar #fillBtn,
  .submit-bar #forceSubmitBtn {
    min-height: 27px;
  }

  .desktop-actions {
    min-height: calc(52px + env(safe-area-inset-bottom));
    padding-block: 2px calc(2px + env(safe-area-inset-bottom));
  }

  .review-head-actions .nav-action,
  .review-head-actions button.secondary.nav-action,
  .review-head-actions .nav-action.notification-button {
    min-height: 44px;
    grid-template-rows: 20px 14px;
    padding-block: 2px;
  }
}

@media (max-width: 900px) {
  .history-outreach {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    padding: 8px;
  }

  .history-message-control {
    grid-column: 1 / -1;
  }

  .history-listing-filter {
    grid-column: 1 / -1;
  }

  .history-apartment-picker {
    max-height: 66px;
  }

  .history-outreach-control textarea {
    height: 48px;
    min-height: 48px;
    font-size: 11px;
  }

  .history-outreach-actions {
    flex-wrap: wrap;
    gap: 7px 10px;
  }

  #historySendSelectedBtn {
    width: 100%;
    margin-left: 0;
  }
}

.viewer-identity-switch svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 901px) {
  html.fillout-site-ux .review-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  html.fillout-site-ux .review-head-left {
    gap: 9px;
  }

  html.fillout-site-ux .viewer-identity-chip {
    flex: 0 0 auto;
    max-width: none;
    gap: 4px;
    padding: 3px;
  }

  html.fillout-site-ux .viewer-identity-text {
    display: none;
  }

  html.fillout-site-ux .viewer-identity-icon,
  html.fillout-site-ux .viewer-identity-switch {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 50%;
  }

  html.fillout-site-ux .viewer-identity-switch {
    display: grid;
    place-items: center;
  }

  html.fillout-site-ux .review-head-actions,
  html.fillout-site-ux .desktop-actions {
    gap: 6px;
  }

  html.fillout-site-ux .desktop-actions .nav-action,
  html.fillout-site-ux .desktop-actions button.secondary.nav-action,
  html.fillout-site-ux .desktop-actions .nav-action.notification-button {
    position: relative;
    display: grid;
    place-items: center;
    width: 34px;
    min-width: 34px;
    max-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 7px;
  }

  html.fillout-site-ux .desktop-actions .nav-action svg,
  html.fillout-site-ux .desktop-actions .nav-action.notification-button svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  html.fillout-site-ux .desktop-actions .nav-action > span:not(.nav-count) {
    display: none;
  }

  html.fillout-site-ux .desktop-actions .nav-action .nav-count:not(.hidden) {
    position: absolute;
    top: -5px;
    right: -5px;
    display: grid;
    place-items: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    font-size: 8px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 0 0 2px var(--bg);
  }
}
