:root {
  --black: #05070b;
  --ink: #080b10;
  --panel: #0f151e;
  --panel-raised: #141c27;
  --panel-blue: #101d32;
  --blue: #214fc6;
  --dodger: #1e90ff;
  --cyan: #00bfff;
  --alice: #f0f8ff;
  --steel: #b0c4de;
  --slate: #708090;
  --line: rgba(176, 196, 222, .16);
  --soft-line: rgba(176, 196, 222, .08);
  --good: #56d39b;
  --warn: #f0b85b;
  --danger: #ff7d8a;
  --display: "Outfit", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ink); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--ink); color: var(--alice); font-family: var(--body); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-150%); border-radius: 6px; background: var(--alice); color: #141414; padding: 10px 14px; font-weight: 600; text-decoration: none; }
.skip-link:focus { transform: none; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.demo-notice {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: linear-gradient(90deg, #163b99, var(--blue), #197ba7);
  color: white;
  padding: 7px 20px;
  font-size: 12px;
}
.demo-notice span { display: inline-flex; align-items: center; gap: 7px; }
.demo-notice i { width: 7px; height: 7px; border-radius: 50%; background: #57f28c; box-shadow: 0 0 12px rgba(87,242,140,.8); }
.demo-notice strong { font-weight: 600; }

.demo-shell { min-height: calc(100vh - 36px); }
.demo-topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  min-height: 66px;
  grid-template-columns: auto minmax(260px, 580px) auto;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,11,16,.94);
  padding: 0 24px;
  backdrop-filter: blur(18px);
}
.demo-brand { display: inline-flex; min-width: 226px; align-items: center; gap: 11px; text-decoration: none; }
.demo-brand img { width: 27px; height: 27px; object-fit: contain; }
.demo-brand span { border-left: 1px solid var(--line); padding-left: 13px; font-family: var(--display); font-size: 21px; font-weight: 500; }
.demo-brand em { border: 1px solid rgba(0,191,255,.3); border-radius: 99px; background: rgba(0,191,255,.08); color: #8ee3ff; padding: 4px 8px; font-size: 10px; font-style: normal; letter-spacing: .08em; text-transform: uppercase; }
.menu-button { display: none; }
.demo-search-wrap { position: relative; width: 100%; max-width: 580px; justify-self: center; }
.demo-search-wrap input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.025); color: var(--alice); padding: 0 46px 0 14px; outline: none; }
.demo-search-wrap input::placeholder { color: #6f7e91; }
.demo-search-wrap input:focus { border-color: rgba(0,191,255,.55); box-shadow: 0 0 0 3px rgba(0,191,255,.08); }
.demo-search-wrap kbd { position: absolute; top: 8px; right: 9px; display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--slate); font-family: var(--body); font-size: 11px; }
.search-results { position: absolute; z-index: 50; top: calc(100% + 8px); right: 0; left: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #111822; padding: 6px; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.search-result { display: grid; width: 100%; grid-template-columns: 1fr auto; gap: 5px 16px; border: 0; border-radius: 6px; background: transparent; padding: 10px 11px; text-align: left; cursor: pointer; }
.search-result:hover, .search-result:focus-visible { background: rgba(33,79,198,.2); }
.search-result strong { font-size: 13px; }
.search-result span { grid-column: 1; overflow: hidden; color: var(--slate); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.search-result em { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--cyan); font-size: 10px; font-style: normal; text-transform: uppercase; }
.search-empty { margin: 0; color: var(--slate); padding: 14px; font-size: 12px; text-align: center; }
.topbar-actions { display: flex; align-items: center; justify-self: end; gap: 16px; }
.snapshot-label { color: var(--slate); font-size: 11px; white-space: nowrap; }
.exit-demo { display: inline-flex; min-height: 36px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 0 13px; color: var(--steel); font-size: 12px; text-decoration: none; }
.exit-demo:hover { border-color: rgba(0,191,255,.42); color: white; }

.demo-layout { display: grid; min-height: calc(100vh - 102px); grid-template-columns: 248px minmax(0, 1fr); }
.demo-sidebar { position: sticky; top: 66px; display: flex; height: calc(100vh - 102px); min-height: 560px; flex-direction: column; border-right: 1px solid var(--line); background: #090d13; padding: 20px 13px 16px; }
.organisation-card { display: grid; gap: 4px; margin: 0 4px 20px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(145deg,rgba(33,79,198,.19),rgba(0,191,255,.035)); padding: 14px; }
.organisation-card span { color: #7bbcff; font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.organisation-card strong { font-family: var(--display); font-size: 15px; font-weight: 500; }
.organisation-card small { color: var(--slate); font-size: 10px; line-height: 1.35; }
.nav-group { margin-top: 16px; }
.nav-group:first-child { margin-top: 0; }
.nav-group > span { display: block; padding: 0 10px 6px; color: #566477; font-size: 9px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.nav-item { display: flex; width: 100%; min-height: 36px; align-items: center; gap: 9px; border: 0; border-radius: 6px; background: transparent; color: #7f8fa4; padding: 0 10px; cursor: pointer; font-size: 12px; text-align: left; }
.nav-item::before { content: ""; width: 8px; height: 8px; flex: 0 0 auto; border: 1px solid currentColor; border-radius: 2px; opacity: .7; }
.nav-item:hover { background: rgba(255,255,255,.035); color: #bfd0e2; }
.nav-item.is-active { background: rgba(33,79,198,.28); color: #eef6ff; }
.nav-item.is-active::before { border-color: var(--cyan); background: rgba(0,191,255,.28); box-shadow: 0 0 10px rgba(0,191,255,.25); }
.sidebar-safety { display: flex; align-items: flex-start; gap: 10px; margin-top: auto; border-top: 1px solid var(--line); padding: 16px 8px 2px; }
.sidebar-safety > i { width: 9px; height: 9px; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; background: var(--good); }
.sidebar-safety div { display: grid; gap: 2px; }
.sidebar-safety strong { color: #aebfd1; font-size: 10px; }
.sidebar-safety span { color: #59687a; font-size: 9px; line-height: 1.4; }
.sidebar-backdrop { display: none; }

.demo-workspace { min-width: 0; padding: 20px clamp(20px, 3vw, 44px) 0; background-color: #0a0f16; background-image: radial-gradient(rgba(33,79,198,.13) .6px, transparent .6px); background-size: 15px 15px; }
.workspace-breadcrumb { display: flex; align-items: center; gap: 8px; color: #5e6d80; font-size: 10px; }
.workspace-breadcrumb i { color: #384555; font-style: normal; }
.workspace-breadcrumb strong { color: #91a2b7; font-weight: 500; }
.module-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-top: 22px; }
.module-heading > div:first-child { max-width: 850px; }
.module-heading p { margin: 0 0 7px; color: var(--cyan); font-size: 10px; font-weight: 600; letter-spacing: .11em; text-transform: uppercase; }
.module-heading h1 { margin: 0; font-family: var(--display); font-size: clamp(28px,3vw,46px); font-weight: 500; line-height: 1.02; letter-spacing: -.025em; }
.module-heading > div:first-child > span { display: block; max-width: 760px; margin-top: 9px; color: #8494a8; font-size: 13px; line-height: 1.5; }
.module-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }
.json-badge { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; border: 1px solid rgba(0,191,255,.2); border-radius: 99px; background: rgba(0,191,255,.05); color: #8bcde4; padding: 0 12px; font-size: 10px; letter-spacing: .05em; text-transform: uppercase; }
.json-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }
.secondary-action, .primary-action { min-height: 36px; border-radius: 6px; padding: 0 13px; cursor: pointer; font-size: 11px; font-weight: 600; }
.secondary-action { border: 1px solid var(--line); background: var(--panel); color: #adbed1; }
.secondary-action:hover { border-color: rgba(0,191,255,.4); color: white; }
.primary-action { border: 1px solid var(--blue); background: var(--blue); color: white; }

.module-tabs { display: flex; overflow-x: auto; gap: 18px; margin-top: 26px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.module-tabs::-webkit-scrollbar { display: none; }
.module-tab { min-height: 38px; flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #6f8095; padding: 0 1px; cursor: pointer; font-size: 11px; }
.module-tab:hover { color: #b4c5d7; }
.module-tab.is-active { border-bottom-color: var(--cyan); color: #eef6ff; }
.view-note { min-height: 17px; margin: 8px 0 0; color: #607187; font-size: 10px; }
.metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-top: 15px; }
.metric-card { display: grid; min-width: 0; gap: 4px; border: 1px solid var(--line); border-radius: 8px; background: rgba(15,21,30,.94); padding: 13px 14px; }
.metric-card > span { overflow: hidden; color: #66778b; font-size: 9px; font-weight: 600; letter-spacing: .08em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.metric-card strong { overflow: hidden; font-family: var(--display); font-size: clamp(18px,2vw,26px); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.metric-card small { overflow: hidden; color: #68798e; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.metric-card.is-good { border-color: rgba(86,211,155,.3); }
.metric-card.is-blue { border-color: rgba(0,191,255,.28); }
.metric-card.is-warn { border-color: rgba(240,184,91,.3); }
.module-content { display: grid; gap: 11px; margin-top: 11px; }
.content-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: rgba(15,21,30,.95); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 48px; border-bottom: 1px solid var(--soft-line); padding: 0 15px; }
.panel-heading div { display: grid; gap: 2px; }
.panel-heading span { color: var(--cyan); font-size: 8px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.panel-heading strong { font-size: 12px; font-weight: 500; }
.panel-heading small { color: #65768a; font-size: 9px; }

.scenario-switch { display: flex; gap: 4px; }
.scenario-button { min-height: 27px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: #6f8095; padding: 0 9px; cursor: pointer; font-size: 9px; }
.scenario-button.is-active { border-color: rgba(0,191,255,.35); background: rgba(0,191,255,.08); color: #dff7ff; }
.forecast-chart { display: grid; height: 210px; grid-template-columns: repeat(12,1fr); align-items: end; gap: 8px; padding: 20px 18px 13px; }
.forecast-bar { display: grid; height: 100%; grid-template-rows: 1fr auto; align-items: end; gap: 8px; }
.forecast-bar i { display: block; height: var(--bar-height); min-height: 10px; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg,var(--cyan),var(--blue)); box-shadow: 0 0 18px rgba(0,191,255,.08); }
.forecast-bar:nth-last-child(-n+6) i { background: repeating-linear-gradient(135deg,rgba(0,191,255,.85) 0 3px,rgba(33,79,198,.38) 3px 6px); }
.forecast-bar span { color: #5c6c80; font-size: 8px; text-align: center; }

.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; min-width: 760px; border-collapse: collapse; }
.data-table th { height: 36px; border-bottom: 1px solid var(--soft-line); color: #617287; padding: 0 14px; font-size: 8px; font-weight: 600; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { height: 42px; border-bottom: 1px solid var(--soft-line); color: #8fa0b5; padding: 0 14px; font-size: 10px; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td:first-child { color: #e4edf7; font-weight: 500; }
.table-status { display: inline-flex; align-items: center; gap: 6px; }
.table-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--slate); }
.table-status.is-good::before { background: var(--good); }
.table-status.is-blue::before { background: var(--cyan); }
.table-status.is-warn::before { background: var(--warn); }
.content-highlight { display: grid; gap: 5px; border: 1px solid rgba(0,191,255,.21); border-radius: 8px; background: linear-gradient(105deg,rgba(33,79,198,.22),rgba(0,191,255,.045)); padding: 15px 17px; }
.content-highlight > span { color: var(--cyan); font-size: 8px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.content-highlight strong { font-family: var(--display); font-size: 17px; font-weight: 500; }
.content-highlight small { color: #74859a; font-size: 10px; }

.demo-board { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 11px; }
.board-column { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: rgba(15,21,30,.9); padding: 11px; }
.board-column-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: #bdccdc; font-size: 11px; }
.board-column-head span { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: rgba(0,191,255,.1); color: #81dbfb; font-size: 9px; }
.board-card { display: grid; gap: 8px; margin-top: 8px; border: 1px solid rgba(176,196,222,.13); border-radius: 7px; background: var(--panel-raised); padding: 12px; }
.board-card strong { font-size: 12px; font-weight: 500; }
.board-card > span { color: #7d8ea3; font-size: 10px; }
.board-card div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.board-card em { border-radius: 99px; background: rgba(33,79,198,.25); color: #9bc1ff; padding: 4px 7px; font-size: 8px; font-style: normal; }
.board-card small { color: #607185; font-size: 8px; }

.control-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.control-card { display: grid; min-width: 0; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 11px; }
.control-card > b { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: rgba(33,79,198,.22); color: #91b7fa; font-size: 9px; }
.control-card div { display: grid; min-width: 0; gap: 2px; }
.control-card strong { overflow: hidden; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.control-card small { overflow: hidden; color: #6b7c91; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { border-radius: 99px; background: rgba(112,128,144,.14); color: #92a2b4; padding: 5px 8px; font-size: 8px; white-space: nowrap; }
.status-pill.is-good { background: rgba(86,211,155,.1); color: #79d9af; }
.status-pill.is-blue { background: rgba(0,191,255,.1); color: #76ddff; }
.status-pill.is-warn { background: rgba(240,184,91,.1); color: #e8bd77; }

.provider-grid, .machine-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.provider-card, .machine-card { display: grid; min-width: 0; gap: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); padding: 13px; }
.provider-card > span, .machine-card > span { color: #8293a7; font-size: 10px; }
.provider-card strong, .machine-card strong { overflow: hidden; font-family: var(--display); font-size: 19px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.provider-card small, .machine-card small { color: #65768b; font-size: 8px; }
.provider-meter { height: 4px; overflow: hidden; margin-top: 5px; border-radius: 99px; background: rgba(176,196,222,.1); }
.provider-meter i { display: block; width: var(--meter-width); height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--blue),var(--cyan)); }
.machine-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.machine-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.machine-card header span { display: inline-flex; align-items: center; gap: 6px; color: #91a2b6; font-size: 9px; }
.machine-card header span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.machine-card em { color: var(--cyan); font-size: 9px; font-style: normal; }

.demo-footer { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; border-top: 1px solid var(--line); color: #536174; }
.demo-footer p { margin: 0; font-size: 9px; }
.demo-footer a { display: inline-flex; align-items: center; gap: 7px; color: #8495a8; font-size: 10px; text-decoration: none; }
.demo-footer a:hover { color: white; }
.demo-footer img { width: 17px; height: 17px; }

.about-dialog { width: min(520px,calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 12px; background: #111822; color: var(--alice); padding: 0; box-shadow: 0 28px 100px rgba(0,0,0,.7); }
.about-dialog::backdrop { background: rgba(2,4,8,.78); backdrop-filter: blur(4px); }
.about-dialog form { padding: 28px; }
.dialog-mark { display: flex; align-items: center; gap: 8px; color: #8ea0b5; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.dialog-mark img { width: 22px; height: 22px; }
.about-dialog h2 { margin: 20px 0 12px; font-family: var(--display); font-size: 31px; font-weight: 500; line-height: 1.05; }
.about-dialog p { color: #93a3b6; font-size: 13px; line-height: 1.6; }
.about-dialog ul { display: grid; gap: 8px; margin: 18px 0 24px; color: #7f90a4; padding-left: 18px; font-size: 11px; }
.about-dialog .primary-action { width: 100%; }
.demo-loading { position: fixed; z-index: 80; inset: 36px 0 0; display: grid; place-content: center; gap: 14px; background: #080b10; color: #9cafc3; text-align: center; transition: opacity .25s ease, visibility .25s ease; }
.demo-loading.is-hidden { opacity: 0; visibility: hidden; }
.demo-loading span { width: 36px; height: 36px; justify-self: center; border: 2px solid rgba(0,191,255,.15); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
.demo-loading strong { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.no-script { position: fixed; z-index: 100; right: 20px; bottom: 20px; left: 20px; border: 1px solid var(--danger); border-radius: 8px; background: #201116; color: white; padding: 16px; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .demo-topbar { grid-template-columns: auto minmax(200px,1fr) auto; gap: 16px; }
  .demo-brand { min-width: 190px; }
  .snapshot-label { display: none; }
  .demo-layout { grid-template-columns: 220px minmax(0,1fr); }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .machine-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .demo-notice { justify-content: space-between; gap: 8px; font-size: 10px; }
  .demo-notice span:last-child { display: none; }
  .demo-topbar { grid-template-columns: auto auto minmax(0,1fr) auto; padding: 0 14px; }
  .menu-button { display: grid; width: 36px; height: 36px; place-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 6px; background: transparent; cursor: pointer; }
  .menu-button i { display: block; width: 15px; height: 1px; background: var(--steel); }
  .demo-brand { min-width: 0; }
  .demo-brand em { display: none; }
  .demo-search-wrap { grid-column: 3; }
  .exit-demo { min-height: 34px; padding: 0 10px; }
  .demo-layout { grid-template-columns: 1fr; }
  .demo-sidebar { position: fixed; z-index: 45; top: 102px; bottom: 0; left: 0; width: min(290px,84vw); height: auto; min-height: 0; transform: translateX(-105%); box-shadow: 24px 0 60px rgba(0,0,0,.55); transition: transform .2s ease; }
  .demo-sidebar.is-open { transform: none; }
  .sidebar-backdrop { position: fixed; z-index: 40; inset: 102px 0 0; display: block; border: 0; background: rgba(1,3,7,.72); }
  .sidebar-backdrop[hidden] { display: none; }
  .demo-workspace { padding-inline: 18px; }
  .module-heading { align-items: flex-start; }
  .json-badge { display: none; }
  .demo-board { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .demo-notice { padding-inline: 12px; }
  .demo-topbar { min-height: 60px; grid-template-columns: auto 1fr auto; }
  .demo-search-wrap { grid-column: 1 / -1; grid-row: 2; max-width: none; margin-bottom: 10px; }
  .demo-topbar { padding-bottom: 10px; }
  .demo-brand { justify-self: start; }
  .demo-brand span { font-size: 18px; }
  .topbar-actions { grid-column: 3; grid-row: 1; }
  .demo-sidebar { top: 148px; }
  .sidebar-backdrop { inset-block-start: 148px; }
  .module-heading { display: grid; margin-top: 18px; }
  .module-actions { justify-content: space-between; }
  .module-heading h1 { font-size: 32px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .metric-card { padding: 11px; }
  .metric-card strong { font-size: 19px; }
  .forecast-chart { height: 150px; gap: 4px; padding-inline: 10px; }
  .forecast-bar span { transform: rotate(-45deg); transform-origin: center; }
  .control-grid, .provider-grid, .machine-grid { grid-template-columns: 1fr; }
  .control-card { grid-template-columns: auto minmax(0,1fr); }
  .control-card .status-pill { grid-column: 2; justify-self: start; }
  .demo-footer { align-items: flex-start; flex-direction: column; padding-block: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
