:root {
  --bg: #fdf6ee;
  --surface: #fff8f0;
  --border: #e8d5c0;
  --ink: #3d2b1f;
  --ink-soft: #6b4d35;
  --accent: #7a5430;
  --badge-doc-bg: #fff0e0;
  --badge-doc-border: #e8c88a;
  --badge-doc-ink: #8a5c1a;
  --badge-tool-bg: #e8f5e0;
  --badge-tool-border: #a8cc90;
  --badge-tool-ink: #3a6a20;
  --badge-pending-bg: #f0f0f0;
  --badge-pending-border: #d0d0d0;
  --badge-pending-ink: #888;
  --radius: 8px;
  --font-serif: Georgia, "Times New Roman", ui-serif, serif;
  --font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.05em;
  text-decoration: none;
}

.site-subtitle {
  font-size: 12px;
  color: var(--accent);
}

.main {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ── Section headings ── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 14px;
}

.section + .section {
  margin-top: 36px;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.card:hover { border-color: var(--accent); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card:active { opacity: 0.85; }
.card.pending { opacity: 0.65; }

.card-body { flex: 1; }
.card-meta { font-size: 11px; color: var(--accent); margin-bottom: 3px; }
.card-title { font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 8px; }
.card-arrow { color: var(--border); font-size: 18px; padding-left: 14px; flex-shrink: 0; }

/* ── Badges ── */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  font-size: 10px;
  border-radius: 999px;
  padding: 2px 10px;
  border: 1px solid;
}

.badge-doc {
  background: var(--badge-doc-bg);
  border-color: var(--badge-doc-border);
  color: var(--badge-doc-ink);
}

.badge-tool {
  background: var(--badge-tool-bg);
  border-color: var(--badge-tool-border);
  color: var(--badge-tool-ink);
}

.badge-pending {
  background: var(--badge-pending-bg);
  border-color: var(--badge-pending-border);
  color: var(--badge-pending-ink);
}

/* ── Session / Tool pages ── */
.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 24px;
}
.back-link:hover { text-decoration: underline; }
.back-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page-meta { font-size: 12px; color: var(--accent); margin-bottom: 4px; }
.page-title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 24px;
  line-height: 1.2;
}

.prose { max-width: 640px; }
.prose p { margin-bottom: 1em; color: var(--ink-soft); }
.prose h2 { font-size: 17px; font-weight: 600; color: var(--ink); margin: 24px 0 8px; }

.tool-cta {
  display: inline-block;
  margin-top: 32px;
  padding: 12px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s;
}
.tool-cta:hover { border-color: var(--accent); }
.tool-cta:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-cta:active { opacity: 0.85; }

.placeholder-notice {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 8px;
}

/* ── Attachments ── */
.attachments {
  max-width: 640px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.attachments-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

.attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.attachment:hover { border-color: var(--accent); }
.attachment:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.attachment-icon { font-size: 16px; flex-shrink: 0; }
.attachment-name { font-weight: 500; }
