/* Components: header, footer, buttons, chips, tabs, cards, pagination, breadcrumb, modal, forms, toggles, toast, skeleton. */

/* ---------- auth-state visibility (server renders one state; static demo toggles by attribute) ---------- */
html[data-auth="guest"] .only-user { display: none !important; }
html[data-auth="user"] .only-guest { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  min-height: 44px; padding: 0 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-pill); border: 1px solid var(--c-line-2);
  background: var(--c-surface); color: var(--c-text);
  font-size: 14px; font-weight: var(--fw-bold); line-height: 1.2; white-space: nowrap;
  text-decoration: none; cursor: pointer; flex: 0 0 auto;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.btn:hover { color: var(--c-text); border-color: var(--c-check); }
.btn:active { transform: translateY(1px); }
.btn--primary { border: 0; background: var(--grad-brand-text); color: #fff; }
.btn--primary:hover { color: #fff; box-shadow: 0 8px 20px rgba(255, 46, 113, .28); }
.btn--dark { border-color: var(--c-dark); background: var(--c-dark); color: #fff; border-radius: var(--r-sm); }
.btn--dark:hover { color: #fff; background: #3a302c; border-color: #3a302c; }
.btn--google { border-color: #DADCE0; box-shadow: var(--shadow-btn); }
.btn--danger { color: var(--c-rose); }
.btn--danger-solid { border-color: var(--c-danger); color: var(--c-danger); }
.btn--danger-solid:hover { color: #fff; background: var(--c-danger); border-color: var(--c-danger); }
.btn--lg { min-height: 52px; padding: 0 24px; font-size: 15px; }
.btn--xl { width: 100%; min-height: 54px; font-size: 16px; gap: 12px; }
.btn--block { width: 100%; }
.btn--round { width: 44px; padding: 0; }
.btn--round.btn--lg { width: 52px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
/* toggle buttons (like / save): pressed state = brand tint + filled icon */
.btn[aria-pressed="true"] { background: var(--c-tint); border-color: #F3B7C7; color: #8E1F42; }
.btn[aria-pressed="true"] .icon { fill: currentColor; }
.btn[aria-pressed="true"] .icon--check { fill: none; }

.icon-btn {
  width: 44px; height: 44px; border-radius: var(--r-pill);
  border: 1px solid var(--c-line-2); background: var(--c-surface); color: var(--c-text);
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; padding: 0;
  transition: border-color .15s, background-color .15s;
}
.icon-btn:hover { color: var(--c-pink); border-color: #F3B7C7; }
.icon-btn[aria-pressed="true"] { color: var(--c-pink); border-color: #F3B7C7; background: var(--c-tint); }
.icon-btn[aria-pressed="true"] .icon { fill: currentColor; }
.icon-btn--sm { width: 34px; height: 34px; border: 0; background: var(--c-surface); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 32px;
  padding-inline: var(--gutter);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-line);
}
.site-header__logo { display: block; flex: 0 0 auto; border-radius: 6px; }
.site-header__logo img { height: 30px; width: auto; }
.main-nav { display: flex; gap: 24px; font-size: 14px; font-weight: var(--fw-medium); }
.main-nav a {
  height: var(--header-h); display: flex; align-items: center;
  border-bottom: 2px solid transparent; color: var(--c-muted);
  transition: color .15s, border-color .15s;
}
.main-nav a:hover { color: var(--c-text); border-bottom-color: var(--c-line-2); }
.main-nav a[aria-current] { border-bottom-color: var(--c-pink); color: var(--c-text); font-weight: var(--fw-bold); }
.header-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }
.search-pill {
  width: 220px; height: 44px; padding: 0 14px;
  display: flex; align-items: center; gap: 8px;
  border-radius: var(--r-pill); background: var(--c-surface-2); border: 1px solid var(--c-line-2);
  color: var(--c-muted-2);
}
.search-pill input {
  flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent; outline: none;
  font-size: 14px; font-weight: var(--fw-light); color: var(--c-text);
}
.search-pill input::placeholder { color: var(--c-muted-2); opacity: 1; }
.search-pill:focus-within { border-color: var(--c-pink); box-shadow: var(--ring); }
.avatar {
  width: 44px; height: 44px; padding: 2px; border-radius: var(--r-pill);
  background: var(--grad-brand); display: block; flex: 0 0 auto;
}
.avatar > span, .avatar > img {
  width: 100%; height: 100%; border-radius: var(--r-pill);
  background: var(--c-tint); color: var(--c-brown);
  border: 2px solid #fff; font-size: 15px; font-weight: var(--fw-bold);
  display: flex; align-items: center; justify-content: center; object-fit: cover;
}
.avatar--lg { width: 112px; height: 112px; padding: 3px; }
.avatar--lg > span { border-width: 4px; font-size: 40px; }
.avatar--md { width: 76px; height: 76px; }
.avatar--md > span { border-width: 3px; font-size: 28px; }
.menu-toggle { display: none; }

/* mobile panel */
.mobile-panel {
  display: none;
  position: absolute; inset-inline: 0; top: 100%;
  background: var(--c-surface); border-bottom: 1px solid var(--c-line);
  box-shadow: 0 20px 40px rgba(39, 32, 29, .12);
  padding: 16px var(--gutter) 22px;
  max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.mobile-panel.is-open { display: block; }
.mobile-panel .search-pill { width: 100%; height: 48px; }
.mobile-panel__label { margin: 20px 0 8px; font-size: 13px; font-weight: var(--fw-bold); color: var(--c-muted-2); letter-spacing: .04em; }
.mobile-panel__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mobile-panel__links a {
  min-height: 48px; padding: 0 14px; display: flex; align-items: center; gap: 10px;
  border-radius: var(--r-sm); background: var(--c-surface-2); border: 1px solid var(--c-line);
  color: var(--c-text); font-size: 14px; font-weight: var(--fw-medium);
}
.mobile-panel__links a img { width: 26px; height: 26px; }
.mobile-panel__links a[aria-current] { background: var(--c-tint); border-color: #F3D9CD; font-weight: var(--fw-bold); }
.mobile-panel .btn { margin-top: 16px; }

@media (max-width: 1023px) {
  .site-header { gap: 16px; }
  .main-nav, .site-header .search-pill { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-tools .search-link { display: inline-flex; }
}
.header-tools .search-link { display: none; }
@media (max-width: 639px) {
  .header-tools { gap: 8px; }
  .site-header__logo img { height: 26px; }
  .header-tools .btn-google-label { display: none; }
  .header-tools .btn--google { width: 44px; padding: 0; }
  .header-tools .icon-btn--hide-sm { display: none; }
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 56px; background: var(--c-surface-2); border-top: 1px solid var(--c-line);
  padding: 36px var(--gutter) 22px; display: flex; flex-direction: column; gap: 26px; flex: 0 0 auto;
}
.site-footer__cols { display: flex; gap: 56px; align-items: flex-start; }
.site-footer__brand { width: 300px; display: flex; flex-direction: column; gap: 12px; }
.site-footer__brand img { width: 170px; height: auto; }
.site-footer__brand p { line-height: 1.4; font-size: 15px; font-weight: var(--fw-medium); color: var(--c-muted); }
.site-footer__col { line-height: 1.43; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--c-muted); }
.site-footer__col h2 { font-size: 14px; font-weight: var(--fw-bold); color: var(--c-text); line-height: 1.43; }
.site-footer__col a { color: var(--c-muted); }
.site-footer__col a:hover { color: var(--c-rose); }
.site-footer__social { margin-inline-start: auto; display: flex; flex-direction: column; gap: 12px; }
.site-footer__social h2 { font-size: 14px; font-weight: var(--fw-bold); line-height: 1.43; }
.site-footer__social ul { display: flex; gap: 6px; }
.site-footer__social a { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-pill); }
.site-footer__social a:hover { background: var(--c-tint); }
.site-footer__social img { width: 20px; height: 20px; }
.site-footer__bottom {
  border-top: 1px solid var(--c-line-2); padding-top: 16px;
  display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--c-muted-2);
}
.site-footer__bottom span:last-child { margin-inline-start: auto; }
@media (max-width: 1023px) {
  .site-footer__cols { flex-wrap: wrap; gap: 32px 40px; }
  .site-footer__brand { width: 100%; }
  .site-footer__social { margin-inline-start: 0; }
}
@media (max-width: 639px) {
  .site-footer { margin-top: 40px; }
  .site-footer__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .site-footer__brand, .site-footer__social { grid-column: 1 / -1; }
  .site-footer__bottom span:last-child { margin-inline-start: 0; }
}

/* ---------- breadcrumb ---------- */
.breadcrumb { font-size: 13px; font-weight: var(--fw-medium); color: var(--c-muted-2); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb li + li::before { content: '\2039'; color: var(--c-check); font-size: 15px; }
[dir="ltr"] .breadcrumb li + li::before { content: '\203A'; }
.breadcrumb a { color: var(--c-muted-2); }
.breadcrumb a:hover { color: var(--c-rose); }
.breadcrumb [aria-current] { color: var(--c-text); }

/* ---------- chips / tags ---------- */
.chip {
  min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-pill); background: var(--c-surface-2); border: 1px solid var(--c-line-2);
  font-size: 14px; font-weight: var(--fw-medium); color: var(--c-text); white-space: nowrap; flex: 0 0 auto;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--c-check); color: var(--c-text); }
.chip[aria-pressed="true"], .chip.is-active, .chip[aria-current="true"] {
  background: var(--c-dark); border-color: var(--c-dark); color: #fff; font-weight: var(--fw-bold);
}
.chip--lg { min-height: 44px; padding: 0 18px; font-weight: var(--fw-bold); }
.chip--sq { border-radius: var(--r-sm); padding: 0 14px; }
.chip--sq[aria-pressed="true"] { background: var(--c-tint); border-color: #F3B7C7; color: #8E1F42; font-weight: var(--fw-medium); }
.chip--sq .icon { display: none; }
.chip--sq[aria-pressed="true"] .icon { display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-block: 2px; }
.chips--scroll::-webkit-scrollbar { display: none; }

.tag {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--c-surface); font-size: 12px; font-weight: var(--fw-bold); color: var(--c-brown); line-height: 1.5;
}
.tag--soft { background: var(--c-tint); }
.tag--outline { background: var(--c-surface); border: 1px solid var(--c-line-2); color: var(--c-muted); font-weight: var(--fw-medium); padding: 5px 12px; }
.tag--lg { padding: 6px 12px; font-size: 13px; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12px; font-weight: var(--fw-medium); color: var(--c-muted-2); }
.meta__cat { color: var(--c-brown); font-weight: var(--fw-bold); }
.meta__dot::before { content: '\00B7'; }
.meta .icon { width: 14px; height: 14px; }
.meta--icon span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--c-line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  min-height: 48px; padding: 0 18px; border: 0; border-bottom: 2px solid transparent; background: transparent;
  display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: var(--fw-medium); color: var(--c-muted);
  white-space: nowrap; margin-bottom: -1px; flex: 0 0 auto;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--c-text); }
.tab[aria-selected="true"], .tab[aria-current="true"] { color: var(--c-text); font-weight: var(--fw-bold); border-bottom-color: var(--c-pink); }
.tabs--sm .tab { min-height: 44px; font-size: 15px; padding: 0 16px; }
.tab-panel[hidden] { display: none; }

/* ---------- cover (image placeholder / real image) ---------- */
.cover {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--grad-cover); border: 1px solid var(--c-line); border-radius: var(--r-lg);
}
.cover--recipe { background: var(--grad-cover-recipe); }
.cover__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover__icon { width: 66px; height: 66px; opacity: .9; }
.cover__badge { position: absolute; top: 12px; inset-inline-start: 12px; }
.cover__action { position: absolute; top: 10px; inset-inline-end: 10px; }

/* ---------- cards ---------- */
.cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 8px;
  border-radius: var(--r-xl); background: var(--c-surface-2); border: 1px solid var(--c-line);
  text-align: center; color: var(--c-text);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.cat-card:hover { color: var(--c-text); transform: translateY(-3px); border-color: #F3D9CD; box-shadow: 0 12px 26px rgba(39, 32, 29, .08); }
.cat-card img { width: 52px; height: 52px; }
.cat-card__name { font-size: 14px; font-weight: var(--fw-bold); line-height: 1.4; }
.cat-card__count { font-size: 12px; color: var(--c-muted-2); }

.article-card { display: flex; flex-direction: column; gap: 12px; color: var(--c-text); min-width: 0; }
.article-card:hover { color: var(--c-text); }
.article-card:hover .article-card__title { color: var(--c-rose); }
.article-card .cover { height: 200px; }
.article-card__title { font-size: 19px; font-weight: var(--fw-bold); line-height: 1.55; text-wrap: pretty; transition: color .15s; }
.article-card__excerpt { font-size: 14px; font-weight: var(--fw-light); line-height: 1.8; color: var(--c-muted); }
/* card on tinted background ("picked for you") */
.article-card--boxed { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-xl); padding: 12px 12px 18px; gap: 12px; }
.article-card--boxed .cover { height: 170px; border-radius: var(--r-sm); }
.article-card--boxed .cover__icon { width: 64px; height: 64px; }
.article-card--boxed .meta, .article-card--boxed .article-card__title { padding-inline: 6px; }
.article-card--boxed .article-card__title { font-size: 18px; }

.recipe-card { display: flex; flex-direction: column; gap: 10px; color: var(--c-text); min-width: 0; }
.recipe-card:hover { color: var(--c-text); }
.recipe-card:hover .recipe-card__title { color: var(--c-rose); }
.recipe-card .cover { height: 190px; border-radius: var(--r-lg); }
.recipe-card__title { font-size: 16px; font-weight: var(--fw-bold); line-height: 1.55; transition: color .15s; }

.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-list__title { font-size: 18px; font-weight: var(--fw-bold); padding-bottom: 8px; border-bottom: 1px solid var(--c-line); }
.rank-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--c-line); color: var(--c-text); }
.rank-item:last-child { border-bottom: 0; }
.rank-item:hover { color: var(--c-text); }
.rank-item:hover .rank-item__title { color: var(--c-rose); }
.rank-item__n { font-size: 28px; font-weight: var(--fw-bold); line-height: 1; color: var(--c-pink); width: 26px; flex: 0 0 auto; }
.rank-item__body { display: flex; flex-direction: column; gap: 6px; }
.rank-item__title { font-size: 16px; font-weight: var(--fw-medium); line-height: 1.6; transition: color .15s; }
.rank-item__meta { font-size: 12px; color: var(--c-muted-2); }

.result-row { display: flex; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--c-line); color: var(--c-text); }
.result-row:hover { color: var(--c-text); }
.result-row:hover .result-row__title { color: var(--c-rose); }
.result-row .cover { width: 150px; height: 104px; flex: 0 0 auto; border-radius: var(--r-md); }
.result-row .cover__icon { width: 50px; height: 50px; }
.result-row__body { display: flex; flex-direction: column; gap: 7px; flex: 1 1 auto; min-width: 0; }
.result-row__title { font-size: 19px; font-weight: var(--fw-bold); line-height: 1.5; transition: color .15s; }
.result-row__snippet { font-size: 15px; font-weight: var(--fw-light); line-height: 1.8; color: var(--c-muted); }
.result-row mark { background: #FFE3EC; color: inherit; border-radius: 4px; padding: 0 2px; }

.mini-card { display: flex; gap: 14px; align-items: center; color: var(--c-text); }
.mini-card:hover { color: var(--c-text); }
.mini-card:hover .mini-card__title { color: var(--c-rose); }
.mini-card .cover { width: 120px; height: 96px; flex: 0 0 auto; border-radius: var(--r-md); }
.mini-card .cover__icon { width: 46px; height: 46px; }
.mini-card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mini-card__cat { font-size: 12px; font-weight: var(--fw-bold); color: var(--c-brown); }
.mini-card__title { font-size: 16px; font-weight: var(--fw-bold); line-height: 1.55; transition: color .15s; }

.saved-card {
  display: flex; gap: 14px; align-items: center; border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 12px;
  color: var(--c-text); position: relative;
}
.saved-card:hover { color: var(--c-text); border-color: #F3D9CD; }
.saved-card .cover { width: 96px; height: 84px; flex: 0 0 auto; border-radius: var(--r-sm); }
.saved-card .cover__icon { width: 42px; height: 42px; }
.saved-card__body { display: flex; flex-direction: column; gap: 5px; flex: 1 1 auto; min-width: 0; }
.saved-card__kind { font-size: 12px; font-weight: var(--fw-bold); color: var(--c-brown); }
.saved-card__title { font-size: 15px; font-weight: var(--fw-bold); line-height: 1.55; }
.saved-card .icon-btn { border: 0; width: 40px; height: 40px; color: var(--c-pink); }
.saved-card .icon-btn .icon { fill: currentColor; }

.liked-card { display: flex; flex-direction: column; gap: 10px; color: var(--c-text); }
.liked-card:hover { color: var(--c-text); }
.liked-card .cover { height: 150px; }
.liked-card .cover__icon { width: 54px; height: 54px; }
.liked-card .cover__action { width: 34px; height: 34px; color: var(--c-pink); }
.liked-card .cover__action .icon { fill: currentColor; }
.liked-card__kind { font-size: 12px; font-weight: var(--fw-bold); color: var(--c-brown); }
.liked-card__title { font-size: 15px; font-weight: var(--fw-bold); line-height: 1.55; }
.liked-card__when { font-size: 12px; color: var(--c-muted-2); }

.collection-card {
  border-radius: var(--r-xl); padding: 18px; background: var(--c-surface-2); border: 1px solid var(--c-line);
  display: flex; flex-direction: column; gap: 12px; text-align: start; color: var(--c-text); width: 100%;
  transition: border-color .15s, transform .15s;
}
.collection-card:hover { border-color: #F3D9CD; transform: translateY(-2px); }
.collection-card img { width: 46px; height: 46px; }
.collection-card__title { font-size: 17px; font-weight: var(--fw-bold); }
.collection-card__count { font-size: 13px; color: var(--c-muted-2); }
.collection-card[aria-pressed="true"], .collection-card.is-active { background: var(--c-dark); border-color: var(--c-dark); color: #fff; }
.collection-card.is-active .collection-card__count, .collection-card[aria-pressed="true"] .collection-card__count { color: #D9CAC3; }
.collection-card--new { border: 1.5px dashed var(--c-line-3); background: transparent; align-items: center; justify-content: center; color: var(--c-muted); }
.collection-card--new:hover { color: var(--c-rose); }

.stat-card { border: 1px solid var(--c-line); background: var(--c-surface); border-radius: var(--r-xl); padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.stat-card__ico { width: 46px; height: 46px; border-radius: var(--r-md); background: var(--c-tint); display: flex; align-items: center; justify-content: center; color: var(--c-rose); flex: 0 0 auto; }
.stat-card__ico--rose { background: #FFECEF; }
.stat-card__ico--soft { background: var(--c-surface-2); color: var(--c-muted); }
.stat-card__n { font-size: 24px; font-weight: var(--fw-bold); line-height: 1.2; display: block; }
.stat-card__l { line-height: 1.5; font-size: 13px; color: var(--c-muted-2); }

/* ---------- facts strip (recipe) & small table ---------- */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; }
.facts > div { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.facts > div + div { border-inline-start: 1px solid var(--c-line); }
.facts dt { font-size: 12px; color: var(--c-muted-2); }
.facts dd { line-height: 1.4; margin: 0; font-size: 17px; font-weight: var(--fw-bold); }
.compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; }
.compare > div { padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.compare > div:nth-child(odd) { background: var(--c-surface-2); }
.compare > div + div { border-inline-start: 1px solid var(--c-line); }
.compare strong { font-size: 15px; font-weight: var(--fw-bold); }
.compare span { font-size: 13px; font-weight: var(--fw-light); line-height: 1.7; color: var(--c-muted); }
@media (max-width: 639px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(3) { border-inline-start: 0; }
  .facts > div:nth-child(n+3) { border-top: 1px solid var(--c-line); }
  .compare { grid-template-columns: 1fr; }
  .compare > div + div { border-inline-start: 0; border-top: 1px solid var(--c-line); }
  .compare > div:nth-child(odd) { background: transparent; }
  .compare > div:nth-child(2) { background: var(--c-surface-2); }
}

/* ---------- callouts ---------- */
.callout {
  display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r-md); padding: 16px 18px;
  background: var(--c-tint-3); border: 1px solid #F3E0D3; font-size: 15px; line-height: 1.8; color: #6E5A50;
}
.callout .icon { color: var(--c-orange); margin-top: 3px; }
.callout--dashed { background: var(--c-surface); border: 1px dashed var(--c-line-3); padding: 14px; font-size: 13px; line-height: 1.75; color: var(--c-muted); }
.callout--dashed b { font-weight: var(--fw-bold); }

/* ---------- pagination ---------- */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.pagination a, .pagination span {
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--c-line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; font-weight: var(--fw-medium); color: var(--c-text);
  transition: border-color .15s, background-color .15s;
}
.pagination a:hover { border-color: var(--c-pink); color: var(--c-text); }
.pagination [aria-current="page"] { background: var(--c-dark); border-color: var(--c-dark); color: #fff; font-weight: var(--fw-bold); }
.pagination .is-gap { border: 0; color: var(--c-muted-2); min-width: 32px; padding: 0; }
.pagination .is-next { padding: 0 16px; font-weight: var(--fw-bold); }
.pagination [aria-disabled="true"] { opacity: .4; pointer-events: none; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-size: 14px; font-weight: var(--fw-bold); }
.field__hint { font-size: 12px; color: var(--c-muted-2); line-height: 1.6; }
.input {
  width: 100%; min-height: 48px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--c-line-3); background: var(--c-surface); color: var(--c-text); font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: var(--c-check); }
.input:focus-visible { border-color: var(--c-pink); outline: 3px solid var(--c-focus); }
.input[readonly], .input--static { background: var(--c-surface-2); border-color: var(--c-line); color: var(--c-muted); }
.input--static { display: flex; align-items: center; gap: 10px; }
.input--ltr { direction: ltr; text-align: left; }
select.input { appearance: none; padding-inline-end: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235D5350' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 14px center; }
[dir="ltr"] select.input { background-position: right 14px center; }
.select-sm { min-height: 40px; padding-inline-start: 14px; font-size: 14px; font-weight: var(--fw-medium); }

/* checkbox (ingredients) */
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; }
.check__box {
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--c-check); background: var(--c-surface);
  flex: 0 0 auto; margin-top: 2px; display: flex; align-items: center; justify-content: center; color: #fff;
  transition: background-color .15s, border-color .15s;
}
.check__box .icon { width: 14px; height: 14px; stroke-width: 2.4; opacity: 0; }
.check input:checked + .check__box { background: var(--grad-brand); border-color: var(--c-pink); }
.check input:checked + .check__box .icon { opacity: 1; }
.check input:focus-visible + .check__box { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.check input:checked ~ .check__text { color: var(--c-muted-2); }
.check input:checked ~ .check__text .check__name { text-decoration: line-through; }

/* toggle switch (role=switch button OR label+checkbox) */
.switch {
  position: relative; width: 52px; height: 30px; padding: 4px; border-radius: var(--r-pill); border: 0;
  background: var(--c-switch-off); display: flex; justify-content: flex-end; flex: 0 0 auto;
  transition: background-color .2s;
}
.switch::after {
  content: ''; width: 22px; height: 22px; border-radius: var(--r-pill); background: #fff; box-shadow: var(--shadow-knob);
  transition: transform .2s;
}
.switch[aria-checked="true"] { background: var(--c-pink); justify-content: flex-start; }
.switch--sm { width: 38px; height: 22px; padding: 3px; }
.switch--sm::after { width: 16px; height: 16px; }
.switch-row { display: flex; align-items: center; gap: 18px; padding: 14px 0; border-top: 1px solid var(--c-line-4); }
.switch-row__text { display: flex; flex-direction: column; gap: 3px; flex: 1 1 auto; }
.switch-row__title { font-size: 15px; font-weight: var(--fw-medium); }
.switch-row__desc { font-size: 13px; font-weight: var(--fw-light); color: var(--c-muted-2); line-height: 1.7; }
.switch-label[aria-checked="true"] .switch { background: var(--c-pink); justify-content: flex-start; }
.switch-label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: var(--fw-medium); color: var(--c-text); cursor: pointer; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: var(--overlay); animation: fade-in .18s ease-out; }
.modal__dialog {
  position: relative; width: 440px; max-width: 100%; max-height: calc(100vh - 40px); overflow-y: auto;
  border-radius: var(--r-modal); background: var(--c-surface); box-shadow: var(--shadow-modal);
  padding: 34px 34px 26px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
  animation: pop-in .22s ease-out;
}
.modal__close { position: absolute; top: 14px; inset-inline-end: 14px; width: 44px; height: 44px; border: 0; background: transparent; border-radius: var(--r-pill); display: flex; align-items: center; justify-content: center; color: var(--c-muted); }
.modal__close:hover { background: var(--c-surface-2); color: var(--c-text); }
.modal__logo { width: 170px; height: auto; margin-top: 6px; }
.modal__title { font-size: 26px; font-weight: var(--fw-bold); line-height: 1.45; }
.modal__text { font-size: 15px; font-weight: var(--fw-light); line-height: 1.85; color: var(--c-muted); max-width: 340px; }
.modal__note { font-size: 12px; color: var(--c-muted-2); line-height: 1.7; }
.modal__actions { display: flex; gap: 10px; width: 100%; margin-top: 6px; }
.modal__actions .btn { flex: 1 1 0; }
.modal--confirm .modal__dialog { width: 420px; padding-top: 30px; }
.modal--confirm .modal__title { font-size: 21px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 639px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal__dialog { width: 100%; max-height: 92vh; border-end-start-radius: 0; border-end-end-radius: 0; padding: 30px 20px 22px; }
  .modal__title { font-size: 22px; }
}

/* ---------- toast ---------- */
.toast-region { position: fixed; inset-inline: 0; bottom: 20px; z-index: 120; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding-inline: 16px; }
.toast {
  pointer-events: auto; max-width: 420px; padding: 12px 20px; border-radius: var(--r-pill);
  background: var(--c-dark); color: #fff; font-size: 14px; font-weight: var(--fw-medium); line-height: 1.6;
  box-shadow: 0 12px 30px rgba(39, 32, 29, .3); display: flex; align-items: center; gap: 10px;
  animation: toast-in .25s ease-out;
}
.toast .icon { color: var(--c-orange); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- skeleton ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--c-line); border-radius: var(--r-sm); }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent);
  transform: translateX(100%); animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(-100%); } }
.skeleton--line { height: 14px; border-radius: 8px; }
.skeleton--cover { height: 200px; border-radius: var(--r-lg); }
.skeleton-card { display: flex; flex-direction: column; gap: 12px; }

/* ---------- reading progress ---------- */
.read-progress { height: 3px; background: var(--c-line); position: sticky; top: var(--header-h); z-index: 40; }
.read-progress > div { width: 0; height: 3px; background: var(--grad-brand-h); transition: width .1s linear; }

/* ---------- timer chip (recipe) ---------- */
.timer {
  min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--c-line-2); background: var(--c-surface);
  font-size: 13px; font-weight: var(--fw-bold); display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; flex: 0 0 auto;
  font-variant-numeric: tabular-nums; transition: background-color .15s, border-color .15s, color .15s;
}
.timer:hover { border-color: var(--c-pink); }
.timer[data-state="running"] { background: var(--c-tint); border-color: #F3B7C7; color: #8E1F42; }
.timer[data-state="paused"] { border-style: dashed; }
.timer[data-state="done"] { background: var(--c-ok); border-color: var(--c-ok); color: #fff; }
