/* Towamori console. One material, glass, floating on a soft ambient backdrop. */
:root {
  color-scheme: light dark;
  --bg: #eef0f6;
  --ink: #0f1115;
  --muted: #687080;
  --line: rgba(15, 20, 40, 0.08);
  --field-edge: rgba(15, 20, 40, 0.1);
  --track: rgba(15, 20, 40, 0.08);
  --glass: rgba(255, 255, 255, 0.5);
  --glass-edge: rgba(255, 255, 255, 0.72);
  --seg: rgba(255, 255, 255, 0.9);
  --hover: rgba(255, 255, 255, 0.45);
  --field: rgba(255, 255, 255, 0.72);
  --code: rgba(15, 20, 40, 0.05);
  --solid: #f7f8fb;
  --rim: rgba(255, 255, 255, 0.95);
  --rim-low: rgba(255, 255, 255, 0.3);
  --shadow: 0 1px 2px rgba(20, 28, 70, 0.05), 0 18px 40px -20px rgba(20, 28, 70, 0.3);
  --shadow-sm: 0 1px 2px rgba(20, 28, 70, 0.08), 0 4px 12px -4px rgba(20, 28, 70, 0.16);
  --accent: #3d4fd8;
  --accent-ink: #ffffff;
  --ok: #17a058;
  --warn: #c97a0a;
  --bad: #d63c3c;
  --s0: #3d4fd8;
  --s1: #f08a3c;
  --gap: #f4f5fa;
  --blob1: rgba(61, 79, 216, 0.26);
  --blob2: rgba(56, 189, 248, 0.24);
  --blob3: rgba(244, 114, 182, 0.18);
  --r: 22px;
  --blur: blur(28px) saturate(180%);
  --font: -apple-system, BlinkMacSystemFont, ui-sans-serif, "Segoe UI", "Inter", "Helvetica Neue", Arial, "Hiragino Sans", "Apple SD Gothic Neo", "PingFang SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07080c;
    --ink: #eef0f5;
    --muted: #8a909d;
    --line: rgba(255, 255, 255, 0.07);
    --field-edge: rgba(255, 255, 255, 0.1);
    --track: rgba(255, 255, 255, 0.1);
    --glass: rgba(30, 32, 40, 0.5);
    --glass-edge: rgba(255, 255, 255, 0.08);
    --seg: rgba(255, 255, 255, 0.13);
    --hover: rgba(255, 255, 255, 0.04);
    --field: rgba(255, 255, 255, 0.05);
    --code: rgba(0, 0, 0, 0.32);
    --solid: #15171d;
    --rim: rgba(255, 255, 255, 0.2);
    --rim-low: rgba(255, 255, 255, 0.03);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 48px -24px rgba(0, 0, 0, 0.85);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 16px -6px rgba(0, 0, 0, 0.6);
    --accent: #8d98ff;
    --accent-ink: #0b0d16;
    --ok: #3ddc8a;
    --warn: #f0b24a;
    --bad: #ff6b6b;
    --s0: #8d98ff;
    --s1: #f6a35b;
    --gap: #1b1d24;
    --blob1: rgba(99, 102, 241, 0.34);
    --blob2: rgba(34, 211, 238, 0.14);
    --blob3: rgba(236, 72, 153, 0.14);
  }
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
/* The backdrop the glass sits on: three soft lights, fixed while the page scrolls. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55vmax 45vmax at 8% -8%, var(--blob1), transparent 62%),
    radial-gradient(45vmax 40vmax at 100% 6%, var(--blob2), transparent 60%),
    radial-gradient(55vmax 45vmax at 72% 108%, var(--blob3), transparent 62%),
    var(--bg);
}
a { color: inherit; }
code { font-family: var(--mono); font-size: 0.9em; }
h1 { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.025em; margin: 0; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.015em; margin: 44px 0 14px; }
h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 40px; padding-bottom: 88px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* The material. A translucent pane that blurs what is behind it, with a light rim
   that is brightest at the top left, like the edge of a sheet of glass. */
.glass {
  position: relative;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  border-radius: var(--r);
  box-shadow: var(--shadow), inset 0 1px 0 var(--rim);
}
.glass::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, var(--rim) 0%, transparent 30%, transparent 70%, var(--rim-low) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Floating navigation capsule */
.topbar { position: sticky; top: 0; z-index: 10; padding-top: 14px; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 8px 0 20px; border-radius: 999px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 650; font-size: 17px; letter-spacing: -0.02em; }
.mark { width: 22px; height: 22px; color: var(--ink); flex: none; }
.mark-dot { fill: var(--accent); stroke: var(--gap); stroke-width: 2.4; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav form { margin: 0; }
.nav a, .linkbtn {
  display: inline-flex; align-items: center; height: 42px; padding: 0 16px; border: 0; border-radius: 999px;
  background: none; color: var(--muted); font: 500 14px var(--font); text-decoration: none; cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.nav a:hover, .linkbtn:hover { color: var(--ink); background: var(--hover); }
.nav a.on { color: var(--ink); font-weight: 600; background: var(--seg); box-shadow: var(--shadow-sm), inset 0 1px 0 var(--rim); }

/* Buttons: capsules. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px;
  border: 1px solid var(--glass-edge); border-radius: 999px; background: var(--seg); color: var(--ink);
  font: 600 14.5px var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--rim);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: scale(0.97); }
.btn.primary {
  border-color: color-mix(in srgb, var(--accent) 55%, #fff);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, #fff) 0%, var(--accent) 100%);
  color: var(--accent-ink);
  box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.btn.small { height: 32px; padding: 0 14px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn .plus { font-size: 19px; font-weight: 500; line-height: 1; margin: -2px 0 0 -4px; }
.dangerbtn { color: var(--bad); }

/* Fields */
input {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--field-edge); border-radius: 14px;
  background: var(--field); color: var(--ink); font: 15px var(--font);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 65%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 550; color: var(--muted); }
.stack { display: grid; gap: 16px; }
.narrow { max-width: 460px; }
.card { padding: 22px; }
.card h3 { margin-bottom: 2px; }

/* Messages */
.notice { margin: 0 0 22px; padding: 13px 18px; border-radius: 16px; font-size: 14px; }
.notice.ok { background: color-mix(in srgb, var(--ok) 12%, var(--glass)); }
.notice.bad { background: color-mix(in srgb, var(--bad) 11%, var(--glass)); color: var(--bad); }
.notice.warn { background: color-mix(in srgb, var(--warn) 13%, var(--glass)); }

/* Sign-in: no navigation, one pane in the middle of the screen. */
body.bare main.wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; }
body.bare .notice { width: 100%; max-width: 400px; }
.auth { width: 100%; max-width: 400px; padding: 32px 30px 30px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 18px; letter-spacing: -0.02em; margin-bottom: 28px; }
.auth-brand .mark { width: 28px; height: 28px; }
.auth h1 { font-size: 28px; }
.auth > p { margin: 6px 0 26px; }

/* Page header */
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 26px; }
.pagehead p { margin: 6px 0 0; }
.back { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 14px; font-size: 14.5px; font-weight: 500; color: var(--accent); text-decoration: none; }
.back::before { content: ""; width: 8px; height: 8px; margin-left: 3px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; border-radius: 1px; transform: rotate(45deg); }
.back:hover { opacity: 0.75; }
.withstatus { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* Status */
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status.online { color: var(--ok); }
.status.online i { background: var(--ok); animation: live 2.6s ease-in-out infinite; }
.status.offline { color: var(--bad); }
.status.offline i { background: var(--bad); }
h1 .status {
  padding: 6px 13px; border: 1px solid var(--glass-edge); border-radius: 999px; background: var(--seg);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--rim); letter-spacing: 0;
}
@keyframes live {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 26%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ok) 0%, transparent); }
}

/* Tables live inside a glass panel; the panel does not scroll, the inside does. */
.panel { padding: 6px 0; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-weight: 550; font-size: 12px; color: var(--muted); padding: 10px 20px 9px; white-space: nowrap; }
td { padding: 14px 20px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--hover); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.warn { color: var(--warn); font-weight: 600; }
td.crit { color: var(--bad); font-weight: 650; }
.hosts td:first-child { min-width: 220px; }
.hosts .hostname { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.hosts .hostname .status { font-size: 0; gap: 0; }
.hosts .hostname strong { font-weight: 600; white-space: nowrap; transition: color 0.15s; }
.hosts .hostname:hover strong { color: var(--accent); }
.sub { margin: 3px 0 0 20px; font-size: 12.5px; color: var(--muted); }
.usage { white-space: nowrap; }
.usage .num { display: inline-block; min-width: 3.2em; }
meter {
  -webkit-appearance: none; appearance: none; width: 96px; height: 6px; margin-right: 8px; vertical-align: middle;
  border: 0; border-radius: 999px; background: var(--track); overflow: hidden;
}
meter::-webkit-meter-bar { height: 6px; border: 0; border-radius: 999px; background: var(--track); }
meter::-webkit-meter-optimum-value { border-radius: 999px; background: var(--ok); }
meter::-webkit-meter-suboptimum-value { border-radius: 999px; background: var(--warn); }
meter::-webkit-meter-even-less-good-value { border-radius: 999px; background: var(--bad); }
meter::-moz-meter-bar { border-radius: 999px; background: var(--ok); }
meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--warn); }
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--bad); }
.tag { font-size: 11px; font-weight: 550; padding: 2px 8px; border-radius: 999px; background: var(--track); color: var(--muted); }

/* Empty state */
.empty { text-align: center; padding: 56px 24px 52px; }
.empty .mark { width: 40px; height: 40px; margin-bottom: 16px; }
.empty h2 { margin: 0 0 8px; }
.empty p { color: var(--muted); max-width: 460px; margin: 0 auto 24px; }

/* Server page */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 0 0 30px; padding: 6px; }
.facts div { padding: 14px 16px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 3px 0 0; font-size: 15px; font-weight: 550; }
.rangebar { display: inline-flex; gap: 2px; padding: 4px; margin: 0 0 16px; border-radius: 999px; }
.rangebar button {
  height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--muted);
  font: 500 13.5px var(--font); cursor: pointer; transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.rangebar button:hover { color: var(--ink); }
.rangebar button.on { background: var(--seg); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm), inset 0 1px 0 var(--rim); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 16px; }
.charts .card { padding: 18px 18px 14px; }
.charts h3 { font-size: 14px; }
.chart { position: relative; height: 170px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-dasharray: 2 4; }
.chart .axis text { fill: var(--muted); font: 11px var(--font); }
.chart path.s0 { stroke: var(--s0); }
.chart path.s1 { stroke: var(--s1); }
.chart .ga { stop-color: var(--s0); stop-opacity: 0.3; }
.chart .gb { stop-color: var(--s0); stop-opacity: 0; }
.chart .dot { stroke: var(--gap); stroke-width: 2; }
.chart .dot.s0 { fill: var(--s0); }
.chart .dot.s1 { fill: var(--s1); }
.chart .cursor { stroke: var(--muted); stroke-opacity: 0.6; stroke-dasharray: 3 3; }
.chart .nodata { fill: var(--muted); font: 13px var(--font); }
.tip {
  position: absolute; top: 4px; pointer-events: none; padding: 8px 11px; border: 1px solid var(--glass-edge); border-radius: 12px;
  background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow-sm), inset 0 1px 0 var(--rim); font-size: 12px; white-space: nowrap;
}
.tip b { font-weight: 600; }
.tip .k0::before, .tip .k1::before, .legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.tip .k0::before, .legend .k0::before { background: var(--s0); }
.tip .k1::before, .legend .k1::before { background: var(--s1); }
.legend { display: flex; gap: 14px; margin: -2px 0 6px; font-size: 12px; color: var(--muted); }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; align-items: start; }
.settings .btn { justify-self: start; }
.danger { background: color-mix(in srgb, var(--bad) 6%, var(--glass)); }
.danger h3 { color: var(--bad); }

/* Install steps */
.steps { list-style: none; counter-reset: step; display: grid; gap: 16px; max-width: 820px; margin: 28px 0 0; padding: 0; }
.steps li { counter-increment: step; padding: 22px 24px 22px 72px; }
.steps li::before {
  content: counter(step); position: absolute; left: 24px; top: 22px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 650; font-size: 14px; color: var(--accent-ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.steps h3 { font-size: 16px; margin: 4px 0 2px; }
.steps p { margin: 4px 0 12px; }
.steps p:last-child { margin-bottom: 0; }
.codeblock { display: flex; align-items: center; gap: 10px; padding: 9px 9px 9px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--code); }
.codeblock code { flex: 1; overflow-x: auto; white-space: nowrap; font-size: 13px; }

/* People who ask the system for less transparency, or browsers without
   backdrop blur, get the same layout on solid panes. */
@media (prefers-reduced-transparency: reduce) {
  .glass, .tip, .btn:not(.primary) { background: var(--solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .tip, .btn:not(.primary) { background: var(--solid); }
}
@media (prefers-reduced-motion: reduce) {
  .status.online i { animation: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 26%, transparent); }
  .btn, .nav a, .linkbtn, .rangebar button, input, tbody tr { transition: none; }
}

@media (max-width: 720px) {
  h1 { font-size: 30px; }
  main.wrap { padding-top: 30px; }
  .pagehead { flex-direction: column; align-items: flex-start; }
  .charts { grid-template-columns: 1fr; }
  /* The server list becomes rows: name on top, three numbers underneath. */
  .hosts thead { display: none; }
  .hosts, .hosts tbody, .hosts td { display: block; }
  .hosts tr { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 18px; border-top: 1px solid var(--line); }
  .hosts tr:first-child { border-top: 0; }
  .hosts td { padding: 0; border: 0; }
  .hosts td:first-child { grid-column: 1 / -1; min-width: 0; margin-bottom: 10px; }
  .hosts td.num { text-align: left; font-weight: 550; }
  .hosts td.num::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
  .hosts .opt { display: none; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:first-child { grid-column: 1 / -1; }
  th, td { padding-left: 16px; padding-right: 16px; }
  .bar { padding-left: 16px; }
  .nav a, .linkbtn { padding: 0 12px; }
  .steps li { padding: 20px 18px 20px 62px; }
  .steps li::before { left: 18px; }
}
@media (max-width: 400px) {
  .brand span { display: none; }
}
