/* GhostWorker control app.
 *
 * One visual rule, from SPEC section 7: a full-width band at the top of every
 * page carrying the project name and client, its colour derived from a hash of
 * the slug. Everything else stays plain and dense.
 *
 * No framework, no bundler, no build step. Hand-written, and meant to stay
 * readable by whoever inherits it.
 */

:root {
  --ink: #14171a;
  --ink-soft: #4a5158;
  --ink-faint: #7b848c;
  --page: #fbfbfa;
  --card: #ffffff;
  --line: #e3e5e8;
  --line-strong: #cfd3d8;
  --accent: #1f5f8b;
  --accent-soft: #eef4f8;
  --overdue: #a12b23;
  --overdue-soft: #fdf0ef;
  --today: #9a5b06;
  --today-soft: #fdf5e8;
  --good: #1d6b45;
  --good-soft: #eef7f2;

  --band-bg: #2c3238;
  --band-accent: #495159;
  --band-tint: #f4f5f6;
  --band-border: #dde0e3;

  --radius: 8px;
  --radius-small: 5px;
  --shadow: 0 1px 2px rgba(20, 23, 26, 0.06), 0 4px 14px rgba(20, 23, 26, 0.05);
  --shadow-lift: 0 2px 6px rgba(20, 23, 26, 0.08), 0 12px 32px rgba(20, 23, 26, 0.10);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eaed;
    --ink-soft: #a9b1b8;
    --ink-faint: #7d868e;
    --page: #14171a;
    --card: #1c2024;
    --line: #2c3238;
    --line-strong: #3a4148;
    --accent: #6fb2dd;
    --accent-soft: #1b2a35;
    --overdue: #e88b83;
    --overdue-soft: #2e1c1a;
    --today: #e0ac5c;
    --today-soft: #2c2417;
    --good: #7cc9a0;
    --good-soft: #17271f;
    --band-tint: #1c2024;
    --band-border: #2c3238;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, 0.45), 0 12px 32px rgba(0, 0, 0, 0.35);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

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

/* --------------------------------------------------------------------------
   the project band
   -------------------------------------------------------------------------- */

.band {
  background: var(--band-bg);
  color: #fff;
  padding: 14px 0 13px;
  border-bottom: 3px solid var(--band-accent);
  transition: background 320ms var(--ease), border-color 320ms var(--ease);
}

.band-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.band-project {
  font-size: 19px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.band-client {
  font-size: 14px;
  opacity: 0.86;
}

.band-meta {
  margin-left: auto;
  font-size: 13px;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   navigation
   -------------------------------------------------------------------------- */

.nav {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav a {
  display: block;
  padding: 11px 13px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 140ms var(--ease), border-color 140ms var(--ease),
    background 140ms var(--ease);
}

.nav a:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

.nav a[aria-current='page'] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 560;
}

/* --------------------------------------------------------------------------
   layout
   -------------------------------------------------------------------------- */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 20px 80px;
}

h1 {
  font-size: 22px;
  font-weight: 640;
  letter-spacing: -0.015em;
  margin: 0 0 4px;
}

h2 {
  font-size: 16px;
  font-weight: 620;
  margin: 30px 0 10px;
}

h3 {
  font-size: 14px;
  font-weight: 620;
  margin: 20px 0 6px;
}

.lede {
  color: var(--ink-soft);
  margin: 0 0 22px;
  max-width: 68ch;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  transition: box-shadow 180ms var(--ease), transform 180ms var(--ease),
    border-color 180ms var(--ease);
}

a.card {
  display: block;
  color: inherit;
  text-decoration: none;
}

a.card:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.card-title {
  font-weight: 600;
  font-size: 15px;
}

.card-sub {
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 4px;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.spacer {
  flex: 1;
}

/* --------------------------------------------------------------------------
   pills and status
   -------------------------------------------------------------------------- */

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}

.pill.overdue {
  background: var(--overdue-soft);
  color: var(--overdue);
}

.pill.today {
  background: var(--today-soft);
  color: var(--today);
}

.pill.good {
  background: var(--good-soft);
  color: var(--good);
}

.pill.quiet {
  background: transparent;
  color: var(--ink-faint);
  border: 1px solid var(--line-strong);
}

/* Separates run-together facts on one line without a decorative character. */
.sep::before {
  content: '';
  display: inline-block;
  width: 1px;
  height: 10px;
  margin: 0 9px 0 8px;
  vertical-align: baseline;
  background: var(--line-strong);
}

.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   forms
   -------------------------------------------------------------------------- */

label {
  display: block;
  font-size: 13px;
  font-weight: 580;
  color: var(--ink-soft);
  margin-bottom: 5px;
}

.hint {
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 12.5px;
  margin-top: 4px;
}

input[type='text'],
input[type='datetime-local'],
input[type='number'],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  padding: 8px 10px;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field {
  margin-bottom: 16px;
}

.field-pair {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

button,
.button {
  font: inherit;
  font-size: 14px;
  font-weight: 560;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  padding: 8px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 140ms var(--ease), border-color 140ms var(--ease),
    transform 90ms var(--ease), color 140ms var(--ease);
}

button:hover,
.button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

button:active,
.button:active {
  transform: translateY(1px);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary:hover {
  color: #fff;
  filter: brightness(1.08);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

button.copied {
  border-color: var(--good);
  color: var(--good);
  background: var(--good-soft);
}

/* --------------------------------------------------------------------------
   the prompt blocks
   -------------------------------------------------------------------------- */

.disclosure-toggle {
  border: none;
  background: transparent;
  padding: 0;
  font-weight: 620;
  font-size: 15px;
  color: var(--ink);
}

.disclosure-toggle::before {
  content: '+';
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 17px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 13px;
  margin-right: 4px;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}

.disclosure-toggle[aria-expanded='true']::before {
  content: '\2212';
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.disclosure-toggle:hover {
  color: var(--accent);
}

.disclosure-toggle + div {
  margin-top: 16px;
}

.prompt {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.prompt-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--band-tint);
}

.prompt-label {
  font-size: 13px;
  font-weight: 620;
}

.prompt-note {
  font-size: 12.5px;
  color: var(--ink-faint);
}

.prompt pre {
  margin: 0;
  padding: 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.62;
  white-space: pre;
  overflow-x: auto;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   tables
   -------------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  font-weight: 620;
  background: var(--band-tint);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background 120ms var(--ease);
}

tbody tr:hover {
  background: var(--band-tint);
}

/* --------------------------------------------------------------------------
   notices
   -------------------------------------------------------------------------- */

.notice {
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-small);
  padding: 11px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}

.notice.bad {
  border-left-color: var(--overdue);
  background: var(--overdue-soft);
  color: var(--overdue);
}

.notice.warn {
  border-left-color: var(--today);
  background: var(--today-soft);
  color: var(--today);
}

.empty {
  color: var(--ink-faint);
  padding: 26px 0;
  text-align: center;
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   the how-to-work page
   -------------------------------------------------------------------------- */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 46px;
  border-left: 2px solid var(--line);
  margin-left: 15px;
}

.steps > li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -16px;
  top: -2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 640;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps h3 {
  margin-top: 0;
  font-size: 15px;
}

.steps p {
  margin: 0 0 8px;
  color: var(--ink-soft);
  max-width: 66ch;
}

.screen {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--band-tint);
  padding: 12px 14px;
  margin: 10px 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-soft);
  overflow-x: auto;
}

.screen .caret {
  color: var(--accent);
  user-select: none;
}

.screen-caption {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: -4px 0 12px;
}

kbd {
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  background: var(--card);
}

/* --------------------------------------------------------------------------
   toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: var(--page);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 560;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
  z-index: 60;
  box-shadow: var(--shadow-lift);
}

.toast.shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   loading
   -------------------------------------------------------------------------- */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--line) 25%,
    var(--band-tint) 50%,
    var(--line) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: var(--radius-small);
  height: 58px;
  margin-bottom: 12px;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.fade-in {
  animation: fade 240ms var(--ease) both;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

footer.foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px 40px;
  color: var(--ink-faint);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
