/* ─── Tokens ──────────────────────────────────────────────────────────────── */

:root {
  /* warm cognac / aged walnut — stoic, focused, dignified */
  --bg:          #3D1F08;
  --bg-header:   #301708;
  --bg-card:     #FDF6EC;
  --bg-surface:  #F0E5D6;
  --bg-overlay:  rgba(12, 5, 1, 0.60);

  /* card / modal text (unchanged) */
  --text-1:      #2C1F14;
  --text-2:      #6B5448;
  --text-3:      #A08576;

  /* chrome text — on warm cognac bg */
  --chrome-1:    #F2DDBF;
  --chrome-2:    #C49A68;
  --chrome-3:    #8A6440;

  --accent:      #C0592D;
  --accent-dark: #9B441E;
  --accent-pale: #F5E4DC;

  --border:      #DDD0C4;
  --border-light:#EDE4DB;

  /* chrome borders on warm bg */
  --chrome-border: rgba(255, 215, 160, 0.13);

  --shadow-xs:   0 1px 3px rgba(20, 8, 1, 0.20);
  --shadow-sm:   0 2px 8px rgba(20, 8, 1, 0.25);
  --shadow-md:   0 6px 24px rgba(20, 8, 1, 0.32);
  --shadow-lg:   0 20px 60px rgba(20, 8, 1, 0.48);

  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --radius-full: 999px;

  --transition:  0.18s ease;
}

/* ─── Reset ───────────────────────────────────────────────────────────────── */

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

/* prevent display:flex/block from overriding the hidden attribute anywhere */
[hidden] { display: none !important; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, #5C2D0E 0%, #3D1F08 55%, #271009 100%);
  background-attachment: fixed;
  color: var(--text-1);
  min-height: 100dvh;
  overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

img { display: block; max-width: 100%; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

input, textarea, select { font-family: inherit; }

/* ─── Typography ──────────────────────────────────────────────────────────── */

.wordmark-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.jar-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.wordmark {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 2rem;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  line-height: 1.1;
}

.tagline {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--chrome-2);
  letter-spacing: 0.01em;
}

/* ─── Buttons ─────────────────────────────────────────────────────────────── */

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-dark); box-shadow: var(--shadow-sm); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.6; pointer-events: none; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--bg-surface);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}
.btn-secondary:hover { background: var(--border-light); }
.btn-secondary:disabled { opacity: 0.5; pointer-events: none; cursor: default; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  color: var(--chrome-2);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn-ghost:hover { background: rgba(255,220,180,0.07); border-color: var(--chrome-border); color: var(--chrome-1); }

/* ghost buttons inside light modals/cards get darker treatment */
.modal-panel .btn-ghost,
.detail-body .btn-ghost {
  color: var(--text-2);
}
.modal-panel .btn-ghost:hover,
.detail-body .btn-ghost:hover {
  background: var(--bg-surface);
  border-color: var(--border-light);
  color: var(--text-1);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: transparent;
  color: #C0392B;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1px solid rgba(192, 57, 43, 0.25);
  transition: background var(--transition), border-color var(--transition);
}
.btn-danger:hover { background: #FDF0EE; border-color: rgba(192, 57, 43, 0.4); }

.inline-link {
  color: var(--accent);
  text-decoration: underline;
  font-size: inherit;
  padding: 0;
}
.inline-link:hover { color: var(--accent-dark); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  background: rgba(38, 18, 5, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--chrome-border);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Controls Bar ────────────────────────────────────────────────────────── */

.controls-bar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 32px 0;
  max-width: 1400px;
  margin: 0 auto;
}

.controls-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.controls-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.controls-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  padding: 9px 16px;
}

.controls-btn.shuffle-active {
  background: rgba(255, 220, 170, 0.15);
  border-color: var(--accent);
  color: var(--chrome-1);
}

.search-wrap {
  position: relative;
  max-width: 360px;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--chrome-3);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: rgba(255, 220, 170, 0.06);
  border: 1px solid var(--chrome-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--chrome-1);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  appearance: none;
}
.search-input::placeholder { color: var(--chrome-3); }
.search-input:focus {
  outline: none;
  background: rgba(255, 220, 170, 0.09);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 89, 45, 0.25);
}

/* Clear button that browsers inject */
.search-input::-webkit-search-cancel-button { opacity: 0.5; }

/* ─── Filter Chips ────────────────────────────────────────────────────────── */

.filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}
.filter-chips::-webkit-scrollbar { display: none; }

.chip {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--chrome-border);
  color: var(--chrome-2);
  background: rgba(255, 220, 170, 0.05);
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}
.chip:hover { background: rgba(255, 220, 170, 0.10); color: var(--chrome-1); }
.chip-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(192, 89, 45, 0.4);
}
.chip-active:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

/* ─── Grid ────────────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 28px 32px 64px;
  max-width: 1400px;
  margin: 0 auto;
}

/* ─── Cards ───────────────────────────────────────────────────────────────── */

.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  box-shadow: var(--shadow-xs);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.card:active { transform: translateY(-2px); }

.card-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--bg-surface);
}

.card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transition: transform 0.35s ease;
}
.card:hover .card-img { transform: scale(1.04); }

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-drag-handle {
  font-size: 1rem;
  color: var(--text-2);
  cursor: grab;
  line-height: 1;
  user-select: none;
}

.card-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.card.drag-over {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
}

.card-body {
  padding: 18px 20px 20px;
}

.category-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-pale);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0;
}

.card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.075rem;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.35;
  margin-bottom: 6px;
}

.card-snippet {
  font-size: 0.825rem;
  color: var(--text-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Empty State ─────────────────────────────────────────────────────────── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 32px;
  text-align: center;
  max-width: 420px;
  margin: 0 auto;
}

.empty-jar-icon {
  width: 72px;
  height: 86px;
  color: var(--chrome-3);
  margin-bottom: 4px;
}

.empty-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--chrome-1);
}

.empty-body {
  font-size: 0.9rem;
  color: var(--chrome-2);
  line-height: 1.6;
}

/* ─── Modals ──────────────────────────────────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* hidden attribute must win — without this, display:flex overrides it and
   invisible modals cover the whole page and block every click */
.modal[hidden] { display: none !important; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.modal-panel {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  overflow-y: auto;
  opacity: 0;
  transform: scale(0.96) translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-visible .modal-backdrop { opacity: 1; }
.modal-visible .modal-panel { opacity: 1; transform: scale(1) translateY(0); }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-3);
  transition: background var(--transition), color var(--transition);
  z-index: 1;
}
.modal-close:hover { background: var(--bg-surface); color: var(--text-1); }

.modal-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 500;
  padding: 28px 28px 4px;
  color: var(--text-1);
}

/* ─── Cookie Form ─────────────────────────────────────────────────────────── */

#cookie-form {
  padding: 20px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.label-optional {
  font-weight: 400;
  color: var(--text-3);
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-1);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.form-input::placeholder { color: var(--text-3); }
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-pale);
}

.form-textarea {
  resize: none;
  overflow: hidden;
  line-height: 1.6;
  min-height: 120px;
}

.select-wrap {
  position: relative;
}
.select-wrap select { padding-right: 36px; cursor: pointer; }
.select-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}

/* Photo drop zone */

.photo-drop {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  transition: border-color var(--transition), background var(--transition);
  overflow: hidden;
}
.photo-drop.drag-over {
  border-color: var(--accent);
  background: var(--accent-pale);
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 20px;
  color: var(--text-3);
  font-size: 0.85rem;
  cursor: pointer;
  text-align: center;
}

.photo-preview-wrap {
  position: relative;
}
.photo-preview-wrap img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  display: block;
}

.replace-photo-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(26, 17, 10, 0.7);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
  transition: background var(--transition);
}
.replace-photo-btn:hover { background: rgba(26, 17, 10, 0.88); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

/* ─── Detail Modal ────────────────────────────────────────────────────────── */

.detail-panel {
  max-width: 680px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.detail-photo-wrap {
  width: 100%;
  background: var(--bg-surface);
  flex-shrink: 0;
}
.detail-photo-wrap img {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  display: block;
}

.detail-no-photo {
  width: 100%;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 0.8rem;
}

.detail-body {
  padding: 24px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-date {
  font-size: 0.8rem;
  color: var(--text-3);
}

.detail-title-el {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-1);
  outline: none;
  border-radius: 4px;
  transition: background var(--transition);
  word-break: break-word;
}
[contenteditable="true"].detail-title-el,
[contenteditable="true"].detail-reflection {
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin: -6px -10px;
  box-shadow: 0 0 0 2px var(--accent);
}

.detail-reflection {
  font-size: 0.95rem;
  color: var(--text-2);
  line-height: 1.75;
  outline: none;
  border-radius: 4px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 40px;
}

.detail-footer {
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
}

.detail-normal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.detail-normal-actions .btn-danger { margin-left: auto; }

.detail-delete-confirm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.delete-confirm-msg {
  font-size: 0.875rem;
  color: var(--text-2);
}

.detail-edit-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-hint {
  font-size: 0.78rem;
  color: var(--text-3);
  text-align: center;
}

.edit-btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ─── Categories Modal ────────────────────────────────────────────────────── */

.categories-panel {
  max-width: 480px;
  padding-bottom: 24px;
}

.category-list {
  list-style: none;
  margin: 16px 28px 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
.category-item:last-child { border-bottom: none; }
.category-item:hover { background: var(--bg-surface); }

.cat-name {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-1);
  outline: none;
  border-radius: 4px;
}
[contenteditable="true"].cat-name {
  background: #fff;
  padding: 2px 6px;
  margin: -2px -6px;
  box-shadow: 0 0 0 2px var(--accent);
  border-radius: var(--radius-sm);
}

.cat-count {
  font-size: 0.78rem;
  color: var(--text-3);
  white-space: nowrap;
}

.cat-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.cat-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  transition: background var(--transition), color var(--transition);
}
.cat-btn:hover { background: var(--border-light); color: var(--text-1); }
.cat-btn:disabled { opacity: 0.3; pointer-events: none; cursor: default; }

.add-category-row {
  display: flex;
  gap: 10px;
  padding: 20px 28px 0;
}
.add-category-row .form-input { flex: 1; }

.manage-footer {
  display: flex;
  gap: 8px;
  padding: 20px 28px 0;
  border-top: 1px solid var(--border-light);
  margin: 20px 28px 0;
}

/* ─── Toast ───────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1a1a1a;
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 500;
  white-space: nowrap;
}
.toast.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-error { background: #922; }

/* ─── Context Section ─────────────────────────────────────────────────────── */

.context-section {
  display: grid;
  grid-template-columns: 3fr 2fr;
  grid-template-areas:
    "quote quote"
    "video steps";
  gap: 20px;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 32px 52px;
}

.context-quote-wrap { grid-area: quote; }
.context-video      { grid-area: video; aspect-ratio: 16 / 9; }
.context-steps      { grid-area: steps; }

.context-quote-wrap {
  background: rgba(255, 215, 150, 0.06);
  border: 1px solid rgba(255, 215, 160, 0.18);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.context-steps {
  background: rgba(255, 215, 150, 0.06);
  border: 1px solid rgba(255, 215, 160, 0.18);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.context-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.goggins-quote {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 0.85rem;
  color: #F0E8DC;
  line-height: 1.78;
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.goggins-quote cite {
  font-style: normal;
  font-size: 0.78rem;
  color: #C49A68;
  letter-spacing: 0.02em;
}

.steps-divider {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #C49A68;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 215, 160, 0.12);
}

.steps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.875rem;
  color: #FFFFFF;
  line-height: 1.55;
}

.steps-list li em {
  font-style: italic;
  color: #FFFFFF;
}

.step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 2px;
}

.context-video {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 215, 160, 0.18);
  background: #000;
  min-height: 220px;
}

.context-video iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 680px) {
  .site-header { padding: 0 16px; height: 58px; }

  .controls-bar { padding: 18px 16px 0; }
  .search-wrap { max-width: 100%; }

  .grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 20px 16px 56px;
  }

  .card-body { padding: 14px 14px 16px; }
  .card-title { font-size: 0.95rem; }
  .card-snippet { display: none; }

  .modal { padding: 0; align-items: flex-end; }
  .modal-panel {
    max-width: 100%;
    max-height: 92dvh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(20px);
  }
  .modal-visible .modal-panel { transform: translateY(0); }

  .detail-panel { max-height: 100dvh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .detail-body { padding: 22px 20px 24px; }
  .detail-title-el { font-size: 1.35rem; }

  #cookie-form { padding: 16px 20px 24px; }
  .modal-title { padding: 24px 20px 4px; }
  .category-list { margin: 16px 20px 0; }
  .add-category-row { padding: 16px 20px 0; }
  .manage-footer { padding: 16px 20px 0; margin: 16px 20px 0; }

  .detail-normal-actions { gap: 8px; }
  .detail-normal-actions .btn-danger { margin-left: 0; }

  .empty-state { padding: 56px 24px; }

  .context-section {
    grid-template-columns: 1fr;
    grid-template-areas: "quote" "video" "steps";
    padding: 20px 16px 36px;
  }
  .context-video { aspect-ratio: 16 / 9; }
  .context-steps { padding: 20px; }
  .wordmark { font-size: 1.5rem; }
  .tagline { font-size: 0.8rem; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
  .header-nav .btn-ghost { display: none; }
}
