/* GOTWIC: a winter night. No external fonts or scripts (the CSP allows only this site). */
:root {
  --bg: #0d1218;
  --panel: #151d26;
  --panel-2: #1b2531;
  --line: #273444;
  --text: #dfe7ef;
  --muted: #8b9aab;
  --ice: #8cc8ff;
  --ice-dim: #5b8fbf;
  --ok: #6fcf97;
  --bad: #ff7a6b;
  --warn: #f2c94c;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--ice); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; letter-spacing: .02em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; color: var(--ice); }
h3 { font-size: .95rem; margin: 1rem 0 .4rem; color: var(--muted); }

.top { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem;
  border-bottom: 1px solid var(--line); background: linear-gradient(#111923, var(--bg)); }
.brand { font-weight: 800; letter-spacing: .25em; color: var(--text); }
.top nav { display: flex; gap: 1rem; align-items: center; }
main { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 1rem; }

.card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin-bottom: 1rem; color: var(--text); }
a.card:hover { border-color: var(--ice-dim); text-decoration: none; }
.card.narrow { max-width: 380px; margin: 3rem auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.grid > .card { margin-bottom: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.row.head h1 { margin: 0; }
.name { font-weight: 700; font-size: 1.1rem; }

dl { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; margin: .75rem 0 0; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.badge { font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px;
  background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.badge.online { color: var(--ok); border-color: #2e5a43; }
.badge.offline { color: var(--bad); border-color: #6a2f2a; }
.badge.stopped { color: var(--bad); border-color: #6a2f2a; }
.badge.unknown { color: var(--warn); }
.badge.restarting { color: var(--warn); border-color: #6b5a22; }
.badge.setup { color: var(--warn); border-color: #6b5a22; }
.state-offline { border-color: #6a2f2a; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: var(--bad); }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list.columns { columns: 2 220px; }
.when { color: var(--muted); font-size: .8rem; margin-right: .5rem; font-variant-numeric: tabular-nums; }

form label { display: block; margin-bottom: .9rem; color: var(--muted); font-size: .9rem; }
input[type=text], input[type=password], input[type=email] { display: block; width: 100%; margin-top: .3rem;
  padding: .6rem .7rem; border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
  color: var(--text); font-size: 1rem; }
form label select { display: block; width: 100%; margin-top: .3rem; padding: .6rem .7rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 1rem; }
input:focus { outline: 2px solid var(--ice-dim); border-color: transparent; }
button { padding: .6rem 1.1rem; border-radius: 8px; border: 0; background: var(--ice); color: #08121c;
  font-weight: 700; font-size: .95rem; cursor: pointer; }
button:hover { background: #a9d7ff; }
button.secondary { background: transparent; color: var(--ice); border: 1px solid var(--ice-dim); }
button.link { background: none; color: var(--ice); padding: 0; font-weight: 400; font-size: 1rem; }
form.inline { display: inline; margin: 0; }

a.button { display: inline-block; padding: .45rem 1rem; border-radius: 8px; border: 1px solid var(--ice-dim);
  color: var(--ice); }
a.button:hover { background: var(--panel-2); text-decoration: none; }
.notice { background: var(--panel-2); border: 1px solid var(--ice-dim); border-radius: var(--radius);
  padding: .8rem 1rem; margin-bottom: 1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }

.switches { list-style: none; margin: 0; padding: 0; }
.switches li { border-bottom: 1px solid var(--line); }
.switches li:last-child { border-bottom: 0; }
.switch { display: flex; gap: .9rem; align-items: flex-start; padding: .7rem 0; margin: 0; cursor: pointer;
  color: var(--text); font-size: 1rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.knob { flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative;
  margin-top: .1rem; transition: background .15s; }
.knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + .knob { background: var(--ice-dim); }
.switch input:checked + .knob::after { transform: translateX(18px); background: #eaf5ff; }
.switch input:focus-visible + .knob { outline: 2px solid var(--ice); outline-offset: 2px; }
.switch input:disabled + .knob { opacity: .6; }
.what { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: baseline; }
.what .title { font-weight: 600; }
.what .desc { flex-basis: 100%; color: var(--muted); font-size: .88rem; }
.tag { font-size: .72rem; padding: .05rem .45rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.spend { color: var(--warn); border-color: #6b5a22; }
.savebar { position: sticky; bottom: 0; padding: .8rem 0; background: linear-gradient(transparent, var(--bg) 30%);
  text-align: right; }

.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.tabs a { padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.tabs a.active { background: var(--ice-dim); border-color: var(--ice-dim); color: #08121c; font-weight: 700; }
.tabs a:hover { text-decoration: none; border-color: var(--ice-dim); }
.feature-head { display: flex; gap: .9rem; align-items: flex-start; }
.feature-head .switch { padding: .1rem 0 0; }
.feature details { margin-top: .6rem; }
.feature details.sub { margin: .3rem 0 .3rem .6rem; border-left: 1px solid var(--line); padding-left: .8rem; }
.feature details.sub > summary { color: var(--text); }
.feature summary { cursor: pointer; color: var(--ice); font-size: .9rem; padding: .2rem 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem 1.2rem; margin: .6rem 0 .4rem; }
.fields + .fields { border-top: 1px solid var(--line); padding-top: .9rem; }
.field { display: flex; flex-direction: column; gap: .25rem; }
.field .fieldname { color: var(--text); font-size: .85rem; font-family: ui-monospace, monospace; margin: 0; }
.field input[type=text], .field textarea { margin: 0; width: 100%; padding: .45rem .55rem; border-radius: 6px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: .9rem/1.4 ui-monospace, monospace; }
.field textarea { resize: vertical; }
.field select { width: 100%; padding: .45rem .55rem; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: .9rem; }
.field .fieldname { font-family: inherit; }
.pick { display: flex; gap: .5rem; align-items: center; }
.pick .nth { flex: none; width: 2.2rem; color: var(--muted); font-size: .8rem; }
.field.has-error input, .field.has-error textarea { border-color: var(--bad); }
.check { display: flex; gap: .5rem; align-items: center; color: var(--text); font-size: .85rem;
  font-family: ui-monospace, monospace; margin: 0; }
.help { color: var(--muted); font-size: .8rem; white-space: pre-line; }
.desc.warn { color: var(--warn); }
.actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin: 0 0 1rem; }
button.outline { background: transparent; border: 1px solid var(--ice-dim); padding: .45rem 1rem;
  font-weight: 400; font-size: 1rem; }
button.outline:hover { background: var(--panel-2); }
button.go { color: var(--ok); border-color: #2e5a43; }
button.halt { color: var(--bad); border-color: #6a2f2a; }
.notice.bad { border-color: var(--bad); color: var(--bad); }
.notice.warnbox { border-color: #6b5a22; }
.tag.warn { color: var(--warn); border-color: #6b5a22; display: inline-block; margin-top: .4rem; }

@media (max-width: 520px) {
  h1 { font-size: 1.35rem; }
  main { padding: 1rem 16px 2rem; }
}
.notice p { margin: 0 0 .5rem; }
.notice form.inline { margin: 0; }
.goals { display: flex; flex-direction: column; gap: .35rem; }
.goal { display: grid; grid-template-columns: 2.6rem 8rem minmax(9rem, 1fr) 6rem; gap: .4rem; align-items: center; }
.goal select { width: 100%; padding: .35rem .45rem; }
.rgoal { grid-template-columns: 2.6rem minmax(12rem, 1fr) 6rem; }
.lineups { display: grid; gap: .6rem; overflow-x: auto; }
.lineup { display: grid; grid-template-columns: 8.5rem repeat(6, minmax(0, 1fr)) 5.8rem; gap: .25rem; align-items: center; min-width: 50rem; }
.lineup5 { grid-template-columns: 8.5rem repeat(5, minmax(0, 1fr)) 5.8rem; min-width: 44rem; }
.lineup .lname { font-weight: 600; font-size: .85rem; line-height: 1.15; }
.lineup select { font-size: .8rem; padding-left: .35rem; padding-right: 1.2rem; }
.goalnote { grid-column: 2 / -1; font-size: .85rem; color: var(--muted, #777); margin-top: -.2rem; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .3rem .8rem; }
@media (max-width: 600px) { .goal { grid-template-columns: 2.2rem 1fr; } .goal select:nth-of-type(n+2) { grid-column: 2; } }
.field.wide { grid-column: 1 / -1; }
