/* ==========================================================================
   NRHH Housing Assistant — sitewide floating chat widget
   Warm palette, matches the dashboard design system.
   ========================================================================== */

.nrhh-bot {
	--bot-primary: #2e9a73;
	--bot-primary2: #3eb489;
	--bot-accent: #f4c431;
	--bot-orange: #f4a460;
	--bot-bg: #f5fffa;
	--bot-surface: #ffffff;
	--bot-border: #dde8e2;
	--bot-text: #2b2620;
	--bot-muted: #6c7c90;
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99998;
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* The [hidden] attribute must win over the display rules below. */
.nrhh-bot [hidden],
.nrhh-bot__panel[hidden] { display: none !important; }

/* Floating action button */
.nrhh-bot__fab {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	border: 0;
	cursor: pointer;
	color: #fff;
	background: linear-gradient( 135deg, var(--bot-primary), var(--bot-primary2) );
	box-shadow: 0 10px 26px rgba(46,154,115,.42);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-left: auto;
	transition: transform .15s ease, box-shadow .15s ease;
}
.nrhh-bot__fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 32px rgba(46,154,115,.5); }
.nrhh-bot__fab svg { width: 26px; height: 26px; }

/* Panel */
.nrhh-bot__panel {
	position: absolute;
	right: 0;
	bottom: 74px;
	width: min( 380px, calc( 100vw - 32px ) );
	height: min( 560px, calc( 100vh - 120px ) );
	background: var(--bot-surface);
	border: 1px solid var(--bot-border);
	border-radius: 18px;
	box-shadow: 0 24px 60px rgba(45,58,52,.28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: nrhh-bot-in .18s ease;
}
@keyframes nrhh-bot-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Header */
.nrhh-bot__head {
	display: flex;
	align-items: center;
	gap: .7rem;
	padding: .9rem 1.1rem;
	color: #fff;
	background: linear-gradient( 135deg, var(--bot-primary), var(--bot-primary2) );
}
.nrhh-bot__avatar {
	width: 2.4rem; height: 2.4rem; border-radius: 50%;
	background: rgba(255,255,255,.22);
	display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
	flex: none;
}
.nrhh-bot__head-text { flex: 1; min-width: 0; }
.nrhh-bot__title { display: block; font-size: .98rem; font-weight: 700; line-height: 1.2; }
.nrhh-bot__sub { display: block; font-size: .76rem; opacity: .9; }
.nrhh-bot__close {
	flex: none;
	width: 2rem; height: 2rem;
	border: 0; border-radius: 50%;
	background: rgba(255,255,255,.18);
	color: #fff; cursor: pointer;
	display: flex; align-items: center; justify-content: center;
	transition: background .13s;
}
.nrhh-bot__close:hover { background: rgba(255,255,255,.34); }
.nrhh-bot__close svg { width: 1.1rem; height: 1.1rem; }

/* Log */
.nrhh-bot__log {
	flex: 1;
	overflow-y: auto;
	padding: 1rem .9rem;
	background: var(--bot-bg);
	display: flex;
	flex-direction: column;
	gap: .7rem;
}
.nrhh-bot__msg { display: flex; flex-direction: column; max-width: 88%; }
.nrhh-bot__msg--user { align-self: flex-end; align-items: flex-end; }
.nrhh-bot__msg--bot { align-self: flex-start; }
.nrhh-bot__bubble {
	padding: .62rem .85rem;
	border-radius: 14px;
	font-size: .9rem;
	line-height: 1.45;
	color: var(--bot-text);
	background: var(--bot-surface);
	border: 1px solid var(--bot-border);
	white-space: pre-wrap;
	word-wrap: break-word;
}
.nrhh-bot__msg--user .nrhh-bot__bubble {
	color: #fff;
	background: var(--bot-primary);
	border-color: var(--bot-primary);
	border-bottom-right-radius: 5px;
}
.nrhh-bot__msg--bot .nrhh-bot__bubble { border-bottom-left-radius: 5px; }

/* Quick-reply chips */
.nrhh-bot__quick { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.nrhh-bot__chip {
	border: 1.5px solid var(--bot-primary);
	background: var(--bot-surface);
	color: var(--bot-primary);
	border-radius: 99px;
	padding: .4rem .8rem;
	font-size: .8rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .13s, color .13s;
}
.nrhh-bot__chip:hover { background: var(--bot-primary); color: #fff; }

/* Links */
.nrhh-bot__links { display: flex; flex-direction: column; gap: .35rem; margin-top: .5rem; }
.nrhh-bot__link {
	display: inline-block;
	background: var(--bot-accent);
	color: #5c4600;
	font-weight: 700;
	font-size: .82rem;
	text-decoration: none;
	padding: .5rem .85rem;
	border-radius: 10px;
	text-align: center;
}
.nrhh-bot__link:hover { filter: brightness(.96); }

/* Home suggestion cards */
.nrhh-bot__homes { display: flex; flex-direction: column; gap: .55rem; margin-top: .55rem; }
.nrhh-bot__home {
	background: var(--bot-surface);
	border: 1px solid var(--bot-border);
	border-left: 3px solid var(--bot-orange);
	border-radius: 10px;
	padding: .7rem .8rem;
	display: flex;
	flex-direction: column;
	gap: .2rem;
}
.nrhh-bot__home-name { font-size: .9rem; color: var(--bot-text); font-weight: 700; }
.nrhh-bot__home-op { font-size: .74rem; color: var(--bot-primary); font-weight: 600; }
.nrhh-bot__home-meta { font-size: .76rem; color: var(--bot-muted); }
.nrhh-bot__home-reasons { list-style: none; margin: .25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.nrhh-bot__home-reasons li {
	font-size: .76rem; color: var(--bot-primary);
	padding-left: 1rem; position: relative;
}
.nrhh-bot__home-reasons li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; }
.nrhh-bot__home-link { margin-top: .3rem; font-size: .8rem; font-weight: 700; color: var(--bot-primary); text-decoration: none; }
.nrhh-bot__home-link:hover { text-decoration: underline; }

/* Typing indicator */
.nrhh-bot__typing { display: inline-flex; gap: .25rem; }
.nrhh-bot__typing span {
	width: .45rem; height: .45rem; border-radius: 50%; background: var(--bot-muted);
	animation: nrhh-bot-blink 1.2s infinite ease-in-out;
}
.nrhh-bot__typing span:nth-child(2) { animation-delay: .18s; }
.nrhh-bot__typing span:nth-child(3) { animation-delay: .36s; }
@keyframes nrhh-bot-blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

/* Composer */
.nrhh-bot__form {
	display: flex;
	gap: .5rem;
	padding: .7rem .8rem;
	border-top: 1px solid var(--bot-border);
	background: var(--bot-surface);
}
.nrhh-bot__input {
	flex: 1;
	border: 1.5px solid var(--bot-border);
	border-radius: 99px;
	padding: .6rem .9rem;
	font-size: .9rem;
	color: var(--bot-text);
	outline: none;
	background: var(--bot-surface);
}
.nrhh-bot__input:focus { border-color: var(--bot-primary); box-shadow: 0 0 0 3px rgba(46,154,115,.15); }
.nrhh-bot__send {
	width: 2.5rem; height: 2.5rem; flex: none;
	border: 0; border-radius: 50%; cursor: pointer;
	background: var(--bot-primary); color: #fff;
	display: flex; align-items: center; justify-content: center;
	transition: background .13s;
}
.nrhh-bot__send:hover { background: var(--bot-primary2); }
.nrhh-bot__send svg { width: 1.15rem; height: 1.15rem; }

@media ( max-width: 480px ) {
	.nrhh-bot { right: 12px; bottom: 12px; }
	.nrhh-bot__panel { bottom: 70px; height: min( 70vh, calc( 100vh - 96px ) ); }
}
