/* המערכת — theme styles (RTL-first admin shell) */

:root {
	--hm-bg: #f0f4f8;
	--hm-surface: #ffffff;
	--hm-border: #e2e8f0;
	--hm-text: #0f172a;
	--hm-muted: #64748b;
	--hm-primary: #1e40af;
	--hm-primary-hover: #1d4ed8;
	--hm-accent: #0ea5e9;
	--hm-ok: #16a34a;
	--hm-warn: #d97706;
	--hm-sidebar: #0f172a;
	--hm-sidebar-text: #e2e8f0;
	--hm-radius: 12px;
	--hm-shadow: 0 1px 3px rgb(15 23 42 / 8%);
	--hm-font: "Segoe UI", Tahoma, Arial, sans-serif;
	--hm-mirror-bg: #e5ddd5;
	--hm-wa-green: #075e54;
	--hm-wa-light: #dcf8c6;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	font-size: 16px;
}

body.ha-merechet {
	margin: 0;
	font-family: var(--hm-font);
	background: var(--hm-bg);
	color: var(--hm-text);
	line-height: 1.5;
	direction: rtl;
}

a {
	color: var(--hm-primary);
	text-decoration: none;
}

a:hover {
	color: var(--hm-primary-hover);
}

.hm-container {
	width: min(960px, 92vw);
	margin: 0 auto;
}

.hm-container--narrow {
	width: min(420px, 92vw);
}

.hm-main {
	min-height: 100vh;
	padding: 2rem 0;
}

.hm-main--gate {
	display: grid;
	place-items: center;
}

.hm-card {
	background: var(--hm-surface);
	border: 1px solid var(--hm-border);
	border-radius: var(--hm-radius);
	box-shadow: var(--hm-shadow);
	padding: 1.5rem;
}

.hm-card--center {
	text-align: center;
}

.hm-title {
	margin: 0 0 1rem;
	font-size: 1.5rem;
}

.hm-muted {
	color: var(--hm-muted);
	font-size: 0.875rem;
}

.hm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.625rem 1.25rem;
	border-radius: 8px;
	border: none;
	font: inherit;
	cursor: pointer;
}

.hm-btn--primary {
	background: var(--hm-primary);
	color: #fff;
}

.hm-btn--primary:hover {
	background: var(--hm-primary-hover);
	color: #fff;
}

.hm-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.hm-input {
	flex: 1;
	padding: 0.625rem 0.875rem;
	border: 1px solid var(--hm-border);
	border-radius: 8px;
	font: inherit;
}

.hm-brand__mark {
	color: var(--hm-accent);
	font-size: 1.25rem;
}

.hm-brand__title {
	margin: 0.5rem 0;
	font-size: 1.75rem;
}

/* App layout */
.hm-app {
	display: grid;
	grid-template-columns: 240px 1fr;
	min-height: 100vh;
}

.hm-sidebar {
	background: var(--hm-sidebar);
	color: var(--hm-sidebar-text);
	display: flex;
	flex-direction: column;
	padding: 1.25rem 1rem;
}

.hm-sidebar__brand {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 700;
	font-size: 1.125rem;
	margin-bottom: 2rem;
}

.hm-nav {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	flex: 1;
}

.hm-nav__link {
	color: var(--hm-sidebar-text);
	padding: 0.625rem 0.75rem;
	border-radius: 8px;
	opacity: 0.85;
}

.hm-nav__link:hover,
.hm-nav__link--active {
	background: rgb(255 255 255 / 10%);
	opacity: 1;
	color: #fff;
}

.hm-nav__link--small {
	font-size: 0.8125rem;
	padding: 0.375rem 0.75rem;
}

.hm-sidebar__foot {
	margin-top: auto;
	padding-top: 1rem;
	border-top: 1px solid rgb(255 255 255 / 12%);
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.hm-app__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.hm-topbar {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 1.25rem;
	padding: 1.25rem 1.5rem;
	background: var(--hm-surface);
	border-bottom: 1px solid var(--hm-border);
}

.hm-topbar__title {
	margin: 0;
	font-size: 1.375rem;
}

.hm-topbar__sub {
	margin: 0.25rem 0 0;
	color: var(--hm-muted);
	font-size: 0.875rem;
}

.hm-status {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.875rem;
}

.hm-status__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.hm-status__dot--ok {
	background: var(--hm-ok);
}

.hm-status__dot--warn {
	background: var(--hm-warn);
}

.hm-dashboard {
	padding: 1.5rem;
	flex: 1;
}

.hm-dashboard__grid {
	display: grid;
	grid-template-columns: 1fr 320px;
	grid-template-rows: auto auto auto;
	gap: 1rem;
}

.hm-panel {
	background: var(--hm-surface);
	border: 1px solid var(--hm-border);
	border-radius: var(--hm-radius);
	padding: 1rem 1.25rem;
	box-shadow: var(--hm-shadow);
}

.hm-panel--wide {
	grid-column: 1;
	grid-row: 1 / span 2;
}

.hm-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.hm-panel__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 600;
}

.hm-panel__note {
	margin: 1rem 0 0;
}

.hm-badge {
	font-size: 0.6875rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 0.2rem 0.5rem;
	border-radius: 999px;
	background: #f1f5f9;
	color: var(--hm-muted);
}

.hm-badge--stub {
	background: #fef3c7;
	color: #92400e;
}

.hm-badge--layer0 {
	background: #fee2e2;
	color: #991b1b;
}

/* Heatmap */
.hm-heatmap {
	display: grid;
	grid-template-columns: 2.5rem repeat(var(--hm-heatmap-cols, 6), minmax(0, 1fr));
	gap: 4px;
}

.hm-heatmap--day {
	grid-template-columns: 2.5rem minmax(0, 1fr);
}

.hm-heatmap--day .hm-heatmap__cell {
	aspect-ratio: auto;
	min-height: 2.75rem;
}

.hm-heatmap__corner,
.hm-heatmap__day,
.hm-heatmap__period {
	font-size: 0.75rem;
	color: var(--hm-muted);
	text-align: center;
}

.hm-heatmap__period,
.hm-heatmap__week {
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
}

.hm-heatmap__cell {
	aspect-ratio: 1.4;
	border-radius: 6px;
	background: #f8fafc;
	border: 1px solid var(--hm-border);
}

.hm-heatmap__cell--empty {
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.hm-heatmap__cell--scheduled {
	background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
	border-color: #86efac;
}

.hm-heatmap__cell--pending_substitution {
	background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
	border-color: #fbbf24;
}

.hm-heatmap__cell--substituted {
	background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
	border-color: #60a5fa;
}

.hm-heatmap__cell--gap {
	background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
	border-color: #fb923c;
}

.hm-heatmap__cell--deadlock {
	background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
	border-color: #f87171;
}

.hm-heatmap__cell--outside {
	background: #f1f5f9;
	border-color: transparent;
	opacity: 0.45;
	pointer-events: none;
}

.hm-heatmap__cell--today {
	box-shadow: inset 0 0 0 2px var(--hm-primary);
}

.hm-heatmap__cell--month {
	aspect-ratio: 1.1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.15rem;
	padding: 0.25rem;
}

.hm-heatmap__daynum {
	font-size: 0.8125rem;
	font-weight: 700;
	line-height: 1;
}

.hm-heatmap__count {
	font-size: 0.625rem;
	font-weight: 600;
	color: var(--hm-muted);
	line-height: 1;
}

.hm-heatmap__cell--clickable {
	cursor: pointer;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.hm-heatmap__cell--clickable:hover,
.hm-heatmap__cell--clickable:focus {
	transform: scale(1.03);
	box-shadow: 0 2px 8px rgb(15 23 42 / 12%);
	outline: none;
}

.hm-heatmap__cell--clickable.hm-heatmap__cell--selected {
	box-shadow: 0 0 0 2px var(--hm-primary);
}

.hm-panel__note {
	margin: 0.75rem 0 0;
	font-size: 0.8125rem;
}

/* Slot drawer */
.hm-drawer[hidden] {
	display: none !important;
}

.hm-drawer {
	position: fixed;
	inset: 0;
	z-index: 1000;
}

.hm-drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgb(15 23 42 / 35%);
}

.hm-drawer__panel {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: min(420px, 92vw);
	background: var(--hm-surface);
	box-shadow: 4px 0 24px rgb(0 0 0 / 12%);
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.hm-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--hm-border);
}

.hm-drawer__title {
	margin: 0;
	font-size: 1rem;
}

.hm-drawer__close {
	border: none;
	background: transparent;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	color: var(--hm-muted);
}

.hm-drawer__body {
	padding: 1rem 1.25rem;
	overflow-y: auto;
	flex: 1;
}

.hm-slot-section {
	margin-bottom: 1rem;
}

.hm-slot-section__title {
	margin: 0 0 0.5rem;
	font-size: 0.875rem;
	font-weight: 600;
}

.hm-slot-meta {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.8125rem;
}

.hm-slot-meta li {
	margin-bottom: 0.25rem;
}

.hm-analysis-list {
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.8125rem;
}

.hm-analysis-list li {
	padding: 0.35rem 0;
	border-bottom: 1px solid var(--hm-border);
}

.hm-analysis-list li.is-eligible {
	color: #166534;
}

.hm-analysis-list li.is-ineligible {
	color: #991b1b;
}

/* Constraints panel */
.hm-constraints {
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
	max-height: 180px;
	overflow-y: auto;
}

.hm-constraints__item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0;
	border-bottom: 1px solid var(--hm-border);
	font-size: 0.8125rem;
}

.hm-constraints__empty {
	color: var(--hm-muted);
	font-size: 0.8125rem;
}

.hm-constraints__form {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--hm-border);
}

.hm-constraints__form-title {
	margin: 0;
	font-size: 0.875rem;
}

.hm-constraints__field {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	font-size: 0.8125rem;
}

.hm-cal-sens__hint {
	margin: 0 0 1rem;
	font-size: 0.875rem;
}

.hm-cal-sens__periods {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

@media (max-width: 520px) {
	.hm-cal-sens__periods {
		grid-template-columns: 1fr;
	}
}

.hm-constraints__delete {
	font-size: 0.75rem;
	padding: 0.2rem 0.5rem;
}

.hm-mirror__sim {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
	color: #94a3b8;
	font-size: 0.875rem;
}

.hm-mirror__schedule {
	flex: 1 1 100%;
	font-size: 0.75rem;
	color: #cbd5e1;
	background: #111827;
	border-radius: 6px;
	padding: 0.4rem 0.55rem;
}

.hm-mirror__chips {
	flex: 1 1 100%;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.hm-mirror__chip {
	border: 1px solid #374151;
	background: #1f2937;
	color: #e2e8f0;
	border-radius: 999px;
	padding: 0.2rem 0.55rem;
	font-size: 0.75rem;
	cursor: pointer;
}

.hm-mirror__chip:hover {
	background: #374151;
}

.hm-mirror__sim-select {
	background: #1f2937;
	color: #e2e8f0;
	border: 1px solid #374151;
	border-radius: 8px;
	padding: 0.375rem 0.625rem;
}

.hm-mirror__gate {
	text-align: center;
	color: #94a3b8;
	margin-bottom: 1rem;
}

.hm-heatmap__label {
	font-size: 0.625rem;
	font-weight: 600;
	line-height: 1.2;
	color: #334155;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.hm-week-nav {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8125rem;
}

.hm-week-nav__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	background: #f1f5f9;
	color: var(--hm-text);
}

.hm-week-nav__btn:hover {
	background: #e2e8f0;
	color: var(--hm-text);
}

.hm-week-nav__label {
	color: var(--hm-muted);
	min-width: 9rem;
	text-align: center;
}

.hm-week-nav__today {
	font-size: 0.75rem;
	color: var(--hm-primary);
}

/* Heatmap toolbar — mode filter + range nav */
.hm-heatmap-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.65rem 1rem;
	margin-bottom: 0.25rem;
}

.hm-heatmap-mode {
	display: inline-flex;
	padding: 3px;
	border-radius: 999px;
	background: rgb(15 23 42 / 5%);
	border: 1px solid var(--hm-border);
}

.hm-heatmap-mode__btn {
	appearance: none;
	border: none;
	background: transparent;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	padding: 0.35rem 0.85rem;
	border-radius: 999px;
	cursor: pointer;
	color: var(--hm-muted);
	transition: background 0.15s ease, color 0.15s ease;
}

.hm-heatmap-mode__btn--active {
	background: var(--hm-surface);
	color: var(--hm-primary);
	box-shadow: 0 1px 4px rgb(15 23 42 / 10%);
}

.hm-heatmap-nav {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	flex-wrap: wrap;
}

.hm-heatmap-nav__btn {
	width: 2rem;
	height: 2rem;
	border-radius: 8px;
	border: 1px solid var(--hm-border);
	background: var(--hm-surface);
	cursor: pointer;
	font-size: 1.1rem;
	line-height: 1;
	color: var(--hm-muted);
}

.hm-heatmap-nav__btn:hover {
	background: #e2e8f0;
	color: var(--hm-text);
}

.hm-heatmap-nav__label {
	color: var(--hm-text);
	font-size: 0.833rem;
	font-weight: 600;
	min-width: 9rem;
	text-align: center;
}

.hm-heatmap-nav__reset {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--hm-primary);
	border: none;
	background: transparent;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
}

.hm-heatmap-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.75rem;
	color: var(--hm-muted);
}

.hm-heatmap-legend--top {
	margin: 0 0 0.875rem;
	padding: 0.625rem 0.75rem;
	background: rgb(15 23 42 / 3%);
	border: 1px solid var(--hm-border);
	border-radius: var(--hm-radius-sm);
}

.hm-heatmap-legend li {
	display: flex;
	align-items: center;
	gap: 0.375rem;
}

.hm-heatmap-legend__swatch {
	width: 14px;
	height: 14px;
	border-radius: 4px;
	border: 1px solid var(--hm-border);
}

.hm-badge--ok {
	background: #dcfce7;
	color: #166534;
}

.hm-badge--warn {
	background: #fef3c7;
	color: #92400e;
}

.hm-briefing-detail {
	margin-top: 1rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--hm-border);
}

.hm-briefing-detail__title {
	margin: 0 0 0.5rem;
	font-size: 0.8125rem;
	font-weight: 600;
}

.hm-briefing-detail__list {
	margin: 0;
	padding: 0 1rem 0 0;
	font-size: 0.8125rem;
}

.hm-briefing-detail--alert {
	border-right: 3px solid #ef4444;
	padding-right: 0.5rem;
}

/* Briefing */
.hm-briefing {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.hm-briefing__item {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	font-size: 0.875rem;
}

.hm-briefing__tag {
	flex-shrink: 0;
	font-size: 0.6875rem;
	padding: 0.15rem 0.45rem;
	border-radius: 4px;
	background: #f1f5f9;
	color: var(--hm-muted);
}

.hm-briefing__tag--ok {
	background: #dcfce7;
	color: #166534;
}

.hm-panel__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.hm-briefing-score {
	font-size: 0.8125rem;
	font-weight: 700;
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	background: #eff6ff;
	color: #1e40af;
}

.hm-briefing-score--high {
	background: #dcfce7;
	color: #166534;
}

.hm-briefing-score--mid {
	background: #fef9c3;
	color: #854d0e;
}

.hm-briefing-score--low {
	background: #fee2e2;
	color: #991b1b;
}

.hm-wa-feed {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 280px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

.hm-wa-feed__item {
	border: 1px solid var(--hm-border);
	border-radius: 8px;
	padding: 0.625rem 0.75rem;
	font-size: 0.8125rem;
	background: #f8fafc;
}

.hm-wa-feed__item--inbound {
	border-right: 3px solid #1e40af;
}

.hm-wa-feed__item--outbound {
	border-right: 3px solid #64748b;
}

.hm-wa-feed__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.625rem;
	align-items: center;
	margin-bottom: 0.35rem;
}

.hm-wa-feed__body {
	margin: 0;
	white-space: pre-wrap;
	word-break: break-word;
}

.hm-wa-feed__dir {
	font-size: 0.6875rem;
	color: var(--hm-muted);
}

.hm-wa-feed__item--empty {
	color: var(--hm-muted);
	text-align: center;
	border-style: dashed;
}

.hm-studio__metrics {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.625rem;
	margin-bottom: 0.75rem;
}

.hm-studio__metric {
	border: 1px solid var(--hm-border);
	border-radius: 8px;
	padding: 0.5rem 0.625rem;
	font-size: 0.8125rem;
}

.hm-studio__metric strong {
	display: block;
	font-size: 1.125rem;
	margin-top: 0.15rem;
}

.hm-studio__subtitle {
	font-size: 0.8125rem;
	margin: 0.75rem 0 0.35rem;
}

.hm-studio__learnings {
	margin: 0;
	padding-right: 1.1rem;
	font-size: 0.8125rem;
	color: var(--hm-text);
}

.hm-studio__pattern {
	font-size: 0.75rem;
	margin: 0 0 0.5rem;
}

/* Proactive alerts + broadcast (Wave 12) */
.hm-alerts {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.hm-alerts__item {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.55rem 0.65rem;
	border-radius: 8px;
	font-size: 0.8125rem;
	background: #f8fafc;
	border-right: 3px solid var(--hm-muted, #94a3b8);
}

.hm-alerts__item--critical {
	background: #fef2f2;
	border-right-color: #dc2626;
}

.hm-alerts__item--warn {
	background: #fffbeb;
	border-right-color: #d97706;
}

.hm-alerts__item--info,
.hm-alerts__item--ok {
	background: #f0fdf4;
	border-right-color: #16a34a;
}

.hm-broadcast {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.hm-broadcast__label {
	font-size: 0.8125rem;
	font-weight: 600;
}

.hm-broadcast__input {
	width: 100%;
	border: 1px solid var(--hm-border, #e2e8f0);
	border-radius: 8px;
	padding: 0.5rem 0.65rem;
	font-family: inherit;
	font-size: 0.875rem;
	resize: vertical;
}

.hm-broadcast__actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.hm-status__python {
	font-size: 0.75rem;
	margin-right: 0.5rem;
}

/* Admin chat */
.hm-chat {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	min-height: 220px;
}

.hm-chat__messages {
	flex: 1;
	background: #f8fafc;
	border-radius: 8px;
	padding: 0.75rem;
	min-height: 140px;
}

.hm-chat__msg--system {
	font-size: 0.8125rem;
	color: var(--hm-muted);
}

.hm-chat__composer {
	display: flex;
	gap: 0.5rem;
}

.hm-chat__msg--deadlock {
	background: #fef2f2;
	border-right: 3px solid #dc2626;
	padding: 0.5rem 0.65rem;
	border-radius: 6px;
	margin-bottom: 0.5rem;
	font-size: 0.8125rem;
}

.hm-chat__msg--pending {
	background: #fffbeb;
	border-right: 3px solid #d97706;
	padding: 0.5rem 0.65rem;
	border-radius: 6px;
	margin-bottom: 0.5rem;
	font-size: 0.8125rem;
}

.hm-chat__msg--override {
	background: #eff6ff;
	border-right: 3px solid #2563eb;
	padding: 0.5rem 0.65rem;
	border-radius: 6px;
	margin-bottom: 0.5rem;
	font-size: 0.8125rem;
}

.hm-chat__idle {
	font-size: 0.8125rem;
	margin: 0;
}

.hm-override {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--hm-border);
}

.hm-override__title {
	margin: 0;
	font-size: 0.875rem;
}

.hm-override__target {
	margin: 0;
	font-size: 0.8125rem;
}

.hm-override__field {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.8125rem;
}

.hm-input--area {
	min-height: 4rem;
	resize: vertical;
}

.hm-text--error {
	color: #b91c1c;
}

/* Demo panel */
.hm-panel--demo {
	margin-bottom: 1rem;
}

.hm-demo__intro {
	margin: 0 0 0.75rem;
	font-size: 0.875rem;
	color: var(--hm-muted);
}

.hm-demo__checklist {
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.hm-demo__step {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.8125rem;
}

.hm-demo__step-mark {
	width: 1.25rem;
	text-align: center;
	color: var(--hm-muted);
}

.hm-demo__step--done {
	color: #166534;
}

.hm-demo__step--done .hm-demo__step-mark {
	color: #166534;
	font-weight: 700;
}

.hm-demo__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.hm-demo__hints {
	background: #f8fafc;
	border-radius: 8px;
	padding: 0.75rem;
	font-size: 0.8125rem;
}

.hm-demo__hints-title {
	margin: 0 0 0.5rem;
	font-size: 0.8125rem;
}

.hm-demo__hint {
	margin-bottom: 0.5rem;
}

.hm-demo__hint-msg {
	display: block;
	margin-top: 0.25rem;
	padding: 0.35rem 0.5rem;
	background: #fff;
	border-radius: 4px;
	font-size: 0.75rem;
}

.hm-demo__hint--override {
	margin-bottom: 0;
	padding-top: 0.5rem;
	border-top: 1px dashed var(--hm-border);
}

.hm-demo__status {
	margin: 0.5rem 0 0;
	font-size: 0.8125rem;
}

.hm-briefing-detail--tokens {
	margin-top: 0.75rem;
}

.hm-token-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.hm-token-list__item {
	display: flex;
	justify-content: space-between;
	font-size: 0.8125rem;
}

.hm-token-list__balance {
	color: var(--hm-primary);
}

.hm-mirror__card {
	margin: 0.5rem 0.75rem;
	padding: 0.65rem 0.75rem;
	border-radius: 10px;
	background: #fff;
	border: 1px solid rgb(255 255 255 / 12%);
	box-shadow: 0 1px 2px rgb(0 0 0 / 12%);
	font-size: 0.8125rem;
}

.hm-mirror__card--deadlock {
	border-right: 3px solid #dc2626;
}

.hm-mirror__card--warn {
	border-right: 3px solid #d97706;
}

.hm-mirror__card--ok {
	border-right: 3px solid #16a34a;
}

.hm-mirror__card-title {
	font-weight: 700;
	margin-bottom: 0.35rem;
}

.hm-mirror__card-line {
	color: #334155;
	line-height: 1.35;
}

.hm-live-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--hm-ok);
	margin-inline-start: 0.35rem;
	animation: hm-pulse 2s ease-in-out infinite;
}

@keyframes hm-pulse {
	0%,
	100% {
		opacity: 0.45;
	}
	50% {
		opacity: 1;
	}
}

.hm-panel--audit {
	margin-top: 1rem;
}

.hm-badge--live {
	background: #dcfce7;
	color: #166534;
	font-size: 0.6875rem;
}

.hm-audit {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	max-height: 280px;
	overflow-y: auto;
}

.hm-audit__item {
	padding: 0.65rem 0.75rem;
	border-radius: 8px;
	background: #f8fafc;
	border-right: 3px solid #cbd5e1;
	font-size: 0.8125rem;
}

.hm-audit__item--layer0 {
	border-right-color: #2563eb;
	background: #eff6ff;
}

.hm-audit__item--alert {
	border-right-color: #dc2626;
	background: #fef2f2;
}

.hm-audit__item--ok {
	border-right-color: #16a34a;
	background: #f0fdf4;
}

.hm-audit__item--demo {
	border-right-color: #7c3aed;
	background: #f5f3ff;
}

.hm-audit__head {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.25rem;
}

.hm-audit__time {
	color: var(--hm-muted);
	font-size: 0.75rem;
	white-space: nowrap;
}

.hm-audit__detail {
	margin: 0;
	color: #334155;
}

.hm-audit__actor {
	display: inline-block;
	margin-top: 0.25rem;
	font-size: 0.75rem;
	color: var(--hm-muted);
}

.hm-audit__item--empty {
	color: var(--hm-muted);
	border-right-color: transparent;
}

.hm-btn--ghost {
	background: transparent;
	border: 1px solid var(--hm-border);
	color: inherit;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Mirror (WhatsApp clone) */
.hm-mirror {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem 1rem;
	background: #111b21;
}

.hm-mirror__phone {
	width: min(380px, 100%);
	background: var(--hm-mirror-bg);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgb(0 0 0 / 35%);
}

.hm-mirror__header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.875rem 1rem;
	background: var(--hm-wa-green);
	color: #fff;
}

.hm-mirror__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgb(255 255 255 / 20%);
	display: grid;
	place-items: center;
	font-weight: 700;
}

.hm-mirror__name {
	display: block;
	font-size: 0.9375rem;
}

.hm-mirror__status {
	font-size: 0.75rem;
	opacity: 0.85;
}

.hm-mirror__thread {
	padding: 1rem;
	min-height: 360px;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='%23e5ddd5'/%3E%3Cpath d='M30 0v60M0 30h60' stroke='%23d9d2cb' stroke-width='0.5'/%3E%3C/svg%3E");
}

.hm-mirror__bubble {
	max-width: 85%;
	padding: 0.5rem 0.75rem;
	border-radius: 8px;
	font-size: 0.875rem;
	position: relative;
	line-height: 1.4;
}

.hm-mirror__bubble--in {
	align-self: flex-start;
	background: #fff;
}

.hm-mirror__bubble--out {
	align-self: flex-end;
	background: var(--hm-wa-light);
}

.hm-mirror__time {
	display: block;
	text-align: left;
	font-size: 0.625rem;
	color: var(--hm-muted);
	margin-top: 0.25rem;
}

.hm-mirror__composer {
	display: flex;
	gap: 0.5rem;
	padding: 0.625rem;
	background: #f0f0f0;
}

.hm-mirror__input {
	flex: 1;
	border: none;
	border-radius: 999px;
	padding: 0.5rem 1rem;
	font: inherit;
}

.hm-mirror__send {
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: var(--hm-wa-green);
	color: #fff;
	font-size: 1rem;
}

.hm-mirror__note {
	margin-top: 1rem;
}

.hm-mirror__note a {
	color: #94a3b8;
}

.hm-mirror__layout {
	display: flex;
	gap: 1.25rem;
	align-items: flex-start;
	flex-wrap: wrap;
	justify-content: center;
	width: 100%;
	max-width: 960px;
}

.hm-mirror__profile {
	flex: 1 1 320px;
	max-width: 400px;
	max-height: 85vh;
	overflow: auto;
	background: #fff;
	border-radius: 16px;
	padding: 0.75rem;
	box-shadow: 0 8px 32px rgb(0 0 0 / 35%);
}

.hm-mirror__avatar--teacher {
	border: 2px solid #fff;
	background-color: rgb(255 255 255 / 20%);
	background-position: center;
}

.hm-mirror__card-wrap {
	margin: 0.5rem 0.75rem;
}

/* Teacher card — see assets/css/teacher-card.css */

@media (max-width: 900px) {
	.hm-app {
		grid-template-columns: 1fr;
	}

	.hm-sidebar {
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.5rem;
	}

	.hm-sidebar__brand {
		margin-bottom: 0;
	}

	.hm-nav {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.hm-sidebar__foot {
		width: 100%;
		flex-direction: row;
		justify-content: space-between;
		border-top: none;
		padding-top: 0;
	}

	.hm-dashboard__grid {
		grid-template-columns: 1fr;
	}

	.hm-panel--wide {
		grid-row: auto;
	}
}
