:root {
  color-scheme: light dark;
  --bg: #fff;
  --fg: #1a1a1a;
  --muted: #666;
  --warn: #9a6700;
  --warn-bg: #fff8e6;
  --error: #b00020;
  --error-bg: #fdecec;
  --border: #ddd;
  --card-bg: #fafafa;
  --link: #0a5cbf;
}

* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.4;
}

body.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

a { color: var(--link); }
nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.25rem 0 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
nav a, nav button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.25rem;
}
nav form { margin-left: auto; }

h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; margin-top: 2rem; }
.muted { color: var(--muted); }
.warn { color: var(--warn); }
.error { color: var(--error); }
/* Cards: an unstyled list, trouble marked by a coloured left border, not
   colour alone — the status text always says the same thing in words. */
.packages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.package {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 5px solid var(--border);
  border-radius: 4px;
}
.package.is-exception { border-left-color: var(--error); background: var(--error-bg); }
.package.is-stalled { border-left-color: var(--warn); background: var(--warn-bg); }
.package a { text-decoration: none; }
.package .carrier { color: var(--muted); font-size: 0.9rem; }
.package .status { font-size: 0.9rem; }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--border);
}
.timeline li {
  padding: 0.4rem 0 0.4rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.timeline time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--muted);
}

.button, button, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--link);
  border-radius: 4px;
  background: var(--link);
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  cursor: pointer;
}
nav button {
  background: transparent;
  color: var(--fg);
  border: none;
  min-height: 44px;
}

form { display: flex; flex-direction: column; gap: 0.9rem; max-width: 26rem; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.95rem; }
input, select {
  min-height: 44px;
  padding: 0 0.6rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--fg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181a;
    --fg: #eaeaea;
    --muted: #9a9a9a;
    --warn: #e0a72e;
    --warn-bg: #2a2107;
    --error: #ff6b6b;
    --error-bg: #2a1414;
    --border: #333;
    --card-bg: #1f2224;
    --link: #6fb1ff;
  }
  .button, button, input[type="submit"] { color: #0d1117; }
  nav button { color: var(--fg); }
}
