/*
 * Base layer: copied from tt-docker-1/bloodandichor/src/index.html <style> (dark site).
 * Light theme: html[data-theme="light"] overrides at bottom.
 */

:root {
  --ichor-crimson: #660000;
  --anima-gold: #c5a059;
  --pitch-black: #080808;
  --text-main: #d1d1d1;
  /* bi-admin header.php — shared table chrome */
  --border-dark: #1a1a1a;
  --bg-raised: #0c0c0c;
}

html[data-theme="light"] {
  --pitch-black: #f4efe6;
  --text-main: #2a2319;
  --bi-nav: #5c5348;
  --bi-line: #c9bda8;
  --bi-surface: #fffdf8;
  --bi-surface-hover: #faf6ef;
  --bi-heading: #1a1510;
  --bi-muted: #777;
  --bi-hero-sub: #660000;
  --footer-bg: #ebe4d8;
}

body {
  background-color: var(--pitch-black);
  color: var(--text-main);
  font-family: "Inter", sans-serif;
  margin: 0;
  overflow-x: hidden;
  line-height: 1.6;
}

html[data-theme="light"] body {
  background-color: var(--pitch-black);
  background-image: linear-gradient(to bottom, #faf6ef, var(--pitch-black));
}

h1,
h2,
h3,
h4,
.header-text-logo {
  font-family: "Cinzel", serif;
  letter-spacing: 2px;
}

/* ——— Header (exact Bi selectors) ——— */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 8%;
  background: rgba(5, 5, 5, 0.98);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #1a1a1a;
}

html[data-theme="light"] header {
  background: rgba(255, 253, 248, 0.96);
  border-bottom-color: var(--bi-line);
}

.header-text-logo {
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
}

html[data-theme="light"] .header-text-logo {
  color: var(--bi-heading);
}

/* Nav: cluster (links + theme) stays on one row with Log out — no wrap between them */
header nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 1rem 1.5rem;
  flex: 1;
  min-width: 0;
}

.header-nav-cluster {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1.25rem;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

nav a {
  color: #888;
  text-decoration: none;
  margin-left: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  transition: 0.3s;
}

html[data-theme="light"] nav a {
  color: var(--bi-nav);
}

nav a:hover {
  color: var(--ichor-crimson);
}

/* Theme button: same visual rhythm as nav links */
header nav .theme-toggle {
  margin-left: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  transition: color 0.3s;
  padding: 0;
}

html[data-theme="light"] header nav .theme-toggle {
  color: var(--bi-nav);
}

header nav .theme-toggle:hover {
  color: var(--ichor-crimson);
}

header nav .header-inline-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

header nav .header-logout-form,
.header-nav-cluster .header-logout-form {
  flex-shrink: 0;
}

header nav .btn-nav-logout {
  margin-left: 0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  transition: color 0.3s;
  padding: 0;
}

html[data-theme="light"] header nav .btn-nav-logout {
  color: var(--bi-nav);
}

header nav .btn-nav-logout:hover {
  color: var(--ichor-crimson);
}

/* ——— Hero (Bi) ——— */
.hero {
  min-height: 38vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: linear-gradient(to bottom, #0d0d0d, #080808);
  padding: 2rem 8%;
}

html[data-theme="light"] .hero {
  background: linear-gradient(to bottom, #faf6ef, #f0ebe3);
}

.hero h1 {
  font-size: clamp(2rem, 8vw, 4rem);
  margin: 0;
  background: linear-gradient(180deg, #fff 0%, #444 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 8px;
}

html[data-theme="light"] .hero h1 {
  background: linear-gradient(180deg, #1a1510 0%, #5c5348 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

.hero p {
  font-size: 1rem;
  color: var(--ichor-crimson);
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-top: 10px;
}

html[data-theme="light"] .hero p {
  color: var(--bi-hero-sub);
}

/* Compact hero (single-recipe page) */
.hero.hero-compact {
  min-height: 0;
  padding: 2.25rem 8% 2rem;
}

.hero-back {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.hero-back a {
  color: var(--anima-gold);
}

.hero-back a:hover {
  color: var(--ichor-crimson);
}

.hero-recipe-title {
  font-size: clamp(1.35rem, 4vw, 2rem);
  margin: 0;
  background: linear-gradient(180deg, #fff 0%, #666 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 4px;
  text-transform: uppercase;
  line-height: 1.25;
  max-width: 36rem;
}

html[data-theme="light"] .hero-recipe-title {
  background: linear-gradient(180deg, #1a1510 0%, #5c5348 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-source {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: #888;
  letter-spacing: 0.04em;
  text-transform: none;
}

.hero-source a {
  color: var(--anima-gold);
  word-break: break-all;
}

/* ——— Overview (Bi) ——— */
.overview {
  padding: 48px 8% 64px;
  text-align: center;
  background: #080808;
}

html[data-theme="light"] .overview {
  background: transparent;
}

.overview p {
  font-size: 1.05rem;
  max-width: 900px;
  margin: 0 auto;
  color: #aaa;
  font-weight: 300;
  line-height: 1.8;
}

html[data-theme="light"] .overview p {
  color: var(--bi-muted);
}

.overview strong {
  color: var(--anima-gold);
}

/* Search row inside overview */
.search-bar {
  display: flex;
  gap: 0.75rem;
  margin: 0 auto 1rem;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 640px;
  text-align: left;
}

.search-bar input[type="search"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #1a1a1a;
  background: #0a0a0a;
  color: var(--text-main);
}

html[data-theme="light"] .search-bar input[type="search"] {
  border-color: var(--bi-line);
  background: var(--bi-surface);
  color: var(--text-main);
}

.search-bar input:focus {
  outline: 1px solid var(--anima-gold);
  outline-offset: 0;
}

.hint {
  font-size: 0.9rem;
  color: #666;
  margin: 0 auto 0;
  max-width: 640px;
  font-weight: 300;
}

html[data-theme="light"] .hint {
  color: #777;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: 0.3s;
}

.btn-primary {
  background: var(--anima-gold);
  color: #080808 !important;
  border-color: var(--anima-gold);
}

.btn-primary:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  color: #aaa !important;
  border-color: #1a1a1a;
}

html[data-theme="light"] .btn-ghost {
  color: var(--bi-nav) !important;
  border-color: var(--bi-line);
}

.btn-ghost:hover {
  border-color: var(--ichor-crimson);
  color: #fff !important;
}

html[data-theme="light"] .btn-ghost:hover {
  color: var(--bi-heading) !important;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.65rem;
}

.btn-danger {
  background: var(--ichor-crimson);
  color: #fff !important;
  border-color: var(--ichor-crimson);
}

.btn-danger:hover {
  filter: brightness(1.15);
  text-decoration: none;
}

.btn-danger-outline {
  background: transparent;
  color: var(--ichor-crimson) !important;
  border-color: var(--ichor-crimson);
}

.btn-danger-outline:hover {
  background: rgba(102, 0, 0, 0.2);
  text-decoration: none;
}

html[data-theme="light"] .btn-danger-outline:hover {
  background: rgba(102, 0, 0, 0.08);
}

.notice-success {
  max-width: 640px;
  margin: 0 auto 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--anima-gold);
  color: var(--anima-gold);
  font-size: 0.95rem;
  text-align: center;
}

.delete-zone {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #1a1a1a;
  max-width: 640px;
}

html[data-theme="light"] .delete-zone {
  border-top-color: var(--bi-line);
}

.delete-zone-title {
  font-family: "Cinzel", serif;
  font-size: 1rem;
  color: var(--ichor-crimson);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}

.delete-zone .lead {
  margin-bottom: 1rem;
}

/* Screen-reader only (table action column label) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Admin tags page: wider layout + visible grid (bi-admin kindreds-style) */
.form-page.admin-tags-page {
  max-width: 960px;
}

/* Admin: tag table — match bi-admin kindreds.php table (header.php) */
.admin-tag-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  margin: 1.75rem 0 0;
  text-align: left;
}

.admin-tag-table thead {
  background: var(--bg-raised);
}

html[data-theme="light"] .admin-tag-table thead {
  background: #ebe4d8;
}

.admin-tag-table th,
.admin-tag-table td {
  border: 1px solid var(--border-dark);
  padding: 12px 16px;
  background: var(--bg-raised);
  vertical-align: middle;
}

.admin-tag-table tbody td {
  font-size: 0.95rem;
  line-height: 1.45;
}

.admin-tag-table th {
  color: var(--anima-gold);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: left;
}

.admin-tag-table th:nth-child(1) {
  width: 44%;
}

.admin-tag-table th:nth-child(2) {
  width: 36%;
}

.admin-tag-table th.admin-tag-col-actions {
  width: 20%;
  text-align: right;
}

html[data-theme="light"] .admin-tag-table th,
html[data-theme="light"] .admin-tag-table td {
  border-color: #a89880;
  background: #faf8f4;
}

html[data-theme="light"] .admin-tag-table tbody td {
  background: #faf8f4;
}

.admin-tag-table tbody tr:nth-child(even) td {
  background: var(--bg-raised);
}

html[data-theme="light"] .admin-tag-table tbody tr:nth-child(even) td {
  background: #f4f0e8;
}

.admin-tag-table tr:hover td {
  background: #0e0e0e !important;
}

html[data-theme="light"] .admin-tag-table tr:hover td {
  background: #ede8de !important;
}

.admin-tag-actions {
  text-align: right;
  vertical-align: middle;
}

.admin-tag-delete-form {
  margin: 0;
  display: inline-block;
}

.admin-tag-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  margin: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  color: #dc2626;
  transition: color 0.2s, background 0.2s;
}

.admin-tag-delete-btn:hover,
.admin-tag-delete-btn:focus-visible {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.12);
  outline: none;
}

html[data-theme="light"] .admin-tag-delete-btn:hover,
html[data-theme="light"] .admin-tag-delete-btn:focus-visible {
  background: rgba(220, 38, 38, 0.1);
}

.admin-tag-delete-icon {
  display: block;
}

.admin-tags-back {
  margin-top: 2rem;
}

/* ——— Anatomy section + cards (Bi) ——— */
.anatomy-section {
  padding: 60px 8% 100px;
  background: #080808;
  text-align: center;
}

html[data-theme="light"] .anatomy-section {
  background: transparent;
}

.anatomy-section > h2 {
  font-size: 2rem;
  color: #fff;
  margin: 0 0 0.5rem;
}

html[data-theme="light"] .anatomy-section > h2 {
  color: var(--bi-heading);
}

.anatomy-section .section-sub {
  color: #555;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin: 0 0 2rem;
}

.anatomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  margin-top: 40px;
  text-align: left;
}

.recipe-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 20px;
  text-align: left;
}

.anatomy-card {
  padding: 30px;
  border-left: 2px solid #1a1a1a;
  transition: 0.3s;
}

html[data-theme="light"] .anatomy-card {
  border-left-color: var(--bi-line);
  background: var(--bi-surface);
}

.anatomy-card:hover {
  border-left-color: var(--ichor-crimson);
  background: #0c0c0c;
}

html[data-theme="light"] .anatomy-card:hover {
  background: var(--bi-surface-hover);
}

.anatomy-card h4 {
  color: #fff;
  margin-bottom: 15px;
  font-size: 1rem;
  font-family: "Cinzel", serif;
}

.anatomy-card h2 {
  color: #fff;
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-family: "Cinzel", serif;
  letter-spacing: 3px;
  text-transform: uppercase;
}

html[data-theme="light"] .anatomy-card h2,
html[data-theme="light"] .anatomy-card h4 {
  color: var(--bi-heading);
}

.anatomy-card h3 {
  margin: 1.25rem 0 0.5rem;
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--anima-gold);
}

.anatomy-card p,
.anatomy-card pre {
  color: #777;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.65;
}

.anatomy-card pre {
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.recipe-meta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #1a1a1a;
  font-size: 0.85rem;
  color: #888;
}

html[data-theme="light"] .recipe-meta {
  border-top-color: var(--bi-line);
}

.recipe-meta a {
  color: var(--anima-gold);
}
.recipe-meta a:hover {
  color: var(--ichor-crimson);
}

.recipe-toolbar {
  margin-top: 1rem;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 1px dashed #1a1a1a;
  background: #0a0a0a;
  color: #888;
  max-width: 560px;
  margin: 2rem auto 0;
  font-weight: 300;
}

html[data-theme="light"] .empty-state {
  border-color: var(--bi-line);
  background: var(--bi-surface);
  color: var(--bi-muted);
}

.empty-state strong {
  color: var(--anima-gold);
}

.empty-state a {
  color: var(--anima-gold);
  font-weight: 700;
}

/* ——— Forms (recipe pages) ——— */
.form-page {
  padding: 48px 8% 80px;
  max-width: 720px;
  margin: 0 auto;
  background: #080808;
}

html[data-theme="light"] .form-page {
  background: transparent;
}

.form-page h1 {
  font-size: 1.75rem;
  color: #fff;
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 4px;
}

html[data-theme="light"] .form-page h1 {
  color: var(--bi-heading);
}

.form-page .lead {
  color: #aaa;
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

html[data-theme="light"] .form-page .lead {
  color: var(--bi-muted);
}

.form-page .lead strong {
  color: var(--anima-gold);
  font-weight: 700;
}

.import-page {
  max-width: 52rem;
}

.import-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid #1a1a1a;
}

.import-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

html[data-theme="light"] .import-section {
  border-top-color: var(--bi-line);
}

.import-subheading {
  font-family: "Cinzel", serif;
  font-size: 1.1rem;
  color: #fff;
  margin: 0 0 0.5rem;
  letter-spacing: 2px;
}

html[data-theme="light"] .import-subheading {
  color: var(--bi-heading);
}

.import-json-textarea {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.8rem;
  line-height: 1.5;
}

.import-json-error-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: #e8b4b4;
  font-size: 0.9rem;
}

html[data-theme="light"] .import-json-error-list {
  color: #883333;
}

.import-json-example {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: #888;
}

html[data-theme="light"] .import-json-example {
  color: var(--bi-muted);
}

.import-json-pre {
  margin: 0.75rem 0 0;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.75rem;
  line-height: 1.5;
  border: 1px solid #1a1a1a;
  background: #0a0a0a;
  color: #ccc;
}

html[data-theme="light"] .import-json-pre {
  border-color: var(--bi-line);
  background: var(--bi-surface);
  color: var(--text-main);
}

.import-json-form input[type="file"] {
  width: 100%;
  max-width: 100%;
  font-size: 0.9rem;
  color: var(--text-main);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-stack label {
  font-family: "Cinzel", serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--anima-gold);
}

.field-label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.field-hint {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #888;
  font-weight: 300;
}

.field-hint code {
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  color: var(--anima-gold);
  border: 1px solid #1a1a1a;
  background: #0a0a0a;
}

html[data-theme="light"] .field-hint code {
  border-color: var(--bi-line);
  background: var(--bi-surface);
}

.form-stack input[type="text"],
.form-stack input[type="url"],
.form-stack input[type="password"],
.form-stack textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #1a1a1a;
  background: #0a0a0a;
  color: var(--text-main);
}

html[data-theme="light"] .form-stack input,
html[data-theme="light"] .form-stack textarea {
  border-color: var(--bi-line);
  background: var(--bi-surface);
}

.form-stack textarea {
  min-height: 160px;
  resize: vertical;
}

.form-stack input:focus,
.form-stack textarea:focus {
  outline: 1px solid var(--anima-gold);
  outline-offset: 0;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.alert-error {
  padding: 0.85rem 1rem;
  background: rgba(102, 0, 0, 0.2);
  color: #e88;
  margin-bottom: 1rem;
  border: 1px solid #1a1a1a;
}

html[data-theme="light"] .alert-error {
  color: #7a0000;
  background: rgba(102, 0, 0, 0.08);
  border-color: var(--bi-line);
}

/* ——— Footer (Bi) ——— */
footer {
  background-color: #050505;
  padding: 80px 10% 40px;
  border-top: 1px solid #1a1a1a;
  text-align: center;
}

html[data-theme="light"] footer {
  background-color: var(--footer-bg);
  border-top-color: var(--bi-line);
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 40px;
}

.footer-col {
  flex: 1;
  min-width: 200px;
}

/* Three-column balance: The Table | tagline | The Chef */
.footer-col-table {
  text-align: left;
}

.footer-col-center {
  flex: 2;
  text-align: center;
  min-width: min(100%, 240px);
}

.footer-col-chef {
  text-align: right;
}

.footer-col h4 {
  color: #444;
  font-size: 0.7rem;
  letter-spacing: 3px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

html[data-theme="light"] .footer-col h4 {
  color: #888;
}

.footer-col a {
  display: block;
  color: #555;
  text-decoration: none;
  margin-bottom: 10px;
  font-size: 0.9rem;
  transition: 0.3s;
}

html[data-theme="light"] .footer-col a {
  color: #666;
}

.footer-col a:hover {
  color: white;
}

html[data-theme="light"] .footer-col a:hover {
  color: var(--ichor-crimson);
}

.footer-copy {
  color: #222;
  font-size: 0.65rem;
  margin-top: 60px;
  text-align: center;
  letter-spacing: 2px;
  text-transform: uppercase;
}

html[data-theme="light"] .footer-copy {
  color: #999;
}

.footer-tagline {
  margin: 0;
  color: #555;
  font-size: 0.9rem;
}

html[data-theme="light"] .footer-tagline {
  color: #666;
}

/* ——— Single recipe (detail) ——— */
.recipe-detail {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 8% 4rem;
  background: #080808;
}

html[data-theme="light"] .recipe-detail {
  background: transparent;
}

.recipe-readable {
  font-size: 1.125rem;
  line-height: 1.8;
  font-variant-numeric: oldstyle-nums;
  font-feature-settings: "frac" 1, "kern" 1, "onum" 1;
}

@supports (font-variant-numeric: diagonal-fractions) {
  .recipe-readable {
    font-variant-numeric: diagonal-fractions oldstyle-nums;
  }
}

.recipe-detail-section {
  margin-bottom: 2.25rem;
}

.recipe-detail-heading {
  font-family: "Cinzel", serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--anima-gold);
  margin: 0 0 1rem;
}

.ingredient-list {
  margin: 0;
  padding-left: 1.35rem;
  color: #ccc;
}

html[data-theme="light"] .ingredient-list {
  color: var(--text-main);
}

.ingredient-list li {
  margin-bottom: 0.55rem;
}

.instruction-flow {
  margin: 0;
}

.instruction-para,
.instruction-bullet {
  margin: 0 0 0.85rem;
  color: #ccc;
}

html[data-theme="light"] .instruction-para,
html[data-theme="light"] .instruction-bullet {
  color: var(--text-main);
}

.instruction-bullet {
  padding-left: 0.15rem;
}

.instruction-bullet .bullet-mark {
  display: inline-block;
  color: var(--anima-gold);
  margin-right: 0.45rem;
  font-weight: 700;
}

.recipe-empty-part {
  color: #666;
  font-style: italic;
  font-size: 0.95rem;
}

.recipe-detail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #1a1a1a;
}

.recipe-source-bottom {
  margin: 1.25rem 0 0;
  font-size: 0.9rem;
  color: #888;
  word-break: break-all;
}

.recipe-source-bottom a {
  color: var(--anima-gold);
}

html[data-theme="light"] .recipe-source-bottom {
  color: #666;
}

html[data-theme="light"] .recipe-detail-toolbar {
  border-top-color: var(--bi-line);
}

/* Library cards: title links to detail */
.recipe-card-title {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  line-height: 1.3;
}

.recipe-card-title a {
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.recipe-card-title a:hover {
  color: var(--anima-gold);
  border-bottom-color: var(--anima-gold);
}

html[data-theme="light"] .recipe-card-title a {
  color: var(--bi-heading);
}

.recipe-card-teaser {
  font-size: 0.88rem;
  line-height: 1.65;
  color: #888;
  margin: 0 0 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.recipe-card-open {
  margin: 0 0 1rem;
}

/* Library: recipe table — match bi-admin kindreds list (header.php table {}) */
.anatomy-section-library {
  text-align: left;
}

/* Align heading + sub with table (shared 52rem column, centered) */
.anatomy-section-library > h2,
.anatomy-section-library > p.section-sub,
.anatomy-section-library > .empty-state {
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}

.recipe-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  max-width: 52rem;
  margin: 24px auto 0;
  text-align: left;
}

.recipe-table thead {
  background: var(--bg-raised);
}

html[data-theme="light"] .recipe-table thead {
  background: #ebe4d8;
}

.recipe-table th,
.recipe-table td {
  border: 1px solid var(--border-dark);
  padding: 12px 16px;
  background: var(--bg-raised);
  vertical-align: top;
}

.recipe-table th:nth-child(1) {
  width: 38%;
}

.recipe-table th:nth-child(2) {
  width: 62%;
}

.recipe-table th {
  color: var(--anima-gold);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: left;
}

html[data-theme="light"] .recipe-table th,
html[data-theme="light"] .recipe-table td {
  border-color: #a89880;
  background: #faf8f4;
}

.recipe-table tbody tr:nth-child(even) td {
  background: var(--bg-raised);
}

html[data-theme="light"] .recipe-table tbody tr:nth-child(even) td {
  background: #f4f0e8;
}

.recipe-table tr:hover td {
  background: #0e0e0e !important;
}

html[data-theme="light"] .recipe-table tr:hover td {
  background: #ede8de !important;
}

.recipe-table-link {
  color: #ddd;
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 400;
  transition: color 0.2s;
}

.recipe-table-link:hover,
.recipe-table-link:focus-visible {
  color: var(--anima-gold);
  outline: none;
}

html[data-theme="light"] .recipe-table-link {
  color: var(--bi-heading);
}

.recipe-table-tags {
  color: #888;
  font-size: 0.9rem;
}

html[data-theme="light"] .recipe-table-tags {
  color: #666;
}

/* Tag picker (forms) */
.tag-picker {
  margin-bottom: 0.25rem;
}

.tag-picker-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.tag-picker-add {
  flex-shrink: 0;
  min-width: 2.5rem;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.45rem 0.65rem;
}

.tag-picker-input {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border: 1px solid #1a1a1a;
  background: #0a0a0a;
  color: var(--text-main);
}

html[data-theme="light"] .tag-picker-input {
  border-color: var(--bi-line);
  background: var(--bi-surface);
}

.tag-picker-suggestions {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid #1a1a1a;
  background: #0a0a0a;
  z-index: 20;
  position: relative;
}

html[data-theme="light"] .tag-picker-suggestions {
  border-color: var(--bi-line);
  background: var(--bi-surface);
}

.tag-picker-suggestions li {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: #ccc;
}

html[data-theme="light"] .tag-picker-suggestions li {
  color: var(--text-main);
}

.tag-picker-suggestions li:hover {
  background: #141414;
  color: var(--anima-gold);
}

html[data-theme="light"] .tag-picker-suggestions li:hover {
  background: var(--bi-surface-hover);
}

.tag-picker-suggestions li.tag-picker-new {
  color: var(--anima-gold);
  font-weight: 600;
}

.tag-picker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  min-height: 0;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--anima-gold);
  color: var(--anima-gold);
  font-size: 0.8rem;
}

.tag-chip-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
}

/* Recipe detail tags */
.recipe-tags.hero-tags {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.recipe-tag-pill {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--anima-gold);
  color: var(--anima-gold);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
  }

  .footer-col-table,
  .footer-col-chef {
    text-align: center;
  }

  header {
    flex-wrap: nowrap;
    gap: 0.75rem;
  }

  header nav {
    justify-content: flex-end;
    min-width: 0;
  }

  .header-text-logo {
    flex-shrink: 0;
    font-size: 1.1rem;
  }
}
