/* DstressedHomes design layer — warm editorial property desk over the Forge shell.
   Card lift, pill filters and soft gradient panels are inspired by Uiverse patterns. */

/*
 * Palette law: four base colours carry every screen - ivory surfaces, forest for
 * actions and the active nav, gold for emphasis and section marks, ink for text.
 * A screen adds at most two of the five accents, and only to mark a section or a
 * record state, so the page stays quieter than the data on it.
 *   brick  - distress, failure, destructive
 *   slate  - neutral information, code and system records
 *   plum   - third-party or sold/assigned records
 *   gold   - emphasis, section marks, warnings
 *   forest - actions, coverage, confirmed state
 */
:root {
  --surface-sunken: #f2eee4;
  --surface-base: #fffdf7;
  --surface-raised: #ffffff;
  --surface-hover: #f6f1e6;
  --border-muted: #e4dccb;
  --border-strong: #cabfa8;
  --text-primary: #16231c;
  --text-secondary: #58675d;
  --text-faint: #8b9389;
  --accent-primary: #1d5a3d;
  --accent-deep: #10291e;
  --accent-soft: rgba(29, 90, 61, 0.1);
  --accent-gold: #c4892f;
  --accent-gold-ink: #96651d;
  --accent-gold-soft: rgba(196, 137, 47, 0.14);
  --accent-brick: #a44832;
  --accent-brick-soft: #fbe6df;
  --accent-slate: #39677c;
  --accent-slate-soft: #e6eff3;
  --accent-plum: #6c4d8c;
  --accent-plum-soft: #efe7f6;
  --status-good: #2f7a55;
  --status-warn: #b1761e;
  --status-bad: #b0473a;
  --section-tint: rgba(29, 90, 61, 0.045);
  --section-rule: #e9e0cf;
  --radius-small: 9px;
  --radius-medium: 16px;
  --shadow-panel: 0 18px 44px rgba(30, 45, 35, 0.09);
  --shadow-lift: 0 24px 50px rgba(22, 40, 30, 0.14);
  color-scheme: light;
}

/* The window scroller is part of the page, so it wears the page's own colours.
   Without this the browser paints a white scrollbar track down the window edge,
   which reads as a white bar sliding over the ivory field. The gutter is reserved
   so a page growing past the fold does not shift its content. */
html {
  background: var(--surface-sunken);
  /* Chrome only reserves the gutter once the root is a real scroller, so the
     scrollbar is always owned by the page and never appears or vanishes under the
     content: the layout width is identical on every screen. */
  overflow-y: scroll;
  scrollbar-gutter: stable;
  scrollbar-color: #b4a88f #efe9db;
}

html::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}

html::-webkit-scrollbar-track {
  background: #efe9db;
}

html::-webkit-scrollbar-thumb {
  border: 3px solid #efe9db;
  border-radius: 8px;
  background: #b4a88f;
}

html::-webkit-scrollbar-thumb:hover {
  background: #9d9077;
}

html::-webkit-scrollbar-corner {
  background: #efe9db;
}

body {
  background:
    radial-gradient(1100px 520px at 88% -10%, rgba(196, 137, 47, 0.16), transparent 62%),
    radial-gradient(900px 480px at -8% 8%, rgba(29, 90, 61, 0.12), transparent 60%),
    var(--surface-sunken);
  font-family: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.005em;
}

h1, h2, h3, .brand-block strong, .stat-card strong, .property-file-address {
  font-family: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  letter-spacing: -0.02em;
}

/* ---- Frame and navigation ---- */

.application-frame {
  grid-template-columns: 264px minmax(0, 1fr);
}

.navigation-rail {
  min-width: 0;
  background:
    radial-gradient(420px 260px at 30% 0%, rgba(196, 137, 47, 0.18), transparent 70%),
    linear-gradient(180deg, #123023 0%, #0d241a 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 22px 16px;
  color: #f3ecdc;
}

.brand-block {
  gap: 12px;
  padding: 0 4px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-block strong {
  font-size: 20px;
  font-weight: 600;
  color: #fbf5e7;
}

/* The subtitle sits on the forest gradient, so it needs near-solid cream: at 10.5px
   a translucent tint thins out into the background and reads as dark text. */
.brand-block small {
  color: rgba(251, 245, 231, 0.82);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* The rail's lockup: gold on the forest gradient. */
.brand-block .brand-mark {
  width: 44px;
  height: 44px;
  color: #e3b566;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.28));
}

.navigation-list {
  gap: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.navigation-list::-webkit-scrollbar {
  width: 6px;
}

.navigation-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.navigation-heading {
  color: rgba(243, 236, 220, 0.45);
  margin: 18px 10px 6px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
}

.navigation-item {
  color: rgba(243, 236, 220, 0.72);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.navigation-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fdf8ec;
  transform: translateX(2px);
}

.navigation-item.is-active {
  background: rgba(227, 181, 102, 0.16);
  border-color: rgba(227, 181, 102, 0.32);
  color: #fdf8ec;
  box-shadow: inset 3px 0 0 #e3b566;
}

.rail-footer {
  color: rgba(243, 236, 220, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
}

.rail-footer a {
  color: #e3b566;
}

.provider-status {
  color: rgba(243, 236, 220, 0.55);
  font-size: 11px;
}

/* ---- Shared surfaces ---- */

.view-surface {
  /* The top navigation owns the top edge; the container owns the gutters. */
  padding: 0;
  min-width: 0;
}

.view-banner {
  height: clamp(130px, 14vw, 188px);
  background-color: var(--accent-deep);
  background-position: center 62%;
  background-size: cover;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border-muted);
  position: relative;
}

/* The photograph fades into the desk's ivory surface instead of ending on a hard edge. */
.view-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(9, 27, 19, 0.42) 0%,
    rgba(9, 27, 19, 0.06) 48%,
    rgba(242, 238, 228, 0.72) 100%
  );
  pointer-events: none;
}

.view-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 26px clamp(16px, 3vw, 40px) 60px;
}

/* ---- Top navigation ---- */

.top-navigation {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(250, 246, 236, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-muted);
}

.top-navigation-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 6px clamp(16px, 3vw, 40px);
  display: flex;
  align-items: center;
  gap: 18px;
}

.top-navigation-links {
  display: flex;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-navigation-links::-webkit-scrollbar {
  display: none;
}

.top-navigation-item {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  padding: 9px 12px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: color 130ms ease, background 130ms ease, border-color 130ms ease;
}

.top-navigation-item:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.top-navigation-item.is-active {
  color: var(--accent-deep);
  border-bottom-color: var(--accent-gold);
  background: linear-gradient(180deg, transparent, var(--accent-gold-soft));
}

.top-navigation-context {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.page-header h1 {
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 500;
  margin: 0 0 4px;
}

.page-header p {
  color: var(--text-secondary);
  max-width: 70ch;
}

.panel {
  background: var(--surface-raised);
  border: 1px solid var(--border-muted);
  border-radius: 20px;
  box-shadow: var(--shadow-panel);
  padding: 20px 22px;
}

.button-primary,
.button-secondary,
.button-ghost,
.button-danger {
  border-radius: 999px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  transition: transform 130ms ease, box-shadow 130ms ease, background 130ms ease;
}

.button-primary {
  background: linear-gradient(135deg, #246b49, #17452f);
  border: 1px solid #123a27;
  color: #fbf6e8;
  box-shadow: 0 8px 18px rgba(20, 60, 40, 0.22);
}

.button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(20, 60, 40, 0.28);
}

.button-secondary {
  background: #fbf7ee;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.button-secondary:hover,
.button-ghost:hover {
  background: var(--surface-hover);
}

.button-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
}

.button-danger {
  background: #fbeae6;
  border: 1px solid #e7c2ba;
  color: #9c3c2e;
}

input,
select,
textarea {
  background: #fffefb;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text-primary);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(29, 90, 61, 0.14);
}

.metric-card {
  background: linear-gradient(160deg, #fffdf7, #f6f0e2);
  border: 1px solid var(--border-muted);
  border-radius: 16px;
  color: var(--text-primary);
}

.metric-card span {
  color: var(--text-faint);
}

.metric-card strong {
  font-family: 'Fraunces', Georgia, serif;
  color: var(--accent-deep);
}

/* ---- Data tables ---- */

.table-scroll {
  border: 1px solid var(--border-muted);
  border-radius: 14px;
}

.data-grid thead th {
  background: #f8f3e8;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-muted);
}

.data-grid td {
  border-bottom: 1px solid #efe8d9;
  color: var(--text-primary);
}

.data-grid tbody tr:hover {
  background: #fbf7ed;
}

.status-pill {
  border-radius: 999px;
  font-weight: 600;
}

.status-pill.tone-good {
  background: #e6f3e9;
  color: #256743;
}

.status-pill.tone-warn {
  background: var(--accent-gold-soft);
  color: var(--accent-gold-ink);
}

.status-pill.tone-bad {
  background: var(--accent-brick-soft);
  color: var(--accent-brick);
}

.status-pill.tone-info {
  background: var(--accent-slate-soft);
  color: var(--accent-slate);
}

.toolbar {
  gap: 10px;
}

/* Sticky headers and money columns: a long table keeps its column names and its
   numbers line up, which is the whole point of reading it as a table. */
.table-scroll {
  overflow-x: auto;
}

.data-grid {
  min-width: 660px;
}

.data-grid thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-grid td {
  vertical-align: middle;
}

.data-grid td strong {
  font-weight: 600;
}

.data-grid .cell-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-grid .cell-code {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.data-grid .actions-cell .button-secondary,
.data-grid .actions-cell .button-ghost,
.data-grid .actions-cell .button-danger {
  padding: 5px 11px;
  font-size: 11.5px;
}

/* ---- Numbered pagination ---- */

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-button {
  min-width: 30px;
  height: 29px;
  border-radius: 8px;
  border: 1px solid var(--border-muted);
  background: #fffdf7;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.page-button:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.page-button.is-current {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fbf4e3;
}

.page-gap {
  color: var(--text-faint);
  padding: 0 2px;
}

.page-step {
  padding: 5px 12px;
  font-size: 12px;
}

/* ---- Modal ---- */

.modal-root {
  background: rgba(13, 34, 24, 0.5);
  backdrop-filter: blur(6px);
}

.modal-card {
  background: #fffdf8;
  border: 1px solid #e6dcc8;
  border-radius: 22px;
  color: var(--text-primary);
  box-shadow: 0 40px 90px rgba(12, 30, 21, 0.35);
  max-width: 760px;
}

.modal-card header {
  border-bottom: 1px solid #eee5d4;
  padding: 20px 24px 14px;
}

.modal-card header h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 24px;
  font-weight: 500;
}

.modal-body {
  padding: 20px 24px;
}

.modal-actions {
  border-top: 1px solid #eee5d4;
  padding: 14px 24px 20px;
}

.field-row label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.field-hint {
  color: var(--text-faint);
}

/* ---- Property desk ---- */

.property-desk {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.property-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.7fr);
  gap: 22px;
  /* The hero is a signpost, not the page: it stops short so the first rows of the
     table are on screen without scrolling. */
  padding: clamp(20px, 2.2vw, 32px);
  border-radius: 26px;
  border: 1px solid rgba(202, 191, 168, 0.7);
  background:
    radial-gradient(600px 320px at 108% 10%, rgba(196, 137, 47, 0.22), transparent 65%),
    radial-gradient(420px 280px at -10% 100%, rgba(29, 90, 61, 0.16), transparent 60%),
    linear-gradient(150deg, #fffdf6 0%, #f7f0df 100%);
  box-shadow: var(--shadow-panel);
}

.eyebrow {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

.hero-copy,
.hero-stats {
  min-width: 0;
}

.hero-copy h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
  font-weight: 500;
  color: var(--accent-deep);
}

.hero-copy h1 em {
  color: var(--accent-gold);
  font-style: italic;
}

.hero-lede {
  color: #4e5f53;
  max-width: 62ch;
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 16px;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid #e5dac3;
  border-radius: 18px;
  padding: 10px 12px;
  box-shadow: 0 12px 28px rgba(43, 60, 45, 0.08);
  max-width: 540px;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.search-field span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-left: 4px;
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 20px;
  letter-spacing: 0.06em;
  padding: 2px 4px 6px;
}

.search-field input:focus {
  box-shadow: none;
}

.search-submit {
  padding: 12px 22px;
}

.saved-search-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  min-height: 20px;
}

.saved-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.saved-chip {
  border: 1px dashed #cdbf9f;
  background: rgba(255, 253, 247, 0.8);
  color: #5a4b2d;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  cursor: pointer;
}

.saved-chip:hover {
  background: #fff7e5;
}

.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stat-card {
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid #e6dcc8;
  border-radius: 16px;
  padding: 11px 15px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 22px rgba(40, 55, 42, 0.06);
}

.stat-card span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.stat-card strong {
  font-size: 24px;
  font-weight: 500;
  color: var(--accent-deep);
  line-height: 1.15;
}

.stat-card small {
  color: var(--text-secondary);
  font-size: 11px;
}

.stat-card-primary {
  background: linear-gradient(140deg, #1d5a3d, #123326);
  border-color: #123326;
}

.stat-card-primary span,
.stat-card-primary small {
  color: rgba(250, 244, 230, 0.68);
}

.stat-card-primary strong {
  color: #fbf3df;
}

/* ---- Results ---- */

.results-panel {
  background: var(--surface-raised);
  border: 1px solid var(--border-muted);
  border-radius: 22px;
  box-shadow: var(--shadow-panel);
  padding: clamp(18px, 2vw, 24px);
}

.results-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.results-head h2 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 500;
  color: var(--accent-deep);
}

.results-subtitle {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.results-head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 2px 0 12px;
  border-bottom: 1px solid #eee6d6;
  margin-bottom: 4px;
}

.filter-chip {
  border: 1px solid var(--border-muted);
  background: #fbf7ee;
  color: #4d5b51;
  border-radius: 999px;
  padding: 7px 12px 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  transition: background 130ms ease, border-color 130ms ease, transform 130ms ease;
}

.filter-chip span {
  background: rgba(22, 35, 28, 0.07);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10.5px;
  color: #59665d;
}

.filter-chip:hover {
  transform: translateY(-1px);
  border-color: #b9a986;
}

.filter-chip.is-active {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fbf4e3;
}

.filter-chip.is-active span {
  background: rgba(255, 255, 255, 0.16);
  color: #fbf4e3;
}

.parcel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 16px;
}

.parcel-card {
  position: relative;
  background: linear-gradient(180deg, #fffefb, #fcf8ef);
  border: 1px solid #e7ddca;
  border-radius: 18px;
  padding: 17px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  overflow: hidden;
}

.parcel-card::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, #e3b566, transparent);
  opacity: 0;
  transition: opacity 160ms ease;
}

.parcel-card:hover {
  transform: translateY(-3px);
  border-color: #d3c2a0;
  box-shadow: var(--shadow-lift);
}

.parcel-card:hover::after {
  opacity: 1;
}

.parcel-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.parcel-card h3 {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--accent-deep);
}

.parcel-place {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12.5px;
}

.parcel-owner {
  margin: 4px 0 2px;
  color: #6d746a;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.parcel-owner span {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 9.5px;
  color: #a29a89;
  margin-right: 8px;
}

.parcel-zip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9a8f79;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Record state uses the accent tokens, so a signal reads the same on a card, a
   table row and a property file. */
.pill-tax_delinquent {
  background: var(--accent-brick-soft);
  color: var(--accent-brick);
}

.pill-lis_pendens {
  background: var(--accent-gold-soft);
  color: var(--accent-gold-ink);
}

.pill-code_open {
  background: var(--accent-slate-soft);
  color: var(--accent-slate);
}

.pill-certificate_sold {
  background: var(--accent-plum-soft);
  color: var(--accent-plum);
}

.pill-foreclosure {
  background: #f6dede;
  color: #7a1f1f;
}

.pill-mortgage_default {
  background: #f7ecd2;
  color: #7a5518;
}

.pill-permit_open {
  background: #e6edf2;
  color: #3d5a70;
}

.pill-none {
  background: #e7f2e7;
  color: #2f6a43;
}

.parcel-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px dashed #e8dfcd;
}

.parcel-owed {
  display: flex;
  flex-direction: column;
}

.parcel-owed span {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a29a89;
}

.parcel-owed strong {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  color: #1c3d2c;
}

.parcel-open {
  border: none;
  background: transparent;
  color: #1d5a3d;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
}

.parcel-open span {
  display: inline-block;
  transition: transform 130ms ease;
}

.parcel-open:hover span {
  transform: translateX(3px);
}

.loading-card,
.empty-property-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-secondary);
  padding: 54px 20px;
  border: 1px dashed #ddd1ba;
  border-radius: 16px;
  background: #fdfaf2;
}

.empty-property-state h3 {
  color: var(--accent-deep);
  font-size: 24px;
  margin: 8px 0 6px;
}

.empty-mark {
  font-size: 30px;
  color: var(--accent-gold);
}

.sign-in-card {
  grid-column: 1 / -1;
  background: #fdf9ef;
  border: 1px solid #e3d6bd;
  border-radius: 18px;
  padding: 28px;
  max-width: 460px;
  margin: 10px auto;
}

.sign-in-card h3 {
  margin: 0 0 6px;
  font-size: 24px;
  color: var(--accent-deep);
}

.sign-in-card p {
  color: var(--text-secondary);
  font-size: 13px;
}

.sign-in-form {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.sign-in-form label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---- Property file modal ---- */

.property-file-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.property-file-parcel {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.property-file-address {
  margin: 14px 0 2px;
  font-size: 28px;
  font-weight: 500;
  color: var(--accent-deep);
}

.property-file-place {
  margin: 0;
  color: var(--text-secondary);
}

.file-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.file-metrics > div {
  background: #f9f4e9;
  border: 1px solid #e8deca;
  border-radius: 12px;
  padding: 10px 12px;
}

.file-metrics span {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.file-metrics strong {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 17px;
  font-weight: 500;
  color: #1c3d2c;
}

.file-owner {
  font-family: 'Manrope', sans-serif !important;
  font-size: 12px !important;
  line-height: 1.35;
}

.file-block {
  border-top: 1px solid #eee5d4;
  padding-top: 14px;
  margin-top: 14px;
}

.file-block h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 500;
  color: var(--accent-deep);
}

.debt-row {
  margin-bottom: 10px;
}

.debt-row-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #55635a;
  margin-bottom: 5px;
}

.debt-row-head strong {
  color: #1c3d2c;
}

.debt-track {
  height: 6px;
  border-radius: 999px;
  background: #eee7d8;
  overflow: hidden;
}

.debt-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d7a554, #b47b26);
}

.flag-list {
  margin: 0;
  padding-left: 18px;
  color: #4d5b51;
  font-size: 12.5px;
  display: grid;
  gap: 5px;
}

.file-source {
  margin: 18px 0 0;
  padding: 12px 14px;
  background: #f4f0e4;
  border-radius: 10px;
  font-size: 11px;
  color: #6d746a;
}

.file-source strong {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 9.5px;
  color: #9a8f79;
  margin-right: 6px;
}

/* ---- Light-theme fixes for the existing Forge screens ---- */

.inline-notice {
  background: #fdf3dc;
  border: 1px solid #e6cf9e;
  color: #7a5a1e;
  border-radius: 12px;
}

.empty-state {
  color: var(--text-secondary);
}

.section-title {
  color: var(--text-primary);
}

.run-card,
.stage-column,
.chat-panel,
.conversation-list {
  background: #fffdf7;
  border-color: var(--border-muted);
  color: var(--text-primary);
}

.stage-column-body {
  background: #faf5ea;
}

.event-list {
  color: var(--text-secondary);
}

.toast-message {
  background: #123326;
  color: #fbf4e3;
  border-radius: 12px;
}

.toast-message.is-error {
  background: #7e3327;
}

@media (max-width: 1100px) {
  .property-hero {
    grid-template-columns: 1fr;
  }

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

  .file-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .property-hero {
    padding: 20px;
  }

  .search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-submit {
    width: 100%;
  }

  .category-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 14px;
  }

  .filter-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 860px) {
  .application-frame {
    grid-template-columns: 1fr;
  }

  .navigation-rail {
    position: relative;
    height: auto;
    padding: 16px;
    width: 100%;
    overflow: hidden;
  }

  .navigation-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .navigation-list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 2px 0 6px;
    scrollbar-width: none;
  }

  .navigation-list::-webkit-scrollbar {
    display: none;
  }

  .navigation-heading {
    display: none;
  }

  .navigation-item {
    white-space: nowrap;
    padding: 7px 12px;
    font-size: 12px;
  }

  .navigation-item.is-active {
    box-shadow: inset 0 -2px 0 #e3b566;
  }

  /* Small screens keep the navigation strip and drop the rail's secondary chrome,
     so the first data row is not pushed 300px down the page. */
  .navigation-rail {
    gap: 10px;
    padding: 12px 14px 8px;
  }

  .rail-footer,
  .brand-block small {
    display: none;
  }

  .brand-block {
    padding-bottom: 8px;
    gap: 10px;
  }

  .brand-block strong {
    font-size: 17px;
  }

  .brand-block .brand-mark {
    width: 38px;
    height: 38px;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .view-surface {
    padding: 20px 16px 44px;
  }

  /* The strip keeps the full width of the screen at this size. */
  .view-banner {
    margin: -20px -16px 18px;
    height: 120px;
  }

  .results-head {
    flex-direction: column;
  }
}

/* ---- Small screens: one navigation strip, full-width actions, readable tables ---- */

@media (max-width: 860px) {
  /* The rail already becomes the horizontal strip at this width. */
  .top-navigation {
    display: none;
  }
}

@media (max-width: 700px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .page-header .button-primary,
  .page-header .button-secondary {
    width: 100%;
  }

  .panel {
    padding: 14px;
    border-radius: 16px;
  }

  .results-head-actions {
    width: 100%;
  }

  .results-head-actions .button-secondary,
  .results-head-actions .button-ghost {
    flex: 1;
  }

  .table-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .pagination-controls {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .data-grid {
    min-width: 600px;
  }
}
