/* 208 Market Agent Hub. Colors and type match 208market.com. Change the brand colors here. */
:root {
  --bg: #f7f7f7;
  --card: #ffffff;
  --ink: #232323;
  --muted: #59595b;
  --line: #dedede;
  --accent: #163561;
  --accent-dark: #0e2442;
  --accent-soft: #eaeef4;
  --top: #000000;
  --warn: #b3261e;
  --warn-bg: #fbeceb;
  --ok-bg: #eaeef4;
  --radius: 0;
  --label: Montserrat, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Open Sans", "Helvetica Neue", Arial, sans-serif; font-size: 16px; line-height: 1.5; background: var(--bg); color: var(--ink); }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--label); font-weight: 500; color: var(--accent); }
h1 { font-size: clamp(1.5rem, 3.5vw, 2rem); line-height: 1.2; margin: 0 0 .4em; letter-spacing: .04em; text-transform: uppercase; }
h2 { font-size: 1.15rem; margin: 0 0 .5em; letter-spacing: .03em; }
code { background: #efefef; padding: .1em .35em; border-radius: 3px; font-size: .95em; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 1.5rem 0; }

/* header */
.top { background: var(--top); color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.75rem; padding: .6rem clamp(1rem, 4vw, 2.5rem); }
.brand { display: flex; align-items: center; gap: 1rem; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand img { width: 58px; height: 58px; display: block; }
.brand-name { font-family: var(--label); font-size: .72rem; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; padding-left: 1rem; border-left: 1px solid #fff; line-height: 2.2; }
.top nav { display: flex; flex-wrap: nowrap; justify-content: center; gap: .25rem 1.6rem; flex: 1; }
.top nav a { white-space: nowrap; }
.top nav a { font-family: var(--label); color: #c5c5c5; text-decoration: none; padding: .4rem 0; font-size: .72rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; border-bottom: 1px solid transparent; }
.top nav a:hover, .top nav a[aria-current] { color: #fff; border-bottom-color: #fff; }
.who { display: flex; flex-wrap: wrap; gap: .2rem 1rem; font-size: .78rem; }
.who a { color: #c5c5c5; text-decoration: none; }
.who a:hover, .who a[aria-current] { color: #fff; text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 1.75rem clamp(1rem, 4vw, 2.5rem) 3rem; }
.foot { text-align: center; color: var(--muted); font-family: var(--label); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; padding: 0 1rem 2.5rem; }
.crumb { color: var(--muted); font-family: var(--label); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 1rem; }
.crumb a { color: inherit; }

/* surfaces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.1rem, 3vw, 1.75rem); }
.narrow { max-width: 460px; margin: 2rem auto; }
.narrow-wide { max-width: 640px; }
.stack { display: grid; gap: .9rem; }
.stack label, .filters label { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; }
.flash { padding: .75rem 1rem; border-radius: var(--radius); margin: 0 0 1rem; }
.flash-ok { background: var(--ok-bg); border: 1px solid #c3cddc; }
.flash-err { background: var(--warn-bg); border: 1px solid #efc2bf; }

/* inputs */
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=password], input:not([type]), select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink); background: #fff; border: 1px solid #c5c5c5; border-radius: var(--radius); padding: .6rem .75rem; min-height: 2.75rem;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid rgba(22, 53, 97, .2); outline-offset: 0; }
input[type=file] { font: inherit; font-size: .95rem; max-width: 100%; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font-family: var(--label); font-weight: 500; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: var(--radius); padding: .7rem 1.6rem; min-height: 2.75rem; cursor: pointer; text-decoration: none; transition: background .15s ease, color .15s ease; }
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: #fff; }
.btn[disabled] { opacity: .6; cursor: progress; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }
.err { color: var(--warn); font-weight: 500; margin: .35rem 0 0; font-size: .95rem; }

/* hub */
.hero { padding: 1rem 0 .5rem; text-align: center; }
.hero .eyebrow { display: block; font-family: var(--label); color: var(--muted); font-size: .85rem; letter-spacing: .3em; text-transform: uppercase; margin-bottom: .35rem; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); letter-spacing: .12em; }
.hero p { color: var(--muted); margin: 0; font-size: 1.05rem; }
.hub-group { margin-top: 2.5rem; }
.hub-group > h2, .fold > summary h2 { font-family: var(--label); font-size: .82rem; font-weight: 500; color: var(--muted); letter-spacing: .25em; text-transform: uppercase; border-bottom: 1px solid var(--line); padding-bottom: .6rem; margin-bottom: 1rem; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.hub-card { display: grid; align-content: start; gap: .4rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.25rem 1.3rem; text-decoration: none; color: var(--ink); box-shadow: inset 0 -3px 0 transparent; transition: box-shadow .15s ease, border-color .15s ease; }
.hub-card strong { font-family: var(--label); font-size: .88rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hub-card span { color: var(--muted); font-size: .9rem; }
.form-no { display: inline-block; margin-left: .35rem; padding: .05rem .4rem; border: 1px solid var(--line); font-style: normal; font-size: .64rem; letter-spacing: .08em; color: var(--muted); vertical-align: 2px; white-space: nowrap; }
.group-note { display: block; margin-top: .3rem; font-family: "Open Sans", Arial, sans-serif; font-size: .85rem; letter-spacing: 0; text-transform: none; color: var(--muted); }
.hub-card:hover { border-color: #c5c5c5; color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }

/* home: Agent Hub first on phones */
.home-agent-hub { display: none; }
@media (max-width: 760px) {
  .home-agent-hub { display: grid; margin-top: 1rem; border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
  .sections-grid .is-agent-hub { display: none; }
  .top nav a[href$="index.php"] { order: -2; }
  .top nav a[href$="s=agent-hub"] { order: -1; }
}

/* voice assistant */
/* Floating microphone on every page: a round button that shows its label on wide screens. */
.voice-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; align-items: center; gap: .55rem; height: 56px; min-width: 56px; padding: 0 16px; border-radius: 28px; background: var(--accent); color: #fff; text-decoration: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); font-family: var(--label); font-size: .72rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.voice-fab:hover { background: var(--accent-dark); color: #fff; }
.voice-fab span { white-space: nowrap; }
@media (max-width: 760px) { .voice-fab { padding: 0; justify-content: center; width: 56px; right: 16px; bottom: 16px; } .voice-fab span { display: none; } }
@media print { .voice-fab { display: none; } }
/* Room at the bottom so the button never covers the last thing on a page. */
body:has(.voice-fab) .foot { padding-bottom: 96px; }
.voice { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 1rem; min-height: 0; height: calc(100vh - 160px); }
/* The voice page fits the screen like a chat app: only the messages scroll. */
body:has(#voice) .foot { display: none; }
body:has(#voice) .wrap { padding-bottom: .5rem; }
.voice-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.voice .eyebrow { display: block; font-family: var(--label); color: var(--muted); font-size: .72rem; letter-spacing: .25em; text-transform: uppercase; }
.voice-form { margin: .2rem 0 0; font-family: var(--label); font-weight: 500; color: var(--accent); font-size: 1.05rem; }
.voice-new { min-height: 2.2rem; padding: .4rem .9rem; }
.voice-log { list-style: none; margin: 0; padding: 0 0 .5rem; display: flex; flex-direction: column; gap: .6rem; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.voice-line { max-width: 85%; padding: .65rem .9rem; line-height: 1.45; overflow-wrap: anywhere; }
.voice-line.me { align-self: flex-end; background: var(--accent); color: #fff; }
.voice-line.bot { align-self: flex-start; background: var(--card); border: 1px solid var(--line); }
.voice-files, .voice-done { background: var(--card); border: 1px solid var(--line); padding: 1rem 1.1rem; }
.voice-files h2 { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; }
.voice-done:not([hidden]) { display: flex; flex-wrap: wrap; gap: .6rem; }
.voice-files + .voice-done { border-top: 0; margin-top: -1rem; }
.voice-files, .voice-done { flex: none; max-height: 55%; overflow-y: auto; }
.voice-controls { flex: none; background: var(--bg); padding: .5rem 0 .25rem; display: grid; justify-items: center; gap: .7rem; text-align: center; }
.voice-status { margin: 0; color: var(--muted); min-height: 1.5em; max-width: 34ch; }
.voice-mic { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgba(22, 53, 97, .3); }
.voice-mic[data-state=listening] { background: #b3261e; animation: voice-pulse 1.2s ease-in-out infinite; }
.voice-mic[data-state=starting] { background: #59595b; }
.voice-mic[data-state=thinking] { opacity: .6; cursor: progress; }
.voice-mic[data-state=speaking] { background: var(--accent-dark); }
@keyframes voice-pulse { 50% { box-shadow: 0 0 0 14px rgba(179, 38, 30, .15); } }
.voice-type { display: flex; gap: .5rem; width: 100%; }
.voice-type input { flex: 1; }
.voice-auto { font-size: .85rem; color: var(--muted); display: flex; gap: .4rem; align-items: center; }
@media (prefers-reduced-motion: reduce) { .voice-mic[data-state=listening] { animation: none; } }

/* market snapshot */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
@media (min-width: 1000px) { .stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; } }
/* Labels reserve two lines so every big number sits on the same line across the row. */
.stat { display: grid; grid-template-rows: auto auto 1fr; gap: .5rem; background: var(--card); border: 1px solid var(--line); padding: 1.15rem 1.2rem 1.2rem; }
.stat-label { font-family: var(--label); font-size: .66rem; font-weight: 500; line-height: 1.5; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); min-height: 3em; display: flex; align-items: flex-end; }
.stat-value { font-family: var(--label); font-size: 1.65rem; font-weight: 600; line-height: 1.1; color: var(--accent); }
.stat-sub { font-size: .82rem; line-height: 1.5; color: var(--muted); }
.stats-note { font-size: .8rem; color: var(--muted); margin: .6rem 0 0; }
/* Where supported, subgrid lines up label, number, and details across each row at any width. */
@supports (grid-template-rows: subgrid) {
  .stat { grid-row: span 3; grid-template-rows: subgrid; row-gap: .5rem; }
  .stat-label { min-height: 0; }
}

/* collapsible form groups: always open on wide screens, tap to open on phones */
.fold > summary { list-style: none; position: relative; cursor: default; pointer-events: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold-count { display: none; }
@media (max-width: 760px) {
  .fold { margin-top: .75rem; background: var(--card); border: 1px solid var(--line); }
  .fold > summary { pointer-events: auto; cursor: pointer; padding: 1rem 2.75rem 1rem 1rem; }
  .fold > summary h2 { border: 0; padding: 0; margin: 0; }
  .fold-count { display: block; margin-top: .35rem; font-size: .8rem; color: var(--muted); }
  .fold > summary::after { content: ""; position: absolute; right: 1.1rem; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-70%) rotate(45deg); transition: transform .2s ease; }
  .fold[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
  .fold > .hub-grid { padding: 0 .75rem .75rem; gap: .6rem; }
  .fold .hub-card { border-color: #e8e8e8; }
}

/* sections */
.sections-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.section-card { padding: 1.6rem 1.4rem; text-align: center; justify-items: center; }
.section-card strong { font-size: 1rem; letter-spacing: .18em; }
.link-card a { text-decoration: none; }
.link-card a::after { content: " \2197"; color: var(--muted); font-size: .8em; }
.link-card form { margin-top: .3rem; }
.news-list { display: grid; gap: 1rem; }
.news { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 1.1rem 1.25rem; }
.news h3 { font-size: 1rem; margin: 0; letter-spacing: .03em; }
.news-section { font-family: var(--label); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); text-decoration: none; }
.news-meta { font-size: .82rem; margin: .15rem 0 .5rem; }
.news-body { overflow-wrap: anywhere; }
.manage { background: var(--card); border: 1px dashed #c5c5c5; padding: .8rem 1.1rem; margin-bottom: 1rem; }
.manage summary { cursor: pointer; font-family: var(--label); font-size: .74rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.manage[open] summary { margin-bottom: 1rem; }

/* tables */
.scroll { overflow-x: auto; }
.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-size: .95rem; }
.list th, .list td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.list th { font-family: var(--label); font-weight: 500; color: var(--muted); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; background: #fafafa; }
.list tr.inactive td { color: var(--muted); }
.list .actions { white-space: nowrap; display: flex; gap: 1rem; }
.inline { display: inline; }
.files-badge { display: inline-flex; align-items: center; gap: .2rem; margin-left: .4rem; padding: .05rem .4rem; background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.status { display: inline-block; padding: .15rem .55rem; font-family: var(--label); font-size: .66rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; background: #efefef; white-space: nowrap; }
.s-new { background: #fdf0d4; color: #7a5300; }
.s-in-progress { background: #dde9f7; color: #1f4b80; }
.s-waiting-on-agent { background: #f6e1f0; color: #7a2462; }
.s-complete { background: #e5f1ea; color: #1d5a37; }
.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; margin-bottom: 1rem; }
.filters label { min-width: 180px; flex: 1; }

/* submission detail */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.detail aside { display: grid; gap: 1.25rem; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }
.answers h2 { margin: 1.75rem 0 .4rem; padding-bottom: .35rem; border-bottom: 1px solid var(--accent); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; }
.answers div { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1rem; padding: .45rem 0; border-bottom: 1px solid #efefef; }
.answers dt { color: var(--muted); }
.answers dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .answers div { grid-template-columns: 1fr; gap: .1rem; } }
.log { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; font-size: .9rem; }
.log .bad strong { color: var(--warn); }

/* the form */
.hubform { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.1rem, 3.5vw, 2.25rem); max-width: 780px; margin: 0 auto; }
.steps { margin-bottom: 1.25rem; }
.step-label { display: block; font-family: var(--label); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 500; min-height: 1.4em; }
.bar { height: 3px; background: #e5e5e5; margin-top: .35rem; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.hubform:not(.js) .steps, .hubform:not(.js) [data-nav=back], .hubform:not(.js) [data-nav=next], .hubform:not(.js) [data-nav=save] { display: none; }
.fpage { display: grid; gap: 1.4rem; }
.fhead h2 { font-size: 1.3rem; margin: 0; letter-spacing: .08em; text-transform: uppercase; }
.fhead p { color: var(--muted); margin: .4rem 0 0; }
.ftext { background: #f7f7f7; border-left: 3px solid var(--accent); padding: .8rem 1.1rem; border-radius: 0 var(--radius) var(--radius) 0; }
.ftext p { margin: .3rem 0; }
.ftext ul { margin: .3rem 0; padding-left: 1.2rem; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 600; margin-bottom: .4rem; padding: 0; }
.req { color: var(--warn); }
.help { color: var(--muted); font-size: .9rem; margin: -.15rem 0 .45rem; }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color: var(--warn); }
.field.has-err > legend, .field.has-err > label { color: var(--warn); }
.choices { display: grid; gap: .35rem; }
.choice { display: flex; align-items: flex-start; gap: .55rem; padding: .45rem .65rem; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.choice:hover { border-color: #9a9a9a; }
.choice input { margin-top: .3rem; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); flex: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--ok-bg); }
.other { margin-top: .2rem; }
.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem; }
.part span { display: block; font-size: .82rem; color: var(--muted); margin-top: .2rem; }
.addr { grid-template-columns: 2fr 1fr 1fr; }
.addr .part-line1, .addr .part-line2 { grid-column: 1 / -1; }
@media (max-width: 560px) { .addr { grid-template-columns: 1fr 1fr; } .addr .part-city { grid-column: 1 / -1; } }
.draftbar { margin-top: 1.25rem; padding: .7rem 1rem; background: #fdf0d4; border-radius: var(--radius); }
.formnav { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.formnav [data-nav=next], .formnav [data-nav=submit] { margin-left: auto; }
.formnav [data-nav=back][hidden] + [data-nav=save] { margin-left: 0; }

/* Narrower screens (most laptops): sections move to their own row under the logo. */
@media (max-width: 1360px) {
  .top { padding-bottom: 0; }
  .top nav { order: 3; flex-basis: 100%; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; border-top: 1px solid #333; padding: .2rem 0; }
  .who { margin-left: auto; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Desktop: the menu wrapper is invisible to layout, so the nav and personal links sit in the header row. */
.topmenu { display: contents; }
.menu-toggle { display: none; }

@media (max-width: 760px) {
  .formnav .btn { flex: 1 1 auto; }
  /* Phones: menu button on the left, logo in the center, everything else in a drop-down panel. */
  .top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: .55rem 16px; gap: 0; }
  .brand { grid-column: 2; justify-self: center; }
  .brand img { width: 46px; height: 46px; }
  .brand-name { display: none; }
  .menu-toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px; grid-column: 1; grid-row: 1; width: 44px; height: 44px; padding: 0 10px; background: none; border: 0; cursor: pointer; }
  .menu-toggle span { display: block; height: 2px; background: #fff; transition: transform .2s ease, opacity .2s ease; }
  .menu-toggle[aria-expanded=true] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle[aria-expanded=true] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded=true] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .topmenu { display: none; grid-column: 1 / -1; padding: .5rem 0 .75rem; margin-top: .55rem; border-top: 1px solid #333; }
  .topmenu.open { display: block; }
  .top .topmenu nav { display: flex; flex-direction: column; gap: 0; overflow: visible; border: 0; padding: 0; margin: 0; }
  .top .topmenu nav a { padding: .8rem 0; font-size: .8rem; border-bottom: 0; }
  .top .topmenu nav a[aria-current] { color: #fff; border-left: 2px solid #fff; padding-left: .75rem; }
  .topmenu .who { display: flex; flex-direction: column; gap: 0; margin: .5rem 0 0; padding-top: .5rem; border-top: 1px solid #333; }
  .topmenu .who a { padding: .7rem 0; font-size: .95rem; }
}

input.locked { background: #f3f3f3; color: var(--muted); }
