:root {
  color-scheme: light dark;
  --bg: #f1f3f6;
  --card: #fff;
  --soft: #f5f7f9;
  --tx: #182533;
  --mut: #526273;
  --bd: #d7dfe6;
  --ac: #b42137;
  --tint: #fff0f1;
  --ok: #166348;
  --ok-bg: #e9f6ee;
  --warn: #94491a;
  --warn-bg: #fff2df;
  --shadow: 0 2px 5px rgb(35 23 32 / 4%);
  --rail: 180px;
  --nav: #19252e;
  --edge: #34434c;
  --coral: #ff887c;
  --ease: cubic-bezier(.2,.8,.2,1);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151d24; --card: #1d2832; --soft: #24323d; --tx: #f0f4f6;
    --mut: #b0beca; --bd: #374752; --ac: #ff9ca7; --tint: #412930;
    --ok: #97dbb9; --ok-bg: #253a31; --warn: #ffc18b; --warn-bg: #423027;
  }
}
* { box-sizing: border-box; }
body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  margin: 0;
  color: var(--tx);
  font: 14px/1.5 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
}
button, input, select { font: inherit; color: inherit; }
button, input, select, dialog { border: 1px solid var(--bd); background: var(--card); }
button {
  cursor: pointer;
  border-radius: 9px;
  padding: 4px 8px;
  font-weight: 600;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--ac);
  outline-offset: 2px;
}
button.pri, button.pri:hover { color: white; background: #ad2337; border-color: #ad2337; }
button:active { transform: translateY(1px); }
.masthead {
  z-index: 4; display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 5px 12px; background: #16212a; color: #f4f7fa;
  border-bottom: 1px solid var(--edge);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand img { width: 30px; height: 30px; padding: 2px; border-radius: 8px; background: white; }
h1 { margin: 0; font-size: 20px; letter-spacing: -.045em; line-height: 1.1; }
#upd {
  margin-left: auto; border-left: 1px solid #43515b; padding-left: 10px;
  color: #cdd8e1; font: 11px/1.4 var(--mono);
}
.server-art {
  position: absolute; inset: auto 0 0; height: 150px; overflow: hidden; display: grid;
  place-items: center; grid-template-columns: minmax(0, 1fr); pointer-events: none; isolation: isolate;
  background: radial-gradient(ellipse at 50% 95%, #76444975, transparent 75%);
}
.server-art::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(circle, #a9b7c245 .8px, transparent .9px);
  background-size: 10px 10px; mask-image: linear-gradient(transparent, black);
}
.server-art::before {
  content: "";
  position: absolute;
  width: 370px; height: 370px;
  border: 1px solid #ffffff18;
  border-radius: 50%;
  box-shadow: 0 0 0 32px #ffffff05, 0 0 0 33px #ffffff10, 0 0 0 76px #ffffff04;
  transform: scale(.52,.22) rotate(-18deg);
}
.rack { scale: .55; width: 228px; height: 142px; position: relative; filter: drop-shadow(0 15px 10px #17081066); }
.unit {
  position: absolute;
  width: 228px; height: 83px;
  --face: #4b3a47; --side: #382936; --lid: #867180; --edge: #bba3b1;
}
.unit:nth-child(1) { top: 56px; }
.unit:nth-child(2) { top: 28px; }
.unit:nth-child(3) { --face: #c0394d; --side: #942d42; --lid: #f37785; --edge: #ffbdc6; }
.unit i, .unit b, .unit em { display: block; position: absolute; }
.unit i {
  inset: 0;
  background: linear-gradient(148deg, var(--edge), var(--lid) 48%, var(--lid));
  clip-path: polygon(0 30px, 83px 0, 228px 32px, 145px 62px);
}
.unit:last-child i::after {
  content: ""; position: absolute; left: 101px; top: 18px;
  width: 44px; height: 12px;
  transform: skewY(12deg) skewX(-48deg);
  background: repeating-linear-gradient(0deg, #a735494a 0 1px, transparent 1px 3px);
}
.unit b {
  left: 0; top: 30px; width: 145px; height: 21px;
  transform-origin: top left; transform: skewY(12.45deg);
  background: linear-gradient(90deg, var(--face), var(--side));
  border-top: 1px solid var(--edge);
}
.unit b::before, .unit b::after { content: ""; position: absolute; top: 8px; height: 4px; }
.unit b::before { left: 12px; width: 4px; border-radius: 50%; background: #ffe0db; box-shadow: 8px 0 #e7a2a6; }
.unit b::after { right: 9px; width: 48px; background: repeating-linear-gradient(90deg, #170f1b99 0 3px, transparent 3px 6px); }
.unit em {
  top: 62px; left: 145px; width: 83px; height: 21px;
  transform-origin: top left; transform: skewY(-19.86deg);
  background: var(--side); border-top: 1px solid var(--edge);
}
#menuToggle {
  flex: none; display: grid; place-items: center; width: 31px; height: 31px; padding: 0;
  color: #f7f9fb; border: 1px solid #52606b; background: #27353f; border-radius: 6px;
}
#menuToggle:hover { background: #384954; }
#menuToggle:focus-visible, #sidebar :focus-visible { outline: 2px solid var(--coral); outline-offset: -2px; }
#menuToggle span {
  position: relative; width: 15px; height: 13px; border: 1.5px solid currentColor; border-radius: 2px;
}
#menuToggle span::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: currentColor;
}
#menuToggle[aria-expanded="true"] span::before { width: 6px; }
.workspace { position: relative; display: flex; min-height: 0; overflow: clip; }
#sidebar {
  position: relative; flex: 0 0 var(--rail); width: var(--rail); padding: 10px 8px;
  overflow: auto; background: var(--nav); color: #e6edf3;
}
#sidebar details { position: relative; z-index: 1; }
#sidebar details + details { border-top: 1px solid var(--edge); margin-top: 8px; padding-top: 8px; }
#sidebar summary {
  display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
  padding: 8px 10px; font-size: 12px; font-weight: 650; color: #f0f4f7; border-radius: 6px;
}
#sidebar summary::before { content: ""; width: 3px; height: 12px; border-radius: 3px; background: #748591; }
#sidebar details:has(.on) summary::before { background: var(--coral); }
#sidebar summary::-webkit-details-marker { display: none; }
#sidebar summary::after {
  content: ""; width: 6px; height: 6px; margin-left: auto; margin-right: 2px;
  border: solid #b6c3cd; border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg);
}
#sidebar details[open] > summary::after { transform: rotate(45deg); }
#sidebar summary:hover, .submenu button:hover { background: #293a46; color: white; }
.submenu { display: grid; gap: 3px; margin: 3px 0 0; }
.submenu button, .cp { display: inline-flex; align-items: center; gap: 8px; }
.submenu button {
  justify-content: flex-start; padding: 9px 12px; font-size: 13px; font-weight: 500;
  border: 1px solid transparent; border-radius: 6px; background: transparent; color: #becbd5;
}
.submenu button.on {
  color: #fff; border-color: #a268694d; background: linear-gradient(105deg,#624044,#38343c);
  box-shadow: inset 2px 0 var(--coral);
}
.submenu button.on::before { color: #ffa899; }
#menuShade { position: absolute; inset: 0; z-index: 2; background: #14233170; }
nav button::before, #xls::before, .server-icon::before, .cp::before, .note::before {
  content: ""; flex: none; width: 16px; height: 16px; background: currentColor;
  mask: var(--icon) center / contain no-repeat;
}
#tabV, .server-icon {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none' stroke='black' stroke-width='1.7'%3E%3Crect x='3' y='3' width='18' height='7' rx='2'/%3E%3Crect x='3' y='14' width='18' height='7' rx='2'/%3E%3Cpath d='M6 6.5h3m-3 11h3'/%3E%3C/svg%3E");
}
#tabC { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M7 19a5 5 0 0 1-.5-10 6.5 6.5 0 0 1 12.6 1.4A4.3 4.3 0 0 1 18 19Z'/%3E%3C/svg%3E"); }
#tabU { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Cpath d='m10 14 4-4m-5 1-3 3a3 3 0 0 0 4 4l3-3m-2-6 3-3a3 3 0 0 1 4 4l-3 3'/%3E%3C/svg%3E"); }
#tabD { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linejoin='round'%3E%3Cpath d='m12 2 9 5v10l-9 5-9-5V7Zm0 10 9-5m-9 5L3 7m9 5v10'/%3E%3C/svg%3E"); }
#xls { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v12m-5-5 5 5 5-5M4 16v4h16v-4'/%3E%3C/svg%3E"); }
main { flex: 1; min-width: 0; overflow: auto; padding: 7px 10px 10px; }
.page-title, .tka-heading h2 {
  margin: 0; color: var(--tx); font-size: 22px; font-weight: 730;
  line-height: 1.2; letter-spacing: -.045em;
}
.page-title { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.page-title::after { content: ""; flex: 1; height: 1px; background: var(--bd); }
.grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.vps, .card {
  border: 1px solid var(--bd); border-radius: 8px;
  background: var(--card); box-shadow: var(--shadow);
}
.vps { padding: 0 9px 7px; overflow: hidden; }
.vps.has-error .server-icon { background: var(--warn-bg); color: var(--warn); }
.server-head {
  display: flex; gap: 7px; align-items: center; margin: 0 -9px; padding: 6px 9px;
  border-bottom: 1px solid var(--bd);
  background: linear-gradient(110deg, var(--card) 55%, var(--soft));
}
.server-icon {
  display: grid; place-items: center; flex: none; width: 30px; height: 30px;
  color: #ffb1a5; background: #25333f; border-radius: 7px;
}
.server-icon::before { width: 21px; height: 21px; }
.server-head h3 { min-width: 0; margin: 0; font-size: 19px; letter-spacing: -.035em; line-height: 1.25; overflow-wrap: anywhere; }
.server-head small { display: block; margin-top: 0; color: var(--mut); font: 11px/1.4 var(--mono); letter-spacing: 0; }
.cp {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round'%3E%3Crect x='8' y='8' width='12' height='13' rx='2'/%3E%3Cpath d='M15 8V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h3'/%3E%3C/svg%3E");
  gap: 4px; padding: 2px 6px; font-size: 12px; white-space: nowrap;
}
.cp::before { width: 13px; height: 13px; }
.server-head .cp { margin-left: auto; }
.metrics {
  display: grid; grid-template-columns: .8fr 1fr 1.2fr;
  margin: 6px 0; padding: 4px 0;
  background: var(--soft); border: 1px solid var(--bd); border-radius: 6px;
}
.metrics div { padding: 0 6px; }
.metrics div + div { border-left: 1px solid var(--bd); }
.metrics dt, .specs dt { color: var(--mut); font-size: 12px; }
.metrics dd { margin: 0; font-size: 19px; font-variant-numeric: tabular-nums; font-weight: 680; letter-spacing: -.035em; }
.metrics dd small { font-size: 11px; font-weight: 450; color: var(--mut); letter-spacing: 0; }
.specs {
  display: grid; grid-template-columns: auto minmax(0,1fr);
  gap: 2px 8px; align-items: baseline; margin: 0;
}
.specs dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; overflow-wrap: anywhere; }
code { font: 12px/1.5 var(--mono); overflow-wrap: anywhere; }
.left { display: inline-block; margin: 0 0 0 4px; border-radius: 20px; padding: 2px 8px; font-size: 11px; }
.up { color: var(--ok); background: var(--ok-bg); }
.dn, .error-msg { color: var(--warn); background: var(--warn-bg); }
.error-msg { margin-top: 4px; padding: 3px 6px; border-radius: 7px; font-size: 12px; overflow-wrap: anywhere; }
.note { display: flex; gap: 7px; align-items: baseline; margin-top: 6px; color: var(--mut); font-size: 12px; }
.note::before {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6m0-10v2'/%3E%3C/svg%3E");
  width: 14px; height: 14px; align-self: flex-start; margin-top: 2px;
}
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 6px; }
input, select { padding: 4px 7px; border-radius: 9px; width: 100%; }
.bar input[type=search] { flex: 1; min-width: min(230px,100%); width: auto; }
.bar select { width: auto; }
.card { overflow-x: auto; margin-bottom: 7px; }
.card h2 { background: var(--soft); border-left: 3px solid var(--ac); padding: 5px 8px; margin: 0; display: flex; align-items: baseline; gap: 10px; font-size: 17px; }
.card h2 span { color: var(--mut); font-size: 12px; font-weight: 450; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
td, th { padding: 4px 7px; text-align: left; border-bottom: 1px solid var(--bd); }
th { background: var(--soft); color: var(--mut); font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
td a { color: var(--ac); text-decoration: none; overflow-wrap: anywhere; }
td a:hover { text-decoration: underline; }
.tag { display: inline-block; background: var(--soft); padding: 2px 8px; border-radius: 6px; font: 12px/1.6 var(--mono); }
.act { white-space: nowrap; }
.act button { font-size: 12px; padding: 2px 6px; }
.err { padding: 5px 8px; color: var(--warn); }
tr.main { cursor: pointer; }
tr.main td:first-child { font-weight: 600; white-space: nowrap; }
.tog { display: inline-block; width: 15px; color: var(--mut); }
tr.sub td { background: var(--soft); }
tr.sub td:first-child { padding-left: 31px; color: var(--mut); }
.dom a { display: block; white-space: nowrap; }
dialog { color: var(--tx); border-radius: 17px; padding: 12px; width: min(460px, 92vw); box-shadow: 0 18px 70px #17101833; }
dialog::backdrop { background: #19151e88; }
dialog h3 { font-size: 22px; letter-spacing: -.035em; }
dialog label { display: block; margin: 6px 0 2px; font-size: 12px; color: var(--mut); }
.hide { display: none; }

@media (hover: hover) {
  button:hover { background: var(--soft); border-color: var(--mut); }
  .cp:hover { color: var(--ac); }
  .vps:hover { box-shadow: 0 6px 20px #20131b10; border-color: color-mix(in srgb, var(--ac) 28%, var(--bd)); }
  tbody tr:hover { background: var(--soft); }
}
@media (max-width: 1050px) { .grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 700px) {
  #sidebar { position: absolute; inset: 0 auto 0 0; z-index: 3; box-shadow: 4px 0 16px #111b2630; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: minmax(0,1fr); }
  main { padding: 6px; }
  .masthead { min-height: 45px; padding: 4px 6px; gap: 6px; }
  .brand { gap: 5px; }
  .brand img { width: 26px; height: 26px; }
  h1 { font-size: 17px; }
  #upd { max-width: 19ch; padding-left: 6px; font-size: 10px; }
  .card h2 { flex-wrap: wrap; }
  .bar input[type=search] { flex-basis: 100%; }
  .card table { min-width: 600px; }
}
@media (max-height: 540px) { .server-art { display: none; } }

@media (prefers-reduced-motion: no-preference) {
  button, input, select, .vps, tbody tr, .tka-agenda li {
    transition: background-color .18s, color .18s, border-color .18s, box-shadow .18s, transform .18s var(--ease);
  }
  #menuToggle span::before { transition: width .2s var(--ease); }
  #sidebar summary::after { transition: transform .2s var(--ease); }
  #sidebar details[open] .submenu { animation: reveal .2s var(--ease) both; }
  #sidebar {
    transition: margin-left .22s var(--ease), opacity .18s, transform .22s var(--ease), display .22s allow-discrete;
  }
  #sidebar[hidden] { opacity: 0; margin-left: calc(-1 * var(--rail)); }
  @starting-style { #sidebar:not([hidden]) { opacity: 0; margin-left: calc(-1 * var(--rail)); } }
  #menuShade { transition: opacity .2s, display .2s allow-discrete; }
  #menuShade[hidden] { opacity: 0; pointer-events: none; }
  @starting-style { #menuShade:not([hidden]) { opacity: 0; } }
  .rack { animation: rack-arrive .65s var(--ease) both; }
  .unit:nth-child(3) { animation: settle .7s var(--ease) both; }
  .unit:nth-child(3) b::before { animation: indicator 2.4s ease-in-out 2; }
  @keyframes indicator { 50% { opacity: .5; } }
  main > section:not(.hide), dialog[open] { animation: reveal .22s var(--ease) both; }
  .vps, .tka-agenda.by-date section, tr.sub { animation: reveal .24s var(--ease) backwards; }
  .vps:nth-child(2), .tka-agenda.by-date section:nth-child(2) { animation-delay: 35ms; }
  .vps:nth-child(3), .tka-agenda.by-date section:nth-child(3) { animation-delay: 65ms; }
  .vps:nth-child(n+4), .tka-agenda.by-date section:nth-child(n+4) { animation-delay: 95ms; }
  @keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
  @keyframes rack-arrive { from { opacity: 0; transform: translateY(12px); } }
  @keyframes settle { from { transform: translateY(-18px); } }
}
@media (hover: hover) {
  .submenu button:not(.on):hover { color: white; background: #293a46; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .vps:hover { transform: translateY(-2px); }
}
