/*
 * Voice Chef workspace v2
 * Recipe note and library views only. The document/body never scrolls; each
 * workspace owns the few scroll regions that need it.
 */

/* -------------------------------------------------------------------------- */
/* Shared workspace tokens and viewport guards                               */
/* -------------------------------------------------------------------------- */

body[data-view="recipe"],
body[data-view="library"] {
  --vc-bg: #f0f4f2;
  --vc-surface: #fefefe;
  --vc-surface-soft: #f6f8f6;
  --vc-ink: #0d0f0e;
  --vc-muted: #747a77;
  --vc-line: #e1e5e2;
  --vc-green: #2fa34a;
  --vc-green-dark: #188138;
  --vc-green-soft: #e7f3e9;
  --vc-black: #0b0d0c;
  --vc-radius-lg: 28px;
  --vc-radius-md: 22px;
  --vc-shadow: 0 14px 38px rgba(27, 60, 38, .09);
  --vc-shadow-soft: 0 8px 25px rgba(27, 60, 38, .075);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  color: var(--vc-ink);
  background: var(--vc-bg);
}

body[data-view="recipe"] .app-shell,
body[data-view="library"] .app-shell,
body[data-view="recipe"] .recipe-screen,
body[data-view="library"] .library-screen,
body[data-view="recipe"] .recipe-shell,
body[data-view="library"] .library-shell {
  width: 100%;
  max-width: none;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body[data-view="recipe"] button,
body[data-view="library"] button,
body[data-view="recipe"] input,
body[data-view="library"] input {
  font: inherit;
}

/* -------------------------------------------------------------------------- */
/* Shared desktop rail                                                        */
/* -------------------------------------------------------------------------- */

body[data-view="recipe"] .workspace-sidebar,
body[data-view="library"] .workspace-sidebar {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 34px 22px 28px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid #e6ebe7;
  background: rgba(255, 255, 255, .965);
  box-shadow: none;
}

body[data-view="recipe"] .workspace-brand,
body[data-view="library"] .workspace-brand {
  min-height: 42px;
  margin: 0 16px 30px;
  padding: 0;
  border: 0;
  color: #080a09;
  background: transparent;
  font-size: 31px;
  font-weight: 820;
  letter-spacing: -.045em;
  text-align: left;
}

body[data-view="recipe"] .workspace-sidebar .sidebar-new-dialogue,
body[data-view="library"] .workspace-sidebar .sidebar-new-dialogue {
  min-height: 60px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--vc-black);
  box-shadow: 0 11px 25px rgba(0, 0, 0, .13);
  font-size: 17px;
  font-weight: 720;
}

body[data-view="recipe"] .workspace-sidebar nav,
body[data-view="library"] .workspace-sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

body[data-view="recipe"] .workspace-sidebar nav button,
body[data-view="library"] .workspace-sidebar nav button {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 18px;
  border: 0;
  border-radius: 17px;
  color: #171a18;
  background: transparent;
  font-size: 16px;
  font-weight: 590;
  text-align: left;
}

body[data-view="recipe"] .workspace-sidebar nav button.active,
body[data-view="library"] .workspace-sidebar nav button.active {
  color: #111512;
  background: linear-gradient(90deg, #e7f1e8, #eff5f0);
}

body[data-view="recipe"] .workspace-sidebar nav button > span,
body[data-view="library"] .workspace-sidebar nav button > span {
  color: #171a18;
  font-size: 21px;
}

body[data-view="recipe"] .workspace-sidebar > p,
body[data-view="library"] .workspace-sidebar > p {
  margin: 28px 14px 9px;
  color: #909691;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .13em;
}

body[data-view="recipe"] .workspace-recent,
body[data-view="library"] .workspace-recent {
  min-height: 44px;
  padding: 0 14px;
  overflow: hidden;
  border: 0;
  border-radius: 13px;
  color: #373d39;
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view="recipe"] .workspace-recent-list {
  min-width: 0;
  display: grid;
  overflow: hidden;
}

body[data-view="recipe"] .workspace-recent-list > .workspace-recent {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

body[data-view="recipe"] .workspace-recent.active,
body[data-view="library"] .workspace-recent.active {
  color: var(--vc-green-dark);
  background: var(--vc-green-soft);
}

body[data-view="recipe"] .workspace-sidebar-footer,
body[data-view="library"] .workspace-sidebar-footer {
  display: grid;
  gap: 41px;
  margin: auto 0 37px;
}

body[data-view="recipe"] .workspace-sidebar-footer > button,
body[data-view="library"] .workspace-sidebar-footer > button {
  min-height: 48px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 0;
  color: #1c211e;
  background: transparent;
  font-size: 16px;
  text-align: left;
}

body[data-view="recipe"] .workspace-sidebar-footer > button > span:first-child,
body[data-view="library"] .workspace-sidebar-footer > button > span:first-child {
  font-size: 25px;
}

body[data-view="recipe"] .workspace-sidebar-footer .workspace-profile i,
body[data-view="library"] .workspace-sidebar-footer .workspace-profile i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef3f0;
  font-size: 17px;
  font-style: normal;
}

body[data-view="recipe"] .workspace-sidebar-footer .workspace-profile b,
body[data-view="library"] .workspace-sidebar-footer .workspace-profile b {
  color: #68706b;
  font-size: 27px;
  font-weight: 400;
}

/* -------------------------------------------------------------------------- */
/* Recipe note — 1536 × 1024 composition                                      */
/* -------------------------------------------------------------------------- */

body[data-view="recipe"] .recipe-shell {
  display: grid;
  grid-template-columns: var(--workspace-rail-width, 350px) minmax(0, 1fr);
}

body[data-view="recipe"] .recipe-workspace {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 98px minmax(0, 1fr) auto;
  padding: 0;
  overflow: hidden;
}

body[data-view="recipe"] .recipe-toolbar {
  position: relative;
  inset: auto;
  z-index: 4;
  min-width: 0;
  min-height: 98px;
  height: 98px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  margin: 0;
  padding: 0 39px 0 31px;
  border: 0;
  border-radius: 0;
  background: var(--vc-bg);
  box-shadow: 0 1px 0 rgba(27, 60, 38, .035);
}

body[data-view="recipe"] .recipe-back {
  width: max-content;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #252b27;
  background: transparent;
  font-size: 27px;
  font-weight: 440;
}

body[data-view="recipe"] .recipe-back > span {
  font-size: 17px;
}

body[data-view="recipe"] .recipe-toolbar-title {
  min-width: 0;
  display: block;
  color: #252b27;
  font-size: 17px;
  font-weight: 450;
}

body[data-view="recipe"] .recipe-note-label {
  font-size: 18px;
  font-weight: 450;
}

body[data-view="recipe"] .recipe-toolbar-title > :not(.recipe-note-label) {
  display: none;
}

body[data-view="recipe"] .recipe-toolbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

body[data-view="recipe"] .recipe-action-button,
body[data-view="recipe"] .recipe-return-dialogue,
body[data-view="recipe"] .recipe-more {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  color: #212622;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  font-weight: 570;
  text-decoration: none;
  white-space: nowrap;
}

body[data-view="recipe"] #recipe-favorite,
body[data-view="recipe"] #recipe-favorite.active,
body[data-view="recipe"] #recipe-favorite[aria-pressed="true"] {
  color: #183e22;
  background: #eaf2eb;
}

body[data-view="recipe"] #recipe-cooking {
  min-height: 44px;
  color: #fff;
  background: var(--vc-black);
}

body[data-view="recipe"] .recipe-return-dialogue {
  color: #25334d;
  padding-right: 0;
}

body[data-view="recipe"] .recipe-saved-status {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 17px;
  border-radius: 14px;
  color: #183e22;
  background: #eaf2eb;
  font-size: 15px;
  white-space: nowrap;
}

body[data-view="recipe"] .recipe-saved-status > i {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--vc-green);
  border-radius: 50%;
  color: var(--vc-green-dark);
  font-size: 12px;
  font-style: normal;
}

body[data-view="recipe"] .recipe-toolbar-overflow {
  position: relative;
}

body[data-view="recipe"] .recipe-toolbar-overflow > summary {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  list-style: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 23px;
}

body[data-view="recipe"] .recipe-toolbar-overflow > summary::-webkit-details-marker {
  display: none;
}

body[data-view="recipe"] .recipe-toolbar-overflow > div {
  position: absolute;
  z-index: 20;
  top: 48px;
  right: 0;
  min-width: 220px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--vc-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--vc-shadow);
}

body[data-view="recipe"] .recipe-more {
  width: 44px;
  padding: 0;
  font-size: 24px;
}

body[data-view="recipe"] .recipe-layout {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: block;
  margin: 0;
  overflow: hidden;
}

body[data-view="recipe"] .recipe-sidebar {
  display: none;
}

body[data-view="recipe"] #recipe-content {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 39px 30px 31px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding: 18px 0 42px;
  scrollbar-gutter: auto;
  scrollbar-width: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-view="recipe"] #recipe-content::-webkit-scrollbar {
  display: none;
}

body[data-view="recipe"] .recipe-hero {
  width: 100%;
  min-height: 292px;
  height: 292px;
  display: grid;
  grid-template-columns: 44% minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(27, 60, 38, .055);
  border-radius: 17px;
  background: var(--vc-surface);
  box-shadow: var(--vc-shadow-soft);
}

body[data-view="recipe"] .recipe-hero-image {
  width: 100%;
  height: 292px;
  min-height: 0;
  object-fit: cover;
  transform: none;
}

body[data-view="recipe"] .recipe-hero-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 34px;
  transform: translateY(5px);
}

body[data-view="recipe"] .recipe-hero-copy > .eyebrow {
  display: none;
}

body[data-view="recipe"] .recipe-hero-copy h1 {
  margin: 0;
  color: #080a09;
  font-size: clamp(39px, 3.3vw, 54px);
  font-weight: 790;
  line-height: 1.02;
  letter-spacing: -.045em;
}

body[data-view="recipe"] .recipe-hero-copy > p:not(.eyebrow),
body[data-view="recipe"] .recipe-hero-meta {
  margin: 18px 0 0;
  color: #70757c;
  font-size: 17px;
  line-height: 1.4;
}

body[data-view="recipe"] .recipe-hero-copy > p:not(.eyebrow) {
  display: none;
}

body[data-view="recipe"] .recipe-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

body[data-view="recipe"] .recipe-hero-meta span {
  padding: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  font-weight: 480;
}

body[data-view="recipe"] .recipe-hero-meta span:nth-child(3) {
  display: none;
}

body[data-view="recipe"] .recipe-hero-meta span + span::before {
  content: "·";
  margin-right: 5px;
}

body[data-view="recipe"] :is(.recipe-source, .recipe-source-line) {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
  color: #244b8e;
  font-size: 16px;
  text-decoration: none;
  border: 0;
  background: transparent;
}

body[data-view="recipe"] :is(.recipe-source, .recipe-source-line)::before {
  content: "▤";
  color: #244b8e;
  font-size: 20px;
}

body[data-view="recipe"] :is(.recipe-mobile-tabs, .recipe-mobile-segments) {
  display: none;
}

body[data-view="recipe"] .recipe-section-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 352px minmax(0, 1fr);
  grid-auto-flow: row;
  align-items: start;
  gap: 20px;
  height: auto;
  margin: 16px 0 0;
  padding: 0 0 10px;
}

body[data-view="recipe"] .recipe-section-card,
body[data-view="recipe"] .recipe-section-card:first-child:not(.ingredients-card) {
  min-width: 0;
  grid-column: auto;
  padding: 24px 28px;
  overflow: visible;
  border: 1px solid rgba(27, 60, 38, .055);
  border-radius: 17px;
  background: var(--vc-surface);
  box-shadow: var(--vc-shadow-soft);
}

body[data-view="recipe"] .recipe-section-grid > .recipe-section-card {
  height: auto;
}

body[data-view="recipe"] .recipe-section-card.recipe-section-ingredients {
  min-height: 432px;
  grid-column: 1;
  grid-row: 1;
}

body[data-view="recipe"] .recipe-section-card.recipe-steps-card,
body[data-view="recipe"] .recipe-section-card.steps-card,
body[data-view="recipe"] .recipe-section-card.recipe-section-steps {
  min-height: 432px;
  grid-column: 2;
  grid-row: 1;
}

body[data-view="recipe"] .recipe-section-grid:not(.has-steps) .recipe-section-ingredients,
body[data-view="recipe"] .recipe-section-grid:not(.has-ingredients) .recipe-section-steps,
body[data-view="recipe"] .recipe-section-grid > .recipe-section-card.recipe-section-overview,
body[data-view="recipe"] .recipe-section-grid > .recipe-section-card.recipe-section-tips,
body[data-view="recipe"] .recipe-section-grid > .recipe-section-card.recipe-section-supporting {
  min-height: 0;
  grid-column: 1 / -1;
  grid-row: auto;
}

body[data-view="recipe"] .recipe-section-figure {
  display: none;
}

body[data-view="recipe"] .recipe-section-card h2,
body[data-view="recipe"] .recipe-section-card h3 {
  margin: 0 0 12px;
  padding: 0;
  color: #080a09;
  font-size: 25px;
  font-weight: 760;
  line-height: 1.12;
  letter-spacing: -.025em;
}

body[data-view="recipe"] .recipe-section-steps h2,
body[data-view="recipe"] .recipe-section-steps h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 1.7vw, 28px);
  margin-bottom: 16px;
}

body[data-view="recipe"] .recipe-step-progress {
  min-width: 0;
  max-width: min(68%, 650px);
  flex: 1 1 520px;
  display: inline-flex;
  align-items: center;
  gap: clamp(5px, .55vw, 10px);
  margin-left: auto;
}

body[data-view="recipe"] .recipe-step-progress em {
  flex: 0 0 auto;
  margin-right: clamp(4px, .65vw, 10px);
  color: #6f7580;
  font-size: 15px;
  font-style: normal;
  font-weight: 450;
  white-space: nowrap;
}

body[data-view="recipe"] .recipe-step-progress i {
  width: auto;
  min-width: 8px;
  max-width: 42px;
  height: 5px;
  flex: 1 1 24px;
  border-radius: 99px;
  background: #d6d9d7;
}

body[data-view="recipe"] .recipe-step-progress i.active {
  background: #329a4b;
}

body[data-view="recipe"] .recipe-checklist {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

body[data-view="recipe"] .recipe-checklist li {
  margin: 0;
  border-bottom: 1px solid var(--vc-line);
}

body[data-view="recipe"] .recipe-checklist li:last-child {
  border-bottom: 0;
}

body[data-view="recipe"] .recipe-checklist label {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 23px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1.35;
}

body[data-view="recipe"] .recipe-checklist input {
  appearance: none;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  margin: 0;
  border: 2px solid #2d9c48;
  border-radius: 6px;
  background: #fff;
}

body[data-view="recipe"] .recipe-checklist input:checked {
  background: #2d9c48;
  box-shadow: inset 0 0 0 6px #fff;
}

body[data-view="recipe"] .recipe-step.has-checklist-control::before {
  display: none;
}

body[data-view="recipe"] .recipe-step.has-checklist-control .recipe-step-check-control {
  width: 52px;
  height: 52px;
  display: grid;
  grid-column: 1;
  place-items: center;
  cursor: pointer;
}

body[data-view="recipe"] .recipe-step.has-checklist-control .recipe-step-check-control input {
  appearance: none;
  width: 27px;
  height: 27px;
  margin: 0;
  border: 2px solid #2d9c48;
  border-radius: 6px;
  background: #fff;
}

body[data-view="recipe"] .recipe-step.has-checklist-control .recipe-step-check-control input:checked {
  background: #2d9c48;
  box-shadow: inset 0 0 0 6px #fff;
}

body[data-view="recipe"] .recipe-step.has-checklist-control .recipe-step-copy {
  grid-column: 2 / 4;
}

body[data-view="recipe"] :is(.recipe-steps, .steps-list),
body[data-view="recipe"] :is(.recipe-steps-card, .steps-card) :is(ol, ul) {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: vc-recipe-step;
}

body[data-view="recipe"] :is(.recipe-step, .recipe-steps > li, .steps-card ol > li) {
  min-height: 106px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding: 16px 18px;
  counter-increment: vc-recipe-step;
  border: 1px solid var(--vc-line);
  border-radius: 16px;
  color: #171a18;
  background: #fff;
}

body[data-view="recipe"] .recipe-step.current,
body[data-view="recipe"] .steps-card ol > li.current {
  grid-template-columns: 52px auto minmax(0, 1fr);
}

body[data-view="recipe"] :is(.recipe-step, .recipe-steps > li, .steps-card ol > li)::before {
  content: counter(vc-recipe-step);
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #151816;
  background: #f0f1f0;
  font-size: 22px;
  font-weight: 700;
}

body[data-view="recipe"] :is(.recipe-step, .recipe-steps > li, .steps-card ol > li)::after {
  content: none;
  display: none;
}

body[data-view="recipe"] .recipe-step.current .recipe-step-speak,
body[data-view="recipe"] .steps-card ol > li.current .recipe-step-speak,
body[data-view="recipe"] .recipe-step-speak.replay-playing {
  color: #208c3d;
  background-color: #dcefe1;
  background-image: url("/assets/icons/speaker.webp") !important;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 24px 24px;
  box-shadow:
    inset 0 0 0 1px rgba(32, 140, 61, .2),
    0 0 0 4px rgba(47, 163, 74, .08);
}

body[data-view="recipe"] :is(.recipe-step.current, .recipe-step.active, .recipe-steps > li.current, .steps-card ol > li.current) {
  border-color: #2e9c49;
  background: linear-gradient(90deg, #f5faf6, #eef7f0);
}

body[data-view="recipe"] :is(.recipe-step.current, .recipe-step.active, .recipe-steps > li.current, .steps-card ol > li.current)::before {
  color: #fff;
  background: linear-gradient(145deg, #61bb6d, #238f40);
}

body[data-view="recipe"] .recipe-step-copy,
body[data-view="recipe"] .recipe-step-content {
  min-width: 0;
  overflow-wrap: anywhere;
}

body[data-view="recipe"] :is(.recipe-step-copy, .recipe-step-content) strong {
  display: block;
  font-size: 20px;
  line-height: 1.25;
}

body[data-view="recipe"] :is(.recipe-step-copy, .recipe-step-content) small {
  display: block;
  margin-top: 8px;
  color: #737980;
  font-size: 16px;
  line-height: 1.35;
}

body[data-view="recipe"] :is(.recipe-step-play, .recipe-step-speak) {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #1b211d;
  cursor: pointer;
  background: #f2f3f2 url("/assets/icons/speaker.webp") center / 23px 23px no-repeat;
  grid-column: 4;
}

body[data-view="recipe"] :is(.recipe-step-play, .recipe-step-speak):focus-visible {
  outline: 3px solid rgba(46, 170, 74, .3);
  outline-offset: 2px;
}

body[data-view="recipe"] .recipe-step-speak.replay-loading {
  animation: vc-replay-pulse 900ms ease-in-out infinite alternate;
}

body[data-view="recipe"] .recipe-step-current-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-right: 12px;
  padding: 0 13px;
  border-radius: 8px;
  color: var(--vc-green-dark);
  background: #dfeee2;
  font-size: 12px;
  font-weight: 650;
}

body[data-view="recipe"] .recipe-step.current .recipe-step-current-label,
body[data-view="recipe"] .steps-card ol > li.current .recipe-step-current-label {
  grid-column: 2;
  margin-right: 0;
}

body[data-view="recipe"] :is(.recipe-step, .steps-card li)[role="button"] {
  cursor: pointer;
}

body[data-view="recipe"] :is(.recipe-step, .steps-card li)[role="button"]:focus-visible {
  outline: 3px solid rgba(46,170,74,.28);
  outline-offset: 2px;
}

body[data-view="recipe"] .recipe-step.current .recipe-step-copy,
body[data-view="recipe"] .steps-card ol > li.current .recipe-step-copy {
  grid-column: 3;
}

body[data-view="recipe"] .recipe-bottom-voice {
  position: relative;
  min-width: 0;
  min-height: 122px;
  height: 122px;
  display: grid;
  grid-template-columns:
    66px
    minmax(0, 1fr)
    minmax(200px, 288px)
    minmax(230px, 300px);
  align-items: center;
  gap: 20px;
  margin: 16px 39px 38px 31px;
  padding: 12px 18px;
  border: 0;
  border-radius: 18px;
  background: var(--vc-surface);
  box-shadow: var(--vc-shadow-soft);
}

body[data-view="recipe"] .recipe-bottom-voice::before {
  content: "";
  position: absolute;
  inset: 17px;
  z-index: 0;
  border-radius: 15px;
  background: linear-gradient(90deg, #e6f1e8, #f2f7f3);
}

body[data-view="recipe"] .recipe-bottom-voice > * {
  position: relative;
  z-index: 1;
}

body[data-view="recipe"] .recipe-bottom-wave {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #62bd70, #278f42);
  box-shadow: 0 0 0 1px #2fa44a;
  font-size: 10px;
  letter-spacing: 2px;
  transform: translateX(13px);
}

body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2) {
  min-width: 0;
  height: 66px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  transform: none;
}

body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2) small {
  display: none;
}

body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2)::after {
  content: "▮▯▮▮▯▮▮▮▯▮▯▮▮▯▮▮▯▮";
  display: inline-block;
  min-width: 54px;
  flex: 1 1 205px;
  margin-left: clamp(18px, 3vw, 52px);
  overflow: hidden;
  color: #2e9e49;
  font-size: 11px;
  letter-spacing: 2px;
  transform: scaleY(1.5);
}

body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2) strong {
  font-size: 20px;
  font-weight: 590;
}

body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2) small {
  margin-top: 5px;
  color: var(--vc-green-dark);
  font-size: 11px;
}

body[data-view="recipe"] .recipe-bottom-voice .recipe-voice-button,
body[data-view="recipe"] :is(.recipe-question-action, .recipe-text-question) {
  min-height: 66px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 28px;
  border: 1px solid #dfe3e0;
  border-radius: 999px;
  color: #171a18;
  background: rgba(255, 255, 255, .92);
  font-size: 16px;
  font-weight: 580;
  white-space: nowrap;
}

body[data-view="recipe"] .recipe-bottom-voice .recipe-voice-button {
  min-width: clamp(230px, 17vw, 300px);
  border-color: var(--vc-black);
  color: #fff;
  background: var(--vc-black);
}

body[data-view="recipe"] :is(.recipe-question-action, .recipe-text-question) {
  min-width: clamp(200px, 16vw, 288px);
}

body[data-view="recipe"] .recipe-text-question {
  transform: translateX(-4px);
}

body[data-view="recipe"] .recipe-bottom-voice .recipe-voice-button {
  transform: translateX(-10px);
}

body[data-view="recipe"] .recipe-voice-status {
  position: absolute;
  right: 40px;
  bottom: 8px;
  left: 31px;
  z-index: 8;
  margin: 0;
}

/* -------------------------------------------------------------------------- */
/* Library — shared                                                           */
/* -------------------------------------------------------------------------- */

body[data-view="library"] .library-shell {
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
}

body[data-view="library"] .library-workspace {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 628px minmax(0, 1fr);
  grid-template-rows: 104px 68px 82px minmax(0, 1fr);
  padding: 0;
  overflow: hidden;
}

body[data-view="library"] .library-toolbar {
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  height: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 38px;
  padding: 24px 0 7px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-view="library"] .library-toolbar .recipe-back {
  display: none;
}

body[data-view="library"] .library-toolbar .eyebrow,
body[data-view="library"] .library-toolbar small {
  display: none;
}

body[data-view="library"] .library-toolbar h1 {
  margin: 0;
  color: #080a09;
  font-size: 36px;
  font-weight: 790;
  line-height: 1.05;
  letter-spacing: -.035em;
}

body[data-view="library"] .library-sort {
  margin-left: auto;
}

body[data-view="library"] .library-search {
  grid-column: 1;
  grid-row: 2;
  width: auto;
  min-width: 0;
  min-height: 60px;
  height: 60px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  margin: 0 45px 0 39px;
  padding: 0 14px;
  border: 1px solid #dadddb;
  border-radius: 20px;
  background: rgba(255, 255, 255, .94);
  box-shadow: none;
}

body[data-view="library"] .library-search > span {
  color: #72787f;
  font-size: 26px;
  text-align: center;
}

body[data-view="library"] .library-search input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 6px;
  border: 0;
  outline: 0;
  color: #1c201d;
  background: transparent;
  font-size: 16px;
}

body[data-view="library"] :is(.library-filters, .library-tabs) {
  grid-column: 1;
  grid-row: 3;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 45px 0 39px;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-view="library"] :is(.library-filters, .library-tabs)::-webkit-scrollbar {
  display: none;
}

body[data-view="library"] :is(.library-filters, .library-tabs) button {
  min-height: 52px;
  flex: 0 0 auto;
  padding: 0 24px;
  border: 1px solid #dfe3e0;
  border-radius: 16px;
  color: #252a27;
  background: rgba(255, 255, 255, .92);
  font-size: 16px;
  font-weight: 510;
}

body[data-view="library"] :is(.library-filters, .library-tabs) button.active,
body[data-view="library"] :is(.library-filters, .library-tabs) button[aria-pressed="true"] {
  border-color: var(--vc-green);
  color: #fff;
  background: linear-gradient(145deg, #5abb67, #269342);
}

body[data-view="library"] .library-workspace:has(.library-filters) > .library-tabs {
  display: none;
}

body[data-view="library"] .library-status {
  position: absolute;
  z-index: 5;
  top: 244px;
  left: 39px;
  margin: 0;
}

body[data-view="library"] .library-content {
  display: contents;
}

body[data-view="library"] #library-list {
  grid-column: 1;
  grid-row: 4;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 14px;
  margin: 0;
  padding: 24px 35px 30px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

body[data-view="library"] :is(.library-group-heading, .library-date-heading, .history-group-heading) {
  grid-column: 1 / -1;
  margin: 4px 6px 0;
  color: #6f7571;
  font-size: 18px;
  font-weight: 570;
}

body[data-view="library"] :is(.dialogue-history-card, .history-card) {
  position: relative;
  min-width: 0;
  min-height: 128px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 19px;
  color: #171a18;
  background: rgba(255, 255, 255, .97);
  box-shadow: var(--vc-shadow-soft);
  text-align: left;
}

body[data-view="library"] :is(.dialogue-history-card, .history-card).active {
  border-color: #2ca147;
}

body[data-view="library"] :is(.dialogue-history-card, .history-card) img,
body[data-view="library"] .history-card-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
  color: var(--vc-green-dark);
  background: var(--vc-green-soft);
}

body[data-view="library"] :is(.dialogue-history-card, .history-card) > span strong {
  display: block;
  overflow: hidden;
  color: #111412;
  font-size: 18px;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view="library"] :is(.dialogue-history-card, .history-card) > span small {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  color: #747a77;
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view="library"] .dialogue-history-meta,
body[data-view="library"] .history-card-tag,
body[data-view="library"] .history-card-note-count {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 25px;
  margin-top: 9px;
  padding: 0 9px;
  border-radius: 8px;
  color: var(--vc-green-dark);
  background: var(--vc-green-soft);
  font-size: 11px;
}

body[data-view="library"] :is(.dialogue-history-card, .history-card) time {
  align-self: start;
  margin-top: 4px;
  color: #777d79;
  font-size: 13px;
}

body[data-view="library"] #library-preview {
  grid-column: 2;
  grid-row: 1 / -1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 32px 33px 30px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 31px 0 0 31px;
  background: rgba(255, 255, 255, .985);
  box-shadow: -12px 0 35px rgba(27, 60, 38, .055);
  scrollbar-width: thin;
}

body[data-view="library"] #library-preview > img {
  display: none;
}

body[data-view="library"] #library-preview > .eyebrow {
  display: none;
}

body[data-view="library"] #library-preview h2 {
  margin: 0;
  color: #090b0a;
  font-size: 35px;
  font-weight: 780;
  line-height: 1.08;
  letter-spacing: -.035em;
}

body[data-view="library"] #library-preview > p:not(.eyebrow) {
  margin: 8px 0 0;
  color: #717773;
  font-size: 15px;
  line-height: 1.45;
}

body[data-view="library"] .library-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

body[data-view="library"] .library-preview-thread,
body[data-view="library"] .history-preview-thread {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 34px;
  margin-top: 24px;
  padding: 8px 6px 16px;
  overflow: visible;
}

body[data-view="library"] :is(.library-preview-message, .history-preview-message) {
  width: fit-content;
  max-width: 78%;
  padding: 17px 21px;
  border: 1px solid #e4e7e5;
  border-radius: 21px;
  color: #171a18;
  background: #fff;
  font-size: 16px;
  line-height: 1.4;
}

body[data-view="library"] :is(.library-preview-message, .history-preview-message).user {
  align-self: flex-end;
  color: #fff;
  border-color: #151816;
  border-bottom-right-radius: 6px;
  background: #151816;
}

body[data-view="library"] :is(.library-preview-message, .history-preview-message).assistant {
  border-bottom-left-radius: 6px;
}

body[data-view="library"] :is(.library-preview-recipe, .history-preview-recipe) {
  min-height: 184px;
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  margin-top: 4px;
  padding: 20px;
  border: 1px solid #e1e5e2;
  border-radius: 22px;
  background: #fff;
}

body[data-view="library"] :is(.library-preview-recipe, .history-preview-recipe) img {
  width: 188px;
  height: 140px;
  border-radius: 15px;
  object-fit: cover;
}

body[data-view="library"] .library-preview-actions {
  display: grid;
  gap: 9px;
  margin-top: auto;
  padding-top: 28px;
}

body[data-view="library"] .library-preview-actions button {
  min-height: 74px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--vc-black);
  font-size: 17px;
  font-weight: 650;
}

body[data-view="library"] .library-preview-actions button + button {
  display: none;
}

body[data-view="library"] .library-mobile-new {
  display: none;
}

/* Notes/favorites and cookings share the card-library workspace. */
:is(
  body[data-view="library"][data-library-view="notes"],
  body[data-view="library"][data-library-view="favorites"],
  body[data-view="library"].library-view-notes,
  body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
  body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
) .library-shell {
  grid-template-columns: 288px minmax(0, 1fr);
}

:is(
  body[data-view="library"][data-library-view="notes"],
  body[data-view="library"][data-library-view="favorites"],
  body[data-view="library"].library-view-notes,
  body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
  body[data-view="library"]:has(#library-screen[data-library-view="favorites"]),
  body[data-view="library"][data-library-view="cookings"],
  body[data-view="library"].library-view-cookings,
  body[data-view="library"]:has(#library-screen[data-library-view="cookings"])
) .library-workspace {
  display: flex;
  flex-direction: column;
  padding: 0 38px 30px;
}

:is(
  body[data-view="library"][data-library-view="notes"],
  body[data-view="library"][data-library-view="favorites"],
  body[data-view="library"].library-view-notes,
  body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
  body[data-view="library"]:has(#library-screen[data-library-view="favorites"]),
  body[data-view="library"][data-library-view="cookings"],
  body[data-view="library"].library-view-cookings,
  body[data-view="library"]:has(#library-screen[data-library-view="cookings"])
) .library-toolbar {
  width: 100%;
  min-height: 120px;
  flex: 0 0 120px;
  margin: 0;
  padding: 30px 6px 8px;
}

:is(
  body[data-view="library"][data-library-view="notes"],
  body[data-view="library"][data-library-view="favorites"],
  body[data-view="library"].library-view-notes,
  body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
  body[data-view="library"]:has(#library-screen[data-library-view="favorites"]),
  body[data-view="library"][data-library-view="cookings"],
  body[data-view="library"].library-view-cookings,
  body[data-view="library"]:has(#library-screen[data-library-view="cookings"])
) .library-toolbar small {
  display: block;
  margin-top: 8px;
  color: #6f757c;
  font-size: 17px;
}

:is(
  body[data-view="library"][data-library-view="notes"],
  body[data-view="library"][data-library-view="favorites"],
  body[data-view="library"].library-view-notes,
  body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
  body[data-view="library"]:has(#library-screen[data-library-view="favorites"]),
  body[data-view="library"][data-library-view="cookings"],
  body[data-view="library"].library-view-cookings,
  body[data-view="library"]:has(#library-screen[data-library-view="cookings"])
) .library-search {
  width: min(708px, 100%);
  min-height: 60px;
  height: 60px;
  flex: 0 0 60px;
  margin: 14px 6px 0;
}

:is(
  body[data-view="library"][data-library-view="notes"],
  body[data-view="library"][data-library-view="favorites"],
  body[data-view="library"].library-view-notes,
  body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
  body[data-view="library"]:has(#library-screen[data-library-view="favorites"]),
  body[data-view="library"][data-library-view="cookings"],
  body[data-view="library"].library-view-cookings,
  body[data-view="library"]:has(#library-screen[data-library-view="cookings"])
) :is(.library-filters, .library-tabs) {
  width: 100%;
  min-height: 88px;
  flex: 0 0 88px;
  margin: 0 6px;
  padding-right: 250px;
}

:is(
  body[data-view="library"][data-library-view="notes"],
  body[data-view="library"][data-library-view="favorites"],
  body[data-view="library"].library-view-notes,
  body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
  body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
) .library-sort {
  position: absolute;
  z-index: 6;
  top: 211px;
  right: 38px;
  min-width: 236px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #d9ddda;
  border-radius: 13px;
  color: #222622;
  background: rgba(255, 255, 255, .94);
  font-size: 14px;
}

:is(
  body[data-view="library"][data-library-view="notes"],
  body[data-view="library"][data-library-view="favorites"],
  body[data-view="library"].library-view-notes,
  body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
  body[data-view="library"]:has(#library-screen[data-library-view="favorites"]),
  body[data-view="library"][data-library-view="cookings"],
  body[data-view="library"].library-view-cookings,
  body[data-view="library"]:has(#library-screen[data-library-view="cookings"])
) .library-content {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: block;
  overflow: hidden;
}

:is(
  body[data-view="library"][data-library-view="notes"],
  body[data-view="library"][data-library-view="favorites"],
  body[data-view="library"].library-view-notes,
  body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
  body[data-view="library"]:has(#library-screen[data-library-view="favorites"]),
  body[data-view="library"][data-library-view="cookings"],
  body[data-view="library"].library-view-cookings,
  body[data-view="library"]:has(#library-screen[data-library-view="cookings"])
) #library-list {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  gap: 24px;
  padding: 0 0 10px;
  overflow-y: auto;
}

:is(
  body[data-view="library"][data-library-view="notes"],
  body[data-view="library"][data-library-view="favorites"],
  body[data-view="library"].library-view-notes,
  body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
  body[data-view="library"]:has(#library-screen[data-library-view="favorites"]),
  body[data-view="library"][data-library-view="cookings"],
  body[data-view="library"].library-view-cookings,
  body[data-view="library"]:has(#library-screen[data-library-view="cookings"])
) #library-preview {
  display: none;
}

body[data-view="library"] .library-card {
  position: relative;
  min-width: 0;
  min-height: 350px;
  height: 350px;
  display: grid;
  grid-template-rows: 220px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(28, 68, 40, .06);
  border-radius: 18px;
  background: rgba(255, 255, 255, .98);
  box-shadow: var(--vc-shadow-soft);
}

body[data-view="library"] .library-card.featured,
body[data-view="library"] .library-card.is-latest,
body[data-view="library"] .library-list.notes-mode .library-card:first-of-type {
  border-color: #2fa34a;
}

body[data-view="library"] .library-card-photo {
  width: 100%;
  height: 220px;
  min-height: 0;
  object-fit: cover;
}

body[data-view="library"] .library-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 18px 17px;
}

body[data-view="library"] .library-card-body h2 {
  margin: 0;
  overflow: hidden;
  color: #111412;
  font-size: 18px;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-view="library"] .library-card-meta {
  margin: 7px 0 0;
  color: #72787f;
  font-size: 14px;
  line-height: 1.3;
}

body[data-view="library"] :is(.library-card-tag, .recipe-card-tag) {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 28px;
  margin-top: auto;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--vc-green-dark);
  background: var(--vc-green-soft);
  font-size: 11px;
}

body[data-view="library"] :is(.library-card-latest, .recipe-card-latest) {
  position: absolute;
  z-index: 3;
  top: 20px;
  left: 20px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-radius: 12px;
  color: var(--vc-green-dark);
  background: rgba(244, 250, 245, .96);
  box-shadow: 0 5px 14px rgba(29, 89, 44, .09);
  font-size: 12px;
}

body[data-view="library"] .library-card-actions {
  display: contents;
}

body[data-view="library"] .library-card-open {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 0;
  opacity: 0;
}

body[data-view="library"] .library-card-favorite,
body[data-view="library"] :is(.library-card-bookmark, .recipe-card-bookmark) {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 17px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 10px;
  color: var(--vc-green-dark);
  background: #edf5ee;
  font-size: 0;
}

body[data-view="library"] .library-card-favorite::before,
body[data-view="library"] :is(.library-card-bookmark, .recipe-card-bookmark)::before {
  content: "♡";
  font-size: 25px;
  line-height: 1;
}

/* One document scroller: recipe cards expand with their content on desktop. */
@media (min-width: 701px) {
  body[data-view="recipe"] .recipe-section-grid:has(> .recipe-section-overview) > .recipe-section-overview {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  body[data-view="recipe"] .recipe-section-grid:has(> .recipe-section-overview) > .recipe-section-ingredients,
  body[data-view="recipe"] .recipe-section-grid:has(> .recipe-section-overview) > .recipe-section-steps {
    grid-row: 2;
  }

  body[data-view="recipe"] :is(.recipe-section-overview, .recipe-section-tips) > :is(p, ul, ol) {
    max-width: 82ch;
    line-height: 1.52;
  }

  body[data-view="recipe"] .recipe-section-grid > .recipe-section-card {
    scroll-margin-top: 18px;
  }

  html body[data-view="recipe"] #recipe-content .recipe-section-grid > .recipe-section-card {
    height: auto;
    overflow: visible;
  }

  html body[data-view="recipe"] #recipe-content .recipe-section-grid > .recipe-section-ingredients,
  html body[data-view="recipe"] #recipe-content .recipe-section-grid > .recipe-section-steps {
    min-height: 432px;
  }
}

/* The recipe and conversation use one desktop navigation shell. */
@media (min-width: 1200px) {
  body[data-view="recipe"] .recipe-workspace-sidebar {
    padding: 34px 28px 24px;
  }

  body[data-view="recipe"] .recipe-workspace-sidebar .workspace-brand {
    min-height: 52px;
    display: flex;
    align-items: flex-start;
    margin: 0 12px 29px;
    font-size: 40px;
    font-weight: 780;
    line-height: 1;
  }

  body[data-view="recipe"] .recipe-workspace-sidebar .sidebar-new-dialogue {
    width: 100%;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    padding: 0 31px;
    font-size: 17px;
    font-weight: 680;
  }

  body[data-view="recipe"] .recipe-workspace-sidebar nav {
    gap: 8px;
    margin-top: 23px;
  }

  body[data-view="recipe"] .recipe-workspace-sidebar nav button {
    width: 100%;
    min-height: 60px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 17px;
    font-size: 19px;
    font-weight: 520;
  }

  body[data-view="recipe"] .recipe-workspace-sidebar nav button > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    font-size: 25px;
  }

  body[data-view="recipe"] .recipe-workspace-sidebar > p {
    margin: 24px 11px 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
  }

  body[data-view="recipe"] .recipe-workspace-sidebar .workspace-recent {
    min-height: 52px;
    padding: 9px 12px;
    border-radius: 17px;
    font-size: 14px;
  }
}

/* A 1920×1080 browser exposes roughly 944px of CSS height. Compress the
 * 1024px reference composition without changing its wide-screen geometry. */
@media (min-width: 1200px) and (max-height: 980px) {
  body[data-view="recipe"] .recipe-workspace {
    grid-template-rows: 86px minmax(0, 1fr) auto;
  }

  body[data-view="recipe"] .recipe-toolbar {
    min-height: 86px;
    height: 86px;
  }

  body[data-view="recipe"] .recipe-hero,
  body[data-view="recipe"] .recipe-hero-image {
    min-height: 252px;
    height: 252px;
  }

  body[data-view="recipe"] .recipe-hero-copy {
    padding: 25px 34px;
    transform: none;
  }

  body[data-view="recipe"] .recipe-hero-copy h1 {
    font-size: clamp(38px, 2.9vw, 47px);
  }

  body[data-view="recipe"] .recipe-hero-meta {
    margin-top: 12px;
  }

  body[data-view="recipe"] :is(.recipe-source, .recipe-source-line) {
    margin-top: 18px;
  }

  body[data-view="recipe"] .recipe-section-grid {
    gap: 16px 20px;
    margin-top: 14px;
  }

  body[data-view="recipe"] .recipe-section-grid > :is(
    .recipe-section-tips,
    .recipe-section-supporting
  ) {
    margin-top: 16px;
  }

  html body[data-view="recipe"] #recipe-content .recipe-section-grid > .recipe-section-ingredients,
  html body[data-view="recipe"] #recipe-content .recipe-section-grid > .recipe-section-steps {
    min-height: 392px;
  }

  body[data-view="recipe"] .recipe-section-card,
  body[data-view="recipe"] .recipe-section-card:first-child:not(.ingredients-card) {
    padding-top: 21px;
    padding-bottom: 21px;
  }

  body[data-view="recipe"] .recipe-checklist label {
    min-height: 62px;
  }

  body[data-view="recipe"] :is(.recipe-step, .recipe-steps > li, .steps-card li) {
    min-height: 92px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  body[data-view="recipe"] .recipe-bottom-voice {
    min-height: 104px;
    height: 104px;
    margin-top: 12px;
    margin-bottom: 18px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  body[data-view="recipe"] .recipe-bottom-voice::before {
    inset: 12px 17px;
  }
}

/* -------------------------------------------------------------------------- */
/* Compact tablet / small desktop                                             */
/* -------------------------------------------------------------------------- */

@media (min-width: 701px) and (max-width: 1199px) {
  body[data-view="recipe"] .recipe-shell {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  body[data-view="recipe"] .workspace-sidebar,
  body[data-view="library"] .workspace-sidebar {
    padding-inline: 17px;
  }

  body[data-view="recipe"] .workspace-brand,
  body[data-view="library"] .workspace-brand {
    margin-inline: 10px;
    font-size: 27px;
  }

  body[data-view="recipe"] .recipe-toolbar {
    padding-inline: 24px;
  }

  body[data-view="recipe"] #recipe-content {
    padding-inline: 24px;
  }

  body[data-view="recipe"] .recipe-hero {
    grid-template-columns: 46% minmax(0, 1fr);
  }

  body[data-view="recipe"] .recipe-hero-copy {
    padding: 27px;
  }

  body[data-view="recipe"] .recipe-section-grid {
    grid-template-columns: minmax(260px, .43fr) minmax(0, 1fr);
  }

  body[data-view="recipe"] .recipe-section-steps h2,
  body[data-view="recipe"] .recipe-section-steps h3 {
    flex-wrap: wrap;
    row-gap: 9px;
  }

  body[data-view="recipe"] .recipe-step-progress {
    width: 100%;
    max-width: 100%;
    flex-basis: 100%;
    gap: 4px;
    margin-left: 0;
  }

  body[data-view="recipe"] .recipe-step-progress em {
    margin-right: 4px;
    font-size: 13px;
  }

  body[data-view="recipe"] .recipe-step-progress i {
    min-width: 4px;
  }

  body[data-view="recipe"] .recipe-bottom-voice {
    grid-template-columns: 68px minmax(140px, 1fr) auto;
    margin-right: 24px;
    margin-left: 24px;
  }

  body[data-view="recipe"] :is(.recipe-question-action, .recipe-text-question) {
    display: none;
  }

  body[data-view="recipe"] .recipe-bottom-voice .recipe-voice-button {
    min-width: 230px;
  }

  body[data-view="library"] .library-shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  body[data-view="library"] .library-workspace {
    grid-template-columns: minmax(420px, 54%) minmax(0, 1fr);
  }

  body[data-view="library"] .library-toolbar,
  body[data-view="library"] .library-search,
  body[data-view="library"] :is(.library-filters, .library-tabs) {
    margin-right: 24px;
    margin-left: 24px;
  }

  body[data-view="library"] #library-list {
    padding-right: 20px;
    padding-left: 20px;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"]),
    body[data-view="library"][data-library-view="cookings"],
    body[data-view="library"].library-view-cookings,
    body[data-view="library"]:has(#library-screen[data-library-view="cookings"])
  ) .library-workspace {
    padding-right: 26px;
    padding-left: 26px;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"]),
    body[data-view="library"][data-library-view="cookings"],
    body[data-view="library"].library-view-cookings,
    body[data-view="library"]:has(#library-screen[data-library-view="cookings"])
  ) #library-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

/* -------------------------------------------------------------------------- */
/* Phone — approximately 430 × 900                                            */
/* -------------------------------------------------------------------------- */

@media (max-width: 700px) {
  body[data-view="recipe"],
  body[data-view="library"] {
    --vc-radius-lg: 22px;
    --vc-radius-md: 18px;
  }

  body[data-view="recipe"] {
    --vc-bg: #fff;
    background: #fff;
  }

  /* Recipe note: 61px toolbar, internally scrolling document, 84px voice UI. */
  body[data-view="recipe"] .recipe-shell {
    display: block;
  }

  body[data-view="recipe"] .recipe-workspace-sidebar {
    display: none;
  }

  body[data-view="recipe"] .recipe-workspace {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: 61px minmax(0, 1fr) 90px;
  }

  body[data-view="recipe"] .recipe-toolbar {
    width: 100%;
    min-height: 61px;
    height: 61px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: max(2px, env(safe-area-inset-top)) 18px 0;
    border-bottom: 1px solid #eeeeec;
    background: rgba(255, 255, 255, .97);
  }

  body[data-view="recipe"] .recipe-back {
    min-height: 52px;
    gap: 20px;
    font-size: 27px;
  }

  body[data-view="recipe"] .recipe-back > span {
    font-size: 20px;
    font-weight: 690;
  }

  body[data-view="recipe"] .recipe-toolbar-actions {
    gap: 7px;
  }

  body[data-view="recipe"] .recipe-note-label {
    font-size: 20px;
    font-weight: 720;
  }

  body[data-view="recipe"] .recipe-saved-status {
    min-height: 42px;
    gap: 7px;
    padding: 0;
    border-radius: 0;
    color: var(--vc-green-dark);
    background: transparent;
    font-size: 16px;
  }

  body[data-view="recipe"] .recipe-saved-status > i {
    width: 16px;
    height: 22px;
    border: 0;
    border-radius: 2px 2px 7px 7px;
    color: #fff;
    background: var(--vc-green);
    font-size: 13px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
  }

  body[data-view="recipe"] .recipe-toolbar-overflow > summary {
    width: 24px;
    height: 42px;
  }

  body[data-view="recipe"] .recipe-action-button,
  body[data-view="recipe"] .recipe-return-dialogue,
  body[data-view="recipe"] .recipe-more {
    min-height: 42px;
    padding: 0 8px;
    font-size: 14px;
  }

  body[data-view="recipe"] #recipe-favorite {
    color: var(--vc-green-dark);
    background: transparent;
  }

  body[data-view="recipe"] #recipe-favorite > span {
    display: inline;
  }

  body[data-view="recipe"] #recipe-cooking,
  body[data-view="recipe"] .recipe-return-dialogue {
    display: none;
  }

  body[data-view="recipe"] .recipe-more {
    display: grid;
    width: 34px;
  }

  body[data-view="recipe"] .recipe-layout,
  body[data-view="recipe"] #recipe-content {
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  body[data-view="recipe"] #recipe-content {
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  body[data-view="recipe"] #recipe-content::-webkit-scrollbar {
    display: none;
  }

  body[data-view="recipe"] .recipe-sidebar {
    display: none;
  }

  body[data-view="recipe"] .recipe-hero {
    min-height: 338px;
    height: 338px;
    display: block;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  body[data-view="recipe"] .recipe-hero-image {
    width: 100%;
    height: 224px;
    object-fit: cover;
    border-radius: 18px;
  }

  body[data-view="recipe"] .recipe-hero-copy {
    min-height: 114px;
    height: 114px;
    justify-content: flex-start;
    padding: 17px 20px 12px;
  }

  body[data-view="recipe"] .recipe-hero-copy h1 {
    overflow: hidden;
    font-size: 30px;
    line-height: 1.03;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-view="recipe"] .recipe-hero-copy > p:not(.eyebrow),
  body[data-view="recipe"] .recipe-hero-meta {
    margin-top: 8px;
    font-size: 15px;
  }

  body[data-view="recipe"] :is(.recipe-source, .recipe-source-line) {
    margin-top: 8px;
    color: #747984;
    font-size: 14px;
  }

  body[data-view="recipe"] :is(.recipe-mobile-tabs, .recipe-mobile-segments) {
    min-height: 46px;
    height: 46px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 20px 18px;
    padding: 4px;
    border: 1px solid #8b8d91;
    border-radius: 20px;
    background: #fff;
  }

  body[data-view="recipe"] :is(.recipe-mobile-tabs, .recipe-mobile-segments) button {
    min-width: 0;
    border: 0;
    border-radius: 17px;
    color: #151716;
    background: transparent;
    font-size: 16px;
    font-weight: 650;
  }

  body[data-view="recipe"] :is(.recipe-mobile-tabs, .recipe-mobile-segments) button.active,
  body[data-view="recipe"] :is(.recipe-mobile-tabs, .recipe-mobile-segments) button[aria-pressed="true"] {
    color: #fff;
    background: var(--vc-black);
  }

  body[data-view="recipe"] .recipe-section-grid {
    display: block;
    margin: 0;
    padding: 0 20px 22px;
  }

  body[data-view="recipe"] .recipe-section-card,
  body[data-view="recipe"] .recipe-section-card:first-child:not(.ingredients-card),
  body[data-view="recipe"] .recipe-section-card:not(.ingredients-card):first-child:last-child,
  body[data-view="recipe"] .recipe-section-card.recipe-steps-card,
  body[data-view="recipe"] .recipe-section-card.steps-card {
    min-height: 0;
    margin: 0 0 19px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-view="recipe"] .recipe-section-card.recipe-section-ingredients,
  body[data-view="recipe"] .recipe-section-card.recipe-section-steps {
    min-height: 0;
  }

  body[data-view="recipe"] .recipe-section-figure {
    display: block;
  }

  body[data-view="recipe"] .recipe-section-card h2,
  body[data-view="recipe"] .recipe-section-card h3 {
    margin: 0 0 13px;
    font-size: 21px;
  }

  body[data-view="recipe"] .recipe-checklist label {
    min-height: 32px;
    gap: 13px;
    font-size: 16px;
  }

  body[data-view="recipe"] .recipe-checklist li {
    min-height: 32px;
    border: 0;
  }

  body[data-view="recipe"] .recipe-checklist input {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    appearance: none;
    border: 2px solid var(--vc-green);
    border-radius: 6px;
    background: #fff;
  }

  body[data-view="recipe"] .recipe-checklist input:checked {
    background: var(--vc-green);
    box-shadow: inset 0 0 0 4px #fff;
  }

  body[data-view="recipe"] .recipe-step.has-checklist-control .recipe-step-check-control {
    width: 30px;
    height: 30px;
  }

  body[data-view="recipe"] .recipe-step.has-checklist-control .recipe-step-check-control input {
    width: 18px;
    height: 18px;
    border-radius: 6px;
  }

  body[data-view="recipe"] .recipe-step.has-checklist-control .recipe-step-check-control input:checked {
    background: var(--vc-green);
    box-shadow: inset 0 0 0 4px #fff;
  }

  body[data-view="recipe"] :is(.recipe-steps, .steps-list),
  body[data-view="recipe"] :is(.recipe-steps-card, .steps-card) :is(ol, ul) {
    gap: 0;
  }

  body[data-view="recipe"] :is(.recipe-step, .recipe-steps > li, .steps-card ol > li) {
    min-height: 48px;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 15.5px;
  }

  body[data-view="recipe"] :is(.recipe-step, .recipe-steps > li, .steps-card ol > li)::before {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 14px;
  }

  body[data-view="recipe"] :is(.recipe-step.current, .recipe-step.active, .recipe-steps > li.current, .steps-card ol > li.current) {
    margin: 0 -5px;
    padding-right: 5px;
    padding-left: 5px;
    border: 0;
    border-radius: 12px;
  }

  body[data-view="recipe"] :is(.recipe-step-play, .recipe-step-speak) {
    width: 32px;
    height: 32px;
    background-color: transparent;
  }

  body[data-view="recipe"] .recipe-step-current-label {
    min-height: 25px;
    margin-right: 6px;
    padding-inline: 8px;
    font-size: 11px;
  }

  body[data-view="recipe"] .recipe-bottom-voice {
    position: relative;
    min-width: 0;
    width: auto;
    min-height: 84px;
    height: 84px;
    grid-template-columns: clamp(110px, 28.5vw, 123px) clamp(174px, 42.4vw, 183px) minmax(70px, 1fr);
    gap: 10px;
    margin: 0 5px 6px;
    padding: 9px 10px;
    border: 1px solid #e5e8e5;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 -7px 22px rgba(25, 56, 35, .07);
  }

  body[data-view="recipe"] .recipe-bottom-voice::before {
    display: none;
  }

  body[data-view="recipe"] .recipe-bottom-wave {
    grid-column: 1;
    grid-row: 1;
    width: 105px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0;
    color: var(--vc-green);
    background: transparent;
    box-shadow: none;
    font-size: 9px;
    letter-spacing: 3px;
    justify-self: center;
  }

  body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2) {
    position: absolute;
    left: 24px;
    bottom: 8px;
    color: var(--vc-green-dark);
  }

  body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2) strong {
    display: block;
    font-size: 13px;
    font-weight: 520;
  }

  body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2) small {
    display: none;
  }

  body[data-view="recipe"] .recipe-bottom-voice .recipe-voice-button,
  body[data-view="recipe"] :is(.recipe-question-action, .recipe-text-question) {
    min-width: 0;
    min-height: 62px;
    height: 62px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 14px;
  }

  body[data-view="recipe"] .recipe-bottom-voice .recipe-voice-button {
    grid-column: 2;
    grid-row: 1;
  }

  body[data-view="recipe"] :is(.recipe-question-action, .recipe-text-question) {
    grid-column: 3;
    grid-row: 1;
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
    padding-inline: 7px;
    border: 0;
    border-radius: 18px;
    background: #f5f6f5;
    font-size: 11px;
    line-height: 1.05;
    white-space: normal;
  }

  body[data-view="recipe"] .recipe-voice-status {
    right: 8px;
    bottom: 94px;
    left: 8px;
  }

  /* Library phone shell. History is the safe default. */
  body[data-view="library"] .library-shell {
    display: block;
  }

  body[data-view="library"] .library-workspace-sidebar {
    display: none;
  }

  body[data-view="library"] .library-workspace {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: max(20px, env(safe-area-inset-top)) 16px max(8px, env(safe-area-inset-bottom));
    overflow: hidden;
  }

  body[data-view="library"] .library-toolbar {
    width: 100%;
    min-height: 66px;
    height: 66px;
    flex: 0 0 66px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-radius: 19px;
    background: rgba(255, 255, 255, .98);
    box-shadow: var(--vc-shadow-soft);
  }

  body[data-view="library"] .library-toolbar .recipe-back {
    width: 39px;
    min-height: 48px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 27px;
  }

  body[data-view="library"] .library-toolbar .recipe-back > span {
    display: none;
  }

  body[data-view="library"] .library-toolbar h1 {
    font-size: 27px;
    line-height: 1;
  }

  body[data-view="library"] .library-sort {
    min-width: 38px;
    min-height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
  }

  body[data-view="library"] .library-search {
    width: 100%;
    min-height: 60px;
    height: 60px;
    flex: 0 0 60px;
    margin: 18px 0 0;
    border-radius: 20px;
  }

  body[data-view="library"] :is(.library-filters, .library-tabs) {
    width: 100%;
    min-height: 57px;
    height: 57px;
    flex: 0 0 57px;
    gap: 10px;
    margin: 0;
  }

  body[data-view="library"] :is(.library-filters, .library-tabs) button {
    min-height: 37px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: 14px;
  }

  body[data-view="library"] .library-status {
    position: static;
    flex: 0 0 auto;
    margin: 0;
  }

  body[data-view="library"] .library-content,
  body[data-view="library"] .library-content.history-mode {
    min-height: 0;
    display: block;
    flex: 1 1 auto;
    overflow: hidden;
  }

  body[data-view="library"] #library-list,
  body[data-view="library"] #library-list.history-mode {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: max-content;
    align-content: start;
    gap: 10px;
    margin: 0;
    padding: 26px 0 64px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
  }

  body[data-view="library"] #library-list::-webkit-scrollbar {
    display: none;
  }

  body[data-view="library"] :is(.library-group-heading, .library-date-heading, .history-group-heading) {
    margin: 3px 3px 5px;
    color: #111412;
    font-size: 19px;
    font-weight: 720;
  }

  body[data-view="library"] :is(.dialogue-history-card, .history-card) {
    min-height: 124px;
    grid-template-columns: 85px minmax(0, 1fr) auto;
    gap: 14px;
    padding: 14px;
    border-radius: 20px;
  }

  body[data-view="library"] :is(.dialogue-history-card, .history-card) img,
  body[data-view="library"] .history-card-icon {
    width: 85px;
    height: 85px;
  }

  body[data-view="library"] :is(.dialogue-history-card, .history-card) > span strong {
    font-size: 17px;
  }

  body[data-view="library"] :is(.dialogue-history-card, .history-card) > span small {
    font-size: 14px;
  }

  body[data-view="library"] #library-preview {
    display: none;
  }

  body[data-view="library"] .library-mobile-new {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    min-width: 234px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 24px;
    transform: translateX(-50%);
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: var(--vc-black);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .14);
    font-size: 16px;
    font-weight: 680;
  }

  /* Notes/favorites phone: flat toolbar, 49px search, featured + 2 columns. */
  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) .library-workspace {
    padding: max(20px, env(safe-area-inset-top)) 16px max(8px, env(safe-area-inset-bottom));
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) .library-toolbar {
    min-height: 34px;
    height: 34px;
    flex: 0 0 34px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) .library-toolbar h1 {
    font-size: 23px;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) .library-toolbar small {
    display: none;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) .library-search {
    min-height: 49px;
    height: 49px;
    flex: 0 0 49px;
    margin-top: 17px;
    border-radius: 18px;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) :is(.library-filters, .library-tabs) {
    min-height: 57px;
    height: 57px;
    flex-basis: 57px;
    padding: 0;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) .library-sort {
    position: static;
    min-width: 38px;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) #library-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    padding: 9px 0 58px;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) .library-card {
    min-height: 192px;
    height: 192px;
    grid-template-rows: 112px minmax(0, 1fr);
    border-radius: 18px;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) .library-card-photo {
    height: 112px;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) :is(.library-card.featured, .library-card.is-latest, .library-list.notes-mode .library-card:first-of-type) {
    min-height: 258px;
    height: 258px;
    grid-column: 1 / -1;
    grid-template-rows: 168px 90px;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) :is(.library-card.featured, .library-card.is-latest, .library-list.notes-mode .library-card:first-of-type) .library-card-photo {
    height: 168px;
  }

  body[data-view="library"] .library-card-body {
    padding: 10px 13px 11px;
  }

  body[data-view="library"] .library-card-body h2 {
    font-size: 15px;
  }

  body[data-view="library"] .library-card-meta {
    margin-top: 5px;
    font-size: 12px;
  }

  body[data-view="library"] .library-card-favorite,
  body[data-view="library"] :is(.library-card-bookmark, .recipe-card-bookmark) {
    right: 11px;
    bottom: 10px;
    width: 33px;
    height: 33px;
  }

  body[data-view="library"] :is(.library-card-latest, .recipe-card-latest) {
    top: 10px;
    left: 10px;
    min-height: 31px;
    padding-inline: 10px;
    font-size: 11px;
  }

  :is(
    body[data-view="library"][data-library-view="notes"],
    body[data-view="library"][data-library-view="favorites"],
    body[data-view="library"].library-view-notes,
    body[data-view="library"]:has(#library-screen[data-library-view="notes"]),
    body[data-view="library"]:has(#library-screen[data-library-view="favorites"])
  ) .library-mobile-new {
    min-width: 278px;
    min-height: 44px;
  }

  /* Cookings use the same compact card grid but no featured spanning card. */
  :is(
    body[data-view="library"][data-library-view="cookings"],
    body[data-view="library"].library-view-cookings,
    body[data-view="library"]:has(#library-screen[data-library-view="cookings"])
  ) .library-workspace {
    padding: max(20px, env(safe-area-inset-top)) 16px max(8px, env(safe-area-inset-bottom));
  }

  :is(
    body[data-view="library"][data-library-view="cookings"],
    body[data-view="library"].library-view-cookings,
    body[data-view="library"]:has(#library-screen[data-library-view="cookings"])
  ) #library-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 0 58px;
  }
}

/* -------------------------------------------------------------------------- */
/* Runtime DOM compatibility (data-tab and the richer generated card markup)  */
/* -------------------------------------------------------------------------- */

body[data-view="library"] .library-workspace:has(.library-filter-controls) > .library-tabs {
  display: none;
}

body[data-view="library"] .library-filter-controls {
  min-width: 0;
  min-height: 0;
}

body[data-view="library"] .library-scenario-filters {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

body[data-view="library"] .library-scenario-filters::-webkit-scrollbar {
  display: none;
}

body[data-view="library"] .library-scenario-filters button {
  min-height: 52px;
  flex: 0 0 auto;
  padding: 0 24px;
  border: 1px solid #dfe3e0;
  border-radius: 16px;
  color: #252a27;
  background: rgba(255, 255, 255, .92);
  font-size: 16px;
  font-weight: 510;
}

body[data-view="library"] .library-scenario-filters button.active,
body[data-view="library"] .library-scenario-filters button[aria-pressed="true"] {
  border-color: var(--vc-green);
  color: #fff;
  background: linear-gradient(145deg, #5abb67, #269342);
}

body[data-view="library"] .library-sort {
  color: transparent;
  font-size: 0;
}

body[data-view="library"] .library-sort select {
  min-width: 220px;
  min-height: 44px;
  padding: 0 38px 0 15px;
  border: 1px solid #d9ddda;
  border-radius: 13px;
  outline: 0;
  color: #222622;
  background: rgba(255, 255, 255, .96);
  font-size: 14px;
}

body[data-view="library"] .library-history-group {
  min-width: 0;
  display: grid;
  gap: 12px;
}

body[data-view="library"] .library-history-group > h2 {
  margin: 4px 6px 0;
  color: #6f7571;
  font-size: 18px;
  font-weight: 570;
}

body[data-view="library"] .library-history-group-list {
  min-width: 0;
  display: grid;
  gap: 14px;
}

body[data-view="library"] .dialogue-history-meta {
  min-width: 0;
  width: 100%;
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
}

body[data-view="library"] :is(.dialogue-scenario-tag, .dialogue-note-count) {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
}

body[data-view="library"] .dialogue-scenario-tag {
  color: var(--vc-green-dark);
  background: var(--vc-green-soft);
}

body[data-view="library"] .dialogue-scenario-tag.tag-healthy {
  color: #6741a2;
  background: #eee6fa;
}

body[data-view="library"] .dialogue-scenario-tag.tag-unique {
  color: #8a6417;
  background: #fff0cc;
}

body[data-view="library"] .dialogue-scenario-tag.tag-dialogue {
  color: #246da7;
  background: #e4f1fb;
}

body[data-view="library"] .dialogue-note-count {
  color: var(--vc-green-dark);
  background: transparent;
}

body[data-view="library"] .dialogue-history-trailing {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  padding: 4px 0;
}

body[data-view="library"] .dialogue-history-arrow {
  color: #161a17;
  font-size: 29px;
  line-height: 1;
}

body[data-view="library"] .library-card-footer {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

body[data-view="library"] .library-card-footer .library-card-tag {
  margin-top: 0;
}

body[data-view="library"] .library-card-footer .library-card-actions {
  display: block;
}

body[data-view="library"] .library-card-footer .library-card-favorite {
  position: static;
}

body[data-view="library"] .library-card-tag.tag-healthy {
  color: #3a7a45;
  background: #e9f2ea;
}

body[data-view="library"] .library-card-tag.tag-unique {
  color: #69429b;
  background: #eee7f8;
}

body[data-view="library"] .library-card-tag.tag-quick {
  color: #236ba4;
  background: #e8f2fc;
}

@media (min-width: 701px) {
  body[data-view="recipe"] .recipe-bottom-wave {
    font-size: 0;
  }

  body[data-view="recipe"] .recipe-bottom-wave::after {
    content: "";
    width: 28px;
    height: 34px;
    display: block;
    background: url("/assets/icons/voice-wave.webp") center / contain no-repeat;
    filter: brightness(0) invert(1);
  }

  body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2)::after {
    content: "";
    width: auto;
    min-width: 54px;
    max-width: 205px;
    height: 36px;
    flex: 1 1 205px;
    margin-left: clamp(18px, 3vw, 52px);
    background: url("/assets/icons/voice-waveform.webp") center / auto 36px repeat-x;
    font-size: 0;
    transform: none;
  }

  body[data-view="library"] .library-filter-controls {
    grid-column: 1;
    grid-row: 3;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0 45px 0 39px;
  }

  body[data-view="library"] .library-filter-controls .library-scenario-filters {
    flex: 1 1 auto;
  }

  body[data-view="library"] .library-filter-controls .library-sort {
    display: none;
  }

  body[data-view="library"] .dialogue-history-card.active {
    min-height: 152px;
  }

  body[data-view="library"] .library-preview-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
  }

  body[data-view="library"] .library-preview-heading > span {
    min-width: 0;
  }

  body[data-view="library"] .library-preview-heading h2 {
    margin: 0;
    font-size: 35px;
  }

  body[data-view="library"] .library-preview-heading time {
    display: block;
    margin-top: 8px;
    color: #72787f;
    font-size: 15px;
  }

  body[data-view="library"] .library-preview-overflow {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    font-size: 25px;
  }

  body[data-view="library"] .library-preview-transcript {
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 32px;
    margin-top: 28px;
    padding: 0 4px 18px;
    overflow: visible;
  }

  body[data-view="library"] .library-preview-message {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  body[data-view="library"] .library-preview-message.user {
    justify-content: flex-end;
    color: inherit;
    border: 0;
    background: transparent;
  }

  body[data-view="library"] .library-preview-avatar {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    display: grid;
    place-items: center;
    border: 1px solid #dce9df;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, #62bd70, #278f42);
    box-shadow: 0 0 0 10px #f5faf6;
    font-size: 9px;
    letter-spacing: 2px;
  }

  body[data-view="library"] .library-preview-bubble {
    width: fit-content;
    max-width: 78%;
    display: block;
    padding: 17px 21px;
    border: 1px solid #e1e5e2;
    border-radius: 21px;
    color: #171a18;
    background: #fff;
    font-size: 16px;
    line-height: 1.4;
  }

  body[data-view="library"] .library-preview-message.user .library-preview-bubble {
    color: #fff;
    border-color: #151816;
    border-bottom-right-radius: 6px;
    background: #151816;
  }

  body[data-view="library"] .library-preview-message.assistant .library-preview-bubble {
    border-bottom-left-radius: 6px;
  }

  body[data-view="library"] .library-preview-recipe-card {
    min-height: 184px;
    display: grid;
    grid-template-columns: 188px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 28px;
    padding: 20px;
    border: 1px solid #e1e5e2;
    border-radius: 22px;
    color: #171a18;
    background: #fff;
    text-align: left;
  }

  body[data-view="library"] .library-preview-recipe-card img {
    width: 188px;
    height: 140px;
    border-radius: 15px;
    object-fit: cover;
  }

  body[data-view="library"] .library-preview-recipe-card strong,
  body[data-view="library"] .library-preview-recipe-card small {
    display: block;
  }

  body[data-view="library"] .library-preview-recipe-card strong {
    font-size: 18px;
  }

  body[data-view="library"] .library-preview-recipe-card small {
    margin-top: 12px;
    color: #737980;
    font-size: 14px;
  }

  body[data-view="library"] .library-preview-recipe-card > b {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    color: #fff;
    background: var(--vc-green);
  }

  /* Actual runtime notes state. */
  body[data-view="library"] #library-screen[data-tab="favorites"] .library-shell {
    grid-template-columns: 288px minmax(0, 1fr);
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-workspace,
  body[data-view="library"] #library-screen[data-tab="cookings"] .library-workspace {
    display: flex;
    flex-direction: column;
    padding: 0 38px 30px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-toolbar,
  body[data-view="library"] #library-screen[data-tab="cookings"] .library-toolbar {
    width: 100%;
    min-height: 120px;
    flex: 0 0 120px;
    margin: 0;
    padding: 30px 6px 8px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-toolbar small,
  body[data-view="library"] #library-screen[data-tab="cookings"] .library-toolbar small {
    display: block;
    margin-top: 8px;
    color: #6f757c;
    font-size: 17px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-search,
  body[data-view="library"] #library-screen[data-tab="cookings"] .library-search {
    width: min(708px, 100%);
    min-height: 60px;
    height: 60px;
    flex: 0 0 60px;
    margin: 14px 6px 0;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-filter-controls,
  body[data-view="library"] #library-screen[data-tab="cookings"] .library-filter-controls {
    position: relative;
    width: 100%;
    min-height: 88px;
    flex: 0 0 88px;
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 6px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-filter-controls .library-scenario-filters {
    flex: 1 1 auto;
    padding-right: 250px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-filter-controls .library-sort {
    position: absolute;
    right: 0;
    display: block;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-content,
  body[data-view="library"] #library-screen[data-tab="cookings"] .library-content {
    min-height: 0;
    display: block;
    flex: 1 1 auto;
    overflow: hidden;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] #library-list,
  body[data-view="library"] #library-screen[data-tab="cookings"] #library-list {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: max-content;
    gap: 24px;
    padding: 0 0 10px;
    overflow-y: auto;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] #library-preview,
  body[data-view="library"] #library-screen[data-tab="cookings"] #library-preview {
    display: none;
  }

  body[data-view="library"] #library-screen[data-tab="cookings"] .library-card {
    min-height: 220px;
    height: auto;
    display: block;
  }

  body[data-view="library"] #library-screen[data-tab="cookings"] .library-card-body {
    min-height: 220px;
  }
}

/* Final 1536 × 1024 history alignment. */
@media (min-width: 1200px) {
  body[data-view="library"] #library-screen[data-tab="history"] .library-workspace-sidebar {
    padding-right: 16px;
    padding-left: 28px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-search {
    min-height: 68px;
    height: 68px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-filter-controls {
    align-items: flex-start;
    padding-top: 21px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-history-group {
    gap: 20px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-history-group[data-period="today"] {
    margin-bottom: 11px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-history-group[data-period="yesterday"] {
    gap: 16px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-history-group[data-period="yesterday"] .dialogue-history-card:nth-child(n + 2) {
    display: none;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .dialogue-history-card::before {
    content: "◷";
    position: absolute;
    left: 20px;
    top: 50%;
    z-index: 2;
    width: 70px;
    height: 70px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #218c3e;
    background: #eaf3ec;
    font-size: 36px;
    transform: translateY(-50%);
  }

  body[data-view="library"] #library-screen[data-tab="history"] .dialogue-history-card > img {
    visibility: hidden;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .dialogue-scenario-tag {
    display: none;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .dialogue-history-meta {
    justify-content: flex-start;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .dialogue-note-count {
    padding: 0;
    font-size: 14px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .dialogue-note-count::before {
    content: "✓";
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    margin-right: 8px;
    border-radius: 3px;
    color: #fff;
    background: #38a453;
    font-size: 12px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] #library-preview {
    position: relative;
    overflow: hidden;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-transcript {
    position: absolute;
    top: 134px;
    right: 33px;
    left: 33px;
    height: 500px;
    display: block;
    margin: 0;
    padding: 0;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message {
    position: absolute;
    right: 0;
    left: 0;
    min-height: 0;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message.assistant {
    gap: 31px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message:nth-child(1) { top: 0; }
  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message:nth-child(2) { top: 130px; }
  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message:nth-child(3) { top: 256px; }
  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message:nth-child(4) { top: 376px; }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-avatar {
    position: relative;
    overflow: visible;
    border: 0;
    color: transparent;
    background: transparent;
    box-shadow: none;
    font-size: 0;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-avatar::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    width: 108px;
    height: 76px;
    background: url("/assets/icons/voice-avatar.webp") center / contain no-repeat;
    transform: translateX(-50%);
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-bubble {
    padding: 19px 22px 14px;
    font-size: 18px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-bubble::after {
    content: "10:41";
    display: block;
    margin-top: 4px;
    color: #737980;
    font-size: 15px;
    line-height: 1.15;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message:nth-child(n + 3) .library-preview-bubble::after {
    content: "10:42";
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message.user .library-preview-bubble::after {
    color: #d5d8d6;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message:nth-child(1) .library-preview-bubble {
    min-width: 344px;
    min-height: 96px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message:nth-child(2) .library-preview-bubble {
    width: 190px;
    min-height: 93px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message:nth-child(3) .library-preview-bubble {
    min-width: 356px;
    min-height: 88px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message:nth-child(4) .library-preview-bubble {
    width: 294px;
    min-height: 124px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message.user .library-preview-bubble::after {
    content: "10:41  ✓✓";
    text-align: right;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message.user:nth-child(n + 3) .library-preview-bubble::after {
    content: "10:42  ✓✓";
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-recipe-card {
    position: absolute;
    top: 660px;
    right: 40px;
    left: 25px;
    min-height: 186px;
    height: 186px;
    grid-template-columns: 188px minmax(0, 1fr) 32px;
    gap: 38px;
    padding: 18px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-actions {
    position: absolute;
    right: 41px;
    bottom: 63px;
    left: 31px;
    margin: 0;
    padding: 0;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-actions button {
    min-height: 75px;
  }
}

@media (max-width: 700px) {
  body[data-view="library"] .library-search > span:first-child {
    position: relative;
    width: 24px;
    height: 24px;
    display: block;
    color: transparent;
    font-size: 0;
  }

  body[data-view="library"] .library-search > span:first-child::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 12px;
    height: 12px;
    border: 2px solid #767b84;
    border-radius: 50%;
  }

  body[data-view="library"] .library-search > span:first-child::after {
    content: "";
    position: absolute;
    left: 15px;
    top: 16px;
    width: 8px;
    height: 2px;
    border-radius: 999px;
    background: #767b84;
    transform: rotate(45deg);
    transform-origin: left center;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-scenario-filters {
    transform: translateY(5px);
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-scenario-filters button {
    min-height: 34px;
    height: 34px;
  }
}

body[data-view="recipe"] .recipe-step-mobile-copy {
  display: none;
}

@media (min-width: 701px) and (max-width: 1100px) {
  body[data-view="recipe"] .recipe-section-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Keep the compact recipe presentation independent from the wide workspace tuning. */
@media (max-width: 700px) {
  body[data-view="recipe"] .recipe-hero-image,
  body[data-view="recipe"] .recipe-hero-copy,
  body[data-view="recipe"] .recipe-bottom-wave,
  body[data-view="recipe"] .recipe-text-question,
  body[data-view="recipe"] .recipe-bottom-voice .recipe-voice-button {
    transform: none;
  }

  body[data-view="recipe"] .recipe-hero-copy {
    padding: 14px 20px 16px;
  }

  body[data-view="recipe"] .recipe-hero-copy h1 {
    height: 31px;
    flex: 0 0 31px;
  }

  body[data-view="recipe"] .recipe-hero-meta {
    flex: 0 0 21px;
    margin-top: 6px;
  }

  body[data-view="recipe"] :is(.recipe-source, .recipe-source-line) {
    min-height: 20px;
    height: 20px;
    flex: 0 0 20px;
    justify-content: flex-start;
    margin-top: 6px;
    padding: 0;
    color: #747984;
    line-height: 20px;
  }

  body[data-view="recipe"] :is(.recipe-source, .recipe-source-line)::before {
    display: none;
  }

  body[data-view="recipe"] :is(.recipe-source, .recipe-source-line)::after {
    content: "↗";
    margin-left: 8px;
    font-size: 17px;
  }

  body[data-view="recipe"] .recipe-section-grid,
  body[data-view="recipe"] .recipe-section-grid > .recipe-section-card {
    height: auto;
  }

  body[data-view="recipe"] .recipe-step-progress {
    display: none;
  }

  body[data-view="recipe"] .recipe-section-steps h2,
  body[data-view="recipe"] .recipe-section-steps h3 {
    display: block;
    margin-bottom: 1px;
  }

  body[data-view="recipe"] .recipe-step-copy {
    display: none;
  }

  body[data-view="recipe"] .recipe-step-mobile-copy {
    min-width: 0;
    display: block;
    grid-column: 2 / 4;
    overflow: visible;
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  body[data-view="recipe"] .steps-card .recipe-step.current {
    position: relative;
    grid-template-columns: 30px minmax(0, 1fr) auto 32px;
    gap: 9px;
  }

  body[data-view="recipe"] .steps-card .recipe-step.current .recipe-step-mobile-copy {
    padding-right: 62px;
  }

  body[data-view="recipe"] .steps-card .recipe-step.current .recipe-step-current-label {
    position: absolute;
    right: 70px;
    grid-column: auto;
    margin: 0;
  }

  body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2) {
    display: block;
    height: auto;
    transform: none;
    white-space: normal;
  }

  body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2)::after {
    display: none;
  }

  body[data-view="recipe"] .recipe-bottom-wave {
    overflow: hidden;
    color: transparent;
    background: url("/assets/icons/voice-waveform.webp") center / 105px 36px no-repeat;
    font-size: 0;
  }
}

@media (max-width: 700px) {
  body[data-view="library"] .library-filter-controls {
    width: 100%;
    min-height: 57px;
    height: 57px;
    flex: 0 0 57px;
    display: flex;
    align-items: center;
    margin: 0;
    overflow: hidden;
  }

  body[data-view="library"] .library-filter-controls .library-scenario-filters {
    width: 100%;
    gap: 10px;
  }

  body[data-view="library"] .library-scenario-filters button {
    min-height: 37px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: 14px;
  }

  body[data-view="library"] .library-scenario-filters button[data-scenario-filter="quick"] {
    border-color: transparent;
    color: #236b3a;
    background: #e7f3e9;
  }

  body[data-view="library"] .library-scenario-filters button[data-scenario-filter="healthy"] {
    border-color: transparent;
    color: #553677;
    background: #eee5fa;
  }

  body[data-view="library"] .library-scenario-filters button[data-scenario-filter="unique"] {
    border-color: transparent;
    color: #71541a;
    background: #fff0ca;
  }

  body[data-view="library"] .library-scenario-filters button.active,
  body[data-view="library"] .library-scenario-filters button[aria-pressed="true"] {
    border-color: var(--vc-black);
    color: #fff;
    background: var(--vc-black);
  }

  body[data-view="library"] .library-filter-controls .library-sort {
    display: none;
  }

  body[data-view="library"] .library-history-group {
    gap: 10px;
  }

  body[data-view="library"] .library-history-group > h2 {
    margin: 3px 3px 5px;
    color: #111412;
    font-size: 19px;
    font-weight: 720;
  }

  body[data-view="library"] .library-history-group-list {
    gap: 10px;
  }

  body[data-view="library"] .dialogue-history-meta {
    align-items: flex-end;
  }

  body[data-view="library"] :is(.dialogue-scenario-tag, .dialogue-note-count) {
    padding-inline: 7px;
    font-size: 10px;
  }

  body[data-view="library"] .dialogue-history-trailing {
    min-width: 44px;
  }

  /* Actual runtime notes state. */
  body[data-view="library"] #library-screen[data-tab="favorites"] .library-workspace {
    padding: max(20px, env(safe-area-inset-top)) 16px max(8px, env(safe-area-inset-bottom));
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-toolbar {
    min-height: 34px;
    height: 34px;
    flex: 0 0 34px;
    grid-template-columns: 38px minmax(0, 1fr) 76px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-toolbar h1 {
    font-size: 23px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-toolbar small {
    display: none;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-toolbar::after {
    content: "⇅   ✎";
    justify-self: end;
    color: #111412;
    font-size: 22px;
    letter-spacing: 12px;
    white-space: nowrap;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-search {
    min-height: 49px;
    height: 49px;
    flex: 0 0 49px;
    margin-top: 17px;
    border-radius: 18px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-filter-controls {
    min-height: 57px;
    height: 57px;
    flex-basis: 57px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-content {
    min-height: 0;
    display: block;
    flex: 1 1 auto;
    overflow: hidden;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] #library-list {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: max-content;
    gap: 12px 10px;
    padding: 9px 0 58px;
    overflow-y: auto;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card {
    min-height: 192px;
    height: 192px;
    grid-template-rows: 112px minmax(0, 1fr);
    border-radius: 18px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-photo {
    height: 112px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] :is(.library-card.featured, .library-card.is-latest, .library-list.notes-mode .library-card:first-of-type) {
    min-height: 258px;
    height: 258px;
    grid-column: 1 / -1;
    grid-template-rows: 168px 90px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] :is(.library-card.featured, .library-card.is-latest, .library-list.notes-mode .library-card:first-of-type) .library-card-photo {
    height: 168px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-mobile-new {
    min-width: 278px;
    min-height: 44px;
  }

  body[data-view="library"] #library-screen[data-tab="cookings"] .library-workspace {
    padding: max(20px, env(safe-area-inset-top)) 16px max(8px, env(safe-area-inset-bottom));
  }

  body[data-view="library"] #library-screen[data-tab="cookings"] #library-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 0 58px;
  }

  body[data-view="library"] #library-screen[data-tab="cookings"] .library-card {
    min-height: 180px;
    height: auto;
    display: block;
  }
}

/* Final phone geometry refinements for the approved history render. */
@media (max-width: 700px) {
  body[data-view="library"] #library-screen[data-tab="history"] .library-toolbar {
    grid-template-columns: 39px minmax(0, 1fr) 30px;
    gap: 10px;
    padding: 0 10px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-toolbar::after {
    content: "";
    width: 30px;
    height: 30px;
    justify-self: end;
    background:
      linear-gradient(45deg, transparent 58%, #111 59% 66%, transparent 67%) 17px 17px / 13px 13px no-repeat,
      radial-gradient(circle at 45% 45%, transparent 7px, #111 7.5px 9.5px, transparent 10px);
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-search {
    grid-template-columns: 30px minmax(0, 1fr);
    padding: 0 12px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-scenario-filters {
    transform: translateY(9px);
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-scenario-filters button {
    padding-inline: 15px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] #library-list {
    gap: 15px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-history-group {
    gap: 3px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-history-group > h2 {
    margin: 8px 3px 0;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-history-group-list {
    gap: 10px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] :is(.dialogue-history-card, .history-card) {
    gap: 19px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] :is(.dialogue-history-card, .history-card) > span strong {
    font-size: 19px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] :is(.dialogue-history-card, .history-card) > span small {
    font-size: 16px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .dialogue-history-arrow {
    display: none;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .dialogue-history-trailing {
    min-width: 42px;
    align-items: flex-end;
  }

  body[data-view="library"] #library-screen[data-tab="history"] :is(.dialogue-scenario-tag, .dialogue-note-count) {
    min-height: 27px;
    padding-inline: 8px;
    font-size: 14px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .dialogue-note-count::before {
    content: "✓";
    width: 15px;
    height: 21px;
    display: inline-grid;
    place-items: center;
    margin-right: 7px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
    color: #fff;
    background: var(--vc-green);
    font-size: 10px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-mobile-new {
    bottom: max(20px, env(safe-area-inset-bottom));
  }

  body[data-view="library"] #library-screen[data-tab="history"] :is(.dialogue-history-card, .history-card) {
    position: relative;
    grid-template-columns: 85px minmax(0, 1fr);
  }

  body[data-view="library"] #library-screen[data-tab="history"] .dialogue-history-trailing {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 0;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-search {
    grid-template-columns: 30px minmax(0, 1fr);
    margin-top: 10px;
    padding: 0 12px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-scenario-filters {
    transform: translateY(6px);
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-scenario-filters button {
    padding-inline: 15px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-body h2 {
    min-height: 18px;
    flex: 0 0 auto;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card.featured {
    border-color: transparent;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card.featured .library-card-body h2 {
    min-height: 25px;
    font-size: 23.5px;
    line-height: 1.08;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card.featured .library-card-body {
    padding: 13px 13px 9px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card.featured .library-card-meta {
    margin-top: 4px;
    font-size: 15px;
    line-height: 1.2;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card.featured .library-card-tag {
    display: none;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card.featured .library-card-footer {
    display: contents;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card.featured .library-card-favorite {
    position: absolute;
    right: 13px;
    bottom: 24px;
    width: 40px;
    height: 40px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-source {
    margin: 4px 0 0;
    overflow: hidden;
    color: #72787f;
    font-size: 14px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-latest::before {
    content: "";
    width: 10px;
    height: 16px;
    border: 1.5px solid var(--vc-green);
    border-radius: 1px 1px 4px 4px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-favorite::before {
    content: "✓";
    width: 16px;
    height: 22px;
    display: grid;
    place-items: center;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
    color: #fff;
    background: var(--vc-green);
    font-size: 10px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-tag.tag-healthy {
    color: #7449a3;
    background: #eee4fa;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-tag.tag-unique {
    color: #8b671b;
    background: #fff0c9;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-tag.tag-tea {
    color: #246da7;
    background: #e4f1fb;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-tag.tag-quick {
    color: #2c7e3e;
    background: #e8f3e8;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-mobile-new {
    bottom: max(13px, env(safe-area-inset-bottom));
  }
}

/* Final wide notes grid alignment. */
@media (min-width: 1200px) {
  body[data-view="library"] #library-screen[data-tab="favorites"] .workspace-sidebar > p,
  body[data-view="library"] #library-screen[data-tab="favorites"] .workspace-sidebar > .workspace-recent {
    display: none;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .workspace-sidebar button:focus {
    outline: none;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-toolbar {
    padding-top: 26px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-toolbar h1 {
    font-size: 40px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-scenario-filters button {
    min-height: 42px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-scenario-filters {
    transform: translateY(-5px);
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-sort select {
    transform: translateY(-5px);
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] #library-list {
    scrollbar-width: none;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] #library-list::-webkit-scrollbar {
    display: none;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card {
    min-height: 353px;
    height: 353px;
    grid-template-rows: 215px minmax(0, 1fr);
    padding: 5px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-photo {
    height: 215px;
    border-radius: 14px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-body {
    padding: 15px 16px 14px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card.featured .library-card-source,
  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card.featured .library-card-tag {
    display: none;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-latest {
    top: 23px;
    left: 21px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-latest::before {
    content: "☆";
    width: auto;
    height: auto;
    border: 0;
    clip-path: none;
    color: #238d40;
    background: transparent;
    font-size: 20px;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-favorite {
    right: 17px;
    bottom: 14px;
    width: 38px;
    height: 38px;
    background: transparent;
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-card-favorite::before {
    content: "";
    width: 20px;
    height: 28px;
    border: 0;
    clip-path: none;
    background: url("/assets/icons/bookmark-outline.webp") center / contain no-repeat;
  }
}

@media (max-width: 700px) {
  body[data-view="library"] #library-screen[data-tab="favorites"] .library-scenario-filters {
    transform: translateY(5px);
  }

  body[data-view="library"] #library-screen[data-tab="favorites"] .library-scenario-filters button {
    min-height: 34px;
    height: 34px;
  }
}

body[data-view="library"] .library-search > span:first-child {
  position: relative;
  width: 24px;
  height: 24px;
  display: block;
  color: transparent;
  font-size: 0;
}

body[data-view="library"] .library-search > span:first-child::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 12px;
  height: 12px;
  border: 2px solid #767b84;
  border-radius: 50%;
}

body[data-view="library"] .library-search > span:first-child::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 16px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: #767b84;
  transform: rotate(45deg);
  transform-origin: left center;
}

@media (min-width: 1200px) {
  body[data-view="library"] #library-screen[data-tab="history"] .workspace-sidebar > p,
  body[data-view="library"] #library-screen[data-tab="history"] .workspace-recent {
    display: none;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .sidebar-new-dialogue {
    min-height: 68px;
    height: 68px;
    margin-top: 8px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .workspace-sidebar nav {
    gap: 12px;
    margin-top: 28px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .workspace-sidebar nav > button {
    min-height: 64px;
    height: 64px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-bubble {
    position: relative;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message.user .library-preview-bubble::before,
  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message.assistant .library-preview-bubble::before {
    content: "";
    position: absolute;
    bottom: 0;
    width: 13px;
    height: 17px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message.user .library-preview-bubble::before {
    right: -11px;
    background: #111412;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-message.assistant .library-preview-bubble::before {
    left: -11px;
    background: #fff;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    font-size: 20px;
  }

  body[data-view="library"] #library-screen[data-tab="history"] .library-preview-actions .mic-icon {
    transform: scale(1.2);
  }
}

/* -------------------------------------------------------------------------- */
/* Final desktop recipe polish                                                */
/* -------------------------------------------------------------------------- */

@media (min-width: 701px) {
  /* Keep the final document rows clear of both keyboard navigation and the
   * persistent voice dock. */
  body[data-view="recipe"] #recipe-content {
    padding-bottom: 56px;
    scroll-padding-top: 64px;
    scroll-padding-bottom: 112px;
  }

  body[data-view="recipe"] .recipe-section-grid > .recipe-section-card {
    scroll-margin-top: 64px;
    scroll-margin-bottom: 112px;
  }

  /* The progress belongs to the preparation card, so it remains useful while
   * its steps are being scrolled without turning into another global bar. */
  body[data-view="recipe"] .recipe-section-steps > :is(h2, h3) {
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 50px;
    margin: -8px 0 10px;
    padding: 9px 0 10px;
    border-bottom: 1px solid rgba(47, 163, 74, .13);
    background: rgba(254, 254, 254, .96);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  /* Ingredient selection remains a conventional square checkbox. Step
   * completion uses a smaller round control on a soft action tile. */
  body[data-view="recipe"] .recipe-checklist input {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    border-radius: 7px;
  }

  body[data-view="recipe"] .recipe-checklist input:focus-visible,
  body[data-view="recipe"] .recipe-step-check-control input:focus-visible {
    outline: 3px solid rgba(47, 163, 74, .24);
    outline-offset: 3px;
  }

  body[data-view="recipe"] .recipe-step.has-checklist-control .recipe-step-check-control {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: #f0f6f1;
    box-shadow: inset 0 0 0 1px rgba(47, 163, 74, .08);
  }

  body[data-view="recipe"] .recipe-step.has-checklist-control .recipe-step-check-control input {
    width: 22px;
    height: 22px;
    border-radius: 50%;
  }

  body[data-view="recipe"] .recipe-step.has-checklist-control .recipe-step-check-control input:checked {
    box-shadow: inset 0 0 0 5px #fff;
  }

  body[data-view="recipe"] :is(
    .recipe-step.current,
    .recipe-step.active,
    .recipe-steps > li.current,
    .steps-card ol > li.current
  )::after {
    background-color: #dcefe1;
    box-shadow:
      inset 0 0 0 1px rgba(32, 140, 61, .2),
      0 0 0 4px rgba(47, 163, 74, .08);
  }
}

@media (min-width: 1200px) {
  body[data-view="recipe"] .recipe-step-progress {
    max-width: min(62%, 520px);
    flex-basis: 420px;
    gap: clamp(4px, .45vw, 8px);
  }

  body[data-view="recipe"] .recipe-step-progress em {
    margin-right: 4px;
    font-size: 13px;
    font-weight: 520;
  }

  body[data-view="recipe"] .recipe-step-progress i {
    min-width: 6px;
    max-width: 34px;
    height: 4px;
  }

  /* A shorter, quieter dock keeps the recipe—not the chrome—as the focal
   * point, while preserving full-size 58px actions. */
  body[data-view="recipe"] .recipe-bottom-voice {
    min-height: 96px;
    height: 96px;
    grid-template-columns:
      58px
      minmax(0, 1fr)
      minmax(210px, 266px)
      minmax(230px, 286px);
    gap: 14px;
    margin: 12px 39px 18px 31px;
    padding: 8px 14px;
    border: 1px solid rgba(27, 60, 38, .06);
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 8px 24px rgba(27, 60, 38, .07);
  }

  body[data-view="recipe"] .recipe-bottom-voice::before {
    inset: 8px;
    border-radius: 14px;
    background: linear-gradient(90deg, #edf6ef, #f6f9f7);
  }

  body[data-view="recipe"] .recipe-bottom-wave {
    width: 58px;
    height: 58px;
    border-width: 3px;
    transform: translateX(5px);
  }

  body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2) {
    height: 58px;
  }

  body[data-view="recipe"] .recipe-bottom-voice > span:nth-child(2) strong {
    font-size: 18px;
  }

  body[data-view="recipe"] .recipe-bottom-voice .recipe-voice-button,
  body[data-view="recipe"] :is(.recipe-question-action, .recipe-text-question) {
    min-height: 58px;
    height: 58px;
    padding-inline: 22px;
  }

  body[data-view="recipe"] .recipe-bottom-voice .recipe-voice-button {
    min-width: clamp(230px, 16vw, 286px);
  }

  body[data-view="recipe"] :is(.recipe-question-action, .recipe-text-question) {
    min-width: clamp(210px, 15vw, 266px);
  }

  /* Wide cards read more evenly when short safety notes use both available
   * columns instead of leaving an empty right half. */
  body[data-view="recipe"] .recipe-section-tips > :is(ul, ol) {
    max-width: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(34px, 4vw, 64px);
    row-gap: 7px;
    padding-left: 22px;
  }

  body[data-view="recipe"] .recipe-section-tips > :is(ul, ol) > li {
    max-width: 62ch;
    padding-right: 12px;
    break-inside: avoid;
  }
}

@media (hover: hover) and (min-width: 701px) {
  body[data-view="recipe"] .recipe-checklist label {
    transition: color .16s ease, background-color .16s ease;
  }

  body[data-view="recipe"] .recipe-checklist label:hover {
    color: #155e2b;
    background: linear-gradient(90deg, rgba(231, 243, 233, .72), transparent 88%);
  }

  body[data-view="recipe"] :is(.recipe-step, .steps-card li)[role="button"] {
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
  }

  body[data-view="recipe"] :is(.recipe-step, .steps-card li)[role="button"]:hover {
    border-color: rgba(47, 163, 74, .42);
    box-shadow: 0 8px 20px rgba(27, 60, 38, .07);
    transform: translateY(-1px);
  }

}

/* The runtime already exposes the voice lifecycle on body/recipe-screen. Keep
 * the desktop dock labels short and make each state recognizable at a glance. */
@media (min-width: 701px) {
  body[data-view="recipe"][data-voice-state] #recipe-voice-state {
    font-size: 0;
  }

  body[data-view="recipe"][data-voice-state] #recipe-voice-state::after {
    content: var(--recipe-voice-label, "Спросить голосом");
    font-size: 16px;
  }

  body[data-view="recipe"][data-voice-state="off"] {
    --recipe-voice-label: "Спросить голосом";
  }

  body[data-view="recipe"][data-voice-state="ready"] {
    --recipe-voice-label: "Готов к вопросу";
  }

  body[data-view="recipe"][data-voice-state="connecting"] {
    --recipe-voice-label: "Подключаюсь";
  }

  body[data-view="recipe"][data-voice-state="listening"] {
    --recipe-voice-label: "Слушаю";
  }

  body[data-view="recipe"][data-voice-state="processing"] {
    --recipe-voice-label: "Готовлю ответ";
  }

  body[data-view="recipe"][data-voice-state="speaking"] {
    --recipe-voice-label: "Отвечаю";
  }

  body[data-view="recipe"][data-voice-state="blocked"] {
    --recipe-voice-label: "Включить звук";
  }

  body[data-view="recipe"] .recipe-bottom-voice,
  body[data-view="recipe"] .recipe-bottom-wave,
  body[data-view="recipe"] .recipe-bottom-voice .recipe-voice-button {
    transition:
      border-color .18s ease,
      color .18s ease,
      background-color .18s ease,
      box-shadow .18s ease;
  }

  body[data-view="recipe"]:is(
    [data-voice-state="off"],
    [data-voice-state="connecting"]
  ) .recipe-bottom-wave {
    opacity: .45;
    filter: saturate(.55);
  }

  body[data-view="recipe"]:is(
    [data-voice-state="ready"],
    [data-voice-state="listening"],
    [data-voice-state="speaking"]
  ) .recipe-bottom-voice::before {
    background: linear-gradient(90deg, #e4f2e7, #f3f8f4);
  }

  body[data-view="recipe"][data-voice-state="ready"] .recipe-bottom-voice .recipe-voice-button {
    background: #163f22;
  }

  body[data-view="recipe"][data-voice-state="listening"] .recipe-bottom-voice .recipe-voice-button {
    border-color: #238f40;
    background: #238f40;
    box-shadow: 0 7px 18px rgba(35, 143, 64, .2);
  }

  body[data-view="recipe"][data-voice-state="listening"] .recipe-bottom-wave {
    box-shadow:
      0 0 0 1px #2fa44a,
      0 0 0 6px rgba(47, 163, 74, .1);
    animation: recipe-voice-listening-pulse 1.45s ease-in-out infinite;
  }

  body[data-view="recipe"][data-voice-state="processing"] .recipe-bottom-voice .recipe-voice-button {
    border-color: #2e3631;
    background: #2e3631;
  }

  body[data-view="recipe"][data-voice-state="processing"] .recipe-bottom-wave {
    opacity: .7;
  }

  body[data-view="recipe"][data-voice-state="speaking"] .recipe-bottom-voice .recipe-voice-button {
    border-color: #1a7334;
    background: #1a7334;
  }

  body[data-view="recipe"][data-voice-state="speaking"] .recipe-bottom-wave {
    box-shadow:
      0 0 0 1px #258f40,
      0 0 0 5px rgba(47, 163, 74, .08);
  }

  body[data-view="recipe"][data-voice-state="blocked"] .recipe-bottom-voice {
    border-color: rgba(167, 112, 17, .2);
  }

  body[data-view="recipe"][data-voice-state="blocked"] .recipe-bottom-voice::before {
    background: linear-gradient(90deg, #fff7df, #fffbef);
  }

  body[data-view="recipe"][data-voice-state="blocked"] .recipe-bottom-voice .recipe-voice-button {
    border-color: #9a6815;
    color: #fff;
    background: #9a6815;
  }
}

@keyframes recipe-voice-listening-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px #2fa44a,
      0 0 0 4px rgba(47, 163, 74, .08);
  }
  50% {
    box-shadow:
      0 0 0 1px #2fa44a,
      0 0 0 8px rgba(47, 163, 74, .14);
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-view="recipe"] :is(
    .recipe-step,
    .steps-card li,
    .recipe-bottom-wave
  ) {
    transition: none;
    animation: none;
  }
}
