.library-body { min-height: 100vh; background: #f5f5f2; }
.library-header, .library-main, .library-footer { width: min(1240px, calc(100% - 40px)); }
.library-main { min-height: calc(100vh - 190px); }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 30px 0 20px; }
.search-field { width: min(430px, 100%); }
.search-field input { width: 100%; height: 46px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; outline: none; }
.search-field input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 104, 70, .12); }
.recipe-count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.library-status { margin: 80px auto; color: var(--muted); text-align: center; }
.library-status.is-error { max-width: 620px; padding: 20px; border: 1px solid #e3c7ba; border-radius: 12px; background: #fff7f3; color: #7b3a20; }
.library-shell { min-height: 680px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 18px 50px rgba(36, 43, 36, .06); overflow: hidden; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.library-shell[hidden] { display: none !important; }
.recipe-index { border-right: 1px solid var(--line); background: #faf9f5; }
.recipe-list { margin: 0; padding: 8px; list-style: none; }
.recipe-list button { width: 100%; padding: 14px 16px; border: 0; border-radius: 9px; background: transparent; color: var(--ink); font: inherit; font-weight: 600; line-height: 1.35; text-align: left; cursor: pointer; }
.recipe-list button:hover, .recipe-list button:focus-visible { background: var(--green-soft); outline: none; }
.recipe-list button[aria-current="true"] { background: var(--green); color: #fff; }
.recipe-list button { display: flex; align-items: center; gap: 12px; }
.recipe-thumbnail { width: 58px; height: 58px; flex: 0 0 58px; object-fit: cover; border-radius: 7px; }
.recipe-photo { display: block; width: 100%; max-height: 520px; object-fit: contain; border-radius: 12px; margin: 0 0 28px; background: #faf9f5; }
.empty-state { padding: 24px; color: var(--muted); text-align: center; }
.recipe-detail { padding: clamp(30px, 6vw, 72px); background: #fff; }
.document-label { margin: 0 0 28px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.recipe-detail h1 { margin: 0 0 38px; font-family: inherit; font-size: clamp(28px, 4vw, 42px); font-weight: 720; letter-spacing: -.035em; }
.document-content { max-width: 760px; color: #2f312f; }
.document-content h2 { margin: 34px 0 12px; font-family: inherit; font-size: 17px; font-weight: 750; letter-spacing: 0; }
.document-content ul, .document-content ol { margin: 0; padding-left: 25px; }
.document-content li + li { margin-top: 7px; }
.document-content p { margin: 0 0 10px; }
.document-content .source { margin-top: 38px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.document-content a { color: var(--green); overflow-wrap: anywhere; text-underline-offset: 3px; }
.document-updated { margin: 42px 0 0; color: var(--muted); font-size: 12px; }
.back-button { display: none; margin: 0 0 28px; padding: 0; border: 0; background: none; color: var(--green); font: inherit; font-weight: 650; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .library-toolbar { align-items: stretch; flex-direction: column; }
  .recipe-count { padding-left: 2px; }
  .library-shell { display: block; min-height: 0; }
  .recipe-index { border-right: 0; }
  .recipe-detail { display: none; min-height: 620px; padding: 26px 22px 42px; }
  .library-shell.show-detail .recipe-index { display: none; }
  .library-shell.show-detail .recipe-detail { display: block; }
  .back-button { display: inline-block; }
}
