/* ─── Reset & Base ─────────────────────────────────────────── */

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

:root {
  --cream:       #F7F3ED;
  --warm:        #FDFAF6;
  --cream-mid:   #F2EDE4;
  --cream-dark:  #E8DCCF;
  --charcoal:    #1C1A17;
  --charcoal-mid:#4A4540;
  --charcoal-lt: #8A7D6E;
  --rust:        #B5522A;
  --rust-lt:     #C96A40;
  --rust-pale:   rgba(181,82,42,0.08);
  --tan:         #C4A882;
  --muted:       #8A7D6E;
  --white:       #FFFFFF;
  --border:      rgba(28,26,23,0.12);
  --border-light:rgba(28,26,23,0.07);

  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-wordmark: 'EB Garamond', Georgia, serif;
  --font-body:     'DM Sans', system-ui, sans-serif;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  18px;
  --radius-xl:  24px;

  --shadow-card: 0 2px 12px rgba(42,37,32,0.08), 0 1px 3px rgba(42,37,32,0.06);
  --shadow-input: 0 2px 8px rgba(42,37,32,0.10);

  --header-h:   56px;
  --input-bar-h: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  height: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--rust);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

/* ─── Utility ──────────────────────────────────────────────── */

.hidden { display: none !important; }

/* ─── Key Gate ─────────────────────────────────────────────── */

.key-gate {
  position: fixed;
  inset: 0;
  background: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  z-index: 100;
}

.key-gate__inner {
  width: 100%;
  max-width: 360px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.key-gate__wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.key-gate__brand {
  font-family: var(--font-wordmark);
  font-style: italic;
  font-weight: 400;
  font-size: 56px;
  color: var(--white);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.key-gate__tagline-line {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--rust);
  padding-top: 18px;
  padding-left: 2px;
  text-align: center;
  position: relative;
}

.key-gate__tagline-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 1px;
  background: var(--rust);
}

.key-gate__field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.key-gate__field .btn {
  width: 100%;
  padding: 16px 24px;
  font-family: var(--font-wordmark);
  font-style: italic;
  font-size: 18px;
  border-radius: 14px;
}

.key-input {
  width: 100%;
  padding: 15px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1;
  color: var(--white);
  outline: none;
  transition: border-color 0.15s;
  text-align: center;
  letter-spacing: 0.05em;
  -webkit-appearance: none;
  appearance: none;
}
.key-input:focus {
  border-color: var(--rust);
}
.key-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.key-gate__name-row {
  display: flex;
  gap: 10px;
}
.key-gate__name-row .key-input {
  flex: 1;
  min-width: 0;
}

/* ─── Auth Gate additions ──────────────────────────────────── */

.btn--secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  color: var(--white);
  width: 100%;
}
.btn--secondary:hover  { background: rgba(255, 255, 255, 0.13); }
.btn--secondary:active { transform: scale(0.98); }

.auth-message {
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}
.auth-message--success {
  background: rgba(181, 82, 42, 0.18);
  color: var(--rust-lt);
}
.auth-message--error {
  background: rgba(200, 60, 60, 0.15);
  color: #E07070;
}

.auth-toggle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  margin-top: 4px;
}

.auth-toggle-link {
  background: none;
  border: none;
  color: var(--rust-lt);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 0 0 0 4px;
  text-decoration: underline;
}

.auth-welcome {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--white);
  text-align: center;
  letter-spacing: 0.01em;
}

.profile-signout-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-body);
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
  margin-top: 4px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.btn--primary {
  background: var(--rust);
  color: var(--white);
  width: 100%;
}
.btn--primary:hover  { background: var(--rust-lt); }
.btn--primary:active { transform: scale(0.98); }

/* ─── App Shell ────────────────────────────────────────────── */

.app {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ─── Home Screen ──────────────────────────────────────────── */

.home-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--charcoal);
  overflow: hidden;
}

.home-top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}

.home-logo {
  font-family: var(--font-wordmark);
  font-size: 20px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  letter-spacing: 0.01em;
}

.home-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--rust);
  border: none;
  padding: 0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Vertically centers all home content between top bar and tab bar */
.home-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 20px 8px;
  gap: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.home-hero {}

.home-greeting {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.home-headline {
  font-family: var(--font-display);
  font-size: clamp(28px, 8vw, 36px);
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.2;
}

.home-headline em {
  font-style: italic;
  color: var(--rust);
}

.home-input-wrap {}

.home-input-row {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: border-color 0.15s, background 0.15s;
}

.home-input-row:focus-within {
  border-color: rgba(181,82,42,0.45);
  background: rgba(255,255,255,0.09);
}

.home-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-style: italic;
  color: rgba(255,255,255,0.88);
  caret-color: var(--rust);
  resize: none;
  overflow-y: hidden;
  line-height: 1.5;
  min-height: 21px;
  max-height: 96px;
  -webkit-appearance: none;
  appearance: none;
}

.home-input::placeholder {
  color: rgba(255,255,255,0.28);
  font-style: italic;
}

.home-mic-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: rgba(255,255,255,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.home-send-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--rust);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

.home-send-btn:hover  { background: var(--rust-lt); }
.home-send-btn:active { transform: scale(0.94); }

.home-section {}

.home-section-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin-bottom: 10px;
}

.home-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 0 20px 2px;
  margin: 0 -20px;
}

.home-chips::-webkit-scrollbar { display: none; }

.home-chip {
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(232,220,207,0.18);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font-body);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.home-chip:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(232,220,207,0.35);
  color: var(--cream);
}

.home-or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}

.home-or-divider::before,
.home-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.10);
}

.home-or-divider span {
  font-family: var(--font-body);
  font-size: 11px;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.05em;
}

.import-recipe-btn {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px 15px 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.import-recipe-btn:hover  { background: rgba(255,255,255,0.08); }
.import-recipe-btn:active { background: rgba(255,255,255,0.11); }

.import-recipe-btn__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.import-recipe-btn__title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.2;
}

.import-recipe-btn__sub {
  font-family: var(--font-body);
  font-size: 12px;
  color: rgba(255,255,255,0.40);
  line-height: 1.4;
}

.import-recipe-btn__chevron {
  flex-shrink: 0;
  color: rgba(255,255,255,0.28);
}

/* ─── Import Recipe Sheet ───────────────────────────────────── */

#import-sheet-panel {
  background: var(--cream-mid);
}

#import-sheet-panel .sheet-handle {
  background: rgba(0,0,0,0.12);
}

#import-sheet-panel .sheet-close {
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.38);
}

#import-sheet-panel .sheet-close:hover {
  background: rgba(0,0,0,0.11);
}

.import-sheet__header {
  padding: 4px 20px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}

.import-sheet__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
  color: var(--charcoal);
  display: block;
  margin-bottom: 3px;
}

.import-sheet__subtitle {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--charcoal-lt);
  margin: 0;
  line-height: 1.4;
}

.import-sheet__body {
  padding: 18px 20px max(28px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.import-recipe-input {
  width: 100%;
  background: var(--warm);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  padding: 14px 15px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--charcoal);
  caret-color: var(--rust);
  resize: none;
  min-height: 160px;
  line-height: 1.6;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.import-recipe-input::placeholder {
  color: rgba(0,0,0,0.28);
}

.import-recipe-input:focus {
  border-color: rgba(181,82,42,0.40);
}

.import-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.import-section-label {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--charcoal-lt);
}

.import-source-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.import-source-pill {
  background: var(--warm);
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 20px;
  padding: 7px 14px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--charcoal-mid);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.import-source-pill--active {
  background: var(--cream-dark);
  border-color: rgba(0,0,0,0.18);
  color: var(--charcoal);
}

.import-intent-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.import-intent-option {
  width: 100%;
  background: var(--warm);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.import-intent-option--active {
  border-color: rgba(181,82,42,0.35);
  background: rgba(181,82,42,0.04);
}

.import-intent-radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.20);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}

.import-intent-option--active .import-intent-radio {
  border-color: var(--rust);
  background: var(--rust);
}

.import-intent-radio-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: white;
}

.import-intent-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.import-intent-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--charcoal);
  line-height: 1.2;
}

.import-intent-sub {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--charcoal-lt);
  line-height: 1.3;
}

.import-recipe-submit {
  width: 100%;
  background: var(--rust);
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.import-recipe-submit:hover:not(:disabled) { background: var(--rust-lt); }
.import-recipe-submit:active:not(:disabled) { transform: scale(0.98); }
.import-recipe-submit:disabled {
  opacity: 0.35;
  cursor: default;
}

.home-tech-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.home-tech-scroll::-webkit-scrollbar { display: none; }

.home-tech-card {
  flex-shrink: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(232,220,207,0.12);
  border-radius: 11px;
  padding: 10px 13px;
  min-width: 90px;
}

.home-tech-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 3px;
  white-space: nowrap;
}

.home-tech-ctx {
  font-size: 9px;
  color: var(--muted);
  white-space: nowrap;
}

.home-recent-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.home-recent-card:hover { background: rgba(255,255,255,0.08); }

.home-recent-emoji {
  width: 40px;
  height: 40px;
  background: rgba(28,20,10,0.7);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.home-recent-info { flex: 1; min-width: 0; }

.home-recent-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--cream);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-recent-meta {
  font-size: 10px;
  color: var(--muted);
}

.home-recent-badge {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(196,168,130,0.12);
  border: 1px solid rgba(196,168,130,0.22);
  color: var(--tan);
}

/* ─── Tab Bar ──────────────────────────────────────────────── */

.tab-bar {
  flex-shrink: 0;
  background: rgba(14,10,6,0.96);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 0;
  padding-bottom: max(10px, calc(10px + env(safe-area-inset-bottom)));
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0 12px;
}

.tab .tab-icon {
  color: rgba(255,255,255,0.28);
  display: block;
}

.tab--active .tab-icon {
  color: var(--cream);
}

.tab-label {
  font-size: 9px;
  font-weight: 500;
  color: rgba(255,255,255,0.28);
  font-family: var(--font-body);
}

.tab--active .tab-label { color: var(--rust); }

/* ─── Chat Screen ──────────────────────────────────────────── */

.chat-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--cream);
  overflow: hidden;
}

/* ─── Chat Nav ─────────────────────────────────────────────── */

.chat-nav {
  flex-shrink: 0;
  height: 52px;
  background: var(--warm);
  border-bottom: 1px solid var(--cream-dark);
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
}

.chat-nav__back {
  font-size: 22px;
  line-height: 1;
  color: var(--charcoal);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px 4px 0;
  -webkit-tap-highlight-color: transparent;
}

.chat-nav__info { flex: 1; min-width: 0; }

.chat-nav__title {
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
  color: var(--charcoal);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
}

.chat-nav__title-input {
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
  color: var(--charcoal);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--rust);
  outline: none;
  width: 100%;
  padding: 0 0 1px;
  line-height: 1.2;
}

.chat-nav__sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

.chat-nav__action {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--cream-dark);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ─── Chat Main ────────────────────────────────────────────── */

.chat-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  background: var(--warm);
}

.messages {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px 16px 20px;
  gap: 0;
}

/* ─── Message Bubbles ──────────────────────────────────────── */

.msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
  animation: msgIn 0.2s ease both;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg--user {
  align-items: flex-end;
}

.msg--assistant {
  align-items: flex-start;
}

.msg__bubble {
  max-width: min(85%, 520px);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 15px;
  line-height: 1.65;
}

.msg--user .msg__bubble {
  background: var(--rust);
  color: var(--white);
  border-bottom-right-radius: var(--radius-sm);
  white-space: pre-wrap;
}

.msg--assistant .msg__bubble {
  background: var(--white);
  color: var(--charcoal);
  border-bottom-left-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  max-width: min(100%, 560px);
}

/* Prose inside assistant bubbles */
.msg__bubble p {
  margin-bottom: 0.75em;
}
.msg__bubble p:last-child {
  margin-bottom: 0;
}
.msg__bubble strong {
  font-weight: 500;
  color: var(--charcoal);
}
.msg__bubble em {
  font-style: italic;
}
.msg__bubble ul,
.msg__bubble ol {
  padding-left: 1.3em;
  margin-bottom: 0.75em;
}
.msg__bubble li {
  margin-bottom: 0.3em;
}
.msg__bubble li:last-child { margin-bottom: 0; }
.msg__bubble code {
  font-family: monospace;
  font-size: 13px;
  background: var(--cream-mid);
  padding: 1px 5px;
  border-radius: 4px;
}
.msg__bubble h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  margin: 1em 0 0.4em;
  color: var(--charcoal);
}
.msg__bubble h2:first-child { margin-top: 0; }

.msg__bubble h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  margin: 1em 0 0.4em;
  color: var(--charcoal);
}
.msg__bubble h3:first-child { margin-top: 0; }

/* ─── Markdown Table ───────────────────────────────────────── */

.msg__bubble .md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 0.6em 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.msg__bubble .md-table th,
.msg__bubble .md-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--cream-dark);
  line-height: 1.45;
  vertical-align: top;
}

.msg__bubble .md-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--cream-mid);
  color: var(--charcoal-mid);
}

.msg__bubble .md-table tr:last-child td {
  border-bottom: none;
}

/* ─── Technique Card ───────────────────────────────────────── */

.technique-card {
  width: 100%;
  background: var(--charcoal);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 14px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.28), 0 1px 4px rgba(0,0,0,0.18);
}

.technique-card__hero {
  background: linear-gradient(135deg, #0e1820, var(--charcoal));
  padding: 20px 22px 18px;
  position: relative;
}

.technique-card__label {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247,243,237,0.38);
  display: block;
  margin-bottom: 8px;
}

.technique-card__name {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  font-style: italic;
  color: var(--cream);
  line-height: 1.1;
}

.technique-card__sections {
  background: var(--charcoal);
}

.technique-section {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.technique-section:last-child {
  border-bottom: none;
}

.technique-section__heading {
  font-family: var(--font-body);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rust);
  display: block;
  margin-bottom: 5px;
  line-height: 1;
}

.technique-section__text {
  font-size: 12.5px;
  color: rgba(247,243,237,0.82);
  line-height: 1.62;
}

@keyframes tc-pulse {
  0%, 100% { opacity: 0.22; }
  50%       { opacity: 0.48; }
}

.technique-section__placeholder {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 0;
}

.technique-section__placeholder-line {
  height: 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
  animation: tc-pulse 1.6s ease-in-out infinite;
}

.technique-section__placeholder-line:nth-child(2) { width: 80%; animation-delay: 0.15s; }
.technique-section__placeholder-line:nth-child(3) { width: 52%; animation-delay: 0.30s; }

.technique-section--mistake {
  border-bottom: none;
}

.technique-mistake {
  background: rgba(138,125,110,0.1);
  border-radius: 9px;
  padding: 9px 11px;
}

.technique-section--mistake .technique-section__heading {
  color: var(--muted);
}

.technique-section--mistake .technique-section__text {
  font-style: italic;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
}

/* ─── Typing Indicator ─────────────────────────────────────── */

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 14px 18px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  width: fit-content;
  margin-bottom: 20px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cream-dark);
  animation: typingBounce 1.2s ease infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
  0%, 60%, 100% { background: var(--cream-dark); transform: translateY(0); }
  30% { background: var(--rust); transform: translateY(-4px); }
}

/* ─── Error Message ────────────────────────────────────────── */

.msg-error {
  background: #FEF2EE;
  border: 1px solid #F5C5B4;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--rust);
  max-width: min(85%, 520px);
  margin-bottom: 20px;
}

/* ─── Input Bar ────────────────────────────────────────────── */

.input-bar {
  flex-shrink: 0;
  background: var(--cream);
  border-top: 1px solid var(--border-light);
  padding: 10px 16px 10px;
  padding-bottom: max(10px, calc(10px + env(safe-area-inset-bottom)));
}

.input-bar__inner {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
}

.input-bar__field {
  flex: 1;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 0 18px;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-input);
}

.input-bar__field:focus-within {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(192,82,42,0.10), var(--shadow-input);
}

.chat-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--charcoal);
  resize: none;
  line-height: 1.5;
  max-height: 120px;
  overflow-y: auto;
  padding: 10px 0;
}

.chat-input::placeholder {
  color: var(--charcoal-lt);
}

.send-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--rust);
  border: none;
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.send-btn:hover:not(:disabled)  { background: var(--rust-lt); }
.send-btn:active:not(:disabled) { transform: scale(0.94); }
.send-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ─── Technique Pill ───────────────────────────────────────── */

.technique-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(181,82,42,0.10);
  color: var(--rust);
  border: 1px solid rgba(181,82,42,0.28);
  border-radius: 20px;
  padding: 1px 8px 2px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: var(--font-body);
  line-height: 1.5;
  cursor: pointer;
  vertical-align: baseline;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.technique-pill:hover {
  background: rgba(181,82,42,0.17);
  border-color: rgba(181,82,42,0.45);
}

/* ─── Techniques Nav Button ────────────────────────────────── */

.chat-nav__techniques {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(181,82,42,0.10);
  border: 1px solid rgba(181,82,42,0.28);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  flex-shrink: 0;
}

.chat-nav__techniques:hover {
  background: rgba(181,82,42,0.17);
}

#techniques-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--rust);
  line-height: 1;
}

.chat-nav__techniques-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--rust);
  opacity: 0.75;
  line-height: 1;
}

/* ─── Sheet Shared ─────────────────────────────────────────── */

.t-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Technique modal must always sit above all other modals */
#technique-modal { z-index: 310; }

.t-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s ease;
}

.t-modal.is-open .t-modal__overlay {
  background: rgba(0,0,0,0.58);
}

.t-modal__sheet {
  position: relative;
  background: var(--charcoal);
  border-radius: 22px 22px 0 0;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  overscroll-behavior: contain;
}

.t-modal.is-open .t-modal__sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  border: none;
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  z-index: 2;
}

.sheet-close:hover { background: rgba(255,255,255,0.16); }

/* ─── Technique Card Modal Body ────────────────────────────── */

.t-modal__body {
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}

/* Remove the inline-card margin/shadow when inside modal */
.t-modal__body .technique-card {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Loading / error states inside modal */
.t-modal__loading,
.t-modal__error {
  padding: 48px 24px;
  text-align: center;
  color: rgba(255,255,255,0.45);
  font-size: 14px;
  line-height: 1.6;
}

.t-modal__spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--rust);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 14px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Session Sheet ────────────────────────────────────────── */

.session-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.session-sheet__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
}

.session-sheet__list {
  padding: 8px 0 max(24px, env(safe-area-inset-bottom));
}

.session-technique-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
  font-family: inherit;
}

.session-technique-row:last-child {
  border-bottom: none;
}

.session-technique-row:hover {
  background: rgba(255,255,255,0.04);
}

.session-technique-row:active {
  background: rgba(255,255,255,0.07);
}

.session-technique-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
}

.session-technique-arrow {
  color: rgba(255,255,255,0.28);
  font-size: 18px;
  line-height: 1;
}

.session-sheet__empty {
  padding: 40px 20px;
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}

/* ─── Scrollbar ────────────────────────────────────────────── */

.chat-main::-webkit-scrollbar { width: 4px; }
.chat-main::-webkit-scrollbar-track { background: transparent; }
.chat-main::-webkit-scrollbar-thumb {
  background: var(--cream-dark);
  border-radius: 4px;
}

/* ─── Saved Screen ─────────────────────────────────────────── */

.saved-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--charcoal);
  overflow: hidden;
}

.saved-header {
  flex-shrink: 0;
}

.saved-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  padding: 10px 20px 16px;
  line-height: 1.2;
}

.saved-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 4px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.saved-list::-webkit-scrollbar { width: 4px; }
.saved-list::-webkit-scrollbar-track { background: transparent; }
.saved-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}

.saved-session-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 13px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.saved-session-card:hover  { background: rgba(255,255,255,0.08); }
.saved-session-card:active { background: rgba(255,255,255,0.11); }

.saved-session-emoji {
  width: 46px;
  height: 46px;
  background: rgba(28,20,10,0.7);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}

.saved-session-info {
  flex: 1;
  min-width: 0;
}

.saved-session-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--cream);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-session-meta {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.saved-session-tech {
  font-size: 11px;
  color: rgba(181,82,42,0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.saved-rename-btn {
  color: rgba(255,255,255,0.28);
  font-size: 15px;
  padding: 4px 6px;
  flex-shrink: 0;
  cursor: pointer;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.saved-rename-btn:hover { color: rgba(255,255,255,0.6); }

.saved-rename-input {
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(200,168,130,0.6);
  color: var(--cream);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  width: 100%;
  outline: none;
  padding: 0 0 1px;
  line-height: 1.3;
}

.saved-session-arrow {
  color: rgba(255,255,255,0.22);
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

/* ─── Card long-press context menu ─────────────────────────── */

.card-ctx-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.card-ctx-menu {
  position: fixed;
  z-index: 201;
  background: #2A2520;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  overflow: hidden;
  min-width: 164px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
}

.card-ctx-item {
  display: block;
  width: 100%;
  padding: 14px 18px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--cream);
  background: none;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s;
}

.card-ctx-item:first-child { border-top: none; }
.card-ctx-item:hover       { background: rgba(255,255,255,0.06); }

.card-ctx-item--delete { color: var(--rust-lt); }

/* ─── Delete confirmation dialog ───────────────────────────── */

/* ─── Grocery list ───────────────────────────────────────────── */

.cookbook-tab:not(:last-child) { border-right: none; }

#grocery-list-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  min-height: 0;
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

.grocery-empty { padding: 48px 32px; text-align: center; }
.grocery-empty__icon { font-size: 36px; opacity: 0.3; margin-bottom: 16px; }
.grocery-empty__title { font-family: var(--font-display); font-size: 22px; font-style: italic; color: var(--cream); margin-bottom: 8px; }
.grocery-empty__sub { font-size: 12px; color: var(--charcoal-lt); line-height: 1.6; margin-bottom: 24px; }
.grocery-empty__btn { background: var(--rust); border: none; border-radius: 10px; padding: 13px 24px; font-family: var(--font-display); font-size: 16px; font-style: italic; color: #fff; cursor: pointer; }

.grocery-preview-wrap { padding: 14px 16px 0; }
.grocery-preview-card { background: #201E1A; border: 1px solid rgba(255,255,255,0.07); border-radius: 14px; overflow: hidden; }
.grocery-preview-hero { background: linear-gradient(160deg, #1E2B1F 0%, #141C15 100%); padding: 16px 16px 14px; display: flex; align-items: flex-start; justify-content: space-between; cursor: pointer; }
.grocery-preview-title { font-family: var(--font-display); font-size: 22px; font-style: italic; font-weight: 300; color: var(--cream); }
.grocery-preview-hint { font-size: 10px; color: rgba(90,138,106,0.7); margin-top: 2px; }
.grocery-preview-wa { font-family: var(--font-display); font-size: 11px; font-style: italic; color: rgba(255,255,255,0.2); }
.grocery-preview-body { padding: 12px 16px 14px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.grocery-preview-meta { font-size: 11px; color: rgba(255,255,255,0.45); line-height: 1.6; }
.grocery-preview-sources { font-size: 10px; color: rgba(255,255,255,0.22); margin-top: 2px; }
.grocery-preview-date { font-size: 10px; color: rgba(255,255,255,0.22); margin-top: 4px; }
.grocery-preview-arrow { font-size: 16px; color: rgba(255,255,255,0.22); }
.grocery-rebuild-btn { width: 100%; text-align: center; padding: 12px 0 16px; font-size: 11px; color: rgba(200,135,74,0.8); background: none; border: none; cursor: pointer; }

.grocery-list-header { padding: 14px 20px 12px; border-bottom: 1px solid rgba(255,255,255,0.07); display: flex; align-items: center; justify-content: space-between; }
.grocery-list-title { font-family: var(--font-display); font-size: 18px; font-style: italic; color: var(--cream); }
.grocery-list-sub { font-size: 10px; color: rgba(255,255,255,0.22); margin-top: 2px; }
.grocery-list-rebuild { font-size: 11px; color: rgba(200,135,74,0.8); background: none; border: none; cursor: pointer; }

.grocery-card { background: #201E1A; border-radius: 16px; overflow: hidden; margin: 14px 16px; border: 1px solid rgba(255,255,255,0.07); }
.grocery-card__hero { background: linear-gradient(160deg, #1E2B1F 0%, #141C15 100%); padding: 20px 18px 18px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.grocery-card__eyebrow { font-size: 9px; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase; color: rgba(90,138,106,0.7); margin-bottom: 6px; }
.grocery-card__title-row { display: flex; align-items: baseline; gap: 8px; }
.grocery-card__title { font-family: var(--font-display); font-size: 28px; font-style: italic; font-weight: 300; color: var(--cream); line-height: 1.1; cursor: pointer; }
.grocery-card__edit { font-size: 10px; color: rgba(90,138,106,0.7); cursor: pointer; }
.grocery-card__sub { font-size: 10px; color: rgba(255,255,255,0.45); margin-top: 6px; }
.grocery-card__body { padding: 4px 0; }
.grocery-card__category { padding: 12px 18px 0; }
.grocery-card__cat-label { font-size: 8px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(90,138,106,0.8); margin-bottom: 10px; }
.grocery-card__item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.grocery-card__dot { width: 4px; height: 4px; border-radius: 50%; background: #5A8A6A; opacity: 0.6; flex-shrink: 0; margin-top: 6px; }
.grocery-card__item-text { font-size: 13px; color: rgba(255,255,255,0.45); line-height: 1.4; }
.grocery-card__divider { height: 1px; background: rgba(255,255,255,0.07); margin: 10px 18px; }
.grocery-card__footer { padding: 12px 18px 14px; border-top: 1px solid rgba(255,255,255,0.07); display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.grocery-card__footer-url { font-size: 9px; color: rgba(255,255,255,0.22); letter-spacing: 0.08em; }
.grocery-card__footer-brand { font-family: var(--font-display); font-size: 13px; font-style: italic; color: rgba(255,255,255,0.22); display: flex; align-items: center; gap: 5px; }
.grocery-card__footer-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--rust); opacity: 0.5; }

.grocery-share-btns { padding: 0 16px 28px; display: flex; gap: 10px; margin-top: 4px; }
.grocery-share-btn { flex: 1; background: var(--rust); border: none; border-radius: 10px; padding: 13px; text-align: center; font-size: 13px; font-weight: 500; color: #fff; cursor: pointer; }
.grocery-save-btn { flex: 1; background: transparent; border: 1px solid rgba(255,255,255,0.07); border-radius: 10px; padding: 13px; text-align: center; font-size: 13px; color: rgba(255,255,255,0.45); cursor: pointer; font-family: var(--font-body); }

.grocery-builder-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,0.58); display: flex; flex-direction: column; justify-content: flex-end; }
.grocery-builder-sheet { background: #1C1A17; border-radius: 20px 20px 0 0; padding: 20px 20px 40px; max-height: 82vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.grocery-builder-handle { width: 36px; height: 4px; background: rgba(255,255,255,0.15); border-radius: 2px; margin: 0 auto 16px; }
.grocery-builder-title { font-family: var(--font-display); font-size: 22px; font-style: italic; color: var(--cream); margin-bottom: 4px; }
.grocery-builder-sub { font-size: 11px; color: rgba(255,255,255,0.45); margin-bottom: 20px; }
.grocery-builder-section { font-size: 8px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255,255,255,0.22); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.grocery-builder-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,0.07); cursor: pointer; user-select: none; -webkit-user-select: none; }
.grocery-builder-item:last-of-type { border-bottom: none; }
.grocery-builder-checkbox { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,0.2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; }
.grocery-builder-checkbox--checked { background: var(--rust); border-color: var(--rust); }
.grocery-builder-item-name { font-family: var(--font-display); font-size: 15px; font-style: italic; color: var(--cream); }
.grocery-builder-item-sub { font-size: 10px; color: rgba(255,255,255,0.22); margin-top: 2px; }
.grocery-builder-empty-note { padding: 8px 0; color: rgba(255,255,255,0.3); }
.grocery-builder-spacer { height: 16px; }
.grocery-builder-generate { width: 100%; background: var(--rust); border: none; border-radius: 10px; padding: 14px; font-family: var(--font-display); font-size: 16px; font-style: italic; color: #fff; margin-top: 16px; cursor: pointer; transition: opacity 0.12s; }
.grocery-builder-generate:disabled { opacity: 0.35; cursor: not-allowed; }
.grocery-builder-cancel { width: 100%; text-align: center; font-size: 12px; color: rgba(255,255,255,0.45); margin-top: 12px; background: none; border: none; cursor: pointer; padding: 8px; font-family: var(--font-body); }

.grocery-rename-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0.68); display: flex; align-items: center; justify-content: center; padding: 24px; }
.grocery-rename-box { background: #2A2520; border: 1px solid rgba(255,255,255,0.10); border-radius: 18px; padding: 24px 20px 20px; width: 100%; max-width: 300px; }
.grocery-rename-title { font-family: var(--font-display); font-size: 1.2rem; color: var(--cream); text-align: center; margin-bottom: 16px; }
.grocery-rename-input { width: 100%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); border-radius: 8px; padding: 10px 12px; font-family: var(--font-display); font-size: 16px; font-style: italic; color: var(--cream); margin-bottom: 16px; outline: none; box-sizing: border-box; }
.grocery-rename-actions { display: flex; gap: 10px; }
.grocery-rename-btn { flex: 1; padding: 11px 0; border-radius: 10px; font-family: var(--font-body); font-size: 0.88rem; font-weight: 500; border: none; cursor: pointer; }
.grocery-rename-btn--cancel { background: rgba(255,255,255,0.09); color: var(--cream); }
.grocery-rename-btn--save { background: var(--rust); color: var(--cream); }

/* ─── Dish selection modal ───────────────────────────────────── */

.dish-select-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0,0,0,0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.dish-select-modal {
  background: #2A2520;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 18px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.dish-select-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--cream);
  text-align: center;
  margin-bottom: 4px;
}

.dish-select-sub {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--charcoal-lt);
  text-align: center;
  margin-bottom: 18px;
}

.dish-select-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.dish-select-item {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid transparent;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--cream);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.dish-select-item--active {
  background: var(--rust-pale);
  border-color: var(--rust-lt);
  color: var(--cream);
}

.dish-select-confirm {
  width: 100%;
  padding: 13px 0;
  border-radius: 10px;
  background: var(--rust);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.12s;
  margin-bottom: 12px;
}

.dish-select-confirm:hover { opacity: 0.88; }

.dish-select-cancel {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: var(--charcoal-lt);
  cursor: pointer;
  padding: 4px 0;
}

.dish-select-cancel:hover { color: var(--cream); }

/* ─── Share card preview overlay ────────────────────────────── */

.share-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.94);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.share-preview-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 0 52px;
  min-height: 100%;
}

.share-preview-canvas-wrap {
  width: 390px;
  max-width: calc(100vw - 32px);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}

.share-preview-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.share-preview-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  width: calc(100% - 48px);
  max-width: 330px;
}

.share-preview-btn {
  width: 100%;
  padding: 14px 0;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.12s;
}

.share-preview-btn:hover { opacity: 0.88; }

.share-preview-btn--share {
  background: var(--rust);
  color: var(--cream);
}

.share-preview-btn--copy {
  background: rgba(255,255,255,0.08);
  color: var(--cream);
  border: 1px solid rgba(255,255,255,0.12);
}

.share-preview-cancel {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.84rem;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 4px 0;
  margin-top: 4px;
}

.share-preview-cancel:hover { color: var(--cream); }

.card-ctx-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0,0,0,0.58);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-ctx-confirm {
  background: #2A2520;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 24px 20px 20px;
  width: 280px;
  text-align: center;
}

.card-ctx-confirm__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--cream);
  margin-bottom: 6px;
}

.card-ctx-confirm__sub {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--charcoal-lt);
  margin-bottom: 20px;
}

.card-ctx-confirm__actions {
  display: flex;
  gap: 10px;
}

.card-ctx-confirm__btn {
  flex: 1;
  padding: 11px 0;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.12s;
}

.card-ctx-confirm__btn:hover  { opacity: 0.85; }

.card-ctx-confirm__btn--cancel {
  background: rgba(255,255,255,0.09);
  color: var(--cream);
}

.card-ctx-confirm__btn--delete {
  background: var(--rust);
  color: var(--cream);
}

.saved-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 20px;
  text-align: center;
}

.saved-empty-icon {
  font-size: 52px;
  opacity: 0.22;
}

.saved-empty-text {
  font-size: 14px;
  color: rgba(255,255,255,0.28);
  line-height: 1.7;
}

/* ─── Cookbook sub-tabs ────────────────────────────────────── */

.cookbook-tabs {
  display: flex;
  padding: 0 16px 14px;
  gap: 0;
}

.cookbook-tab {
  flex: 1;
  padding: 9px 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.40);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.cookbook-tab:first-child {
  border-radius: 8px 0 0 8px;
  border-right: none;
}

.cookbook-tab:last-child {
  border-radius: 0 8px 8px 0;
}

.cookbook-tab--active {
  background: rgba(255,255,255,0.12);
  color: var(--cream);
}

/* ─── Cookbook panel ───────────────────────────────────────── */

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

/* ─── Recipe cards ─────────────────────────────────────────── */

.recipe-card {
  background: #1A1714;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.recipe-card:hover  { background: rgba(255,255,255,0.06); }
.recipe-card:active { background: rgba(255,255,255,0.09); }

.recipe-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.recipe-card__name {
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  color: var(--cream);
  line-height: 1.2;
}

.recipe-card__date {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  padding-top: 5px;
}

.recipe-card__why {
  font-size: 12px;
  color: rgba(255,255,255,0.42);
  line-height: 1.55;
  margin-bottom: 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.recipe-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recipe-card__pill {
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--cream);
  background: rgba(181,82,42,0.20);
  border: 1px solid rgba(181,82,42,0.35);
  border-radius: 4px;
  padding: 3px 8px;
  letter-spacing: 0.02em;
}

/* ─── Recipe modal content ─────────────────────────────────── */

.recipe-modal__sheet {
  background: #1A1714;
}

.recipe-modal__body {
  padding-bottom: 0;
}

.recipe-modal__header {
  background: #1A1714;
  padding: 20px 24px 24px;
}

.recipe-modal__inner {
  padding: 20px 24px 4px;
}

.recipe-modal__title {
  font-family: var(--font-display);
  font-size: 38px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.12;
  margin-bottom: 0;
}

.recipe-modal__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 22px;
}

.recipe-modal__pill {
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--cream);
  background: rgba(181,82,42,0.20);
  border: 1px solid rgba(181,82,42,0.45);
  border-radius: 5px;
  padding: 4px 11px;
  letter-spacing: 0.03em;
}

.recipe-modal__section {
  border-top: 1px solid rgba(28,26,23,0.10);
  padding: 18px 0 6px;
}

.recipe-modal__section-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
  display: block;
  margin-bottom: 12px;
}

.recipe-modal__ingredients {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 8px;
}

.recipe-modal__ingredient {
  font-size: 13px;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  color: var(--charcoal-mid);
  line-height: 1.5;
  padding-left: 14px;
  position: relative;
}

.recipe-modal__ingredient::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8B4513;
  opacity: 0.5;
}

.recipe-modal__why {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--charcoal);
  line-height: 1.65;
  margin-bottom: 8px;
}

.recipe-modal__steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 8px;
}

.recipe-modal__step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.recipe-modal__step-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  font-weight: 300;
  color: var(--rust);
  opacity: 0.45;
  line-height: 1;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  padding-top: 1px;
}

.recipe-modal__step-body {
  flex: 1;
  min-width: 0;
}

.recipe-modal__step-action {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.4;
  margin-bottom: 2px;
}

.recipe-modal__step-desc {
  font-size: 13px;
  font-weight: 300;
  color: var(--charcoal-mid);
  line-height: 1.6;
}

.recipe-modal__step-note {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px;
  color: var(--charcoal-lt);
  line-height: 1.55;
  margin-top: 5px;
}

/* ─── Save-to-Cookbook context menu item ───────────────────── */

.card-ctx-item--cookbook {
  color: var(--tan);
}

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

.wa-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #2A2520;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: 22px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
  pointer-events: none;
}

.wa-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Profile Screen ──────────────────────────────────────── */

.profile-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--charcoal);
  overflow: hidden;
}

.profile-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: 8px;
}

.profile-scroll::-webkit-scrollbar { width: 4px; }
.profile-scroll::-webkit-scrollbar-track { background: transparent; }
.profile-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}

.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 28px;
  gap: 6px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--rust);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  color: white;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.profile-name {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  color: var(--cream);
  line-height: 1.2;
}

.profile-subtitle {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 16px 24px;
}

.profile-stat-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 10px 13px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.profile-stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--cream);
  line-height: 1;
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-text-size-adjust: 100%;
}

.profile-stat-value--dish {
  font-size: 13px;
  font-style: italic;
  color: var(--tan);
  line-height: 1.3;
  word-break: break-word;
  hyphens: auto;
}

.profile-stat-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  line-height: 1.3;
}

.profile-section {
  padding: 0 16px 24px;
}

.profile-section-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin-bottom: 10px;
}

.profile-tech-list {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  overflow: hidden;
}

.profile-tech-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  width: 100%;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s;
}

.profile-tech-row:last-child { border-bottom: none; }
.profile-tech-row:hover      { background: rgba(255,255,255,0.04); }
.profile-tech-row:active     { background: rgba(255,255,255,0.07); }

/* ─── Technique-for-Profile dish list (inside modal) ───────── */

.tech-dish-list {
  padding: 8px 0 max(20px, env(safe-area-inset-bottom));
}

.tech-dish-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
  font-family: inherit;
}

.tech-dish-row:last-child { border-bottom: none; }
.tech-dish-row:hover      { background: rgba(255,255,255,0.04); }
.tech-dish-row:active     { background: rgba(255,255,255,0.07); }

.tech-dish-info {
  flex: 1;
  min-width: 0;
}

.tech-dish-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.2;
  margin-bottom: 3px;
}

.tech-dish-date {
  font-size: 11px;
  color: var(--muted);
}

.tech-dish-arrow {
  color: rgba(255,255,255,0.28);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.tech-dish-empty {
  padding: 32px 22px;
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.3);
  font-style: italic;
}

.profile-tech-rank {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.22);
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.profile-tech-name {
  flex: 1;
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
}

.profile-tech-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--rust);
  background: rgba(181,82,42,0.10);
  border: 1px solid rgba(181,82,42,0.22);
  border-radius: 20px;
  padding: 2px 9px;
  flex-shrink: 0;
}

.profile-empty {
  padding: 24px 20px;
  font-size: 13px;
  font-style: italic;
  color: rgba(255,255,255,0.22);
  text-align: center;
}

/* ─── Profile About section ─────────────────────────────────── */

.profile-section--about { padding: 0 16px 8px; }

.profile-about-list { display: flex; flex-direction: column; }

.profile-about-row {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  font-family: inherit;
}

.profile-about-row:hover { background: rgba(255,255,255,0.07); }
.profile-about-row:active { background: rgba(255,255,255,0.10); }

.profile-about-row-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  color: var(--cream);
  margin-bottom: 2px;
  text-align: left;
}

.profile-about-row-sub {
  font-family: var(--font-body);
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-align: left;
}

.profile-about-row-chevron {
  color: rgba(255,255,255,0.25);
  font-size: 18px;
  flex-shrink: 0;
  margin-left: 12px;
}

/* ─── How to Use modal ───────────────────────────────────────── */

.t-modal__sheet.htu-sheet {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 90vh;
  min-height: 90dvh;
  max-height: 96vh;
  max-height: 96dvh;
}

.htu-hero {
  flex-shrink: 0;
  background: #1A1714;
  padding: 28px 24px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.htu-eyebrow {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(181,82,42,0.7);
  margin-bottom: 10px;
}

.htu-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-style: italic;
  font-weight: 400;
  color: rgba(255,255,255,0.88);
  line-height: 1.08;
}

.htu-tagline {
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  margin-top: 10px;
  line-height: 1.55;
}

.htu-dots {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px 0 10px;
  background: var(--charcoal);
}

.htu-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: background 0.2s;
}

.htu-dot--active { background: var(--rust); }

.htu-cards {
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.htu-card { display: block; }

.htu-block {
  padding: 24px 24px;
}

.htu-block--border {
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.htu-block-eyebrow {
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin-bottom: 16px;
}

/* Steps */
.htu-steps { display: flex; flex-direction: column; gap: 20px; }

.htu-step { display: flex; gap: 16px; align-items: flex-start; }

.htu-step-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-style: italic;
  font-weight: 300;
  color: var(--rust);
  opacity: 0.45;
  line-height: 1;
  flex-shrink: 0;
  width: 22px;
  padding-top: 1px;
}

.htu-step-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  margin-bottom: 4px;
}

.htu-step-desc {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.45);
}

/* Try asking */
.htu-try-list { display: flex; flex-direction: column; gap: 10px; }

.htu-try-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 14px;
  color: rgba(255,255,255,0.72);
  line-height: 1.4;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.htu-try-arrow {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 14px;
  color: var(--rust);
  opacity: 0.5;
  flex-shrink: 0;
  margin-left: auto;
}

/* Pills */
.htu-pills-list { display: flex; flex-direction: column; gap: 16px; }

.htu-pill-row { display: flex; align-items: center; gap: 14px; }

.htu-pill-sample {
  flex-shrink: 0;
  min-width: 86px;
  justify-content: center;
  pointer-events: none;
  cursor: default;
}

.htu-pill-explain {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255,255,255,0.45);
}

/* Library block */
.htu-library-block {
  padding: 20px 24px;
  background: rgba(255,255,255,0.03);
}

.htu-library-inner { display: flex; gap: 14px; align-items: flex-start; }
.htu-library-icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }

.htu-library-title {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
  margin-bottom: 4px;
}

.htu-library-desc {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.45);
}

/* Cookbook */
.htu-cookbook-steps { display: flex; flex-direction: column; gap: 16px; }

.htu-cookbook-step { display: flex; gap: 12px; align-items: flex-start; }

.htu-cookbook-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }

.htu-cookbook-text {
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.45);
}

.htu-cookbook-text strong { font-weight: 500; color: rgba(255,255,255,0.75); }

/* Difference block */
.htu-difference-block {
  padding: 24px 24px;
  background: #1A1714;
}

.htu-difference-text {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 300;
  font-style: italic;
  line-height: 1.65;
  color: rgba(255,255,255,0.55);
  text-align: center;
}

.htu-difference-attr {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  text-align: center;
  margin-top: 12px;
}

/* Navigation */
.htu-nav {
  flex-shrink: 0;
  padding: 14px 24px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 10px;
  background: var(--charcoal);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.htu-btn-prev {
  flex: 1;
  padding: 13px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: transparent;
  color: rgba(255,255,255,0.55);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s;
}

.htu-btn-prev:hover { background: rgba(255,255,255,0.05); }

.htu-btn-next {
  flex: 2;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: var(--rust);
  color: white;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.12s;
}

.htu-btn-next:hover { opacity: 0.88; }

.htu-btn-done {
  flex: 1;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: var(--rust);
  color: white;
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.12s;
}

.htu-btn-done:hover { opacity: 0.88; }

.profile-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 16px 24px;
  gap: 8px;
}

.profile-version {
  font-family: var(--font-body);
  font-size: 11px;
  color: rgba(255,255,255,0.22);
  margin: 0;
}

.profile-disclaimer {
  font-family: var(--font-body);
  font-size: 11px;
  color: rgba(255,255,255,0.22);
  text-align: center;
  line-height: 1.5;
  margin: 0;
  padding: 0 16px;
}

.profile-clear-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255,255,255,0.22);
  cursor: pointer;
  padding: 10px 24px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}

.profile-clear-btn:hover {
  color: rgba(255,255,255,0.42);
}

/* ─── Techniques Screen ─────────────────────────────────────── */

.techniques-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--charcoal);
  overflow: hidden;
}

.techniques-header {
  flex-shrink: 0;
  background: var(--charcoal);
}

.techniques-title-row {
  padding: 8px 20px 14px;
}

.techniques-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.2;
}

.techniques-progress {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-block;
}

.techniques-progress:hover { color: var(--tan); }

.techniques-search-wrap {
  padding: 0 16px 12px;
}

.techniques-search {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--cream);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.techniques-search::placeholder {
  color: rgba(255,255,255,0.25);
  font-style: italic;
}

.techniques-search:focus {
  border-color: rgba(181,82,42,0.45);
  background: rgba(255,255,255,0.09);
}

.techniques-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 4px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--charcoal);
}

.techniques-scroll::-webkit-scrollbar { width: 4px; }
.techniques-scroll::-webkit-scrollbar-track { background: transparent; }
.techniques-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}

.techniques-group-label {
  display: block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
  margin-bottom: 10px;
}

.techniques-cat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 14px;
  margin-bottom: 7px;
  letter-spacing: 0.01em;
}

.techniques-cat-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.technique-discovered-hat {
  font-size: 15px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.8;
}

.techniques-empty {
  padding: 48px 20px;
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.28);
  font-style: italic;
}

.technique-card__tagline-sub {
  font-size: 12px;
  font-style: normal;
  font-family: var(--font-body);
  color: rgba(247,243,237,0.38);
  margin-top: 8px;
  line-height: 1.45;
}

/* ─── Library Pill ─────────────────────────────────────────── */

.library-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(101,90,70,0.10);
  color: #5A4F3A;
  border: 1px solid rgba(101,90,70,0.28);
  border-radius: 20px;
  padding: 1px 8px 2px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: var(--font-body);
  line-height: 1.5;
  cursor: pointer;
  vertical-align: baseline;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.library-pill:hover {
  background: rgba(101,90,70,0.17);
  border-color: rgba(101,90,70,0.45);
}

/* ─── Library Screen ────────────────────────────────────────── */

.library-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--charcoal);
  overflow: hidden;
}

.library-header {
  flex-shrink: 0;
  background: var(--charcoal);
}

.library-title-row {
  padding: 6px 20px 10px;
}

.library-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.2;
}

.library-filters {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.library-filters::-webkit-scrollbar { display: none; }

.lib-filter {
  flex-shrink: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.lib-filter--active {
  background: rgba(181,82,42,0.14);
  border-color: rgba(181,82,42,0.35);
  color: var(--rust-lt);
}

.library-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.library-scroll::-webkit-scrollbar { width: 4px; }
.library-scroll::-webkit-scrollbar-track { background: transparent; }
.library-scroll::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}

/* ─── Library Progress Chip ─────────────────────────────────── */

.lib-section {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.lib-section-header {
  padding: 0 16px 10px;
}

.lib-progress-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 10px 13px;
}

.lib-progress-chip__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.lib-progress-chip__label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.lib-progress-chip__count {
  font-size: 10px;
  font-weight: 500;
  color: var(--tan);
}

.lib-progress-bar {
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}

.lib-progress-bar__fill {
  height: 100%;
  background: var(--rust);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ─── Techniques Section (within Library) ───────────────────── */

.lib-techniques-content {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lib-tech-cat-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 4px;
}

.lib-tech-cards {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* ─── Knife Cuts Section ────────────────────────────────────── */

.kc-scroll-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  padding: 0 16px;
  padding-right: 16px;
}

.kc-scroll-row::-webkit-scrollbar { display: none; }

.kc-scroll-row::after {
  content: '';
  min-width: 1px;
  flex-shrink: 0;
}

.kc-scroll-card {
  flex-shrink: 0;
  width: 136px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 13px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.kc-scroll-card:hover  { background: rgba(255,255,255,0.08); }
.kc-scroll-card:active { background: rgba(255,255,255,0.11); }

.kc-scroll-card__visual {
  height: 96px;
  background: #1A1714;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.kc-scroll-card__visual svg {
  width: 100%;
  height: 100%;
  max-height: 68px;
}

.kc-scroll-card__body {
  padding: 10px 11px 11px;
}

.kc-scroll-card__name {
  font-family: var(--font-display);
  font-size: 15px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.15;
  margin-bottom: 2px;
}

.kc-scroll-card__sub {
  font-size: 9.5px;
  color: var(--muted);
  margin-bottom: 8px;
  line-height: 1.3;
}

.kc-scroll-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.kc-dim-tag {
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 2px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75px;
}

.kc-pips {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.kc-pip {
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,0.12);
}

.kc-pip--filled {
  background: var(--rust);
  opacity: 0.75;
}

/* ─── Knife Cut Vertical List ───────────────────────────────── */

.kc-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kc-list-card {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 13px;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.kc-list-card:active { background: rgba(255,255,255,0.08); }

.kc-list-card__visual {
  height: 120px;
  background: #1A1714;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.kc-list-card__visual svg {
  width: 100%;
  height: 100%;
  max-height: 88px;
}

.kc-list-card__bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px 14px;
}

.kc-list-card__info {
  flex: 1;
  min-width: 0;
}

.kc-list-card__name {
  font-family: var(--font-display);
  font-size: 19px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.15;
  margin-bottom: 2px;
}

.kc-list-card__sub {
  font-size: 11px;
  font-weight: 300;
  color: var(--muted);
  margin-bottom: 9px;
  line-height: 1.3;
}

.kc-list-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kc-list-card__chevron {
  font-size: 20px;
  color: rgba(255,255,255,0.22);
  flex-shrink: 0;
  line-height: 1;
  padding-bottom: 1px;
}

/* ─── Knife Cut Modal Card ──────────────────────────────────── */

.kc-modal-card {
  padding: 0 0 max(20px, env(safe-area-inset-bottom));
}

.kc-modal-card__visual {
  height: 160px;
  background: #1A1714;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.kc-modal-card__visual svg {
  width: 100%;
  max-width: 220px;
  max-height: 112px;
}

.kc-modal-card__content {
  padding: 20px 22px 0;
}

.kc-modal-card__cat {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
  display: block;
  margin-bottom: 6px;
}

.kc-modal-card__name {
  font-family: var(--font-display);
  font-size: 30px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.1;
  margin-bottom: 2px;
}

.kc-modal-card__sub {
  font-size: 13px;
  color: rgba(247,243,237,0.4);
  margin-bottom: 14px;
}

.kc-modal-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.kc-modal-card__dim {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: rgba(255,255,255,0.07);
  border-radius: 20px;
  padding: 3px 10px;
}

.kc-modal-card__diff {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.kc-modal-card__diff-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.28);
}

.kc-modal-card__diff-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
}

.kc-modal-card__body {
  font-size: 13px;
  color: rgba(247,243,237,0.75);
  line-height: 1.68;
}

.kc-modal-card__body p + p {
  margin-top: 10px;
}

/* ─── Terminology Cards (list) ──────────────────────────────── */

.term-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.term-list-card {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 13px;
  overflow: hidden;
  text-align: left;
  width: 100%;
  font-family: inherit;
}

.term-list-card__accent {
  width: 3px;
  background: var(--rust);
  flex-shrink: 0;
  opacity: 0.65;
}

.term-list-card__content {
  flex: 1;
  padding: 13px 14px 12px;
  min-width: 0;
}

.term-list-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.term-list-card__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.15;
}

.term-list-card__origin {
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.term-list-card__body {
  font-size: 12px;
  color: rgba(247,243,237,0.6);
  line-height: 1.62;
  margin-bottom: 7px;
}

.term-list-card__insight {
  font-size: 11.5px;
  font-style: italic;
  color: rgba(247,243,237,0.38);
  line-height: 1.5;
  margin-bottom: 9px;
}

.term-list-card__see-also {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.term-see-also-label {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
}

.term-see-also-tag {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--tan);
  background: rgba(196,168,130,0.09);
  border: 1px solid rgba(196,168,130,0.2);
  border-radius: 20px;
  padding: 2px 9px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.term-see-also-tag:hover {
  background: rgba(196,168,130,0.17);
}

/* ─── Terminology Modal Card ────────────────────────────────── */

.term-modal-card {
  padding: 0 0 max(20px, env(safe-area-inset-bottom));
}

.term-modal-card__hero {
  padding: 20px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
}

.term-modal-card__hero::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--rust);
  opacity: 0.6;
}

.term-modal-card__cat {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
  display: block;
  margin-bottom: 6px;
}

.term-modal-card__name {
  font-family: var(--font-display);
  font-size: 30px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.1;
  margin-bottom: 3px;
}

.term-modal-card__sub {
  font-size: 13px;
  color: rgba(247,243,237,0.38);
  margin-bottom: 8px;
}

.term-modal-card__origin {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 20px;
  padding: 3px 10px;
  display: inline-block;
}

.term-modal-card__body {
  padding: 16px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.term-modal-card__body p {
  font-size: 13px;
  color: rgba(247,243,237,0.78);
  line-height: 1.7;
}

.term-modal-card__body p + p {
  margin-top: 10px;
}

.term-modal-card__insight {
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.term-modal-card__insight-text {
  font-size: 12.5px;
  font-style: italic;
  color: rgba(247,243,237,0.42);
  line-height: 1.6;
}

.term-modal-card__see-also {
  padding: 14px 22px;
}

.term-modal-card__see-also-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  display: block;
  margin-bottom: 8px;
}

.term-modal-card__see-also-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ─── Library Modal Nav (breadcrumb) ────────────────────────── */

.lib-modal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  min-height: 44px;
}

.lib-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--rust-lt);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.lib-breadcrumb {
  flex: 1;
  font-size: 11px;
  color: rgba(255,255,255,0.28);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-breadcrumb-sep {
  margin: 0 4px;
  opacity: 0.4;
}

/* ─── Principle List Cards (Library section) ────────────────── */

.principle-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.principle-list-card {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 13px;
  overflow: hidden;
  text-align: left;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.principle-list-card:active { background: rgba(255,255,255,0.08); }

.principle-list-card__accent {
  width: 3px;
  align-self: stretch;
  flex-shrink: 0;
  opacity: 0.7;
}

.principle-list-card__content {
  flex: 1;
  padding: 13px 12px 12px 14px;
  min-width: 0;
}

.principle-list-card__name {
  font-family: var(--font-display);
  font-size: 18px;
  font-style: italic;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.15;
  margin-bottom: 2px;
}

.principle-list-card__sub {
  font-size: 11.5px;
  font-weight: 300;
  color: rgba(247,243,237,0.45);
  line-height: 1.35;
}

.principle-list-card__chevron {
  font-size: 18px;
  color: rgba(255,255,255,0.22);
  padding: 0 14px 0 6px;
  flex-shrink: 0;
  line-height: 1;
}

/* ─── Principle Modal Card ──────────────────────────────────── */

.principle-modal-card {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.principle-modal__hero {
  padding: 28px 22px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.principle-modal__eyebrow {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 10px;
}

.principle-modal__title {
  font-family: var(--font-display);
  font-size: 48px;
  font-style: italic;
  font-weight: 300;
  color: rgba(247,243,237,0.92);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.principle-modal__title--sm {
  font-size: 34px;
  line-height: 1.05;
}

.principle-modal__sub {
  font-size: 12px;
  font-weight: 300;
  color: rgba(247,243,237,0.38);
  letter-spacing: 0.04em;
}

/* Sections */

.principle-modal__section {
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.principle-modal__section-eyebrow {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 12px;
}

.principle-modal__core-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
  line-height: 1.6;
  color: rgba(247,243,237,0.82);
}

/* Timing */

.principle-modal__timing {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.principle-modal__timing-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 12px;
  align-items: start;
}

.principle-modal__timing-moment {
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 3px;
  border-top: 1px solid rgba(255,255,255,0.1);
  line-height: 1.4;
}

.principle-modal__timing-action {
  font-size: 12.5px;
  font-weight: 300;
  line-height: 1.65;
  color: rgba(247,243,237,0.65);
}

.principle-modal__timing-action strong {
  font-weight: 500;
  color: rgba(247,243,237,0.88);
}

/* Steps */

.principle-modal__steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.principle-modal__step {
  display: flex;
  gap: 13px;
  align-items: flex-start;
}

.principle-modal__step-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  font-weight: 300;
  opacity: 0.55;
  line-height: 1;
  flex-shrink: 0;
  width: 17px;
  text-align: center;
}

.principle-modal__step-text {
  font-size: 12.5px;
  font-weight: 300;
  line-height: 1.65;
  color: rgba(247,243,237,0.65);
  padding-top: 1px;
}

.principle-modal__step-text strong {
  font-weight: 500;
  color: rgba(247,243,237,0.88);
}

/* Mistakes */

.principle-modal__mistakes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.principle-modal__mistake-item {
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 10px 12px;
}

.principle-modal__mistake-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust-lt);
  opacity: 0.75;
  margin-bottom: 4px;
}

.principle-modal__mistake-text {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(247,243,237,0.62);
}

/* Reference list */

.principle-modal__ref-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.principle-modal__ref-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.principle-modal__ref-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  opacity: 0.4;
  flex-shrink: 0;
  margin-top: 5px;
}

.principle-modal__ref-name {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(247,243,237,0.82);
  width: 118px;
  flex-shrink: 0;
  line-height: 1.4;
}

.principle-modal__ref-use {
  font-size: 11.5px;
  font-weight: 300;
  color: rgba(247,243,237,0.5);
  line-height: 1.45;
  flex: 1;
}

/* Contrast block (Seasoning vs Flavoring) */

.principle-modal__contrast {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.principle-modal__contrast-side {
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 12px 11px;
}

.principle-modal__contrast-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.principle-modal__contrast-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  color: var(--cream);
  margin-bottom: 5px;
}

.principle-modal__contrast-text {
  font-size: 10.5px;
  font-weight: 300;
  line-height: 1.5;
  color: rgba(247,243,237,0.55);
  margin-bottom: 8px;
}

.principle-modal__contrast-examples {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.principle-modal__contrast-ex {
  font-size: 10px;
  font-weight: 400;
  color: rgba(247,243,237,0.4);
  padding-left: 7px;
  border-left: 1px solid rgba(255,255,255,0.12);
  line-height: 1.4;
}

/* Rule */

.principle-modal__rule {
  padding: 22px 22px;
  background: rgba(0,0,0,0.18);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.principle-modal__rule-text {
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(247,243,237,0.68);
  text-align: center;
}

.principle-modal__rule-attr {
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  text-align: center;
  margin-top: 10px;
}

/* Related */

.principle-modal__related {
  border-bottom: none;
}

.principle-modal__related-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.principle-related-tag {
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  color: var(--tan);
  background: rgba(196,168,130,0.09);
  border: 1px solid rgba(196,168,130,0.2);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.principle-related-tag:hover { background: rgba(196,168,130,0.16); }

/* ─── Library All View ──────────────────────────────────────── */

.lib-all-view {
  display: flex;
  flex-direction: column;
}

/* Four stat chips */

.lib-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px 16px 4px;
}

.lib-stat-chip {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 10px 13px;
}

.lib-stat-chip__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lib-stat-chip__label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.lib-stat-chip__count {
  font-size: 10px;
  font-weight: 500;
  color: var(--tan);
}

/* Count row */

.lib-all-count-row {
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.2);
  padding: 10px 16px 2px;
}

/* Alpha dividers */

.lib-alpha-divider {
  padding: 16px 0 6px;
  font-family: var(--font-display);
  font-size: 20px;
  font-style: italic;
  font-weight: 300;
  color: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.lib-alpha-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.07);
}

/* Alphabetical list container */

.lib-all-list {
  padding: 0 16px 20px;
}

/* Unified all-view cards */

.lib-all-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 7px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.lib-all-card:active { background: rgba(255,255,255,0.08); }

.lib-all-card__body {
  flex: 1;
  min-width: 0;
}

.lib-all-card__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-style: italic;
  font-weight: 400;
  color: rgba(247,243,237,0.9);
  line-height: 1.15;
}

.lib-all-card__sub {
  font-size: 10.5px;
  font-weight: 300;
  color: rgba(247,243,237,0.4);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-all-card__chevron {
  font-size: 17px;
  color: rgba(255,255,255,0.2);
  flex-shrink: 0;
  line-height: 1;
}

/* Type badges */

.lib-type-badge {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  flex-shrink: 0;
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-technique {
  color: rgba(200,135,74,0.9);
  background: rgba(139,69,19,0.12);
  border-color: rgba(139,69,19,0.22);
}

.badge-cut {
  color: rgba(140,170,125,0.9);
  background: rgba(100,140,90,0.1);
  border-color: rgba(100,140,90,0.22);
}

.badge-term {
  color: rgba(160,150,135,0.9);
  background: rgba(120,110,95,0.1);
  border-color: rgba(120,110,95,0.22);
}

.badge-principle {
  color: rgba(140,160,185,0.9);
  background: rgba(90,120,150,0.1);
  border-color: rgba(90,120,150,0.22);
}

/* ─── Desktop tweaks ───────────────────────────────────────── */

@media (min-width: 600px) {
  .messages {
    padding: 28px 24px 28px;
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
  }
  .input-bar__inner {
    padding: 0;
  }
  .home-headline {
    font-size: 40px;
  }
}
