:root {
  color-scheme: light;
  --ink: #1a1d1c;
  --ink-2: #4f5653;
  --muted: #6b726e;
  --accent: #0f7b5f;
  --accent-hover: #0c6750;
  --accent-soft: #e7f2ee;
  --paper: #f6f6f3;
  --surface: #fff;
  --line: #e5e6e2;
  --line-strong: #d6d8d2;
  --tint: #eeefeb;
  --radius: .5rem;
  --body-font: "Inter", -apple-system, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --title-font: var(--body-font);
  --rail-width: 188px;
  color: var(--ink);
  background: var(--paper);
  font: 16px/1.5 var(--body-font);
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; font-size: 14px; }
a { color: inherit; text-underline-offset: .18em; }
button, input, select, textarea { color: inherit; font: inherit; }
button, summary, select { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, h4, p, dl, figure { margin: 0; }
h1, h2, h3, h4 { line-height: 1.3; }
h1 { font-size: 18px; font-weight: 600; letter-spacing: -.025em; overflow-wrap: anywhere; }
h2 { font-size: 15px; font-weight: 600; margin-bottom: .8rem; }
h3 { font-size: 14px; font-weight: 600; }
h4 { font-size: 13px; font-weight: 600; }
p, dd, li, td { overflow-wrap: anywhere; }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  block-size: 1px;
  inline-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus {
  position: fixed;
  z-index: 10;
  inset-block-start: .5rem;
  inset-inline-start: .75rem;
  padding: .65rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: .25rem;
}

.ui-icon { display: inline-block; flex: none; vertical-align: middle; }
.workspace-body { padding-inline-start: var(--rail-width); }
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail-width);
  z-index: 5;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.rail > .brand { display: flex; padding: 16px; }
.brand__mark { position: relative; flex: none; width: 28px; height: 28px; border-radius: 8px; background: #14201b; }
.brand__mark::before, .brand__mark::after {
  position: absolute; inset: 50% auto auto 50%; border-radius: 50%; transform: translate(-50%,-50%); content: "";
}
.brand__mark::before { width: 14px; height: 14px; border: 2.5px solid #16a37b; }
.brand__mark::after { width: 4px; height: 4px; background: white; }
.brand__type { display: grid; line-height: 1.22; }
.brand__type strong { font-size: 13.5px; font-weight: 650; letter-spacing: -.025em; }
.brand__type small { color: var(--muted); font-size: 10.5px; }
.rail__nav { padding: 0 8px; }
.nav-link { text-decoration: none; }
.rail__nav .nav-link, .mobile-more__list .nav-link {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; margin-bottom: 2px; border-radius: 6px;
  font-size: 13px; line-height: 20px; color: var(--ink-2);
}
.rail__nav .ui-icon, .mobile-more__list .ui-icon { color: var(--muted); }
.rail__nav .nav-link:hover, .mobile-more__list .nav-link:hover { background: var(--tint); color: var(--ink); }
.rail__nav .nav-link[aria-current], .mobile-more__list .nav-link[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-link[aria-current] .ui-icon { color: var(--accent); }
.rail__nav .nav-link[aria-current]::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.appbar {
  position: sticky; top: 0; z-index: 4; height: 52px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding-inline: 16px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.appbar__brand, .mobile-tabs { display: none; }
.appbar__actions, .global-search { display: flex; align-items: center; }
.appbar__actions { gap: 12px; margin-inline-start: auto; }
.global-search { position: relative; width: min(400px,46%); }
.global-search button {
  position: absolute; inset: 0 auto 0 0; width: 32px; display: grid; place-items: center;
  background: transparent; color: var(--muted); border: 0; border-radius: 5px;
}
.appbar .global-search input[type="search"] { min-height: 32px; height: 32px; padding: 4px 10px 4px 33px; font-size: 13px; background: var(--paper); border: 1px solid var(--line); }
.global-search input:focus { background: white; }
.profile, .mobile-more { position: relative; }
.profile summary, .mobile-more summary { list-style: none; }
.profile summary::-webkit-details-marker, .mobile-more summary::-webkit-details-marker { display: none; }
.profile summary { border-radius: 50%; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }
.profile__menu, .mobile-more__list { background: white; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px #14181621; }
.profile__menu { position: absolute; inset: calc(100% + 8px) 0 auto auto; width: min(210px,88vw); padding: 12px; overflow-wrap: anywhere; }
.profile__menu strong, .profile__menu small { display: block; }
.profile__menu small { color: var(--muted); }
.profile__menu form { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--line); }
.profile__exit { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 2px 4px; color: var(--ink-2); background: transparent; border: 0; }

.shell { width: min(100%,1280px); margin-inline: auto; padding: 20px 24px 34px; }
.signin-page { min-height: 100vh; }
.signin-shell { width: min(100%,430px); padding-block-start: clamp(52px,14vh,144px); }
.signin { padding: clamp(20px,4vw,30px); }
.signin h1 { font-size: 20px; margin-bottom: 20px; }
.signin .button { margin-top: 4px; }
.guest-bar { justify-content: flex-start; }
.messages { display: grid; gap: .65rem; margin-bottom: 1rem; }

.page-head, .breadcrumbs, .property__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem 1.25rem;
}
.page-head { margin-bottom: 1.3rem; }
.page-head--lead { align-items: start; }
.page-head--lead > div { min-width: 0; }
.page-head--lead h1 { font-size: 20px; }
.page-meta { margin-top: .35rem; color: var(--muted); }
.meta-separator { color: #8b959b; margin-inline: .2rem; }
.breadcrumbs { justify-content: flex-start; margin-bottom: .8rem; font-size: .86rem; color: var(--muted); }
.text-link { color: var(--accent); font-weight: 600; }
.text-link:hover, .lead-link:hover { color: var(--accent); }
.button {
  min-height: 32px;
  width: fit-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: .35rem;
  background: var(--surface);
  color: var(--ink);
  padding: .45rem .85rem;
  text-decoration: none;
  text-align: center;
  gap: 6px;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.25;
}
.button:hover { background: var(--tint); border-color: #8197a4; }
.button--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button--wide { width: 100%; }
.button:active { transform: translateY(1px); }

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);

}
.panel--section, .create-pane { padding: clamp(.95rem, 2.5vw, 1.4rem); }
.create-pane {
  scroll-margin-top: 1rem;
  border-block-start: 3px solid var(--accent);
}
.queue-layout, .lead-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16.5rem, 23rem);
  align-items: start;
  gap: clamp(.85rem, 2.5vw, 1.4rem);
}
.queue-layout--single { grid-template-columns: minmax(0, 1fr); }
.lead-layout { grid-template-columns: minmax(0, 1fr) minmax(16rem, 21rem); }
.lead-brief { grid-column: 1; grid-row: 1; }
.lead-records { grid-column: 1; grid-row: 2; }
.lead-actions { min-width: 0; grid-column: 2; grid-row: 1 / span 2; }
.section-stack { min-width: 0; display: grid; gap: clamp(.85rem, 2.5vw, 1.4rem); }
.queue-search {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem;
}
.queue-search input { flex: 1 1 12rem; min-width: 7rem; }
.queue-search .text-link { font-size: .86rem; }
.lead-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.lead-table th, .lead-table td { text-align: start; vertical-align: top; padding: .76rem .8rem; border-top: 1px solid var(--line); }
.lead-table th:first-child, .lead-table td:first-child { padding-inline-start: 1rem; }
.lead-table th { background: var(--tint); color: var(--muted); font-size: .78rem; font-weight: 700; }
.lead-table th:first-child { width: 33%; }
.lead-table th:nth-child(2) { width: 24%; }
.lead-table th:nth-child(3) { width: 22%; }
.lead-table td { font-size: .9rem; }
.lead-table tbody tr:hover { background: #f8f9f6; }
.lead-table__lead { position: relative; }
.record-id { display: block; font-size: .73rem; letter-spacing: .015em; color: var(--muted); font-weight: 700; }
.lead-link { display: inline; font-weight: 600; color: var(--ink); text-decoration: none; }
.secondary { color: var(--muted); display: block; font-size: .83rem; line-height: 1.3; }
.secondary--clarification { color: #784920; margin-top: .3rem; }
.empty { padding: 1.2rem 1rem 1.45rem; border-top: 1px solid var(--line); color: var(--muted); }
.empty--compact { border: 0; padding: 0; }

.form-stack {
  display: grid;
  gap: .85rem;
  align-content: start;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.form-grid--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { min-width: 0; display: grid; gap: .31rem; align-content: start; }
.field > span { font-weight: 700; font-size: .88rem; }
.field small, .field-hint { color: var(--muted); font-size: .78rem; font-weight: 400; }
.field small { margin-inline-start: .25rem; }
input:not([type="checkbox"]):not([type="hidden"]), select, textarea {
  min-height: 2.55rem;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: .3rem;
  padding: .42rem .56rem;
  background: #fff;
}
input[type="file"] { font-size: .8rem; }
input::placeholder { color: #5b6872; opacity: 1; }
textarea { resize: vertical; }
.check-options { display: grid; gap: .5rem; }
.check-options label { display: flex; align-items: start; gap: .45rem; font-size: .88rem; }
.check-options input { inline-size: 1rem; block-size: 1rem; margin: .15rem 0 0; accent-color: var(--accent); flex-shrink: 0; }

.pill {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: .22rem .48rem;
  border: 1px solid transparent;
  border-radius: .33rem;
  background: #eef1f2;
  color: #334957;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.pill--prominent { font-size: .84rem; padding: .4rem .68rem; margin-top: .25rem; }
.status-new { background: #ecf3f6; color: #254d61; border-color: #d5e3e8; }
.status-assigned { background: #f0eaf6; color: #51396b; border-color: #e1d8eb; }
.status-search, .decision-clarify { background: #faeed8; color: #70461a; border-color: #f0dfbb; }
.status-options, .decision-suitable { background: #eaf3eb; color: #275141; border-color: #d7e7da; }
.status-closed { background: #eff1f2; color: #3e4f57; border-color: #dde2e4; }
.decision-unsuitable { background: #f9ecea; color: #802f28; border-color: #eed3ce; }

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem 1.1rem;
}
.facts--single { grid-template-columns: minmax(0,1fr); }
.facts dt { color: var(--muted); font-size: .76rem; line-height: 1.3; }
.facts dd { color: var(--ink); font-size: .91rem; margin: .14rem 0 0; }
.facts dd:empty::before { content: "—"; color: var(--muted); }
.brief { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--line); white-space: pre-wrap; }
.preserve { white-space: pre-wrap; }
.notice {
  border: 1px solid #c0d9d1;
  border-inline-start: 3px solid #487d70;
  border-radius: .32rem;
  background: #edf6f1;
  color: #233d34;
  padding: .66rem .79rem;
  font-size: .9rem;
}
.notice strong + p { margin-top: .25rem; }
.notice--error { border-color: #efc7bf; border-inline-start-color: #9b452f; background: #fbece8; color: #752823; }
.notice--warn { border-color: #ead8ad; border-inline-start-color: #926122; background: #fcf3dd; color: #573c20; }
.brief + .notice, .notice + .notice { margin-top: .8rem; }
.responsible { color: var(--muted); margin: -.4rem 0 .65rem; }
.timeframe { padding: .15rem .3rem; }
.timeframe dd { font-size: .81rem; }

.checklist, .screening {
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: .4rem;
  padding: .67rem .78rem;
}
.checklist { margin-bottom: .9rem; }
.checklist summary, .inline-details summary { font-weight: 700; }
.checklist ul, .screening ul { margin: .5rem 0; padding-inline-start: 1.15rem; }
.checklist li + li, .screening li + li { margin-top: .3rem; }
.sources { display: flex; flex-wrap: wrap; gap: .2rem .8rem; font-size: .82rem; }
.object-list { display: grid; gap: .8rem; }
.property {
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
}
.property__head { align-items: start; margin-bottom: .7rem; }
.property__head h3 { overflow-wrap: anywhere; }
.property .facts + p, .property .screening, .property .review { margin-top: .8rem; }
.review { border-inline-start: 2px solid #7593a5; padding-inline-start: .65rem; }
.review p { margin-top: .3rem; }
.review .text-link { font-size: .82rem; }
.inline-details, .subsection, .action-details { margin-top: .85rem; }
.subsection, .inline-details { border-top: 1px solid var(--line); padding-top: .75rem; }
.subsection h3, .subsection h4 { margin-bottom: .35rem; }
.inline-details form, .stacked-fields { margin-top: .8rem; }
.action-details summary { list-style: none; }
.action-details summary::-webkit-details-marker { display: none; }
.action-details summary::after { content: '+'; font-size: 1.15em; margin-inline-start: .55rem; }
.action-details[open] summary::after { content: '−'; }
.history { margin: 0; padding: 0; list-style: none; }
.history li + li { border-top: 1px solid var(--line); padding-top: .55rem; margin-top: .55rem; }
.history li .secondary { margin-top: .22rem; }

.contract-actions { display: flex; flex-wrap: wrap; gap: .65rem; }

@media (min-width: 768px) and (max-width: 1279px) {
  :root { --rail-width: 56px; }
  .rail > .brand { justify-content: center; padding: 12px 4px; }
  .rail .brand__type, .rail__nav .nav-link > span { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
  .rail__nav { padding: 0 8px; }
  .rail__nav .nav-link { justify-content: center; padding: 0; width: 38px; height: 36px; margin-bottom: 4px; }
}
@media (max-width: 767px) {
  :root { --rail-width: 0px; }
  .rail { display: none; }
  .appbar { padding-inline: 12px; }
  .appbar__brand { display: inline-flex; }
  .global-search { display: none; }
  .appbar__actions { gap: 8px; }
  .mobile-tabs {
    position: fixed; inset: auto 0 0; z-index: 5; display: flex; align-items: stretch; justify-content: space-around;
    min-height: 56px; padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line);
  }
  .mobile-tabs > .nav-link, .mobile-more { min-width: 0; flex: 1 1 0; }
  .mobile-tabs > .nav-link, .mobile-more > summary {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 55px; line-height: 1.2; color: var(--muted); font-size: 10.5px; font-weight: 500;
  }
  .mobile-tabs > .nav-link .ui-icon { width: 19px; height: 19px; }
  .mobile-tabs [aria-current], .mobile-more[data-active] > summary, .mobile-more[open] > summary { color: var(--accent); }
  .mobile-more__list { position: absolute; right: 5px; bottom: calc(100% + 6px); min-width: 158px; padding: 5px; }
  .shell { padding: 16px 12px calc(78px + env(safe-area-inset-bottom)); }
  .signin-shell { padding: 44px 16px; }
}
@media (max-width: 66rem) {
  .queue-layout { grid-template-columns: minmax(0, 1fr); }
  .queue-search input { width: auto; }
}
@media (max-width: 53rem) {
  .lead-layout { grid-template-columns: minmax(0, 1fr); }
  .lead-brief, .lead-records, .lead-actions { grid-column: auto; grid-row: auto; }
  .lead-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 42rem) {
  .page-head { align-items: start; }
  .queue-search { flex-wrap: wrap; }
  .lead-table, .lead-table tbody, .lead-table tr, .lead-table td { display: block; }
  .lead-table thead { position: absolute; block-size: 1px; inline-size: 1px; overflow: hidden; clip-path: inset(50%); }
  .lead-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: .65rem .7rem;
    border-top: 1px solid var(--line);
    padding: .75rem 1rem;
  }
  .lead-table td, .lead-table td:first-child { padding: 0; border: 0; }
  .lead-table__lead { grid-column: 1 / -1; }
  .lead-table td:not(:first-child)::before {
    display: block;
    content: attr(data-column);
    font-weight: 700;
    font-size: .74rem;
    color: var(--muted);
    margin-bottom: .13rem;
  }
}
@media (max-width: 33rem) {
  .page-head, .property__head { flex-wrap: wrap; }
  .lead-actions, .form-grid--three { grid-template-columns: minmax(0,1fr); }
  .form-grid { gap: .65rem; }
  .field input, .field select, .field textarea, .queue-search input { font-size: 1rem; }
}
@media (max-width: 23rem) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
