          body { margin: 0; background: #ffffff; color: #2f2f2f; }
          .app-shell { display: flex; min-height: 100vh; }
          .sidebar { display: flex; flex-direction: column; width: 244px; flex: 0 0 244px; min-height: 100vh; padding: 1.25rem 0.75rem; box-sizing: border-box; background: #f1f0ed; border-right: 1px solid #e4e2de; }
          .sidebar-brand { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.65rem 1.25rem; color: #2f2f2f; font-weight: 700; }
          .sidebar-brand-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: #7b3f00; color: white; }
          .sidebar-label { margin: 1.1rem 0.65rem 0.4rem; color: #87837d; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; }
          .sidebar-link { display: flex; align-items: center; gap: 0.65rem; padding: 0.6rem 0.65rem; border-radius: 7px; color: #4d4a46; text-decoration: none; font-size: 0.95rem; }
          .sidebar-link:hover { background: #e7e5e1; color: #2f2f2f; }
          .sidebar-link.active { background: #e2dfda; color: #000000; font-weight: 700; }

          .sidebar-settings { margin-top: auto; }
          .main-content { flex: 1; min-width: 0; padding: 2rem; }
          .container { max-width: 1066px; margin: 0 auto; }
          .site-header { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.2rem; }
          .site-header h1 { margin: 0; }
          .header-actions { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; max-width: 680px; margin-left: auto; }
          .search-form { display: flex; align-items: center; flex: 1 1 0; min-width: 0; width: auto; height: 44px; margin: 0; padding: 0 0.25rem 0 0.85rem; border: 1px solid #d9d9d9; border-radius: 999px; background: white; box-sizing: border-box; }
          .search-form input { min-width: 0; flex: 1 1 auto; width: 100%; margin: 0; padding: 0.4rem 0; border: none; border-radius: 0; background: transparent; color: #000; font-size: 0.875rem; }
          .search-form input::placeholder { color: #b0b0b0; opacity: 1; }
          .search-form input:focus { outline: none; }
          .search-form input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
          .search-form input::-ms-clear { display: none; }
          .search-form:focus-within { border-color: #999; }
          .search-form button { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; margin: 0; padding: 0; border-radius: 50%; }
          .search-form button svg { width: 20px; height: 20px; }
          .add-recipe-button { display: grid; place-items: center; width: auto; height: 44px; flex: 0 0 auto; margin: 0; padding: 0 1.1rem; border: 2px solid #000; border-radius: 999px; font-size: 0.875rem; font-weight: 600; line-height: 1.2; white-space: nowrap; }
          .card { background: white; padding: 1.2rem 1.5rem; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 1.2rem; }
          h1, h2 { color: #000000; margin-top: 0; }
          input, textarea, select, button { font-size: 1rem; padding: 0.75rem; width: 100%; margin-top: 0.5rem; border: 1px solid #ddd; border-radius: 10px; box-sizing: border-box; }
          textarea { min-height: 100px; resize: vertical; }
          button { background: #2563eb; color: white; border: none; border-radius: 10px; cursor: pointer; transition: transform 0.15s ease, background 0.15s ease; }
          button:hover { transform: translateY(-1px); background: #1d4ed8; }
          .search-form button, .add-recipe-button { background: white; color: #000; }
          .search-form button:hover, .add-recipe-button:hover { background: #f5f5f5; transform: none; }
          .add-recipe-button:focus-visible, .search-form button:focus-visible { outline: 2px solid #000; outline-offset: 3px; }
          .small-text { color: #4b5563; margin-top: 1rem; }
          .small-text a { color: #000; font-weight: 600; text-decoration: none; }
          .small-text a:hover { text-decoration: underline; }
          .grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
          .recipe-card { background: white; padding: 1rem; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); text-align: center; color: #2f2f2f; }
          .recipe-card:not(.recipe-card-edit) { position: relative; padding-bottom: 3.7rem; }
          .recipe-card-link { display: block; color: inherit; text-decoration: none; }
          .recipe-card img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; margin-bottom: 0.8rem; }
          .recipe-card h3 { margin: 0.3rem 0 0.6rem; }
          .meta { color: #6b6b6b; font-size: 0.9rem; }
          .ingredients { white-space: pre-line; margin-top: 0.35rem; }
          .instructions { white-space: pre-line; line-height: 1.6; }
          .edit-toggle { display: inline-block; margin-bottom: 0.8rem; color: #2563eb; font-weight: 600; }
          .recipe-card-edit { position: relative; text-align: center; padding: 0; overflow: hidden; }
          .recipe-card-edit img { width: 100%; height: 140px; object-fit: cover; border-radius: 8px 8px 0 0; margin-bottom: 0; }
          .recipe-card-edit h3 { margin: 0.75rem 0.75rem 0.9rem; }
          .delete-btn { position: absolute; top: 0.5rem; right: 0.5rem; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,0.95); color: #b91c1c; border: none; font-size: 1rem; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
          .favorite-form { position: absolute; top: 0.65rem; right: 0.65rem; margin: 0; z-index: 1; }
          .favorite-btn { display: grid; place-items: center; width: 34px; height: 34px; margin: 0; padding: 0; border-radius: 50%; background: rgba(255,255,255,0.94); color: #7b3f00; border: none; font-size: 1.35rem; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,0.16); }
          .favorite-btn:hover { background: white; color: #b45309; transform: scale(1.06); }
          .favorite-btn.is-favorite { color: #b91c1c; }
          .add-ingredients-form { position: absolute; right: 0.75rem; bottom: 0.75rem; margin: 0; }
          .add-ingredients-btn { display: grid; place-items: center; width: 36px; height: 36px; margin: 0; padding: 0; border-radius: 50%; font-size: 1.4rem; line-height: 1; box-shadow: 0 2px 6px rgba(0,0,0,0.16); }
          .toast { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 100; max-width: min(360px, calc(100% - 3rem)); padding: 0.9rem 1.1rem; border-radius: 10px; background: #2f2f2f; color: white; box-shadow: 0 8px 24px rgba(0,0,0,0.22); }
          a { color: #000000; text-decoration: none; }
          .overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); display: none; align-items: center; justify-content: center; z-index: 50; overflow: hidden; padding: 1rem; }
          .overlay.show { display: flex; }
          .popup { background: white; position: fixed; inset: 0; max-width: 900px; width: 100%; height: 100%; margin: auto; border-radius: 0; padding: 1.5rem; box-shadow: none; z-index: 60; overflow-y: auto; box-sizing: border-box; }
          .popup h2 { margin-top: 0; }
          .popup .close { position: absolute; top: 1rem; right: 1rem; z-index: 2; width: auto; margin: 0; padding: 0.4rem 0.65rem; background: transparent; border: none; border-radius: 7px; font-size: 0.9rem; cursor: pointer; color: #4b5563; }
          .popup .close:hover { background: #f1f0ed; color: #2f2f2f; transform: none; }
          .popup .close:hover, .popup .close:focus-visible { background: none; color: #2f2f2f; outline: none; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; transform: none; }
          .popup .error { color: #b91c1c; margin-bottom: 1rem; }
          .popup form > p { margin-bottom: 1rem; }
          .popup form button { width: 100%; }
          .add-popup { top: 50%; right: auto; bottom: auto; left: 50%; width: min(700px, calc(100% - 2rem)); height: auto; max-height: calc(100vh - 2rem); padding: 2rem; border-radius: 16px; transform: translate(-50%, -50%); box-shadow: 0 16px 45px rgba(15, 23, 42, 0.28); }
          .add-popup h2 { margin-bottom: 1.8rem; }
          .url-import-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 0.65rem; align-items: end; }
          .url-import-row label { display: block; margin-bottom: 0.35rem; }
          .url-import-row input, .url-import-row select { margin-top: 0; }
          .category-picker { position: relative; }
          .category-picker input[role="combobox"] { padding-right: 2rem; font: inherit; }
          .category-chevron { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; pointer-events: none; }
          .category-options { position: fixed; box-sizing: border-box; height: auto; max-height: calc(100dvh - 32px); display: flex; flex-direction: column; gap: 8px; padding: 12px; z-index: 70; background: #fff; border: 1px solid #dedede; border-radius: 16px; box-shadow: 0 8px 24px #00000012; }
          .category-options input[type="search"] { flex: none; width: 100%; box-sizing: border-box; margin: 0; padding: 10px 12px; font: inherit; border: 1px solid #ddd; border-radius: 12px; }
          .category-option-list { flex: 0 1 auto; max-height: 172px; min-height: 0; overflow-y: auto; }
          .category-options > button { flex: none; border-top: 1px solid #eee; border-radius: 0; font-weight: 600; padding-top: 14px; }
          .category-picker input[readonly] { cursor: pointer; }
          .category-options[hidden] { display: none; }
          .category-options button { display: block; width: 100%; margin: 0; padding: 0.6rem 0.75rem; text-align: left; font: inherit; color: #000; background: #fff; border: 0; border-radius: 7px; box-shadow: none; cursor: pointer; }
          .category-options button[hidden] { display: none; }
          .category-options button:hover, .category-options button[aria-selected="true"] { background: #f2f2f2; transform: none; }
          .confirmation-popup { width: min(440px, calc(100% - 2rem)); }
          .confirmation-popup h2 { margin-bottom: 0.75rem; }
          .confirmation-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }
          .confirmation-actions button { width: auto; margin: 0; }
          .confirmation-actions .secondary { background: #e7e5e1; color: #4b5563; }
          .confirmation-actions .secondary:hover { background: #d9d6d0; transform: none; }
          .no-scroll { overflow: hidden; }
          .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
          .recipe-placeholder { display: flex; align-items: center; justify-content: center; height: 140px; margin-bottom: 0.8rem; border-radius: 8px; background: #ede8d0; color: #888; }
          .recipe-placeholder-edit { margin-bottom: 0; border-radius: 8px 8px 0 0; }
          @media (max-width: 600px) {
            .app-shell { display: block; }
            .sidebar { width: 100%; min-height: 0; padding: 0.75rem; border-right: none; border-bottom: 1px solid #e4e2de; }
            .sidebar-brand { padding-bottom: 0.6rem; }
            .sidebar-label { display: none; }
            .sidebar nav { display: flex; flex-wrap: wrap; gap: 0.3rem; }
            .sidebar-link { padding: 0.45rem 0.55rem; }
            .main-content { padding: 1.25rem; }
            .site-header { align-items: stretch; flex-direction: column; }
            .header-actions { width: 100%; max-width: none; flex-wrap: wrap; gap: 1rem; }
            .search-form { width: 100%; flex-basis: 100%; }
            .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .url-import-row { grid-template-columns: 1fr; }
          }
          @media (max-width: 400px) { .grid { grid-template-columns: 1fr; } }

.manual-popup { inset: auto; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; width: min(900px, calc(100% - 2rem)); height: min(900px, calc(100dvh - 2rem)); max-height: calc(100dvh - 2rem); padding: 2rem; border-radius: 20px; overflow: hidden; background-clip: padding-box; }
.manual-popup[hidden] { display: none; }
.manual-popup form { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 0.75rem; margin-right: -0.75rem; scrollbar-width: thin; scrollbar-color: #c8c8c8 transparent; }
.manual-popup form::-webkit-scrollbar { width: 10px; }
.manual-popup form::-webkit-scrollbar-track { margin-block: 16px; border-radius: 999px; background: transparent; }
.manual-popup form::-webkit-scrollbar-thumb { border: 3px solid white; border-radius: 999px; background: #c8c8c8; background-clip: padding-box; }
.manual-popup label { display: block; }
.manual-meta-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: end; }
.manual-meta-row label { font-size: 0.9rem; }
.manual-meta-row input, .manual-entry-group input, .manual-entry-group textarea { height: 46px; font: inherit; }
.manual-entry-group textarea { display: block; width: 100%; min-height: 46px; height: auto; box-sizing: border-box; line-height: 1.4; overflow: hidden; resize: none; }
.manual-entry-group { border: 0; padding: 0; margin: 1.25rem 0 0; min-width: 0; }
.manual-entry-group legend { padding: 0; margin-bottom: 0.25rem; }
.manual-entry-group ol { margin: 0; padding-left: 1.75rem; }
.manual-entry-group li { padding-left: 0.25rem; }
body .manual-popup .areti-button.close { border: 0; border-radius: 0; }
body .manual-popup .areti-button.close:hover, body .manual-popup .areti-button.close:focus-visible { background: transparent; color: #2f2f2f; outline: none; box-shadow: none; text-decoration: underline; text-underline-offset: 3px; transform: none; }
@media (max-width: 480px) { .manual-popup { padding: 1.25rem; } .manual-meta-row { gap: 12px; } .manual-meta-row label { font-size: 0.75rem; } .manual-meta-row input { padding-left: 8px; padding-right: 8px; } }

.servings-stepper, .manual-time-fields { display: flex; align-items: center; height: 46px; margin-top: 0.5rem; }
.servings-stepper { border: 1px solid #ddd; border-radius: 10px; box-sizing: border-box; }
.manual-popup .servings-stepper button { flex: 0 0 30px; width: 30px; padding: 0; margin: 0; height: 100%; background: transparent; color: #000; font-size: 1.25rem; border: 0; transform: none; }
.manual-popup .servings-stepper button:disabled { opacity: 0.3; cursor: default; }
.manual-popup .servings-stepper input { flex: 1; min-width: 0; margin: 0; border: 0; height: 100%; padding: 0; text-align: center; background: transparent; }
.manual-time-fields { gap: 6px; }
.manual-time-fields > div { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; height: 100%; border: 1px solid #ddd; border-radius: 10px; box-sizing: border-box; padding-right: 6px; }
.manual-time-fields > div:focus-within { border-color: #000; outline: 1px solid #000; outline-offset: 0; }
.manual-popup .manual-time-fields input { min-width: 0; width: calc(3ch + 12px); margin: 0; padding: 6px; height: 100%; border: 0; background: transparent; }
.manual-popup .manual-time-fields input:focus { outline: none; }
.manual-time-fields span { color: #777; font-size: 0.75rem; }
.servings-stepper input, .manual-time-fields input { appearance: textfield; -moz-appearance: textfield; }
.servings-stepper input::-webkit-inner-spin-button, .manual-time-fields input::-webkit-inner-spin-button { -webkit-appearance: none; }

.manual-meta-row { grid-template-columns: minmax(0, 160px) minmax(0, 120px) minmax(0, 140px); }
.manual-meta-row .category-picker { margin-top: 0.5rem; }
.manual-meta-row .category-picker input[role="combobox"] { margin-top: 0; }
.manual-photo-field input { font: inherit; }
.manual-photo-field input::file-selector-button { font: inherit; color: #000; background: #fff; border: 1px solid #000; border-radius: 999px; padding: 6px 12px; margin-right: 12px; cursor: pointer; }
#manual-photo-preview { display: block; width: 100px; height: 72px; object-fit: cover; border-radius: 10px; margin-top: 10px; }
#manual-photo-preview[hidden] { display: none; }
.manual-photo-remove { width: auto !important; margin: 0 0 0 10px !important; padding: 7px 14px !important; font-size: 0.9rem !important; }
.manual-photo-remove[hidden] { display: none; }
