/* HowHotHowLong - Dark Theme */
/* Color scheme from original Blazor app */
:root {
  --primary: #0E0E0E;
  --secondary: #FF9000;
  --surface: #101112;
  --black: #000000;
  --background: #0E0E0E;
  --text-primary: #FFFFFF;
  --text-secondary: #B0B0B0;
  --error: #f44336;
  --success: #4caf50;
  --border: #2a2a2a;
  --hover: #1a1a1a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  min-height: 100vh;
}

/* Layout */
.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-bar {
  background-color: var(--surface);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-bar-content {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  gap: 1rem;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo-img {
  height: 40px;
  width: auto;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary);
}

.spacer {
  flex: 1;
}

.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* User Controls */
.user-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.username {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--secondary);
  color: var(--black);
}

.btn-primary:hover:not(:disabled) {
  background-color: #e68200;
}

.btn-secondary {
  background-color: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--hover);
}

.btn-danger {
  background-color: var(--error);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background-color: #d32f2f;
}

.btn-large {
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
}

.icon-btn:hover {
  background-color: var(--hover);
}

.icon-btn-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.icon-btn-small:hover {
  background-color: var(--hover);
  color: var(--text-primary);
}

/* Search */
.search-container {
  position: relative;
}

.search-input {
  width: 240px;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--secondary);
}

.search-input::placeholder {
  color: var(--text-secondary);
}

.search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--secondary);
  pointer-events: none;
}

/* Cards */
.card {
  background-color: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color 0.15s, background-color 0.15s;
  position: relative;
}

.meal-toggle-mode .card[data-hotlong-id] {
  cursor: pointer;
}

.meal-toggle-mode .card[data-hotlong-id]:hover:not(.card-in-meal) {
  border-color: #4ade80;
  opacity: 0.85;
}

.card-in-meal {
  border-color: #22c55e !important;
  background-color: #0a1a0f;
}

.card-in-meal::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  background: #22c55e;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: #0a1a0f;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 24px;
  text-align: center;
  pointer-events: none;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.card-content {
  padding: 1rem;
}

.card-create {
  border: 2px dashed var(--border);
  background: transparent;
}

.create-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 1rem;
  min-height: 150px;
}

.create-message {
  color: var(--text-secondary);
  text-align: center;
}

/* Stats */
.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: var(--primary);
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.stat-item:last-child {
  margin-bottom: 0;
}

.stat-icon {
  flex-shrink: 0;
}

.stat-icon.fire {
  color: var(--secondary);
}

.stat-icon.timer {
  color: var(--secondary);
}

.stat-value {
  font-size: 0.9rem;
}

/* Grid */
.grid-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.grid-header {
  width: 100%;
  display: flex;
  justify-content: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  width: 100%;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination-search {
  width: 10rem;
  flex: 0 0 10rem;
}

.pagination-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.pagination-create {
  flex-shrink: 0;
  margin-left: auto;
}

.pagination-bottom {
  margin-top: 1rem;
}

.page-btn {
  padding: 0.5rem 1rem;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.page-btn:hover:not(:disabled) {
  background-color: var(--hover);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  padding: 0 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Dialog */
.dialog-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.dialog {
  background-color: var(--surface);
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.dialog-content {
  padding: 1.5rem;
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
}

/* Meal-edit dialog */
.dialog-meal-edit {
  max-width: 440px;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.dialog-meal-edit .dialog-content {
  flex-shrink: 0;
  padding-bottom: 0.75rem;
}

.dialog-meal-edit .dialog-actions {
  flex-shrink: 0;
}

/* Inner HTMX swap target for the dialog's embedded grid */
.dialog-hotlong-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid var(--border);
}

.dialog-hotlong-inner .hotlong-status-row {
  flex-shrink: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.25rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.dialog-hotlong-inner .hotlong-cards {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 0.5rem 1rem;
}

.dialog-hotlong-inner .hotlong-nav-row {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 0;
}

.dialog-hotlong-inner .hotlong-nav-row .pagination {
  width: 100%;
  padding: 0.4rem 1rem;
}

.dialog-hotlong-inner .hotlong-nav-row .pagination-search {
  flex: 1;
  width: auto;
}

/* Suppress the absolute checkmark badge inside the dialog grid — the toggle button handles state */
.dialog-hotlong-inner .card-in-meal::after {
  display: none;
}

/* Forms */
.form-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input {
  padding: 0.75rem;
  background-color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 100%;
}

.input:focus {
  outline: none;
  border-color: var(--secondary);
}

.input::placeholder {
  color: var(--text-secondary);
}

.input-title {
  font-size: 1.25rem;
  font-weight: 600;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  padding: 0.5rem 0;
}

.input-title:focus {
  border-color: var(--secondary);
}

.textarea {
  resize: vertical;
  min-height: 80px;
}

/* Error messages */
.error-list {
  padding: 0.75rem;
  background-color: rgba(244, 67, 54, 0.1);
  border: 1px solid var(--error);
  border-radius: 4px;
}

.error-message {
  color: var(--error);
  font-size: 0.875rem;
}

/* Welcome Page */
.welcome-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 2rem;
}

.welcome-content {
  text-align: center;
  max-width: 800px;
}

.welcome-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--secondary);
}

.welcome-text {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.feature-icon {
  color: var(--secondary);
}

.feature-icon.list {
  color: var(--text-secondary);
}

.feature h3 {
  font-size: 1.125rem;
  font-weight: 600;
}

.feature p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* App Body - flex container for drawer + main */
.app-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.app-body .main-content {
  flex: 1;
  min-width: 0;
}

/* Meal Drawer */
.meal-drawer {
  width: 280px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  height: calc(100vh - 56px);
  position: sticky;
  top: 56px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.drawer-header h2 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
}

.drawer-date-picker {
  padding: 0.25rem 0.5rem;
  background: var(--primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.75rem;
  color-scheme: dark;
}

.drawer-date-picker:focus {
  outline: none;
  border-color: var(--secondary);
}

.drawer-day-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

/* Day Card */
.day-card {
  padding: 0.4rem 0.375rem;
  border-radius: 6px;
  background: var(--primary);
  border-left: 3px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.day-card-today {
  border-left-color: var(--secondary);
}

.day-card-dow {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.today-label {
  color: var(--secondary);
}

.day-card-today .day-card-dow {
  color: var(--secondary);
}

.day-card-dom {
  font-size: 0.625rem;
  color: var(--text-secondary);
}

.day-card-count {
  margin-top: 0.25rem;
}

.day-card-meal-total {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--border);
  border-radius: 8px;
  padding: 0.1rem 0.4rem;
  min-width: 1.25rem;
  text-align: center;
  letter-spacing: 0;
}

.btn-preset {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  width: 100%;
  text-align: left;
}

.btn-preset:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.btn-add-meal {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  width: 100%;
  text-align: left;
  opacity: 0.7;
}

.btn-add-meal:hover {
  border-color: var(--secondary);
  color: var(--secondary);
  opacity: 1;
}

.meal-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.meal-name-input {
  width: 100%;
  margin-bottom: 1rem;
}

.scroll-sentinel {
  height: 1px;
  width: 100%;
}

/* Meal Banner — full-width top strip */
.meal-banner {
  width: 100%;
  height: 180px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.meal-banner-header {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.meal-banner-header h2 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 1;
}

.meal-banner-list {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  align-items: flex-start;
}


/* Drawer Toggle */
.drawer-toggle {
  display: none;
}

/* Drawer Backdrop */
.drawer-backdrop {
  display: none;
}

/* Meal Item Dialog */
.meal-item-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
  max-height: 260px;
  overflow-y: auto;
}


.meal-item-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--primary);
  border-radius: 4px;
}

.meal-item-row span {
  flex: 1;
  font-size: 0.875rem;
}

.meal-item-remove {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.meal-item-remove:hover {
  color: var(--error);
}

.meal-item-add-row {
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  color: var(--text-secondary);
  gap: 0.375rem;
}

.meal-item-add-row:hover {
  color: var(--text-primary);
}

.meal-search-results {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 200px;
  overflow-y: auto;
}

.meal-search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--primary);
  border-radius: 4px;
  font-size: 0.875rem;
}

.meal-search-result .btn {
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
}

.meal-empty-state {
  padding: 0.75rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

/* ── Date List (test_3 meal selector) ── */
.date-list-outer {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.date-jump-bar {
  flex-shrink: 0;
  padding: 0.375rem 0.625rem;
  border-bottom: 1px solid var(--border);
}

.date-jump-input {
  width: 100%;
  font-size: 0.8125rem;
  padding: 0.25rem 0.375rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text-primary);
  cursor: pointer;
}

.date-list-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.date-list-scroll {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.today-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 0.2rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
}

.today-btn-above { top: 0.5rem; }
.today-btn-below { bottom: 0.5rem; }

.date-entry {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
}

.date-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem 0.35rem;
  position: sticky;
  top: 0;
  background: var(--hover);
  border-bottom: 1px solid var(--border);
  z-index: 1;
}

.date-entry-header.date-entry-today {
  border-left: 3px solid var(--secondary);
  padding-left: calc(0.75rem - 3px);
}

.date-entry-today .date-entry-label {
  color: var(--secondary);
}

.date-entry-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.date-add-btn {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s, border-color 0.15s;
}

.date-add-btn:hover {
  color: var(--secondary);
  border-color: var(--secondary);
}

.meal-entry-btn {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  padding: 0;
  background: var(--primary);
  border: none;
  border-top: 1px solid var(--border);
  border-left: 3px solid transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
  position: relative;
  overflow: hidden;
  transition: background-color 0.12s, border-color 0.12s;
}

.meal-entry-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.5rem 0.55rem 0.75rem;
  min-height: 3rem;
  justify-content: center;
}

/* Long-press fill animation */
.meal-entry-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--secondary);
  border-radius: 1px;
  transition: none;
}

.meal-entry-btn.meal-pressing::after {
  width: 100%;
  transition: width 650ms linear;
}

.meal-edit-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  align-self: stretch;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.meal-entry-btn:hover .meal-edit-btn {
  opacity: 1;
}

.meal-edit-btn:hover {
  color: var(--secondary);
}

.meal-entry-btn:hover {
  background-color: var(--hover);
}

.meal-entry-btn.meal-selected {
  border-left-color: var(--secondary);
  background-color: #1a1200;
}

.meal-entry-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meal-item-name {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding-left: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Active date: highlight header when one of its meals is selected */
.date-entry-active > .date-entry-header {
  border-bottom: 2px solid var(--secondary);
}

.date-entry-active > .date-entry-header .date-entry-label {
  color: var(--secondary);
}

.meal-entry-badge {
  flex-shrink: 0;
  font-size: 0.6875rem;
  color: var(--text-secondary);
  background: var(--primary);
  border-radius: 10px;
  padding: 0 0.35rem;
  min-width: 1.25rem;
  text-align: center;
}

.date-entry-empty {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
  padding: 0.75rem 0.75rem;
  min-height: 3rem;
  display: flex;
  align-items: center;
}

.date-list-sentinel {
  height: 1px;
  flex-shrink: 0;
}

/* ── Compact card mode (mobile grid in test_3) ── */
.compact-grid-mode .grid {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.compact-grid-mode .grid-item {
  width: 100%;
}

.compact-grid-mode .card-header {
  padding: 0.375rem 0.625rem;
}

.compact-grid-mode .card-content {
  padding: 0.375rem 0.625rem 0.375rem;
}

.compact-grid-mode .card-title {
  font-size: 0.875rem;
}

.compact-grid-mode .stat-item {
  padding: 0.2rem 0.375rem;
  margin-bottom: 0.2rem;
  gap: 0.4rem;
}

.compact-grid-mode .stat-icon {
  width: 16px;
  height: 16px;
}

.compact-grid-mode .stat-value {
  font-size: 0.8125rem;
}

.scroll-sentinel {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* Mobile: drawer hidden by default */
@media (max-width: 1023px) {
  .drawer-toggle {
    display: inline-flex;
  }

  .meal-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 150;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .drawer-open .meal-drawer {
    transform: translateX(0);
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 140;
    display: none;
  }

  .drawer-open .drawer-backdrop {
    display: block;
  }

  .app-body .main-content {
    max-width: 1200px;
    margin: 0 auto;
  }
}

/* Desktop: drawer always visible */
@media (min-width: 1024px) {
  .drawer-toggle {
    display: none !important;
  }

  .meal-drawer {
    display: flex;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .meal-edit-btn {
    display: none;
  }

  .app-bar-content {
    padding: 0.5rem 1rem;
    flex-wrap: wrap;
  }

  .search-input {
    width: 180px;
  }

  .username {
    display: none;
  }

  .welcome-title {
    font-size: 1.75rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .search-container {
    order: 10;
    width: 100%;
  }

  .search-input {
    width: 100%;
  }
}

/* ── HotLong List ── */
.hotlong-list {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  cursor: pointer;
}

/* suppress the large centered checkmark — border color conveys selection */
.list-item.card-in-meal::after {
  display: none;
}

.list-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.list-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-item-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.list-item-stats {
  display: flex;
  gap: 0.625rem;
  margin-top: 0.125rem;
}

.list-item-stat {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.hotlong-list-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.hotlong-list-search-bar .pagination-create {
  margin-left: 0;
}

.hotlong-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.hotlong-list-search {
  width: 100%;
  padding-right: 2rem;
}

.hotlong-search-clear {
  position: absolute;
  right: 0.375rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0.125rem;
  display: flex;
  align-items: center;
  line-height: 1;
}

.hotlong-search-clear:hover {
  color: var(--text-primary);
}
