/* =========================================================================
   AMIR SMART DIGITAL TWIN — Command Center theme (class prefix: atw-)
   Same "premium glass" visual language as AMIR SMART HOME: a full-bleed
   3D stage with floating pill/panel controls layered on top, not a boxed
   dashboard grid.
   ========================================================================= */
.amir-twin-app {
	--atw-accent: #00ff96;
	--atw-accent-dim: rgba(0, 255, 150, 0.35);
	--atw-accent-glow: rgba(0, 255, 150, 0.18);
	--atw-bg-0: #07080a;
	--atw-panel: rgba(9, 11, 12, 0.86);
	--atw-panel-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
	--atw-panel-border: rgba(255, 255, 255, 0.13);
	--atw-text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
	--atw-text-0: #ffffff;
	--atw-text-1: #c7cdcb;
	--atw-text-2: #8b928f;
	--atw-blue: #3aa8ff;
	--atw-amber: #ffb020;
	--atw-red: #ff4d4d;

	position: relative;
	width: 100%;
	min-height: 420px;
	border-radius: 22px;
	overflow: hidden;
	background: radial-gradient(circle at 25% 15%, #10140f 0%, var(--atw-bg-0) 55%, #050505 100%);
	font-family: 'Vazirmatn', 'Yekan', Tahoma, sans-serif;
	color: var(--atw-text-0);
	isolation: isolate;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.amir-twin-app[data-twin-dir='rtl'] { direction: rtl; }
.amir-twin-app[data-twin-dir='ltr'] { direction: ltr; }
.amir-twin-app * { box-sizing: border-box; }
.amir-twin-app canvas { display: block; outline: none; }

.atw-topbar, .atw-chips, .atw-zones, .atw-timeline, .atw-scenarios,
.atw-info, .atw-dashboard, .atw-ai-panel, .atw-ai-fab {
	text-shadow: var(--atw-text-shadow);
}

/* shared "premium glass" chrome for every pill/button-like surface */
.atw-chip, .atw-scn-btn, .atw-iconbtn, .atw-dd-btn, .atw-fab,
.atw-zone-item, .atw-btn, .atw-radar-toggle {
	position: relative;
	background-image: var(--atw-panel-grad);
	background-blend-mode: overlay;
	transition: border-color 0.18s, background-color 0.18s, transform 0.12s, box-shadow 0.18s;
}
.atw-chip:active, .atw-scn-btn:active, .atw-dd-btn:active, .atw-zone-item:active, .atw-btn:active {
	transform: scale(0.97);
}

.atw-stage { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.atw-stage.atw-dragging { cursor: grabbing; }

/* ---------------------------------------------------------------- Loading */
.atw-loading {
	position: absolute; inset: 0; z-index: 100;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	background: var(--atw-bg-0); transition: opacity 0.6s;
}
.atw-loading.atw-hide { opacity: 0; pointer-events: none; }
.atw-ring {
	width: 42px; height: 42px; border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.08); border-top-color: var(--atw-accent);
	animation: atw-spin 0.9s linear infinite;
}
@keyframes atw-spin { to { transform: rotate(360deg); } }
.atw-loading-text { font-size: 12px; color: var(--atw-text-2); }

/* ---------------------------------------------------------------- Topbar */
.atw-topbar {
	position: absolute; top: 0; inset-inline: 0; z-index: 40;
	display: flex; align-items: center; justify-content: space-between;
	padding: 14px 18px 34px; pointer-events: none;
	background: linear-gradient(to bottom, rgba(3, 4, 5, 0.65) 0%, rgba(3, 4, 5, 0.32) 60%, rgba(3, 4, 5, 0) 100%);
}
.atw-brand {
	display: flex; align-items: center; gap: 9px; pointer-events: auto; min-width: 0;
	background: var(--atw-panel); border: 1px solid var(--atw-panel-border); backdrop-filter: blur(14px);
	padding: 8px 14px; border-radius: 100px;
}
.atw-brand .atw-dot {
	width: 8px; height: 8px; border-radius: 50%; background: var(--atw-accent); flex-shrink: 0;
	box-shadow: 0 0 10px var(--atw-accent), 0 0 22px var(--atw-accent-glow);
}
.atw-brand .atw-name { font-weight: 800; font-size: 13.5px; white-space: nowrap; color: var(--atw-text-0); }
.atw-brand .atw-name b { color: var(--atw-accent); }
.atw-brand .atw-sub {
	display: none; font-size: 10.5px; font-weight: 500; color: var(--atw-text-1); white-space: nowrap;
	overflow: hidden; text-overflow: ellipsis; padding-inline-start: 8px; margin-inline-start: 6px;
	border-inline-start: 1px solid var(--atw-panel-border);
}
@media (min-width: 640px) { .atw-brand .atw-sub { display: inline; } }

.atw-topbar-right { display: flex; gap: 8px; align-items: center; }
.atw-status-pill {
	pointer-events: auto; font-size: 10.5px; background: var(--atw-panel); border: 1px solid var(--atw-panel-border);
	backdrop-filter: blur(14px); padding: 6px 13px; border-radius: 100px;
}
.atw-status-pill.atw-status-alert { color: var(--atw-red); border-color: rgba(255, 77, 77, 0.4); }

.atw-toolbtns { display: flex; gap: 7px; pointer-events: auto; }
.atw-iconbtn {
	width: 32px; height: 32px; border-radius: 10px; background: var(--atw-panel); border: 1px solid var(--atw-panel-border);
	backdrop-filter: blur(14px); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--atw-text-1);
}
.atw-iconbtn:hover { color: var(--atw-text-0); border-color: var(--atw-accent-dim); }
.atw-iconbtn svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- View chips (Explore/Monitor/Operate) */
.atw-chips {
	position: absolute; top: 60px; inset-inline-start: 50%; transform: translateX(-50%);
	z-index: 32; display: flex; gap: 6px; pointer-events: auto;
}
.amir-twin-app[data-twin-dir='rtl'] .atw-chips { transform: translateX(50%); }
.atw-chip {
	background: var(--atw-panel); border: 1px solid var(--atw-panel-border); backdrop-filter: blur(14px);
	color: var(--atw-text-0); font-weight: 600; font-size: 11.5px; padding: 7px 14px; border-radius: 100px;
	cursor: pointer; white-space: nowrap; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.atw-chip:hover { border-color: var(--atw-accent-dim); }
.atw-chip.atw-active {
	background: linear-gradient(135deg, var(--atw-accent), #00d47f); color: #06110c; font-weight: 800;
	border-color: var(--atw-accent); text-shadow: none; box-shadow: 0 8px 20px rgba(0, 255, 150, 0.28);
}

.atw-fab {
	display: none; position: absolute; z-index: 36; width: 42px; height: 42px; border-radius: 50%;
	background: var(--atw-panel); border: 1px solid var(--atw-panel-border); backdrop-filter: blur(16px);
	align-items: center; justify-content: center; cursor: pointer; color: var(--atw-text-0);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}
.atw-fab svg { width: 17px; height: 17px; }
.atw-fab-zones { top: 60px; inset-inline-start: 18px; }
.atw-fab-dash { top: 60px; inset-inline-start: 66px; }

/* ---------------------------------------------------------------- Dropdowns + radar toggle */
.atw-dd-row { position: absolute; top: 106px; inset-inline-start: 18px; z-index: 33; display: flex; gap: 7px; pointer-events: auto; }
.atw-dd { position: relative; }
.atw-dd-btn {
	display: flex; align-items: center; gap: 7px; background: var(--atw-panel); border: 1px solid var(--atw-panel-border);
	backdrop-filter: blur(14px); color: var(--atw-text-0); font-weight: 600; font-size: 11px; padding: 9px 13px;
	border-radius: 100px; cursor: pointer; white-space: nowrap; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.atw-dd-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.atw-dd-btn .atw-dd-chevron { width: 9px; height: 9px; opacity: 0.7; transition: transform 0.2s; }
.atw-dd.atw-open .atw-dd-chevron { transform: rotate(180deg); }
.atw-dd.atw-open .atw-dd-btn { border-color: var(--atw-accent-dim); background: rgba(0, 255, 150, 0.12); }
.atw-dd-btn .atw-dd-current { color: var(--atw-accent); font-weight: 700; }
.atw-dd-menu {
	position: absolute; top: calc(100% + 8px); inset-inline-start: 0; min-width: 210px;
	background: rgba(9, 11, 12, 0.95); border: 1px solid var(--atw-panel-border); backdrop-filter: blur(20px);
	border-radius: 14px; padding: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
	opacity: 0; transform: translateY(-6px); pointer-events: none; transition: 0.18s; z-index: 50;
}
.atw-dd.atw-open .atw-dd-menu { opacity: 1; transform: translateY(0); pointer-events: auto; }
.atw-dd-item {
	display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; font-size: 12px;
	font-weight: 500; color: var(--atw-text-1); cursor: pointer;
}
.atw-dd-item:hover { background: rgba(255, 255, 255, 0.07); color: var(--atw-text-0); }
.atw-dd-item svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--atw-text-2); }
.atw-dd-item-icon {
	width: 26px; height: 26px; border-radius: 8px; background: rgba(255, 255, 255, 0.05);
	display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.atw-dd-item.atw-selected { color: var(--atw-text-0); background: rgba(0, 255, 150, 0.1); }
.atw-dd-item.atw-selected .atw-dd-item-icon { background: var(--atw-accent); color: #06110c; }
.atw-dd-item.atw-selected svg { color: #06110c; }
.atw-dd-check { margin-inline-start: auto; width: 15px; height: 15px; color: var(--atw-accent); opacity: 0; }
.atw-dd-item.atw-selected .atw-dd-check { opacity: 1; }

.atw-radar-toggle {
	display: flex; align-items: center; gap: 7px; background: var(--atw-panel); border: 1px solid var(--atw-panel-border);
	backdrop-filter: blur(14px); color: var(--atw-text-0); font-weight: 600; font-size: 11px; padding: 9px 13px;
	border-radius: 100px; cursor: pointer; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.atw-radar-toggle svg { width: 14px; height: 14px; }
.atw-radar-toggle.atw-active { border-color: var(--atw-accent-dim); background: rgba(0, 255, 150, 0.14); color: var(--atw-accent); }

/* ---------------------------------------------------------------- Radar panel */
.atw-radar-panel {
	position: absolute; top: 340px; right: 18px; left: auto; z-index: 35; width: 250px;
	background: radial-gradient(circle at 50% 45%, rgba(10, 20, 16, 0.96), rgba(4, 7, 6, 0.98));
	border: 1px solid var(--atw-panel-border); border-radius: 18px; padding: 14px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(0, 255, 150, 0.06);
	opacity: 0; transform: translateY(-8px) scale(0.97); pointer-events: none; transition: 0.22s;
}
.atw-radar-panel.atw-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.atw-radar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.atw-radar-title { font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--atw-accent); text-transform: uppercase; }
.atw-radar-close {
	width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, 0.08);
	display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--atw-text-1); font-size: 10px;
}
.atw-radar-svg-wrap {
	position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden;
	box-shadow: inset 0 0 30px rgba(0, 255, 150, 0.08), 0 0 0 1px rgba(0, 255, 150, 0.15);
	background-image:
		repeating-radial-gradient(circle at 50% 50%, rgba(0, 255, 150, 0.16) 0, rgba(0, 255, 150, 0.16) 1px, transparent 1px, transparent 24.5%),
		linear-gradient(rgba(0, 255, 150, 0.08) 1px, transparent 1px),
		linear-gradient(90deg, rgba(0, 255, 150, 0.08) 1px, transparent 1px);
	background-size: 100% 100%, 12.5% 100%, 100% 12.5%;
}
.atw-radar-blips { position: absolute; inset: 0; }
.atw-radar-sweep {
	position: absolute; inset: 0; border-radius: 50%;
	background: conic-gradient(from 0deg, rgba(0, 255, 150, 0.45), rgba(0, 255, 150, 0) 28%);
	animation: atw-radar-spin 3.2s linear infinite; transform-origin: 50% 50%;
}
@keyframes atw-radar-spin { to { transform: rotate(360deg); } }
.atw-radar-blip { position: absolute; width: 7px; height: 7px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 8px currentColor; }
.atw-radar-blip::after {
	content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid currentColor; opacity: 0.5;
	animation: atw-blip-pulse 1.6s ease-out infinite;
}
@keyframes atw-blip-pulse { 0% { transform: scale(0.6); opacity: 0.6; } 100% { transform: scale(2.2); opacity: 0; } }
.atw-radar-filters { display: flex; gap: 5px; margin-top: 11px; flex-wrap: wrap; justify-content: center; }
.atw-radar-filter {
	font-size: 9.5px; font-weight: 600; padding: 5px 9px; border-radius: 100px; background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--atw-panel-border); color: var(--atw-text-1); cursor: pointer;
}
.atw-radar-filter.atw-active { background: var(--atw-accent); color: #06110c; border-color: var(--atw-accent); }

/* ---------------------------------------------------------------- Entity tags (label overlay) */
.atw-entity-layer { position: absolute; inset: 0; z-index: 24; pointer-events: none; overflow: hidden; }
.atw-entity-tag { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 3px; white-space: nowrap; transition: opacity 0.2s; }
.atw-entity-tag .atw-et-box { font-size: 9.5px; font-weight: 700; color: #06110c; background: var(--atw-accent); padding: 3px 8px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.atw-entity-tag.atw-tag-vehicle .atw-et-box { background: var(--atw-amber); }
.atw-entity-tag.atw-tag-robot .atw-et-box { background: var(--atw-blue); }
.atw-entity-tag.atw-tag-drone .atw-et-box { background: #ff77e0; }

/* ---------------------------------------------------------------- Zones sidebar (left) */
.atw-zones {
	position: absolute; top: 150px; inset-inline-start: 18px; z-index: 26; width: 178px;
	background: var(--atw-panel); border: 1px solid var(--atw-panel-border); backdrop-filter: blur(18px);
	border-radius: 16px; padding: 12px; max-height: calc(100% - 306px); overflow-y: auto;
}
.atw-zones h3 { margin: 2px 2px 8px; font-size: 10px; font-weight: 700; color: var(--atw-text-2); letter-spacing: 1px; text-transform: uppercase; }
.atw-zone-item {
	padding: 9px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 500; color: var(--atw-text-0);
	cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.atw-zone-item:hover { background: rgba(255, 255, 255, 0.08); }
.atw-zone-item.atw-active { background: var(--atw-accent); color: #06110c; font-weight: 700; text-shadow: none; }
.atw-zone-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--atw-text-2); }
.atw-zone-item.atw-active .atw-zone-dot { background: #06110c; box-shadow: none; }
.atw-zone-count { color: var(--atw-text-2); font-variant-numeric: tabular-nums; font-size: 11px; }
.atw-zone-item.atw-active .atw-zone-count { color: #06110c; }

/* ---------------------------------------------------------------- Timeline (bottom-left) */
.atw-timeline {
	position: absolute; inset-inline-start: 18px; bottom: 18px; z-index: 26; width: 220px;
	background: var(--atw-panel); border: 1px solid var(--atw-panel-border); backdrop-filter: blur(18px);
	border-radius: 16px; padding: 11px 14px;
}
.atw-timeline .atw-tl-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.atw-timeline .atw-tl-label { font-size: 10.5px; color: var(--atw-text-2); }
.atw-timeline .atw-tl-val { font-size: 12px; font-weight: 700; color: var(--atw-text-0); }
.amir-twin-app input[type='range'] { -webkit-appearance: none; width: 100%; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.14); outline: none; }
.amir-twin-app input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--atw-accent); box-shadow: 0 0 8px var(--atw-accent); cursor: pointer; }

/* ---------------------------------------------------------------- Object info panel (right) */
.atw-info {
	position: absolute; top: 104px; inset-inline-end: 18px; width: 270px; max-width: calc(100% - 36px); z-index: 38;
	background: var(--atw-panel); border: 1px solid var(--atw-panel-border); backdrop-filter: blur(18px);
	border-radius: 18px; padding: 18px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
	transform: translateX(120%); opacity: 0; transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
	max-height: calc(100% - 300px); overflow-y: auto;
}
.amir-twin-app[data-twin-dir='rtl'] .atw-info { transform: translateX(-120%); }
.atw-info.atw-show { transform: translateX(0); opacity: 1; }
.atw-info .atw-close {
	position: absolute; inset-inline-start: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%;
	background: rgba(255, 255, 255, 0.06); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--atw-text-2); font-size: 12px;
}
.atw-info .atw-eyebrow { font-size: 10px; letter-spacing: 1px; color: var(--atw-accent); text-transform: uppercase; font-weight: 700; margin-bottom: 6px; }
.atw-info h2 { margin: 0 0 3px; font-size: 17px; font-weight: 800; }
.atw-info .atw-sub { font-size: 11px; color: var(--atw-text-2); margin-bottom: 14px; }
.atw-info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 12px; }
.atw-info-row:last-of-type { border-bottom: none; }
.atw-info-row .atw-k { color: var(--atw-text-2); }
.atw-info-row .atw-v { color: var(--atw-text-0); font-weight: 600; }
.atw-info-controls { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.atw-btnrow { display: flex; gap: 8px; }
.atw-btn {
	flex: 1; text-align: center; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--atw-panel-border);
	color: var(--atw-text-0); font-family: inherit; font-weight: 500; font-size: 11.5px; padding: 9px 8px; border-radius: 10px; cursor: pointer;
}
.atw-btn:hover { background: rgba(255, 255, 255, 0.14); }
.atw-btn.atw-btn-on { background: var(--atw-accent); color: #06110c; border-color: var(--atw-accent); font-weight: 800; text-shadow: none; }
.atw-btn.atw-btn-danger { background: rgba(255, 77, 77, 0.16); border-color: rgba(255, 77, 77, 0.4); color: #ffc2c2; }

/* ---------------------------------------------------------------- Dashboard aside (left, collapsible) */
.atw-dashboard {
	position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 280px; z-index: 34;
	background: var(--atw-panel); border-inline-end: 1px solid var(--atw-panel-border); backdrop-filter: blur(20px);
	padding: 70px 16px 16px; overflow-y: auto; transform: translateX(-105%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.amir-twin-app[data-twin-dir='rtl'] .atw-dashboard { transform: translateX(105%); }
.atw-dashboard.atw-open { transform: translateX(0); }
.atw-dash-section { margin-bottom: 18px; }
.atw-dash-title { font-size: 10.5px; font-weight: 700; color: var(--atw-text-2); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px; }
.atw-health-wrap { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.atw-health-num { font-size: 30px; font-weight: 800; }
.atw-health-label { font-size: 10.5px; color: var(--atw-text-2); }
.atw-metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.atw-metric { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--atw-panel-border); border-radius: 12px; padding: 10px; }
.atw-metric .atw-metric-label { font-size: 10px; color: var(--atw-text-2); margin-bottom: 4px; }
.atw-metric .atw-metric-val { font-size: 15px; font-weight: 700; }
.atw-alert-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 11.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.atw-alert-item:last-child { border-bottom: none; }
.atw-alert-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.atw-alert-critical .atw-alert-dot { background: var(--atw-red); box-shadow: 0 0 6px var(--atw-red); }
.atw-alert-warning .atw-alert-dot { background: var(--atw-amber); box-shadow: 0 0 6px var(--atw-amber); }
.atw-alert-info .atw-alert-dot { background: var(--atw-accent); }
.atw-alert-text { flex: 1; color: var(--atw-text-1); }
.atw-alert-time { color: var(--atw-text-2); font-size: 10px; }
.atw-empty { font-size: 11px; color: var(--atw-text-2); padding: 6px 0; }
.atw-cam-item { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 11.5px; color: var(--atw-text-1); border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.atw-cam-item:last-child { border-bottom: none; }
.atw-cam-item.atw-cam-offline { color: var(--atw-red); }

/* ---------------------------------------------------------------- Scenario bar (bottom, one-shot actions) */
.atw-scenarios {
	position: absolute; bottom: 18px; inset-inline-end: 210px; inset-inline-start: 256px; z-index: 30;
	display: flex; justify-content: flex-end; gap: 7px; overflow-x: auto; padding: 2px; scrollbar-width: none;
}
.atw-scenarios::-webkit-scrollbar { display: none; }
.atw-scn-btn {
	flex-shrink: 0; background: linear-gradient(180deg, rgba(28, 31, 33, 0.95), rgba(16, 18, 19, 0.95));
	border: 1px solid var(--atw-panel-border); backdrop-filter: blur(14px); color: var(--atw-text-0);
	font-weight: 600; font-size: 11.5px; padding: 10px 16px; border-radius: 100px; cursor: pointer; white-space: nowrap;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06); letter-spacing: 0.2px;
}
.atw-scn-btn:hover { border-color: var(--atw-accent-dim); background: linear-gradient(180deg, rgba(36, 40, 42, 0.95), rgba(20, 23, 24, 0.95)); }
.atw-scn-btn.atw-scn-danger { color: #ffc2c2; border-color: rgba(255, 77, 77, 0.3); }
.atw-scn-btn.atw-scn-danger:hover { border-color: rgba(255, 77, 77, 0.6); background: rgba(255, 77, 77, 0.14); }

/* ---------------------------------------------------------------- AI FAB + chat panel */
.atw-ai-fab {
	position: absolute; bottom: 18px; inset-inline-end: 18px; z-index: 36; display: flex; align-items: center; gap: 8px; cursor: pointer;
	background: linear-gradient(135deg, var(--atw-accent), #00d47f); color: #06110c; padding: 11px 18px 11px 11px; border-radius: 100px;
	box-shadow: 0 12px 30px rgba(0, 255, 150, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.amir-twin-app[data-twin-dir='rtl'] .atw-ai-fab { padding: 11px 11px 11px 18px; }
.atw-ai-fab::after {
	content: ''; position: absolute; inset: -6px; border-radius: 100px; border: 2px solid var(--atw-accent); opacity: 0.5;
	animation: atw-ai-pulse 2.2s ease-out infinite; pointer-events: none;
}
@keyframes atw-ai-pulse { 0% { transform: scale(1); opacity: 0.5; } 100% { transform: scale(1.18); opacity: 0; } }
.atw-ai-fab-circle { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.atw-ai-fab svg { width: 19px; height: 19px; }
.atw-ai-fab-label { font-size: 12px; font-weight: 800; white-space: nowrap; text-shadow: none; }
.atw-ai-fab-label small { display: block; font-size: 9px; font-weight: 600; opacity: 0.75; margin-top: 0; }
.atw-ai-fab.atw-ai-open .atw-ai-fab-label { display: none; }
.atw-ai-fab.atw-ai-open { padding: 11px; }

.atw-ai-panel {
	position: absolute; bottom: 76px; inset-inline-end: 18px; z-index: 36; width: 300px; max-width: calc(100% - 36px);
	height: 380px; max-height: calc(100% - 200px); background: var(--atw-panel); border: 1px solid var(--atw-panel-border);
	backdrop-filter: blur(20px); border-radius: 18px; display: flex; flex-direction: column; overflow: hidden;
	transform: translateY(20px) scale(0.96); opacity: 0; pointer-events: none; transition: 0.25s;
}
.atw-ai-panel.atw-open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }
.atw-ai-head { padding: 13px 16px; border-bottom: 1px solid var(--atw-panel-border); font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: var(--atw-text-0); }
.atw-ai-head .atw-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--atw-accent); }
.atw-ai-head-close { margin-inline-start: auto; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--atw-text-1); font-size: 12px; }
.atw-ai-head-close:hover { color: var(--atw-text-0); background: rgba(255, 255, 255, 0.14); }
.atw-ai-messages { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.atw-ai-msg { font-size: 12px; line-height: 1.8; padding: 9px 12px; border-radius: 12px; max-width: 88%; }
.atw-ai-msg-user { align-self: flex-start; background: var(--atw-accent-glow); color: var(--atw-text-0); border: 1px solid var(--atw-accent-dim); }
.atw-ai-msg-ai { align-self: flex-end; background: rgba(255, 255, 255, 0.05); color: var(--atw-text-1); }
.atw-ai-input-row { display: flex; gap: 7px; padding: 10px; border-top: 1px solid var(--atw-panel-border); }
.atw-ai-input-row input { flex: 1; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--atw-panel-border); border-radius: 100px; padding: 9px 14px; color: var(--atw-text-0); font-family: inherit; font-size: 12px; outline: none; }
.atw-ai-send { width: 36px; height: 36px; border-radius: 50%; background: var(--atw-accent); color: #06110c; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.atw-ai-send svg { width: 15px; height: 15px; }

.atw-hint {
	position: absolute; top: 96px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 22;
	font-size: 10px; color: var(--atw-text-1); background: var(--atw-panel); border: 1px solid var(--atw-panel-border);
	backdrop-filter: blur(14px); padding: 6px 14px; border-radius: 100px; pointer-events: none; white-space: nowrap;
}
.amir-twin-app[data-twin-dir='rtl'] .atw-hint { transform: translateX(50%); }
.atw-credit { position: absolute; bottom: 5px; inset-inline-end: 210px; font-size: 9px; color: var(--atw-text-2); opacity: 0.6; z-index: 18; pointer-events: none; }

@media (max-width: 860px) {
	.atw-hint { display: none; }
	.atw-dashboard { width: 86%; }
}

@media (max-width: 760px) {
	.amir-twin-app { border-radius: 16px; }
	.atw-brand .atw-sub { display: none; }
	.atw-zones {
		inset-inline: 14px; top: auto; bottom: 0; width: auto; max-height: 56%;
		border-radius: 20px 20px 0 0; transform: translateY(105%); transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
	}
	.atw-zones.atw-open { transform: translateY(0); }
	.atw-fab-zones, .atw-fab-dash { display: flex; }
	.atw-dd-row { top: auto; bottom: 70px; inset-inline-end: 14px; inset-inline-start: auto; }
	.atw-dd-label, .atw-radar-toggle-label { display: none; }
	.atw-dd-btn, .atw-radar-toggle { padding: 9px; }
	.atw-radar-panel { inset-inline: 14px; left: 14px; right: 14px; width: auto; top: 106px; }
	.atw-timeline { inset-inline-start: 14px; bottom: 70px; width: 180px; }
	.atw-scenarios { bottom: 18px; inset-inline-end: 70px; inset-inline-start: 14px; justify-content: flex-start; }
	.atw-credit { display: none; }
	.atw-info { inset-inline: 14px; top: auto; bottom: 0; width: auto; max-width: none; border-radius: 20px 20px 0 0; max-height: 66%; transform: translateY(105%); }
	.atw-info.atw-show { transform: translateY(0); }
	.atw-dashboard { width: 100%; top: auto; bottom: 0; height: 70%; border-radius: 20px 20px 0 0; transform: translateY(105%); padding-top: 20px; }
	.atw-dashboard.atw-open { transform: translateY(0); }
	.atw-ai-panel { inset-inline: 14px; width: auto; bottom: 76px; }
	.atw-ai-fab-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.atw-ring { animation: none; }
}
