body {
    font-family: sans-serif;
    margin: 0;
    background-color: #333;
    color: #ddd;
}

a {
    color: inherit;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    background-color: #222;
    color: #ddd;
    padding: 0.65rem 1.75rem 0.65rem 1.25rem;
    border-bottom: 1px solid #444;
}

.navbar-brand {
    color: #f2f2f2;
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.navbar-brand:hover {
    color: #fff;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-group {
    position: relative;
}

.nav-group>summary {
    list-style: none;
}

.nav-group>summary::-webkit-details-marker {
    display: none;
}

.nav-group-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    left: 0;
    display: none;
    min-width: 13rem;
    padding: 0.4rem;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #2f2f2f;
    z-index: 10;
}

.nav-group[open] .nav-group-menu {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-group--right .nav-group-menu {
    left: auto;
    right: 0;
}

.nav-link {
    color: #d8d8d8;
    text-decoration: none;
    padding: 0.45rem 0.85rem;
    border-radius: 6px;
    border: 1px solid #555;
    background-color: #3a3a3a;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    background-color: #4a4a4a;
    border-color: #777;
    color: #fff;
}

.nav-link--muted {
    color: #aaa;
    background-color: #333;
    border-color: #4a4a4a;
}

.nav-link--muted:hover {
    background-color: #3d3d3d;
    border-color: #666;
    color: #e8e8e8;
}

.single-message {
    background-color: #61d4445e;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin: 5px;
    padding: 5px;
}

.warning-message {
    background-color: rgba(255, 193, 7, 0.18);
    border-radius: 5px;
    border: 1px solid #d4a017;
    color: #ffe08a;
    margin: 5px;
    padding: 5px;
}

.flash-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.flash-banner-text {
    flex: 1;
    min-width: 0;
}

div.search-results {
    border-radius: 5px;
    display: inline-block;
    margin-right: 10px;
    padding: 5px;
    vertical-align: text-top;
}

.container {
    margin: 0 15%;
    padding: 1rem;
}

.content-page,
.recipe-view,
.recipe-edit-page {
    max-width: 52rem;
}

.page-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #555;
}

.page-title-main {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 600;
    color: #f2f2f2;
}

.page-lead {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #aaa;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}

.action-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.1rem;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #3d3d3d;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.action-card:hover {
    background-color: #454545;
    border-color: #777;
}

.action-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #f0f0f0;
}

.action-card-desc {
    font-size: 0.85rem;
    color: #aaa;
    line-height: 1.4;
}

.search-panel,
.form-panel {
    padding: 1.25rem;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #3d3d3d;
}

.field-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #d8d8d8;
}

.form-control {
    padding: 0.55rem 0.65rem;
    border-radius: 6px;
    border: 1px solid #666;
    background-color: #555;
    color: #ddd;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.95rem;
}

.form-control:focus {
    outline: none;
    border-color: #5a9fd4;
    box-shadow: 0 0 0 2px rgba(90, 159, 212, 0.2);
}

.search-results-panel {
    margin-top: 1rem;
}

.search-placeholder {
    margin: 0;
    font-size: 0.9rem;
    color: #999;
}

.search-result-list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #444;
    color: #e8e8e8;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.search-result-item:hover {
    background-color: #4d4d4d;
    border-color: #777;
}

.search-result-id {
    flex-shrink: 0;
    font-size: 0.8rem;
    color: #999;
}

.search-result-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.form-section {
    margin-bottom: 1.5rem;
}

.search-panel .form-section {
    margin-top: 1.25rem;
}

.tag-group-fieldset {
    margin: 0 0 1rem;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 0.75rem;
}

.tag-group-fieldset legend {
    padding: 0 0.35rem;
    color: #e0e0e0;
}

.tag-group-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background-color: var(--tag-bg, #2563eb);
    color: var(--tag-fg, #ffffff);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
    font-weight: 600;
}

.tag-group-chip--small {
    padding: 0.15rem 0.45rem;
    font-size: 0.8rem;
}

.manage-tag-form--create .manage-tag-form-row .form-control {
    flex: 1;
}

.tag-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0.75rem 0;
}

.tag-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
}

.recipes-missing-tags-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recipes-missing-tags-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recipes-missing-tags-groups {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.missing-tags-group-slot {
    display: inline-flex;
    align-items: center;
}

.missing-tags-group-trigger {
    display: inline-flex;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
}

.missing-tags-group-trigger:hover .tag-group-chip {
    filter: brightness(1.08);
}

.missing-tags-group-editor {
    flex: 1 1 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid #666;
    border-radius: 8px;
    background-color: #3d3d3d;
}

.missing-tags-group-editor-form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.manage-tag-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin: 0;
}

.manage-tag-form-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.manage-tag-form--inline {
    flex-direction: row;
    align-items: flex-start;
}

.manage-tag-form .form-control:not(.manage-shop-color-input) {
    flex: 1;
    min-width: 0;
}

.manage-tag-label {
    width: 6rem;
    margin-top: 0.45rem;
    margin-bottom: 0;
    text-align: left;
}

.icon-btn {
    height: 2.25rem;
    min-width: 2.25rem;
    padding: 0;
    background-color: #4a4a4a;
    border-color: #666;
    color: #f0f0f0;
    font-size: 1rem;
}

.icon-btn:hover {
    background-color: #555;
    border-color: #777;
    color: #fff;
}

.icon-btn--active {
    background-color: #5a9fd4;
    border-color: #5a9fd4;
    color: #fff;
}

.week-menu-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.week-menu-start-day {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.week-menu-start-day .field-label {
    margin-bottom: 0;
    margin-top: 0.45rem;
}

.week-menu-start-day .form-control {
    width: 10rem;
}

.week-menu-options {
    margin-bottom: 1rem;
}

.week-menu-options-header {
    margin-bottom: 0.65rem;
}

.week-menu-constraints-summary {
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.75rem;
}

.week-menu-constraints-summary .subheader {
    margin-bottom: 0.35rem;
}

.week-menu-constraints-summary .subheader .section-title {
    margin: 0;
    font-size: 0.95rem;
}

.week-menu-constraints-summary-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.week-menu-constraint-readonly {
    display: grid;
    grid-template-columns: minmax(7rem, 9rem) 1fr;
    align-items: center;
    gap: 0.65rem;
    padding: 0.1rem 0;
}

.week-menu-constraint-readonly .tag-group-chip {
    justify-self: start;
}

.week-menu-constraint-summary-text {
    color: #d8d8d8;
    font-size: 0.85rem;
    line-height: 1.3;
    min-width: 0;
}

.week-menu-options-header .section-title {
    margin: 0 0 0.2rem;
    font-size: 0.95rem;
}

.week-menu-options-header .section-hint {
    margin: 0;
    font-size: 0.8rem;
    color: #b5b5b5;
}

.week-menu-constraints-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.week-menu-constraints-form .form-actions {
    margin-top: 0.35rem;
}

.week-menu-constraint-row {
    display: grid;
    grid-template-columns: minmax(6rem, 8rem) minmax(9rem, 1.4fr) 1fr;
    gap: 0.5rem;
    align-items: center;
}

.week-menu-constraint-extra {
    display: grid;
    grid-template-columns: minmax(8rem, 1fr) 4.5rem;
    gap: 0.5rem;
    min-width: 0;
}

.week-menu-constraint-row .field-label {
    margin: 0;
    font-size: 0.85rem;
}

.week-menu-constraint-tag-field,
.week-menu-constraint-min-field {
    min-width: 0;
}

.week-menu-constraint-tag-field.is-hidden,
.week-menu-constraint-min-field.is-hidden {
    display: none;
}

.week-menu-constraint-tag-field .form-control,
.week-menu-constraint-min-field .form-control {
    width: 100%;
}

.week-menu-constraint-min {
    width: 4.5rem;
}

.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;
}

.week-menu-panel {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.week-menu-day {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.55rem;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #3d3d3d;
}

.week-menu-day-primary,
.week-menu-day-secondary {
    display: contents;
}

.week-menu-move {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 0 0 auto;
}

.week-menu-move-btn {
    height: 1.15rem;
    width: 1.6rem;
    min-width: 1.6rem;
    padding: 0;
    font-size: 0.6rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.week-menu-move-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.week-menu-day-info {
    flex: 1 1 auto;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    min-width: 0;
}

.week-menu-day-info .recipe-link,
.week-menu-day-info .search-placeholder {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin: 0;
}

.week-menu-day-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.week-menu-day-actions form {
    margin: 0;
    display: inline-flex;
}

.icon-action-btn {
    height: 2rem;
    width: 2rem;
    min-width: 2rem;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1;
}

.week-menu-day-title {
    margin: 0;
    flex: 0 0 auto;
    min-width: 5.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e8e8e8;
}

.recipe-link {
    color: #b8d9f0;
    text-decoration: none;
    font-weight: 500;
}

.recipe-link:hover {
    color: #fff;
    text-decoration: underline;
}

.week-menu-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.week-menu-footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #555;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.15rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}

.btn-action-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.btn-action--grocery {
    background: linear-gradient(135deg, #16a34a, #15803d);
    border-color: #22c55e;
    color: #fff;
}

.btn-action--grocery:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
}

.btn-action--export {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-color: #3b82f6;
    color: #fff;
}

.btn-action--export:hover {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.week-menu-day-servings {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
}

.week-menu-day-servings .field-label {
    margin: 0;
    font-size: 0.8rem;
    color: #b5b5b5;
}

.week-menu-servings-input {
    width: 3.6rem;
    padding: 0.3rem 0.4rem;
    font-size: 0.85rem;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.grocery-add-weekly-form {
    margin-top: 0.65rem;
}

.content-divider {
    margin: 0 0 1rem;
    border: none;
    border-top: 1px solid #555;
}

.subheader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.form-actions--end {
    justify-content: flex-end;
}

.grocery-column .subheader {
    margin-top: 1.25rem;
}

.subheader .grocery-subsection-title {
    margin: 0;
}

.grocery-bulk-form {
    margin: 0;
}

.grocery-generate-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.grocery-generate-form {
    margin: 0;
}

.grocery-generate-choices[hidden],
.grocery-generate-trigger[hidden] {
    display: none !important;
}

.grocery-generate-choices {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.grocery-generate-choice {
    white-space: nowrap;
}

.grocery-inline-confirm-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.grocery-inline-confirm[hidden],
.grocery-inline-confirm-trigger[hidden] {
    display: none !important;
}

.grocery-inline-confirm {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.grocery-inline-confirm-label {
    font-size: 0.85rem;
    color: #c8c8c8;
}

.grocery-clear-list-trigger {
    color: #fbbf24;
    border: 1px solid #b45309;
    background-color: rgba(180, 83, 9, 0.12);
}

.grocery-clear-list-trigger:hover {
    color: #fde68a;
    border-color: #d97706;
    background-color: rgba(217, 119, 6, 0.2);
}

.grocery-clear-list-icon {
    margin-right: 0.25rem;
}

.grocery-check-all-trigger {
    color: var(--shop-fg, #ffffff);
    background-color: transparent;
}

.grocery-check-all-trigger:hover {
    background-color: transparent !important;
    color: var(--shop-fg, #ffffff);
}

.shop-chip-btn--warn {
    background-color: #b45309;
    color: #fff;
    border-color: #d97706;
}

.grocery-shop-group .subheader {
    margin-bottom: 0.5rem;
}

.subheader .grocery-shop-title {
    margin: 0;
}

.grocery-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.grocery-column--left {
    min-width: 0;
}

.grocery-column--right {
    min-width: 0;
}

.grocery-subsection-title {
    margin: 1.25rem 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #c8c8c8;
}

.grocery-shop-group {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--shop-bg, #2563eb) 65%, #333);
    border-radius: 10px;
    background-color: var(--shop-bg, #2563eb);
    color: var(--shop-fg, #ffffff);
}

.grocery-shop-group .grocery-item {
    background-color: #353535;
    border-color: #555;
    color: #e8e8e8;
}

.grocery-shop-group .grocery-item-name {
    color: #e8e8e8;
}

.grocery-shop-group .grocery-item-amount {
    color: #b8d9f0;
}

.grocery-shop-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--shop-fg, #e8e8e8);
}

.grocery-item {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #3d3d3d;
}

.grocery-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
}

.grocery-item-amount-wrap {
    flex: 0 0 auto;
}

.grocery-item-amount {
    padding: 0.15rem 0.35rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #b8d9f0;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-align: right;
    white-space: nowrap;
}

.grocery-item-amount:hover {
    border-color: #666;
    background-color: rgba(255, 255, 255, 0.05);
}

.grocery-amount-form {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.grocery-amount-input {
    width: 4.5rem;
    padding: 0.25rem 0.4rem;
    font-size: 0.85rem;
}

.grocery-unit-select {
    width: 4.5rem;
    padding: 0.25rem 0.4rem;
    font-size: 0.85rem;
}

.grocery-item--muted {
    opacity: 0.85;
    background-color: #353535;
}

.grocery-list--muted .grocery-item {
    border-style: dashed;
}

.grocery-item--to-check {
    background-color: #3a3428;
}

.grocery-list--to-check .grocery-item {
    border-color: #b45309;
}

.shop-chip-btn--question {
    background-color: #4a4a4a;
    color: #ccc;
}

.shop-chip-btn--question.shop-chip-btn--active {
    background-color: #d97706;
    color: #fff;
    border-color: #f59e0b;
}

.grocery-copy-section {
    margin-top: 1.25rem;
}

.grocery-copy-section .subheader {
    margin-bottom: 0.5rem;
}

.shop-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    width: 100%;
}

.shop-chip-form {
    margin: 0;
}

.shop-chip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.shop-chip-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.shop-chip-btn--title {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.8rem;
    cursor: default;
}

.shop-chip-btn--preview {
    flex: 0 0 auto;
    cursor: default;
}

.shop-chip-btn--clear {
    background-color: #4a4a4a;
    color: #ccc;
}

.shop-chip-btn--check {
    background-color: #4a4a4a;
    color: #ccc;
}

.shop-chip-btn--check.shop-chip-btn--active {
    background-color: #16a34a;
    color: #fff;
    border-color: #22c55e;
}

.shop-chip-btn--active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px currentColor;
}

.plaintext-export {
    width: 100%;
    min-height: 8rem;
    padding: 0.75rem;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #2f2f2f;
    color: inherit;
    font-family: inherit;
    resize: vertical;
}

.manage-shop-create-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.manage-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
    gap: 1rem;
}

.manage-shop-edit-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-bottom: 0;
}

.manage-shop-tile-preview {
    align-self: flex-start;
}

.manage-shop-tile-colors {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.manage-shop-color-input {
    width: 3rem;
    min-width: 3rem;
    height: 2.25rem;
    padding: 0.15rem;
}

.manage-shop-ingredient-grid {
    margin-bottom: 0;
}

.manage-shop-ingredient-tile {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.manage-shop-ingredient-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.manage-shop-ingredient-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.manage-shop-assignment-group {
    margin-bottom: 1.25rem;
}

.manage-shop-assignment-group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: #e8e8e8;
}

.manage-shop-ingredient {
    font-weight: 600;
}

.grocery-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.weekly-grocery-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.weekly-grocery-list .ingredient-input {
    padding: 0.35rem 0.5rem;
}

.weekly-grocery-row {
    margin: 0;
}

.ingredient-input > .form-control[name="abbrev"] {
    min-width: 0;
    flex: 0 1 4.5rem;
}

.ingredient-input > .form-control[name="single"],
.ingredient-input > .form-control[name="plural"] {
    min-width: 0;
    flex: 1 1 7rem;
}

.ingredient-unit-pair-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.form-panel.is-incomplete {
    border-color: #d4a017;
    background-color: rgba(255, 193, 7, 0.1);
}

details.form-panel > summary {
    list-style: none;
    cursor: pointer;
}

details.form-panel > summary::-webkit-details-marker {
    display: none;
}

details.form-panel > summary .section-hint {
    margin-left: 0.35rem;
}

details.form-panel > :not(summary) {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.recipe-link + .section-hint {
    margin-left: 0.35rem;
}

.ingredient-unit-pair-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 1rem;
}

.ingredient-unit-pair-name {
    font-weight: 600;
    min-width: 8rem;
}

.ingredient-unit-pair-units {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 auto;
}

.ingredient-unit-pair-separator {
    color: #aaa;
}

.unit-chip {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background-color: #2f2f2f;
    border: 1px solid #666;
}

.ingredient-unit-target-fieldset {
    margin: 0.75rem 0 0;
    padding: 0;
    border: 0;
}

.ingredient-unit-target-option {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-right: 1rem;
}

.ingredient-unit-conversion-input {
    margin-top: 0.5rem;
}

.ingredient-unit-ratio-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    margin-top: 0.35rem;
}

.ingredient-unit-amount-input {
    width: 5rem;
    min-width: 0;
    flex: 0 0 5rem;
}

.ingredient-unit-ratio-label {
    min-width: 6.5rem;
    white-space: nowrap;
}

.ingredient-unit-ratio-equals {
    color: #aaa;
    padding: 0 0.15rem;
}

.form-panel .form-actions {
    margin-top: 0.85rem;
}

.ingredient-unit-conversion-message {
    margin-bottom: 0.65rem;
}

.recipe-id-link {
    color: #8ec8ff;
    text-decoration: underline;
}

.recipe-id-link:hover {
    color: #b8dcff;
}

@media (max-width: 640px) {
    .ingredient-unit-pair-summary {
        flex-direction: column;
        align-items: flex-start;
    }
}

.ingredient-merge-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ingredient-merge-selectors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 1rem;
}

.ingredient-merge-message {
    margin-bottom: 0.65rem;
}

.ingredient-merge-search-results {
    margin-top: 0.5rem;
}

.ingredient-merge-search .search-result-id {
    margin-left: auto;
}

.grocery-item-name {
    font-weight: 600;
    color: #e8e8e8;
    min-width: 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.5rem 0.65rem;
    text-align: left;
    border-bottom: 1px solid #4d4d4d;
}

.data-table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #b5b5b5;
}

.week-menu-search-toggle {
    position: static;
}

.week-menu-day-search {
    position: absolute;
    right: 0.55rem;
    top: calc(100% - 0.2rem);
    z-index: 20;
    width: min(22rem, calc(100% - 1.1rem));
    margin-top: 0.1rem;
    padding: 0.5rem;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #353535;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.week-menu-search-results {
    margin-top: 0.3rem;
}

.week-menu-day-search .field-label {
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
}

.week-menu-day-search .form-control {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
}

.week-menu-search-toggle summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    vertical-align: middle;
    list-style: none;
    appearance: none;
    -webkit-appearance: none;
}

.week-menu-search-toggle summary::-webkit-details-marker {
    display: none;
}

.ingredients-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.success-message {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid #4d7a4d;
    border-radius: 8px;
    background-color: rgba(40, 167, 69, 0.12);
}

.recipe-form {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-group--inline {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #666;
    background-color: #555;
    color: #ddd;
    width: 100%;
    box-sizing: border-box;
}

.form-group textarea {
    height: 15rem;
}

.ingredient-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.65rem;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #444;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: #5a9fd4;
    border-color: #5a9fd4;
    color: #fff;
}

.btn-primary:hover {
    background-color: #4a8fc4;
    border-color: #4a8fc4;
}

.btn-secondary {
    background-color: #4a4a4a;
    border-color: #666;
    color: #f0f0f0;
}

.btn-secondary:hover {
    background-color: #555;
    border-color: #777;
    color: #fff;
}

.btn-ghost {
    background-color: transparent;
    border-color: #666;
    color: #ccc;
}

.btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.06);
    border-color: #888;
    color: #fff;
}

.btn.grocery-check-all-trigger {
    color: var(--shop-fg, #ffffff);
    border-color: var(--shop-fg, #ffffff);
    background-color: transparent;
}

.btn.grocery-check-all-trigger:hover {
    background-color: transparent;
    color: var(--shop-fg, #ffffff);
    border-color: var(--shop-fg, #ffffff);
}

.btn-danger {
    background-color: transparent;
    border-color: #a94442;
    color: #f5b7b1;
}

.btn-danger:hover {
    background-color: rgba(169, 68, 66, 0.2);
    border-color: #c9302c;
    color: #fff;
}

.recipe-header {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #555;
}

.recipe-image-wrap {
    margin: 0 0 1.5rem;
}

.recipe-image {
    display: block;
    max-width: 100%;
    max-height: 28rem;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.35rem;
}

.recipe-image-url {
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
    color: #aaa;
    word-break: break-all;
}

.recipe-owner-line {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: #aaa;
}

.recipe-owner-line strong {
    color: #e0e0e0;
    font-weight: 600;
}

.recipe-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.recipe-title-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.home-group-section {
    margin-top: 1.5rem;
}

.recipe-title-main,
.recipe-title-display {
    margin: 0;
    font-size: 1.75rem;
    line-height: 1.25;
    font-weight: 600;
    color: #f2f2f2;
}

.recipe-section {
    margin-bottom: 2rem;
}

.recipe-tag-groups {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.recipe-tag-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.recipe-description,
.recipe-description-display {
    line-height: 1.6;
    color: #d8d8d8;
}

.recipe-description a,
.recipe-description-display a {
    color: #b8d9f0;
    text-decoration: underline;
}

.recipe-description a:hover,
.recipe-description-display a:hover {
    color: #fff;
}

.section-title {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e8e8e8;
}

.section-hint {
    margin: 0;
    font-size: 0.85rem;
    color: #999;
}

.recipe-ingredient-list {
    margin: 0;
    padding-left: 1.25rem;
    line-height: 1.6;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #555;
}

.page-mode-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background-color: rgba(90, 159, 212, 0.15);
    border: 1px solid #5a9fd4;
    color: #b8d9f0;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.editable-field {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background-color: #3d3d3d;
    border: 1px solid #555;
    border-radius: 8px;
}

.editable-field--stacked {
    flex-direction: column;
    align-items: stretch;
}

.editable-field--stacked .btn {
    align-self: flex-start;
}

.recipe-section--danger {
    padding-top: 1rem;
    border-top: 1px solid #555;
}

.recipe-title {
    display: inline-block;
}

.edit-ingredient-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.5rem 0;
    padding: 0.65rem 0.85rem;
    background-color: #3d3d3d;
    border: 1px solid #555;
    border-radius: 8px;
}

.ingredient-span {
    flex: 1;
    min-width: 0;
}

.ingredient-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.recipe-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #cfcfcf;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border: 1px solid #666;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.06);
}

.status-icon {
    font-size: 0.95rem;
}

.recipe-status-editor {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 20rem;
    padding: 1rem;
    background-color: #3d3d3d;
    border: 1px solid #555;
    border-radius: 8px;
}

.recipe-status-toggle {
    display: flex;
    align-items: center;
}

.switch-row {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    font-weight: normal;
}

.switch {
    position: relative;
    display: inline-block;
    width: 2.6rem;
    height: 1.5rem;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #666;
    border-radius: 999px;
    transition: background-color 0.2s ease;
}

.slider::before {
    content: "";
    position: absolute;
    width: 1.1rem;
    height: 1.1rem;
    left: 0.2rem;
    top: 0.2rem;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.switch input:checked+.slider {
    background-color: #28a745;
}

.switch input:checked+.slider::before {
    transform: translateX(1.1rem);
}

@media (max-width: 768px) {
    .container {
        margin: 0 4%;
    }

    .navbar {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
    }

    .navbar-links {
        order: 3;
        width: 100%;
        flex-wrap: wrap;
    }

    .recipe-title-row {
        flex-direction: column;
        align-items: stretch;
    }

    .edit-ingredient-row {
        flex-direction: column;
        align-items: stretch;
    }

    .ingredient-actions {
        justify-content: flex-end;
    }

    .week-menu-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .week-menu-start-day {
        align-items: stretch;
    }

    .week-menu-start-day .form-control {
        width: 100%;
    }

    .week-menu-constraint-row {
        grid-template-columns: 1fr;
    }

    .week-menu-constraint-extra {
        grid-template-columns: 1fr;
    }

    .week-menu-constraint-min {
        width: 100%;
    }

    .week-menu-constraint-tag-field .form-control,
    .week-menu-constraint-min-field .form-control {
        width: 100%;
    }

    .week-menu-day {
        flex-direction: column;
        align-items: stretch;
        gap: 0.45rem;
    }

    .week-menu-day-primary {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        min-width: 0;
    }

    .week-menu-day-secondary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding-left: 2.2rem;
        position: relative;
    }

    .week-menu-day-title {
        min-width: auto;
    }

    .week-menu-day-info .recipe-link,
    .week-menu-day-info .search-placeholder {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }

    .week-menu-day-search {
        right: 0;
        left: auto;
        top: 100%;
        width: min(20rem, 100%);
    }

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

    .shop-chip-row {
        justify-content: flex-start;
    }

}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 22rem;
    padding: 1.75rem;
    border: 1px solid #555;
    border-radius: 12px;
    background-color: #3a3a3a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.auth-title {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
}

.auth-subtitle {
    margin: 0 0 1.25rem;
    color: #b5b5b5;
    font-size: 0.9rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-form .field-label {
    margin-top: 0.6rem;
}

.auth-submit {
    margin-top: 1.1rem;
    width: 100%;
    justify-content: center;
}

.auth-switch {
    margin: 1.1rem 0 0;
    font-size: 0.85rem;
    color: #b5b5b5;
    text-align: center;
}

.auth-switch a {
    color: #b8d9f0;
}

.field-optional {
    color: #8f8f8f;
    font-weight: 400;
}

.profile-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    max-width: 22rem;
}

.profile-form .form-control {
    width: 100%;
}

.profile-form .btn {
    margin-top: 0.6rem;
}

.profile-detail {
    margin: 0 0 0.75rem;
}

.admin-temp-password {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.15rem 0.4rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    user-select: all;
}

.nav-logout-form {
    margin: 0;
}

.nav-logout-btn {
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.include-public {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.75rem 0 0;
    font-size: 0.9rem;
    color: #c8c8c8;
    cursor: pointer;
}

.week-menu-toolbar-actions .include-public {
    margin: 0;
}

.week-menu-randomize-form {
    margin: 0;
}

.recipe-import-note {
    align-self: center;
    font-size: 0.9rem;
    color: #b5b5b5;
}

.translations-group-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    margin-top: 0.5rem;
}

.translations-group-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: #c8c8c8;
    cursor: pointer;
}

.translations-incomplete-toggle {
    margin-top: 1rem;
    max-width: 22rem;
}

.translations-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.25rem;
}

.translations-group {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin: 0;
}

.translations-group .translations-group {
    background-color: #333;
}

.translations-group .translations-group .translations-group {
    background-color: #2b2b2b;
}

.translations-group-heading {
    margin: 0;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #555;
}

.translations-group[data-depth="1"] > .translations-group-heading,
.translations-group[data-depth="2"] > .translations-group-heading,
.translations-group[data-depth="3"] > .translations-group-heading {
    font-size: 1.05rem;
}

.translations-group-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.translations-row {
    border: 1px solid #555;
    border-radius: 8px;
    padding: 0.75rem;
    background: #2a2a2a;
}

.translations-row.is-dirty {
    border-color: #777;
}

.translations-row--incomplete {
    border-left: 3px solid #b45309;
}

.translations-row-form {
    display: grid;
    grid-template-columns: minmax(8rem, 1.2fr) minmax(10rem, 1.4fr) minmax(10rem, 1.4fr) auto;
    gap: 0.75rem;
    align-items: end;
}

.translations-row-key {
    display: block;
    align-self: center;
    overflow-wrap: anywhere;
    font-size: 0.85rem;
    color: #d4d4d4;
}

.translations-row-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin: 0;
}

.translations-row-input {
    min-height: 2.35rem;
    max-height: 12rem;
    resize: none;
    overflow-y: hidden;
    line-height: 1.4;
    field-sizing: content;
}

.translations-row-input:focus {
    overflow-y: auto;
}

.translations-row-form .form-actions {
    min-height: 2.25rem;
}

.translations-row-save:disabled {
    opacity: 0.4;
    cursor: default;
}

.translations-row-saved {
    font-size: 0.85rem;
    color: #86efac;
}

@media (max-width: 900px) {
    .translations-row-form {
        grid-template-columns: 1fr;
    }
}
