@import url('https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,300..700;1,300..700&family=Tenor+Sans&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* Profile vars — usefull-tokens.js source of truth. Shared with profile page. */
:root {
  --cloud: #F7F6F2;
  --surface: #F5F3EE;
  --card: #FFFFFF;
  --text-primary: #1A1A2E;
  --text-soft: #44445A;
  --text-muted: #6E6E7E;
  --coral: #D94F3B;
  --coral-bg: #FCEAE6;
  --teal: #2A9D8F;
  --teal-bg: #E6F5F3;
  --yellow: #E9A33A;
  --yellow-bg: #FDF4E1;
  --border-color: #DDD8CE;
  --border-light: #ECEAE3;
  --shadow-sm: 0 1px 3px rgba(26, 26, 46, 0.04), 0 1px 2px rgba(26, 26, 46, 0.02);
  --shadow-md: 0 4px 12px rgba(26, 26, 46, 0.06), 0 1px 4px rgba(26, 26, 46, 0.03);
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 100px;
}

* { font-family: 'Tenor Sans', -apple-system, BlinkMacSystemFont, sans-serif; }

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Jost', sans-serif;
  letter-spacing: -0.02em;
}

html {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  width: 100%;
  margin: 0;
  padding: 0;
}

body.pull-refresh-active #mainContent {
  transition: transform 0.12s ease-out;
  will-change: transform;
}

body.pull-refresh-refreshing #mainContent {
  transition: transform 0.2s ease-out;
}

.pull-refresh-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translate(-50%, -56px);
  opacity: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  transition: transform 0.12s ease-out, opacity 0.12s ease-out;
}

.pull-refresh-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #ECEAE3;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.09);
}

.pull-refresh-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #D94F3B;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1;
  transition: transform 0.15s ease-out;
}

.pull-refresh-icon.is-release {
  transform: rotate(180deg);
}

.pull-refresh-icon.is-spinning {
  animation: pull-refresh-spin 0.8s linear infinite;
}

.pull-refresh-label {
  color: #44445A;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pull-refresh-progress {
  display: block;
  width: 112px;
  height: 2px;
  background: linear-gradient(90deg, #D94F3B 0%, #E9A33A 55%, #5B8C5A 100%);
  border-radius: 999px;
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0.85;
  transition: transform 0.12s ease-out;
}

body.theme-dark .pull-refresh-chip {
  background: rgba(77, 89, 102, 0.98);
  border-color: var(--dark-border);
  box-shadow: 0 10px 24px rgba(18, 22, 26, 0.34);
}

body.theme-dark .pull-refresh-label {
  color: var(--dark-text-soft);
}

body.theme-dark .pull-refresh-icon {
  color: #FFB19F;
}

@keyframes pull-refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (min-width: 1024px) {
  .pull-refresh-indicator {
    display: none;
  }
}

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
}

.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;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 999;
  background: #1A1A2E;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  transform: translateY(-140%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.logo-gradient {
  background: linear-gradient(135deg, #D94F3B, #E9A33A, #5B8C5A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body:not(.theme-dark).bg-cloud {
  background-color: #F7F6F2;
}

/* Theme: Dark (Design-system palette) */
body.theme-dark {
  color-scheme: dark;
  --cloud: #39434E;
  --surface: #45515E;
  --card: #4D5966;
  --text-primary: #EDEBE4;
  --text-soft: #D3CFC4;
  --text-muted: #B7B3A8;
  --coral-bg: #654741;
  --teal-bg: #3B625C;
  --yellow-bg: #6A5B3D;
  --border-color: #6E7A85;
  --border-light: #5F6B77;
  --shadow-sm: 0 1px 3px rgba(18, 22, 26, 0.24), 0 1px 2px rgba(18, 22, 26, 0.18);
  --shadow-md: 0 8px 24px rgba(18, 22, 26, 0.32), 0 2px 8px rgba(18, 22, 26, 0.2);
  --dark-bg: #39434E;
  --dark-surface: #45515E;
  --dark-card: #4D5966;
  --dark-hover: #586470;
  --dark-border: #5F6B77;
  --dark-border-strong: #6E7A85;
  --dark-text: #EDEBE4;
  --dark-text-soft: #D3CFC4;
  --dark-text-muted: #B7B3A8;
  --dark-text-faint: #9D9A90;
  --dark-sidebar: #343F4A;
  --dark-sidebar-hover: #4C5864;
  --dark-sidebar-active: #586471;
  background: var(--dark-bg);
  color: var(--dark-text);
}

body.theme-dark .bg-cloud { background-color: var(--dark-bg); }
body.theme-dark .bg-surface { background-color: var(--dark-surface); }
body.theme-dark .bg-white { background-color: var(--dark-card); }
body.theme-dark .border-border-light { border-color: var(--dark-border); }
body.theme-dark .text-text-primary { color: var(--dark-text); }
body.theme-dark .text-text-soft { color: var(--dark-text-soft); }
body.theme-dark .text-text-muted { color: var(--dark-text-muted); }
body.theme-dark .placeholder\:text-text-muted::placeholder { color: var(--dark-text-faint); }

body.theme-dark .hover\:bg-surface:hover { background-color: var(--dark-hover); }
body.theme-dark .hover\:border-border-color:hover { border-color: var(--dark-border-strong); }
body.theme-dark .hover\:text-text-primary:hover { color: var(--dark-text); }
body.theme-dark .hover\:text-text-soft:hover { color: var(--dark-text-soft); }

body.theme-dark .skip-link {
  background: var(--dark-text);
  color: var(--dark-bg);
}

body.theme-dark .sidebar-shell {
  background: var(--dark-sidebar);
  border-right-color: var(--dark-border);
  color: var(--dark-text);
}

body.theme-dark .sidebar-item {
  color: var(--dark-text-muted);
}

body.theme-dark .sidebar-item:hover {
  background: var(--dark-sidebar-hover);
  color: var(--dark-text);
}

body.theme-dark .sidebar-item.active {
  background: var(--dark-sidebar-active);
  border-color: var(--dark-border-strong);
  color: var(--dark-text);
  box-shadow: none;
}

body.theme-dark .account-link {
  color: var(--dark-text-muted);
}

body.theme-dark .account-link .account-link-icon {
  color: var(--dark-text-faint);
}

body.theme-dark .account-link:hover,
body.theme-dark .account-link.active {
  color: var(--dark-text);
}

body.theme-dark .account-link:hover .account-link-icon,
body.theme-dark .account-link.active .account-link-icon {
  color: var(--dark-text-soft);
}

body.theme-dark .sidebar-count-hint {
  color: var(--dark-text-faint);
}

body.theme-dark .sidebar-count-main {
  color: var(--dark-text-soft);
}

body.theme-dark .sidebar-count-divider,
body.theme-dark .sidebar-count-sub {
  color: var(--dark-text-faint);
}

body.theme-dark .sidebar-item.active .sidebar-count-main {
  color: var(--dark-text);
}

body.theme-dark .sidebar-item.active .sidebar-count-divider,
body.theme-dark .sidebar-item.active .sidebar-count-sub {
  color: var(--dark-text-muted);
}

body.theme-dark .header-user-button {
  border-color: var(--dark-border);
  background: var(--dark-card);
}

body.theme-dark .header-user-button:hover {
  border-color: var(--dark-border-strong);
  box-shadow: 0 1px 2px rgba(18, 22, 26, 0.28);
}

body.theme-dark .header-user-caret {
  color: var(--dark-text-muted);
}

body.theme-dark .header-search-input input {
  background: var(--dark-surface);
  border-color: var(--dark-border);
  color: var(--dark-text);
}

body.theme-dark .header-search-input input::placeholder {
  color: var(--dark-text-muted);
}

body.theme-dark .header-menu-dropdown {
  background: var(--dark-card);
  border-color: var(--dark-border);
  box-shadow: 0 8px 24px rgba(18, 22, 26, 0.34);
}

body.theme-dark .header-menu-item {
  color: var(--dark-text-soft);
}

body.theme-dark .header-menu-item:hover {
  background: var(--dark-hover);
  color: var(--dark-text);
}

body.theme-dark .header-menu-item.logout {
  color: #FFB19F;
}

body.theme-dark .header-menu-item.logout:hover {
  background: #654741;
  color: #FFD0C4;
}

body.theme-dark .theme-menu-group {
  border-top-color: var(--dark-border);
}

body.theme-dark .theme-menu-label {
  color: var(--dark-text-muted);
}

body.theme-dark .theme-menu-option.is-selected {
  background: var(--dark-hover);
  color: var(--dark-text);
}

body.theme-dark .content-card:hover {
  box-shadow: 0 10px 24px rgba(18, 22, 26, 0.28);
}

body.theme-dark .meta-help-trigger::before {
  border-color: var(--dark-border-strong);
  background: var(--dark-surface);
  color: var(--dark-text-soft);
  box-shadow: 0 8px 20px rgba(18, 22, 26, 0.34);
}

body.theme-dark .recipe-card-theme {
  color: var(--dark-text-muted);
}

body.theme-dark .recipe-card-bottom {
  border-top-color: var(--dark-border);
  color: var(--dark-text-muted);
}

body.theme-dark .recipe-card-bottom-link {
  color: var(--dark-text-soft);
}

body.theme-dark .recipe-card-bottom-link:hover {
  color: var(--dark-text);
}

body.theme-dark .recipe-detail-thumbnail-frame {
  border-color: var(--dark-border);
  background: var(--dark-card);
}

body.theme-dark .recipe-detail-tabs {
  border-color: var(--dark-border);
  background: var(--dark-surface);
}

body.theme-dark .recipe-detail-tab {
  color: var(--dark-text-soft);
}

body.theme-dark .recipe-detail-tab--active {
  color: var(--dark-text);
  background: rgba(217, 79, 59, 0.2);
}

body.theme-dark .content-card.content-card--expanded::after {
  border-bottom-color: var(--dark-card);
  filter: drop-shadow(0 -1px 1px rgba(18, 22, 26, 0.28));
}

body.theme-dark .detail-meta-item {
  color: var(--dark-text-soft);
}

body.theme-dark .detail-meta-label {
  color: var(--dark-text-muted);
}

body.theme-dark .detail-items-table-wrap {
  border-color: var(--dark-border);
  background: var(--dark-card);
}

body.theme-dark .detail-items-table thead th {
  background: var(--dark-surface);
  color: var(--dark-text-muted);
}

body.theme-dark .detail-items-table tbody td {
  border-top-color: var(--dark-border);
  color: var(--dark-text-soft);
}

body.theme-dark .detail-items-table tbody tr:nth-child(even) td {
  background: rgba(77, 89, 102, 0.28);
}

body.theme-dark .view-switcher {
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.theme-dark .view-btn {
  color: var(--dark-text-muted);
}

body.theme-dark .view-btn + .view-btn::before {
  background: var(--dark-border);
}

body.theme-dark .view-btn:hover {
  background: rgba(77, 89, 102, 0.3);
  color: var(--dark-text-soft);
}

body.theme-dark .view-btn.active {
  border-color: transparent;
  box-shadow: none;
}

body.theme-dark .sort-trigger {
  border: 0;
  background: transparent;
  color: var(--dark-text-soft);
  box-shadow: none;
}

body.theme-dark .sort-trigger:hover {
  color: #FFFFFF;
}

body.theme-dark .sort-trigger-icon,
body.theme-dark .sort-trigger-caret {
  color: var(--dark-text-muted);
}

body.theme-dark .sort-wrap {
  border-left-color: var(--dark-border);
}

body.theme-dark .skeleton-card {
  border-color: var(--dark-border);
  background: var(--dark-card);
}

body.theme-dark .skeleton-thumb,
body.theme-dark .skeleton-line {
  background: var(--dark-surface);
}

body.theme-dark .skeleton-thumb::after,
body.theme-dark .skeleton-line::after {
  background: linear-gradient(90deg, rgba(69, 81, 94, 0), rgba(110, 122, 133, 0.45), rgba(69, 81, 94, 0));
}

body.theme-dark .table-row:hover {
  background: var(--dark-surface);
}

body.theme-dark .table-row:active {
  background: var(--dark-hover);
}

body.theme-dark #tableBody .table-row:nth-child(even) {
  background: rgba(77, 89, 102, 0.38);
}

body.theme-dark #tableBody .table-row:nth-child(even):hover {
  background: var(--dark-surface);
}

body.theme-dark .table-row.table-row--expanded {
  background: var(--dark-surface);
}

body.theme-dark #tableHead .table-header-cell {
  color: var(--dark-text-muted);
}

body.theme-dark #tableBody .table-row td:not(:first-child) {
  color: var(--dark-text-soft);
}

body.theme-dark .table-row .table-chevron {
  color: var(--dark-text-faint);
}

body.theme-dark .table-row:hover .table-chevron {
  color: var(--dark-text-soft);
}

body.theme-dark .sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(237, 235, 228, 0.28);
}

/* Sidebar */
.sidebar-shell {
  width: 14rem;
  background: #EDEBE4;
  border-right: 1px solid #DDD8CE;
  color: #1A1A2E;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-shell-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-item {
  transition: all 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 1px solid transparent;
  color: #44445A;
  text-decoration: none;
}
.sidebar-item:hover {
  background: #F2EFE8;
  color: #1A1A2E;
}
.sidebar-item.active {
  background: #FFFFFF;
  border-color: #E5E1D7;
  color: #1A1A2E;
  box-shadow: 0 1px 2px rgba(26, 26, 46, 0.05);
}

.sidebar-count-hint {
  margin: 0;
  padding: 0 12px 8px;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: #6E6E7E;
  font-family: 'Jost', sans-serif;
}

.sidebar-count {
  margin-left: auto;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sidebar-count-main {
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: #44445A;
}

.sidebar-count-divider,
.sidebar-count-sub {
  font-size: 10px;
  line-height: 1;
  color: #6E6E7E;
}

.sidebar-item.active .sidebar-count-main {
  color: #1A1A2E;
}

.sidebar-item.active .sidebar-count-divider,
.sidebar-item.active .sidebar-count-sub {
  color: #636379;
}

.account-link {
  color: #636379;
}

.account-link .account-link-icon {
  color: #9FA0B1;
}

.account-link:hover {
  color: #1A1A2E;
}

.account-link:hover .account-link-icon {
  color: #64657A;
}

.account-link.active {
  color: #1A1A2E;
}

.account-link.active .account-link-icon {
  color: #44445A;
}

.unstyled-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
}

.dashboard-header-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  min-width: 0;
}

.header-search-shell {
  width: min(100%, 560px);
  min-width: 240px;
  justify-self: center;
}

.header-search-input {
  position: relative;
}

.header-mobile-search {
  display: flex;
  justify-self: end;
}

.header-user-slot {
  justify-self: end;
}

@media (max-width: 639px) {
  .header-search-shell {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .header-mobile-search {
    display: none;
  }
}

@media (min-width: 640px) {
  .dashboard-header-row {
    grid-template-columns: minmax(140px, 1fr) minmax(240px, 560px) minmax(140px, 1fr);
  }

  .header-mobile-search {
    display: none;
  }
}

/* ── Notification bell ── */

.notif-bell-wrap {
  position: relative;
}

.notif-bell-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #ECEAE3;
  background: #fff;
  color: #44445A;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}

.notif-bell-button:hover {
  border-color: #DDD8CE;
  color: #1A1A2E;
  box-shadow: 0 1px 3px rgba(26, 26, 46, 0.04);
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #D94F3B;
  color: #fff;
  font-family: 'Jost', sans-serif;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

.notif-badge.hidden {
  display: none;
}

.notif-dropdown {
  min-width: 300px;
  width: 300px;
  background: #fff;
  border: 1px solid #ECEAE3;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(26, 26, 46, 0.06), 0 1px 4px rgba(26, 26, 46, 0.03);
  padding: 6px;
}

.notif-dropdown-title {
  margin: 0;
  padding: 8px 10px 6px;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6E6E7E;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.12s ease;
  cursor: pointer;
}

.notif-item:hover {
  background: #F5F3EE;
}

.notif-item-text {
  margin: 0;
  font-size: 13px;
  color: #1A1A2E;
  line-height: 1.4;
}

.notif-item-hint {
  margin: 3px 0 0;
  font-size: 12px;
  color: #6E6E7E;
  line-height: 1.3;
}

.notif-empty {
  padding: 16px 10px;
  text-align: center;
}

.notif-empty p {
  margin: 0;
  font-size: 13px;
  color: #6E6E7E;
}

body.theme-dark .notif-empty p {
  color: var(--dark-text-muted);
}

body.theme-dark .notif-bell-button {
  border-color: var(--dark-border);
  background: var(--dark-card);
  color: var(--dark-text-soft);
}

body.theme-dark .notif-bell-button:hover {
  border-color: var(--dark-border-strong);
  color: var(--dark-text);
}

body.theme-dark .notif-badge {
  background: #FF6B54;
}

body.theme-dark .notif-dropdown {
  background: var(--dark-card);
  border-color: var(--dark-border);
  box-shadow: 0 8px 24px rgba(18, 22, 26, 0.34);
}

body.theme-dark .notif-dropdown-title {
  color: var(--dark-text-muted);
}

body.theme-dark .notif-item:hover {
  background: var(--dark-hover);
}

body.theme-dark .notif-item-text {
  color: var(--dark-text);
}

body.theme-dark .notif-item-hint {
  color: var(--dark-text-muted);
}

/* ── Header user button ── */

.header-user-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border: 1px solid #ECEAE3;
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px 4px 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-user-button:hover {
  border-color: #DDD8CE;
  box-shadow: 0 1px 3px rgba(26, 26, 46, 0.04), 0 1px 2px rgba(26, 26, 46, 0.02);
}

.header-user-caret {
  color: #6E6E7E;
  flex-shrink: 0;
}

.header-menu-dropdown {
  min-width: 220px;
  width: 220px;
  background: #fff;
  border: 1px solid #ECEAE3;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(26, 26, 46, 0.06), 0 1px 4px rgba(26, 26, 46, 0.03);
  padding: 6px;
}

.header-menu-item {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 10px;
  font-size: 0.875rem;
  color: #44445A;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.header-menu-item:hover {
  background: #F5F3EE;
  color: #1A1A2E;
}

.header-menu-item.logout {
  color: #D94F3B;
}

.header-menu-item.logout:hover {
  background: #FCEAE6;
  color: #D94F3B;
}

.theme-menu-group {
  margin: 6px 0;
  padding-top: 6px;
  border-top: 1px solid #ECEAE3;
}

.theme-menu-label {
  margin: 0;
  padding: 2px 10px 6px;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6E6E7E;
  font-family: 'Jost', sans-serif;
  font-weight: 600;
}

.theme-menu-option.is-selected {
  background: #F5F3EE;
  color: #1A1A2E;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid #D94F3B;
  outline-offset: 2px;
}

/* Card hover */
.content-card {
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.content-card:hover {
  box-shadow: 0 6px 16px rgba(26,26,46,0.08);
  transform: translateY(-2px);
  border-color: #D0CBC0;
}

#gridView {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 640px) {
  #gridView {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  #gridView {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1536px) {
  #gridView {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1920px) {
  #gridView {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 2560px) {
  #gridView {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

#gridView .content-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 400px;
  min-height: 400px;
  max-height: 400px;
}

#gridView .content-card > :first-child {
  flex: 0 0 200px;
  height: 200px;
  min-height: 200px;
  max-height: 200px;
  aspect-ratio: auto;
}

#gridView .content-card > :last-child {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.recipe-grid-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.grid-card-content {
  display: flex;
  flex-direction: column;
  padding: 14px 16px 12px;
  min-height: 0;
  overflow: hidden;
}

.grid-card-preview {
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

/* Recipe card */
.recipe-card-content {
  display: flex;
  flex-direction: column;
  padding: 14px 16px 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

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

.recipe-card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.recipe-card-date {
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.25;
}

.card-date-text {
  font-size: 10px;
  line-height: 14px;
}

.recipe-meta-item {
  font-size: 10px;
  line-height: 14px;
}

.recipe-meta-icon {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}

.meta-help-trigger {
  position: relative;
  cursor: help;
}

.meta-help-trigger::before {
  content: attr(data-help-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(4px);
  border-radius: 6px;
  border: 1px solid var(--color-border-light, #ECEAE3);
  background: #FFFFFF;
  color: var(--color-soft, #44445A);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(26,26,46,0.04), 0 1px 2px rgba(26,26,46,0.02));
  font-family: var(--font-heading, 'Jost', sans-serif);
  font-size: 10px;
  line-height: 1.2;
  padding: 4px 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 20;
}

.meta-help-trigger[data-help-position="bottom"]::before {
  top: calc(100% + 6px);
  bottom: auto;
  transform: translateX(-50%) translateY(-4px);
}

.meta-help-trigger:hover::before,
.meta-help-trigger:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.recipe-card-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.recipe-card-title {
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.grid-card-title {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.recipe-card-theme {
  margin: 0;
  font-size: 10px;
  line-height: 1.35;
  color: #6E6E7E;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-card-bottom {
  margin-top: auto;
  border-top: 1px solid #ECEAE3;
  padding-top: 8px;
  font-size: 10px;
  color: #44445A;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.recipe-card-bottom-link {
  color: #44445A;
  text-decoration: none;
}

.recipe-card-bottom-link:hover {
  color: #1A1A2E;
}

/* Recipe detail section */
.recipe-detail-section {
  margin-top: 6px;
  padding-top: 16px;
}

.recipe-detail-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.recipe-detail-thumbnail-link {
  color: inherit;
  text-decoration: none;
  display: block;
  width: min(220px, 100%);
}

.recipe-detail-thumbnail-frame {
  border: 1px solid #ECEAE3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #FFFFFF;
}

.recipe-detail-thumbnail-aspect {
  aspect-ratio: 9 / 16;
  background: var(--color-surface);
}

.recipe-detail-thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.recipe-detail-content {
  flex: 1 1 auto;
  min-width: 0;
}

.recipe-detail-desktop-columns {
  display: none;
}

.recipe-detail-list-block {
  min-width: 0;
}

.recipe-detail-list-title {
  margin: 0 0 8px;
}

.recipe-detail-list {
  margin: 0;
  padding-left: 20px;
}

.recipe-detail-list li {
  overflow-wrap: break-word;
}

.recipe-detail-mobile {
  display: block;
}

.recipe-detail-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid #ECEAE3;
  border-radius: 999px;
  background: #F5F3EE;
  margin-bottom: 10px;
}

.recipe-detail-tab {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  line-height: 1;
  font-family: var(--font-heading, 'Jost', sans-serif);
  font-weight: 600;
  cursor: pointer;
  color: var(--color-soft, #44445A);
  background: transparent;
}

.recipe-detail-tab--active {
  color: var(--color-coral, #D94F3B);
  background: var(--color-coral-bg, #FCEAE6);
}

/* Detail panel */
.detail-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.3s ease-out, opacity 0.3s ease-out;
}
.detail-panel > div {
  overflow: hidden;
}
.detail-panel.open {
  grid-template-rows: 1fr;
  opacity: 1;
}

/* Caret arrow pointing from expanded card to detail panel */
.content-card.content-card--expanded {
  position: relative;
}
.content-card.content-card--expanded::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 9px solid #fff;
  filter: drop-shadow(0 -1px 1px rgba(217,79,59,0.15));
  z-index: 1;
}

/* Detail metadata row */
.detail-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  line-height: 1.35;
}
.detail-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #44445A;
}
.detail-meta-label {
  color: #6E6E7E;
  font-family: 'Jost', sans-serif;
  font-weight: 600;
}

.detail-items-table-wrap {
  border: 1px solid #ECEAE3;
  border-radius: 12px;
  overflow: hidden;
  background: #FFFFFF;
}

.detail-items-table-scroll {
  overflow-x: auto;
}

.detail-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.35;
  min-width: 520px;
}

.detail-items-table thead th {
  background: #F5F3EE;
  color: #6E6E7E;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  padding: 9px 12px;
  white-space: nowrap;
}

.detail-items-table tbody td {
  border-top: 1px solid #ECEAE3;
  color: #44445A;
  padding: 9px 12px;
  vertical-align: top;
  overflow-wrap: break-word;
}

.detail-items-table tbody tr:nth-child(even) td {
  background: #FCFBF9;
}

.detail-items-cell-primary {
  font-family: 'Jost', sans-serif;
  font-weight: 600;
  color: #1A1A2E;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-mobile {
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}
.sidebar-mobile.open {
  transform: translateX(0);
}

/* Keep sidebar visible in desktop layout. */
@media (min-width: 1024px) {
  .sidebar-mobile {
    transform: none;
  }
}

/* View mode buttons */
.view-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.view-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.view-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: transparent;
  color: #6E6E7E;
  border: 0;
  transition: all 0.15s ease;
}

.view-btn-icon {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.view-btn:hover {
  background: rgba(236, 234, 227, 0.72);
  color: #44445A;
}

.view-btn.active {
  background: var(--active-color, #D94F3B);
  color: white;
  border-color: transparent;
  box-shadow: none;
}

.sort-wrap {
  border-left: 1px solid #DDD8CE;
  padding-left: 10px;
}

@media (max-width: 639px) {
  .view-controls {
    align-self: flex-start;
  }

  .sort-wrap {
    border-left: 0;
    padding-left: 0;
  }
}

.sort-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #5B5C71;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s ease;
  box-shadow: none;
}

.sort-trigger:hover {
  color: #44445A;
}

.sort-trigger-icon,
.sort-trigger-caret {
  width: 14px;
  height: 14px;
  color: #6E6E7E;
  flex-shrink: 0;
}

.sort-trigger-caret {
  margin-left: 1px;
}

/* Empty state */
.empty-state {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 480px;
  padding: 56px 24px 40px;
  text-align: center;
}

.empty-state-visual {
  position: relative;
  width: min(100%, 360px);
  height: 210px;
  margin-bottom: 6px;
}

.empty-state-glow {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(217, 79, 59, 0.08) 0%, rgba(217, 79, 59, 0) 72%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.empty-state-floating-cloud,
.empty-state-search-visual {
  position: absolute;
  inset: 0;
}

.empty-state-search-visual {
  display: none;
}

.empty-state-search-icon {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 76px;
  height: 76px;
  border-radius: 24px;
  border: 1px solid #ECEAE3;
  background: #FFFFFF;
  color: #6E6E7E;
  box-shadow: 0 14px 32px rgba(26, 26, 46, 0.08), 0 1px 3px rgba(26, 26, 46, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  animation: empty-fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.empty-state-orbit,
.empty-state-dot {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(calc(-50% + var(--icon-x, 0px)), calc(-50% + var(--icon-y, 0px)));
}

.empty-state-orbit {
  animation: empty-icon-enter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) var(--icon-delay, 0s) both;
}

.empty-state-orbit-card {
  width: calc(var(--icon-size, 18px) * 2.2);
  height: calc(var(--icon-size, 18px) * 2.2);
  border-radius: calc(var(--icon-size, 18px) * 0.55);
  border: 1px solid rgba(26, 26, 46, 0.06);
  background: var(--icon-bg, #F5F3EE);
  color: var(--icon-color, #D94F3B);
  box-shadow: 0 2px 8px rgba(26, 26, 46, 0.05), 0 0 0 1px rgba(26, 26, 46, 0.02);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: empty-float-0 5s ease-in-out var(--icon-delay, 0s) infinite;
}

.empty-state-orbit:nth-child(3n + 2) .empty-state-orbit-card {
  animation-name: empty-float-1;
  animation-duration: 6s;
}

.empty-state-orbit:nth-child(3n) .empty-state-orbit-card {
  animation-name: empty-float-2;
  animation-duration: 7s;
}

.empty-state-dot {
  width: var(--dot-size, 3px);
  height: var(--dot-size, 3px);
  border-radius: 999px;
  background: var(--dot-color, #D94F3B);
  opacity: var(--dot-opacity, 0.12);
  transform: translate(calc(-50% + var(--dot-x, 0px)), calc(-50% + var(--dot-y, 0px)));
  animation: empty-float-1 7s ease-in-out var(--dot-delay, 0s) infinite;
}

.empty-state-copy {
  max-width: 420px;
  animation: empty-fade-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.empty-state-title {
  margin: 0;
  font-family: 'Jost', sans-serif;
  font-size: clamp(1.4rem, 1.2rem + 1vw, 1.95rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #1A1A2E;
}

.empty-state-description {
  margin: 10px auto 0;
  max-width: 380px;
  font-size: 14px;
  line-height: 1.6;
  color: #5B5C71;
}

.empty-state-inline-link {
  color: #1A1A2E;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(26, 26, 46, 0.2);
  text-underline-offset: 2px;
}

.empty-state-inline-link:hover {
  text-decoration-color: currentColor;
}

.empty-state-search-copy {
  display: none;
}

.empty-state-actions {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.empty-state-primary-btn,
.empty-state-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.empty-state-primary-btn {
  background: #D94F3B;
  color: #FFFFFF;
  box-shadow: 0 1px 3px rgba(217, 79, 59, 0.22), 0 0 0 0 rgba(217, 79, 59, 0);
}

.empty-state-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(217, 79, 59, 0.24), 0 0 0 3px rgba(217, 79, 59, 0.08);
}

.empty-state-secondary-btn {
  background: #FFFFFF;
  color: #44445A;
  border-color: #ECEAE3;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(26, 26, 46, 0.04);
}

.empty-state-secondary-btn:hover {
  transform: translateY(-1px);
  color: #1A1A2E;
  border-color: #DDD8CE;
  background: #FCFBF9;
}

.empty-state-reset-btn {
  display: none;
}

.empty-state.is-search-mode {
  min-height: 360px;
}

.empty-state.is-search-mode .empty-state-search-visual {
  display: block;
}

.empty-state.is-search-mode .empty-state-floating-cloud {
  display: none;
}

.empty-state.is-search-mode #emptyDescription {
  display: none;
}

.empty-state.is-search-mode .empty-state-search-copy {
  display: block;
}

.empty-state.is-search-mode .empty-state-default-action {
  display: none;
}

.empty-state.is-search-mode .empty-state-reset-btn {
  display: inline-flex;
}

body.theme-dark .empty-state-glow {
  background: radial-gradient(circle, rgba(255, 177, 159, 0.12) 0%, rgba(255, 177, 159, 0) 72%);
}

body.theme-dark .empty-state-title {
  color: var(--dark-text);
}

body.theme-dark .empty-state-description {
  color: var(--dark-text-soft);
}

body.theme-dark .empty-state-inline-link {
  color: var(--dark-text);
  text-decoration-color: rgba(237, 235, 228, 0.26);
}

body.theme-dark .empty-state-search-icon {
  border-color: var(--dark-border);
  background: var(--dark-card);
  color: var(--dark-text-muted);
  box-shadow: 0 12px 28px rgba(18, 22, 26, 0.28);
}

body.theme-dark .empty-state-orbit-card {
  border-color: rgba(183, 179, 168, 0.12);
  box-shadow: 0 2px 10px rgba(18, 22, 26, 0.2), 0 0 0 1px rgba(18, 22, 26, 0.12);
}

body.theme-dark .empty-state-secondary-btn {
  background: var(--dark-card);
  border-color: var(--dark-border);
  color: var(--dark-text-soft);
  box-shadow: 0 1px 2px rgba(18, 22, 26, 0.22);
}

body.theme-dark .empty-state-secondary-btn:hover {
  background: var(--dark-hover);
  color: var(--dark-text);
}

@keyframes empty-float-0 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(2px, -6px, 0) scale(1.03); }
  66% { transform: translate3d(-3px, -3px, 0) scale(0.98); }
}

@keyframes empty-float-1 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  25% { transform: translate3d(-4px, -4px, 0) scale(1.02); }
  75% { transform: translate3d(3px, -7px, 0) scale(0.97); }
}

@keyframes empty-float-2 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  40% { transform: translate3d(5px, -5px, 0) scale(1.04); }
  70% { transform: translate3d(-2px, -8px, 0) scale(0.99); }
}

@keyframes empty-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes empty-icon-enter {
  from {
    opacity: 0;
    transform: translate(calc(-50% + var(--icon-x, 0px)), calc(-50% + var(--icon-y, 0px))) scale(0.55);
  }
  to {
    opacity: 1;
    transform: translate(calc(-50% + var(--icon-x, 0px)), calc(-50% + var(--icon-y, 0px))) scale(1);
  }
}

@media (max-width: 639px) {
  .empty-state {
    min-height: 380px;
    padding: 40px 14px 28px;
  }

  .empty-state-visual {
    width: min(100%, 300px);
    height: 180px;
  }

  .empty-state-title {
    font-size: 1.55rem;
  }

  .empty-state-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .empty-state-primary-btn,
  .empty-state-secondary-btn {
    width: 100%;
  }
}

/* Toast */
.toast {
  animation: toastIn 0.3s ease forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.loading-skeleton-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .loading-skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .loading-skeleton-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1536px) {
  .loading-skeleton-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1920px) {
  .loading-skeleton-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 2560px) {
  .loading-skeleton-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .recipe-detail-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 18px;
  }

  .recipe-detail-thumbnail-link {
    flex: 0 0 260px;
    width: 260px;
    max-width: 100%;
  }

  .recipe-detail-mobile {
    display: none;
  }

  .recipe-detail-desktop-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
  }
}

/* Keep recipe detail compact in table inline expansion */
.detail-inline-row .recipe-detail-content {
  max-width: 880px;
}

.detail-inline-row .recipe-detail-thumbnail-link {
  flex: 0 0 144px;
  width: 144px;
}

.detail-inline-row .recipe-detail-thumbnail-frame {
  width: 144px;
}

.detail-inline-row .recipe-detail-thumbnail-aspect {
  width: 144px;
  height: 228px;
  aspect-ratio: auto;
}

.detail-inline-row .recipe-detail-desktop-columns {
  max-width: 880px;
}


.skeleton-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #ECEAE3;
  background: #fff;
  display: flex;
  flex-direction: column;
  height: 400px;
  min-height: 400px;
  max-height: 400px;
}

.skeleton-thumb,
.skeleton-line {
  position: relative;
  overflow: hidden;
  background: #F5F3EE;
}

.skeleton-thumb {
  aspect-ratio: auto;
  flex: 0 0 200px;
  height: 200px;
  min-height: 200px;
  max-height: 200px;
}

.skeleton-card > :last-child {
  flex: 1 1 auto;
}

.skeleton-line {
  border-radius: 100px;
  height: 10px;
}

.skeleton-line.wide {
  width: 80%;
}

.skeleton-line.mid {
  width: 56%;
}

.skeleton-line.short {
  width: 40%;
}

.skeleton-thumb::after,
.skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, rgba(245,243,238,0), rgba(255,255,255,0.7), rgba(245,243,238,0));
  animation: shimmer 1.3s ease-in-out infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* Table styles */
#tableView table {
  width: 100%;
  table-layout: fixed;
}

.table-row {
  transition: background 0.1s ease;
}

.table-row:hover {
  background: #F5F3EE;
}

.table-row:active {
  background: #EDEAE3;
}

/* Zebra-striping */
#tableBody .table-row:nth-child(even) {
  background: rgba(245,243,238,0.4);
}
#tableBody .table-row:nth-child(even):hover {
  background: #F5F3EE;
}

/* Active (expanded) row accent border */
.table-row.table-row--expanded {
  background: #F5F3EE;
  position: relative;
}
.table-row.table-row--expanded td:first-child {
  box-shadow: inset 3px 0 0 0 var(--row-accent-color, #D94F3B);
}

#tableHead .table-header-cell {
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  line-height: 24px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: #6E6E7E;
}

#tableBody td {
  vertical-align: top;
}

#tableBody .table-row td {
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

#tableBody .table-row td:first-child {
  min-width: max(200px, 25%);
}

#tableBody .table-primary-cell-name {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#tableBody .table-row td:not(:first-child) {
  color: #4F5063;
}

#tableBody .table-cell-value {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.35;
}

#tableBody .table-cell-value--multiline {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.pagination-bar {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

#paginationBarTop {
  margin-top: 0;
  margin-bottom: 18px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-btn {
  appearance: none;
  border: 1px solid #DED9CD;
  background: #FFFFFF;
  color: #4F5063;
  border-radius: 999px;
  padding: 8px 12px;
  font: 600 12px/1 'Jost', sans-serif;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: #F5F3EE;
  border-color: #D0C7B8;
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pagination-btn--active {
  background: #1A1A2E;
  border-color: #1A1A2E;
  color: #FFFFFF;
}

.pagination-ellipsis {
  color: #6E6E7E;
  font-size: 12px;
}

.mobile-only {
  display: none;
}

@media (max-width: 639px) {
  .pagination-bar {
    align-items: stretch;
  }

  .pagination-summary {
    width: 100%;
  }

  .pagination-controls {
    width: 100%;
    justify-content: space-between;
  }

  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }
}

/* Chevron expand indicator */
.table-row .table-chevron {
  transition: transform 0.2s ease;
  color: #6E6E7E;
  flex-shrink: 0;
}
.table-row:hover .table-chevron {
  color: #44445A;
}
.table-row.table-row--expanded .table-chevron {
  transform: rotate(90deg);
  color: var(--row-accent-color, #D94F3B);
}

/* Inline detail row animation */
.detail-inline-row td {
  overflow: hidden;
}
.detail-inline-row .detail-panel {
  animation: detailSlideDown 0.3s ease-out forwards;
}
@keyframes detailSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Custom scrollbar for sidebar */
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(68,68,90,0.22); border-radius: 100px; }

/* ── Mobile bottom tab bar ── */
.mobile-bottom-tabs {
  display: none;
}

@media (max-width: 1023px) {
  .mobile-bottom-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 35;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    background: var(--card, #FFFFFF);
    border-top: 1px solid var(--border-light, #ECEAE3);
    box-shadow: 0 -2px 8px rgba(26,26,46,0.04);
    padding-bottom: env(safe-area-inset-bottom, 0);
    height: calc(56px + env(safe-area-inset-bottom, 0));
  }
  .mobile-tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 0;
    color: var(--text-muted, #6E6E7E);
    text-decoration: none;
    font-family: 'Jost', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.15s ease;
    cursor: pointer;
    background: none;
    border: none;
    position: relative;
  }
  .mobile-tab-item:hover {
    color: var(--text-soft, #44445A);
  }
  .mobile-tab-item.active {
    color: var(--coral, #D94F3B);
  }
  .mobile-tab-item .mobile-tab-icon {
    width: 20px;
    height: 20px;
  }
  .mobile-tab-item .mobile-tab-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 16px);
    min-width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--coral, #D94F3B);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
  }

  /* Offset main content for bottom tabs */
  body.has-bottom-tabs .flex.min-h-\[calc\(100vh-4rem\)\] {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0));
  }
  body.has-bottom-tabs footer {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0));
  }

  body.theme-dark .mobile-bottom-tabs {
    background: var(--dark-card);
    border-top-color: var(--dark-border);
    box-shadow: 0 -2px 8px rgba(18,22,26,0.2);
  }
  body.theme-dark .mobile-tab-item {
    color: var(--dark-text-muted);
  }
  body.theme-dark .mobile-tab-item:hover {
    color: var(--dark-text-soft);
  }
  body.theme-dark .mobile-tab-item.active {
    color: #FFB19F;
  }
}
