/*
 * Be AI Intelligence Platform - skin
 * Loaded after app.css. Turns the shared engine into the Be AI look:
 * an ink control-plane sidebar, a bone canvas, Fraunces for page titles,
 * Manrope for everything you operate, orange for action and AI,
 * green only for "good", and the six 6D stage colours as wayfinding.
 */

body { font-family: var(--f-ui); font-size: 14.2px; }
h1, h2 { font-family: var(--f-display); font-weight: 600; letter-spacing: -.015em; }
h3, h4 { font-family: var(--f-ui); }
.ph h1, .ph h2.as-h1 { font-weight: 600; font-size: clamp(24px, 2.1vw, 31px); }
.ch h3 { font-weight: 700; font-size: 14.8px; }
.kpi .k-val { font-family: var(--f-ui); font-weight: 800; letter-spacing: -.025em; }
.mtile .mt-top b, .cp-h b, .tenant-pill .t-name, .plan-card b { font-family: var(--f-ui); font-weight: 700; }
.price-tag, .mtile .mt-stat b, .radar-box .rb-v b, .donut-center { font-family: var(--f-ui); }

/* Light canvas: calm, warm, a whisper of orange at the top */
[data-theme="light"] .aurora {
	background:
		radial-gradient(1100px 520px at 18% -12%, rgba(216, 70, 38, .07), transparent 60%),
		radial-gradient(900px 600px at 105% 0%, rgba(150, 190, 26, .06), transparent 60%),
		var(--bg);
}
[data-theme="light"] .aurora::before, [data-theme="light"] .aurora::after { opacity: .06; }
[data-theme="dark"] .aurora {
	background:
		radial-gradient(1100px 600px at 12% -10%, rgba(216, 70, 38, .16), transparent 60%),
		radial-gradient(900px 600px at 105% 10%, rgba(150, 190, 26, .07), transparent 60%),
		linear-gradient(180deg, var(--bg-2), var(--bg) 55%);
}
.aurora .grid { opacity: .7; }

/* ---------- The control plane: an ink sidebar in both themes ---------- */
.side, .side[class] {
	--text: #F7F3EC; --text-2: #E2D9CD; --muted: #B3A89B; --faint: #9C9084;
	--glass: rgba(255, 244, 232, .05); --glass-2: rgba(255, 244, 232, .08); --glass-3: rgba(255, 244, 232, .12);
	--stroke: rgba(255, 236, 220, .09); --stroke-2: rgba(255, 236, 220, .16);
	--accent-t: #F0805F; --focus: #FFD9C9;
	background: linear-gradient(180deg, #1B1511 0%, #14100D 100%) !important;
	color: var(--text);
	border-right: 1px solid rgba(0, 0, 0, .25);
}
.side .brand { padding-bottom: 12px; }
.side .brand img.logo-full { height: 30px; }
.side .brand .portal-tag { color: #F0805F; border-color: rgba(240, 128, 95, .35); font-size: 9.5px; letter-spacing: .12em; line-height: 1.25; text-align: center; max-width: 92px; white-space: normal; padding: 4px 6px; }
.nav a { font-size: 13.4px; padding: 7px 10px; }
.nav a .n-ic { width: 28px; height: 28px; border-radius: 8px; }
.nav a.on { background: linear-gradient(90deg, rgba(216, 70, 38, .22), rgba(216, 70, 38, 0) 85%) !important; }
.nav .n-sig { margin-left: auto; color: #F3C866; opacity: .85; display: inline-flex; }
.nav .n-sig .ic { width: 13px; height: 13px; }
.app.side-min .nav .n-sig { display: none; }
.nav-cap { padding: 13px 10px 6px; }
.stage-cap { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.stage-cap .sc-n {
	width: 18px; height: 18px; border-radius: 6px; display: inline-grid; place-items: center;
	font: 700 10.5px/1 var(--f-mono); color: #fff; background: var(--sc); letter-spacing: 0;
}
.app.side-min .stage-cap .sc-n { display: none; }
.plan-card { background: linear-gradient(140deg, rgba(216, 70, 38, .16), rgba(255, 244, 232, .03)); }
.sd-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin-top: 9px; }
.sd-strip i { height: 4px; border-radius: 3px; }

/* top bar */
[data-theme="light"] .top { background: rgba(251, 249, 245, .82); }
[data-theme="dark"] .top { background: rgba(20, 16, 13, .72); }
/* phone and tablet: the product name sits beside the logo, as it does in the sidebar */
.top .m-brand .portal-tag { display: none; }
@media (max-width: 899px) {
	.top .m-brand .portal-tag {
		display: inline-block; font: 600 9.5px/1.25 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
		color: var(--accent-t); border: 1px solid rgba(198, 60, 30, .32); border-radius: 6px;
		padding: 4px 6px; max-width: 92px; white-space: normal; text-align: center;
	}
	[data-theme="dark"] .top .m-brand .portal-tag { border-color: rgba(240, 128, 95, .35); }
}
@media (max-width: 339px) { .top .m-brand .portal-tag { display: none; } }
.demo-strip { background: linear-gradient(90deg, rgba(216, 70, 38, .08), rgba(150, 190, 26, .07)); }

/* buttons: orange with white labels (5:1 on the deep fill), green only for good */
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 10px 24px -14px rgba(198, 60, 30, .9); }
.btn.primary:hover { background: #B03418; }
[data-theme="dark"] .btn.primary:hover { background: #E35A3A; }
.btn.ai, .link.ai, .pill.ai, .msg.ai .who, .msg .cite, .cp-sug button { color: var(--accent-t); }
.btn.ai { border-color: rgba(216, 70, 38, .45); background: rgba(216, 70, 38, .07); }
.pill.ok { border-color: rgba(39, 116, 46, .3); background: rgba(39, 116, 46, .09); }
.sev.low { background: rgba(79, 138, 60, .12); border-color: rgba(79, 138, 60, .28); }
.sev.info { background: rgba(124, 138, 147, .14); border-color: rgba(124, 138, 147, .3); }
.delta.up-good, .delta.down-good { background: rgba(39, 116, 46, .12); }
.live { color: var(--t-low); border-color: rgba(39, 116, 46, .35); background: rgba(39, 116, 46, .08); }
.live i { background: #3E9A47; animation-name: pulse-g; }
@keyframes pulse-g { 0% { box-shadow: 0 0 0 0 rgba(62, 154, 71, .6); } 70% { box-shadow: 0 0 0 8px rgba(62, 154, 71, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 154, 71, 0); } }
.card.tint-ai { background: linear-gradient(150deg, rgba(216, 70, 38, .09), rgba(255, 255, 255, 0)); border-color: rgba(216, 70, 38, .22); }
[data-theme="light"] .card { background: rgba(255, 255, 255, .86); }

/* ---------- Night cards: the operations rail in the reference layout ---------- */
.card.night {
	--text: #F7F3EC; --text-2: #E2D9CD; --muted: #B3A89B; --faint: #A2968A;
	--glass: rgba(255, 244, 232, .05); --glass-2: rgba(255, 244, 232, .08); --glass-3: rgba(255, 244, 232, .12);
	--stroke: rgba(255, 236, 220, .10); --stroke-2: rgba(255, 236, 220, .18); --accent-t: #F0805F;
	--t-crit: #F28B82; --t-high: #F5A06B; --t-med: #F3C866; --t-low: #9FCB7E; --t-info: #B7C2C9; --grid-line: rgba(255, 236, 220, .07);
	background: linear-gradient(165deg, #241C17, #17120F 70%) !important; color: var(--text); border-color: rgba(0, 0, 0, .2);
}
[data-theme="dark"] .card.night { background: linear-gradient(165deg, #2D241E, #1B1511 70%) !important; border-color: var(--stroke-2); }
.card.night .chart text { fill: #B3A89B; }

/* ---------- Control Tower hero ---------- */
.tower {
	position: relative; overflow: hidden; border-radius: var(--r-xl);
	background:
		radial-gradient(600px 300px at 78% 50%, rgba(216, 70, 38, .28), transparent 65%),
		linear-gradient(120deg, #1B1511 0%, #17120F 55%, #241A14 100%);
	color: #F7F3EC; border: 1px solid rgba(0, 0, 0, .25);
	box-shadow: 0 30px 60px -36px rgba(25, 21, 18, .7);
}
.tower .tower-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tower-in { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) clamp(220px, 30%, 440px); gap: 22px; padding: clamp(18px, 2.2vw, 28px) clamp(18px, 2.4vw, 32px) 16px; align-items: center; }
.tower-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.tower-space { min-height: 230px; }
.tw-eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: #F0805F; margin-bottom: 10px; }
.tw-eyebrow .pip { width: 7px; height: 7px; border-radius: 50%; background: #F0805F; box-shadow: 0 0 0 4px rgba(240, 128, 95, .18); }
.tower h1 { font-size: clamp(26px, 2.6vw, 38px); color: #fff; margin-bottom: 8px; }
.tower p { color: #E2D9CD; max-width: 60ch; font-size: 14.5px; }
.tw-acts { margin-top: 16px; gap: 8px; }
.btn.tw-ghost { background: rgba(255, 244, 232, .07); border-color: rgba(255, 236, 220, .22); color: #F7F3EC; }
.btn.tw-ghost:hover { background: rgba(255, 244, 232, .14); border-color: rgba(255, 236, 220, .4); }
.tower-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 860px; }
.tw-stat { padding: 12px 14px; border-radius: 14px; background: rgba(20, 16, 13, .55); border: 1px solid rgba(255, 236, 220, .12); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); min-width: 0; }
.tw-stat b { display: block; font: 800 24px/1.05 var(--f-ui); letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; }
.tw-stat b small { font-size: .55em; color: #B3A89B; font-weight: 600; margin-left: 2px; }
.tw-stat span { display: block; font-size: 12.3px; color: #E2D9CD; margin-top: 4px; font-weight: 600; }
.tw-stat em { display: block; font-style: normal; font-size: 11.5px; color: #B3A89B; margin-top: 1px; }
.tower-status { position: relative; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; padding: 10px clamp(18px, 2.4vw, 32px) 14px; border-top: 1px solid rgba(255, 236, 220, .08); font-size: 12px; color: #B3A89B; }
.tower-status .live { color: #9FCB7E; border-color: rgba(159, 203, 126, .35); background: rgba(159, 203, 126, .08); }

/* value row under the chart */
.val-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--stroke); }
.val-row b { display: block; font: 800 18px/1.1 var(--f-ui); font-variant-numeric: tabular-nums; }
.val-row span { font-size: 12px; color: var(--muted); }

/* next best action */
.card.nba { background: linear-gradient(160deg, rgba(216, 70, 38, .10), rgba(255, 255, 255, .0) 60%), var(--glass); border-color: rgba(216, 70, 38, .25); }
.nba-main { padding: 4px 0 12px; border-bottom: 1px solid var(--stroke); margin-bottom: 4px; }
.nba-main h4 { font-size: 17px; font-weight: 700; margin: 10px 0 6px; line-height: 1.3; }
.nba-main p { color: var(--text-2); font-size: 13.4px; margin-bottom: 12px; }
.nba-stage { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.nba-stage::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--sc); }

/* 6D journey strip */
.stage-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--gap); }
.stage-tile {
	display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 13px 14px; border-radius: var(--r-lg);
	background: var(--glass); border: 1px solid var(--stroke); border-top: 3px solid var(--sc); box-shadow: var(--hl), var(--shadow);
	transition: transform .2s var(--ease), border-color .2s;
}
[data-theme="light"] .stage-tile { background: rgba(255, 255, 255, .86); }
.stage-tile:hover { transform: translateY(-2px); border-color: var(--stroke-2); border-top-color: var(--sc); }
.st-top { display: flex; align-items: center; gap: 8px; }
.st-top b { font-size: 14px; }
.st-top .pill { margin-left: auto; height: 20px; font-size: 10.5px; padding: 0 7px; }
.st-n { width: 22px; height: 22px; border-radius: 7px; display: inline-grid; place-items: center; background: var(--sc); color: #fff; font: 700 11.5px/1 var(--f-mono); }
.st-v { font: 800 16px/1.2 var(--f-ui); margin-top: 2px; }
.st-s { font-size: 12px; color: var(--muted); min-height: 30px; }
.st-next { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--accent-t); font-weight: 600; margin-top: 2px; }
.st-next .ic { width: 13px; height: 13px; }

/* fleet, approvals, risk */
.risk-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.li.hitl { align-items: flex-start; }
.risk-wrap { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 14px; align-items: center; }
.feed-tl { display: flex; flex-direction: column; }
.ft-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--stroke); position: relative; }
.ft-row:last-child { border-bottom: 0; }
.ft-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--fc); margin-top: 4px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .04); }
.ft-main b { display: block; font-size: 13.4px; font-weight: 700; }
.ft-main span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft-r { text-align: right; font-size: 11.5px; color: var(--faint); display: flex; flex-direction: column; gap: 3px; }
.ft-res { font-weight: 700; }
.card.team b { font-size: 15px; display: block; }
.card.team .grow span { font-size: 12.3px; color: var(--muted); }

/* stage pill colours for workspaces that tag items by stage */
.stage-chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 7px; font: 600 11px/1 var(--f-mono); background: var(--glass-2); border: 1px solid var(--stroke); color: var(--text-2); }
.stage-chip::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--sc, var(--accent)); }

@media (max-width: 1240px) {
	.stage-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.tower-in { grid-template-columns: minmax(0, 1fr) 160px; }
	.tower-space { min-height: 160px; }
}
@media (max-width: 1100px) {
	.tower-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.tower-in { grid-template-columns: minmax(0, 1fr); }
	.tower-space { display: none; }
	.tower .tower-fx { opacity: .45; }
	.val-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stage-strip.swipe { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; scrollbar-width: none; }
	.stage-strip.swipe::-webkit-scrollbar { display: none; }
	.stage-strip.swipe .stage-tile { flex: 0 0 72%; scroll-snap-align: start; }
	.risk-wrap { grid-template-columns: 120px minmax(0, 1fr); }
	.tower h1 { font-size: 25px; }
}
@media (prefers-reduced-motion: reduce) { .stage-tile { transition: none; } }
@media (max-width: 640px) {
	.tw-acts .btn { height: 36px; padding: 0 12px; font-size: 13px; }
	.tw-acts .btn:last-child { display: none; }
	.tower p { font-size: 14px; }
	.tw-stat b { font-size: 21px; }
	.tower-status { font-size: 11.5px; }
}

/* Framework alignment strip on the Control Tower */
.fw-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--gap); }
.fw-tile { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 13px 14px; border-radius: var(--r-lg); background: var(--glass); border: 1px solid var(--stroke); box-shadow: var(--hl), var(--shadow); transition: transform .2s var(--ease), border-color .2s; }
[data-theme="light"] .fw-tile { background: rgba(255, 255, 255, .86); }
.fw-tile:hover { transform: translateY(-2px); border-color: var(--stroke-2); }
.fw-tile b { font-size: 13.6px; }
.fw-tile .mono { font: 800 17px/1 var(--f-ui); }
.fw-s { font-size: 12px; color: var(--muted); }
.fw-n { font-size: 12px; color: var(--accent-t); font-weight: 600; line-height: 1.35; }
.nist-grid .li-s { font-size: 12px; }
@media (max-width: 1240px) { .fw-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
	.fw-strip.swipe { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -14px; padding: 0 14px 6px; scrollbar-width: none; }
	.fw-strip.swipe::-webkit-scrollbar { display: none; }
	.fw-strip.swipe .fw-tile { flex: 0 0 70%; scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) { .fw-tile { transition: none; } }
/* long values in list rows wrap instead of pushing past the card */
.li .li-r { flex-wrap: wrap; justify-content: flex-end; }
.li .li-r b.mono { white-space: normal; text-align: right; max-width: 280px; }
.row-wrap .tag { white-space: normal; height: auto; min-height: 22px; padding-top: 3px; padding-bottom: 3px; line-height: 1.3; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
@media (max-width: 560px) {
	.li { flex-wrap: wrap; row-gap: 6px; }
	.li .li-main { flex: 1 1 calc(100% - 60px); }
	.li .li-ic ~ .li-r { margin-left: 48px; max-width: calc(100% - 48px); }
	.li .li-r { justify-content: flex-start; max-width: 100%; }
	.li .li-r b.mono { text-align: left; }
}
/* menus and selects inside night cards open on a dark surface */
.card.night { --solid: #1E1814; --solid-2: #261F1A; }
