/* AGENT_REH_PARITY_V1 */

/*
 * Canonical REH V2 visual variables.
 * The dark values mirror the current REH V2 final UI grey theme.
 */
:root{
  --reh-surface:#ffffff;
  --reh-page:#f7f8f8;
  --reh-soft:#f1f3f3;
  --reh-ink:#102a47;
  --reh-muted:#697985;
  --reh-border:#d9e1e8;
  --reh-accent:#102a47;
  --reh-on-accent:#ffffff;
  --reh-selected:#eef8f3;
  --reh-shadow:0 3px 16px rgba(13,34,57,.10);
  --reh-green:#16976c;
}
:root[data-reh-theme="dark"]{
  --reh-surface:#242424;
  --reh-page:#181818;
  --reh-soft:#303030;
  --reh-ink:#f2f2f2;
  --reh-muted:#b5b5b5;
  --reh-border:#474747;
  --reh-accent:#eeeeee;
  --reh-on-accent:#202020;
  --reh-selected:#263c32;
  --reh-shadow:0 3px 16px #0006;
  --ink:#f2f2f2;
  --ink2:#d4d4d4;
  --muted:#b5b5b5;
  --line:#474747;
  --soft:#303030;
  --white:#242424;
  color-scheme:dark;
}

/* Shared Agent.host wordmark: typography first, no separate Agent theme. */
.agent-reh-wordmark{
  display:inline-flex!important;
  align-items:baseline!important;
  white-space:nowrap!important;
  gap:0!important;
  color:var(--reh-ink)!important;
  text-decoration:none!important;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif!important;
  font-size:22px!important;
  line-height:1!important;
  letter-spacing:-.045em!important;
  font-weight:800!important;
}
.agent-reh-wordmark .agent-reh-dot{
  font-weight:650!important;
  letter-spacing:-.03em!important;
}
[data-reh-theme="dark"] .agent-reh-wordmark{color:#f2f2f2!important}
.top-nav .agent-reh-wordmark{font-size:27px!important}
.reh-pd-brand.agent-reh-brand,
.pa-native-logo.agent-reh-brand{
  width:auto!important;
  min-width:130px!important;
  height:auto!important;
  overflow:visible!important;
}
.reh-pd-brand.agent-reh-brand .agent-reh-wordmark,
.pa-native-logo.agent-reh-brand .agent-reh-wordmark{
  font-size:24px!important;
}

/* --------------------------------------------------------------------------
 * LOGGED-OUT GATEWAY
 * Preserve the working gateway layout; only align its visual language to REH.
 * -------------------------------------------------------------------------- */
body.agent-auth-body{
  background:var(--reh-page)!important;
  color:var(--reh-ink)!important;
}
.agent-auth-header{
  background:var(--reh-surface)!important;
  color:var(--reh-ink)!important;
  border-bottom:1px solid var(--reh-border)!important;
  box-shadow:none!important;
}
.agent-auth-brand,
.agent-auth-brand-word,
.agent-auth-brand-sub{
  color:var(--reh-ink)!important;
}
.agent-auth-brand-word{
  text-transform:none!important;
  letter-spacing:-.035em!important;
  font-size:22px!important;
  font-weight:800!important;
}
.agent-auth-brand-sub,
.agent-auth-public,
.agent-auth-kicker,
.agent-auth-muted,
.agent-auth-note{
  color:var(--reh-muted)!important;
}
.agent-auth-public{color:var(--reh-ink)!important}
.agent-auth-intro h1{color:var(--reh-ink)!important}
.agent-auth-card{
  color:var(--reh-ink)!important;
  background:var(--reh-surface)!important;
  border:1px solid var(--reh-border)!important;
  border-radius:24px!important;
  box-shadow:0 24px 90px #0002!important;
}
.agent-auth-card-brand{
  color:var(--reh-ink)!important;
  background:transparent!important;
  border-bottom:1px solid var(--reh-border)!important;
  text-transform:none!important;
  letter-spacing:-.02em!important;
}
.agent-auth-form label{color:var(--reh-ink)!important}
.agent-auth-form input{
  color:var(--reh-ink)!important;
  background:var(--reh-surface)!important;
  border:1px solid var(--reh-border)!important;
  border-radius:10px!important;
  padding:12px!important;
  box-shadow:none!important;
}
.agent-auth-form input:focus{
  outline:2px solid color-mix(in srgb,var(--reh-ink) 22%,transparent)!important;
  outline-offset:1px!important;
}
.agent-auth-primary{
  background:var(--reh-ink)!important;
  color:var(--reh-surface)!important;
  border:1px solid var(--reh-ink)!important;
  border-radius:10px!important;
}
.agent-auth-secondary{
  background:transparent!important;
  color:var(--reh-ink)!important;
  border:1px solid var(--reh-border)!important;
  border-radius:10px!important;
}
.agent-auth-divider:before,.agent-auth-divider:after{background:var(--reh-border)!important}

[data-reh-theme="dark"] .agent-auth-header{
  background:#202020!important;
}
[data-reh-theme="dark"] .agent-auth-card{
  box-shadow:0 24px 90px #0005!important;
}
[data-reh-theme="dark"] .agent-auth-brand,
[data-reh-theme="dark"] .agent-auth-brand-word,
[data-reh-theme="dark"] .agent-auth-public{
  color:#f2f2f2!important;
}

/* --------------------------------------------------------------------------
 * LEGACY REGISTRATION PAGE -> REH V2 visual language
 * -------------------------------------------------------------------------- */
body.agent-reh-registration,
body:has(#regForm){
  margin:0!important;
  min-height:100vh!important;
  background:var(--reh-page)!important;
  color:var(--reh-ink)!important;
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Inter,Arial,sans-serif!important;
  display:block!important;
  padding:42px 20px!important;
}
body:has(#regForm) .card{
  width:min(920px,calc(100vw - 32px))!important;
  margin:0 auto!important;
  padding:28px!important;
  color:var(--reh-ink)!important;
  background:var(--reh-surface)!important;
  border:1px solid var(--reh-border)!important;
  border-radius:24px!important;
  box-shadow:0 24px 90px #0002!important;
}
body:has(#regForm) .card:before{display:none!important}
body:has(#regForm) .header{
  padding:0 0 24px!important;
  margin:0 0 22px!important;
  border-bottom:1px solid var(--reh-border)!important;
  text-align:left!important;
}
body:has(#regForm) .header img{display:none!important}
body:has(#regForm) .header::before{
  content:"Agent.host";
  display:block;
  margin:0 0 24px;
  color:var(--reh-ink);
  font-size:25px;
  line-height:1;
  font-weight:800;
  letter-spacing:-.045em;
}
body:has(#regForm) .header h1{
  margin:0 0 8px!important;
  color:var(--reh-ink)!important;
  font-size:30px!important;
  line-height:1.08!important;
  letter-spacing:-.035em!important;
  text-align:left!important;
}
body:has(#regForm) .muted{
  margin:0!important;
  color:var(--reh-muted)!important;
  text-align:left!important;
}
body:has(#regForm) form{gap:18px!important}
body:has(#regForm) label,
body:has(#regForm) legend{
  color:var(--reh-ink)!important;
}
body:has(#regForm) input[type="text"],
body:has(#regForm) input[type="email"],
body:has(#regForm) input[type="password"],
body:has(#regForm) input[type="tel"],
body:has(#regForm) select,
body:has(#regForm) textarea{
  width:100%!important;
  padding:12px!important;
  color:var(--reh-ink)!important;
  background:var(--reh-surface)!important;
  border:1px solid var(--reh-border)!important;
  border-radius:10px!important;
  outline:none!important;
  box-shadow:none!important;
}
body:has(#regForm) input:focus,
body:has(#regForm) select:focus,
body:has(#regForm) textarea:focus{
  border-color:var(--reh-ink)!important;
}
body:has(#regForm) .hint,
body:has(#regForm) .req,
body:has(#regForm) .score-line,
body:has(#regForm) .file-hint,
body:has(#regForm) .foot{
  color:var(--reh-muted)!important;
}
body:has(#regForm) .pw-section{
  margin-top:4px!important;
  padding:18px!important;
  color:var(--reh-ink)!important;
  background:var(--reh-soft)!important;
  border:1px solid var(--reh-border)!important;
  border-radius:16px!important;
}
body:has(#regForm) .pw-section legend{
  color:var(--reh-ink)!important;
  background:var(--reh-surface)!important;
  border-radius:6px!important;
  padding:0 8px!important;
}
body:has(#regForm) .section-title{
  margin-top:8px!important;
  padding-top:18px!important;
  color:var(--reh-ink)!important;
  border-top:1px solid var(--reh-border)!important;
}
body:has(#regForm) .meter{
  background:var(--reh-soft)!important;
  border-color:var(--reh-border)!important;
}
body:has(#regForm) .btn,
body:has(#regForm) button,
body:has(#regForm) input[type="submit"]{
  color:var(--reh-surface)!important;
  background:var(--reh-ink)!important;
  border:1px solid var(--reh-ink)!important;
  border-radius:10px!important;
  box-shadow:none!important;
}
body:has(#regForm) a{
  color:var(--reh-ink)!important;
}
body:has(#regForm) input[type="checkbox"],
body:has(#regForm) input[type="radio"]{
  accent-color:var(--reh-green)!important;
}
body:has(#regForm) .message{
  border-radius:12px!important;
  box-shadow:none!important;
}
body:has(#regForm) .message.error{
  color:#9d302d!important;
  background:#fff1f0!important;
  border:1px solid #e0aaa7!important;
}
body:has(#regForm) .message.success{
  color:#146247!important;
  background:#eef9f4!important;
  border:1px solid #a8d7c4!important;
}
[data-reh-theme="dark"] body:has(#regForm) .card{
  box-shadow:0 24px 90px #0005!important;
}
[data-reh-theme="dark"] body:has(#regForm) .message.error{
  color:#ffbcbc!important;
  background:#351e1e!important;
  border-color:#643939!important;
}
[data-reh-theme="dark"] body:has(#regForm) .message.success{
  color:#bcebd6!important;
  background:#1f352d!important;
  border-color:#38604f!important;
}

/* --------------------------------------------------------------------------
 * AGENT ACCOUNT & SETTINGS
 * Map the dedicated Agent workspace onto the current REH account-dialog shell.
 * -------------------------------------------------------------------------- */
.ah-tools-dialog{
  width:min(1040px,calc(100vw - 32px))!important;
  height:min(760px,calc(100dvh - 40px))!important;
  max-width:none!important;
  max-height:calc(100dvh - 40px)!important;
  padding:0!important;
  overflow:hidden!important;
  color:var(--reh-ink)!important;
  background:var(--reh-surface)!important;
  border:1px solid var(--reh-border)!important;
  border-radius:24px!important;
  box-shadow:0 24px 90px #0004!important;
}
.ah-tools-dialog::backdrop{
  background:#0008!important;
  backdrop-filter:blur(4px)!important;
}
.ah-tools-head{
  padding:18px 22px!important;
  color:var(--reh-ink)!important;
  background:var(--reh-surface)!important;
  border-bottom:1px solid var(--reh-border)!important;
}
.ah-tools-head strong,
.ah-tools-dialog h1,
.ah-tools-dialog h2,
.ah-tools-dialog h3{
  color:var(--reh-ink)!important;
}
.ah-kicker,
.ah-tools-dialog p,
.ah-tools-dialog small,
.ah-version{
  color:var(--reh-muted)!important;
}
.ah-icon-button{
  color:var(--reh-ink)!important;
  background:transparent!important;
  border:1px solid var(--reh-border)!important;
}
.ah-tools-main{
  grid-template-columns:180px 1fr!important;
  background:var(--reh-surface)!important;
}
.ah-tools-nav{
  padding:16px 10px!important;
  color:var(--reh-ink)!important;
  background:var(--reh-surface)!important;
  border-right:1px solid var(--reh-border)!important;
}
.ah-tools-nav button{
  color:var(--reh-muted)!important;
  background:transparent!important;
  border:0!important;
  border-radius:10px!important;
}
.ah-tools-nav button:hover{
  color:var(--reh-ink)!important;
  background:var(--reh-soft)!important;
}
.ah-tools-nav button.active{
  color:var(--reh-ink)!important;
  background:var(--reh-soft)!important;
}
.ah-tools-body{
  background:var(--reh-surface)!important;
}
.ah-page-head h1 span{color:var(--reh-green)!important}
.ah-page-head p{color:var(--reh-muted)!important}

.ah-list-panel,
.ah-form-card,
.ah-profile-card,
.ah-stats article,
.ah-agent-row,
.ah-editor-card,
.ah-preferences-form section,
.ah-billing-plans button{
  color:var(--reh-ink)!important;
  background:var(--reh-surface)!important;
  border:1px solid var(--reh-border)!important;
  box-shadow:none!important;
}
.ah-form-card,
.ah-profile-card,
.ah-stats article,
.ah-agent-row{
  border-radius:16px!important;
}
.ah-listing-row{
  color:var(--reh-ink)!important;
  background:var(--reh-surface)!important;
  border-color:var(--reh-border)!important;
}
.ah-listing-row:hover{background:var(--reh-soft)!important}

.ah-tools-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.ah-tools-dialog select,
.ah-tools-dialog textarea,
.ah-search input,
.ah-editor-form input,
.ah-editor-form select,
.ah-editor-form textarea{
  color:var(--reh-ink)!important;
  background:transparent!important;
  border:1px solid var(--reh-border)!important;
  border-radius:10px!important;
  box-shadow:none!important;
}
.ah-tools-dialog input:focus,
.ah-tools-dialog select:focus,
.ah-tools-dialog textarea:focus{
  border-color:var(--reh-ink)!important;
  outline:none!important;
}
.ah-tools-dialog input[type="checkbox"],
.ah-tools-dialog input[type="radio"]{
  accent-color:var(--reh-green)!important;
}

.ah-primary{
  color:var(--reh-surface)!important;
  background:var(--reh-ink)!important;
  border:1px solid var(--reh-ink)!important;
}
.ah-secondary,
.ah-link-button,
.ah-text-button{
  color:var(--reh-ink)!important;
  background:transparent!important;
  border:1px solid var(--reh-border)!important;
}
.ah-primary,.ah-secondary,.ah-link-button,.ah-text-button{
  border-radius:10px!important;
  box-shadow:none!important;
}
.ah-tools-dot{background:var(--reh-green)!important}

.ah-tools-nav .ah-signout,
.ah-tools-nav [data-action="signout"]{
  color:var(--reh-ink)!important;
  border:1px solid var(--reh-border)!important;
  background:transparent!important;
}

[data-reh-theme="dark"] .ah-tools-dialog,
[data-reh-theme="dark"] .ah-tools-head,
[data-reh-theme="dark"] .ah-tools-nav,
[data-reh-theme="dark"] .ah-tools-body,
[data-reh-theme="dark"] .ah-list-panel,
[data-reh-theme="dark"] .ah-form-card,
[data-reh-theme="dark"] .ah-profile-card,
[data-reh-theme="dark"] .ah-stats article,
[data-reh-theme="dark"] .ah-agent-row,
[data-reh-theme="dark"] .ah-editor-card,
[data-reh-theme="dark"] .ah-billing-dialog,
[data-reh-theme="dark"] .ah-billing-plans button{
  color:var(--reh-ink)!important;
  background:var(--reh-surface)!important;
  border-color:var(--reh-border)!important;
}
[data-reh-theme="dark"] .ah-tools-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
[data-reh-theme="dark"] .ah-tools-dialog select,
[data-reh-theme="dark"] .ah-tools-dialog textarea,
[data-reh-theme="dark"] .ah-search input,
[data-reh-theme="dark"] .ah-editor-form input,
[data-reh-theme="dark"] .ah-editor-form select,
[data-reh-theme="dark"] .ah-editor-form textarea{
  color:var(--reh-ink)!important;
  background:transparent!important;
  border-color:var(--reh-border)!important;
}
[data-reh-theme="dark"] .ah-secondary,
[data-reh-theme="dark"] .ah-link-button,
[data-reh-theme="dark"] .ah-icon-button{
  color:var(--reh-ink)!important;
  background:transparent!important;
  border-color:var(--reh-border)!important;
}

/* Billing inherits the same REH shell instead of the old green/black palette. */
.ah-billing-dialog{
  color:var(--reh-ink)!important;
  background:var(--reh-surface)!important;
  border:1px solid var(--reh-border)!important;
  border-radius:24px!important;
  box-shadow:0 24px 90px #0004!important;
}
.ah-billing-head>[data-close],
.ah-billing-plans button{
  color:var(--reh-ink)!important;
  background:transparent!important;
  border-color:var(--reh-border)!important;
}
.ah-billing-head p,
.ah-billing-plans small,
.ah-billing-note{color:var(--reh-muted)!important}

/* Never reveal the REH consumer account workspace on the Agent product. */
html.agent-host-product .reh-account-workspace{display:none!important}

/* Mobile parity follows the REH modal behaviour. */
@media(max-width:640px){
  .ah-tools-dialog{
    width:calc(100vw - 16px)!important;
    height:calc(100dvh - 16px)!important;
    max-height:calc(100dvh - 16px)!important;
    border-radius:16px!important;
  }
  .ah-tools-main{grid-template-columns:1fr!important}
  .ah-tools-nav{
    flex-direction:row!important;
    overflow:auto!important;
    padding:8px!important;
    border-right:0!important;
    border-bottom:1px solid var(--reh-border)!important;
  }
  .ah-tools-body{padding:20px!important}
  .ah-tools-nav-spacer,.ah-version{display:none!important}
}

/* Property/admin pages: REH theme, Agent identity. */
body.reh-property-v2-page,
body.platform-admin-page{
  background:var(--reh-page)!important;
  color:var(--reh-ink)!important;
}