/* Komari Pure — Apple-inspired, quiet and minimal */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);
  --sep: rgba(60, 60, 67, 0.12);
  --label: #1d1d1f;
  --label-2: rgba(60, 60, 67, 0.62);
  --label-3: rgba(60, 60, 67, 0.36);
  --blue: #007aff;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --teal: #30b0c7;
  --indigo: #5856d6;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Helvetica Neue", "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Helvetica Neue", "Segoe UI Variable Display", "Segoe UI", "Microsoft YaHei UI", sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000;
  --card: #1c1c1e;
  --fill: rgba(118, 118, 128, 0.24);
  --fill-2: rgba(118, 118, 128, 0.32);
  --sep: rgba(84, 84, 88, 0.55);
  --label: #f5f5f7;
  --label-2: rgba(235, 235, 245, 0.6);
  --label-3: rgba(235, 235, 245, 0.3);
  --blue: #0a84ff;
  --green: #30d158;
  --orange: #ff9f0a;
  --red: #ff453a;
  --teal: #40c8e0;
  --indigo: #5e5ce6;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--label); font-family: var(--font);
  font-size: 15px; line-height: 1.4; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
.tnum { font-variant-numeric: tabular-nums; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* Header */
.km-navbar { padding: 64px 0 28px; }
.hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.hd-date { font-size: 13px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: 0.02em; }
.hd-title { font-family: var(--display); font-size: 40px; font-weight: 700; letter-spacing: -0.028em; line-height: 1.1; margin: 4px 0 0; }
.hd-sub { margin-top: 8px; font-size: 17px; color: var(--label-2); display: flex; align-items: center; gap: 8px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); position: relative; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit; animation: pulse 2s var(--ease) infinite; }
.pulse.warn { background: var(--orange); }
.pulse.warn::after { animation: none; }
.round-btn {
  width: 36px; height: 36px; border-radius: 50%; background: var(--fill); color: var(--label);
  display: grid; place-items: center; transition: transform .2s var(--ease), background-color .2s;
}
.round-btn:hover { background: var(--fill-2); }
.round-btn:active { transform: scale(0.92); }
.round-btn svg { width: 18px; height: 18px; }

/* Summary widgets */
.widgets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 40px; }
.widget { background: var(--card); border-radius: 20px; padding: 18px 20px 20px; box-shadow: var(--shadow); }
.w-k { font-size: 13px; font-weight: 600; color: var(--label-2); }
.w-v { font-family: var(--display); font-size: 32px; font-weight: 600; letter-spacing: -0.025em; margin-top: 6px; line-height: 1.1; }
.w-v small { font-size: 17px; font-weight: 500; color: var(--label-2); margin-left: 3px; letter-spacing: -0.01em; }
.w-s { font-size: 13px; color: var(--label-2); margin-top: 4px; }

.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 14px; }
.sec h2 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.sec span { font-size: 13px; color: var(--label-2); }

/* Machine cards */
.km-instance-server-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.km-node-card {
  background: var(--card); border-radius: 22px; padding: 20px 22px 18px; box-shadow: var(--shadow);
  cursor: pointer; text-align: left; width: 100%; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch;
  font: inherit; color: inherit; border: 0;
  transition: transform .35s var(--spring), box-shadow .35s var(--ease), opacity .3s;
  animation: in .6s var(--spring) both;
}
.km-node-card:hover { transform: scale(1.012); }
.km-node-card:active { transform: scale(0.985); }
.km-node-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 50%, transparent); outline-offset: 2px; }
.km-node-card.off { opacity: .6; }
.c-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.c-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.c-name .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 18%, transparent); }
.dot.off { background: var(--label-3); box-shadow: 0 0 0 4px var(--fill); }
.c-loc { flex: none; font-size: 13px; font-weight: 500; color: var(--label-2); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill { font-size: 12px; font-weight: 500; color: var(--label-2); background: var(--fill); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
/* source pill: vendor tint */
.pill.src { font-weight: 600; }
.pill.v-az { color: #0067b8; background: rgba(0, 120, 212, 0.12); }
.pill.v-gcp { color: #188038; background: rgba(52, 168, 83, 0.13); }
.pill.v-oci { color: #b3361c; background: rgba(199, 70, 52, 0.12); }
.pill.v-home { color: var(--indigo); background: color-mix(in srgb, var(--indigo) 13%, transparent); }
:root[data-theme="dark"] .pill.v-home { color: #a5a3ff; background: rgba(165, 163, 255, 0.16); }
.pill.v-own { color: #8a5a00; background: rgba(255, 149, 0, 0.15); }
:root[data-theme="dark"] .pill.v-az { color: #4cc2ff; background: rgba(76, 194, 255, 0.16); }
:root[data-theme="dark"] .pill.v-gcp { color: #6dd58c; background: rgba(109, 213, 140, 0.15); }
:root[data-theme="dark"] .pill.v-oci { color: #ff8a73; background: rgba(255, 138, 115, 0.15); }
:root[data-theme="dark"] .pill.v-own { color: #ffb340; background: rgba(255, 179, 64, 0.16); }

/* Traffic */
.q-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 14px; }
.q-card { background: var(--card); border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.q-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.q-h b { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.q-h b.warn { color: var(--orange); } .q-h b.bad { color: var(--red); }
.q-card .bar { margin-top: 8px; height: 5px; border-radius: 3px; }
.q-card .bar i { background: var(--green); }
.q-s { font-size: 12px; color: var(--label-2); margin-top: 6px; }
.q-n { font-size: 11px; color: var(--label-3); margin-top: 3px; line-height: 1.45; }
.t-list .t-row { display: grid; grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr); align-items: center; column-gap: 16px; row-gap: 6px; padding: 11px 16px; cursor: pointer; transition: background-color .15s; }
.t-list .t-row + .t-row { border-top: 0.5px solid var(--sep); }
.t-list .t-row:hover { background: var(--fill); }
.t-name { min-width: 0; display: flex; flex-direction: column; }
.t-name b { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-name span { font-size: 12px; color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-v { display: flex; gap: 14px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.t-v span { display: inline-flex; align-items: center; gap: 4px; }
.t-v svg { width: 11px; height: 11px; }
.t-v .u { color: var(--green); } .t-v .d { color: var(--blue); }
.t-day { font-size: 12px; color: var(--label-2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-bar { grid-column: 1 / -1; display: flex; gap: 2px; height: 4px; }
.t-bar i { display: block; height: 100%; border-radius: 2px; min-width: 0; }
.t-bar .u { background: var(--green); } .t-bar .d { background: var(--blue); opacity: .55; }

.meters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.m { min-width: 0; }
.m-h { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.m-k { font-size: 12px; font-weight: 600; color: var(--label-2); }
.m-h b { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.m .bar { margin-top: 6px; height: 5px; border-radius: 3px; }
.m .bar i { background: var(--green); }
.m-s { font-size: 11px; color: var(--label-2); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.tile { background: var(--fill); border-radius: 12px; padding: 8px 10px; font-size: 12px; font-weight: 500; line-height: 1.55; min-width: 0; }
:root[data-theme="dark"] .tile, :root[data-theme="dark"] .lp { background: rgba(118,118,128,.16); }
.tile div { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile svg { width: 11px; height: 11px; flex: none; }
.tile .u { color: var(--green); } .tile .d { color: var(--blue); }
.mute { color: var(--label-2); font-weight: 400; }
.c-lat { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.c-lat.none { display: none; }
.lp { background: var(--fill); border-radius: 12px; padding: 8px 10px 10px; min-width: 0; }
.lp-h { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; }
.lp-h .mute { font-size: 11px; font-weight: 500; }
.lp-v { display: flex; justify-content: space-between; align-items: baseline; margin-top: 2px; font-size: 12px; gap: 6px; white-space: nowrap; }
.lp-v b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.lp-v b.ok { color: var(--green); } .lp-v b.warn { color: var(--orange); } .lp-v b.bad { color: var(--red); }
.sq { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; margin-top: 7px; }
.sq i { height: 10px; border-radius: 2.5px; background: var(--fill-2); opacity: .55; }
.sq i.ok { background: var(--green); opacity: 1; } .sq i.warn { background: var(--orange); opacity: 1; } .sq i.bad { background: var(--red); opacity: 1; }
.c-lat.src { display: flex; align-items: center; gap: 10px; background: color-mix(in srgb, var(--blue) 9%, transparent); border-radius: 12px; padding: 10px 12px; }
.c-lat.src b { display: block; font-size: 13px; font-weight: 600; color: var(--blue); }
.c-lat.src span { font-size: 12px; color: var(--label-2); }
.src-i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 22%, transparent); }
.km-node-card.off .meters, .km-node-card.off .tiles, .km-node-card.off .c-lat { filter: grayscale(1); }
.bar { height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: 2px; background: var(--blue); transition: width 1s var(--spring), background-color .4s; }
.bar i.warn { background: var(--orange) !important; } .bar i.bad { background: var(--red) !important; }

/* World map (interactive) */
.map { margin-bottom: 40px; }
.map-card { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 20px 22px 18px; overflow: hidden; }
.map-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.map-k { font-size: 13px; font-weight: 600; color: var(--label-2); }
.map-t { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; }
.map-lg { display: flex; gap: 14px; font-size: 12px; color: var(--label-2); }
.map-lg span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--green); }
.lv-src.lg { background: var(--blue); } .lv-warn.lg { background: var(--orange); } .lv-bad.lg { background: var(--red); } .lv-off.lg { background: var(--label-3); }
.c-ok { color: var(--green); } .c-warn { color: var(--orange); } .c-bad { color: var(--red); } .c-off { color: var(--label-3); } .c-src { color: var(--blue); }

.map-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.chips, .tgls { display: flex; gap: 6px; flex-wrap: wrap; }
.chips { min-width: 0; }
.chip, .tgl { height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--label); background: var(--fill);
  display: inline-flex; align-items: center; gap: 6px; transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--spring); white-space: nowrap; }
.chip:hover, .tgl:hover { background: var(--fill-2); }
.chip:active, .tgl:active { transform: scale(.95); }
.chip span { font-size: 12px; color: var(--label-2); }
.chip span:empty { display: none; }
.chip.on { background: var(--label); color: var(--card); }
.chip.on span { color: color-mix(in srgb, var(--card) 70%, transparent); }
.chip .cnt-bad { color: #fff !important; background: var(--red); border-radius: 999px; min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; font-weight: 600; }
.chip:not(.has) .cnt-bad { display: none; }
.tgl { color: var(--label-2); background: transparent; box-shadow: inset 0 0 0 1px var(--sep); }
.tgl .ic { width: 15px; height: 15px; display: inline-grid; }
.tgl .ic svg { width: 15px; height: 15px; }
.tgl.on { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); box-shadow: none; }
.chip:focus-visible, .tgl:focus-visible, .map-ctl button:focus-visible, .mp-go:focus-visible, .mp-x:focus-visible, .rk:focus-visible, .ml:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.map-body { position: relative; margin: 12px -10px 0; }
.map-stage { position: relative; aspect-ratio: 240 / 92; min-height: 300px; border-radius: 16px; overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; outline: none; }
.map-stage:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--blue) 55%, transparent); }
.map-stage.grabbing { cursor: grabbing; }
.map-stage.on-arc { cursor: pointer; }
.map-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.mk { position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; z-index: 2; padding: 0; transition: opacity .3s var(--ease); will-change: transform; }
.mk .pin { position: absolute; left: 9px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.22); transition: transform .3s var(--spring), background-color .3s; }
.mk .pin::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; background: inherit; animation: pulse 2.4s var(--ease) infinite; z-index: -1; }
.mk.lv-src .pin { background: var(--blue); width: 12px; height: 12px; left: 8px; top: 8px; }
.mk.lv-warn .pin { background: var(--orange); }
.mk.lv-bad .pin { background: var(--red); }
.mk.lv-bad .pin::after { animation-duration: 1.2s; }
.mk.lv-off .pin { background: var(--label-3); }
.mk.lv-off .pin::after { animation: none; }
.mk:hover .pin, .mk.focus .pin, .mk.hl .pin { transform: scale(1.35); }
.mk.sel .pin { transform: scale(1.5); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 30%, transparent), 0 1px 4px rgba(0,0,0,.22); }
.mk .lb { position: absolute; left: 14px; top: 14px; white-space: nowrap; font-size: 11px; line-height: 1.25; padding: 3px 7px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 2px 10px rgba(0,0,0,.08); border: 0.5px solid var(--sep);
  transition: opacity .2s var(--ease), border-color .2s, box-shadow .2s; }
.mk .lb b { font-weight: 600; font-size: 11px; display: inline-flex; align-items: center; gap: 4px; color: var(--label); }
.mk .lb .ct { font-style: normal; font-size: 9px; font-weight: 700; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; background: var(--fill-2); color: var(--label-2); display: inline-grid; place-items: center; }
.mk .lv { color: var(--label-2); font-size: 10px; }
.mk.lv-src .lv { color: var(--blue); font-weight: 600; }
.mk.lv-warn .lv { color: var(--orange); font-weight: 600; }
.mk.lv-bad .lv { color: var(--red); font-weight: 600; }
.mk.nolb .lb { opacity: 0; }
.mk.out { visibility: hidden; }
.mk.fade { opacity: .45; }
.mk.dim { opacity: .2; }
.mk.focus, .mk.sel, .mk:hover { z-index: 4; opacity: 1; }
.mk.sel .lb, .mk.focus .lb { border-color: color-mix(in srgb, var(--blue) 45%, transparent); box-shadow: 0 4px 16px rgba(0,0,0,.14); }
.mk:focus-visible { outline: none; }
.mk:focus-visible .pin { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--blue); }

.map-tip { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; min-width: 200px; max-width: 280px; padding: 10px 12px; border-radius: 12px; font-size: 12px;
  background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 8px 28px rgba(0,0,0,.16); border: 0.5px solid var(--sep); opacity: 0; transition: opacity .15s var(--ease); }
.map-tip.show { opacity: 1; }
.tt-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tt-h b { font-size: 14px; font-weight: 700; }
.tt-h span, .tt-s, .tt-f { color: var(--label-2); font-size: 11px; }
.tt-s { margin-bottom: 4px; }
.tt-r { display: flex; align-items: center; gap: 7px; padding: 3px 0; }
.tt-r span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-r b { font-weight: 600; }
.tt-r small { color: var(--orange); font-size: 10px; }
.tt-f { margin-top: 6px; padding-top: 6px; border-top: 0.5px solid var(--sep); }

.map-ctl { position: absolute; right: 12px; bottom: 12px; z-index: 5; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden;
  background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 2px 12px rgba(0,0,0,.1); border: 0.5px solid var(--sep); }
.map-ctl button { width: 34px; height: 34px; display: grid; place-items: center; color: var(--label); transition: background-color .15s; }
.map-ctl button + button { border-top: 0.5px solid var(--sep); }
.map-ctl button:hover { background: var(--fill); }
.map-ctl svg { width: 16px; height: 16px; }
.map-toast { position: absolute; left: 50%; top: 12px; z-index: 7; transform: translate(-50%, -6px); padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; pointer-events: none;
  background: color-mix(in srgb, var(--label) 82%, transparent); color: var(--card); opacity: 0; transition: opacity .2s var(--ease), transform .3s var(--spring); white-space: nowrap; }
.map-toast.show { opacity: 1; transform: translate(-50%, 0); }
.map-hint { position: absolute; left: 12px; bottom: 12px; z-index: 5; padding: 6px 11px; border-radius: 999px; font-size: 12px; color: var(--label-2); pointer-events: none;
  background: color-mix(in srgb, var(--card) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 0.5px solid var(--sep); transition: opacity .4s var(--ease); animation: fade .6s 1s var(--ease) both; }
.map-hint.gone { opacity: 0; }

.map-panel { position: absolute; top: 12px; right: 12px; bottom: 12px; width: 320px; z-index: 6; overflow: auto; overscroll-behavior: contain; padding: 14px 14px 12px; border-radius: 16px;
  background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: 0 10px 40px rgba(0,0,0,.16); border: 0.5px solid var(--sep);
  opacity: 0; transform: translateX(16px) scale(.98); pointer-events: none; visibility: hidden; transition: opacity .25s var(--ease), transform .4s var(--spring), visibility 0s .25s; }
.map-panel.show { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .25s var(--ease), transform .4s var(--spring); }
.mp-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mp-k { font-size: 12px; font-weight: 600; color: var(--label-2); }
.mp-t { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.mp-tag { font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, transparent); padding: 2px 8px; border-radius: 999px; letter-spacing: 0; }
.mp-x { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; color: var(--label-2); }
.mp-x:hover { background: var(--fill-2); color: var(--label); }
.mp-x svg { width: 14px; height: 14px; }
.mp-sub { font-size: 12px; color: var(--label-2); margin: 6px 0 10px; }
.mp-route { margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: var(--fill); font-size: 12px; display: grid; gap: 4px; }
.mp-route > div { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mp-route b { font-weight: 600; }
.mp-n { padding: 12px 0 2px; }
.mp-n + .mp-n { border-top: 0.5px solid var(--sep); margin-top: 8px; }
.mp-nh { display: flex; align-items: center; gap: 7px; }
.mp-nh b { font-size: 14px; font-weight: 650; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-g { font-size: 11px; color: var(--label-2); background: var(--fill); border-radius: 999px; padding: 1px 7px; flex: none; }
.mp-go { margin-left: auto; flex: none; font-size: 12px; font-weight: 600; color: var(--blue); display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 8px; }
.mp-go:hover { background: color-mix(in srgb, var(--blue) 10%, transparent); }
.mp-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.mp-kv div { background: var(--fill); border-radius: 10px; padding: 6px 8px; }
.mp-kv span { display: block; font-size: 10px; color: var(--label-2); }
.mp-kv b { font-size: 15px; font-weight: 650; }
.spk-w { margin-top: 8px; color: var(--green); }
.spk-w.c-warn { color: var(--orange); }
.spk-w.c-bad { color: var(--red); }
.spk-w.c-off { color: var(--label-3); }
.spk { display: block; width: 100%; height: 44px; overflow: visible; }
.spk .l { fill: none; stroke: currentColor; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spk .a { fill: currentColor; opacity: .12; }
.spk .x rect { fill: var(--red); }
.spk-ax { display: flex; justify-content: space-between; font-size: 10px; color: var(--label-3); margin-top: 2px; }
.mp-res { font-size: 11px; color: var(--label-2); margin-top: 6px; }
.mp-rank { display: grid; gap: 2px; margin-bottom: 4px; }
.rk { display: grid; grid-template-columns: 92px 1fr 62px; align-items: center; gap: 8px; padding: 6px 6px; border-radius: 8px; text-align: left; font-size: 12px; }
.rk:hover { background: var(--fill); }
.rk-n { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; }
.rk-n em { font-style: normal; color: var(--label-2); font-weight: 500; font-size: 11px; }
.rk-b { height: 5px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.rk-b i { display: block; height: 100%; border-radius: 3px; background: var(--green); transition: width .8s var(--spring); }
.rk-b i.bg-warn { background: var(--orange); }
.rk-b i.bg-bad { background: var(--red); }
.rk-b i.bg-off { background: var(--label-3); }
.rk b { text-align: right; font-weight: 600; }

.map-list { display: none; }
.ml { display: inline-flex; align-items: center; gap: 6px; text-align: left; padding: 6px 8px; border-radius: 10px; min-width: 0; }
.ml:hover, .ml.on { background: var(--fill); }
.km-node-card.map-sel { box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 55%, transparent), var(--shadow); }

.map-card.fs { border-radius: 0; padding: 20px 24px; display: flex; flex-direction: column; width: 100vw; height: 100vh; overflow: auto; background: var(--bg); }
.map-card.fs .map-body { flex: 1; display: flex; min-height: 0; margin: 12px 0 0; }
.map-card.fs .map-stage { flex: 1; aspect-ratio: auto; height: auto; min-height: 0; background: var(--card); }

.map-card { --map-ok: #21843b; --map-warn: #9b5b00; --map-bad: #c62828; }
:root[data-theme="dark"] .map-card { --map-ok: #30d158; --map-warn: #ff9f0a; --map-bad: #ff453a; }
.map-card .c-ok { color: var(--map-ok); }
.map-card .c-warn { color: var(--map-warn); }
.map-card .c-bad { color: var(--map-bad); }
.map-card .c-unknown, .mk.lv-unknown .lv { color: var(--label-2); }
.lg.lv-unknown, .mk.lv-unknown .pin { background: var(--label-2); }
.mk.lv-unknown .pin::after { animation: none; }
.mk.lv-warn .lv { color: var(--map-warn); }
.mk.lv-bad .lv { color: var(--map-bad); }
.map-card .spk-ax { color: var(--label-2); }
.map-card:not(.motion-on) .pin::after { animation: none; }
@media (max-width: 900px) and (min-width: 601px) {
  .map-bar { align-items: flex-start; }
  .map-panel { width: 280px; }
  .map-lg { gap: 7px; }
}

.empty { text-align: center; color: var(--label-2); padding: 80px 0; font-size: 17px; }

.km-footer { padding: 56px 0 48px; text-align: center; font-size: 12px; color: var(--label-3); }
.km-footer a { color: var(--label-2); }

/* Sheet */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.25); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%); animation: fade .35s var(--ease) both; }
:root[data-theme="dark"] .scrim { background: rgba(0, 0, 0, 0.55); }
.sheet {
  position: fixed; z-index: 41; left: 50%; top: 50%; width: min(760px, calc(100vw - 48px)); max-height: calc(100vh - 64px);
  transform: translate(-50%, -50%); background: var(--bg); border-radius: 28px; overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column;
  animation: pop .5s var(--spring) both;
}
.sheet.closing { animation: popOut .25s var(--ease) both; }
.scrim.closing { animation: fadeOut .25s var(--ease) both; }
.sh-bar { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 8px; gap: 12px; }
.sh-body { overflow-y: auto; padding: 0 24px 28px; overscroll-behavior: contain; }
.sh-loc { font-size: 13px; font-weight: 600; color: var(--label-2); display: flex; gap: 8px; align-items: center; }
.sh-title { font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.025em; margin: 2px 0 0; line-height: 1.15; word-break: break-word; }
.sh-meta { font-size: 13px; color: var(--label-2); margin-top: 4px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.stat { background: var(--card); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat .k { font-size: 12px; font-weight: 600; color: var(--label-2); }
.stat .v { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }
.stat .v small { font-size: 13px; color: var(--label-2); font-weight: 500; margin-left: 2px; }
.stat .s { font-size: 12px; color: var(--label-2); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-h { display: flex; align-items: center; justify-content: space-between; margin: 28px 4px 10px; gap: 12px; }
.grp-h h3 { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.seg { display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; position: relative; }
.seg button { position: relative; z-index: 1; height: 28px; padding: 0 14px; font-size: 13px; font-weight: 500; border-radius: 7px; color: var(--label); transition: color .2s; }
.seg button.on { background: var(--card); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); font-weight: 600; }
:root[data-theme="dark"] .seg button.on { background: #636366; }
.panel { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.chart { padding: 14px 16px 6px; position: relative; }
.chart + .chart { border-top: 0.5px solid var(--sep); }
.ch-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ch-h b { font-size: 15px; font-weight: 600; }
.ch-h span { font-size: 13px; color: var(--label-2); }
.ch-h .lg { display: inline-flex; gap: 12px; flex: none; white-space: nowrap; width: auto; height: auto; border-radius: 0; background: none; }
.ch-h .lg i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
canvas.cv { display: block; width: 100%; height: 120px; margin-top: 8px; }
.tip {
  position: absolute; pointer-events: none; z-index: 3; padding: 7px 10px; border-radius: 10px; font-size: 12px; line-height: 1.5; white-space: nowrap;
  background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 6px 24px rgba(0,0,0,.14); border: 0.5px solid var(--sep);
  transform: translate(-50%, -100%); opacity: 0; transition: opacity .15s;
}
.tip.show { opacity: 1; }
.tip .t { color: var(--label-2); }
.list .row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; min-height: 46px; font-size: 15px; }
.list .row + .row { border-top: 0.5px solid var(--sep); margin-left: 16px; padding-left: 0; }
.list .k { color: var(--label); flex: none; }
.list .v { color: var(--label-2); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.lat .row { display: grid; grid-template-columns: 1fr auto; row-gap: 6px; }
.lat .name { display: flex; align-items: center; gap: 8px; }
.lat .name i { width: 8px; height: 8px; border-radius: 50%; }
.lat .val { font-weight: 600; text-align: right; }
.lat .val small { font-weight: 400; color: var(--label-2); margin-left: 6px; font-size: 13px; }
.lat .bar { grid-column: 1 / -1; margin: 0; height: 3px; }
.note { font-size: 13px; color: var(--label-2); margin: 8px 16px 0; }
.loading { height: 120px; display: grid; place-items: center; color: var(--label-3); font-size: 13px; }

@keyframes in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes pulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.96); } }
@keyframes popOut { to { opacity: 0; transform: translate(-50%, -48%) scale(.97); } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(100%); } }

@media (max-width: 860px) {
  .widgets { grid-template-columns: 1fr 1fr; }
  .widgets .widget:last-child { grid-column: 1 / -1; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .km-navbar { padding: 44px 0 22px; }
  .hd-title { font-size: 34px; }
  .hd-sub { font-size: 15px; }
  .widgets { gap: 12px; margin-bottom: 32px; }
  .widget { padding: 14px 16px 16px; border-radius: 18px; }
  .w-v { font-size: 26px; }
  .km-instance-server-list { grid-template-columns: 1fr; gap: 12px; }
  .km-node-card { padding: 18px 16px 16px; }
  .map { margin-bottom: 32px; }
  .map-card { padding: 16px 14px 14px; border-radius: 18px; }
  .map-lg { display: none; }
  .map-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px; }
  .chips::-webkit-scrollbar { display: none; }
  .tgls { justify-content: flex-start; }
  .map-body { margin: 10px -6px 0; }
  .map-stage { min-height: 0; aspect-ratio: 4 / 3; border-radius: 12px; }
  .mk .lb { font-size: 10px; padding: 2px 6px; }
  .mk .lb b { font-size: 10px; }
  .mk .lv { font-size: 9px; }
  .mk .pin { width: 8px; height: 8px; left: 10px; top: 10px; border-width: 1.5px; }
  .mk.lv-src .pin { width: 10px; height: 10px; left: 9px; top: 9px; }
  .map-ctl { right: 8px; bottom: 8px; }
  .map-ctl button { width: 36px; height: 36px; }
  .map-hint { left: 8px; bottom: 8px; font-size: 11px; }
  .map-tip { display: none; }
  .map-panel { position: relative; top: auto; right: auto; bottom: auto; width: auto; margin-top: 10px; max-height: none; overflow: visible; box-shadow: none; background: var(--fill); backdrop-filter: none; -webkit-backdrop-filter: none; border: 0;
    display: none; transform: none; }
  .map-panel.show { display: block; animation: in .45s var(--spring) both; }
  .map-panel .mp-kv div, .map-panel .mp-route, .map-panel .mp-g, .map-panel .rk-b { background: var(--card); }
  .map-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; margin-top: 10px; padding-top: 10px; border-top: 0.5px solid var(--sep); font-size: 13px; }
  .ml b { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ml span { color: var(--label-2); white-space: nowrap; }
  .ml span.c-warn { color: var(--orange); }
  .ml span.c-bad { color: var(--red); }
  .ml span.c-src { color: var(--blue); }
  .map-ctl { flex-direction: row; }
  .map-ctl button + button { border-top: 0; border-left: 0.5px solid var(--sep); }
  .map-ctl button { width: 34px; height: 34px; }
  .map-hint { right: 8px; left: 8px; bottom: 50px; text-align: center; }

  .chip, .tgl { min-height: 44px; }
  .map-ctl button { width: 44px; height: 44px; }
  .mp-x, .mp-go { min-width: 44px; min-height: 44px; }
  .ml { min-height: 44px; }
  .map-hint { bottom: 60px; font-size: 10px; }
  .map-card.fs .map-body { display: block; flex: none; }
  .map-card.fs .map-stage { height: 55vh; }

  .ml { flex-wrap: wrap; gap: 3px 6px; align-content: center; }
  .ml b { flex-basis: calc(100% - 20px); }
  .ml span { margin-left: 14px; font-size: 11px; }
  .sheet {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 92vh; transform: none;
    border-radius: 14px 14px 0 0; animation: up .5s var(--spring) both;
  }
  .sheet.closing { animation: down .28s var(--ease) both; }
  .sheet::before { content: ""; width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); position: absolute; left: 50%; top: 6px; transform: translateX(-50%); }
  .sh-bar { padding: 22px 16px 6px; }
  .sh-body { padding: 0 16px calc(28px + env(safe-area-inset-bottom)); }
  .sh-title { font-size: 26px; }
  .q-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .q-card { padding: 11px 12px; border-radius: 14px; }
  .q-h { flex-direction: column; align-items: flex-start; gap: 4px; }
  .q-h .pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: 11px; padding: 2px 8px; }
  .q-h b { font-size: 18px; }
  .q-s { font-size: 11px; }
  .q-n { display: none; }
  .t-list .t-row { grid-template-columns: minmax(0, 1fr) auto; min-height: 44px; }
  .t-day { grid-column: 1 / -1; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
