/* 栖价 · 杭州私人住宅工作台 · 高定视觉与动效系统 */
:root {
  --paper: #f7f9f7;
  --paper-warm: #f1f6f3;
  --surface: #ffffff;
  --surface-glass: rgba(255, 255, 255, 0.90);
  --surface-subtle: #f2f7f4;
  --ink: #193328;
  --ink-soft: #2e4d3f;
  --muted: #5e7a6e;
  --muted-light: #8fa79c;
  --line: #e0ece5;
  --line-subtle: #edf5f0;
  --accent: #327d66;
  --accent-hover: #266652;
  --accent-soft: #eaf5f0;
  --accent-light: #d8ece2;
  --accent-glow: rgba(50, 125, 102, 0.16);
  --heart: #e45f76;
  --heart-soft: #fdf0f3;
  --gold: #caa048;
  --gold-soft: #fcf7ec;
  --danger: #b83a28;
  --danger-soft: #fef0ee;
  --warning: #8a6820;
  --shadow-sm: 0 2px 8px rgba(25, 60, 45, 0.04);
  --shadow-md: 0 10px 30px -4px rgba(25, 60, 45, 0.08), 0 2px 8px rgba(25, 60, 45, 0.02);
  --shadow-lg: 0 18px 45px -8px rgba(25, 60, 45, 0.12), 0 4px 14px rgba(0, 0, 0, 0.03);
  --shadow: 0 16px 55px #18423218;
  --radius: 16px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 20% 0%, #eaf4ee 0%, #f9fbf9 55%, #f1f7f3 100%);
  background-attachment: fixed;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
a { color: var(--accent); text-decoration: none; transition: color .18s var(--ease); }
a:hover { text-decoration: underline; color: var(--accent-hover); }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #6ab69b;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
input, select, textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 11px 14px;
  color: var(--ink);
  min-width: 0;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
}
textarea { resize: vertical; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: #8fa79c; }
input[type=checkbox] { accent-color: var(--accent); }
label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: 26px; font-weight: 650; letter-spacing: -.4px; }
h2 { font-size: 22px; font-weight: 650; letter-spacing: -.3px; }
h3 { font-size: 16px; font-weight: 600; }
p { line-height: 1.75; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Button Styles */
.button {
  border: 1px solid transparent;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  transition: transform .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.button:active { transform: scale(0.98); }
.button.primary {
  background: linear-gradient(135deg, #37866e 0%, #2b6f5b 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(50, 125, 102, 0.24);
}
.button.primary:hover {
  background: linear-gradient(135deg, #2b6f5b 0%, #205747 100%);
  box-shadow: 0 6px 18px rgba(50, 125, 102, 0.3);
  transform: translateY(-1px);
}
.button.secondary {
  border-color: #c8e0d4;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.button.secondary:hover {
  background: var(--accent-soft);
  border-color: #aed1c0;
  transform: translateY(-1px);
}
.button.quiet {
  background: transparent;
  color: #557266;
}
.button.quiet:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.button.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #f8d1cb;
}
.button.danger:hover { background: #fce0dc; }
.button.compact {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
}
.button svg { width: 16px; height: 16px; }
.icon-button {
  border: 0;
  background: transparent;
  padding: 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all .18s var(--ease);
}
.icon-button:hover {
  background: var(--accent-soft);
  color: var(--accent);
  transform: scale(1.05);
}
.button-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.form-error { font-size: 13px; color: var(--danger); white-space: pre-wrap; min-height: 10px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; font-weight: 700; color: var(--accent); text-transform: uppercase; }

/* Brand & Logo Mark */
.brand-mark {
  height: 38px;
  width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #37866e 0%, #2b6f5b 100%);
  color: white;
  font-family: "SimSun", "Songti SC", serif;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(50, 125, 102, 0.24);
  transition: transform .2s var(--ease);
}
.brand:hover .brand-mark { transform: scale(1.06) rotate(3deg); }
.boot { height: 100vh; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 20px; font-size: 14px; color: var(--muted); }

/* Auth Screen */
.auth-screen {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: radial-gradient(circle at 50% 30%, #ecf5f0 0%, #f8faf8 60%, #eaf3ed 100%);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 34px;
  color: var(--ink);
}
.brand-sub {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.8px;
  color: var(--muted);
  margin-top: 3px;
}
.auth-card {
  width: min(100%, 430px);
  padding: 40px 36px;
  background: var(--surface);
  border: 1px solid #dcebe2;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(25, 60, 45, 0.08), 0 4px 16px rgba(0, 0, 0, 0.02);
  animation: popIn .35s var(--ease);
}
.auth-card h1 { margin: 16px 0 8px; font-size: 24px; color: var(--ink); }
.auth-card>p { font-size: 13px; color: var(--muted); margin-bottom: 26px; line-height: 1.7; }
.auth-card label { display: block; margin: 16px 0 8px; font-size: 13px; }
.auth-card input { width: 100%; min-height: 46px; }
.auth-submit { width: 100%; justify-content: space-between; margin-top: 14px; min-height: 46px; font-size: 14px; }
.auth-card .auth-foot { font-size: 12px; color: var(--muted); text-align: center; margin: 24px 0 0; line-height: 1.8; }
.auth-caption { font-size: 12px; letter-spacing: .6px; color: var(--muted); margin: 24px 0 0; }

/* Application Shell Layout */
.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); height: 100svh; overflow: hidden; }
.sidebar {
  background: linear-gradient(180deg, #edf5f0 0%, #e7f0eb 100%);
  border-right: 1px solid var(--line);
  padding: 26px 16px 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 1px; margin-top: 2px; }
.new-search {
  border: 1px solid #c0ded0;
  background: white;
  color: var(--accent);
  margin: 28px 0 20px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: all .2s var(--ease);
}
.new-search span { font-size: 18px; font-weight: 400; color: var(--accent); }
.new-search:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.sidebar nav { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: #557266;
  min-height: 44px;
  transition: all .18s var(--ease);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent);
  transform: translateX(2px);
}
.nav-item.active {
  background: white;
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(25, 60, 45, 0.08);
}
.nav-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}
.nav-count:not(:empty) {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 10px;
  padding: 2px 6px;
}
.sidebar-bottom { margin-top: auto; }
.workspace-user {
  border-top: 1px solid #d6e8de;
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink);
}
.workspace-user small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.workspace-user>.icon-button { margin-left: auto; padding: 6px; }
.workspace-user svg { height: 18px; width: 18px; }
.user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #c0ded0;
  background: linear-gradient(135deg, #ffffff 0%, #dbebe2 100%);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 650;
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(23, 94, 81, 0.1);
}

/* Topbar */
.main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.topbar {
  height: 70px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  gap: 15px;
}
.topbar>div:first-child { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); }
.topbar h1 { font-size: 15px; letter-spacing: 0; margin: 0; font-weight: 650; }
.location-dot {
  height: 7px;
  width: 7px;
  border-radius: 50%;
  background: #39a67a;
  box-shadow: 0 0 0 3px rgba(57, 166, 122, 0.2);
}
.header-divider { color: #bcd5c8; margin: 0 3px; }
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.mode-badge {
  font-size: 11px;
  font-weight: 550;
  color: #3d6b58;
  border: 1px solid #cce2d6;
  background: var(--surface);
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
}
.connection-banner {
  padding: 10px 24px;
  background: #fff6e3;
  color: #7e5e1a;
  border-bottom: 1px solid #fae6be;
  font-size: 12px;
  flex-shrink: 0;
}
.page-view { min-height: 0; flex: 1; }
.chat-view { overflow: hidden; }
.workspace-body { display: flex; height: 100%; min-width: 0; }
.conversation-column { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.chat-transcript { overflow: auto; flex: 1; padding: 32px 38px 24px; scroll-behavior: smooth; scrollbar-gutter: stable; }

/* Right Rail (Companion Assistant) */
.insight-rail {
  width: 260px;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, #f2f7f4 0%, #ecf4ef 100%);
  padding: 32px 24px;
  flex-shrink: 0;
  overflow: auto;
}
.rail-label {
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}
.rail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.rail-heading .icon-button { padding: 4px; margin: -4px -4px 0 0; }
.rail-task-status { margin: 6px 0 0; font-size: 14px; font-weight: 650; color: var(--accent); line-height: 1.5; }
.rail-condition { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; min-height: 24px; }
.rail-condition-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid #cbe0d5;
  border-radius: 14px;
  background: white;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  box-shadow: 0 1px 4px rgba(25, 60, 45, 0.04);
}
.rail-empty { font-size: 12px; line-height: 1.7; color: var(--muted); }
.rail-rule { height: 1px; background: #d8e8de; margin: 24px 0; }
.rail-phases { display: grid; gap: 8px; margin-top: 12px; }
.rail-phases .phase {
  padding: 7px 10px;
  border: 1px solid #dcebe2;
  border-radius: 10px;
  background: white;
}
.rail-phases .phase.done { border-color: #aed9c2; background: #f0f9f4; color: #287355; }
.rail-phases .phase.current { border-color: #6fb897; background: #e6f5ed; color: #1e5e45; font-weight: 600; }
.rail-platforms { display: grid; gap: 8px; margin-top: 12px; }
.rail-platform {
  border: 1px solid #d8e8df;
  border-radius: 12px;
  background: white;
  padding: 10px 12px;
  min-width: 0;
  box-shadow: 0 2px 6px rgba(25, 60, 45, 0.03);
}
.rail-platform-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rail-platform-header strong { font-size: 13px; color: var(--ink); font-weight: 650; }
.rail-platform p { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 6px 0 0; }
.rail-task-meta { margin-top: 16px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.rail-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-top: 28px;
  color: var(--accent);
  padding: 10px 12px;
  background: white;
  border-radius: 10px;
  border: 1px solid #d2e6dc;
}
.rail-link:hover { background: var(--accent-soft); text-decoration: none; }

/* Empty Chat - Chic Lifestyle Illustration */
.empty-chat {
  max-width: 720px;
  margin: 24px auto 0;
  text-align: center;
  animation: fadeInUp .4s var(--ease);
}
.chic-hero-scene {
  margin: 0 auto 18px;
  width: 100%;
  max-width: 520px;
  display: flex;
  justify-content: center;
}
.chic-hero-scene svg {
  width: 100%;
  height: auto;
  max-height: 160px;
  filter: drop-shadow(0 8px 24px rgba(25, 60, 45, 0.06));
}
.welcome-symbol {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid #cbe0d5;
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #eaf4ef 100%);
  margin: 0 auto 18px;
  color: var(--accent);
  box-shadow: 0 6px 16px rgba(23, 94, 81, 0.1);
}
.welcome-symbol svg { width: 26px; height: 26px; stroke-width: 1.5; }
.empty-chat h2 {
  font-size: 26px;
  letter-spacing: -.2px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 10px;
  color: var(--ink);
}
.empty-chat>p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  max-width: 500px;
  margin: 0 auto 24px;
}
.suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 26px 0 28px;
}
.suggestion {
  border: 1px solid #d8e8df;
  background: white;
  border-radius: 16px;
  text-align: left;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  min-height: 96px;
  box-shadow: var(--shadow-sm);
  transition: all .22s var(--ease);
}
.suggestion:hover {
  border-color: #88c7aa;
  background: linear-gradient(135deg, #ffffff 0%, #f5faf7 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.suggestion strong {
  font-size: 14px;
  font-weight: 650;
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
}
.suggestion span { font-size: 12px; color: var(--muted); line-height: 1.6; }
.suggestion .suggestion-arrow { font-size: 16px; line-height: 1; color: #327d66; transition: transform .18s var(--ease); }
.suggestion:hover .suggestion-arrow { transform: translate(2px, -2px); }
.start-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #d2e6dc;
  border-radius: 20px;
  padding: 6px 14px;
}
.start-note svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }

/* Composer & Input Area */
.composer-wrap {
  padding: 0 38px 18px;
  flex-shrink: 0;
  background: transparent;
}
.composer {
  border: 1px solid #c2ded0;
  background: white;
  border-radius: 18px;
  padding: 14px 18px 12px;
  box-shadow: 0 8px 30px rgba(25, 60, 45, 0.05), 0 1px 4px rgba(0, 0, 0, 0.02);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 12px 35px rgba(50, 125, 102, 0.12);
}
.composer textarea {
  padding: 0;
  background: transparent;
  border: 0;
  outline: none !important;
  width: 100%;
  resize: none;
  font-size: 14px;
  min-height: 54px;
  max-height: 140px;
  line-height: 1.8;
  display: block;
  color: var(--ink);
}
.composer textarea::placeholder { color: #8fa79c; }
.composer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  border-top: 1px solid #eef6f1;
  padding-top: 8px;
}
.composer-bottom>span { font-size: 11px; color: var(--muted-light); font-weight: 500; }
.send-button {
  min-height: 36px;
  padding: 8px 16px;
  font-size: 12px;
  border-radius: 10px;
}
.composer-note { font-size: 11px; color: var(--muted-light); text-align: center; margin: 8px 0 0; }
.context-row {
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 2px;
  font-size: 12px;
  color: var(--muted);
}
.context-chip {
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 3px 8px;
  color: var(--accent);
  font-weight: 550;
}
.context-row button {
  border: 0;
  padding: 3px 6px;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.context-row button:hover { text-decoration: underline; }
.jump-latest {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px auto;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid #c5e0d3;
  border-radius: 20px;
  background: white;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all .18s var(--ease);
}
.jump-latest:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Chat Messages */
.message { max-width: 1040px; margin: 0 auto 26px; animation: fadeInUp .28s var(--ease); }
.message.user { display: flex; justify-content: flex-end; margin-bottom: 26px; }
.user-bubble {
  background: linear-gradient(135deg, #e4f2eb 0%, #d8eade 100%);
  color: #14382c;
  padding: 13px 18px;
  border-radius: 18px 18px 4px 18px;
  max-width: 85%;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 3px 12px rgba(25, 60, 45, 0.06);
}
.assistant-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
}
.assistant-label .brand-mark {
  width: 26px;
  height: 26px;
  font-size: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(50, 125, 102, 0.15);
}
.assistant-label time { font-size: 11px; color: var(--muted-light); margin-left: auto; font-weight: 400; }
.message-content {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.85;
  color: var(--ink-soft);
  background: white;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid #dcece2;
  box-shadow: var(--shadow-sm);
}

/* Query Report Container */
.query-report {
  margin: 18px 0 28px;
  border: 1px solid #d8e8df;
  border-radius: 20px;
  background: white;
  box-shadow: 0 8px 30px rgba(25, 60, 45, 0.05);
  overflow: hidden;
}
.report-top {
  padding: 20px 24px;
  background: linear-gradient(135deg, #f8fbf9 0%, #edf6f1 100%);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.report-top h3 { margin: 0 0 6px; font-size: 15px; font-weight: 650; color: var(--ink); }
.report-top p { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.7; }
.status-pill {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: #edf5f0;
  color: #55776a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
}
.status-pill.good { background: #eaf6f0; color: #226b4f; border-color: #bde4d0; }
.status-pill.running { background: #eef6f2; color: #1e6147; border-color: #bee2d0; }
.status-pill.warn { background: #fdf5e7; color: #85641e; border-color: #f7dfaf; }
.status-pill.bad { background: #fdeeee; color: #9b3323; border-color: #f9cdc6; }
.status-pill.running:before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulseSoft 1.2s ease-in-out infinite;
}
.round-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.6;
  font-weight: 700;
}
.round-label::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}
.report-content { padding: 22px 24px; }

/* Query Overview */
.query-overview {
  border: 1px solid #dcebe2;
  border-radius: 16px;
  background: linear-gradient(135deg, #fdfaf7 0%, #f8ede6 100%);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.query-overview h4 { font-size: 15px; line-height: 1.6; margin: 0 0 6px; color: var(--ink); font-weight: 650; }
.query-overview p { font-size: 13px; line-height: 1.75; color: var(--ink-soft); margin: 0; overflow-wrap: anywhere; }
.query-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.metric {
  min-width: 0;
  border: 1px solid #dcebe2;
  border-radius: 12px;
  background: white;
  padding: 12px 14px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(25, 60, 45, 0.03);
  transition: all .2s var(--ease);
}
.metric:hover {
  border-color: #8ec9ad;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(50, 125, 102, 0.1);
}
.metric strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  color: var(--accent);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.4px;
}
.metric span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--muted);
}
.query-timing {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.query-phases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 16px 0 0; }
.phase {
  min-width: 0;
  position: relative;
  border-top: 2px solid #ecdcd2;
  padding: 8px 6px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.phase.done { border-top-color: #39a67a; color: #226b4f; }
.phase.current { border-top-color: var(--accent); color: var(--accent); font-weight: 650; }
.phase.idle { color: #8fa79c; }
.phase b { display: block; font-size: 12px; line-height: 1.6; }
.phase span { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.report-human {
  margin: 14px 0;
  padding: 14px 18px;
  border: 1px solid #f6e2b8;
  border-radius: 12px;
  background: #fdf9ee;
  color: #7e5e1a;
  font-size: 13px;
  line-height: 1.75;
}
.report-human b { display: block; font-size: 13px; margin-bottom: 6px; }
.report-error {
  font-size: 13px;
  color: var(--danger);
  line-height: 1.8;
  padding: 12px 16px;
  background: var(--danger-soft);
  border: 1px solid #f9d1cb;
  border-radius: 12px;
  margin-bottom: 16px;
}

/* Listing cards */
.results-group { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.results-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.results-group h4 { font-size: 15px; font-weight: 700; line-height: 1.6; margin: 0 0 14px; color: var(--ink); }
.listing-card {
  border: 1px solid #dcebe2;
  border-radius: 18px;
  padding: 20px;
  margin: 14px 0;
  background: white;
  min-width: 0;
  box-shadow: 0 3px 14px rgba(105, 60, 50, 0.04);
  transition: all .22s var(--ease);
}
.listing-card:hover {
  border-color: #88c7aa;
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(25, 60, 45, 0.08);
}
.listing-card:last-child { margin-bottom: 0; }
.listing-card.excluded { background: #f8faf8; opacity: .88; }
.listing-topline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.source-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  line-height: 1.3;
  border: 1px solid #d0e4d8;
  border-radius: 6px;
  color: #2e664f;
  background: #f2f8f4;
}
.listing-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 6px 0 12px; }
.listing-card h3 {
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.listing-card h3 a { color: var(--ink); transition: color .18s var(--ease); }
.listing-card h3 a:hover { color: var(--accent); text-decoration: none; }
.listing-address { font-size: 12px; color: var(--muted); margin: 0 0 12px; overflow-wrap: anywhere; }
.listing-facts { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 14px; }
.listing-price {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 27px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}
.listing-price small { font-size: 12px; font-weight: 500; margin-left: 4px; letter-spacing: 0; }
.listing-price .price-caption { font-size: 12px; letter-spacing: 0; margin: 0 6px 0 0; color: var(--muted); font-weight: 500; }
.fact { font-size: 12px; color: var(--ink-soft); background: #edf5f0; padding: 4px 8px; border-radius: 6px; font-weight: 550; }

/* Specs Table & Field Rows */
.listing-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 22px;
  margin: 14px 0;
}
.listing-field {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #eaf3ed;
  font-size: 13px;
  line-height: 1.65;
  min-width: 0;
}
.listing-field:first-child { border-top: 0; }
.listing-field dt { flex: 0 0 auto; color: var(--muted); font-weight: 500; max-width: 45%; }
.listing-field dd { margin: 0; min-width: 0; text-align: right; color: var(--ink); overflow-wrap: anywhere; font-weight: 500; }
.listing-reasons {
  font-size: 13px;
  line-height: 1.8;
  color: #5d382f;
  background: linear-gradient(135deg, #fdf6f2 0%, #faede7 100%);
  border: 1px solid #dcebe2;
  border-radius: 10px;
  padding: 10px 14px;
  margin: 12px 0;
}
.listing-source-details {
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  margin: 10px 0;
}
.listing-quote { font-size: 12px; color: var(--muted); margin: 10px 0; overflow-wrap: anywhere; }

/* Actions Bar */
.listing-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #eaf3ed;
  padding-top: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.listing-actions .button { font-size: 12px; min-height: 34px; padding: 6px 12px; border-radius: 8px; }
.listing-actions .original-link {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--accent);
  padding: 6px 10px;
  border-radius: 8px;
  transition: all .18s var(--ease);
}
.listing-actions .original-link:hover { background: var(--accent-soft); text-decoration: none; }
.listing-actions svg { width: 15px; height: 15px; }

/* Favorite Heart Animation & Styling */
.favorite-active {
  background: var(--heart-soft) !important;
  color: var(--heart) !important;
  border-color: #f7c0ca !important;
  animation: heartPop .38s var(--ease);
}
.favorite-active svg {
  fill: var(--heart);
  stroke: var(--heart);
}

/* Accordions & Details */
.detail-fold { font-size: 12px; color: var(--muted); margin: 12px 0; }
.detail-fold summary, .search-details summary, .all-links summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 0;
  transition: color .18s var(--ease);
}
.detail-fold summary:hover, .search-details summary:hover, .all-links summary:hover { color: var(--accent-hover); }
.detail-fold dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  padding: 12px 14px;
  background: #f3f8f5;
  font-size: 12px;
  line-height: 1.7;
  border-radius: 10px;
  margin-top: 8px;
}
.detail-fold dt { color: var(--muted); font-weight: 550; }
.detail-fold dd { margin: 0; overflow-wrap: anywhere; color: var(--ink); }
.layout-record { border-top: 1px solid var(--line); padding: 10px 0 14px; margin-top: 10px; }
.layout-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.layout-status { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.layout-source { font-size: 12px; margin: 6px 0 0; }
.layout-evidence summary { font-size: 11px; color: var(--muted); }
.layout-evidence p { margin: 6px 0; font-size: 12px; }

/* Opportunities & Market Table */
.opportunity {
  border-left: 3px solid #e27563;
  background: linear-gradient(135deg, #fdf6f2 0%, #fbf0ea 100%);
  padding: 14px 16px;
  margin: 10px 0;
  border-radius: 0 12px 12px 0;
  box-shadow: 0 2px 8px rgba(226, 117, 99, 0.07);
}
.opportunity strong { display: block; font-size: 14px; font-weight: 700; color: #1b6348; margin-bottom: 6px; }
.opportunity p { margin: 4px 0; font-size: 13px; line-height: 1.75; color: #23543e; }
.opportunity ul { padding-left: 18px; line-height: 1.8; margin: 6px 0; }
.opportunity li { margin: 4px 0; font-size: 12px; }
.opportunity details { font-size: 12px; color: var(--muted); margin-top: 8px; }
.market-note { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.7; }
.market-table-wrap { overflow: auto; }
.market-table { border-collapse: collapse; width: 100%; font-size: 12px; min-width: 440px; text-align: left; }
.market-table th { font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding: 10px 12px 10px 0; }
.market-table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line-subtle); color: var(--ink); line-height: 1.7; }
.market-table tr:last-child td { border: 0; }
.market-table small { display: block; font-size: 11px; color: var(--muted); }
.search-details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}
.search-details pre {
  max-width: 100%;
  margin: 10px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: var(--ink-soft);
  background: #f3f8f5;
  border: 1px solid #d8e8df;
  border-radius: 10px;
  padding: 12px;
}
.search-details p { margin: 8px 0; overflow-wrap: anywhere; }
.all-links { margin-top: 16px; font-size: 12px; }
.all-links ol { padding-left: 20px; margin: 12px 0; line-height: 1.9; }
.all-links li { padding: 4px 0; overflow-wrap: anywhere; }
.all-links small { display: block; color: var(--muted-light); font-size: 11px; }
.link-context { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.report-actions .button { font-size: 13px; min-height: 40px; }

/* Loading State */
.pending-placeholder {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--accent);
  font-size: 13px;
  font-weight: 550;
  padding: 18px 22px;
  background: white;
  border: 1px solid #dcebe2;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  margin: 16px 0;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #ecdcd2;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}
.report-mode { font-size: 11px; color: var(--muted); margin-top: 12px; }

/* Content Pages */
.content-page { overflow: auto; padding: 36px; scrollbar-gutter: stable; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 0 0 28px; }
.page-heading h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.page-heading p { font-size: 13px; color: var(--muted); margin: 0; }
.page-empty { max-width: 480px; margin: 80px auto; text-align: center; animation: fadeInUp .35s var(--ease); }
.page-empty .empty-icon {
  margin: 0 auto 20px;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #e7f4ed 0%, #d8ece0 100%);
  color: var(--accent);
  box-shadow: 0 6px 16px rgba(50, 125, 102, 0.12);
}
.page-empty h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; color: var(--ink); }
.page-empty p { font-size: 13px; color: var(--muted); line-height: 1.8; }
.page-empty .button { margin-top: 16px; }
.favorite-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.favorite-grid .listing-card { margin: 0; }

/* Watches & Notifications */
.watch-list { display: grid; gap: 16px; }
.watch-card {
  background: white;
  border: 1px solid #d9ebe0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all .2s var(--ease);
}
.watch-card:hover { border-color: #e5a99c; box-shadow: var(--shadow-md); }
.watch-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.watch-heading h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.watch-heading p { font-size: 12px; color: var(--muted); margin: 0; }
.watch-criteria {
  font-size: 13px;
  color: #1e5e48;
  padding: 12px 16px;
  background: #f2f8f5;
  border-radius: 10px;
  border: 1px solid #d4eadc;
  line-height: 1.75;
}
.watch-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 12px; color: var(--muted); margin: 16px 0; }
.watch-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.notification-list { background: white; border: 1px solid #dcebe2; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.notification-item { display: flex; gap: 14px; padding: 22px; border-bottom: 1px solid var(--line-subtle); transition: background .18s ease; }
.notification-item:last-child { border: 0; }
.notification-item.unread { background: linear-gradient(135deg, #f7fbf9 0%, #eff6f2 100%); }
.notification-dot { flex-shrink: 0; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #39a67a; }
.notification-item.read .notification-dot { background: #c2d6cb; }
.notification-item h3 { font-size: 14px; font-weight: 700; margin: 0 0 8px; line-height: 1.6; }
.notification-item p { font-size: 13px; color: var(--ink-soft); margin: 0 0 10px; white-space: pre-wrap; line-height: 1.75; }
.notification-item time { font-size: 11px; color: var(--muted); }
.notification-item .button { margin-top: 10px; }

/* Settings */
.settings-layout { max-width: 840px; }
.settings-section {
  background: white;
  border: 1px solid #d9ebe0;
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.settings-section h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.settings-section>p { font-size: 13px; color: var(--muted); line-height: 1.8; margin-bottom: 24px; }
.settings-section .field-help { font-size: 11px; color: var(--muted-light); line-height: 1.7; margin: 6px 0 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field.full { grid-column: 1/-1; }
.field label { font-size: 12px; font-weight: 600; }
.checkbox-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); }
.checkbox-row input { margin: 0; }
.settings-footer { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 24px; }
.settings-status { font-size: 12px; color: var(--muted); line-height: 1.8; }
.setting-platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.setting-platform {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #dcebe2;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  background: #fdfaf8;
}
.notice {
  padding: 14px 18px;
  background: #f0f7f3;
  color: #235846;
  font-size: 12px;
  line-height: 1.8;
  border-radius: 10px;
  border: 1px solid #dcebe2;
  margin-top: 16px;
}
.danger-text { color: var(--danger); }

/* Modals & Dialogs */
.modal {
  border: 1px solid #eddcd2;
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  max-width: min(680px, calc(100vw - 32px));
  width: 680px;
  max-height: 90svh;
  overflow: auto;
  color: var(--ink);
  background: white;
  animation: popIn .25s var(--ease);
}
.modal::backdrop { background: rgba(25, 45, 35, 0.45); backdrop-filter: blur(6px); }
.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 22px; }
.modal-heading h2 { font-size: 19px; font-weight: 700; margin: 4px 0 0; }
.modal-heading p { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.modal form>.button-row { margin-top: 24px; justify-content: flex-end; }
.history-summary {
  background: #f2f8f5;
  border: 1px solid #d4eadc;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.8;
}
.history-table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
.history-table th { font-size: 11px; font-weight: 600; color: var(--muted); padding: 10px 8px; border-bottom: 1px solid var(--line); }
.history-table td { padding: 12px 8px; border-bottom: 1px solid var(--line-subtle); font-size: 12px; line-height: 1.7; }

/* Platform Browser Modal */
.browser-modal { max-width: min(1380px, calc(100vw - 28px)); width: 1280px; padding: 22px; }
.browser-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.browser-toolbar select { font-size: 12px; padding: 8px 12px; max-width: 160px; }
.browser-toolbar #browser-release { margin-left: auto; }
.browser-connection-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin: 0 0 9px; }
.browser-connection { min-width: 0; font-size: 12px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.browser-connection[data-state="connected"] { color: #1e5e48; }
.browser-connection[data-state="disconnected"] { color: #9b5727; }
.browser-connection-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.browser-status {
  font-size: 12px;
  color: #1e5e48;
  line-height: 1.8;
  background: #f2f8f5;
  border: 1px solid #dcebe2;
  padding: 10px 14px;
  border-radius: 10px;
  margin: 14px 0;
  overflow-wrap: anywhere;
}
.browser-image-wrap {
  width: 100%;
  overflow: auto;
  background: #edf5f0;
  border: 1px solid #cce2d6;
  border-radius: 12px;
  max-height: 62svh;
  position: relative;
}
.browser-image-wrap img { width: 100%; height: auto; display: block; cursor: crosshair; user-select: none; }
.browser-image-wrap img.released { cursor: default; }
.browser-remote { width: 100%; height: clamp(240px, calc(90svh - 410px), 620px); overflow: hidden; touch-action: none; background: #edf5f0; }
.browser-remote:not([hidden]) ~ .browser-placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: #edf5f0; pointer-events: none; }
.browser-remote canvas { outline-offset: -3px; }
.browser-placeholder { padding: 110px 20px; text-align: center; font-size: 13px; color: var(--muted); }
.browser-input-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.browser-input-bar input { flex: 1; min-width: 220px; font-size: 13px; padding: 9px 12px; }
.browser-note { font-size: 11px; color: var(--muted); line-height: 1.7; margin: 12px 0 0; }
@media (max-width: 600px) {
  .browser-modal { width: calc(100vw - 16px); max-width: calc(100vw - 16px); padding: 14px; max-height: 94svh; }
  .browser-modal .modal-heading { margin-bottom: 14px; }
  .browser-toolbar { gap: 7px; }
  .browser-toolbar select { flex: 1; max-width: none; min-width: 0; }
  .browser-toolbar #browser-release { margin-left: 0; }
  .browser-connection-actions { width: 100%; }
  .browser-remote { height: auto; aspect-ratio: 8 / 5; }
  .browser-input-bar input { flex-basis: 100%; width: 100%; min-width: 0; }
  .browser-status { padding: 8px 10px; margin: 10px 0; }
}
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(580px, calc(100vw - 32px));
  padding: 13px 22px;
  background: linear-gradient(135deg, #20473a 0%, #15352a 100%);
  color: #fff;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(21, 53, 42, 0.3);
  z-index: 1000;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.6;
  animation: fadeInUp .25s var(--ease);
}
.toast.error { background: linear-gradient(135deg, #9e3725 0%, #752314 100%); }

/* Keyframe Animations */
@keyframes pulse { 50% { opacity: .35; } }
@keyframes pulseSoft { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(0.88); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.96); } 70% { transform: scale(1.01); } 100% { opacity: 1; transform: scale(1); } }
@keyframes heartPop { 0% { transform: scale(1); } 35% { transform: scale(1.32); } 65% { transform: scale(0.92); } 100% { transform: scale(1); } }

/* Reduced Motion Mode */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .insight-rail { transition: none !important; }
}
.browser-image-wrap img { touch-action: none; }
summary:focus-visible { outline: 3px solid #6ab69b; outline-offset: 3px; border-radius: 4px; }

/* Geometry Alignment & View Chat Specifics */
.conversation-column { align-items: stretch; position: relative; }
.chat-transcript { padding-top: 30px; padding-bottom: 24px; }
.chat-content, .composer-wrap { width: min(100%, 1040px); max-width: 1040px; margin-left: auto; margin-right: auto; }
.chat-transcript>.chat-content { min-width: 0; }
.chat-content .message, .chat-content .query-report, .chat-content .empty-chat { max-width: none; }
.message { max-width: 1040px; }
.empty-chat { max-width: 720px; }
.composer-wrap { padding-left: 0; padding-right: 0; padding-bottom: 18px; }
.composer { width: 100%; }
.composer-feedback { min-height: 20px; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.composer-feedback:empty { display: none; }

.workspace-body { position: relative; }
.insight-rail { overflow: auto; transition: width .2s var(--ease), padding .2s var(--ease), opacity .2s var(--ease); }
.workspace-body.rail-collapsed>.insight-rail { width: 0; padding-left: 0; padding-right: 0; border-left: 0; opacity: 0; pointer-events: none; overflow: hidden; }

@media (min-width: 1280px) {
  .workspace-body:not(.rail-collapsed)>.insight-rail { width: 276px; }
  .workspace-body:not(.rail-collapsed) .chat-transcript, .workspace-body:not(.rail-collapsed) .composer-wrap { padding-left: 34px; padding-right: 34px; }
}
@media (max-width: 1279px) {
  .insight-rail { display: none; }
  .workspace-body.rail-open>.insight-rail { display: block; position: absolute; z-index: 20; top: 0; right: 0; width: min(330px, calc(100% - 26px)); height: 100%; border: 1px solid #c5e0d3; background: #fbf2ec; padding: 26px 22px; opacity: 1; pointer-events: auto; overflow: auto; box-shadow: 0 12px 40px rgba(25, 60, 45, 0.12); }
  .workspace-body.rail-collapsed>.insight-rail { width: min(330px, calc(100% - 26px)); padding: 26px 22px; opacity: 1; pointer-events: auto; display: none; }
  .chat-content, .composer-wrap { width: min(100%, 1000px); }
}
@media (max-width: 1000px) {
  .query-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .listing-grid { grid-template-columns: 1fr; }
  .chat-transcript, .composer-wrap { padding-left: 30px; padding-right: 30px; }
  .suggestions { grid-template-columns: 1fr; }
}

/* Strict Layout Rules for #view-chat */
#view-chat { --chat-gap: 24px; --chat-width: 1040px; font-size: 14px; line-height: 1.7; }
#view-chat .chat-transcript { padding: 26px var(--chat-gap) 24px; scrollbar-gutter: stable both-edges; scroll-behavior: auto; overflow-anchor: none; }
#view-chat .chat-transcript::-webkit-scrollbar { width: 8px; }
#view-chat .chat-transcript::-webkit-scrollbar-thumb { background: #bcd6c8; border-radius: 6px; }
#view-chat .chat-content { width: 100%; max-width: var(--chat-width); margin: 0 auto; }
#view-chat .composer-wrap { width: calc(100% - var(--chat-gap)*2 - 16px); max-width: var(--chat-width); padding: 0 0 14px; margin: 0 auto; position: relative; }
#view-chat .message { max-width: none; margin: 0 0 26px; }
#view-chat .message-content, #view-chat .user-bubble { font-size: 15px; line-height: 1.75; }
#view-chat .query-report { margin: 0 0 24px; width: 100%; border-radius: 18px; }
#view-chat .report-top { padding: 20px 24px; gap: 12px; }
#view-chat .report-top h3 { font-size: 15px; }
#view-chat .report-top p { font-size: 13px; color: var(--muted); line-height: 1.7; }
#view-chat .report-content { padding: 22px 24px; }
#view-chat .query-overview { padding: 18px 20px; border: 1px solid #dcebe2; background: linear-gradient(135deg, #fdfaf7 0%, #f8ede6 100%); }
#view-chat .query-overview>p { font-size: 14px; color: var(--ink-soft); line-height: 1.75; }
#view-chat .query-overview .query-timing { margin-top: 12px; font-size: 12px; color: var(--muted); }
#view-chat .query-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#view-chat .metric { background: white; padding: 12px 14px; }
#view-chat .metric strong { font-size: 22px; font-variant-numeric: tabular-nums; }
#view-chat .phase { color: var(--muted); font-weight: 400; }
#view-chat .phase b, #view-chat .phase span { display: block; font-size: 12px; line-height: 1.65; }
#view-chat .phase.current { color: var(--accent); }
#view-chat .phase.idle { color: #8fa79c; }
#view-chat .report-human { background: #fdf9ee; color: #7e5e1a; font-size: 13px; margin: 18px 0; padding: 14px 18px; }
#view-chat .report-human>div { margin-top: 8px; }
#view-chat .report-human .button { margin-top: 6px; }
#view-chat .results-group h4, #view-chat .section-heading h4 { font-size: 15px; }
#view-chat .listing-card { border-radius: 18px; padding: 20px; }
#view-chat .listing-card h3 { font-size: 17px; line-height: 1.55; }
#view-chat .listing-price { font-size: 27px; color: var(--accent); }
#view-chat .listing-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin: 12px 0; }
#view-chat .listing-field { font-size: 13px; line-height: 1.65; gap: 12px; }
#view-chat .listing-field dt { color: var(--muted); max-width: 45%; }
#view-chat .listing-field dd { color: var(--ink); }
#view-chat .listing-reasons { font-size: 13px; line-height: 1.75; }
#view-chat .source-tag, #view-chat .status-pill, #view-chat .listing-source-details, #view-chat .original-link, #view-chat .assistant-label, #view-chat .assistant-label time { font-size: 12px; }
#view-chat .listing-actions .button { font-size: 12px; min-height: 36px; padding: 8px 12px; }
#view-chat .report-actions .button { font-size: 13px; min-height: 40px; white-space: normal; }
#view-chat .empty-result, #view-chat .market-note, #view-chat .search-details, #view-chat .all-links, #view-chat .detail-fold { font-size: 13px; line-height: 1.75; color: var(--muted); }
#view-chat .search-details p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0; }
#view-chat .search-details dl { font-size: 12px; line-height: 1.7; }
#view-chat .search-details dd { margin: 4px 0 12px; overflow-wrap: anywhere; }
#view-chat .all-links small, #view-chat .link-context { display: block; overflow-wrap: anywhere; font-size: 12px; color: var(--muted); }
#view-chat .market-cards>div { padding: 12px 0; border-bottom: 1px solid var(--line); }
#view-chat .market-cards p { margin: 8px 0 0; }
#view-chat .composer { box-shadow: 0 8px 30px rgba(25, 60, 45, 0.05); padding: 14px 18px; border: 1px solid #c2ded0; border-radius: 18px; }
#view-chat .composer textarea { font-size: 15px; line-height: 1.75; min-height: 54px; max-height: 120px; }
#view-chat .composer textarea:focus-visible { outline: 2px solid #6ab69b !important; outline-offset: 4px; border-radius: 4px; }
#view-chat .composer:focus-within { box-shadow: 0 0 0 3px var(--accent-glow), 0 12px 35px rgba(50, 125, 102, 0.12); border-color: var(--accent); }
#view-chat .send-button { min-height: 38px; font-size: 13px; padding: 9px 16px; }
#view-chat .composer-bottom>span, #view-chat .composer-note, #view-chat .context-row, #view-chat .context-row button { font-size: 12px; color: var(--muted); }
#view-chat .context-row { flex-wrap: nowrap; min-height: 36px; gap: 10px; }
#view-chat .context-row>span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; }
#view-chat .context-row>button { white-space: nowrap; }
#view-chat .composer-feedback button { border: 1px solid #bcdbcc; border-radius: 6px; color: var(--accent); background: #fff; padding: 4px 10px; margin-left: 5px; }
#view-chat .jump-latest { position: absolute; top: 0; right: 0; z-index: 5; background: #fff; color: var(--accent); min-height: 32px; margin: 0; }
#view-chat .composer-wrap:has(.jump-latest:not([hidden])) .context-row { padding-right: 137px; }
#view-chat .insight-rail { padding: 28px 22px; background: #ecf4ef; }
#view-chat .rail-label, #view-chat .rail-task-status, #view-chat .rail-empty, #view-chat .rail-task-meta, #view-chat .rail-task-meta small, #view-chat .rail-platform p, #view-chat .rail-link { font-size: 12px; line-height: 1.7; color: var(--muted); }
#view-chat .rail-label { letter-spacing: .6px; font-weight: 700; }
#view-chat .rail-task-status { font-size: 15px; margin-top: 6px; color: var(--accent); }
#view-chat .rail-rule { margin: 22px 0; }
#view-chat .rail-platform p { margin: 4px 0; }
#view-chat .rail-platform strong { font-size: 13px; }
#view-chat .rail-phases-list { display: grid; gap: 8px; }
#view-chat .rail-link { margin-top: 24px; }
#view-chat .empty-chat { margin: 28px 0 0; max-width: 720px; }
#view-chat .empty-chat>p { font-size: 14px; color: var(--muted); }
#view-chat .suggestion strong { font-size: 14px; }
#view-chat .suggestion span, #view-chat .start-note { font-size: 12px; color: var(--muted); }
.topbar .mode-badge, .brand small, .nav-count { font-size: 12px; }
.topbar .button { font-size: 12px; }
#view-chat .small, #view-chat small, #view-chat .layout-row, #view-chat .opportunity p, #view-chat .opportunity details, #view-chat .layout-source, #view-chat .layout-status { font-size: 12px; color: var(--muted); line-height: 1.7; }
#view-chat .opportunity>p { font-size: 14px; }
#view-chat .composer textarea::placeholder { color: #8fa79c; }

/* Responsive 700px (Mobile 390px Viewport) */
@media (max-width: 700px) {
  .app-shell { height: 100dvh; grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) calc(64px + env(safe-area-inset-bottom, 0px)); }
  .sidebar {
    grid-row: 2;
    flex-direction: row;
    padding: 0 8px calc(env(safe-area-inset-bottom, 0px)/2);
    border-right: 0;
    border-top: 1px solid #ebdcd2;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    z-index: 10;
  }
  .sidebar .brand, .sidebar>.new-search, .sidebar-bottom { display: none; }
  .sidebar nav { flex-direction: row; justify-content: space-around; gap: 0; flex: 1; }
  .nav-item {
    padding: 8px 5px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 0;
    position: relative;
    font-size: 11px;
    flex: 1;
    min-width: 0;
  }
  .nav-item.active { background: transparent; color: var(--accent); box-shadow: none; }
  .nav-item.active:before { position: absolute; top: 0; content: ""; height: 3px; width: 28px; border-radius: 2px; background: var(--accent); }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-count:not(:empty) { position: absolute; top: 4px; right: calc(50% - 25px); background: var(--accent); color: white; min-width: 14px; line-height: 14px; padding: 0 4px; border-radius: 8px; font-size: 9px; }
  .main { grid-row: 1; }
  .topbar { height: auto; min-height: 58px; padding: 8px 14px; flex-wrap: wrap; gap: 6px; }
  .topbar>div:first-child { font-size: 12px; gap: 6px; }
  .topbar-actions { gap: 6px; margin-left: auto; }
  .topbar .mode-badge { display: none; }
  .topbar .button { font-size: 12px; padding: 6px 10px; min-height: 34px; }
  #view-chat { --chat-gap: 10px; }
  #view-chat .chat-transcript { padding-top: 18px; padding-bottom: 20px; }
  #view-chat .composer-wrap { padding-bottom: 8px; width: calc(100% - var(--chat-gap)*2 - 16px); }
  #view-chat .composer { padding: 10px 14px; border-radius: 14px; }
  #view-chat .composer textarea { font-size: 16px; min-height: 48px; }
  #view-chat .composer-note { display: none; }
  #view-chat .composer-bottom { gap: 6px; }
  #view-chat .report-top, #view-chat .report-content { padding: 16px 14px; }
  #view-chat .listing-card { padding: 16px 14px; border-radius: 14px; }
  #view-chat .listing-fields { grid-template-columns: 1fr; }
  #view-chat .listing-field { font-size: 13px; }
  #view-chat .query-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #view-chat .query-phases { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #view-chat .assistant-label time { font-size: 11px; }
  #view-chat .workspace-body.rail-open>.insight-rail {
    top: 8px;
    right: 8px;
    height: calc(100% - 220px);
    max-height: 75dvh;
    width: calc(100% - 16px);
    padding: 18px;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(25, 60, 45, 0.15);
  }
  #view-chat .context-row { gap: 6px; min-height: 32px; }
  #view-chat .report-actions .button { flex: 1; min-width: 100px; }
  .suggestions { grid-template-columns: 1fr; gap: 10px; }
  .favorite-grid { grid-template-columns: 1fr; }
}

/* Compact property results: keep the surrounding application layout intact. */
.compact-listing, #view-chat .compact-listing { padding: 16px 18px; border-radius: 12px; box-shadow: none; }
.compact-listing:hover { transform: none; box-shadow: none; }
.compact-listing.excluded { opacity: 1; }
.compact-listing .listing-topline { justify-content: space-between; gap: 8px 12px; margin-bottom: 9px; }
.listing-origin { min-width: 0; font-size: 12px; color: #536c61; overflow-wrap: anywhere; }
.compact-listing h3, #view-chat .compact-listing h3 { margin-bottom: 3px; font-size: 16px; line-height: 1.6; }
.listing-specs { margin: 0 0 12px; font-size: 14px; color: var(--ink-soft); overflow-wrap: anywhere; }
.listing-prices { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px 32px; }
.listing-prices>div { min-width: 0; display: flex; flex-direction: column; }
.price-label { color: #536c61; font-size: 12px; line-height: 1.6; }
.listing-prices .listing-price, #view-chat .listing-prices .listing-price { font-size: 26px; line-height: 1.45; letter-spacing: 0; overflow-wrap: anywhere; }
.listing-unit-price { font-size: 19px; line-height: 1.45; letter-spacing: 0; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.listing-prices small, #view-chat .listing-prices small { margin-left: 4px; font-size: 12px; font-weight: 500; color: inherit; }
.listing-prices .price-missing, #view-chat .listing-prices .price-missing { font-size: 17px; color: #536c61; }
.listing-quote-source { margin: 5px 0 0; color: #536c61; font-size: 12px; overflow-wrap: anywhere; }
.listing-match-note { margin: 9px 0 0; font-size: 13px; line-height: 1.65; color: #536c61; overflow-wrap: anywhere; }
.listing-match-note.excluded { color: #9a4036; }
.listing-match-note.matched { color: #286348; }
.compact-listing .listing-more { margin-top: 10px; padding-top: 0; border-top: 0; }
.compact-listing .listing-more>summary { font-size: 12px; font-weight: 500; padding: 4px 0; }
.compact-listing .listing-more dl.listing-fields { display: grid; grid-template-columns: 1fr; margin: 10px 0; padding: 0; background: none; }
.compact-listing .listing-field dt { flex-shrink: 0; }
.compact-listing .listing-field dd { overflow-wrap: anywhere; }
.compact-listing .listing-actions { margin-top: 8px; padding-top: 10px; gap: 6px; }
.compact-listing .listing-actions .button, #view-chat .compact-listing .listing-actions .button { min-height: 34px; padding: 6px 9px; }
.compact-listing .listing-actions .original-link { padding: 6px 0 6px 5px; }
.excluded-results>summary { font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; line-height: 1.8; }
.excluded-results>summary>span { display: inline-block; margin-left: 10px; font-size: 12px; font-weight: 400; color: #536c61; }
#view-chat .concise-overview { background: transparent; border: 0; padding: 0; margin-bottom: 14px; }
#view-chat .concise-overview>p { margin: 0 0 12px; }
#view-chat .concise-overview .metric { padding: 8px 10px; border: 1px solid var(--line); box-shadow: none; }
#view-chat .concise-overview .metric strong { font-size: 20px; }
#view-chat .report-human { margin: 14px 0; padding: 10px 14px; }
#view-chat .report-human>div:first-child { margin-top: 0; }
.platform-source-link { display: inline-block; font-size: 12px; margin-left: 5px; padding: 4px 0; }
#view-chat .report-top p { margin: 5px 0 0; }
.compact-listing summary:focus-visible, .excluded-results>summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 3px; }
@media (max-width: 700px) {
  .compact-listing, #view-chat .compact-listing { padding: 13px 12px; }
  .listing-prices { column-gap: 20px; }
  #view-chat .listing-prices .listing-price { font-size: 24px; }
  .listing-unit-price { font-size: 18px; }
  .compact-listing .listing-actions .original-link { margin-left: 0; }
}
/* Immediate outgoing messages; the query report remains in the shared column. */
.draft-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; white-space:normal; }
.draft-actions small { flex-basis:100%; color:var(--muted); font-size:12px; }
#view-chat .pending-results > summary > span { margin-left: 8px; }
#view-chat [data-action="watch-query"] { white-space: nowrap; }
#view-chat .message.user { gap: 10px; align-items: flex-start; }
#view-chat .user-message-body { max-width: min(82%, 720px); min-width: 0; }
#view-chat .user-bubble { max-width: none; margin: 0; border-radius: 12px 3px 12px 12px; background: #dceddf; box-shadow: none; overflow-wrap: anywhere; white-space: pre-wrap; }
#view-chat .chat-user-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px; background: #286953; color: #fff; font-size: 13px; }
#view-chat .message-delivery { margin-top: 6px; color: #52695e; font-size: 12px; line-height: 1.6; text-align: right; }
#view-chat .message-delivery button { color: #a22c2c; padding: 2px 7px; border: 1px solid currentColor; border-radius: 5px; background: transparent; cursor: pointer; }
#view-chat .message-content { max-width: 88%; border-radius: 3px 12px 12px 12px; border: 1px solid #dce5df; background: #fff; padding: 12px 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
/* Manual evidence stays separate from verified search cards. */
.browser-binding { margin: 0 0 12px; color: #245c48; overflow-wrap: anywhere; line-height: 1.65; }
.platform-issue + .platform-issue { border-top: 1px solid #eee6cf; padding-top: 10px; }
.platform-issue-main { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.platform-issue-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#view-chat .report-human .platform-issue-actions .button { margin-top: 0; min-height: 32px; }
.platform-issue-details { margin-top: 3px; font-size: 12px; line-height: 1.65; }
.platform-issue-details > summary { width: fit-content; cursor: pointer; color: #75694d; }
.platform-issue-detail { padding: 8px 0 4px; overflow-wrap: anywhere; }
.platform-issue-detail p { margin: 0 0 5px; }
.platform-issue-reason { color: #786f5b; }
.manual-results { margin-block: 20px; min-width: 0; }
.manual-card { margin-top: 12px; padding: 16px; border: 1px solid #d4dad6; border-radius: 12px; background: #fafbfa; overflow-wrap: anywhere; }
.manual-card-heading { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.manual-status { font-size: 12px; color: #675328; }
.manual-card p { margin-block: 8px; }
.manual-price { display: flex; gap: 24px; margin-block: 12px; flex-wrap: wrap; }
.manual-card details { margin-top: 12px; }
.manual-original { white-space: pre-wrap; overflow-wrap: anywhere; }
.manual-evidence-image { max-width: 100%; height: auto; border-radius: 8px; }
#manual-form { min-width: 0; }
#manual-form input, #manual-form textarea, #manual-form select { min-width: 0; max-width: 100%; width: 100%; box-sizing: border-box; }
#manual-form textarea { resize: vertical; font: inherit; line-height: 1.65; padding: 10px; border: 1px solid #ccd3ce; border-radius: 8px; }
@media (max-width: 600px) { #manual-form .form-grid { grid-template-columns: minmax(0,1fr); } .manual-card { padding: 12px; } }

/* Regional monitor: keep prices compact and evidence collapsible. */
.monitor-overview { min-width:0; margin:16px 0; overflow-wrap:anywhere; }
.monitor-overview p { line-height:1.65; }
.monitor-platforms { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.monitor-platforms>div { min-width:0; padding:12px; border:1px solid var(--line,#d7ded9); border-radius:12px; }
.monitor-opportunities { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.monitor-opportunity { min-width:0; }
.opportunity-reason { font-weight:600; color:var(--green,#225e48); }
#monitor-form .watch-criteria { white-space:normal; overflow-wrap:anywhere; }
@media(max-width:700px) { .monitor-platforms,.monitor-opportunities { grid-template-columns:minmax(0,1fr); } }
