/* Fluxer moves — migration panel.
   Cool fog ground, white paper sheets, one hi-vis yellow reserved for "moving right now". */

:root {
  --fog: #e4e9ee;
  --paper: #fafbfc;
  --ink: #17202a;
  --slate: #566474;
  --line: #c6d0da;
  --route: #2753bf;
  --route-soft: #dfe7f8;
  --hivis: #efb300;
  --done: #2d7f4f;
  --fail: #b23a31;
  --warn-bg: #fff6d9;
  --fail-bg: #fbe9e7;
  --ok-bg: #e5f2ea;
  --font: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--fog); color: var(--ink); font: 16px/1.5 var(--font); font-variant-numeric: tabular-nums; }
body { margin: 0; min-height: 100vh; }
a { color: var(--route); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--route); outline-offset: 2px; border-radius: 2px; }

/* top strip */
.top { background: var(--ink); color: #e9eef3; }
.top-inner { max-width: 1160px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 28px; height: 52px; }
.brand { color: #fff; font-weight: 700; text-decoration: none; letter-spacing: .01em; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 26px; height: 10px; display: inline-flex; gap: 3px; }
.brand-mark i { flex: 1; background: #8aa4e6; border-radius: 1px; }
.brand-mark i:last-child { background: var(--hivis); }
.top nav { display: flex; gap: 4px; }
.top nav a { color: #c3ccd6; text-decoration: none; padding: 6px 10px; border-radius: 4px; }
.top nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.top nav a[aria-current] { color: #fff; box-shadow: inset 0 -2px 0 var(--hivis); border-radius: 0; }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: #9aa6b3; font-size: .9rem; }
.linkish { background: none; border: 0; color: #c3ccd6; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

main { max-width: 1160px; margin: 0 auto; padding: 32px 24px 80px; }

h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 4px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 0 0 12px; max-width: 72ch; }
.muted { color: var(--slate); }
.small { font-size: .875rem; }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 240px; }
.crumb { font-size: .9rem; margin-bottom: 6px; }
.crumb a { color: var(--slate); }

.sheet { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 24px; margin-bottom: 20px; }
.sheet > h2:first-child { margin-top: 0; }
.sheet.flush { padding: 0; overflow: hidden; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 24px; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--slate); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--route); font-weight: 700; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; padding: 9px 16px; border-radius: 5px; border: 1px solid var(--route); background: var(--route); color: #fff; cursor: pointer; text-decoration: none; line-height: 1.2; }
.btn:hover { background: #1f45a3; }
.btn.quiet { background: var(--paper); color: var(--route); }
.btn.quiet:hover { background: var(--route-soft); }
.btn.stop { background: var(--ink); border-color: var(--ink); }
.btn.danger { background: var(--paper); color: var(--fail); border-color: var(--fail); }
.btn.danger:hover { background: var(--fail-bg); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* flash + notes */
.flash { padding: 12px 16px; border-radius: 5px; margin-bottom: 20px; border-left: 4px solid; background: var(--ok-bg); border-color: var(--done); }
.flash.error { background: var(--fail-bg); border-color: var(--fail); }
.note { background: var(--warn-bg); border-left: 4px solid var(--hivis); padding: 12px 16px; border-radius: 4px; margin: 0 0 16px; }

/* the route bar: Discord leg, a hop, then the Fluxer leg */
.route { display: grid; grid-template-columns: 1fr 14px 1fr; align-items: center; gap: 6px; }
.leg { height: 12px; background: #d5dde6; border-radius: 2px; overflow: hidden; position: relative; }
.leg .fill { position: absolute; inset: 0 auto 0 0; background: var(--route); transition: width .6s ease; }
.leg.moving .fill {
  background: repeating-linear-gradient(-45deg, var(--hivis) 0 10px, #f6cf4d 10px 20px);
  background-size: 28px 28px;
  animation: strap 1.2s linear infinite;
}
.leg.failed .fill { background: var(--fail); }
.hop { width: 14px; height: 14px; border-radius: 50%; border: 3px solid #d5dde6; background: var(--paper); }
.hop.passed { border-color: var(--route); }
@keyframes strap { to { background-position: 28px 0; } }
@media (prefers-reduced-motion: reduce) { .leg.moving .fill { animation: none; } .leg .fill { transition: none; } }

.route.big .leg { height: 22px; border-radius: 3px; }
.route.big .hop { width: 22px; height: 22px; border-width: 4px; }
.route.big { grid-template-columns: 1fr 22px 1fr; gap: 10px; }
.route-legend { display: grid; grid-template-columns: 1fr 22px 1fr; gap: 10px; margin-top: 12px; }
.route-legend .side h3 { margin: 0 0 2px; }
.route-legend .side p { margin: 0; color: var(--slate); font-size: .925rem; }
.route-legend .side:last-child { text-align: right; }

/* tables */
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: .85rem; color: var(--slate); font-weight: 700; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #f1f4f7; }
td { padding: 12px 16px; border-bottom: 1px solid #e1e6ec; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.comm-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.comm-name:hover { text-decoration: underline; }
.comm-route { min-width: 220px; width: 32%; }
.status-text { font-size: .925rem; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--line); }
.dot.running { background: var(--hivis); }
.dot.queued { background: var(--route); }
.dot.done { background: var(--done); }
.dot.failed, .dot.interrupted { background: var(--fail); }
.dot.stopped { background: var(--slate); }

.empty { text-align: center; padding: 56px 24px; }
.empty p { margin: 0 auto 16px; }

/* forms */
fieldset { border: 0; padding: 0; margin: 0 0 28px; }
legend { font-weight: 700; font-size: 1.1rem; margin-bottom: 4px; padding: 0; }
.fieldset-help { color: var(--slate); margin: 0 0 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 24px; }
.field label { display: block; font-weight: 700; margin-bottom: 4px; }
.field .hint { display: block; font-size: .85rem; color: var(--slate); margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=url], select {
  width: 100%; font: inherit; padding: 8px 10px; border: 1px solid #aab6c3; border-radius: 4px; background: #fff; color: var(--ink);
}
input:focus, select:focus { border-color: var(--route); outline: 2px solid var(--route-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: 5px; width: 16px; height: 16px; accent-color: var(--route); }
.check span small { display: block; color: var(--slate); font-size: .85rem; }
.radios { display: flex; flex-direction: column; gap: 6px; }
.form-foot { display: flex; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }

/* check results */
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check-card { border: 1px solid var(--line); border-radius: 5px; padding: 14px 16px; background: #fff; }
.check-card.good { border-left: 4px solid var(--done); }
.check-card.bad { border-left: 4px solid var(--fail); }
.check-card ul { margin: 6px 0 0; padding-left: 18px; }

/* channel picker */
.cat { border-top: 1px solid var(--line); padding: 14px 0; }
.cat:first-of-type { border-top: 0; }
.cat > .check { font-weight: 700; }
.chan-list { list-style: none; margin: 8px 0 0; padding: 0 0 0 26px; columns: 2 280px; column-gap: 32px; }
.chan-list li { break-inside: avoid; padding: 3px 0; }
.ctype { color: var(--slate); font-size: .8rem; margin-left: 4px; }

/* log */
.log { background: #1b232d; color: #d6dde5; font: .82rem/1.55 var(--mono); padding: 14px 16px; border-radius: 5px; height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }
.log.tall { height: calc(100vh - 260px); min-height: 400px; }
.log .warn { color: #f3cd6b; }
.log .error { color: #ff9b91; }
.log .debug { color: #8796a6; }
.log .t { color: #7d8b99; }
.log-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.log-head h2 { margin: 0; }
.live { font-size: .85rem; color: var(--slate); }
.live.on::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--hivis); margin-right: 6px; vertical-align: 1px; }

details.more summary { cursor: pointer; color: var(--route); font-weight: 700; padding: 14px 16px; }
details.more[open] summary { border-bottom: 1px solid var(--line); }
.thread-name { color: var(--slate); padding-left: 18px; }

.danger-zone { border-color: #e3b4ae; }
.danger-zone .row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid #f0d6d2; flex-wrap: wrap; }
.danger-zone .row:first-of-type { border-top: 0; }
.danger-zone .row p { margin: 0; }

.auth { max-width: 380px; margin: 12vh auto 0; }
.auth .sheet { padding: 28px; }
.auth .field { margin-bottom: 16px; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 760px) {
  .two, .checks { grid-template-columns: 1fr; }
  .top-inner { gap: 12px; padding: 0 14px; overflow-x: auto; }
  .top .who span { display: none; }
  main { padding: 20px 14px 60px; }
  .sheet { padding: 18px; }
  .hide-sm { display: none; }
  td, th { padding: 10px; }
}

.field label.check { display: flex; font-weight: 400; margin-bottom: 0; }
.field label.check + label.check { margin-top: 8px; }
.brand { white-space: nowrap; }
