:root {
  --bg: #15181c; --bg2: #1b1f24; --panel: #20252b; --panel2: #262c33; --line: #323a43;
  --text: #c9d0d7; --strong: #dde3e9; --muted: #85909b; --accent: #8fa3b8;
  --yellow: #f3d36b; --yellow-wash: rgba(243, 211, 107, .12);
  --ok: #6fbf8e; --bad: #e06c6c; --r: 12px; --r-sm: 8px;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --title: Bahnschrift, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 15px/1.5 var(--font); color: var(--text);
  background: radial-gradient(900px 500px at 100% 0, rgba(143, 163, 184, .10), transparent 60%),
              radial-gradient(700px 500px at 0 100%, rgba(243, 180, 107, .06), transparent 60%), var(--bg);
  background-attachment: fixed;
}
h1, h2, h3 { font-family: var(--title); color: var(--strong); font-weight: 600; margin: 0 0 .6em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: .85rem; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px;
  border-bottom: 1px solid var(--line); background: rgba(21, 24, 28, .8); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--strong); text-decoration: none;
  font-family: var(--title); font-size: 1.15rem; }
.brand img { width: 30px; height: 30px; }
.who { display: flex; align-items: center; gap: 10px; }
.who img { width: 30px; height: 30px; border-radius: 50%; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel2);
  color: var(--strong); padding: 8px 14px; border-radius: var(--r-sm); font: inherit; cursor: pointer;
  text-decoration: none; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--yellow); color: #1b1d20; border-color: var(--yellow); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.big { padding: 12px 22px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: default; }

.login { text-align: center; max-width: 520px; margin: 8vh auto; }
.login-logo { width: 96px; height: 96px; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .login-logo { animation: none; } }

.server-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.server { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.server .ic { width: 64px; height: 64px; border-radius: 50%; background: var(--panel2); display: grid;
  place-items: center; font-family: var(--title); font-size: 1.4rem; color: var(--strong); overflow: hidden; }
.server .ic img { width: 100%; height: 100%; }
.server.absent { opacity: .7; }

.guild { display: grid; grid-template-columns: 210px 1fr; gap: 24px; }
.tabs { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 80px; align-self: start; }
.tabs button { text-align: left; background: none; border: 0; color: var(--text); padding: 9px 12px;
  border-radius: var(--r-sm); font: inherit; cursor: pointer; border-left: 3px solid transparent; }
.tabs button:hover { background: var(--panel); }
.tabs button.on { background: var(--panel); color: var(--strong); border-left-color: var(--yellow); }
.guild-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.guild-head img { width: 40px; height: 40px; border-radius: 50%; }
.guild-head h1 { margin: 0; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px;
  margin-bottom: 16px; }
.card > h2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin: 0 0 16px; }
.field > label { display: block; color: var(--strong); margin-bottom: 6px; font-weight: 500; }
.field .hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
input[type=text], input[type=number], input[type=url], select, textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--strong); border-radius: var(--r-sm);
  padding: 8px 10px; font: inherit; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--yellow); }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 12px; background: var(--line);
  position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked { background: var(--yellow); }
.switch input:checked::after { transform: translateX(18px); background: #1b1d20; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 6px 3px 10px; font-size: .9rem; }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; }
.chip button:hover { color: var(--bad); }

.rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; } .row > .narrow { flex: 0 0 110px; } .row > .x { flex: 0 0 auto; }

.section { margin-bottom: 28px; }
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-wrap .bar { fill: #a8851f; transition: fill .1s; }
.chart-wrap .bar.on { fill: var(--yellow); }
.chart-wrap .grid { stroke: var(--line); stroke-width: 1; }
.chart-wrap .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart-tip { position: absolute; pointer-events: none; background: var(--bg2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 6px 10px; font-size: .85rem; white-space: nowrap; transform: translate(-50%, -110%); }
.chart-tip b { color: var(--strong); }
.seg { display: inline-flex; gap: 4px; background: var(--bg2); border-radius: var(--r-sm); padding: 3px; }
.seg button { background: none; border: 0; color: var(--text); padding: 5px 12px; border-radius: 6px; cursor: pointer; font: inherit; }
.seg button.on { background: var(--panel2); color: var(--strong); }
details summary { cursor: pointer; color: var(--muted); margin-top: 10px; }
.savebar { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .85rem; }
.av { width: 26px; height: 26px; border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--yellow); }

.stat { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat div { background: var(--bg2); border-radius: var(--r-sm); padding: 12px; }
.stat b { display: block; font-family: var(--title); font-size: 1.3rem; color: var(--strong); }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: var(--panel2); }
.pill.on { background: var(--yellow-wash); color: var(--yellow); }
.pill.bad { color: var(--bad); }
.tag { font-size: .8rem; padding: 1px 8px; border-radius: 6px; background: var(--panel2); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2);
  border: 1px solid var(--line); padding: 10px 18px; border-radius: var(--r); box-shadow: 0 8px 30px rgba(0,0,0,.4);
  z-index: 50; max-width: calc(100% - 32px); }
.toast.bad { border-color: var(--bad); color: var(--bad); }
.toast.ok { border-color: var(--yellow); }

@media (max-width: 760px) {
  .guild { grid-template-columns: 1fr; }
  .tabs { flex-direction: row; overflow-x: auto; position: static; }
  .tabs button { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .tabs button.on { border-bottom-color: var(--yellow); }
  .grid2 { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
}
