/* JCGreen Holdings palette, taken from the logo: metallic gold and silver on
   near-black. The gold (#d6a644) is the logo's measured average. Text on
   light backgrounds uses the darker --gold-text so it stays readable. */
:root {
  --gold: #d6a644;
  --gold-light: #efc766;
  --gold-dark: #a8801f;
  --gold-text: #8a6514;
  --gold-tint: #faf3e1;
  --ink: #111214;
  --ink-2: #1c1d21;
  --ink-3: #2a2b30;
  --silver: #d6d6d6;
  --silver-dim: #a3a3a8;
  --bg: #f6f5f1;
  --card: #ffffff;
  --border: #e4e1d8;
  --text: #1c1c1e;
  --muted: #6b6760;
  --green: #1a7f4b;
  --red: #b3261e;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }
.topbar { display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: var(--silver); padding: 8px 20px; border-bottom: 1px solid var(--ink-3); }
.brand { display: flex; align-items: center; }
.brand-logo { height: 66px; width: auto; display: block; }
.userbar { display: flex; align-items: center; gap: 10px; }
.userbar select { padding: 4px 8px; border-radius: 6px; border: none; }
.plan-badge { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--ink); padding: 3px 10px; border-radius: 12px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em; }

.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 16px; background: var(--ink-2); border-bottom: 3px solid var(--gold); }
.tab { border: none; border-bottom: 3px solid transparent; margin-bottom: -3px; background: transparent; padding: 12px 14px; cursor: pointer; border-radius: 0; color: var(--silver-dim); font-weight: 600; font-size: 0.9rem; }
.tab:hover { color: var(--silver); background: var(--ink-3); }
.tab.active { color: var(--ink); background: var(--gold); border-bottom-color: var(--gold); }
.tab + .tab { margin-left: 0; }

main { padding: 20px; }
.panel { display: none; }
.panel.active { display: block; }

.layout-2col { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .layout-2col { grid-template-columns: 1fr; } }

.filters, .dfd-form { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.filters h3, .dfd-form h3 { margin-top: 0; font-size: 0.95rem; color: var(--ink); border-left: 3px solid var(--gold); padding-left: 8px; }
h3 { color: var(--ink); }
label { display: block; font-size: 0.8rem; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.88rem; font-family: inherit; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold-dark); }
input[type="checkbox"] { accent-color: var(--gold-dark); }
a { color: var(--gold-text); font-weight: 600; }
a:hover { color: var(--gold-dark); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row2 label { margin: 10px 0 0; }

button { cursor: pointer; border: 1px solid var(--border); background: white; padding: 8px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; color: var(--text); }
button:hover { border-color: var(--gold); background: var(--gold-tint); }
button.primary { background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--ink); border-color: var(--gold-dark); }
button.primary:hover { background: var(--gold); border-color: var(--gold-dark); }
button + button { margin-left: 6px; }
#btnSaveSearch, #btnSearch { width: 100%; margin: 10px 0 0; }
#btnSaveSearch { margin-left: 0; }

.saved-list { margin-top: 8px; }
.saved-item, .list-item { display: flex; justify-content: space-between; align-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; font-size: 0.85rem; background: #fafbfc; cursor: pointer; }
.saved-item:hover, .list-item:hover { background: var(--gold-tint); border-color: var(--gold); }

.results { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 0.85rem; color: var(--muted); }
.prop-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.prop-table th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--border); padding: 6px 8px; }
.prop-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prop-table tbody tr:hover { background: var(--gold-tint); }
.flag { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: 0.7rem; font-weight: 700; margin-right: 3px; }
.flag.absentee { background: var(--gold-tint); color: var(--gold-text); border: 1px solid #ecd9a8; }
.flag.vacant { background: #e0e7ff; color: #3730a3; }
.flag.tax { background: #fee2e2; color: #991b1b; }
.flag.equity { background: #dcfce7; color: #166534; }

.pager { display: flex; gap: 6px; margin-top: 10px; justify-content: flex-end; }
.lock { font-size: 0.8rem; }
#premiumFilters.locked { opacity: 0.45; pointer-events: none; }

.hint { color: var(--muted); font-size: 0.8rem; }
.code-block { background: var(--ink); color: var(--gold-light); padding: 12px; border-radius: 8px; font-size: 0.78rem; overflow-x: auto; white-space: pre; }
.plain-list { font-size: 0.85rem; }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.checkbox-grid label { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; }
.checkbox-grid input { width: auto; }

.activity-feed { max-height: 500px; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.activity-item { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.activity-item time { color: var(--muted); font-size: 0.72rem; display: block; }

#dfdPreview img { max-width: 100%; border-radius: 6px; margin-top: 8px; }

/* ---------- sign-in page ---------- */
.login-body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 100vh; margin: 0; padding: 24px 16px; background: radial-gradient(ellipse at top, #24252a 0%, var(--ink) 60%); }
.login-logo { width: min(260px, 70vw); height: auto; display: block; }
.login-card { background: white; border: 1px solid var(--ink-3); border-top: 4px solid var(--gold); border-radius: 12px; padding: 28px 32px 32px; width: min(380px, 92vw); box-shadow: 0 10px 40px rgba(0,0,0,0.45); }
.login-sub { margin: 0 0 20px; color: var(--muted); font-size: 0.85rem; text-align: center; }
.login-card label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.login-card input { width: 100%; box-sizing: border-box; padding: 9px 11px; margin-bottom: 15px; border: 1px solid var(--border); border-radius: 7px; font-size: 0.95rem; }
.login-card input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.login-card button { width: 100%; padding: 10px; border: 1px solid var(--gold-dark); border-radius: 7px; background: linear-gradient(180deg, var(--gold-light), var(--gold)); color: var(--ink); font-weight: 700; font-size: 0.95rem; cursor: pointer; }
.login-card button:hover { background: var(--gold); }
.login-card button:disabled { opacity: 0.6; cursor: default; }
.login-error { margin: 14px 0 0; padding: 9px 11px; border-radius: 7px; background: #fdecea; color: #a4262c; font-size: 0.85rem; }

/* ---------- signed-in user controls ---------- */
.user-label { color: var(--silver); font-size: 0.85rem; font-weight: 600; }
.linkbtn { background: transparent; border: 1px solid var(--gold-dark); color: var(--gold-light); padding: 5px 11px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-weight: 600; }
.linkbtn:hover { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* Narrow screens: smaller logo, controls wrap under it. */
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .brand-logo { height: 46px; }
  .userbar { flex-wrap: wrap; }
}

.inline-check { display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; }

.flag.longheld { background: #efe7fb; color: #5b3a8c; }
.coverage { color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.pager button:disabled { opacity: 0.4; cursor: default; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- my profile ---------- */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; align-items: start; max-width: 1100px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 18px; }
.card h3 { margin-top: 0; font-size: 0.95rem; border-left: 3px solid var(--gold); padding-left: 8px; }
.stack button { width: 100%; margin: 14px 0 0; }
.profile-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: 0.88rem; }
.profile-facts dt { color: var(--muted); }
.profile-facts dd { margin: 0; font-weight: 600; word-break: break-word; }
.form-msg { margin: 10px 0 0; font-size: 0.83rem; min-height: 1em; }
.form-msg.ok { color: var(--green); }
.form-msg.error { color: var(--red); }
button.user-label { background: transparent; border: none; padding: 4px 6px; cursor: pointer; border-radius: 6px; }
button.user-label:hover { background: var(--ink-3); color: var(--gold-light); }

/* ---------- property detail ---------- */
.addr-link { background: none; border: none; padding: 0; margin: 0; font: inherit; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer; border-bottom: 1px dashed var(--gold-dark); border-radius: 0; }
.addr-link:hover { color: var(--gold-text); background: none; border-bottom-style: solid; }
.prop-dialog { width: min(860px, 94vw); max-height: 90vh; padding: 0; border: 1px solid var(--ink-3); border-top: 4px solid var(--gold); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.45); overflow: auto; }
.prop-dialog::backdrop { background: rgba(10, 10, 12, 0.65); }
.pd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 6px; }
.pd-head h2 { margin: 0; font-size: 1.25rem; color: var(--ink); }
.pd-head p { margin: 4px 0 0; }
.pd-close { border: none; background: transparent; font-size: 1.1rem; padding: 4px 8px; color: var(--muted); }
.pd-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 20px 14px; }
.pd-link { display: inline-block; padding: 6px 12px; border-radius: 6px; background: var(--ink); color: var(--gold-light); text-decoration: none; font-size: 0.82rem; font-weight: 700; border: 1px solid var(--ink-3); }
.pd-link:hover { background: var(--gold); color: var(--ink); }
.pd-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding: 0 20px; }
.pd-map { height: 300px; border-radius: 8px; border: 1px solid var(--border); }
.pd-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 0.86rem; align-content: start; }
.pd-facts dt { color: var(--muted); }
.pd-facts dd { margin: 0; font-weight: 600; word-break: break-word; }
.pd-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px 18px; }
@media (max-width: 700px) { .pd-body { grid-template-columns: 1fr; } .pd-map { height: 220px; } }

/* ---------- RentCast section ---------- */
.rc { margin: 16px 20px 0; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fcfbf7; }
.rc-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.rc-head h3 { margin: 0; font-size: 0.95rem; border-left: 3px solid var(--gold); padding-left: 8px; }
.rc-by { font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.rc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.rc-actions button + button { margin-left: 0; }
.rc-actions button:disabled { opacity: 0.45; cursor: default; }
.rc-facts { margin-top: 10px; }
.rc-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.rc-price { font-size: 1.4rem; font-weight: 800; color: var(--ink); border-bottom: 3px solid var(--gold); }
.rc-comps { margin-top: 10px; font-size: 0.8rem; }
