/* Crème — визуальная система. Токены из MASTER_SPEC, раздел 3. */

:root {
  --paper: #f7f0e3;
  --paper-light: #fffbf3;
  --paper-deep: #efe3cf;
  --ink: #342a25;
  --muted: #6c5d54;
  --kraft: #c8a982;
  --cocoa: #745345;
  --cocoa-dark: #5d4136;
  --strawberry: #b95b60;
  --strawberry-dark: #9c434a;
  --sage: #84917a;
  --sage-dark: #5f6d56;
  --dusty: #d9a8ae;
  --butter: #ebcb82;
  --border: #d7c9b8;
  --focus: #754c9a;
  --shadow-sm: 0 1px 2px #4a33221a, 0 3px 8px #4a332214;
  --shadow: 0 2px 4px #4a33221a, 0 12px 28px #4a33221f;
  --radius: 12px;
  --font-ui: Manrope, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-book: Literata, Georgia, 'Times New Roman', serif;
  --font-hand: 'Marck Script', 'Segoe Script', cursive;
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .2 0 0 0 0 .1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --header-h: 72px;
  color-scheme: light;
}

/* ---------- База ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--grain), radial-gradient(circle at 85% 0, #fffaf0 0, transparent 50%), #ece2d2;
  font: 15px/1.6 var(--font-ui);
  min-height: 100vh;
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }
code { background: var(--paper-deep); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.lead { color: var(--muted); font-size: 16px; margin: 4px 0 18px; max-width: 62ch; }
.script { font-family: var(--font-hand); font-weight: 400; }
.hand { font: 400 30px/1.15 var(--font-hand); margin: 0 0 10px; color: var(--cocoa-dark); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 10px; }

/* ---------- Каркас ---------- */

.app { max-width: 1480px; min-height: 100vh; margin: 0 auto; background: var(--grain), var(--paper); box-shadow: 0 0 60px #5e4a2c1c; display: flex; flex-direction: column; }
.content { flex: 1; width: 100%; padding: 32px clamp(16px, 5vw, 72px) 72px; outline: none; }
.top {
  height: var(--header-h); position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 clamp(16px, 5vw, 72px);
  background: #fbf6edeb; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #e3d5c3;
}
.brand { font: 40px/1 var(--font-hand); text-decoration: none; color: var(--ink); display: flex; align-items: baseline; }
.brand span { font: 18px var(--font-ui); color: var(--strawberry); padding-left: 4px; }
.top-nav { display: flex; gap: 6px; }
.top-nav a { text-decoration: none; font-size: 14px; font-weight: 500; padding: 10px 14px; border-radius: 999px; color: var(--muted); }
.top-nav a:hover { color: var(--ink); background: #f0e4d2; }
.top-nav a.active { color: var(--ink); background: #ead9bf; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #ead1b5; color: var(--cocoa); text-decoration: none; }
.avatar.active { box-shadow: 0 0 0 2px var(--cocoa); }
.foot { text-align: center; font-size: 12px; color: var(--muted); padding: 22px 16px 28px; }
.mobile-nav { display: none; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid #c9b59d; background: var(--paper-light); color: var(--ink);
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: #fff; border-color: #b39c82; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--cocoa); border-color: var(--cocoa); color: #fff; }
.btn-primary:hover { background: var(--cocoa-dark); border-color: var(--cocoa-dark); }
.btn-soft { background: #f3e5c9; border-color: #e3cfa7; }
.btn-soft:hover { background: #efdcb7; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #f0e4d2; border-color: transparent; }
.btn-danger { background: var(--strawberry-dark); border-color: var(--strawberry-dark); color: #fff; }
.btn-danger:hover { background: #853840; }
.btn-sm { min-height: 38px; padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn.is-on { background: #f6dfe0; border-color: var(--dusty); color: var(--strawberry-dark); }
.btn.is-on .icon { fill: currentColor; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 10px; border: 1px solid var(--border); background: var(--paper-light); font-weight: 700;
}
.icon-btn:hover { background: #fff; }
.icon-btn.danger { color: var(--strawberry-dark); }
.link { background: none; border: 0; padding: 4px 0; color: var(--cocoa); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; min-height: 32px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }

/* ---------- Карточки и состояния ---------- */

.card { background: var(--paper-light); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card h2 { margin: 0 0 10px; font: 600 20px var(--font-book); }
.notice { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; margin: 0 0 22px; border-radius: var(--radius); background: #e7ecdc; border: 1px solid #cbd5b9; }
.notice p { margin: 0; flex: 1 1 260px; }
.notice > .icon { color: var(--sage-dark); }
.notice-warm { background: #f8ead0; border-color: #ead2a2; }
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 36px 24px; background: #fff8ed; border: 1.5px dashed #cdb397; border-radius: var(--radius); color: var(--muted); }
.empty .craft-svg { width: 64px; height: 64px; }
.empty p { margin: 0 0 6px; max-width: 46ch; }
.not-found { display: grid; justify-items: center; text-align: center; padding: 40px 0; }
.not-found .craft-svg { width: 110px; height: 110px; }

.section-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font: 500 26px var(--font-book); margin: 40px 0 16px; }
.section-title small { font: 13px var(--font-ui); color: var(--muted); }
.page-title { font-size: clamp(42px, 6vw, 58px); margin: 0 0 6px; color: var(--ink); outline: none; }
.crumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.crumb a { color: var(--cocoa); text-underline-offset: 3px; }
.crumb span { opacity: .5; }

.tag { display: inline-block; background: #efe1cb; border-radius: 6px; padding: 3px 9px; font-size: 12px; font-weight: 600; color: var(--cocoa-dark); }
.tag-soft { background: transparent; border: 1px solid var(--border); font-weight: 500; }
.tag-draft { background: #f8e2a8; color: #6d5011; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Главная ---------- */

.hero { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 26px; }
.hero h1 { font-size: clamp(44px, 6vw, 62px); margin: 0; outline: none; }
.hero .heart { color: var(--strawberry); font-size: .7em; }
.hero-search { position: relative; max-width: 460px; margin-top: 6px; }
.hero-search .icon, .search-bar > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.hero-search input { width: 100%; min-height: 48px; padding: 10px 16px 10px 44px; border-radius: 999px; border: 1px solid var(--border); background: var(--paper-light); }
.paper-note {
  flex: none; max-width: 270px; padding: 18px 24px; position: relative;
  background: var(--grain), var(--season-note, #ecd8b0); transform: rotate(3deg);
  box-shadow: 2px 6px 12px #4d39242e; font: 25px/1.2 var(--font-hand); color: #4c3a2e;
}
.paper-note::before { content: ''; position: absolute; top: -12px; left: 36%; width: 88px; height: 24px; background: #ffffff8c; transform: rotate(-7deg); box-shadow: 0 1px 2px #0001; }

/* Полочка */
.shelf {
  display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x proximity;
  padding: 18px 8px 0; margin: 0 -8px; position: relative;
  scrollbar-width: thin; scrollbar-color: #c6a78a transparent;
  background: linear-gradient(#b88a5f, #9a6f48) left bottom / 100% 18px no-repeat;
  background-attachment: local;
  filter: drop-shadow(0 6px 6px #4a332230);
}
.shelf::after { content: ''; position: sticky; flex: none; width: 1px; }
.shelf-book { flex: none; width: 156px; scroll-snap-align: start; text-decoration: none; color: inherit; border: 0; background: none; padding: 0 0 16px; position: relative; }

.shelf-book .cover { transition: transform .25s ease; transform-origin: bottom center; }
.shelf-book:hover .cover, .shelf-book:focus-visible .cover { transform: translateY(-8px) rotate(-1.5deg); }
.shelf-book:focus-visible { outline: none; }
.shelf-book:focus-visible .cover { outline: 3px solid var(--focus); outline-offset: 4px; }
.shelf-add .add-cover {
  display: grid; place-items: center; align-content: center; gap: 8px; aspect-ratio: 5 / 7; border-radius: 4px 12px 12px 4px;
  border: 2px dashed #b89f86; background: #f1e6d5; color: var(--cocoa); font-size: 14px;
}
.shelf-add .icon { width: 34px; height: 34px; }
.shelf-add:hover .add-cover { background: #ecdcc4; }
.shelf-add:focus-visible { outline: none; }
.shelf-add:focus-visible .add-cover { outline: 3px solid var(--focus); outline-offset: 4px; }

/* ---------- Обложки ---------- */

.cover {
  --cover-title-default: #fff4e3;
  container-type: inline-size;
  position: relative; aspect-ratio: 5 / 7; width: 100%;
  border-radius: 4px 12px 12px 4px; overflow: hidden;
  box-shadow: inset 8px 0 12px -4px #1f120c66, inset -2px 0 4px #ffffff55, 4px 6px 10px #49362b4d;
  isolation: isolate;
}
.cover::before { /* строчка по краю */
  content: ''; position: absolute; inset: 5.5% 6% 5.5% 9%; z-index: 3; pointer-events: none;
  border: 1.5px dashed #fff1d888; border-radius: 3px 8px 8px 3px;
}
.cover::after { /* фактура ткани и корешок */
  content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background:
    linear-gradient(90deg, #00000038 0, #00000010 4%, #ffffff1f 5%, transparent 7%),
    repeating-linear-gradient(0deg, #ffffff0d 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, #0000000d 0 1px, transparent 1px 3px),
    var(--grain);
}
.cover-title {
  position: absolute; z-index: 5; top: 11%; left: 12%; right: 10%;
  text-align: center; font: 15cqw/1.02 var(--font-hand); color: var(--cover-title, var(--cover-title-default));
  text-shadow: 0 1px 2px #2a1a1477; overflow-wrap: anywhere; pointer-events: none;
}
.cover-sub { position: absolute; z-index: 5; bottom: 8%; left: 0; right: 0; text-align: center; font-size: 6.6cqw; font-weight: 600; color: var(--cover-title, var(--cover-title-default)); opacity: .85; text-shadow: 0 1px 2px #2a1a1466; }
.cover-layers { position: absolute; inset: 0; z-index: 2; }
.cover-layer { position: absolute; display: block; aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; }
.cover-layer.is-tag { aspect-ratio: auto; }
.cover-edit .cover-layer { cursor: grab; z-index: auto; }
.cover-edit .cover-layer:active { cursor: grabbing; }
.cover-edit .cover-layer.selected { outline: 2px dashed #fff8e6; outline-offset: 2px; filter: drop-shadow(0 0 4px #0006); }
.cover-edit .cover-layer:focus-visible { outline: 3px solid #fff; box-shadow: 0 0 0 6px var(--focus); }
.cover-tag {
  display: block; padding: 6% 10% 6% 16%; position: relative;
  background: var(--grain), #f8efdf; color: #4a362d; border-radius: 3px 6px 6px 3px;
  clip-path: polygon(12% 0, 100% 0, 100% 100%, 12% 100%, 0 50%);
  box-shadow: 1px 2px 3px #0003; text-align: center;
  font: calc(var(--s, 40) * .16cqw)/1.15 var(--font-hand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cover-tag::before { content: ''; position: absolute; left: 5%; top: 50%; width: 3.2cqw; height: 3.2cqw; transform: translateY(-50%); border-radius: 50%; background: #d9c9b2; box-shadow: inset 0 1px 1px #0003; }
.craft-svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(.6px 1.2px .8px #2a1a1466); }
.craft-svg .stitch * { fill: none !important; stroke: #fff8 !important; stroke-width: .9 !important; stroke-dasharray: 1.8 1.6; }
.craft-svg.embroidery { filter: drop-shadow(.4px .8px .4px #1f140e99); }
.craft-svg.mosaic { filter: drop-shadow(1px 1px 0 #efe2cf) drop-shadow(1.5px 2.5px 1.5px #261c1780); }
.craft-svg.rhinestones { filter: drop-shadow(0 0 1.5px #fffc) drop-shadow(1.5px 2.5px 1.5px #3e273d77); }

/* Материалы */
.mat-brown { background-color: #6b5047; background-image: repeating-linear-gradient(91deg, #ffffff08 0 2px, transparent 2px 4px); }
.mat-green { background-color: #66785f; background-image: repeating-linear-gradient(89deg, #ffffff0a 0 2px, transparent 2px 4px); }
.mat-blue { background-color: #7f9899; background-image: repeating-linear-gradient(91deg, #ffffff0c 0 2px, transparent 2px 4px); }
.mat-pink {
  background-color: #f4ddd6;
  background-image:
    repeating-linear-gradient(0deg, #c9777b70 0 9px, transparent 9px 18px),
    repeating-linear-gradient(90deg, #c9777b70 0 9px, transparent 9px 18px);
}
.mat-berry { background-color: #7f3443; background-image: radial-gradient(ellipse at 30% 25%, #ffffff2b, transparent 55%), radial-gradient(ellipse at 80% 90%, #00000033, transparent 60%); }
.mat-cream { --cover-title-default: #4a362d; background-color: #eadfcb; background-image: repeating-linear-gradient(91deg, #8a6d5012 0 2px, transparent 2px 4px); }
.mat-cream::before, .mat-kraft::before, .mat-floral::before { border-color: #7d5f4a66; }
.mat-cream .cover-title, .mat-kraft .cover-title, .mat-floral .cover-title { text-shadow: 0 1px 0 #fff8; }
.mat-kraft { --cover-title-default: #3f2e25; background-color: #c8a982; background-image: radial-gradient(#8b6a4a22 1px, transparent 1.5px), radial-gradient(#fff3 1px, transparent 1.5px); background-size: 7px 7px, 11px 11px; background-position: 0 0, 3px 5px; }
.mat-floral {
  --cover-title-default: #5a2f33; background-color: #f6ecdc;
  background-image:
    radial-gradient(circle, #e8b75f 0 1.5px, transparent 2px),
    radial-gradient(circle, #d98f97 0 4px, transparent 4.5px),
    radial-gradient(circle, #9fb08b 0 2px, transparent 2.5px);
  background-size: 26px 26px;
  background-position: 0 0, 0 0, 13px 13px;
}

/* ---------- Карточки рецептов ---------- */

.recipes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 22px 18px; }
.recipe-card {
  position: relative; display: block; text-decoration: none; color: inherit; min-width: 0;
  background: #fffdf8; padding: 8px 8px 12px; border-radius: 3px;
  box-shadow: 0 1px 2px #4a33221f, 2px 5px 12px #4a332217;
  transform: rotate(var(--tilt, 0deg)); transition: transform .2s ease, box-shadow .2s;
}
.recipe-card:hover, .recipe-card:focus-visible { transform: rotate(0) translateY(-4px); box-shadow: 0 2px 4px #4a33221f, 4px 12px 22px #4a332226; }
.recipe-card strong { display: block; font: 600 15px/1.3 var(--font-book); margin: 10px 2px 2px; overflow-wrap: anywhere; }
.recipe-card small { display: block; color: var(--muted); font-size: 12px; margin: 0 2px; }
.badge { position: absolute; top: 14px; z-index: 1; border-radius: 6px; font-size: 11px; font-weight: 700; padding: 3px 8px; box-shadow: var(--shadow-sm); }
.badge-draft { left: 14px; background: #f8e2a8; color: #6d5011; }
.badge-saved { right: 14px; background: #fff; color: var(--strawberry); padding: 5px; border-radius: 50%; }
.badge-saved .icon { width: 16px; height: 16px; fill: currentColor; }
.photo { aspect-ratio: 4 / 3; overflow: hidden; background: #e8d9c3; position: relative; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-empty, .photo-missing {
  display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); font-size: 13px;
  background-color: #f6ebda;
  background-image: repeating-linear-gradient(0deg, #e6c8bf66 0 10px, transparent 10px 20px), repeating-linear-gradient(90deg, #e6c8bf66 0 10px, transparent 10px 20px);
}
.photo-empty .craft-svg { width: 42%; height: auto; aspect-ratio: 1; }
.photo-missing img { display: none; }

/* ---------- Книга ---------- */

.book-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 44px; align-items: start; }
.book-aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 18px; }
.cover-large { width: 100%; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 16px; padding-bottom: 0; border-bottom: 2px solid #e1d2bd; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 8px 14px;
  border: 1px solid var(--border); border-bottom: 0; border-radius: 10px 10px 0 0;
  background: color-mix(in srgb, var(--tab, #efe1cb) 55%, #fffbf3); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink);
  margin-bottom: -2px;
}
.tab span { font-size: 11px; color: var(--muted); font-weight: 600; }
.tab.active { background: var(--tab, #e5d1b2); border-color: #c9b59d; box-shadow: 0 -2px 0 inset #fff6; padding-top: 10px; }
.tab-add { background: transparent; border-style: dashed; color: var(--cocoa); }
.tab-add .icon { width: 16px; height: 16px; }
.book-layout .row { margin-bottom: 22px; }

/* ---------- Рецепт ---------- */

.recipe-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; align-items: center; }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; z-index: 15; top: calc(100% + 6px); right: 0; min-width: 230px;
  background: var(--paper-light); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 6px; display: grid;
}
.menu-list button { display: flex; align-items: center; gap: 10px; text-align: left; min-height: 44px; padding: 8px 12px; border: 0; border-radius: 8px; background: none; font-weight: 500; }
.menu-list button:hover { background: #f3e7d5; }
.menu-list .danger { color: var(--strawberry-dark); }
.jump { display: none; }

.spread {
  display: grid; grid-template-columns: 1fr 1fr; max-width: 1180px; margin: 0 auto; position: relative;
  border-radius: 6px 14px 14px 6px; box-shadow: 0 2px 4px #5d48351f, 10px 18px 40px #5d483529;
}
.spread::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 34px; transform: translateX(-50%); background: linear-gradient(90deg, transparent, #4b342414 40%, #4b342433 50%, #4b342414 60%, transparent); pointer-events: none; }
.page {
  min-height: 680px; padding: 40px 46px 48px; position: relative; min-width: 0;
  background-color: #fbf3e4; border: 1px solid #dccab1;
  background-image: var(--grain), repeating-linear-gradient(transparent 0 31px, #9e90752a 31px 32px);
}
.page-left { border-radius: 6px 0 0 6px; }
.page-right { border-radius: 0 14px 14px 0; }
.recipe-title { font: 400 clamp(44px, 5vw, 60px)/1.02 var(--font-hand); margin: 14px 0 12px; color: var(--ink); outline: none; overflow-wrap: anywhere; }
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 0 0 8px; }
.facts li { display: flex; align-items: center; gap: 8px; }
.facts .icon { color: var(--cocoa); }
.facts span { display: grid; line-height: 1.25; font-weight: 600; font-size: 14px; }
.facts small { font-weight: 500; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.polaroid { width: min(86%, 420px); margin: 26px auto 24px; padding: 10px 10px 30px; background: #fffdf8; box-shadow: 3px 8px 18px #52391c3d; transform: rotate(-2.5deg); position: relative; }
.polaroid::before { content: ''; position: absolute; width: 90px; height: 26px; background: #d9c5a9b8; left: 38%; top: -13px; transform: rotate(6deg); z-index: 1; box-shadow: 0 1px 2px #0001; }
.polaroid figcaption { position: absolute; bottom: 6px; right: 12px; font: 17px var(--font-hand); color: var(--muted); }
.scribble { display: block; width: fit-content; max-width: 90%; margin: 0 0 22px auto; padding: 14px 18px; background: var(--grain), #efdcb9; transform: rotate(2deg); font: 23px/1.25 var(--font-hand); box-shadow: 2px 4px 8px #4d39241f; }
.tips ul { padding-left: 20px; margin: 0; }
.tips li { margin: 4px 0; }
.source { font-size: 13px; color: var(--muted); margin-top: 22px; overflow-wrap: anywhere; }
.source a { color: var(--cocoa); }

.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.section-head .hand { margin: 0; }
.anchor { margin-bottom: 30px; }
.scaler { display: flex; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--paper-light); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.stepper .icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #f2e5d1; font-size: 18px; }
.stepper output { min-width: 84px; text-align: center; font-size: 14px; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--paper-light); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; min-height: 38px; min-width: 44px; padding: 4px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--cocoa); color: #fff; }
.seg-wrap { display: grid; grid-template-columns: 1fr 1fr; border-radius: 14px; width: 100%; }
.scale-note { font-size: 12.5px; color: var(--muted); background: #f8ead0; border-radius: 8px; padding: 8px 12px; margin: 10px 0 0; }
.ingredients { list-style: none; padding: 0; margin: 14px 0 6px; }
.ingredients li { padding: 3px 0; }
.ing-heading { font-weight: 700; color: var(--cocoa-dark); margin-top: 10px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 4px 0; min-height: 32px; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { flex: none; width: 22px; height: 22px; margin-top: 1px; border: 1.5px solid #a88d74; border-radius: 5px; background: #fffdf8; display: grid; place-items: center; }
.check .box .icon { width: 16px; height: 16px; stroke-width: 2.6; opacity: 0; color: #fff; }
.check input:checked + .box { background: var(--sage-dark); border-color: var(--sage-dark); }
.check input:checked + .box .icon { opacity: 1; }
.check input:checked ~ span { text-decoration: line-through; text-decoration-color: #0006; color: var(--muted); }
.check input:focus-visible + .box { outline: 3px solid var(--focus); outline-offset: 2px; }
.scaled { background: linear-gradient(transparent 60%, #ebcb8266 60%); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 34px 1fr; gap: 12px; margin-bottom: 14px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #f1d8d4; color: var(--strawberry-dark); font: 600 15px var(--font-book); border: 1px solid #e3b8b3; }
.steps p { margin: 4px 0 0; }
.timer-chip {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: baseline;
  border: 1px solid #d6bf9c; background: #fbefd9; border-radius: 999px; padding: 1px 9px 1px 6px;
  font-weight: 600; font-size: .93em; color: var(--cocoa-dark); min-height: 28px;
}
.timer-chip .icon { width: .85em; height: .85em; }
.timer-chip:hover { background: #f5e0b9; }
.margin-notes textarea {
  width: 100%; min-height: 96px; padding: 10px 12px; border-radius: 8px; resize: vertical;
  border: 1px dashed #c4ab8f; background: #fffaf0cc; font: 22px/1.35 var(--font-hand); color: #4a362d;
}
.cook-log { margin-top: 18px; padding-top: 14px; border-top: 1px dashed #d4c0a5; }
.cook-log h3 { font: 600 15px var(--font-book); margin: 0 0 6px; }
.cook-log ul { padding-left: 18px; margin: 6px 0 12px; font-size: 14px; }
.cook-log time { font-weight: 600; }

/* ---------- Режим готовки ---------- */

.cook { max-width: 1000px; margin: 0 auto; }
.cook-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.cook-title { font: 400 clamp(36px, 5vw, 50px)/1.1 var(--font-hand); margin: 0 0 14px; outline: none; }
.progress { height: 8px; background: #e8d8c4; border-radius: 99px; overflow: hidden; }
.progress div { height: 100%; background: var(--sage-dark); transition: width .25s; }
.cook-body { display: grid; grid-template-columns: 290px 1fr; gap: 24px; margin: 24px 0; align-items: start; }
.cook-ingredients { background: var(--paper-light); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.cook-ingredients summary { font: 600 17px var(--font-book); cursor: pointer; min-height: 32px; }
.cook-card { background: var(--paper-light); border: 1px solid var(--border); border-radius: 16px; padding: clamp(22px, 4vw, 44px); box-shadow: var(--shadow); min-height: 300px; }
.cook-count { margin: 0 0 12px; color: var(--muted); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.cook-step { font: 400 clamp(21px, 2.6vw, 28px)/1.55 var(--font-book); margin: 0; }
.cook-done .big { font-size: 48px; margin: 0 0 14px; }
.cook-done label { font-weight: 600; display: block; margin-bottom: 6px; }
.cook-done textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 14px; background: #fff; }
.cook-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; bottom: 12px; background: #fbf6edf0; backdrop-filter: blur(6px); padding: 10px; border-radius: 14px; border: 1px solid var(--border); }
.cook-nav .btn { min-height: 52px; padding: 12px 22px; font-size: 16px; }
.dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.dots span { width: 9px; height: 9px; border-radius: 50%; background: #dccbb4; }
.dots .past { background: #a9b39f; }
.dots .on { background: var(--cocoa); transform: scale(1.3); }
.switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; }
.switch span { width: 42px; height: 24px; border-radius: 99px; background: #d8c7b0; position: relative; transition: background .2s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px #0003; }
.switch input:checked + span { background: var(--sage-dark); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Редактор ---------- */

.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.editor-main, .editor-side { display: grid; gap: 20px; min-width: 0; }
.editor-side { position: sticky; top: calc(var(--header-h) + 16px); }
fieldset.card { margin: 0; min-width: 0; }
fieldset.card > legend { font: 600 19px var(--font-book); padding: 0 6px; margin-left: -6px; float: left; width: 100%; margin-bottom: 10px; }
fieldset.card > legend + * { clear: both; }
.field { display: block; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field > span, .field > legend { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); padding: 0; }
.field small { font-weight: 400; color: var(--muted); }
.field b { color: var(--strawberry-dark); }
.field input:not([type="radio"]):not([type="checkbox"]):not([type="range"]), .field textarea, .field select, .search-bar input, .search-bar select, .dialog select {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cdbba7; border-radius: 9px; background: #fff;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input[type="range"] { width: 100%; accent-color: var(--cocoa); min-height: 32px; }
[aria-invalid="true"] { border-color: var(--strawberry-dark) !important; box-shadow: 0 0 0 3px #b95b6033; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 10px; }
.step-editor { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.step-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.step-num { width: 32px; height: 32px; margin-top: 6px; border-radius: 50%; display: grid; place-items: center; background: #f1d8d4; color: var(--strawberry-dark); font: 600 14px var(--font-book); }
.step-row textarea { width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid #cdbba7; border-radius: 9px; background: #fff; resize: vertical; line-height: 1.5; }
.step-tools { display: flex; gap: 4px; }
.step-tools .icon-btn { width: 38px; height: 38px; }
.editor-photo { border-radius: 8px; margin-bottom: 12px; }
.editor-photo.photo-empty { display: grid; gap: 6px; }
.editor-photo.photo-empty .icon { width: 30px; height: 30px; }
.editor-side .file-btn { width: 100%; }
.editor-save { display: grid; gap: 10px; }
.editor-save p { margin: 0; text-align: center; }

/* ---------- Мастерская ---------- */

.ws-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.workshop { display: grid; grid-template-columns: 270px minmax(0, 1fr) 290px; gap: 22px; align-items: start; }
.ws-panel h2 { font: 600 19px var(--font-book); }
.ws-stage {
  display: grid; justify-items: center; gap: 14px; padding: 28px 16px; border-radius: var(--radius);
  background: var(--grain), repeating-linear-gradient(45deg, #e9dbc9 0 12px, #f0e6d7 12px 24px);
}
#wsCanvas { width: min(360px, 82vw); }
.shelf-preview { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
#wsMini { width: 64px; }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.swatch { display: grid; justify-items: center; gap: 4px; cursor: pointer; text-align: center; }
.swatch input { position: absolute; opacity: 0; }
.swatch .cover { width: 100%; border-radius: 3px 7px 7px 3px; box-shadow: 1px 2px 4px #49362b4d; }
.swatch .cover::before { display: none; }
.swatch small { font-size: 10.5px; line-height: 1.2; color: var(--muted); }
.swatch input:checked + .cover { outline: 3px solid var(--cocoa); outline-offset: 2px; }
.swatch input:focus-visible + .cover { outline: 3px solid var(--focus); outline-offset: 2px; }
.colors { display: flex; flex-wrap: wrap; gap: 8px; }
.colors label { cursor: pointer; position: relative; }
.colors input { position: absolute; opacity: 0; }
.colors span { display: block; width: 36px; height: 36px; border-radius: 50%; border: 1px solid #0002; box-shadow: inset 0 0 0 3px #fff; }
.colors span.auto { background: linear-gradient(135deg, #fff4e3 50%, #3a2c26 50%) !important; }
.colors input:checked + span { outline: 3px solid var(--cocoa); outline-offset: 2px; }
.colors input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.decors { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; margin: 14px 0; }
.decors button { aspect-ratio: 1; display: grid; place-items: center; padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: #fff; transition: transform .15s; }
.decors button:hover { transform: scale(1.06); border-color: #b39c82; }
.ws-props { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.ws-props h3 { margin: 0 0 10px; font: 600 16px var(--font-book); }
.ws-hint { margin-top: 18px; }
.ws-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 22px; padding: 14px 0; border-top: 1px solid var(--border); }

/* ---------- Поиск, вдохновение, данные ---------- */

.search-bar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 190px 190px; gap: 10px; margin: 10px 0 22px; }
.search-bar input { padding-left: 44px !important; border-radius: 999px !important; min-height: 48px !important; }
.search-bar select { min-height: 48px !important; border-radius: 999px !important; }
.inspo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pick { display: grid; gap: 14px; justify-items: start; }
.pick-card { width: min(260px, 100%); }
.future { margin-top: 40px; text-align: center; }
.data-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.data-grid .card p { margin: 0 0 14px; }
.stats { list-style: none; display: flex; gap: 22px; padding: 0; margin: 4px 0 14px; }
.stats li { display: grid; color: var(--muted); font-size: 13px; }
.stats b { font: 600 30px var(--font-book); color: var(--ink); }
.danger-zone { border-color: #e2b9b6; }
details.danger-zone { border: 1px solid #e2b9b6; border-radius: 10px; padding: 10px 14px; margin-top: 10px; }
details.danger-zone summary { cursor: pointer; font-weight: 600; color: var(--strawberry-dark); min-height: 32px; }

/* ---------- Диалоги, уведомления, таймеры ---------- */

.dialog { border: 1px solid var(--border); border-radius: 18px; padding: 0; background: var(--paper-light); color: var(--ink); box-shadow: 0 24px 70px #0005; width: min(520px, calc(100% - 24px)); max-height: min(90vh, 900px); }
.dialog-wide { width: min(640px, calc(100% - 24px)); }
.dialog::backdrop { background: #33241dad; }
.dialog form { display: flex; flex-direction: column; max-height: inherit; }
.dialog header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px 6px 22px; }
.dialog header h2 { margin: 0; font: 400 34px var(--font-hand); }
.dialog header .icon-btn { border: 0; background: none; }
.dialog-body { padding: 6px 22px 8px; overflow: auto; }
.dialog-body p { margin-top: 0; }
.dialog footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid #eadfcf; }
.chapter-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.chapter-row .dot { width: 14px; height: 14px; border-radius: 50%; }
.chapter-row input[type="text"], .chapter-row input:not([type]) { min-height: 40px; padding: 8px 10px; border: 1px solid #cdbba7; border-radius: 8px; background: #fff; width: 100%; }
.mini-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; min-height: 40px; }
.mini-check input { width: 18px; height: 18px; accent-color: var(--strawberry-dark); }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; width: max-content; max-width: calc(100% - 24px); }
.toast { display: flex; align-items: center; gap: 14px; background: #3d2e27; color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); animation: rise .2s ease-out; }
.toast .link { color: #f6d79a; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.timers { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: grid; gap: 8px; width: min(330px, calc(100% - 24px)); }
.timer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; background: var(--paper-light); border: 1px solid var(--border); border-left: 5px solid var(--sage-dark); border-radius: 12px; padding: 10px 10px 10px 14px; box-shadow: var(--shadow); }
.timer-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; grid-column: 1; }
.timer-time { font: 600 24px var(--font-book); font-variant-numeric: tabular-nums; grid-column: 1; }
.timer-btns { grid-column: 2; grid-row: 1 / 3; display: flex; gap: 4px; }
.timer-btns .icon-btn { width: 40px; height: 40px; font-size: 13px; }
.timer.done { border-left-color: var(--strawberry); background: #fbe9e6; animation: pulse 1s ease-in-out 6; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px #b95b6033; } }
body[data-page="workshop"] .timers { bottom: 90px; }

/* ---------- v0.6: украшения и удобства ---------- */

.view-enter { animation: viewIn .28s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }
.show-sm { display: none; }

/* Шапка: корзина со счётчиком */
.avatar.cart { position: relative; background: #f1e3c8; }
.avatar .count { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--strawberry-dark); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--paper); }
.avatar .count[hidden] { display: none; }

/* Главная */
.today { margin: 6px 0 0; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--season, var(--sage-dark)); }
.today::first-letter { text-transform: uppercase; }
.hero-deco { position: relative; flex: none; padding: 10px 30px 0 0; }
.hero-doodle { position: absolute; left: -64px; bottom: -34px; width: 96px; color: var(--sage-dark); opacity: .55; transform: rotate(-24deg); z-index: 0; }
.hero-deco .paper-note { z-index: 1; }

/* Книги на полке: объём страниц и ленточка-закладка */
.shelf-book .cover { box-shadow: inset 8px 0 12px -4px #1f120c66, inset -2px 0 4px #ffffff55, 3px 0 0 -1px #fbf5ea, 5px 1px 0 -1px #e9dcc8, 6px 2px 0 -1px #d8c7af, 6px 8px 12px #49362b4d; }
.book-ribbon { position: absolute; left: 68%; bottom: 4px; width: 9px; height: 26px; z-index: 1; background: var(--ribbon); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); box-shadow: inset 0 3px 3px #0002; transition: height .25s ease; }
.shelf-book:hover .book-ribbon, .shelf-book:focus-visible .book-ribbon { height: 34px; }

/* Карточки: полоска скотча */
.recipe-card .tape { position: absolute; top: -9px; left: 50%; width: 58px; height: 19px; transform: translateX(-50%) rotate(calc(var(--tilt, 0deg) * -3)); background: var(--tape); opacity: .78; z-index: 2; box-shadow: 0 1px 1px #0000000f; clip-path: polygon(3% 0, 97% 4%, 100% 50%, 96% 100%, 2% 96%, 0 50%); }
.recipe-card { margin-top: 6px; }

/* Разворот рецепта */
.doodle { display: block; pointer-events: none; color: var(--cocoa); }
.doodle-svg { width: 100%; height: auto; }
.page > * { position: relative; z-index: 1; }
.page > .doodle { position: absolute; z-index: 0; opacity: .22; width: 110px; }
.doodle-left { left: 18px; bottom: 16px; transform: rotate(-8deg); }
.doodle-right { right: 16px; bottom: 14px; transform: rotate(10deg); width: 90px !important; }
.ribbon { position: absolute !important; top: -6px; left: 14px; width: 20px; height: 92px; background: linear-gradient(90deg, #a54850, var(--strawberry) 40%, #a54850); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%); box-shadow: 0 2px 4px #0003; z-index: 3 !important; }
.edge-tabs { position: absolute; top: 70px; right: -32px; display: grid; gap: 6px; z-index: 0; }
.edge-tabs a { writing-mode: vertical-rl; text-decoration: none; font-size: 12.5px; font-weight: 600; color: #4a362d; padding: 14px 8px 14px 9px; background: var(--tab); border-radius: 0 8px 8px 0; box-shadow: 2px 2px 4px #4a33221f; border: 1px solid #0000000d; border-left: 0; max-height: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: transform .15s; }
.edge-tabs a:hover, .edge-tabs a.on { transform: translateX(4px); }
.edge-tabs a.on { font-weight: 800; box-shadow: 3px 2px 6px #4a332233; }
.polaroid::before { background: repeating-linear-gradient(45deg, #e8b9b6cc 0 6px, #f4d9d6cc 6px 12px) !important; }
.ing-tools { margin-top: 10px; }
.btn .lbl { display: inline; }

/* Режим готовки */
.cook-count { display: flex; align-items: center; gap: 12px; }
.cook-num { font: 400 46px/1 var(--font-hand); color: var(--strawberry); text-transform: none; letter-spacing: 0; }
.cook-next { margin: 26px 0 0; padding-top: 14px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 15px; }
.cook-next b { color: var(--ink); }

/* Книга: сортировка */
.book-tools { justify-content: space-between; }
.sort-select { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.sort-select select { min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--paper-light); font-weight: 600; font-size: 14px; color: var(--ink); }

/* Редактор: зона фото */
.drop-zone { border-radius: 10px; transition: box-shadow .15s; }
.drop-zone.over { box-shadow: 0 0 0 3px var(--sage-dark); }
.drop-zone.busy { opacity: .5; }
.editor-photo.photo-empty span { text-align: center; line-height: 1.4; }

/* Список покупок */
.shop-add { display: flex; gap: 10px; max-width: 640px; margin-bottom: 22px; }
.shop-add input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--paper-light); }
.shop-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.shop-group { background-image: var(--grain), repeating-linear-gradient(transparent 0 39px, #9e90752a 39px 40px); background-color: #fffaf0; }
.shop-group h2 { font: 400 28px var(--font-hand); margin: 0 0 6px; }
.shop-group h2 a { text-decoration: none; color: var(--cocoa-dark); }
.shop-group ul { list-style: none; padding: 0; margin: 0; }
.shop-group li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; }
.shop-group li .check { flex: 1; }
.icon-sm { width: 36px; height: 36px; border: 0; background: none; color: var(--muted); opacity: .6; }
.shop-group li:hover .icon-sm, .icon-sm:focus-visible { opacity: 1; }
.shop-actions { margin-top: 22px; }

/* ---------- v0.7: стили карточек, штампы, дневник, журнал ---------- */

/* Сезоны */
body[data-season="autumn"] { --season: #a5562a; --season-note: #efd2a8; }
body[data-season="winter"] { --season: #4f6d80; --season-note: #e3e6e1; }
body[data-season="spring"] { --season: #b25f72; --season-note: #f3d9d6; }
body[data-season="summer"] { --season: #9a7a12; --season-note: #f2e2a6; }
body[data-season] .hero-doodle { color: var(--season, var(--sage-dark)); }

/* Тактильные мелочи */
.btn.pop .icon { animation: pop .45s ease-out; }
@keyframes pop { 40% { transform: scale(1.45); } }
.stamp-in { animation: stampIn .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes stampIn { from { opacity: 0; transform: scale(1.8) rotate(-14deg); } }

/* Карточка: элементы стилей */
.recipe-card .kicker { display: none; }
.mini-stamp {
  position: absolute; top: 20px; left: 12px; z-index: 2; max-width: 70%;
  padding: 3px 7px; border: 1.5px solid var(--stamp); border-radius: 5px; background: #fffdf8e6;
  color: var(--stamp); font-size: 9.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2;
  transform: rotate(-6deg); box-shadow: 0 1px 2px #0001;
}
.recipe-card .badge-draft { top: 46px; }
.hearts { color: var(--strawberry); letter-spacing: 1px; font-size: 1em; white-space: nowrap; }
.hearts-off { color: #e3d0c8; }

/* Кондитерская: полосатый козырёк и арочное фото */
.cs-patisserie { background: #fff7f1; padding: 0 10px 14px; text-align: center; border-radius: 4px 4px 10px 10px; }
.cs-patisserie::before {
  content: ''; display: block; height: 22px; margin: 0 -10px 10px;
  background: repeating-linear-gradient(90deg, var(--strawberry) 0 14px, #fff7f1 14px 28px);
  -webkit-mask: radial-gradient(circle at 7px 0, #000 0 13px, transparent 13.5px) 0 0 / 14px 22px repeat-x;
          mask: radial-gradient(circle at 7px 0, #000 0 13px, transparent 13.5px) 0 0 / 14px 22px repeat-x;
}
.cs-patisserie .tape { display: none; }
.cs-patisserie .photo { border-radius: 999px 999px 6px 6px; aspect-ratio: 1; }
.cs-patisserie strong { font: 400 23px/1.1 var(--font-hand); color: var(--strawberry-dark); }
.cs-patisserie .mini-stamp { top: 40px; }

/* Журнал: фото на всю карточку, заголовок поверх */
.cs-magazine { display: flex; flex-direction: column; justify-content: flex-end; padding: 12px 14px; border-radius: 4px; overflow: hidden; background: #2d2420; aspect-ratio: 3 / 4; }
.cs-magazine .tape { display: none; }
.cs-magazine .photo { position: absolute; inset: 0; aspect-ratio: auto; }
.cs-magazine .photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 30%, #1e140fe6 90%); }
.cs-magazine .kicker { display: block; position: absolute; top: 12px; left: 12px; right: 12px; z-index: 2; color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; text-shadow: 0 1px 2px #0006; }
.cs-magazine strong, .cs-magazine small, .cs-magazine .mini-stamp { position: relative; z-index: 2; }
.cs-magazine strong { color: #fff; font: italic 600 19px/1.15 var(--font-book); margin: 0 0 4px; text-shadow: 0 1px 3px #0007; }
.cs-magazine small { color: #f3e6d6; margin: 0; }
.cs-magazine .hearts-off { color: #ffffff55; }
.cs-magazine .mini-stamp { top: auto; left: auto; align-self: flex-start; margin-bottom: 8px; }
.cs-magazine .badge-draft { position: absolute; }

/* Винтажная карточка: картотека в линейку */
.cs-vintage {
  padding: 34px 12px 14px; border-radius: 3px;
  background-color: #fffdf4;
  background-image: linear-gradient(#d9726f 0 0), repeating-linear-gradient(transparent 0 23px, #a9c1d488 23px 24px);
  background-size: 100% 2px, 100% 100%; background-position: 0 24px, 0 30px; background-repeat: no-repeat, repeat;
}
.cs-vintage .tape { left: 22%; top: 26px; width: 44px; z-index: 3; }
.cs-vintage .photo { width: 78%; margin: 0 auto; border: 5px solid #fff; box-shadow: 1px 3px 6px #0002; transform: rotate(-2.5deg); }
.cs-vintage strong { font: 400 22px/1.15 var(--font-hand); color: #2f3f5f; }
.cs-vintage .mini-stamp { top: 6px; left: auto; right: 10px; }

/* Минимализм */
.cs-minimal { padding: 0; background: transparent; box-shadow: none; transform: none; }
.cs-minimal:hover, .cs-minimal:focus-visible { box-shadow: none; transform: translateY(-3px); }
.cs-minimal .tape { display: none; }
.cs-minimal .photo { border-radius: 14px; box-shadow: var(--shadow-sm); }
.cs-minimal strong { font: 600 15px/1.3 var(--font-ui); }

/* Фото на развороте рецепта в выбранном стиле */
.hero-magazine { transform: none; padding: 0; width: 100%; border-radius: 4px; overflow: hidden; }
.hero-magazine::before, .hero-minimal::before, .hero-patisserie::before { display: none; }
.hero-minimal { transform: none; padding: 0; background: none; box-shadow: none; }
.hero-minimal .photo { border-radius: 16px; box-shadow: var(--shadow); }
.hero-patisserie { transform: none; padding: 12px; background: #fff7f1; border-radius: 999px 999px 10px 10px; }
.hero-patisserie .photo { border-radius: 999px 999px 6px 6px; }
.hero-vintage { background: #fffdf4; padding: 10px 10px 34px; transform: rotate(2deg); }
.hero-magazine figcaption, .hero-minimal figcaption { position: static; margin-top: 4px; }

/* Штампы на странице рецепта */
.stamps { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 0; }
.stamp {
  display: inline-block; padding: 6px 12px; border: 2.5px double var(--stamp); border-radius: 7px;
  color: var(--stamp); font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  transform: rotate(-4deg); opacity: .88; background: #ffffff40;
}
.stamps .stamp:nth-child(2n) { transform: rotate(3deg); }

/* Выбор стиля и штампов */
.style-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.style-choice { display: grid; justify-items: center; gap: 6px; cursor: pointer; text-align: center; }
.style-choice input { position: absolute; opacity: 0; }
.style-choice small { font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.style-thumb { position: relative; width: 66px; height: 84px; display: block; border-radius: 4px; background: #fffdf8; box-shadow: 0 1px 3px #0002; overflow: hidden; transform: none; padding: 0; }
.style-thumb i { position: absolute; left: 7px; right: 7px; top: 8px; height: 44px; background: linear-gradient(135deg, #e7c39c, #c98a64); }
.style-thumb b { position: absolute; left: 9px; right: 18px; bottom: 12px; height: 6px; border-radius: 3px; background: #6c5d54; }
.style-thumb.cs-patisserie::before { height: 10px; margin: 0; -webkit-mask-size: 8px 10px; mask-size: 8px 10px; background: repeating-linear-gradient(90deg, var(--strawberry) 0 8px, #fff7f1 8px 16px); }
.style-thumb.cs-patisserie i { top: 16px; height: 38px; border-radius: 99px 99px 3px 3px; }
.style-thumb.cs-magazine i { inset: 0; height: auto; }
.style-thumb.cs-magazine b { background: #fff; }
.style-thumb.cs-vintage { padding: 0; }
.style-thumb.cs-vintage i { left: 12px; right: 12px; top: 16px; height: 34px; transform: rotate(-3deg); border: 2px solid #fff; }
.style-thumb.cs-minimal { background: transparent; box-shadow: none; }
.style-thumb.cs-minimal i { left: 0; right: 0; top: 0; height: 56px; border-radius: 9px; }
.style-choice input:checked + .style-thumb { outline: 3px solid var(--cocoa); outline-offset: 3px; }
.style-choice input:focus-visible + .style-thumb { outline: 3px solid var(--focus); outline-offset: 3px; }
.stamp-choices { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.stamp-choice { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; }
.stamp-choice input { width: 18px; height: 18px; accent-color: var(--cocoa); }
.stamp-choice input:not(:checked) + .stamp { opacity: .4; }

/* Оценка сердечками */
.rating-field legend { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.rating { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.rating input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating label { font-size: 32px; line-height: 1; color: #e3d0c8; cursor: pointer; padding: 4px 3px; min-width: 40px; text-align: center; transition: transform .1s, color .1s; }
.rating input:checked ~ label, .rating label:hover, .rating label:hover ~ label { color: var(--strawberry); }
.rating label:hover { transform: scale(1.15); }
.rating input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 1px; border-radius: 6px; }
.diary-file { margin-top: 2px; }
.diary-form { margin: 8px 0 14px; }
.diary-form textarea { width: 100%; }

/* Дневник на странице рецепта */
.diary-list { list-style: none; padding: 0; margin: 8px 0 14px; display: grid; gap: 12px; }
.diary-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.diary-photo { width: 76px; padding: 4px 4px 12px; background: #fff; box-shadow: 1px 2px 5px #0002; transform: rotate(-3deg); }
.diary-photo .photo { aspect-ratio: 1; }
.diary-list li:nth-child(2n) .diary-photo { transform: rotate(2deg); }
.diary-text { grid-column: 2; font-size: 14px; }
.diary-list li:not(:has(.diary-photo)) .diary-text { grid-column: 1 / 3; }
.diary-text time { font-weight: 700; }
.diary-text p { margin: 2px 0 0; font: 19px/1.3 var(--font-hand); color: #4a362d; }

/* Рулетка */
.roulette-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; }
.roulette-have { grid-column: 1 / -1; }
.roulette-form .btn { grid-column: 1 / -1; margin-bottom: 14px; }
.roulette-stage { min-height: 120px; display: grid; justify-items: start; gap: 6px; }
.pick-card.spinning { filter: blur(.6px); opacity: .85; transform: translateY(-2px); }
.pick-card.landed { animation: land .5s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes land { from { transform: translateY(-14px) rotate(-3deg); opacity: .4; } }
.roulette-empty { margin: 0; }

/* Анонс журнала */
.journal-teaser { display: flex; align-items: center; gap: 18px; margin: 24px 0 0; padding: 16px 20px; border-radius: var(--radius); text-decoration: none; color: inherit; background: var(--grain), linear-gradient(100deg, #f4e1d6, #f7ecdc); border: 1px solid #e6cfc0; box-shadow: var(--shadow-sm); transition: transform .2s; }
.journal-teaser:hover { transform: translateY(-2px); }
.journal-teaser .jt-logo { font: 38px/1 var(--font-hand); color: var(--strawberry-dark); }
.journal-teaser span:nth-child(2) { display: grid; flex: 1; }
.journal-teaser b { font: 600 18px var(--font-book); }
.journal-teaser small { color: var(--muted); }

/* Журнал месяца */
.journal-nav { justify-content: space-between; margin-bottom: 18px; }
.magazine { max-width: 1000px; margin: 0 auto; background: #fffcf6; box-shadow: var(--shadow); border-radius: 4px; overflow: hidden; }
.mag-cover { position: relative; min-height: 460px; display: grid; align-items: end; color: #fff; background: #3b2c25; }
.mag-cover > .photo { position: absolute; inset: 0; aspect-ratio: auto; }
.mag-cover > .photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(#1e140f66, transparent 30%, transparent 45%, #1e140fe0); }
.mag-cover.no-photo { color: var(--ink); background: var(--grain), repeating-linear-gradient(0deg, #f2dcd4 0 18px, #fbefe8 18px 36px); }
.mag-masthead { position: relative; padding: 34px clamp(20px, 5vw, 56px); }
.mag-issue { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; opacity: .9; }
.mag-logo { position: absolute; z-index: 1; top: 26px; left: clamp(20px, 5vw, 56px); margin: 0; font: 110px/1 var(--font-hand); opacity: .95; text-shadow: 0 2px 10px #0004; }
.no-photo .mag-logo { text-shadow: none; color: var(--strawberry-dark); }
.mag-title { font: italic 600 clamp(36px, 6vw, 64px)/1.02 var(--font-book); margin: 6px 0 8px; outline: none; }
.mag-lines { margin: 0; font-weight: 600; opacity: .92; }
.mag-feature { text-align: center; padding: 40px 24px 10px; max-width: 680px; margin: 0 auto; }
.mag-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--strawberry-dark); }
.mag-feature h2 { font: 400 46px/1.1 var(--font-hand); margin: 8px 0; }
.mag-feature h2 a { text-decoration: none; }
.mag-quote { font: italic 19px/1.5 var(--font-book); color: var(--muted); margin: 0; }
.mag-grid { columns: 3 240px; column-gap: 26px; padding: 30px clamp(18px, 4vw, 48px); }
.mag-item { break-inside: avoid; margin: 0 0 26px; background: #fff; padding: 9px 9px 14px; box-shadow: 0 2px 8px #4a332222; transform: rotate(var(--tilt)); }
.mag-item figcaption { display: grid; gap: 2px; margin-top: 10px; font-size: 13px; }
.mag-item time { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.mag-item a { font: 600 16px var(--font-book); text-decoration: none; }
.mag-item q { font: 19px/1.3 var(--font-hand); color: #4a362d; quotes: '«' '»'; }
.mag-new { padding: 0 clamp(18px, 4vw, 48px) 20px; }
.mag-new h2 { font: 600 20px var(--font-book); border-top: 1px solid var(--border); padding-top: 20px; }
.mag-new ul { columns: 2 220px; padding-left: 18px; }
.mag-new small { color: var(--muted); }
.mag-empty { padding: 30px; }
.mag-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 18px; border-top: 1px solid #efe4d5; }

/* Печатная книга (предпросмотр на экране) */
.pb-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px; }
.pb-toolbar p { flex-basis: 100%; margin: 0; }
.printbook { display: grid; gap: 26px; justify-items: center; }
.pb-page { width: min(794px, 100%); min-height: 600px; padding: clamp(24px, 6vw, 64px); background: #fffdf8; box-shadow: var(--shadow); }
.pb-cover { display: grid; justify-items: center; align-content: center; text-align: center; min-height: 900px; background: var(--grain), #fbf3e4; }
.pb-cover-art { width: 230px; margin-bottom: 26px; }
.pb-cover h1 { font-size: 64px; margin: 0; }
.pb-meta { color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.pb-toc h2 { font: 400 44px var(--font-hand); }
.pb-toc ol { padding-left: 22px; }
.pb-toc li { margin: 6px 0; }
.pb-toc li small { color: var(--muted); margin-left: 8px; }
.pb-kicker { margin: 0; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--strawberry-dark); font-weight: 700; }
.pb-recipe h2 { font-size: 48px; margin: 4px 0; }
.pb-facts { color: var(--muted); font-size: 13px; }
.pb-summary { font: italic 17px/1.5 var(--font-book); }
.pb-photo { width: 60%; margin: 10px 0 18px; }
.pb-no-photos .pb-photo { display: none; }
.pb-cols { display: grid; grid-template-columns: 1fr 1.6fr; gap: 28px; }
.pb-cols h3, .pb-recipe h3 { font: 600 16px var(--font-book); text-transform: uppercase; letter-spacing: .06em; }
.pb-cols .ingredients li { padding: 2px 0; }
.pb-steps { padding-left: 20px; }
.pb-steps li { margin-bottom: 8px; }
.pb-notes { font: 20px/1.3 var(--font-hand); border-left: 3px solid var(--dusty); padding-left: 12px; }
.pb-source { font-size: 12px; color: var(--muted); }


/* ---------- v0.8: premium visual refinement ---------- */

:root {
  --paper: #f6efe3;
  --paper-light: #fffaf2;
  --paper-deep: #eee1cd;
  --ink: #2f241f;
  --muted: #6f6157;
  --kraft: #c8a27d;
  --cocoa: #6f4b3d;
  --cocoa-dark: #56372b;
  --strawberry: #b76069;
  --strawberry-dark: #94414b;
  --sage: #84927a;
  --sage-dark: #617056;
  --border: #dccab6;
  --shadow-sm: 0 10px 24px rgba(82, 55, 39, 0.08), 0 2px 6px rgba(82, 55, 39, 0.06);
  --shadow: 0 18px 44px rgba(79, 54, 39, 0.12), 0 6px 18px rgba(79, 54, 39, 0.08);
  --radius: 18px;
}

html {
  background:
    radial-gradient(circle at top left, rgba(255, 252, 245, .9), transparent 40%),
    linear-gradient(180deg, #e7dac8 0%, #e9dfd2 28%, #e6ddcf 100%);
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 252, 246, .94), transparent 24%),
    radial-gradient(circle at 88% 4%, rgba(240, 212, 201, .46), transparent 26%),
    radial-gradient(circle at 80% 90%, rgba(222, 196, 167, .34), transparent 22%),
    var(--grain),
    linear-gradient(180deg, #e9decd 0%, #ece2d7 35%, #e8ddcf 100%);
}

.app {
  position: relative;
  max-width: min(1520px, calc(100vw - 32px));
  margin: 18px auto;
  border-radius: 30px;
  overflow: clip;
  background:
    linear-gradient(180deg, rgba(255,255,255,.52), rgba(255,255,255,.18)) top/100% 120px no-repeat,
    var(--grain),
    linear-gradient(180deg, #fbf6ee 0%, #f5ecdf 100%);
  border: 1px solid rgba(120, 88, 60, 0.1);
  box-shadow:
    0 34px 80px rgba(72, 48, 33, 0.12),
    0 8px 22px rgba(72, 48, 33, 0.08);
}

.content {
  padding: 36px clamp(18px, 4vw, 72px) 84px;
}

.top {
  height: 82px;
  padding: 0 clamp(18px, 4vw, 72px);
  background: rgba(251, 245, 236, 0.88);
  border-bottom: 1px solid rgba(140, 107, 76, 0.12);
  box-shadow: 0 10px 28px rgba(73, 49, 35, 0.06);
}

.top::after {
  content: '';
  position: absolute;
  left: clamp(18px, 4vw, 72px);
  right: clamp(18px, 4vw, 72px);
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(127, 88, 61, .18), transparent);
}

.brand {
  font-size: 42px;
  letter-spacing: -.02em;
}

.top-nav {
  gap: 10px;
}

.top-nav a {
  font-size: 14px;
  padding: 11px 16px;
  border: 1px solid transparent;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.top-nav a:hover {
  background: rgba(243, 229, 210, 0.82);
  border-color: rgba(173, 136, 104, 0.16);
  transform: translateY(-1px);
}

.top-nav a.active {
  background: linear-gradient(180deg, #f7ebd7, #ecdac0);
  border-color: rgba(166, 126, 92, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

.avatar {
  background: linear-gradient(180deg, #f3e2c9, #ebd3b3);
  border: 1px solid rgba(154, 117, 82, 0.15);
  box-shadow: 0 6px 14px rgba(77, 51, 34, 0.08);
}

.avatar.active {
  box-shadow: 0 0 0 2px rgba(111, 75, 61, .22), 0 8px 18px rgba(77, 51, 34, 0.08);
}

.btn, .icon-btn, .btn-secondary {
  border-color: rgba(162, 130, 101, .24);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248, 241, 231, .96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 4px 10px rgba(88, 58, 40, .05);
}

.btn:hover, .icon-btn:hover, .btn-secondary:hover {
  background: linear-gradient(180deg, #ffffff, #fbf4ea);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 10px 18px rgba(88, 58, 40, .08);
}

.btn-primary {
  background: linear-gradient(180deg, #7f5a49, #6a4738);
  border-color: #6d4a3b;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 10px 18px rgba(82, 53, 41, .18);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #8a6352, #714b3c);
  border-color: #6d4a3b;
}

.btn-soft {
  background: linear-gradient(180deg, #f8ecd9, #efdec2);
  border-color: rgba(182, 151, 117, .32);
}

.btn-danger {
  box-shadow: 0 10px 18px rgba(148, 65, 75, .18);
}

.card,
.notice,
.dialog,
.menu-list,
.timer,
.shop-group,
.pb-page,
.magazine,
.cook-card {
  background: linear-gradient(180deg, rgba(255,255,255,.84), rgba(255,250,242,.96));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.card {
  border-radius: 22px;
  border-color: rgba(157, 120, 88, .18);
  box-shadow: var(--shadow-sm);
}

.section-title {
  position: relative;
  align-items: center;
  gap: 14px;
}

.section-title::after {
  content: '';
  flex: 1;
  min-width: 80px;
  height: 1px;
  background: linear-gradient(90deg, rgba(185, 151, 120, .4), rgba(185, 151, 120, .08) 70%, transparent);
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .78fr);
  gap: clamp(24px, 4vw, 42px);
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 44px);
  margin-bottom: 30px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.55), transparent 26%),
    radial-gradient(circle at 18% 80%, rgba(244, 216, 204, .42), transparent 26%),
    linear-gradient(135deg, rgba(255,252,247,.98), rgba(246,235,223,.96));
  border: 1px solid rgba(164, 128, 97, 0.16);
  box-shadow: 0 22px 50px rgba(78, 54, 40, 0.1), inset 0 1px 0 rgba(255,255,255,.72);
}

.hero-shell::before,
.hero-shell::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-shell::before {
  right: -120px;
  top: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(216, 173, 160, .22), transparent 68%);
}

.hero-shell::after {
  left: -120px;
  bottom: -140px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(236, 210, 169, .22), transparent 70%);
}

.hero-copy,
.hero-deco {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(48px, 6vw, 68px);
  letter-spacing: -.03em;
}

.hero .lead {
  font-size: 18px;
  max-width: 48ch;
  margin-bottom: 20px;
}

.hero-search {
  max-width: 520px;
}

.hero-search input {
  min-height: 56px;
  padding-left: 48px;
  border-radius: 999px;
  border: 1px solid rgba(160, 123, 92, 0.18);
  background: rgba(255,255,255,.78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 8px 22px rgba(87, 56, 38, .06);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 640px;
  margin-top: 18px;
}

.hero-stat {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(161, 126, 97, .14);
  background: rgba(255,255,255,.54);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.hero-stat strong {
  display: block;
  font: 600 28px/1 var(--font-book);
  color: var(--ink);
}

.hero-stat span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.hero-deco {
  display: grid;
  justify-items: end;
  padding: 10px 8px 10px 20px;
}

.hero-deco .paper-note {
  max-width: 320px;
  padding: 24px 28px;
  border-radius: 18px;
  transform: rotate(2.5deg);
  background: linear-gradient(180deg, rgba(248, 235, 209, .98), rgba(238, 219, 183, .98));
  box-shadow: 0 16px 34px rgba(77, 57, 36, 0.14);
}

.hero-doodle {
  left: -52px;
  bottom: -20px;
  width: 116px;
  opacity: .4;
}

.notice {
  border-radius: 22px;
  border-color: rgba(161, 129, 94, .18);
  box-shadow: var(--shadow-sm);
}

.shelf {
  position: relative;
  margin-top: 8px;
  padding: 24px 14px 12px;
  border-radius: 24px;
  border: 1px solid rgba(162, 129, 99, .16);
  background:
    linear-gradient(180deg, rgba(255,255,255,.46), rgba(255,255,255,0)) top/100% 58px no-repeat,
    linear-gradient(180deg, rgba(255,248,239,.7), rgba(245,236,224,.5));
  box-shadow: var(--shadow-sm);
}

.shelf::before {
  content: 'Коллекция книг';
  position: absolute;
  left: 18px;
  top: 10px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(111, 75, 61, .75);
}

.shelf-book .cover {
  transition: transform .26s ease, filter .26s ease;
}

.shelf-book:hover .cover,
.shelf-book:focus-visible .cover {
  filter: drop-shadow(0 14px 18px rgba(73, 54, 43, .22));
}

.recipe-card {
  padding: 10px 10px 14px;
  border-radius: 20px;
  border: 1px solid rgba(162, 129, 99, .14);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(252, 246, 238, .96));
  box-shadow: 0 12px 30px rgba(86, 59, 42, .08), 0 2px 8px rgba(86, 59, 42, .05);
}

.recipe-card:hover,
.recipe-card:focus-visible {
  box-shadow: 0 18px 34px rgba(86, 59, 42, .12), 0 6px 14px rgba(86, 59, 42, .07);
}

.recipe-card .photo {
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(88, 61, 43, .12);
}

.recipe-card strong {
  margin-top: 12px;
  font-size: 16px;
}

.recipe-card small {
  margin-top: 4px;
}

.book-layout {
  gap: 34px;
}

.book-aside {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.52), rgba(252, 247, 240, .8));
  border: 1px solid rgba(160, 126, 96, .12);
  box-shadow: var(--shadow-sm);
}

.tabs {
  gap: 8px;
  padding-bottom: 8px;
  border-bottom-color: rgba(161, 128, 96, .18);
}

.tab {
  border: 1px solid rgba(161, 128, 96, .18);
  border-radius: 999px;
  min-height: 44px;
  padding-inline: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(246,236,223,.96));
  margin-bottom: 0;
}

.tab.active {
  background: linear-gradient(180deg, #f4e4cf, #ead8bf);
  box-shadow: 0 8px 18px rgba(95, 67, 46, .08);
}

.spread {
  max-width: 1220px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(163, 131, 102, .1), rgba(163, 131, 102, .02));
  box-shadow: 0 26px 58px rgba(81, 57, 39, .14);
}

.spread::after {
  width: 44px;
  background: linear-gradient(90deg, transparent, rgba(90, 65, 47, .08) 35%, rgba(90, 65, 47, .22) 50%, rgba(90, 65, 47, .08) 65%, transparent);
}

.page {
  background-color: #fcf5e8;
  background-image:
    radial-gradient(circle at top right, rgba(255,255,255,.28), transparent 26%),
    var(--grain),
    repeating-linear-gradient(transparent 0 31px, rgba(158, 144, 117, 0.15) 31px 32px);
  border-color: rgba(160, 126, 96, .18);
}

.polaroid {
  border-radius: 6px;
  box-shadow: 0 16px 28px rgba(79, 55, 37, .18);
}

.scribble {
  border-radius: 12px;
  box-shadow: 0 12px 20px rgba(83, 59, 40, .08);
}

.menu-list {
  border-radius: 18px;
  border-color: rgba(161, 128, 96, .18);
  box-shadow: var(--shadow);
}

.field input:not([type="radio"]):not([type="checkbox"]):not([type="range"]),
.field textarea,
.field select,
.search-bar input,
.search-bar select,
.dialog select {
  border: 1px solid rgba(160, 126, 96, .18);
  border-radius: 14px;
  background: rgba(255,255,255,.84);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.72);
}

.dialog {
  border-radius: 24px;
  border-color: rgba(160, 126, 96, .16);
}

.journal-teaser {
  border-radius: 22px;
  padding: 18px 22px;
  background: radial-gradient(circle at top right, rgba(255,255,255,.46), transparent 28%), var(--grain), linear-gradient(100deg, #f3dfd2, #f8eddc);
  border-color: rgba(165, 127, 96, .14);
  box-shadow: var(--shadow-sm);
}

.cook-card,
.shop-group,
.pb-page,
.magazine {
  border: 1px solid rgba(160, 126, 96, .14);
  box-shadow: var(--shadow-sm);
}

.foot {
  padding: 26px 16px 32px;
  color: rgba(111, 97, 87, .92);
}

.mobile-nav {
  background: rgba(255, 248, 238, 0.9);
}

@media (max-width: 900px) {
  .app {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
  }

  .top {
    height: 68px;
  }

  .content {
    padding-top: 22px;
  }

  .hero-shell {
    padding: 22px 18px;
    gap: 18px;
    border-radius: 24px;
  }

  .hero-search input {
    min-height: 52px;
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-stat {
    padding: 12px;
    border-radius: 16px;
  }

  .hero-stat strong {
    font-size: 22px;
  }

  .book-aside {
    padding: 14px;
  }
}

@media (max-width: 520px) {
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }

  .hero-stat strong {
    font-size: 20px;
  }

  .hero-stat span {
    font-size: 11px;
  }
}


/* ---------- v0.9: premium book covers & workshop ---------- */

.cover {
  --cover-title-default: #f8efdd;
  --cover-accent: rgba(255, 244, 224, .58);
  border-radius: 7px 18px 18px 7px;
  box-shadow:
    inset 10px 0 16px -6px rgba(27, 16, 12, .42),
    inset -1px 0 0 rgba(255,255,255,.36),
    0 14px 22px rgba(73, 54, 43, .18);
}

.cover::before {
  inset: 4.6% 6.5% 4.6% 10%;
  border: 1px solid rgba(255, 244, 224, .26);
  border-radius: 5px 14px 14px 5px;
}

.cover::after {
  background:
    linear-gradient(90deg, rgba(0,0,0,.2) 0, rgba(0,0,0,.06) 4%, rgba(255,255,255,.12) 5.4%, transparent 7.2%),
    linear-gradient(180deg, rgba(255,255,255,.12), transparent 22%, transparent 74%, rgba(0,0,0,.1)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.04) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.03) 0 1px, transparent 1px 5px),
    var(--grain);
}

.cover-ornament {
  position: absolute;
  inset: 10% 14% 12%;
  z-index: 1;
  border-radius: 12px;
  border: 1px solid rgba(255, 246, 232, .18);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
  opacity: .9;
  pointer-events: none;
}

.cover-title-wrap {
  position: absolute;
  z-index: 5;
  left: 14%;
  right: 14%;
  top: 16%;
  padding: 12% 10% 9%;
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255,251,243,.22), rgba(255,247,234,.08));
  border: 1px solid rgba(255, 244, 224, .18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  pointer-events: none;
}

.cover-kicker {
  display: inline-block;
  margin-bottom: 7%;
  font-size: 4.1cqw;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--cover-title, var(--cover-title-default)) 72%, white 28%);
  opacity: .95;
}

.cover-title {
  position: static;
  display: block;
  font: 12.2cqw/1.02 var(--font-book);
  font-style: italic;
  color: var(--cover-title, var(--cover-title-default));
  text-shadow: 0 2px 6px rgba(29, 18, 13, .18);
  letter-spacing: -.03em;
}

.cover-sub {
  position: static;
  display: block;
  margin-top: 8%;
  font-size: 5cqw;
  font-weight: 600;
  color: color-mix(in srgb, var(--cover-title, var(--cover-title-default)) 78%, white 22%);
  opacity: .9;
  text-shadow: none;
}

.cover-layers {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.cover-layer {
  filter: drop-shadow(0 7px 8px rgba(28, 18, 12, .18));
}

.cover-edit .cover-layer.selected {
  outline: 2px dashed rgba(255,255,255,.88);
  outline-offset: 3px;
  filter: drop-shadow(0 0 6px rgba(0,0,0,.34));
}

.cover-tag {
  padding: 8% 11% 8% 16%;
  background: linear-gradient(180deg, rgba(252,244,231,.98), rgba(241,228,205,.96));
  color: #4d382d;
  border-radius: 5px 10px 10px 5px;
  box-shadow: 0 10px 16px rgba(39, 27, 20, .14), inset 0 1px 0 rgba(255,255,255,.75);
  font: calc(var(--s, 40) * .12cqw)/1.14 var(--font-book);
  font-style: italic;
  letter-spacing: -.01em;
}

.cover-tag::before {
  width: 3cqw;
  height: 3cqw;
  background: #dac7ad;
}

.craft-svg {
  filter: drop-shadow(.6px 1.2px 1.1px rgba(31, 20, 14, .34));
}

.layout-classic .cover-title-wrap {
  top: 13%;
  left: 15%;
  right: 15%;
}

.layout-classic .cover-ornament {
  inset: 10% 14% 12%;
}

.layout-medallion .cover-ornament {
  inset: 19% 23% 28%;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 24%, rgba(255,255,255,.16), transparent 40%);
  border: 1.4px solid rgba(255, 245, 228, .22);
}

.layout-medallion .cover-title-wrap {
  top: auto;
  bottom: 10%;
  left: 17%;
  right: 17%;
  padding: 8% 8% 7%;
  background: transparent;
  border-color: rgba(255,255,255,.08);
  box-shadow: none;
}

.layout-medallion .cover-kicker {
  opacity: .78;
}

.layout-frame .cover-ornament {
  inset: 9% 11% 10%;
  border-style: double;
  border-width: 3px;
}

.layout-frame .cover-title-wrap {
  top: 16%;
  left: 19%;
  right: 19%;
  padding-top: 11%;
}

.layout-band .cover-ornament {
  inset: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, transparent 0 48%, rgba(31, 18, 13, .18) 48% 72%, transparent 72% 100%);
  opacity: 1;
}

.layout-band .cover-title-wrap {
  top: 48%;
  left: 9%;
  right: 9%;
  padding: 7% 8% 7%;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255,250,241,.92), rgba(249,240,225,.86));
  color: #3d2d25;
}

.layout-band .cover-kicker,
.layout-band .cover-title,
.layout-band .cover-sub {
  color: #3d2d25;
  text-shadow: none;
}

.layout-label .cover-ornament {
  inset: 12% 12% 13%;
  border: 0;
  background:
    radial-gradient(circle at center, transparent 0 35%, rgba(255,255,255,.08) 35% 36%, transparent 36%),
    linear-gradient(180deg, transparent 0 18%, rgba(255,255,255,.08) 18% 19%, transparent 19% 81%, rgba(255,255,255,.08) 81% 82%, transparent 82%);
}

.layout-label .cover-title-wrap {
  top: 34%;
  left: 18%;
  right: 18%;
  padding: 10% 8% 8%;
  background: linear-gradient(180deg, rgba(250,244,234,.96), rgba(240,228,209,.95));
  box-shadow: 0 16px 22px rgba(48, 32, 24, .16), inset 0 1px 0 rgba(255,255,255,.75);
}

.layout-label .cover-title,
.layout-label .cover-kicker,
.layout-label .cover-sub {
  color: #423229;
  text-shadow: none;
}

.mat-brown {
  background:
    radial-gradient(circle at 18% 10%, rgba(255,255,255,.15), transparent 22%),
    linear-gradient(180deg, #745449, #61453c 54%, #583e35 100%);
}

.mat-green {
  background:
    radial-gradient(circle at 22% 14%, rgba(255,255,255,.14), transparent 22%),
    linear-gradient(180deg, #718465, #5f7356 54%, #57684f 100%);
}

.mat-blue {
  background:
    radial-gradient(circle at 22% 14%, rgba(255,255,255,.18), transparent 22%),
    linear-gradient(180deg, #8aa3a2, #738d8d 54%, #667f80 100%);
}

.mat-pink {
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,.2), transparent 20%),
    linear-gradient(180deg, #f4dfd9, #eed1cb 100%);
}

.mat-berry {
  background:
    radial-gradient(circle at 20% 12%, rgba(255,255,255,.12), transparent 22%),
    linear-gradient(180deg, #873c4a, #742f3c 58%, #682734 100%);
}

.mat-cream {
  --cover-title-default: #4a362d;
  background:
    radial-gradient(circle at 20% 14%, rgba(255,255,255,.34), transparent 22%),
    linear-gradient(180deg, #eadfcb, #e3d4bc 100%);
}

.mat-kraft {
  --cover-title-default: #3f2e25;
  background:
    radial-gradient(circle at 16% 10%, rgba(255,255,255,.14), transparent 18%),
    linear-gradient(180deg, #c8a982, #b9966f 100%);
}

.mat-floral {
  --cover-title-default: #583238;
  background:
    radial-gradient(circle at 18% 14%, rgba(255,255,255,.22), transparent 18%),
    linear-gradient(180deg, #f5ede1, #ece2d0 100%);
}

.mat-pink::before,
.mat-floral::before,
.mat-cream::before,
.mat-kraft::before {
  border-color: rgba(93, 70, 55, .22);
}

.mat-pink .cover-title,
.mat-cream .cover-title,
.mat-kraft .cover-title,
.mat-floral .cover-title,
.mat-pink .cover-kicker,
.mat-cream .cover-kicker,
.mat-kraft .cover-kicker,
.mat-floral .cover-kicker,
.mat-pink .cover-sub,
.mat-cream .cover-sub,
.mat-kraft .cover-sub,
.mat-floral .cover-sub {
  text-shadow: none;
}

.swatches {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.swatch {
  align-content: start;
  gap: 6px;
}

.swatch .cover {
  min-height: 120px;
}

.layout-picks,
.preset-grid {
  display: grid;
  gap: 10px;
}

.layout-picks {
  grid-template-columns: 1fr;
}

.layout-chip,
.preset-card {
  display: grid;
  justify-items: start;
  gap: 2px;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid rgba(160, 126, 96, .18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,239,228,.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 6px 14px rgba(81, 57, 40, .05);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.layout-chip:hover,
.preset-card:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 10px 18px rgba(81, 57, 40, .08);
}

.layout-chip b,
.preset-card b {
  font: 600 14px var(--font-book);
}

.layout-chip small,
.preset-card small {
  color: var(--muted);
  font-size: 12px;
}

.layout-chip.active,
.layout-chip[aria-pressed="true"] {
  border-color: rgba(109, 74, 59, .32);
  background: linear-gradient(180deg, #f5e7d5, #ecd9c0);
}

.preset-grid {
  grid-template-columns: 1fr 1fr;
}

.ws-stage {
  padding: 34px 18px 26px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,.42), transparent 28%),
    var(--grain),
    linear-gradient(180deg, #e8dbc8 0%, #efe6da 100%);
  border: 1px solid rgba(160, 126, 96, .14);
  box-shadow: var(--shadow-sm);
}

#wsCanvas {
  width: min(390px, 82vw);
}

#wsCanvas .cover {
  width: 100%;
}

.shelf-preview {
  gap: 14px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.5);
  border: 1px solid rgba(160, 126, 96, .12);
}

#wsMini {
  width: 72px;
}

.decors {
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 10px;
}

.decors button {
  padding: 10px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(249,243,235,.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 6px 14px rgba(80, 56, 39, .06);
}

.decors button:hover {
  transform: translateY(-2px);
  border-color: rgba(144, 107, 77, .28);
}

.ws-props {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(160, 126, 96, .14);
}

@media (max-width: 900px) {
  .swatches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .preset-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Адаптив ---------- */

@media (max-width: 1180px) {
  .workshop { grid-template-columns: 1fr 1fr; }
  .ws-stage { grid-column: 1 / -1; order: -1; }
  .editor { grid-template-columns: minmax(0, 1fr) 300px; }
}

@media (max-width: 900px) {
  :root { --header-h: 60px; }
  .top-nav, .hide-sm { display: none !important; }
  .brand { font-size: 34px; }
  .content { padding: 20px 16px 120px; }
  .foot { padding-bottom: 110px; }
  .hero { display: block; }
  .paper-note { display: none; }
  .section-title { font-size: 22px; margin-top: 32px; }
  .shelf-book { width: 122px; }
  .shelf { gap: 18px; }
  .recipes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .recipe-card strong { font-size: 14px; }

  .book-layout { grid-template-columns: 1fr; gap: 20px; }
  .book-aside { position: static; grid-template-columns: 130px 1fr; align-items: start; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tab { flex: none; }

  .recipe-actions .btn { flex: 1 1 auto; }
  .recipe-actions .menu { flex: none; }
  .jump { display: flex; gap: 6px; position: sticky; top: calc(var(--header-h) + 6px); z-index: 10; margin: 0 -4px 14px; padding: 4px; background: #f7f0e3ee; border-radius: 999px; border: 1px solid var(--border); backdrop-filter: blur(6px); }
  .jump a { flex: 1; text-align: center; padding: 8px 6px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 13px; color: var(--cocoa-dark); min-height: 38px; }
  .jump a:active { background: #ead9bf; }
  .spread { grid-template-columns: 1fr; box-shadow: var(--shadow); }
  .spread::after { display: none; }
  .page { min-height: 0; padding: 26px 20px 30px; }
  .page-left { border-radius: 12px 12px 0 0; border-bottom: 0; }
  .page-right { border-radius: 0 0 12px 12px; }
  .polaroid { width: 92%; }
  .scribble { margin-right: 6px; }

  .cook-body { grid-template-columns: 1fr; }
  .cook-card { min-height: 220px; }
  .cook-nav { bottom: 84px; }
  .cook-nav .btn { padding: 12px 16px; }

  .editor { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .editor-save { position: sticky; bottom: 76px; z-index: 5; box-shadow: var(--shadow); }
  .editor-save .btn-ghost, .editor-save p { display: none; }
  .editor-save { grid-template-columns: 1fr 1fr; padding: 10px; }

  .workshop { grid-template-columns: 1fr; }
  .search-bar { grid-template-columns: 1fr 1fr; }
  .search-bar > input, .search-bar > .icon { grid-column: 1 / -1; }
  .search-bar > .icon { top: 24px; }
  .inspo { grid-template-columns: 1fr; }

  .mobile-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: #fff9f0f2; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--border);
    padding: 6px 4px max(8px, env(safe-area-inset-bottom));
  }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 52px; justify-content: center; text-decoration: none; color: var(--muted); }
  .mobile-nav small { font-size: 10.5px; font-weight: 600; }
  .mobile-nav a.active { color: var(--cocoa-dark); }
  .mobile-nav a.active .icon { stroke-width: 2.3; }
  .mobile-add span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--cocoa); color: #fff; box-shadow: 0 4px 12px #5d413666; margin-top: -18px; }
  .mobile-add .icon { width: 26px; height: 26px; stroke-width: 2.2; }
  .toasts { bottom: 92px; }
  .timers { bottom: 84px; right: 12px; }
  body[data-page="cook"] .timers, body[data-page="edit"] .timers, body[data-page="new"] .timers, body[data-page="workshop"] .timers { bottom: 160px; }
}

@media (max-width: 900px) {
  .show-sm { display: block; }
  .hide-sm.center { display: none; }
  .recipe-actions { display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, 46px); gap: 6px; }
  .recipe-actions .btn-primary { grid-column: 1; min-width: 0; padding: 10px 12px; }
  .recipe-actions .btn-secondary { padding: 0; width: 46px; min-height: 46px; }
  .recipe-actions .menu summary { width: 46px; padding: 0; }
  .recipe-actions .lbl { display: none; }
  .edge-tabs, .hero-deco, .doodle-right { display: none; }
  .ribbon { left: auto; right: 18px; height: 70px; }
  .cook-num { font-size: 38px; }
  .book-tools { gap: 10px; }
  .book-tools .btn-primary { flex: 1; }
  .shop-list { grid-template-columns: 1fr; }
  .avatar { width: 40px; height: 40px; }
}

@media (max-width: 900px) {
  .mag-cover { min-height: 380px; }
  .mag-logo { font-size: 72px; top: 18px; }
  .pb-cols { grid-template-columns: 1fr; }
  .pb-cover { min-height: 600px; }
  .journal-nav .btn-ghost { padding: 10px; }
  .roulette-form { grid-template-columns: 1fr; }
}

@media (max-width: 1240px) and (min-width: 901px) {
  .edge-tabs { right: -26px; }
  .edge-tabs a { font-size: 11.5px; }
}

@media (max-width: 420px) {
  .hide-xs { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .grid-3 .field > span { font-size: 12px; }
  .recipe-title { font-size: 42px; }
  .stepper output { min-width: 70px; }
  .swatches { grid-template-columns: repeat(4, 1fr); }
  .step-row { grid-template-columns: 28px minmax(0, 1fr); }
  .step-tools { grid-column: 2; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Печать рецепта ---------- */

@media print {
  @page { margin: 14mm; }
  body, .app { background: #fff !important; box-shadow: none; }
  .top, .mobile-nav, .foot, .recipe-actions, .jump, .crumb, .timers, .toasts, .skip-link, .edge-tabs, .ribbon, .doodle, .ing-tools, .scaler .seg, .scaler .icon-btn, .cook-log .btn, #notesStatus, .link { display: none !important; }
  .content { padding: 0; }
  .spread { display: block; box-shadow: none; }
  .spread::after { display: none; }
  .page { min-height: 0; border: 0; padding: 0; background: none; }
  .polaroid { transform: none; box-shadow: none; width: 55%; margin: 10px 0; padding: 0; }
  .polaroid::before, .scribble { box-shadow: none; }
  .scribble { transform: none; background: none; padding: 0; margin: 0 0 12px; }
  .timer-chip { border: 0; background: none; padding: 0; font: inherit; }
  .timer-chip .icon { display: none; }
  .check .box { border-color: #555; }
  .margin-notes textarea { border: 0; font-size: 18px; resize: none; }
  .steps li { break-inside: avoid; }
  .no-print, .journal-nav { display: none !important; }
  .pb-page { box-shadow: none; width: auto; min-height: 0; padding: 0; break-after: page; background: none; }
  .pb-cover { min-height: 90vh; }
  .printbook { display: block; }
  .magazine { box-shadow: none; max-width: none; }
  .mag-item { box-shadow: 0 0 0 1px #ddd; }
  .view-enter { animation: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}


/* ---------- v1.2: maximum visual pass ---------- */
.eyebrow {
  margin: 0 0 10px;
  font: 800 11px/1.2 var(--font-ui);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--cocoa) 78%, white 22%);
}

.library-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(250px, .8fr);
  gap: 22px;
  align-items: start;
  margin: 12px 0 18px;
  padding: 26px 28px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.52), transparent 28%),
    linear-gradient(135deg, rgba(255,250,243,.98), rgba(244,232,216,.96));
  border: 1px solid rgba(147, 110, 79, .15);
  box-shadow: 0 16px 34px rgba(74, 52, 37, .07);
}

.library-banner .section-title { margin: 4px 0 10px; }
.library-banner .lead { margin-bottom: 10px; }
.library-note {
  margin: 0;
  font: italic 16px/1.5 var(--font-book);
  color: var(--muted);
}

.library-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.library-metrics div {
  min-height: 92px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: rgba(255, 253, 249, .88);
  border: 1px solid rgba(147, 110, 79, .12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.library-metrics strong {
  font: 600 clamp(22px, 2.2vw, 30px)/1 var(--font-book);
  color: var(--ink);
}

.library-metrics span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.shelf {
  position: relative;
  margin-top: 14px;
  padding-bottom: 20px;
}

.shelf::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(121,84,61,.16), rgba(121,84,61,.06));
  pointer-events: none;
}

.shelf-book {
  padding-bottom: 22px;
}

.shelf-book .book-ribbon {
  box-shadow: 0 8px 14px rgba(72, 42, 31, .18);
}

.recipe-card {
  display: grid;
  align-content: start;
  gap: 0;
  padding-bottom: 14px;
}

.recipe-card .kicker {
  display: block;
  margin: 12px 2px 3px;
  font: 800 10px/1.2 var(--font-ui);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--cocoa) 74%, white 26%);
}

.recipe-card strong {
  margin-top: 6px;
}

.recipe-card .card-meta {
  display: block;
  margin-top: 4px;
}

.recipe-card .card-note {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.9em;
}

.recipe-card .card-note-empty {
  visibility: hidden;
}

.book-header {
  margin-bottom: 18px;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(255,250,243,.98), rgba(245,234,219,.95));
  border: 1px solid rgba(147, 110, 79, .13);
  box-shadow: 0 16px 32px rgba(74, 52, 37, .06);
}

.book-header .page-title {
  margin-bottom: 8px;
}

.book-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.book-meta-pills span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(147, 110, 79, .12);
  font-size: 13px;
  font-weight: 600;
  color: var(--cocoa-dark);
}

.recipe-kicker {
  margin: 12px 0 8px;
  font: 800 11px/1.2 var(--font-ui);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--cocoa) 70%, white 30%);
}

.facts {
  gap: 10px 12px;
  margin-bottom: 16px;
}

.facts li {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 251, 245, .8);
  border: 1px solid rgba(160, 126, 96, .12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.polaroid {
  box-shadow: 0 18px 28px rgba(82, 57, 28, .18);
}

.scribble {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 249, 240, .84);
  border: 1px solid rgba(160, 126, 96, .13);
}

.page-left .tips,
.page-left .source {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 250, 244, .86);
  border: 1px solid rgba(160, 126, 96, .13);
}

.recipe-panel {
  margin-top: 16px;
  padding: 20px 22px;
  border-radius: 22px;
  background: rgba(255, 252, 248, .92);
  border: 1px solid rgba(160, 126, 96, .14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 8px 18px rgba(80, 56, 40, .04);
}

.recipe-panel:first-child {
  margin-top: 0;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.ingredients li {
  padding: 5px 0;
}

.steps li {
  margin-bottom: 18px;
}

.steps li::before {
  box-shadow: 0 6px 12px rgba(128, 78, 70, .12);
}

.margin-notes textarea {
  background: rgba(255,255,255,.85);
  border-color: rgba(160, 126, 96, .18);
}

.discover-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.5), transparent 26%),
    linear-gradient(135deg, rgba(246,231,224,.98), rgba(245,239,228,.98));
  border: 1px solid rgba(150, 116, 88, .16);
  box-shadow: 0 16px 34px rgba(74, 52, 37, .07);
}

.discover-quote {
  padding: 20px 22px;
  border-radius: 22px;
  background: rgba(255, 252, 247, .82);
  border: 1px solid rgba(150, 116, 88, .12);
  font: italic clamp(20px, 2.6vw, 28px)/1.22 var(--font-book);
  color: var(--cocoa-dark);
}

.inspo > .card,
.roulette {
  padding: 24px;
  border-radius: 24px;
}

.pick-card .recipe-card {
  margin-top: 12px;
}

.journal-teaser {
  margin-top: 22px;
  padding: 18px 22px;
  border: 1px solid rgba(150, 116, 88, .16);
  box-shadow: 0 14px 24px rgba(74, 52, 37, .06);
}

@media (max-width: 960px) {
  .library-banner,
  .discover-hero {
    grid-template-columns: 1fr;
  }

  .library-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .library-banner,
  .book-header,
  .discover-hero,
  .inspo > .card,
  .roulette {
    padding: 18px;
  }

  .library-metrics {
    grid-template-columns: 1fr;
  }

  .recipe-card .card-note {
    -webkit-line-clamp: 2;
    min-height: 2.8em;
  }

  .recipe-panel {
    padding: 16px;
    border-radius: 18px;
  }

  .section-head {
    display: block;
  }

  .discover-quote {
    font-size: 20px;
  }
}


/* ---------- v1.3 premium editorial pass ---------- */
.magazine {
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(180deg, #fffdfa, #fff9f1);
  box-shadow: 0 18px 40px rgba(74, 52, 37, .08);
  border: 1px solid rgba(146, 112, 84, .12);
}

.mag-cover {
  min-height: 520px;
}

.mag-cover > .photo img {
  filter: saturate(.94) contrast(1.02);
}

.mag-masthead {
  max-width: 760px;
}

.mag-title {
  text-wrap: balance;
}

.mag-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  gap: 20px;
  padding: 24px clamp(18px, 4vw, 48px) 6px;
}

.mag-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mag-stat {
  min-height: 130px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(252,246,239,.92));
  border: 1px solid rgba(146, 112, 84, .12);
}

.mag-stat small,
.mag-note-kicker,
.pb-section-label {
  font: 800 11px/1.2 var(--font-ui);
  text-transform: uppercase;
  letter-spacing: .18em;
  color: color-mix(in srgb, var(--cocoa) 76%, white 24%);
}

.mag-stat strong {
  font: 600 clamp(28px, 3vw, 40px)/1 var(--font-book);
  color: var(--ink);
}

.mag-stat span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.mag-note-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(244,231,225,.95), rgba(253,248,241,.95));
  border: 1px solid rgba(146, 112, 84, .14);
}

.mag-note-card blockquote {
  margin: 0;
  font: italic clamp(20px, 2.5vw, 30px)/1.24 var(--font-book);
  color: var(--cocoa-dark);
}

.mag-note-meta,
.mag-feature-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.mag-feature {
  padding-top: 28px;
}

.mag-feature-meta .hearts {
  transform: translateY(1px);
}

.mag-grid {
  padding-top: 26px;
}

.mag-item {
  border-radius: 4px;
  box-shadow: 0 10px 22px rgba(74, 52, 37, .12);
}

.mag-item .photo {
  border-radius: 2px;
  overflow: hidden;
}

.mag-item figcaption {
  gap: 5px;
}

.mag-item a {
  line-height: 1.28;
}

.mag-new {
  padding-bottom: 30px;
}

.mag-new h2 {
  margin-bottom: 14px;
}

.pb-toolbar {
  margin-bottom: 18px;
}

.printbook {
  gap: 30px;
}

.pb-page {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(141, 110, 85, .10);
  box-shadow: 0 14px 28px rgba(74, 52, 37, .07);
  overflow: hidden;
}

.pb-page::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.24), transparent 12%, transparent 88%, rgba(208,190,170,.14));
}

.pb-cover {
  background: radial-gradient(circle at top, rgba(255,255,255,.55), transparent 24%), var(--grain), #fbf3e4;
}

.pb-cover h1 {
  text-wrap: balance;
}

.pb-cover-note {
  max-width: 42ch;
  margin: 14px auto 0;
  font: italic 20px/1.5 var(--font-book);
  color: var(--cocoa-dark);
}

.pb-cover-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.pb-cover-stats span {
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(141, 110, 85, .12);
  font-size: 13px;
  font-weight: 600;
}

.pb-toc {
  background: linear-gradient(180deg, rgba(255,252,247,.98), rgba(252,246,237,.98));
}

.pb-toc h2,
.pb-divider h2 {
  margin-top: 6px;
  font: 400 clamp(40px, 4vw, 54px)/1.04 var(--font-hand);
}

.pb-toc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 18px;
}

.pb-toc-group {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.74);
  border: 1px solid rgba(141, 110, 85, .10);
}

.pb-toc-group h3 {
  margin: 0 0 10px;
  font: 600 22px/1.15 var(--font-book);
}

.pb-toc-group ol {
  margin: 0;
  padding-left: 18px;
}

.pb-toc-group li {
  margin: 0 0 8px;
}

.pb-divider {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 360px;
  background: linear-gradient(135deg, rgba(247,237,225,.98), rgba(255,250,243,.98));
}

.pb-recipe-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 24px;
  align-items: start;
  margin-bottom: 18px;
}

.pb-recipe-head.no-photo {
  grid-template-columns: 1fr;
}

.pb-recipe-copy h2 {
  margin-bottom: 8px;
  text-wrap: balance;
}

.pb-photo-hero {
  width: 100%;
  margin: 0;
}

.pb-photo-hero .photo {
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(74, 52, 37, .10);
}

.pb-cols {
  padding-top: 16px;
  border-top: 1px solid rgba(141, 110, 85, .14);
}

.pb-cols > div:first-child {
  padding: 18px;
  border-radius: 18px;
  background: rgba(252,246,239,.88);
  border: 1px solid rgba(141, 110, 85, .10);
}

.pb-cols > div:last-child {
  padding-right: 6px;
}

.pb-steps li {
  margin-bottom: 10px;
  line-height: 1.55;
}

.pb-callout {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(252,246,239,.86);
  border: 1px solid rgba(141, 110, 85, .10);
}

.pb-notes {
  margin-top: 18px;
}

@media (max-width: 960px) {
  .mag-overview {
    grid-template-columns: 1fr;
  }

  .mag-overview-grid,
  .pb-toc-grid {
    grid-template-columns: 1fr;
  }

  .pb-recipe-head {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .mag-cover {
    min-height: 430px;
  }

  .mag-overview-grid {
    grid-template-columns: 1fr;
  }

  .mag-stat {
    min-height: 0;
  }

  .mag-note-card blockquote {
    font-size: 22px;
  }

  .pb-cover-note {
    font-size: 18px;
  }
}

@media print {
  .pb-page {
    border: 0;
    border-radius: 0;
  }

  .pb-page::before {
    display: none;
  }
}

/* Verified chef selection */
.chef-onion-banner { margin:20px 0; display:flex;gap:24px;justify-content:space-between;align-items:center;padding:23px 28px;border:1px solid #d5c4ac;border-radius:23px;background:linear-gradient(125deg,#fcf7ee,#ecdfc9);box-shadow:0 10px 24px rgba(70,50,33,.07); }
.chef-onion-banner h2 {font:italic 600 clamp(22px,2.5vw,32px)/1.13 var(--font-book);margin:4px 0 9px;color:var(--ink);}
.chef-onion-banner p:not(.eyebrow) {max-width:66ch;margin:0;color:var(--muted);line-height:1.55;font-size:14px;}
.chef-onion-banner .btn {white-space:nowrap;flex:none;}
@media(max-width:700px){.chef-onion-banner{padding:20px;display:grid;gap:16px}.chef-onion-banner .btn{white-space:normal;}}
