body { padding: 40px 0; }
@media (max-width: 900px) { body { padding: 24px 0; } }
@media (max-width: 600px) { body { padding: 16px 0; } }

.container { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 900px) { .container { padding: 0 20px; } }
@media (max-width: 600px) { .container { padding: 0 16px; } }

nav { margin-bottom: 40px; }
@media (max-width: 900px) { nav { margin-bottom: 24px; } }

.nav-context {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
}
.nav-context-sep { margin-left: 2px; }

/* ── Header ──────────────────────────────────────────────────────────────── */

.hub-header {
  margin-bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.hub-heading {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0;
  color: var(--fg);
}
.hub-sub {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 4px 0 0;
}

/* ── Tools grid ──────────────────────────────────────────────────────────── */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 780px) {
  .tools-grid { grid-template-columns: 1fr; }
}

.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
  box-shadow: var(--shadow-sm);
  min-height: 220px;
}
.tool-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.tool-card:hover .tool-open {
  color: var(--accent-hover);
}
.tool-card:hover .tool-open::after {
  transform: translateX(3px);
}

/* Top row: icon on left, quick actions on right */
.tool-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.tool-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  flex: 0 0 auto;
}

.tool-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.tool-action {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  padding: 0;
}
.tool-action:hover:not([disabled]) {
  color: var(--accent);
  background: var(--accent-faint);
  border-color: var(--accent-soft);
}
.tool-action[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.tool-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg);
  margin: 0 0 8px;
}

.tool-desc {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin: 0 0 20px;
}

/* Capture-hub tile glance — last-7-day scans + captures + most-active
   Loop callout. Sits between the description and the chips so it reads
   as "current state of the page" without distorting the existing
   tile rhythm. */
.tool-stats {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin: 0 0 10px;
  padding: 10px 14px;
  background: var(--accent-faint, rgba(29,78,216,0.06));
  border-radius: 8px;
  flex-wrap: wrap;
}
.tool-stat { display: inline-flex; align-items: baseline; gap: 6px; }
.tool-stat-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: 1;
}
.tool-stat-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.tool-stat-window {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}
.tool-stat-cta {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.4;
}
.tool-stat-cta strong { color: var(--fg); font-weight: 600; }
.tool-stat-quiet { font-style: italic; }

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}
.tool-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.tool-open {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: color 0.15s;
}
.tool-open::after {
  content: '→';
  margin-left: 6px;
  transition: transform 0.18s;
  display: inline-block;
}

/* Empty state */
.tools-empty {
  grid-column: 1 / -1;
  padding: 40px 24px;
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-size: 14px;
}
.tools-empty p { margin: 0; line-height: 1.6; }

/* ── QR quick-view modal ─────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 10, 9, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.modal-panel {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px 24px;
  max-width: 420px;
  width: calc(100% - 32px);
  text-align: center;
  animation: modal-in 0.18s ease-out;
  box-shadow: var(--shadow-lg);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px 10px;
  line-height: 1;
  border-radius: var(--radius);
}
.modal-close:hover { color: var(--fg); background: var(--border-soft); }

.modal-panel h2 {
  color: var(--fg);
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.qr-image {
  width: 100%;
  max-width: 240px;
  background: #fff;
  padding: 12px;
  display: block;
  margin: 0 auto 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.qr-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.qr-caption {
  color: var(--muted);
  font-size: 12px;
  margin-top: 18px;
  line-height: 1.6;
}
.qr-caption code {
  color: var(--accent);
  word-break: break-all;
  background: transparent;
  padding: 0;
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .hub-heading { font-size: 22px; }
  .tool-card { padding: 22px; min-height: 0; }
  .tool-title { font-size: 16px; }
  .tool-desc { font-size: 13px; }
}
