/*
 * Homeport Agent portal.
 *
 * The surface below is the Homeport Shift surface: white pages, hairline
 * borders, blue pill buttons, a sans UI, and the wordmark set in Times New
 * Roman. Keep the tokens in sync with the main app when they change there.
 */

:root {
  --ink: #0f172a;
  --ink-soft: #111827;
  --body: #4b5563;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --blue: #1d4ed8;
  --blue-link: #2563eb;
  --blue-tint: #eff6ff;
  --blue-tint-2: #eef2ff;
  --neutral: #f3f4f6;
  --green: #059669;
  --green-tint: #ecfdf5;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --serif: "Times New Roman", Times, "Liberation Serif", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, "Helvetica Neue", Arial, sans-serif;
  --shadow-soft: 0 24px 60px -34px rgba(15, 23, 42, 0.32);
  --shadow-menu: 0 18px 40px -24px rgba(15, 23, 42, 0.45);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  color: var(--ink-soft);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

img {
  max-width: 100%;
  display: block;
}

p {
  margin: 0;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--blue-link);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 16px;
}

/* Wordmark ------------------------------------------------------------- */

.wordmark {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.wordmark:hover {
  color: var(--ink);
}

.wordmark-app {
  color: var(--blue);
  font-size: 28px;
}

.wordmark-splash {
  font-size: 24px;
  color: var(--ink);
}

/* Icons ---------------------------------------------------------------- */

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.icon-sm {
  width: 15px;
  height: 15px;
}

/* Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  background: var(--blue);
  color: #ffffff;
}

.btn-primary:hover {
  background: #1e40af;
}

.btn-primary:disabled {
  background: var(--line);
  color: #9ca3af;
  cursor: default;
}

.btn-outline {
  border-color: var(--blue);
  color: var(--blue);
  background: transparent;
}

.btn-outline:hover {
  background: var(--blue-tint);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  height: 44px;
  padding: 0 18px;
  font-size: 14px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-link);
  text-decoration: none;
  cursor: pointer;
}

.link-arrow:hover {
  text-decoration: underline;
}

.link-arrow .icon {
  width: 15px;
  height: 15px;
}

.link-sm {
  font-size: 13px;
  font-weight: 500;
  color: var(--blue-link);
  text-decoration: none;
}

.link-sm:hover {
  text-decoration: underline;
}

/* Portal header -------------------------------------------------------- */

.portal {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 96px;
  padding: 0 clamp(20px, 6vw, 80px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.header-note {
  font-size: 13.5px;
  color: var(--muted);
}

/* Portal hero ---------------------------------------------------------- */

.portal-hero {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(36px, 5vw, 64px) clamp(20px, 6vw, 80px) clamp(48px, 7vw, 88px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #374151;
}

.eyebrow .icon {
  width: 16px;
  height: 16px;
  color: #4b5563;
}

.hero-copy h1 {
  margin: 18px 0 20px;
  font-size: clamp(38px, 4.6vw, 60px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.hero-copy h1 .accent {
  color: var(--blue-link);
}

.lede {
  max-width: 470px;
  font-size: 17.5px;
  line-height: 1.62;
  color: var(--body);
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--body);
}

.checks .icon {
  width: 15px;
  height: 15px;
  color: #9ca3af;
}

.demo-card {
  max-width: 470px;
  margin-top: 32px;
  padding: 16px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  background: var(--surface-soft);
}

.demo-title {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.demo-copy {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--body);
}

.demo-copy .mono {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--ink-soft);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
}

/* Sign-in card --------------------------------------------------------- */

.hero-card {
  max-width: 470px;
  width: 100%;
  justify-self: end;
}

.signin-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(24px, 3vw, 34px);
  box-shadow: var(--shadow-soft);
}

.micro {
  display: inline-block;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.signin-card h2 {
  margin: 10px 0 6px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.card-sub {
  margin: 0 0 22px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--body);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #ffffff;
  font-size: 15px;
  color: var(--ink);
}

.field input {
  height: 48px;
  padding: 0 14px;
}

.field textarea {
  padding: 12px 14px;
  min-height: 92px;
  resize: vertical;
  line-height: 1.55;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #9ca3af;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.field input:disabled {
  background: var(--surface-soft);
  color: var(--muted);
  cursor: not-allowed;
}

.field-note {
  font-size: 12px;
  color: var(--muted);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 20px;
  flex-wrap: wrap;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--body);
}

.check-inline input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.form-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  color: #b42318;
  font-size: 13.5px;
  line-height: 1.45;
}

.card-foot {
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13.5px;
  color: var(--body);
}

.card-foot a {
  color: var(--blue-link);
  font-weight: 500;
  text-decoration: none;
}

.card-foot a:hover {
  text-decoration: underline;
}

.card-note {
  margin: 14px 4px 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.card-note a {
  color: var(--blue-link);
  text-decoration: none;
}

.card-note a:hover {
  text-decoration: underline;
}

/* Inside the portal ---------------------------------------------------- */

.inside {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 80px) clamp(48px, 7vw, 84px);
}

.inside-head {
  max-width: 640px;
  margin-bottom: 30px;
}

.inside-head h2 {
  margin: 14px 0 10px;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.inside-sub {
  font-size: 15px;
  line-height: 1.6;
  color: var(--body);
}

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

.card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.inside-card {
  padding: 26px;
}

.icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--blue-tint);
  color: var(--blue);
}

.inside-card h3 {
  margin: 16px 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.inside-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--body);
}

/* Footer --------------------------------------------------------------- */

.site-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(20px, 6vw, 80px);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.footer-brand {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-note {
  font-size: 13px;
  color: var(--muted);
}

.footer-link {
  padding: 0;
  border: 0;
  background: none;
  font-size: 13.5px;
  color: #374151;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Workspace shell ------------------------------------------------------ */

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  background: #ffffff;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 26px 16px;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-top {
  padding: 0 10px;
}

.workspace-label {
  margin: 12px 0 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
}

.nav-item .icon {
  width: 19px;
  height: 19px;
  color: var(--muted);
}

.nav-item:hover {
  background: var(--surface-soft);
}

.nav-item.is-active {
  background: var(--blue-tint);
  color: var(--blue);
}

.nav-item.is-active .icon {
  color: var(--blue);
}

.app-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px clamp(20px, 3vw, 36px) 0;
}

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 44px;
  margin-bottom: 6px;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  padding-bottom: 40px;
}

.avatar-menu {
  position: relative;
}

.avatar-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.avatar-chip:hover {
  background: var(--surface-soft);
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue-tint);
  color: var(--blue);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  flex: none;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 15px;
}

.menu-card {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 184px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-menu);
  z-index: 20;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 14px;
  color: #374151;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--surface-soft);
}

.menu-item .icon {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

/* Workspace pages ------------------------------------------------------ */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 34px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.page-sub {
  margin: 8px 0 0;
  font-size: 14.5px;
  color: var(--body);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  padding: 22px 24px;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--body);
}

.stat-label .icon {
  width: 17px;
  height: 17px;
  color: #9ca3af;
}

.stat-value {
  margin: 16px 0 12px;
  font-size: 40px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.stat-caption {
  font-size: 12.5px;
  color: var(--muted);
}

.panel {
  padding: 24px;
}

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

.panel-head h2 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}

.client-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.client-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.client-list .client-row:first-child {
  border-top: 0;
}

.client-name {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.client-meta {
  font-size: 14px;
  color: var(--body);
}

.client-date {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: #9ca3af;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.icon-btn .icon {
  width: 17px;
  height: 17px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--neutral);
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
}

.badge-blue {
  background: var(--blue-tint);
  color: var(--blue);
}

.badge-green {
  background: var(--green-tint);
  color: var(--green);
}

.empty-state {
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* Clients -------------------------------------------------------------- */

.client-card {
  padding: 26px;
}

.client-card + .client-card {
  margin-top: 20px;
}

.client-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.client-card-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.client-card-head .badge {
  margin-left: auto;
}

.detail-list {
  margin: 20px 0 0;
}

.detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.detail-row dt {
  margin: 0;
  color: var(--muted);
}

.detail-row dd {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 500;
  text-align: right;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.client-card.is-selected {
  border-color: #c7d7f7;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

/* File team ------------------------------------------------------------ */

.file-card {
  padding: 24px;
}

.file-card + .file-card {
  margin-top: 16px;
}

.file-card h2 {
  margin: 8px 0 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
}

.file-meta {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--body);
}

.note-card {
  margin-top: 20px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.note-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.note-card p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--body);
}

.timeline {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 0 0 20px 26px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 18px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li:last-child::after {
  display: none;
}

.timeline-title {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.timeline-detail {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--body);
}

.timeline-date {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

/* Messages ------------------------------------------------------------- */

.messages-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.thread-list {
  padding: 18px 14px;
}

.thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 10px;
}

.thread-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.count-badge {
  font-size: 12px;
  color: var(--muted);
}

.thread-items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.thread-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: none;
  text-align: left;
  cursor: pointer;
}

.thread-item:hover {
  background: var(--surface-soft);
}

.thread-item.is-active {
  background: var(--blue-tint);
}

.thread-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.thread-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-preview {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thread-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.thread {
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
}

.thread-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.thread-header h2 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}

.thread-body {
  padding: 10px 2px 4px;
  max-height: 50vh;
  min-height: 220px;
  overflow-y: auto;
}

.msg {
  display: flex;
  gap: 10px;
  padding: 10px 0;
}

.msg.is-mine {
  flex-direction: row-reverse;
}

.msg-body {
  min-width: 0;
  max-width: 560px;
}

.msg-meta {
  margin: 0 0 5px;
  font-size: 11.5px;
  color: var(--muted);
}

.bubble {
  margin: 0;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--neutral);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.msg.is-mine .bubble {
  background: var(--blue-tint);
}

.bubble-system {
  margin: 12px 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

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

.composer textarea {
  width: 100%;
  min-height: 78px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  resize: vertical;
}

.composer textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

/* Homes ---------------------------------------------------------------- */

.search-field {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #ffffff;
  color: var(--muted);
}

.search-field input {
  width: 190px;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
}

.search-field input:focus {
  outline: none;
}

.select {
  height: 44px;
  padding: 0 36px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  font-size: 14px;
  color: var(--ink-soft);
  appearance: none;
  -webkit-appearance: none;
}

.result-line {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--muted);
}

.homes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.home-card {
  overflow: hidden;
}

.home-media {
  position: relative;
  height: 148px;
  background: linear-gradient(135deg, #e8eef6, #dbe6f3 55%, #cfe0f2);
}

.home-media > .icon {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 58px;
  height: 58px;
  color: rgba(29, 78, 216, 0.16);
}

.home-tag {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
}

.home-save {
  position: absolute;
  right: 12px;
  top: 12px;
  width: 32px;
  height: 32px;
  background: #ffffff;
  box-shadow: 0 6px 16px -10px rgba(15, 23, 42, 0.5);
  color: var(--muted);
}

.home-save.is-saved {
  color: #dc2626;
}

.home-save.is-saved .icon {
  fill: currentColor;
}

.home-body {
  padding: 16px 18px 18px;
}

.home-price {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}

.home-address {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
}

.home-city {
  font-size: 13px;
  color: var(--muted);
}

.home-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.home-specs span + span::before {
  content: "·";
  margin-right: 6px;
}

/* Profile -------------------------------------------------------------- */

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.profile-form {
  padding: 26px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.profile-identity h2 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
}

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

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

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
}

.profile-side {
  padding: 24px;
}

.profile-side h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.profile-side .detail-list {
  margin-bottom: 16px;
}

.profile-side .link-arrow {
  margin-top: 14px;
}

/* Splash and toast ----------------------------------------------------- */

.splash {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.splash p {
  font-size: 13.5px;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13.5px;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

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

/* Responsive ----------------------------------------------------------- */

@media (max-width: 1080px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .messages-layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

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

@media (max-width: 900px) {
  .portal-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
    padding-top: 32px;
  }

  .hero-card {
    max-width: none;
    justify-self: stretch;
  }

  .header-note {
    display: none;
  }

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

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-sidebar {
    position: static;
    height: auto;
    gap: 16px;
    padding: 18px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-item {
    padding: 9px 12px;
    white-space: nowrap;
  }

  .app-content {
    padding: 16px 16px 0;
  }

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

  .messages-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .thread-body {
    max-height: none;
  }

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

  .page-head h1 {
    font-size: 28px;
  }
}

@media (max-width: 620px) {
  .site-header {
    min-height: 76px;
    padding: 0 20px;
  }

  .wordmark {
    font-size: 24px;
  }

  .wordmark-app {
    font-size: 24px;
  }

  .btn-sm {
    height: 40px;
    padding: 0 14px;
  }

  .hero-copy h1 {
    font-size: 36px;
  }

  .lede {
    font-size: 16px;
  }

  .site-footer {
    gap: 12px;
    padding: 22px 20px;
  }

  .footer-note {
    order: 3;
    flex-basis: 100%;
    font-size: 12px;
  }

  .client-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
  }

  .client-row .client-date,
  .client-row .badge {
    display: none;
  }

  .search-field input {
    width: 120px;
  }

  .page-actions {
    width: 100%;
  }

  .thread {
    padding: 18px 16px;
  }

  .thread-list {
    padding: 14px 10px;
  }

  .msg-body {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Utilities ------------------------------------------------------------ */

.stack > * + * {
  margin-top: 20px;
}

.homes-grid .empty-state {
  grid-column: 1 / -1;
}

.avatar-sm {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.app-footer {
  padding: 20px 0 24px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.app-footer .footer-note {
  flex: 1;
  text-align: center;
}
