/**
 * InventoryChat — Colorado Pawn & Jewelry
 * Full page (staff play) + optional floating popup.
 */

.ic-chat,
.ic-launcher,
.ic-page {
	--ic-bg: #1a1510;
	--ic-panel: #241e17;
	--ic-border: #3d3428;
	--ic-gold: #c9a227;
	--ic-gold-soft: #e8d48b;
	--ic-text: #f5f0e6;
	--ic-muted: #b8a99a;
	--ic-user: #3a2f1f;
	--ic-assistant: #2c241c;
	--ic-radius: 14px;
	--ic-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	box-sizing: border-box;
}

.ic-chat *,
.ic-launcher *,
.ic-page * {
	box-sizing: border-box;
}

/* Customer chat only: soft discouragement of bulk copy (not applied in staff mode). */
.ic-chat--public-protect .ic-chat__messages {
	-webkit-user-select: none;
	user-select: none;
}
.ic-chat--public-protect .ic-chat__input,
.ic-chat--public-protect textarea,
.ic-chat--public-protect input {
	-webkit-user-select: text;
	user-select: text;
}

/* Staff / employee chat: always allow select + screenshots */
.ic-page--staff,
.ic-chat[data-ic-mode="staff"],
.ic-page[data-ic-mode="staff"] {
	-webkit-user-select: text;
	user-select: text;
}

/* ----- Full page (staff play) ----- */
.ic-page--full {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto 2rem;
	padding: 0.5rem 0 1.5rem;
}

.ic-page__intro {
	margin-bottom: 1rem;
}

.ic-page__heading {
	margin: 0 0 0.35rem;
	font-size: 1.5rem;
	color: var(--ic-gold-soft);
	letter-spacing: 0.02em;
}

.ic-page__lede {
	margin: 0;
	color: var(--ic-muted);
	font-size: 0.95rem;
	line-height: 1.45;
	max-width: 42rem;
}

.ic-page__grid {
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 1.25rem;
	align-items: stretch;
}

.ic-page--compact .ic-page__grid,
.ic-page__grid--chat-only {
	grid-template-columns: 1fr;
}

/* Customer popup / embed: no extra page chrome — black chat only */
.ic-page--customer.ic-page--compact {
	margin: 0;
	padding: 0;
	max-width: none;
}
.ic-page--customer.ic-page--compact .ic-page__intro,
.ic-page--customer.ic-page--compact .ic-side {
	display: none !important;
}

/* Faint staff login / logout under customer chat */
.ic-staff-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5rem 0.75rem;
	margin: 0.35rem 0.15rem 0;
	padding: 0.15rem 0.25rem;
	min-height: 1.25rem;
}
.ic-staff-foot__link {
	font-size: 0.68rem;
	font-weight: 500;
	color: #6b7280;
	opacity: 0.55;
	cursor: pointer;
	text-decoration: none;
	list-style: none;
	background: none;
	border: none;
	padding: 0;
}
.ic-staff-foot__link:hover,
.ic-staff-foot__details[open] > .ic-staff-foot__link {
	opacity: 0.95;
	color: #9ca3af;
	text-decoration: underline;
}
.ic-staff-foot__details {
	margin: 0;
}
.ic-staff-foot__details > summary {
	list-style: none;
}
.ic-staff-foot__details > summary::-webkit-details-marker {
	display: none;
}
.ic-staff-foot__form {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.35rem;
	padding: 0.45rem 0.5rem;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.35);
	border: 1px solid rgba(255, 255, 255, 0.08);
}
.ic-staff-foot__input {
	flex: 1 1 7rem;
	min-width: 0;
	padding: 0.35rem 0.5rem;
	border-radius: 6px;
	border: 1px solid #4b5563;
	background: #111827;
	color: #f3f4f6;
	font-size: 0.8rem;
}
.ic-staff-foot__btn {
	padding: 0.35rem 0.65rem;
	border-radius: 6px;
	border: 1px solid #4b5563;
	background: #1f2937;
	color: #e5e7eb;
	font-size: 0.75rem;
	font-weight: 600;
	cursor: pointer;
}
.ic-staff-foot__btn:hover {
	background: #374151;
}
.ic-staff-foot__error {
	flex: 1 1 100%;
	margin: 0;
	font-size: 0.72rem;
	color: #fca5a5;
	font-weight: 600;
}
.ic-staff-foot__on {
	font-size: 0.68rem;
	color: #6ee7b7;
	opacity: 0.75;
	font-weight: 600;
}

.ic-floating-wrap {
	position: fixed;
	right: 20px;
	bottom: 84px;
	z-index: 99991;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: min(400px, calc(100vw - 32px));
	pointer-events: none;
}
.ic-floating-wrap .ic-chat--floating {
	position: relative;
	right: auto;
	bottom: auto;
	width: 100%;
	pointer-events: auto;
}
.ic-floating-foot {
	pointer-events: auto;
	margin-top: 0.25rem;
}
.ic-floating-foot .ic-staff-foot {
	justify-content: center;
	background: transparent;
}

@media (max-width: 860px) {
	.ic-page__grid {
		grid-template-columns: 1fr;
	}
}

.ic-side {
	background: var(--ic-panel);
	border: 1px solid var(--ic-border);
	border-radius: var(--ic-radius);
	padding: 1rem;
	color: var(--ic-text);
	box-shadow: var(--ic-shadow);
}

.ic-side__title {
	margin: 0 0 0.6rem;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--ic-gold);
}

.ic-side__rules {
	margin-top: 1.25rem;
}

.ic-side__rules ul {
	margin: 0;
	padding-left: 1.1rem;
	color: var(--ic-muted);
	font-size: 0.88rem;
	line-height: 1.45;
}

.ic-chips {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.ic-chip {
	width: 100%;
	text-align: left;
	padding: 0.5rem 0.65rem;
	border-radius: 8px;
	border: 1px solid var(--ic-border);
	background: #1a1510;
	color: var(--ic-text);
	cursor: pointer;
	font-size: 0.88rem;
	line-height: 1.3;
}

.ic-chip:hover,
.ic-chip:focus-visible {
	border-color: var(--ic-gold);
	color: var(--ic-gold-soft);
	outline: none;
}

/* ----- Floating launcher (optional popup) ----- */
.ic-launcher {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99990;
}

.ic-launcher__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.1rem;
	border: 1px solid var(--ic-gold);
	border-radius: 999px;
	background: linear-gradient(145deg, #2a2118, #1a1510);
	color: var(--ic-gold-soft);
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: var(--ic-shadow);
	transition: transform 0.15s ease, background 0.15s ease;
}

.ic-launcher__btn:hover,
.ic-launcher__btn:focus-visible {
	transform: translateY(-2px);
	outline: none;
	background: linear-gradient(145deg, #3a2f1f, #241e17);
}

.ic-launcher__icon {
	font-size: 1.15rem;
	line-height: 1;
}

/* ----- Chat panel ----- */
.ic-chat {
	display: flex;
	flex-direction: column;
	background: var(--ic-panel);
	color: var(--ic-text);
	border: 1px solid var(--ic-border);
	border-radius: var(--ic-radius);
	overflow: hidden;
	box-shadow: var(--ic-shadow);
}

/* Staff full-page chat */
.ic-chat--page {
	width: 100%;
	height: var(--ic-height, min(72vh, 720px));
	min-height: 420px;
}

/* Smaller embed if needed */
.ic-chat--compact,
.ic-chat--embedded {
	width: 100%;
	max-width: 720px;
	height: var(--ic-height, 480px);
	margin: 0 auto;
}

.ic-chat--floating {
	/* Positioned by .ic-floating-wrap when present; fallback if alone */
	position: fixed;
	right: 20px;
	bottom: 84px;
	z-index: 99991;
	width: min(400px, calc(100vw - 32px));
	height: min(560px, calc(100vh - 120px));
}
.ic-floating-wrap .ic-chat--floating {
	position: relative;
	right: auto;
	bottom: auto;
	z-index: auto;
	width: 100%;
	height: min(560px, calc(100vh - 140px));
}

.ic-chat[hidden] {
	display: none !important;
}

.ic-chat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	background: linear-gradient(180deg, #2e261c, #241e17);
	border-bottom: 1px solid var(--ic-border);
}

.ic-chat__title {
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--ic-gold-soft);
	letter-spacing: 0.02em;
}

.ic-chat__close,
.ic-chat__clear,
.linkish {
	appearance: none;
	border: none;
	background: transparent;
	color: var(--ic-muted);
	font-size: 0.9rem;
	line-height: 1;
	cursor: pointer;
	padding: 0 0.25rem;
}

.ic-chat__close {
	font-size: 1.5rem;
}

.ic-chat__close:hover,
.ic-chat__close:focus-visible,
.ic-chat__clear:hover,
.ic-chat__clear:focus-visible,
.linkish:hover,
.linkish:focus-visible {
	color: var(--ic-gold-soft);
	outline: none;
}

.ic-chat__messages {
	flex: 1;
	overflow-y: auto;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	background: var(--ic-bg);
}

.ic-msg {
	max-width: 92%;
	padding: 0.7rem 0.9rem;
	border-radius: 12px;
	font-size: 0.92rem;
	line-height: 1.45;
	white-space: pre-wrap;
	word-wrap: break-word;
}

.ic-msg--assistant {
	align-self: flex-start;
	background: var(--ic-assistant);
	border: 1px solid var(--ic-border);
	color: var(--ic-text);
}

.ic-msg--user {
	align-self: flex-end;
	background: var(--ic-user);
	border: 1px solid var(--ic-gold);
	color: var(--ic-gold-soft);
}

.ic-msg--error {
	align-self: stretch;
	background: #3a1a1a;
	border: 1px solid #8a3030;
	color: #ffc9c9;
	font-size: 0.88rem;
}

.ic-msg--thinking {
	opacity: 0.75;
	font-style: italic;
	color: var(--ic-muted);
}

.ic-chat__form {
	display: flex;
	gap: 0.5rem;
	padding: 0.75rem;
	border-top: 1px solid var(--ic-border);
	background: #1f1913;
}

.ic-chat__input {
	flex: 1;
	min-width: 0;
	padding: 0.65rem 0.85rem;
	border-radius: 10px;
	border: 1px solid var(--ic-border);
	background: #12100d;
	color: var(--ic-text);
	font-size: 0.95rem;
}

.ic-chat__input:focus {
	outline: 2px solid var(--ic-gold);
	outline-offset: 1px;
	border-color: var(--ic-gold);
}

.ic-chat__input::placeholder {
	color: #9a8b78;
	opacity: 1;
}

.ic-chat__send {
	flex-shrink: 0;
	padding: 0.65rem 1rem;
	border-radius: 10px;
	border: 1px solid var(--ic-gold);
	background: linear-gradient(180deg, #d4b84a, #a8841c);
	color: #1a1510;
	font-weight: 700;
	font-size: 0.9rem;
	cursor: pointer;
}

.ic-chat__send:hover:not(:disabled),
.ic-chat__send:focus-visible:not(:disabled) {
	filter: brightness(1.08);
	outline: none;
}

.ic-chat__send:disabled,
.ic-chat__input:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.ic-chat .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* Podium text-list offer */
.ic-offer {
	margin: 8px 12px 12px;
	padding: 12px 14px;
	border-radius: 12px;
	background: #f4f7fb;
	border: 1px solid #d7e2ef;
}

.ic-offer__prompt {
	margin: 0 0 10px;
	font-size: 0.95rem;
	line-height: 1.4;
	color: #1a2b3c;
}

.ic-offer__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ic-offer__btn {
	appearance: none;
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 8px 14px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	line-height: 1.2;
}

.ic-offer__btn--yes {
	background: #0b5cab;
	color: #fff;
	border-color: #0b5cab;
}

.ic-offer__btn--yes:hover {
	background: #094a8a;
}

.ic-offer__btn--no {
	background: #fff;
	color: #334155;
	border-color: #cbd5e1;
}

.ic-offer__btn--no:hover {
	background: #f8fafc;
}

.ic-offer__stores {
	margin: 0 0 12px;
	padding: 10px 12px;
	border-radius: 10px;
	background: #fff;
	border: 1px solid #d7e2ef;
}

.ic-offer__stores-label {
	margin: 0 0 8px;
	font-size: 0.9rem;
	font-weight: 600;
	color: #1a2b3c;
}

.ic-offer__store-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 6px 0;
	font-size: 0.9rem;
	line-height: 1.35;
	cursor: pointer;
	color: #1a2b3c;
}

.ic-offer__store-row--on-list {
	font-weight: 600;
}

.ic-offer--staff .ic-offer__store-row--on-list span {
	color: #0b3d2e;
}

.ic-offer__store-check {
	margin-top: 3px;
	flex-shrink: 0;
}

.ic-offer__stores-help {
	margin: 8px 0 0;
	font-size: 0.8rem;
	color: #64748b;
	line-height: 1.35;
}

.ic-offer__fields,
.ic-offer__phone-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.ic-offer__name-input,
.ic-offer__phone-input,
.ic-offer__from-input,
.ic-offer__store-select {
	flex: 1 1 140px;
	min-width: 0;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	padding: 9px 12px;
	font-size: 1rem;
	background: #fff;
}

.ic-offer__fields--staff {
	flex-direction: column;
	align-items: stretch;
}

.ic-offer__fields--staff .ic-offer__btn {
	align-self: flex-start;
}

.ic-page--staff .ic-page__heading {
	color: #0b3d2e;
}

.ic-chat--staff .ic-chat__header {
	background: #0b3d2e;
	color: #fff;
}

/* Staff password gate (no WP login) */
.ic-staff-gate {
	max-width: 420px;
	margin: 1.5rem auto;
	padding: 1.25rem 1.35rem;
	border-radius: 14px;
	background: #f8fafc;
	border: 1px solid #d7e2ef;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.ic-staff-gate .ic-page__heading {
	margin-top: 0;
}

.ic-staff-gate__form {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 1rem 0 0.5rem;
}

.ic-staff-gate__label {
	font-weight: 600;
	font-size: 0.9rem;
	color: #1a2b3c;
}

.ic-staff-gate__input {
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 1rem;
}

.ic-staff-gate__btn {
	align-self: flex-start;
	border: none;
	border-radius: 10px;
	padding: 10px 16px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	background: #0b3d2e;
	color: #fff;
}

.ic-staff-gate__btn:hover {
	background: #0e4f3b;
}

.ic-staff-gate__error {
	color: #b91c1c;
	font-weight: 600;
	margin: 0.5rem 0 0;
}

.ic-staff-gate__help {
	margin: 0.75rem 0 0;
	font-size: 0.85rem;
	color: #64748b;
	line-height: 1.4;
}

.ic-staff-logout {
	margin-left: 0.75rem;
	font-size: 0.9rem;
	color: #0b5cab;
}

/*
 * Staff text form lives inside .ic-offer (light panel). Use high-contrast dark text
 * on light surfaces — do not reuse dark-chat gold/muted vars here (unreadable).
 */
.ic-offer__items {
	margin: 0.5rem 0 0.75rem;
	padding: 0.65rem 0.75rem;
	border-radius: 10px;
	border: 1px solid #c5d0dc;
	background: #ffffff;
	max-height: 14rem;
	overflow-y: auto;
}
.ic-offer__items-label,
.ic-offer .ic-offer__stores-label {
	margin: 0 0 8px;
	font-size: 0.9rem;
	font-weight: 700;
	color: #0f172a;
}
.ic-offer__item-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.85rem;
	margin: 0 0 0.55rem;
}
.ic-offer__link-btn {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	font-size: 0.8rem;
	font-weight: 700;
	color: #0b5cab;
	cursor: pointer;
	text-decoration: underline;
	min-height: auto;
	width: auto;
}
.ic-offer__link-btn:hover,
.ic-offer__link-btn:focus-visible {
	color: #084a8c;
	outline: none;
}
.ic-offer__item-row {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	padding: 0.5rem 0.35rem;
	border-top: 1px solid #e2e8f0;
	cursor: pointer;
	font-size: 0.88rem;
	color: #0f172a;
}
.ic-offer__item-row:first-of-type {
	border-top: none;
}
.ic-offer__item-row:hover {
	background: #f1f5f9;
	border-radius: 6px;
}
.ic-offer__item-check {
	margin-top: 0.2rem;
	flex-shrink: 0;
	width: 1.1rem;
	height: 1.1rem;
	accent-color: #0b5cab;
}
.ic-offer__item-body {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	min-width: 0;
}
.ic-offer__item-head {
	font-weight: 700;
	font-size: 0.84rem;
	line-height: 1.35;
	color: #0f172a;
}
.ic-offer__item-desc {
	font-size: 0.8rem;
	color: #334155;
	line-height: 1.4;
}
.ic-offer__origin-row {
	align-items: flex-start;
}
/* Store select inside light offer card */
.ic-offer .ic-offer__store-select,
.ic-offer__store-select {
	display: block;
	width: 100%;
	margin: 0.35rem 0 0.5rem;
	padding: 0.55rem 0.65rem;
	border-radius: 8px;
	border: 1px solid #94a3b8;
	background: #ffffff;
	color: #0f172a;
	font-size: 0.95rem;
	min-height: 2.5rem;
}
.ic-offer__store-select:disabled {
	opacity: 0.55;
	background: #f1f5f9;
	color: #64748b;
}
.ic-offer .ic-offer__name-input,
.ic-offer .ic-offer__phone-input,
.ic-offer .ic-offer__from-input {
	border: 1px solid #94a3b8;
	background: #ffffff;
	color: #0f172a;
}
.ic-offer .ic-offer__name-input::placeholder,
.ic-offer .ic-offer__phone-input::placeholder,
.ic-offer .ic-offer__from-input::placeholder {
	color: #64748b;
	opacity: 1;
}
.ic-offer .ic-offer__prompt {
	color: #0f172a;
	font-weight: 600;
}
.ic-offer .ic-offer__stores-help {
	color: #475569;
}

/* Staff → Pricing Calculator handoff */
.ic-price-panel {
	margin: 0.65rem 0.75rem 0.85rem;
	padding: 0.75rem 0.85rem;
	border-radius: 12px;
	border: 1px solid rgba(201, 162, 39, 0.45);
	background: rgba(201, 162, 39, 0.1);
}
.ic-price-panel__title {
	font-size: 0.82rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--ic-gold-soft, #e8d48b);
	margin: 0 0 0.35rem;
}
.ic-price-panel__help {
	margin: 0 0 0.65rem;
	font-size: 0.78rem;
	line-height: 1.4;
	color: var(--ic-muted, #b8a99a);
}
.ic-price-panel__list {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}
.ic-price-panel__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 0.65rem;
	padding: 0.55rem 0.6rem;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.22);
	border: 1px solid var(--ic-border, #3d3428);
}
.ic-price-panel__meta {
	flex: 1 1 12rem;
	min-width: 0;
}
.ic-price-panel__stock {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--ic-text, #f5f0e6);
	line-height: 1.3;
}
.ic-price-panel__desc {
	font-size: 0.72rem;
	color: var(--ic-muted, #b8a99a);
	line-height: 1.35;
	margin-top: 0.15rem;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.ic-price-panel__btn {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 2.25rem;
	padding: 0.4rem 0.75rem;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	text-decoration: none;
	color: #1a1510;
	background: linear-gradient(to right, #e8d48b, #c9a227);
	border: none;
	white-space: nowrap;
}
.ic-price-panel__btn:hover {
	filter: brightness(1.06);
}
.ic-price-panel__btn:active {
	transform: scale(0.98);
}
/* GM Pricing Calculator handoff (sky accent vs jewelry gold) */
.ic-price-panel__btn--gm {
	color: #0c1929;
	background: linear-gradient(to right, #38bdf8, #2563eb);
}
.ic-price-panel__btn--gm:hover {
	filter: brightness(1.08);
}

.ic-offer__name-input:focus,
.ic-offer__phone-input:focus {
	outline: 2px solid #0b5cab;
	outline-offset: 1px;
	border-color: #0b5cab;
}

@media (max-width: 480px) {
	.ic-launcher__label {
		display: none;
	}

	.ic-launcher__btn {
		width: 56px;
		height: 56px;
		justify-content: center;
		padding: 0;
		border-radius: 50%;
	}

	.ic-chat--floating {
		right: 12px;
		bottom: 80px;
		width: calc(100vw - 24px);
	}

	.ic-chat--page {
		min-height: 360px;
	}
}
