/* =========================================================
   Leo Property Command
   Mobile-first manager app UI
   ========================================================= */

:root {
  /* Surfaces */
  --bg: #f4f0e8;
  --bg-soft: #ece7dc;
  --bg-deep: #d9d6c8;
  --surface: #ffffff;
  --surface-tint: #faf8f1;

  /* Ink */
  --ink: #0f0d0a;
  --ink-2: #2a241c;
  --ink-soft: #5a5144;
  --ink-muted: #8a8073;
  --line: rgba(15, 13, 10, 0.08);
  --line-strong: rgba(15, 13, 10, 0.16);

  /* Brand */
  --copper: #b94f2b;
  --copper-deep: #863719;
  --copper-soft: #fbdcc6;
  --emerald: #126b61;
  --emerald-soft: #d2ece8;
  --steel: #2f5f7f;
  --steel-soft: #dce8f0;
  --amber: #b78328;
  --amber-soft: #f6e1b6;
  --red: #d93322;
  --red-soft: #fbd9d4;

  /* Type */
  --serif: "Fraunces", ui-serif, Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;

  /* Space */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Shadow stack */
  --sh-1: 0 1px 2px rgba(20, 15, 8, 0.04), 0 2px 8px rgba(20, 15, 8, 0.05);
  --sh-2: 0 4px 14px rgba(20, 15, 8, 0.06), 0 16px 36px rgba(20, 15, 8, 0.08);
  --sh-3: 0 18px 48px rgba(20, 15, 8, 0.14), 0 4px 14px rgba(20, 15, 8, 0.08);
  --glow-copper: 0 14px 40px rgba(200, 80, 29, 0.35);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  background:
    linear-gradient(135deg, rgba(47, 95, 127, 0.08), transparent 34%),
    linear-gradient(315deg, rgba(18, 107, 97, 0.11), transparent 32%),
    var(--bg);
}

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

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }

h1, h2, h3, h4 { margin: 0; letter-spacing: 0; }
p { margin: 0; }

/* Ambient backgrounds */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.15 0 0 0 0 0.11 0 0 0 0 0.05 0 0 0 0.08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.ambient {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.55;
}
.ambient-a,
.ambient-b { display: none; }

/* =========================================================
   App shell — phone-first single column
   ========================================================= */
.app {
  position: relative;
  z-index: 2;
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 0;
}

/* On larger screens, keep the phone-app feel instead of becoming a desktop table. */
@media (min-width: 720px) {
  .app { max-width: 560px; }
}

@media (min-width: 1080px) {
  .app { max-width: 560px; }
  .scroller { padding: 10px 16px 160px; }
}

/* =========================================================
   App bar
   ========================================================= */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 12px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(246, 239, 226, 0.92) 0%, rgba(246, 239, 226, 0.75) 85%, rgba(246, 239, 226, 0) 100%);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
}

.appbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-dot {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 18px;
  color: #fff6ea;
  background: linear-gradient(140deg, var(--ink) 0%, #2a241c 100%);
  box-shadow: 0 8px 18px rgba(15, 13, 10, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0;
}
.brand-sub {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

/* Segmented control */
.segmented {
  display: inline-flex;
  padding: 3px;
  background: rgba(15, 13, 10, 0.06);
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  justify-self: end;
}

.seg {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.seg:hover { color: var(--ink); }
.seg.active {
  background: var(--ink);
  color: #fff6ea;
  box-shadow: 0 4px 14px rgba(15, 13, 10, 0.25);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--copper) 0%, #e58a53 100%);
  color: #fff6ea;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
  box-shadow: var(--glow-copper);
  transition: transform 0.15s ease;
}
.avatar:hover { transform: scale(1.05); }

/* On tiny phones, drop sub-text */
@media (max-width: 380px) {
  .brand-sub { display: none; }
  .seg { padding: 7px 11px; font-size: 12px; }
}

/* =========================================================
   Scroller / screens
   ========================================================= */
.scroller {
  padding: 8px 16px 160px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-margin-top: 72px;
}

.screen-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--copper);
  margin: 0 0 6px;
}

.screen-head h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
  color: var(--ink);
}

/* Search pill */
.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-1);
  min-width: 140px;
  flex-shrink: 0;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.search-pill:focus-within {
  border-color: var(--copper);
  box-shadow: 0 0 0 4px var(--copper-soft);
}
.search-ico { width: 16px; height: 16px; color: var(--ink-muted); flex-shrink: 0; }
.search-pill input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.search-pill input::placeholder { color: var(--ink-muted); }

/* =========================================================
   Today card (hero)
   ========================================================= */
.today-card {
  position: relative;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: #191714;
  border: 1px solid rgba(15, 13, 10, 0.08);
  border-radius: var(--r-xl);
  padding: 22px 22px 20px;
  box-shadow: var(--sh-2);
  overflow: hidden;
}
.today-card::before { display: none; }
.today-photo,
.today-scrim {
  position: absolute;
  inset: 0;
}
.today-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}
.today-scrim {
  background:
    linear-gradient(180deg, rgba(10, 13, 15, 0.12) 0%, rgba(10, 13, 15, 0.28) 38%, rgba(10, 13, 15, 0.82) 100%),
    linear-gradient(90deg, rgba(10, 13, 15, 0.62), rgba(10, 13, 15, 0.08));
}
.today-card > *:not(.today-photo):not(.today-scrim) {
  position: relative;
  z-index: 1;
}

.today-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 248, 236, 0.82);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-wrap: wrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: #56d1b6;
  box-shadow: 0 0 0 4px rgba(86, 209, 182, 0.22);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(86, 209, 182, 0.22); }
  50%      { box-shadow: 0 0 0 8px rgba(86, 209, 182, 0.08); }
}

.pill {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: rgba(255, 248, 236, 0.9);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.pill.is-staging { background: var(--amber); color: var(--ink); }

.today-headline {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 48px;
  line-height: 0.95;
  letter-spacing: 0;
  margin-top: 14px;
  color: #fff8ec;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

.today-headline .num {
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  color: #ffd0aa;
  letter-spacing: 0;
}
.today-headline .num.soft { color: #ffffff; }
.today-headline .dim {
  font-size: 18px;
  font-family: var(--sans);
  font-weight: 500;
  color: rgba(255, 248, 236, 0.76);
  letter-spacing: 0;
}
.today-headline .dim-sep {
  font-size: 20px;
  color: rgba(255, 248, 236, 0.45);
  margin: 0 2px;
}

.today-caption {
  margin-top: 16px;
  color: rgba(255, 248, 236, 0.82);
  font-size: 14px;
  max-width: 34ch;
}
.today-caption strong { color: #fff; font-weight: 700; }

.today-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* =========================================================
   Voice hero (the centerpiece)
   ========================================================= */
.voice-hero {
  position: relative;
  padding: 28px 22px 22px;
  background: linear-gradient(145deg, #1f3d50 0%, #18322f 100%);
  color: #fdf5e8;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  overflow: hidden;
}

.voice-hero::before,
.voice-hero::after { display: none; }

.voice-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  z-index: 1;
}

.voice-copy { max-width: 30ch; }
.voice-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #e8a674;
  font-weight: 700;
}
.voice-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
  margin-top: 6px;
  color: #fdf5e8;
}
.voice-sub {
  margin-top: 8px;
  color: rgba(253, 245, 232, 0.72);
  font-size: 14px;
  line-height: 1.5;
}

/* Orb */
.voice-meter {
  height: 92px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.voice-meter span {
  width: 10px;
  min-height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a7f1df, #45a898);
  animation: voiceLevel 1.4s ease-in-out infinite;
}
.voice-meter span:nth-child(2) { animation-delay: 0.12s; min-height: 42px; }
.voice-meter span:nth-child(3) { animation-delay: 0.24s; min-height: 72px; }
.voice-meter span:nth-child(4) { animation-delay: 0.36s; min-height: 36px; }
.voice-meter span:nth-child(5) { animation-delay: 0.48s; min-height: 56px; }
@keyframes voiceLevel {
  0%, 100% { transform: scaleY(0.76); opacity: 0.72; }
  50% { transform: scaleY(1.08); opacity: 1; }
}

.voice-widget-wrap {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  padding: 12px;
  background: rgba(255, 246, 234, 0.08);
  border: 1px solid rgba(255, 246, 234, 0.12);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  color: rgba(253, 245, 232, 0.8);
  font-size: 13px;
}

.ops-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.ops-strip div {
  display: grid;
  grid-template-columns: 32px 1fr;
  column-gap: 12px;
  row-gap: 2px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.ops-strip span {
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--steel-soft);
  color: var(--steel);
  display: grid;
  place-items: center;
  font-weight: 800;
}
.ops-strip strong { font-size: 14px; }
.ops-strip p { color: var(--ink-muted); font-size: 13px; }

@media (min-width: 640px) {
  .ops-strip { grid-template-columns: repeat(3, 1fr); }
}

elevenlabs-convai { width: 100%; max-width: 100%; }

/* =========================================================
   Stat tiles
   ========================================================= */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 520px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 14px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
  border-color: var(--line-strong);
}
.tile-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}
.tile-num {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.tile-num.accent { color: var(--copper-deep); }
.tile-num small {
  font-size: 18px;
  font-family: var(--sans);
  font-weight: 600;
  margin-left: 2px;
  color: var(--ink-soft);
}
.tile-trend {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.arrow.up { color: var(--emerald); }

/* =========================================================
   Card list (queue)
   ========================================================= */
.card-list { display: flex; flex-direction: column; gap: 12px; }

.queue-item {
  position: relative;
  display: grid;
  grid-template-columns: 6px 1fr;
  gap: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
}
.queue-item:hover {
  box-shadow: var(--sh-2);
  border-color: var(--line-strong);
}
.queue-item.active {
  border-color: var(--copper);
  box-shadow: 0 0 0 4px var(--copper-soft), var(--sh-2);
}

.queue-item::before {
  content: "";
  grid-column: 1;
  grid-row: 1 / -1;
  background: var(--ink-muted);
  border-radius: 999px;
}
.queue-item[data-urgency="urgent"]::before { background: linear-gradient(180deg, var(--red), #b12316); }
.queue-item[data-urgency="normal"]::before { background: linear-gradient(180deg, var(--amber), #8f6312); }
.queue-item[data-urgency="low"]::before    { background: linear-gradient(180deg, var(--emerald), #0a4c35); }

.queue-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.queue-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.queue-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0;
  line-height: 1.2;
  color: var(--ink);
  flex: 1 1 auto;
  min-width: 0;
}
.queue-id {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  background: var(--bg-soft);
  padding: 3px 7px;
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}
.chip {
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.chip.urgent { background: var(--red-soft); color: var(--red); }
.chip.normal { background: var(--amber-soft); color: #8f6312; }
.chip.low    { background: var(--emerald-soft); color: var(--emerald); }
.chip.soft   { background: var(--bg-soft); color: var(--ink-soft); }

.queue-meta {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}
.queue-meta .dot { color: var(--ink-muted); margin: 0 4px; }

.queue-summary {
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.45;
  margin-top: 2px;
}

.queue-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  align-items: center;
}

.vendor-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.queue-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}

.queue-actions .btn-ghost,
.queue-actions .btn-dark,
.queue-actions .btn-primary {
  padding: 7px 12px;
  font-size: 12px;
}

.vendor-select {
  flex: 1 1 140px;
  min-width: 0;
  padding: 7px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface-tint);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.vendor-select:focus { outline: none; border-color: var(--copper); box-shadow: 0 0 0 3px var(--copper-soft); }

/* Empty state */
.empty,
.empty-state {
  padding: 28px 20px;
  background: var(--surface-tint);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  text-align: center;
  color: var(--ink-muted);
  font-size: 14px;
}

/* =========================================================
   Buttons
   ========================================================= */
.btn-primary, .btn-dark, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 16px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  min-height: 40px;
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(180deg, #d85d27 0%, var(--copper) 100%);
  color: #fff6ea;
  box-shadow: var(--glow-copper);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 18px 44px rgba(200, 80, 29, 0.45); }
.btn-primary.wide { width: 100%; }

.btn-dark {
  background: var(--ink);
  color: #fff6ea;
  box-shadow: 0 8px 20px rgba(15, 13, 10, 0.25);
}
.btn-dark:hover { transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--surface-tint); border-color: var(--ink); }

/* =========================================================
   Quick-add (disclosure)
   ========================================================= */
.quick-add {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.quick-add[open] { box-shadow: var(--sh-2); }

.quick-add > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.quick-add > summary::-webkit-details-marker { display: none; }
.qa-plus {
  width: 26px;
  height: 26px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff6ea;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.2s ease, background 0.2s ease;
}
.quick-add[open] .qa-plus {
  background: var(--copper);
  transform: rotate(45deg);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 4px 16px 16px;
}
@media (min-width: 500px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid label.wide { grid-column: 1 / -1; }

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-grid label > span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}
.form-grid input,
.form-grid select,
.form-grid textarea {
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.form-grid textarea { resize: vertical; min-height: 68px; }
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--copper);
  box-shadow: 0 0 0 3px var(--copper-soft);
}

/* =========================================================
   Portfolio: horizontal property scroller
   ========================================================= */
.portfolio-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.property-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.property-scroll::-webkit-scrollbar { height: 6px; }
.property-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }

.property-card {
  flex: 0 0 82%;
  max-width: 280px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.property-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.property-card.selected {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px var(--copper-soft), var(--sh-2);
}

.property-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  background:
    radial-gradient(60% 80% at 30% 40%, rgba(255, 255, 255, 0.7), transparent 60%),
    linear-gradient(160deg, #f4d9b4 0%, #e6a870 100%);
  position: relative;
  overflow: hidden;
}
.property-thumb.v1 { background: linear-gradient(160deg, #f4d9b4, #e6a870); }
.property-thumb.v2 { background: linear-gradient(160deg, #d8e4c6, #86ac8a); }
.property-thumb.v3 { background: linear-gradient(160deg, #e8d3d0, #b9786a); }
.property-thumb.v4 { background: linear-gradient(160deg, #efe0b7, #c69a4e); }
.property-thumb.v5 { background: linear-gradient(160deg, #dedcef, #7e84b8); }
.property-thumb.v6 { background: linear-gradient(160deg, #f1d5c4, #c66846); }

.property-thumb::before {
  content: "";
  position: absolute;
  left: 14px;
  bottom: 12px;
  right: 14px;
  height: 42%;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.28) 0 8px, transparent 8px 14px),
    rgba(15, 13, 10, 0.12);
}
.property-thumb::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: 12px;
  right: 22px;
  height: 26%;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 6px, transparent 6px 12px);
}

.property-card-main { display: flex; flex-direction: column; gap: 2px; }
.property-card h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0;
  line-height: 1.15;
}
.property-card .addr { font-size: 12px; color: var(--ink-muted); }

.property-card-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
  align-items: center;
}

/* Selected property detail */
.property-detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.property-hero-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  align-items: center;
}
.property-hero-row .property-thumb {
  width: 92px;
  aspect-ratio: 1;
  flex: 0 0 auto;
}
.property-hero-row p:not(.eyebrow),
.property-summary p {
  color: var(--ink-muted);
  font-size: 13px;
}

.property-detail h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.detail-grid .cell {
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.detail-grid .cell span:first-child {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}
.detail-grid .cell span:last-child {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.work-trail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.work-trail h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}
.work-trail li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-soft);
  list-style: none;
}
.work-trail li:last-child { border-bottom: none; }
.work-trail ul { list-style: none; padding: 0; margin: 0; }

/* Portfolio empty */
.portfolio-empty {
  padding: 28px 22px;
  background: var(--surface-tint);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.portfolio-empty h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
}
.portfolio-empty p { color: var(--ink-muted); font-size: 13px; max-width: 36ch; }

/* =========================================================
   Activity timeline
   ========================================================= */
.timeline { display: flex; flex-direction: column; gap: 10px; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(180deg, var(--copper-soft), var(--bg-deep));
  border-radius: 999px;
}

.activity-entry {
  position: relative;
  padding: 12px 14px 12px 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.activity-entry::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--copper);
  box-shadow: 0 0 0 3px #fff6ea, 0 0 0 4px var(--copper-soft);
}

.activity-entry time {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Rules list */
.rules {
  margin-top: 6px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #fffaf0, #fbeed6);
  border: 1px solid rgba(200, 80, 29, 0.18);
  border-radius: var(--r-lg);
}
.rules ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rules li {
  position: relative;
  padding-left: 20px;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.45;
}
.rules li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--copper);
  transform: rotate(45deg);
}

.footnote {
  font-size: 11px;
  color: var(--ink-muted);
  text-align: center;
  letter-spacing: 0.06em;
  margin-top: 8px;
}

/* =========================================================
   Tab bar
   ========================================================= */
.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 10px 10px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(246, 239, 226, 0.98) 20%, rgba(246, 239, 226, 0.85) 85%, rgba(246, 239, 226, 0) 100%);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  align-items: end;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  border-radius: 14px;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.2s ease, background 0.2s ease;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--ink); }
.tab.active::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--copper);
  margin-top: 2px;
}

.tab-mid { margin-top: -28px; }
.tab-mid .tab-voice {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--steel), var(--emerald));
  color: #fff6ea;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 34px rgba(47, 95, 127, 0.34);
  transition: transform 0.15s ease;
}
.tab-mid .tab-voice svg { width: 24px; height: 24px; }
.tab-mid:hover .tab-voice { transform: scale(1.05); }

@media (min-width: 1080px) {
  /* Let the tab bar breathe as a floating pill on desktop */
  .tabbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: min(440px, 80vw);
    border-radius: var(--r-pill);
    border: 1px solid var(--line-strong);
    box-shadow: var(--sh-3);
    background: rgba(253, 248, 236, 0.92);
    padding: 8px;
  }
  .tab-mid { margin-top: -22px; }
}

/* =========================================================
   Toast
   ========================================================= */
.toast {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff6ea;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--sh-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Smooth scrolling */
html { scroll-behavior: smooth; }

::selection { background: var(--copper-soft); color: var(--ink); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }
