/* Lifted from quickiecoin.com so the console reads as the same product:
   Fredoka for display, Outfit for text, IBM Plex Mono for anything numeric. */

:root {
  color-scheme: light;

  --ink: #10263B;
  --ink-deep: #0E2A47;
  --ink-mid: #3D5570;
  --ink-soft: #4A6076;
  --ink-muted: #687784;
  --ink-faint: #9FB4C9;

  --page: #F4F8FB;
  --surface: #FBFDFE;
  --white: #FFFFFF;

  --line: #E1EAF2;
  --line-strong: #D6E2ED;

  --blue: #4E9CD8;
  --blue-deep: #2E6FA8;
  --blue-soft: #8FC1E8;
  --blue-pale: #DCEBF8;
  --blue-edge: #C6DFF3;

  --mint: #2BDFC5;
  --orange: #F7931A;

  --good: #1F7A4D;
  --good-bg: #E3F4EA;
  --good-line: #B7DFC8;

  --warn: #8A5A12;
  --warn-bg: #FFF4E3;
  --warn-line: #F5DDB4;

  --bad: #8A2B2B;
  --bad-bg: #FDF1F1;
  --bad-line: #F3C9C9;

  --shadow-card: 0 20px 40px rgba(16, 38, 59, .1);
  --shadow-blue: 0 12px 24px rgba(78, 156, 216, .35);

  --display: 'Fredoka', system-ui, sans-serif;
  --text: 'Outfit', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The one label style used for every section heading and eyebrow, so the page
   only ever has one way of saying "this is what the thing below is". */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--blue-deep);
  margin: 0;
}

.eyebrow-muted { color: var(--ink-faint); }

/* Admin badge. Deliberately loud: this page writes to live machine records. */
.badge-admin {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* Buttons ---------------------------------------------------------------- */

.btn {
  font-family: var(--display);
  font-weight: 500;
  font-size: 15px;
  border-radius: 999px;
  padding: 11px 22px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}

.btn:focus-visible {
  outline: 3px solid var(--blue-edge);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
  box-shadow: var(--shadow-blue);
}

.btn-primary:hover { background: var(--blue-deep); }

.btn-quiet {
  background: var(--white);
  color: var(--blue-deep);
  border-color: var(--blue-edge);
}

.btn-quiet:hover { border-color: var(--blue-soft); color: var(--ink); }

.btn-danger {
  background: var(--white);
  color: var(--bad);
  border-color: var(--bad-line);
}

.btn-danger:hover { background: var(--bad-bg); }

.btn-danger-solid {
  background: var(--bad);
  color: var(--white);
  border-color: var(--bad);
}

.btn[disabled] {
  opacity: .55;
  cursor: default;
  box-shadow: none;
}

/* Fields ----------------------------------------------------------------- */

.field-label {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 7px;
}

.field-input {
  width: 100%;
  font-family: var(--text);
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-pale);
}

/* Notices ---------------------------------------------------------------- */

.notice {
  border-radius: 12px;
  border: 1px solid;
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.5;
}

.notice-bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.notice-good { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }

/* Collection run --------------------------------------------------------- */

.run {
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  padding: 26px 26px 22px;
  margin-bottom: 34px;
}

.run .page-head { margin-bottom: 20px; }

.run-ends {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.run-field { position: relative; }

.run-suggestions {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  list-style: none;
  margin: 0;
  padding: 6px;
  background: var(--white);
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  max-height: 14rem;
  overflow-y: auto;
}

.run-suggestions li {
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-mid);
  cursor: pointer;
}

.run-suggestions li:hover,
.run-suggestions li.active { background: var(--blue-pale); color: var(--ink); }

.run-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  counter-reset: run-stop;
}

.route-stop {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  cursor: grab;
  transition: border-color .15s, box-shadow .15s, opacity .15s;
}

.route-stop:hover { border-color: var(--blue-edge); }
.route-stop.dragging { opacity: .45; cursor: grabbing; }
.route-stop.drop-target { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-pale); }

/* Numbered by position, so a reorder renumbers itself. */
.run-seq {
  counter-increment: run-stop;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.run-seq::before { content: counter(run-stop); }
.run-grip { color: var(--ink-faint); font-size: 15px; cursor: grab; }

.run-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.run-pick input { accent-color: var(--blue); width: 16px; height: 16px; }

.route-name {
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-bills {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.run-apple {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
  text-decoration: none;
}

.run-apple:hover { border-color: var(--blue-soft); color: var(--blue-deep); }

/* An unticked stop stays readable but visibly out of the run. */
.route-stop.skipped { opacity: .5; }
.route-stop.skipped .run-seq { background: var(--ink-faint); }

/* The primary action is an anchor, and the theme's .btn was only ever used on
   buttons, so it never had to reset link styling. */
a.btn { text-decoration: none; }

.run-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.run-credit {
  flex: 1 1 100%;
  margin: 0;
  font-size: 11px;
  color: var(--ink-faint);
}

.run-credit a { color: var(--ink-muted); }
.run-skipped + .run-skipped::before { content: ', '; }
.run-ends.busy .field-input { opacity: .6; }

/* Sign-in and sign-out ---------------------------------------------------
   Shared by every page behind the console's sign-in: the markup is the signin
   partial, and these are its styles. */

/* Sign-in. The console behind this is already empty -- the server sends no
   counts until the cookie comes back -- so the scrim is presentation, not
   protection. It blurs a blank page on purpose: nothing flashes into view
   before the reload, and there is nothing underneath to read. */
body.locked { overflow: hidden; }

.signin-scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(16, 38, 59, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.signin {
  position: fixed;
  inset: 0;
  z-index: 41;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow-y: auto;
}

.signin-card {
  width: 100%;
  max-width: 360px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
  text-align: left;
}

.signin-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--blue-pale);
  color: var(--blue-deep);
  font-size: 24px;
  line-height: 1;
}

.signin-title {
  margin: 0;
  font-family: var(--display);
  font-size: 26px;
  color: var(--ink-deep);
}

.signin-blurb {
  margin: 6px 0 22px;
  font-size: 14px;
  color: var(--ink-muted);
}

.signin-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mid);
}

.signin-input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 16px;
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
}

.signin-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-pale);
}

.signin-error {
  margin: 0 0 14px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--bad);
  background: var(--bad-bg);
  border: 1px solid var(--bad-line);
  border-radius: 10px;
}

.signin-button {
  width: 100%;
  padding: 12px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  color: var(--white);
  background: var(--blue-deep);
  border: 0;
  border-radius: 11px;
  cursor: pointer;
}

.signin-button:hover:not(:disabled) { background: var(--ink-deep); }
.signin-button:disabled { opacity: .6; cursor: default; }

@media (prefers-reduced-motion: no-preference) {
  .signin-card { animation: signin-rise .18s ease-out; }
}

@keyframes signin-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Between the console's pages ------------------------------------------- */

/* Two-panel sign-in, and the controls that replaced the single Sign out ------ */

.signin-hint {
  margin: -8px 0 16px;
  font-size: 12px;
  color: var(--ink-muted);
}

.signin-button:disabled { opacity: .6; cursor: default; }

.signin-back {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 9px 16px;
  font: inherit;
  font-size: 14px;
  color: var(--ink-mid);
  background: none;
  border: 0;
  cursor: pointer;
}

.signin-back[hidden], .signin [hidden] { display: none; }

/* Shown while stats cannot be reached and a session is being honoured on trust
   for up to two hours. Writes are off for as long as it is up. */
.session-banner {
  padding: 10px 16px;
  font-size: 14px;
  text-align: center;
  color: var(--bad);
  background: var(--bad-bg);
  border-bottom: 1px solid var(--bad-line);
}
