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

:root {
  --bg:          #111111;
  --surface:     #1a1a1a;
  --surface2:    #242424;
  --accent:      #c15f3c;
  --text:        #ececec;
  --text-muted:  #8a8a8a;
  --user-bubble: #2a2a2a;
  --bot-bubble:  #1a1a1a;
  --border:      #2d2d2d;
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-height: 56px;
  --input-height:  56px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* Auth overlay */
#auth-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.auth-box {
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border-radius: 18px;
  padding: 32px 24px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-box h2 {
  font-size: 1.4rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

.auth-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-box input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
}

.auth-box input:focus {
  border-color: var(--accent);
}

.auth-error {
  color: var(--accent);
  font-size: 0.85rem;
  text-align: center;
}

.auth-box button {
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.auth-box button:active { opacity: 0.85; }

/* App shell */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  padding-top: var(--safe-top);
}

/* Header */
#header {
  height: var(--header-height);
  min-height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

#app-title {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.03em;
  color: var(--text);
}

.header-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.header-btn:active { opacity: 0.8; }

/* Messages */
#messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.6;
  word-break: break-word;
  font-size: 0.95rem;
}

.message.user {
  background: var(--user-bubble);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  color: var(--text);
}

.message.assistant {
  background: var(--bot-bubble);
  align-self: flex-start;
  border-radius: 4px 16px 16px 16px;
  padding: 10px 14px;
  color: var(--text);
  max-width: 90%;
}

/* Markdown inside assistant messages */
.message.assistant p { margin-bottom: 0.55em; }
.message.assistant p:last-child { margin-bottom: 0; }
.message.assistant strong { color: #f0f0f0; }
.message.assistant em { color: #aaaaaa; }
.message.assistant code {
  background: rgba(255,255,255,0.07);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'SF Mono', Menlo, monospace;
}
.message.assistant ul, .message.assistant ol {
  padding-left: 1.4em;
  margin: 0.4em 0;
}
.message.assistant li { margin-bottom: 3px; }
.message.assistant hr { border: none; border-top: 1px solid var(--border); margin: 0.6em 0; }
.message.assistant a { color: #555555; text-decoration: underline; display: block; }
.message.assistant a:visited { color: #444444; }

/* Thinking indicator */
.message.thinking {
  background: var(--bot-bubble);
  align-self: flex-start;
  border-radius: 4px 16px 16px 16px;
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 0.88rem;
  min-width: 52px;
}

.thinking-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 1.2em;
}

.thinking-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: dot-pulse 1.2s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-pulse {
  0%, 60%, 100% { opacity: 0.25; transform: scale(0.8); }
  30%            { opacity: 1;    transform: scale(1);   }
}

/* Input form */
#input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  padding-bottom: calc(8px + var(--safe-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

#image-input { display: none; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.icon-btn:active { background: var(--border); }

#text-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  min-height: 40px;
  max-height: 120px;
  resize: none;
  transition: border-color 0.15s;
}

#text-input:focus { border-color: var(--accent); }
#text-input::placeholder { color: var(--text-muted); }

#send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

#send-btn:disabled { opacity: 0.35; cursor: default; }
#send-btn:not(:disabled):active { opacity: 0.8; }

/* Header actions group */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn--icon {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 6px 8px;
  font-size: 1.05rem;
  line-height: 1;
  transition: color 0.15s;
}

.header-btn--icon:active { color: var(--text); opacity: 1; }

/* Push button — subscribed state: small green tick circle */
.push-subscribed {
  background: #2d7a4f;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  flex-shrink: 0;
}

/* Read-more / collapse toggle on older bot messages */
.msg-toggle-btn {
  display: inline-block;
  margin-top: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  letter-spacing: 0.01em;
}

.header-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

/* Test panel */
#test-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  flex-shrink: 0;
}

.test-panel__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.test-panel__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.test-btn {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.test-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.test-btn:not(:disabled):active {
  background: var(--border);
}

/* ── Side nav ─────────────────────────────────────────────────────────────── */

.side-nav {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100dvh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 200;
  transition: left 0.25s ease;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-top);
}

.side-nav.open { left: 0; }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 199;
  transition: opacity 0.25s ease;
}

.nav-overlay.hidden { display: none; }

.nav-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.nav-list {
  list-style: none;
  padding: 8px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border-radius: 0;
}

.nav-item:active { background: var(--surface2); }
.nav-item.active { color: var(--accent); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }

/* Hamburger button */
.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

/* ── Tab panels ───────────────────────────────────────────────────────────── */

.tab-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.tab-panel.active { display: flex; }

#tab-tasks {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

#tab-recipes {
  position: relative;
  overflow: hidden;
}

/* ── Tasks tab ────────────────────────────────────────────────────────────── */

.tasks-list {
  padding: 8px 0;
}

.task-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.task-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 8px;
}

.task-text {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.task-date {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.task-notes {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}

.task-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--surface2);
  border-radius: 8px;
  padding: 6px 10px;
}

.task-note-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.note-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.45;
}

.note-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-delete-note {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.btn-delete-note:active { opacity: 1; }

.add-task-note-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.task-note-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 7px 12px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.task-note-input:focus { border-color: var(--accent); }
.task-note-input::placeholder { color: var(--text-muted); }

.btn-add-task-note {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
}

.btn-add-task-note:active { opacity: 0.8; }

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ── Recipes tab ──────────────────────────────────────────────────────────── */

.recipe-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: absolute;
  inset: 0;
}

/* Recipes list */
#recipe-list-view {
  overflow: hidden;
}

.recipes-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

.recipe-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.recipe-list-item:active { background: var(--surface2); }

.recipe-list-name {
  font-size: 0.95rem;
  color: var(--text);
  flex: 1;
}

.recipe-list-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-right: 10px;
}

.recipe-list-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Bottom bar: search + FAB in one aligned row */
.recipe-bottom-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  padding-bottom: calc(10px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.recipe-bottom-bar #recipe-search {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  color: var(--text);
  font-size: 0.9rem;
}
.recipe-bottom-bar #recipe-search::placeholder { color: var(--text-muted); }

/* FAB wrapper — relative anchor for sub-buttons */
.recipe-fab-wrapper {
  position: relative;
  flex-shrink: 0;
}

.fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.4);
  transition: opacity 0.15s, transform 0.2s;
  flex-shrink: 0;
}

.fab:active { opacity: 0.85; transform: scale(0.95); }

.upload-sub-btns {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  animation: sub-btns-in 0.18s ease;
  z-index: 10;
}

@keyframes sub-btns-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fab-sub {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transition: opacity 0.15s;
}

.fab-sub:active { opacity: 0.75; }

/* URL input bar — in-flow row above the bottom bar */
.url-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  flex-shrink: 0;
}

#recipe-url-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

#recipe-url-input::placeholder { color: var(--text-muted); }

.btn-fetch {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.btn-fetch:active { opacity: 0.8; }
.btn-fetch:disabled { opacity: 0.4; cursor: default; }

/* View header (shared by review + detail views) */
.view-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.view-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  padding: 6px 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.view-back-btn:active { opacity: 0.7; }

.view-title {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.btn-secondary-sm {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.btn-secondary-sm:active { background: var(--border); }

/* Review view */
#recipe-review-view .review-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.review-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.field-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recipe-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.recipe-input:focus { border-color: var(--accent); }
.recipe-input::placeholder { color: var(--text-muted); }

.recipe-textarea {
  width: 100%;
  flex: 1;
  min-height: 200px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: 'SF Mono', Menlo, monospace;
  line-height: 1.55;
  outline: none;
  resize: none;
  transition: border-color 0.15s;
}

.recipe-textarea:focus { border-color: var(--accent); }
.recipe-textarea--tall { min-height: 280px; flex: 1; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.btn-primary:active { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.4; cursor: default; }

.review-error {
  padding: 16px;
  color: var(--accent);
  font-size: 0.9rem;
}

/* Detail view */
.recipe-scroll-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.recipe-content {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Notes section */
.notes-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notes-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recipe-notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recipe-note-item {
  background: var(--surface2);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.recipe-note-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recipe-note-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.recipe-note-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

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

.btn-note-action {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.btn-note-action:active { opacity: 1; }

.add-note-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.note-textarea {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 0.88rem;
  font-family: inherit;
  line-height: 1.45;
  outline: none;
  resize: none;
  transition: border-color 0.15s;
}

.note-textarea:focus { border-color: var(--accent); }
.note-textarea::placeholder { color: var(--text-muted); }

.btn-add-note {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.btn-add-note:active { background: var(--border); }

.edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.edit-actions .btn-primary { flex: 1; }
.edit-actions .btn-secondary-sm { padding: 13px 16px; font-size: 0.95rem; }

/* ── Recipe category styles ───────────────────────────────────────────────── */

.recipe-category-header {
  padding: 6px 16px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

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

.recipe-category-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(193, 95, 60, 0.12);
  border-radius: 20px;
  padding: 2px 10px;
}

.recipe-category-badge:empty { display: none; }

.recipe-added-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.recipe-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.recipe-select:focus { border-color: var(--accent); }

/* Filter button */
.btn-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.btn-filter:active { background: var(--border); }
.btn-filter--active { color: var(--accent); border-color: var(--accent); }

/* Category filter sheet */
.category-filter-sheet {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.category-filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
}

.category-filter-option {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.category-filter-option:active { background: var(--border); }
.category-filter-option.active { color: var(--accent); border-color: var(--accent); font-weight: 600; }

/* Delete recipe button */
.btn-delete-recipe {
  background: none;
  color: #e05252;
  border: 1px solid #e05252;
  border-radius: 12px;
  padding: 11px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  transition: background 0.15s, color 0.15s;
}

.btn-delete-recipe:active { background: rgba(224,82,82,0.1); }

/* Message timestamp */
.message-time {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 5px;
  opacity: 0.65;
  letter-spacing: 0.02em;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Backups tab ──────────────────────────────────────────────────────────── */

.backups-actions {
  padding: 12px 16px 4px;
}

.backups-actions .btn-primary {
  width: 100%;
}

.backups-list {
  padding: 8px 0;
}

.backup-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.backup-item--failed .backup-detail {
  color: #c0392b;
}

.backup-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.backup-icon {
  font-size: 1.1rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.backup-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.backup-time {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
}

.backup-detail {
  color: var(--text-muted);
  font-size: 0.78rem;
  word-break: break-word;
}
