:root {
  color-scheme: dark;
  --bg: #080d13;
  --surface: #101923;
  --surface2: #141f2a;
  --surface3: #1a2935;
  --line: #263641;
  --line-strong: #344854;
  --text: #f0f5f6;
  --muted: #a5b7c0;
  --subtle: #8297a2;
  --mint: #59dbbc;
  --mint-soft: rgba(89,219,188,.11);
  --warning: #efd397;
  --side-width: 246px;
  font-family: Arial, Helvetica, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body { min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a:focus-visible, button:focus-visible, select:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 19px; height: 19px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-shell { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-width); min-height: 100vh; }
.app-shell.is-collapsed { --side-width: 78px; }
.workspace { min-width: 0; min-height: 100vh; display: flex; flex-direction: column; grid-column: 1; grid-row: 1; }
.topbar { height: 100px; border-bottom: 1px solid #1b2935; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 18px clamp(25px, 4.5vw, 68px); }
.brand img { display: block; max-width: min(220px, 33vw); height: auto; }
.topbar-right { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.environment-dot { border-radius: 50%; width: 7px; height: 7px; background: var(--mint); box-shadow: 0 0 0 5px rgba(89,219,188,.09); }
.workspace-inner { width: 100%; max-width: 1600px; margin: 0 auto; flex: 1; padding: 29px clamp(25px, 4.5vw, 68px) 72px; }
.preview-banner { display: flex; align-items: center; gap: 10px; background: rgba(89,219,188,.06); border: 1px solid #2a524b; border-radius: 10px; color: #b9dacf; padding: 13px 17px; font-size: 12px; margin-bottom: 36px; }
.preview-banner .icon { color: var(--mint); width: 17px; height: 17px; }
.preview-banner strong { color: #d9f7e9; }
.footer { padding: 19px clamp(25px, 4.5vw, 68px); border-top: 1px solid #1b2935; display: flex; justify-content: space-between; gap: 12px; color: #8297a2; font-size: 10px; letter-spacing: .06em; }
.sidebar { grid-column: 2; grid-row: 1; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 30px 14px 22px; background: #101820; border-left: 1px solid #25343e; min-width: 0; }
.sidebar-top { border-bottom: 1px solid var(--line); padding: 0 7px 22px; }
.sidebar-heading { display: flex; align-items: center; height: 34px; color: var(--subtle); font-size: 10px; font-weight: bold; letter-spacing: .15em; white-space: nowrap; padding: 0 11px; }
.sidebar-compact-logo { display: none; background: var(--mint); color: #083229; width: 30px; height: 30px; border-radius: 9px; font-size: 17px; letter-spacing: -.08em; align-items: center; justify-content: center; }
.menu-toggle { display: flex; align-items: center; gap: 14px; margin-top: 14px; border: 1px solid var(--line); color: #c2d3da; border-radius: 10px; width: 100%; min-height: 43px; padding: 10px 13px; background: #15232d; font-size: 12px; font-weight: bold; text-align: left; }
.menu-toggle:hover { color: var(--mint); border-color: #456a65; }
.side-nav { display: flex; flex-direction: column; gap: 8px; padding-top: 25px; }
.nav-item { display: flex; align-items: center; gap: 15px; width: 100%; min-height: 49px; border: 1px solid transparent; border-radius: 10px; padding: 12px 15px; color: var(--muted); font-weight: bold; font-size: 13px; white-space: nowrap; }
.nav-item:hover { background: #1b2a34; color: #effffc; }
.nav-item[aria-current="page"] { background: #19352f; border-color: #315a4e; color: var(--mint); }
.nav-item .icon { width: 20px; height: 20px; }
.sidebar-bottom { margin-top: auto; padding: 20px 7px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.sidebar-avatar { flex-shrink: 0; height: 39px; width: 39px; border-radius: 11px; color: var(--mint); border: 1px solid #477168; display: grid; place-items: center; font-size: 12px; font-weight: bold; }
.sidebar-user { min-width: 0; }
.sidebar-user strong { display: block; font-size: 11px; line-height: 1.5; white-space: nowrap; }
.sidebar-user span { display: block; font-size: 11px; color: var(--subtle); white-space: nowrap; }
.app-shell.is-collapsed .sidebar { padding-left: 9px; padding-right: 9px; }
.app-shell.is-collapsed .nav-label, .app-shell.is-collapsed .sidebar-wordmark { display: none; }
.app-shell.is-collapsed .sidebar-compact-logo { display: flex; }
.app-shell.is-collapsed .sidebar-top { padding: 0 0 18px; }
.app-shell.is-collapsed .sidebar-heading { justify-content: center; padding: 0; }
.app-shell.is-collapsed .menu-toggle { justify-content: center; padding: 9px; }
.app-shell.is-collapsed .nav-item { justify-content: center; padding: 13px 8px; }
.app-shell.is-collapsed .sidebar-bottom { justify-content: center; padding-left: 0; padding-right: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 24px; }
.eyebrow { color: var(--mint); font-size: 11px; font-weight: bold; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 10px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(31px, 3.4vw, 43px); letter-spacing: -.045em; font-weight: bold; line-height: 1.15; }
h2 { font-size: 20px; letter-spacing: -.035em; }
h3 { font-size: 15px; letter-spacing: -.02em; }
.description { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
.muted { color: var(--muted); }
.small { color: var(--subtle); font-size: 12px; }
.section-label { font-size: 11px; color: var(--subtle); letter-spacing: .09em; text-transform: uppercase; font-weight: bold; margin: 31px 0 15px; }
.scenario-label { display: flex; align-items: center; gap: 10px; color: var(--subtle); font-size: 12px; }
.scenario-label select { background: var(--surface2); color: #dce9ec; border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 12px; max-width: 200px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 20px; align-items: stretch; }
.vm-card { background: linear-gradient(155deg, #15222d 0%, #101923 86%); border: 1px solid #2a3d49; border-radius: 17px; padding: 24px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.vm-card:hover { border-color: #436359; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.machine-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: #1b3039; color: var(--mint); }
.machine-icon .icon { width: 21px; height: 21px; }
.machine-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.machine-identity h3 { font-size: 16px; overflow-wrap: anywhere; }
.machine-identity p { margin-top: 2px; font-size: 12px; color: var(--subtle); }
.status { border-radius: 99px; padding: 5px 9px; font-size: 11px; font-weight: bold; white-space: nowrap; border: 1px solid #374550; color: #a9bac6; background: #1a2730; }
.status.running { color: var(--mint); background: #15342e; border-color: #2b6050; }
.status.provisioning { color: var(--warning); background: #322b20; border-color: #68543a; }
.machine-specs { display: flex; align-items: center; gap: 12px; color: #96a9b6; font-size: 12px; border-bottom: 1px solid #263743; padding: 0 0 17px; }
.dot { width: 3px; height: 3px; background: #738995; border-radius: 50%; }
.metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 17px; }
.metric { min-width: 0; }
.metric-title { display: flex; align-items: center; gap: 6px; color: var(--subtle); font-size: 11px; margin-bottom: 7px; }
.metric-title .icon { width: 14px; height: 14px; }
.metric-value { color: #eaf2f3; font-size: 17px; font-weight: bold; line-height: 1.35; font-variant-numeric: tabular-nums; }
.metric-hint { font-size: 10px; color: var(--subtle); margin-top: 5px; }
.meter { display: block; appearance: none; -webkit-appearance: none; width: 100%; height: 7px; border: 0; border-radius: 7px; background: #2c3d48; margin-top: 10px; overflow: hidden; }
.meter::-webkit-progress-bar { background: #2c3d48; border-radius: 7px; }
.meter::-webkit-progress-value { background: var(--mint); border-radius: 7px; }
.meter::-moz-progress-bar { background: var(--mint); border-radius: 7px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; border-top: 1px solid #263743; padding-top: 17px; }
.card-foot .small { max-width: 45%; }
.link-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #072820; background: var(--mint); border: 1px solid transparent; border-radius: 9px; padding: 10px 13px; font-weight: bold; font-size: 12px; white-space: nowrap; }
.link-action .icon { width: 15px; height: 15px; }
.link-action:hover { background: #8df1d8; }
.link-quiet { display: inline-flex; align-items: center; gap: 8px; color: var(--mint); font-size: 13px; font-weight: bold; }
.link-quiet:hover { text-decoration: underline; text-underline-offset: 4px; }
.empty-state { border: 1px dashed #415660; border-radius: 17px; padding: clamp(38px, 6vw, 78px) 26px; text-align: center; background: #101923; }
.empty-state .machine-icon { margin: 0 auto 20px; width: 57px; height: 57px; }
.empty-state h2 { margin-bottom: 10px; }
.empty-state p { color: var(--muted); max-width: 430px; margin: 0 auto 22px; }
.empty-state .link-action { margin: 0 auto; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--subtle); margin-bottom: 22px; flex-wrap: wrap; }
.breadcrumb a { color: #adc3c7; }
.breadcrumb a:hover { color: var(--mint); }
.breadcrumb .icon { width: 14px; height: 14px; }
.detail-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 24px; }
.detail-header .status { align-self: center; }
.tabbar { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--line-strong); gap: 7px; margin: 0 0 23px; }
.tab { padding: 14px 15px; font-size: 13px; color: var(--muted); font-weight: bold; border-bottom: 2px solid transparent; }
.tab:hover { color: var(--mint); }
.tab[aria-current="page"] { color: var(--mint); border-bottom-color: var(--mint); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-bottom: 19px; }
.info-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 20px; }
.info-panel .info-label { color: var(--subtle); font-size: 12px; margin-bottom: 9px; }
.info-panel strong { color: var(--text); font-size: 16px; overflow-wrap: anywhere; }
.full-panel { padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; display: grid; gap: 14px; }
.full-panel h2 { font-size: 20px; }
.full-panel p { color: var(--muted); max-width: 680px; }
.full-panel .icon { color: var(--mint); }
.subnote { padding: 13px 16px; background: #1b2b34; border: 1px solid #314852; border-radius: 9px; color: #beced1; font-size: 12px; line-height: 1.6; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; }
.action-button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #3a4b55; background: #22303b; color: #aec0c7; padding: 11px 15px; border-radius: 9px; font-weight: bold; }
.action-button:disabled { opacity: .58; }
.action-button .icon { width: 17px; height: 17px; }
.terminal-window { border: 1px solid #3a4c56; background: #080e14; border-radius: 12px; overflow: hidden; min-height: 180px; }
.terminal-head { background: #17212c; padding: 12px 17px; color: #b4c8d0; font-size: 12px; border-bottom: 1px solid #2d3d49; display: flex; align-items: center; gap: 10px; }
.terminal-body { padding: 30px 21px; color: #8ba6b0; font: 13px/1.7 ui-monospace, Consolas, 'Courier New', monospace; }
.terminal-body strong { color: var(--mint); }
.contact-list { display: grid; gap: 11px; margin-top: 4px; }
.contact-list a { display: inline-flex; gap: 9px; align-items: center; color: var(--mint); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.avatar-big { display: grid; place-items: center; width: 74px; height: 74px; border: 1px solid #3f7163; background: #19342e; border-radius: 19px; color: var(--mint); font-size: 24px; font-weight: bold; margin-bottom: 14px; }
.pill-list { display: flex; gap: 9px; flex-wrap: wrap; margin: 12px 0; }
.pill { border: 1px solid #344854; border-radius: 99px; padding: 6px 12px; color: #c2ced4; font-size: 12px; }
.loading-block { padding: 26px; color: var(--muted); }
@media (min-width: 1450px) {
  .cards-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1120px) {
  .topbar-extra { display: none; }
  .cards-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px),1fr)); }
  .vm-card { padding: 19px; }
}
@media (max-width: 760px) {
  .app-shell { --side-width: 74px; }
  .sidebar { padding: 21px 8px 16px; }
  .sidebar-top { padding: 0 0 17px; }
  .sidebar-heading { justify-content: center; padding: 0; }
  .sidebar-wordmark { display: none; }
  .sidebar-compact-logo { display: flex; }
  .sidebar .nav-label { display: none; }
  .sidebar .menu-toggle, .sidebar .nav-item { justify-content: center; padding: 11px 8px; }
  .sidebar-bottom { justify-content: center; padding: 15px 0 0; }
  .app-shell:not(.is-collapsed) .sidebar { width: 230px; right: 0; z-index: 5; position: fixed; box-shadow: -18px 0 50px #04080dcc; }
  .app-shell:not(.is-collapsed) .sidebar-wordmark, .app-shell:not(.is-collapsed) .sidebar .nav-label { display: block; }
  .app-shell:not(.is-collapsed) .sidebar-compact-logo { display: none; }
  .app-shell:not(.is-collapsed) .sidebar-heading, .app-shell:not(.is-collapsed) .sidebar .menu-toggle, .app-shell:not(.is-collapsed) .sidebar .nav-item, .app-shell:not(.is-collapsed) .sidebar-bottom { justify-content: flex-start; }
  .app-shell.is-collapsed { --side-width: 74px; }
  .topbar { height: 82px; padding: 14px 19px; }
  .workspace-inner { padding: 24px 18px 58px; }
  .footer { padding: 18px; }
  .preview-banner { margin-bottom: 25px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .topbar-right { font-size: 10px; }
  .brand img { width: 145px; max-width: 36vw; }
  .vm-card { padding: 16px; }
  .status { font-size: 10px; }
  .metrics-grid { gap: 13px; }
  .card-foot { align-items: flex-start; flex-direction: column; }
  .card-foot .small { max-width: 100%; }
  h1 { font-size: 30px; }
  .footer span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
/* GUI refinement v2: accessible reading, calmer transitions, consistent states.
   Arial is intentionally retained. Motion never communicates security/status alone. */
:root {
  --subtle: #a8bdc8;
  --muted: #c0cdd4;
  --motion-ease: cubic-bezier(.22, 1, .36, 1);
  --motion-duration: 580ms;
}
body { font-size: 15px; font-weight: 500; line-height: 1.56; }
h1 { font-weight: 800; letter-spacing: -.038em; }
h2, h3 { font-weight: 800; }
.description { font-size: 15px; font-weight: 500; }
.topbar-right { font-size: 13px; font-weight: 600; }
.preview-banner { font-size: 13px; font-weight: 550; margin-bottom: 31px; }
.sidebar-heading { font-size: 11px; font-weight: 800; color: #a7bbc5; }
.nav-item { font-size: 14px; font-weight: 700; }
.menu-toggle { font-size: 13px; font-weight: 700; }
.sidebar-user strong, .sidebar-user span { font-size: 12px; }
.eyebrow, .section-label { font-size: 12px; font-weight: 800; }
.section-label { color: #b1c4cb; }
.scenario-label { font-size: 13px; font-weight: 700; }
.scenario-label select { font-size: 13px; font-weight: 650; }
.machine-identity h3 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.machine-identity p { font-size: 13px; color: #b5c7ce; }
.status { font-size: 12px; font-weight: 800; }
.machine-specs { font-size: 13px; font-weight: 600; flex-wrap: wrap; gap: 6px 10px; }
.metric-title { font-size: 13px; font-weight: 700; color: #b6c8d1; }
.metric-title .icon { width: 15px; height: 15px; }
.metric-value { font-size: 19px; font-weight: 800; overflow-wrap: anywhere; }
.metric-hint { font-size: 12px; color: #a9bdc7; }
.small { font-size: 13px; }
.card-foot .small { color: #b7c8d1; }
.link-action { font-size: 13px; font-weight: 800; }
.link-quiet, .tab { font-size: 14px; font-weight: 750; }
.empty-state p { font-size: 15px; }
.breadcrumb { font-size: 13px; }
.info-panel .info-label { font-size: 13px; }
.info-panel strong { font-size: 18px; font-weight: 800; }
.full-panel p { font-size: 15px; }
.subnote { font-size: 13px; color: #c4d2d9; }
.action-button { font-size: 14px; }
.terminal-head { font-size: 13px; }
.terminal-body { font-size: 14px; }
.footer { font-size: 11px; letter-spacing: .03em; color: #b0c1c9; }
.pill { font-size: 13px; }
.app-shell { transition: grid-template-columns 650ms var(--motion-ease); }
.sidebar { transition: padding 620ms var(--motion-ease), width 620ms var(--motion-ease), box-shadow 620ms var(--motion-ease); }
.menu-toggle, .nav-item, .tab, .action-button, .link-action, .link-quiet {
  transition: background-color 480ms var(--motion-ease),
              border-color 480ms var(--motion-ease),
              color 480ms var(--motion-ease),
              transform 580ms var(--motion-ease),
              box-shadow 580ms var(--motion-ease);
}
.vm-card, .info-panel {
  transition: transform 620ms var(--motion-ease),
              box-shadow 620ms var(--motion-ease),
              border-color 620ms var(--motion-ease);
}
.vm-card:hover {
  transform: translateY(-4px);
  border-color: #4e8274;
  box-shadow: 0 20px 48px rgba(0,0,0,.2), 0 0 0 1px rgba(89,219,188,.06);
}
.link-action:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(89,219,188,.15); }
.nav-item:hover, .menu-toggle:hover { transform: translateX(-2px); }
.tab:hover { border-bottom-color: rgba(89,219,188,.4); }
@keyframes content-appear {
  from { opacity: 0; transform: translateY(11px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes card-appear {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
#view > * { animation: content-appear 600ms var(--motion-ease) both; }
#view .cards-grid > .vm-card { animation: card-appear 700ms var(--motion-ease) both; }
#view .cards-grid > .vm-card:nth-child(2) { animation-delay: 110ms; }
#view .cards-grid > .vm-card:nth-child(3) { animation-delay: 210ms; }
#view .cards-grid > .vm-card:nth-child(n+4) { animation-delay: 260ms; }
.inventory-toolbar { display: flex; align-items: end; gap: 15px; flex-wrap: wrap; margin: 18px 0 28px; }
.filter-field { display: grid; gap: 8px; color: #bfced5; font-size: 13px; font-weight: 750; }
.filter-field:first-child { flex: 1; min-width: min(100%, 240px); max-width: 390px; }
.filter-field input, .filter-field select {
  width: 100%; min-height: 45px; padding: 10px 13px;
  background: #14222d; color: #f1f8f8; border: 1px solid #3b515e; border-radius: 10px;
  font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: 650;
  transition: border-color 460ms var(--motion-ease), box-shadow 460ms var(--motion-ease);
}
.filter-field input::placeholder { color: #b2c4ce; }
.filter-field input:focus-visible, .filter-field select:focus-visible { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(89,219,188,.13); }
@media (max-width: 760px) {
  .page-head { gap: 17px; }
  .sidebar .nav-item .icon { width: 21px; height: 21px; }
  .metric-value { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
    transform: none !important;
  }
}

/* Embedded xterm.js widget inside the real VM-detail navigation shell. */
.mg-dashboard-terminal { min-width: 0; }
.mg-dashboard-terminal .mg-terminal-screen {
  height: clamp(300px, 50vh, 530px);
  min-width: 0;
}
.mg-dashboard-terminal .mg-terminal-controls { align-items: end; }
.mg-dashboard-terminal .mg-terminal-button { white-space: nowrap; }
.mg-dashboard-terminal .mg-terminal-state { flex-shrink: 0; }
@media (max-width: 650px) {
  .mg-dashboard-terminal .mg-terminal-screen { height: 350px; }
  .mg-dashboard-terminal .mg-terminal-header { flex-wrap: wrap; }
}
