@font-face {
  font-family: 'Google Sans';
  src: url('/assets/google-sans-500.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f6f2e9;
  --ink: #142d25;
  --muted: #5c665d;
  --line: #c8c0b1;
  --green: #1c362b;
  --sage: #d0d9c3;
  --rust: #a83e24;
  --serif: 'Times New Roman', Georgia, serif;
  font: 100%/1.45 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse at 60% 15%, #faf7f0, var(--paper) 75%);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.1; margin: 0; letter-spacing: -.035em; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
button:disabled { cursor: default; opacity: .5; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.app { display: grid; grid-template-columns: 18.4% minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  min-width: 0; padding: clamp(1rem, 2.5vw, 2.4rem) clamp(.7rem, 1.1vw, 1.1rem);
  border-right: 1px solid #e3ddd0;
}
.brand { display: flex; align-items: center; gap: clamp(.35rem, .9vw, .85rem); margin: 0 0 clamp(1.4rem, 2.8vw, 2.7rem); padding: 0 .8rem; white-space: nowrap; }
.brand .icon { width: clamp(1.7rem, 3.35vw, 3.15rem); height: auto; color: #463722; }
.brand strong { font: bold clamp(1.13rem, 1.74vw, 1.72rem)/1 var(--serif); letter-spacing: -.055em; }
.nav { display: grid; gap: .22rem; }
.nav button {
  display: flex; align-items: center; text-align: left; gap: clamp(.45rem, 1.35vw, 1.32rem);
  border: 0; background: transparent; padding: .55rem clamp(.45rem, 1.1vw, 1.05rem); border-radius: .7rem;
  min-height: clamp(2.5rem, 3.3vw, 3.16rem); font-size: clamp(.9rem, 1.35vw, 1.33rem); letter-spacing: -.035em;
}
.nav button[aria-current="page"] { background: var(--sage); font-weight: 650; }
.nav button:hover { background: #e7e9dc; }
.sidebar hr { margin: clamp(1rem, 2vw, 2rem) .65rem clamp(.9rem, 1.5vw, 1.4rem); }
hr { border: 0; border-top: 1px solid var(--line); }
.nav-label { margin: 0 .75rem .8rem; font: bold clamp(.72rem, 1.05vw, 1rem)/1.2 var(--serif); letter-spacing: .13em; color: #62492d; }
.library { padding: clamp(1.1rem, 2vw, 2rem); min-width: 0; }
.library-header { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: clamp(1rem, 1.9vw, 1.8rem); }
h1 { font-size: clamp(2.1rem, 4.15vw, 4rem); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em; border: 1px solid #aaa18f;
  text-decoration: none; padding: .45em .95em; min-height: 2.55rem; border-radius: .55rem;
  background: transparent; font-weight: 600; white-space: nowrap; line-height: 1.25;
}
.button:hover { background: #e5e9da; }
.button.quiet { border-color: transparent; }
.primary { background: var(--green); color: #fffdf8; border-color: var(--green); }
.primary:hover { background: #304d3d; }
.accent { background: var(--rust); color: #fffdf8; border-color: var(--rust); }
.accent:hover { background: #8c331e; }
.library-header .button { min-height: 2.75rem; font-size: clamp(.9rem, 1.33vw, 1.3rem); padding: .55em 1em; }
.library-toolbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  border: 1px solid var(--line); border-radius: .55rem; background: #faf7ef;
}
.search {
  display: flex; align-items: center; gap: .65rem; padding: 0 clamp(.65rem, 1.4vw, 1rem);
  min-height: 2.85rem; min-width: 0; border-radius: .5rem 0 0 .5rem;
}
.search:focus-within { outline: 2px solid #789773; outline-offset: -2px; }
.search input { border: 0; background: transparent; width: 100%; min-width: 0; padding: .65rem 0; outline: none; }
.button.toolbar-add {
  border: 0; border-left: 1px solid var(--line); border-radius: 0 .5rem .5rem 0;
  padding-inline: clamp(.6rem, 1.7vw, 1.2rem); font-size: .95rem;
}
.button.toolbar-add:focus-visible { outline-offset: -3px; }
.filters { display: flex; flex-wrap: wrap; gap: .55rem .85rem; margin: clamp(.95rem, 1.75vw, 1.7rem) 0 clamp(1.25rem, 2.35vw, 2.25rem); }
.filter { border: 1px solid var(--line); border-radius: 99px; background: transparent; padding: .34em 1.25em; font-size: clamp(.9rem, 1.18vw, 1.15rem); }
.filter[aria-pressed="true"] { background: var(--rust); color: white; border-color: var(--rust); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); gap: clamp(.75rem, 1.3vw, 1.25rem); }
.card { border: 1px solid #d5cebf; border-radius: .9rem; overflow: hidden; position: relative; min-width: 0; }
.card-open { background: transparent; border: 0; display: block; text-align: left; width: 100%; padding: 0; }
.food { display: block; width: 100%; aspect-ratio: 1.4; object-fit: cover; }
.food.placeholder { display: grid; place-items: center; background: #e1e6d6; color: #65775e; font-size: 3rem; }
.card-copy { padding: .65rem .85rem .95rem; }
.card h2 { font-size: clamp(1.1rem, 1.8vw, 1.75rem); overflow-wrap: anywhere; margin: 0 0 .5rem; }
.card-meta, .metadata { display: flex; align-items: center; gap: .45rem; font-size: clamp(.85rem, 1.15vw, 1.13rem); }
.icon-button { display: inline-grid; place-items: center; color: inherit; width: 2.65rem; height: 2.65rem; border: 0; background: transparent; border-radius: .55rem; font-size: 1.3rem; }
.icon-button:hover { background: #e6e9dd; }
.favorite { position: absolute; right: .3rem; bottom: .45rem; }
.favorite[aria-pressed="true"] .icon { fill: var(--rust); stroke: var(--rust); }
.recipe-view {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; border-radius: 0; overflow: auto; overscroll-behavior: contain;
  background: var(--paper);
}
.recipe-shell { width: min(100%, 78rem); padding-inline: clamp(1rem, 4vw, 2.75rem); margin-inline: auto; }
.recipe-top { position: sticky; top: 0; z-index: 1; border-bottom: 1px solid var(--line); background: var(--paper); }
.recipe-top .recipe-shell { padding-block: .65rem; }
.recipe-page { padding-block: clamp(1.2rem, 3vw, 2.5rem) 3rem; }
.recipe-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(1.4rem, 4vw, 4rem); align-items: center; }
.recipe-hero .food { border-radius: .75rem; max-height: 27rem; }
.recipe-intro h1 { overflow-wrap: anywhere; margin-bottom: 1rem; }
.recipe-instructions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: clamp(1.2rem, 4vw, 4rem); margin-top: clamp(1.2rem, 3vw, 2.5rem); }
.recipe-page > .recipe-tools { margin-top: 1rem; }
.metadata { font-size: clamp(.94rem, 1.28vw, 1.22rem); flex-wrap: wrap; }
.metadata span { display: inline-flex; align-items: center; gap: .5em; }
.metadata span + span { border-left: 1px solid var(--line); padding-left: 1.25em; margin-left: .75em; }
.detail-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.detail-actions .button { font-size: clamp(.9rem, 1.25vw, 1.2rem); padding: .58em .85em; }
.detail-section { border-top: 1px solid var(--line); padding: 1.25rem 0; }
.detail-section h2 { font-size: clamp(1.4rem, 2.2vw, 2.1rem); margin-bottom: .85rem; }
.ingredients { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.ingredients label { display: flex; align-items: flex-start; gap: 1.1rem; font-size: clamp(1rem, 1.32vw, 1.26rem); }
.ingredients input { width: 1.4rem; height: 1.4rem; flex: none; margin: .16em 0 0 .2rem; accent-color: var(--green); }
.ingredients input:checked + span { text-decoration: line-through; color: var(--muted); }
.directions { padding-left: 1.5rem; margin-bottom: 0; }
.directions li + li { margin-top: .6rem; }
.recipe-tools { display: flex; flex-wrap: wrap; gap: .8rem; }
.empty { color: var(--muted); padding: .5rem 0; }
.books, .chapter-list { display: grid; gap: 1rem; }
.books { grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); }
.book-tile { border: 1px solid var(--line); padding: 0; border-radius: .75rem; overflow: hidden; background: transparent; text-align: left; }
.book-tile h2 { font-size: 1.45rem; }
.book-tile p { margin: .35rem 0 0; }
.book-tile > div:last-child { padding: 1rem; }
.book-cover { height: 12rem; background: #647256; color: #fff8de; font: bold 1.75rem/1.15 var(--serif); display: grid; place-items: center; text-align: center; padding: 1rem; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.book-cover:has(img) { padding: 0; overflow: hidden; }
.book-cover.clay { background: #943f2b; }
.book-title { margin-top: 1.25rem; }
.book-toolbar { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 1.5rem; }
.book-chapter { border-top: 1px solid var(--line); padding-top: 1rem; }
.book-chapter h2 { font-size: 1.6rem; }
.book-row { display: flex; align-items: center; gap: .35rem; border-bottom: 1px solid #e3ddd0; padding: .25rem 0; }
.book-row .recipe-link { flex: 1; }
.recipe-link { text-align: left; border: 0; background: transparent; padding: .4rem; text-decoration: underline; text-underline-offset: .2em; overflow-wrap: anywhere; min-width: 0; }
dialog {
  max-width: min(37rem, calc(100vw - 1.5rem)); width: 100%; padding: 1.45rem;
  color: var(--ink); background: #faf7ef; border: 1px solid var(--line); border-radius: .9rem;
}
dialog::backdrop { background: #142d2570; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .85rem; }
.dialog-header h2 { font-size: 2rem; }
.dialog-header .icon-button { flex: none; }
.form { display: grid; gap: .8rem; }
.form label { display: grid; gap: .3rem; font-weight: 600; }
.form input, .form select, .form textarea { width: 100%; padding: .55rem .65rem; border: 1px solid #a79e8e; border-radius: .45rem; background: #fffdf8; }
.form textarea { resize: vertical; min-height: 5rem; }
.form small { color: var(--muted); font-weight: 400; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-end; margin-top: .45rem; }
.form-error { color: #942c1c; margin: 0; }
.import-form { margin-bottom: 1.15rem; padding-bottom: 1.15rem; border-bottom: 1px solid var(--line); }
.cook-step { font-size: clamp(1.25rem, 3.4vw, 1.8rem); }
.notice { position: fixed; z-index: 2; bottom: 1rem; left: 50%; transform: translateX(-50%); padding: .65rem 1rem; border-radius: .5rem; background: var(--green); color: white; max-width: calc(100% - 2rem); }
.notice:empty, #print { display: none; }
.archive-summary { margin: 0; overflow-wrap: anywhere; }
.archive-preview { padding: 0; margin: 0; list-style: none; max-height: min(45vh, 26rem); overflow: auto; border-block: 1px solid var(--line); }
.archive-preview li + li { border-top: 1px solid #e3ddd0; }
.archive-preview label { display: grid; grid-template-columns: auto 3rem minmax(0, 1fr); align-items: center; gap: .65rem; padding: .45rem .3rem; }
.archive-preview label > input { width: 1.15rem; height: 1.15rem; accent-color: var(--green); }
.form .restore-books { display: flex; align-items: center; gap: .5rem; }
.restore-books input { width: 1.15rem; height: 1.15rem; accent-color: var(--green); }
.archive-preview label > span:last-child { display: grid; overflow-wrap: anywhere; }
.archive-preview img, .archive-thumb { display: block; width: 3rem; height: 3rem; object-fit: cover; border-radius: .35rem; background: #e0e5d7; }
.archive-details { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .3rem 1rem; }
.archive-details dd { margin: 0; overflow-wrap: anywhere; }
.archive-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.archive-gallery img { width: 100%; aspect-ratio: 1.4; object-fit: cover; border-radius: .5rem; }
.recipe-notes { white-space: pre-wrap; }
.sidebar-utilities { position: relative; margin-top: 1rem; padding-top: .8rem; }
.sidebar-utilities::before { content: ''; position: absolute; inset: 0 .65rem auto; border-top: 1px solid var(--line); }
.sidebar-utilities > .button { justify-content: flex-start; font-size: .95rem; font-weight: 500; color: #39493d; }

.account-dialog {
  width: min(47rem, calc(100vw - 2rem)); max-width: none; padding: 0;
  border-color: #b9b7a6; border-radius: 1rem; background: #fbf8f0;
  box-shadow: 0 1.25rem 4rem #12271f3b;
}
.account-dialog::backdrop { background: #172b24a3; }
.account-layout { display: grid; grid-template-columns: minmax(0, .65fr) minmax(0, 1fr); }
.account-photo {
  background: #5f5945 url('/assets/account-risotto.jpg') center / cover no-repeat;
}
.account-panel { padding: clamp(1.5rem, 3.2vw, 2.5rem); min-width: 0; }
.account-dialog-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.15rem; }
.account-dialog-top .icon-button { margin-right: -.35rem; }
.account-emblem {
  display: grid; width: 2.8rem; height: 2.8rem; place-items: center; border-radius: .65rem;
  color: #263e31; background: #e2e9d9; font-size: 1.25rem;
}
.account-panel h2 { font-size: clamp(2.05rem, 4vw, 3rem); }
.account-description { margin: .55rem 0 1.3rem; color: var(--muted); font-size: .98rem; }
.account-provider { display: grid; gap: .6rem; }
.account-provider .google-button {
  position: relative; width: 100%; min-height: 2.8rem; padding: .625rem 2.625rem;
  background: #fff; color: #1f1f1f; border-color: #747775;
  font: 500 .875rem/1.25rem 'Google Sans', Arial, sans-serif;
  white-space: normal;
}
.google-button img { position: absolute; left: .75rem; width: 1.125rem; height: 1.125rem; object-fit: contain; }
.account-provider .google-button:hover { background: #f8f9fa; }
.account-divider { display: flex; align-items: center; gap: .75rem; margin: 1.1rem 0; color: var(--muted); font-size: .85rem; }
.account-divider::before, .account-divider::after { content: ''; flex: 1; border-top: 1px solid #d5cebe; }
.account-form { gap: .8rem; }
.account-form label, .account-field-heading { gap: .35rem; font-size: .9rem; }
.account-form input { min-height: 2.8rem; background: #fffdf8; }
.account-password { display: grid; gap: .35rem; }
.account-field-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.account-form > button[type="submit"] { min-height: 2.8rem; margin-top: .2rem; }
.account-panel .form-error:empty { display: none; }
.account-panel .form-error { font-size: .9rem; }
.button.text-button {
  display: inline; min-height: 0; padding: .25rem 0; border: 0; border-radius: .15rem;
  background: transparent; color: #345442; font-weight: 650; text-decoration: underline; text-underline-offset: .18em;
  white-space: normal;
}
.button.text-button:hover { color: #85402c; }
.account-options { margin-top: 1.15rem; text-align: center; font-size: .9rem; color: var(--muted); }
.account-identity {
  display: grid; gap: .25rem; padding: .85rem 1rem; margin-top: 1.2rem;
  background: #ecf0e4; border-radius: .6rem; overflow-wrap: anywhere;
}
.account-identity span { color: var(--muted); }
.account-profile-actions { display: grid; gap: .65rem; margin-top: 1rem; }
@media (min-width: 1051px) {
  .sidebar { position: sticky; top: 0; align-self: start; height: 100dvh; overflow: auto; scrollbar-width: none; }
}
@media (max-width: 1050px) {
  .brand { padding: 0 .15rem; }
  .brand .icon { width: 1.4rem; }
}
@media (max-width: 700px) {
  .app { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 1rem; }
  .brand { margin: 0 0 .65rem; }
  .brand strong { font-size: 1.45rem; }
  .brand .icon { width: 2rem; }
  .nav { display: flex; flex-wrap: wrap; }
  .nav button { min-height: 2.5rem; }
  .nav-label { margin: .6rem .15rem .15rem; }
  .sidebar hr { display: none; }
  .sidebar-utilities { margin-top: .35rem; padding-top: 0; }
  .sidebar-utilities::before { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recipe-hero, .recipe-instructions { grid-template-columns: minmax(0, 1fr); }
  .card-copy { padding: .65rem .65rem .95rem; }
  .card h2 { margin-right: 0; }
}
@media (max-width: 620px) {
  .account-layout { display: block; }
  .account-photo { display: none; }
  .account-dialog { width: min(27rem, calc(100vw - 1rem)); }
}
@media (max-width: 350px) {
  .cards { grid-template-columns: 1fr; }
}
@media print {
  @page { margin: 18mm; }
  body { background: white; color: black; }
  #app, dialog, .notice { display: none !important; }
  #print { display: block; font-family: var(--serif); }
  .print-cover { min-height: 75vh; display: grid; place-content: center; text-align: center; break-after: page; color: #344f3d; }
  .print-cover.clay { color: #943f2b; }
  .print-cover img { display: block; width: 48mm; margin: 1.5rem auto; }
  .print-contents { break-after: page; }
  .print-recipe { break-before: page; }
  .print-recipe:first-child { break-before: auto; }
  .print-recipe h3 { break-after: avoid; margin-top: 1rem; }
}
