:root {
  --bg-primary: #fafafa;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #ffffff;
  --bg-hover: #f0f0f0;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #737373;
  --text-inverse: #ffffff;
  --accent: #008fa3;
  --accent-hover: #007a8a;
  --accent-subtle: rgba(0, 143, 163, 0.08);
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --radius-sm: 4px;
  --radius-md: 6px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: var(--text-inverse);
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 24px 40px;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  margin-bottom: 2rem;
}

.topnav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text-primary);
}

.brand span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.panel {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.panel-compact {
  padding: 1rem;
}

.hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 0 1.5rem;
}

.kicker {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-header {
  margin: 2.5rem 0 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.packet {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.packet:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.packet .hash {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
  word-break: break-all;
}

.packet .date {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.packet h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.packet h3 a {
  color: var(--text-primary);
  text-decoration: none;
}

.packet h3 a:hover {
  color: var(--accent);
}

.packet p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.packet .action {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.packet .action:hover {
  text-decoration: underline;
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  transition: filter 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.kind-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.kind-badge.bounty { background: #e6f4f6; color: #008fa3; }
.kind-badge.rfq { background: #f8f3e6; color: #8b6914; }
.kind-badge.rfp { background: #f3e8f8; color: #6b2d8b; }
.kind-badge.private_security { background: #f8e8ec; color: #8b1c3b; }
.kind-badge.draft { background: #f0f0f0; color: #555; }
.kind-badge.private { background: #f0f0f0; color: #555; }
.kind-badge.public { background: #e8f5e9; color: #2e7d32; }
.kind-badge.archived { background: #f0f0f0; color: #888; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-open .status-dot { background: var(--accent); }
.status-review .status-dot { background: #d4a017; }
.status-awarded .status-dot { background: #2e8b57; }
.status-closed .status-dot { background: var(--text-muted); }
.status-rejected .status-dot { background: #c41e3a; }

.queue {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.queue th, .queue td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  padding: 0.75rem 0.625rem;
  vertical-align: top;
}

.queue thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom-width: 2px;
}

.queue tbody tr:hover {
  background: var(--bg-hover);
}

.queue tbody tr.private {
  border-left: 3px solid var(--text-muted);
}

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.tab {
  padding: 0.625rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
  color: var(--text-primary);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state p {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.activity-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  padding: 1rem 1.25rem;
}

.activity-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.activity-head strong {
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
}

.activity-head time {
  color: var(--text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.activity-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
}

.meta-cell {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.meta-cell strong {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.meta-cell code,
.meta-cell .mono {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  word-break: break-all;
  color: var(--text-primary);
}

.intake-form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
}

input, select, textarea {
  font-family: var(--font-sans);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.625rem 0.75rem;
  background: var(--bg-tertiary);
  font-size: 0.9375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

textarea {
  min-height: 100px;
  resize: vertical;
}

button[type="submit"] {
  width: fit-content;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--text-inverse);
  cursor: pointer;
  padding: 0.625rem 1.25rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  transition: filter 0.15s;
}

button[type="submit"]:hover {
  filter: brightness(1.1);
}

.footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
}

.error-panel {
  border-color: #f4c2c2;
  background: #fef0f2;
  color: #c41e3a;
}

.error-panel h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.inline-list {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.inline-list a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}

.inline-list a:hover {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-secondary);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
}

@media (max-width: 760px) {
  .topnav-inner { align-items: flex-start; }
  .activity-head { flex-direction: column; gap: 0.25rem; }
  .queue { font-size: 0.875rem; }
  .queue th, .queue td { padding: 0.625rem 0.5rem; }
}

@media (max-width: 640px) {
  .shell { padding: 0 16px 32px; }
  .panel { padding: 1.25rem; }
  .hero h1 { font-size: 1.75rem; }
  .grid { grid-template-columns: 1fr; }
  .tab-bar { overflow-x: auto; }
}
