:root {
    --bg: #f4f5f6;
    --text: #111111;
    --muted: #666666;
    --line: #d9d9d9;
    --accent: #1f1f1f;
    --ok-bg: #f1f7f1;
    --ok-line: #c8e1c8;
    --err-bg: #fff3f3;
    --err-line: #efc6c6;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.4;
}

.app-shell {
    max-width: 760px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 82px;
}

.topbar {
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(17, 17, 17, 0.04);
}

.env-banner {
    margin: -2px 0 12px;
    padding: 8px 10px;
    border: 1px solid #e7b54b;
    border-radius: 10px;
    background: linear-gradient(135deg, #fff7db 0%, #fff1bf 100%);
    color: #5c4300;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.env-banner-label {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(92, 67, 0, 0.12);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.env-banner-text {
    font-size: 0.82rem;
    font-weight: 600;
}

.topbar-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.topbar-subtitle {
    font-size: 0.82rem;
    color: var(--muted);
}

.content {
    padding: 12px;
    display: grid;
    gap: 10px;
}

.card {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(17, 17, 17, 0.045);
}

h1, h2 {
    margin: 0 0 10px;
    line-height: 1.25;
}

h1 {
    font-size: 1.05rem;
}

h2 {
    font-size: 0.95rem;
}

p {
    margin: 0;
}

.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.inline-form {
    margin-top: 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.compact-form {
    margin-top: 8px;
}

label {
    font-size: 0.85rem;
    color: var(--muted);
}

input,
select,
button,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    font-size: 1rem;
    background: #fff;
    color: var(--text);
}

button {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    cursor: pointer;
}

.btn-secondary {
    background: #fff;
    color: var(--text);
    border-color: var(--line);
}

.flash {
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.92rem;
}

.flash-ok {
    background: var(--ok-bg);
    border-color: var(--ok-line);
}

.flash-error {
    background: var(--err-bg);
    border-color: var(--err-line);
}

.flash-warning {
    background: #fff9e8;
    border-color: #ead9a6;
}

.simple-list {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
}

.simple-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.stacked-list {
    padding-left: 0;
    list-style: none;
    gap: 10px;
}

.item-row {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.item-head-top {
    align-items: flex-start;
}

.item-head form {
    width: auto;
}

.item-head .btn-secondary {
    width: auto;
    padding: 8px 10px;
}

.alias-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ingredient-checklist {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    display: grid;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.chip-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.82rem;
    background: #fafafa;
}

.offer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
    border: 1px solid transparent;
}

.badge-wishlist {
    background: #eef5ff;
    border-color: #bdd4ff;
}

.badge-frequent {
    background: #f6f1ff;
    border-color: #d6c3ff;
}
.check-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    color: var(--text);
    font-size: 0.92rem;
}

.check-item input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
}
.editor-toolbar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.rich-editor {
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 120px;
    padding: 10px;
}

.rich-editor:focus {
    outline: 2px solid #d0d0d0;
    outline-offset: 0;
}

details summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.92rem;
}

.muted {
    color: var(--muted);
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 -8px 20px rgba(17, 17, 17, 0.05);
}

.nav-link {
    text-align: center;
    text-decoration: none;
    color: var(--muted);
    padding: 10px 4px;
    font-size: 0.75rem;
    border-right: 1px solid var(--line);
}

.nav-link:last-child {
    border-right: 0;
}

.nav-link.is-active {
    color: var(--text);
    font-weight: 600;
}

@media (min-width: 740px) {
    .bottom-nav {
        left: 50%;
        transform: translateX(-50%);
        max-width: 760px;
        border-left: 1px solid var(--line);
        border-right: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
    }
}



.check-form {
    width: auto;
}

.check-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.85rem;
}

.check-toggle input[type="checkbox"] {
    width: auto;
    margin: 0;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.item-main {
    flex: 1;
    display: grid;
    gap: 2px;
}

.delete-form {
    width: auto;
}

.icon-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1;
}

/* UI refresh: sticky header + safe-area nav + segment toggles */
.app-shell {
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
}

.topbar {
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(17, 17, 17, 0.04);
}

.topbar-title {
    font-size: 1rem;
    font-weight: 700;
}

.topbar-subtitle {
    display: none;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 -8px 20px rgba(17, 17, 17, 0.05);
}

.nav-link {
    border-right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 66px;
}

.nav-emoji {
    font-size: 1.05rem;
    line-height: 1;
}

.subnav-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.subnav-link {
    text-align: center;
    text-decoration: none;
    color: var(--muted);
    background: #fff;
    padding: 10px 12px;
    font-size: 0.92rem;
    border: 0;
}

.subnav-link.is-active {
    color: #fff;
    background: var(--accent);
    font-weight: 600;
}

/* Compact tuning for shopping tab */
.content {
    padding: 6px 10px 12px;
    gap: 8px;
}

.shopping-controls,
.archive-controls {
    padding: 8px 10px;
}

.shopping-controls .subnav-toggle,
.archive-controls .subnav-toggle {
    margin-top: 0;
    margin-bottom: 6px;
}

.shopping-add-row {
    margin-top: 0;
    display: grid;
    grid-template-columns: 1fr 42px;
    gap: 6px;
}

.shopping-add-row input {
    padding: 8px 10px;
    font-size: 0.95rem;
}

.add-plus {
    background: #111;
    border-color: #111;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
}

.shopping-meta-row {
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.market-switch-wrap {
    display: grid;
    gap: 4px;
}

.market-label {
    font-size: 0.78rem;
    color: var(--muted);
}

.market-switch {
    display: inline-flex;
    gap: 4px;
    flex-wrap: wrap;
}

.market-switch form,
.undo-inline,
.shopping-actions form,
.shopping-item-line .check-form {
    width: auto;
    margin: 0;
}

.market-btn {
    width: auto;
    min-width: 58px;
    padding: 5px 8px;
    font-size: 0.78rem;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
}

.market-btn.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.undo-btn {
    width: 40px;
    height: 32px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 1rem;
    padding: 0;
}

.shopping-group {
    margin: 0;
}

.shopping-controls + .shopping-group {
    margin-top: 12px;
}

.shopping-group + .shopping-group {
    margin-top: 8px;
}

.shopping-group-title {
    margin: 0 0 8px;
    padding-left: 2px;
    font-size: 0.95rem;
}

.shopping-items-box {
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(17, 17, 17, 0.035);
}

.shopping-item {
    padding: 4px 10px;
}

.shopping-item + .shopping-item {
    border-top: 1px solid var(--line);
}

.shopping-item-line {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
}

.shopping-item-line .check-form input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.shopping-qty {
    color: var(--muted);
    font-size: 0.76rem;
    white-space: nowrap;
}

.shopping-name {
    font-size: 0.88rem;
    line-height: 1.12;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shopping-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 2px;
}

.icon-plain {
    border: 0;
    background: transparent;
    color: var(--muted);
    width: auto;
    min-width: auto;
    padding: 0;
    line-height: 1;
    font-size: 1rem;
}

.shopping-action-btn {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--muted);
}

.shopping-action-btn .icon {
    width: 12px;
    height: 12px;
}

.shopping-edit-btn {
    color: #6f786f;
}

.shopping-delete-btn {
    color: #8b948c;
}

.shopping-delete-btn .icon {
    width: 11px;
    height: 11px;
    opacity: 0.78;
}

.item-hint {
    margin-top: 2px;
    font-size: 0.75rem;
    color: var(--muted);
}

.shopping-edit {
    margin-top: 6px;
    border-top: 1px solid var(--line);
    padding-top: 6px;
}

.shopping-edit-form {
    margin-top: 0;
}

.shopping-edit-form input,
.shopping-edit-form select,
.shopping-edit-form button {
    padding: 7px 9px;
    font-size: 0.9rem;
}

/* Compact tuning for archive tab */
.archive-search-row {
    margin-top: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
}

.archive-search-row input,
.archive-search-row button {
    padding: 8px 10px;
    font-size: 0.9rem;
}

.archive-group {
    margin: 0;
}

.archive-accordion-list {
    display: grid;
    gap: 8px;
}

.archive-accordion {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(17, 17, 17, 0.035);
    overflow: hidden;
}

.archive-accordion-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text);
}

.archive-accordion-summary::-webkit-details-marker {
    display: none;
}

.archive-accordion-title {
    font-size: 0.92rem;
    font-weight: 600;
}

.archive-accordion-count {
    min-width: 28px;
    padding: 2px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8f8f8;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.archive-accordion-body {
    border-top: 1px solid var(--line);
    padding: 8px;
}

.archive-loading {
    font-size: 0.84rem;
}

.archive-item {
    padding: 6px 8px;
}

.archive-item + .archive-item {
    border-top: 1px solid var(--line);
}

.archive-item-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.archive-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.archive-name {
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.archive-category {
    color: var(--muted);
    font-size: 0.78rem;
}

.archive-meta {
    margin-top: 2px;
    display: grid;
    gap: 1px;
}

.archive-meta-line {
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.2;
}

.archive-edit {
    margin-top: 6px;
    border-top: 1px solid var(--line);
    padding-top: 6px;
}

.archive-inline-row {
    margin-top: 0;
    display: grid;
    grid-template-columns: 1fr 44px;
    gap: 6px;
}

.archive-token-row {
    align-items: stretch;
}

.archive-inline-row input,
.archive-inline-row button {
    padding: 7px 9px;
    font-size: 0.88rem;
}

.archive-title-row {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.archive-inline-category {
    font-size: 0.74rem;
    color: var(--muted);
    white-space: nowrap;
}

.archive-note {
    font-size: 0.76rem;
    margin-bottom: 4px;
}

.bubble-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
}

.bubble-label {
    font-size: 0.72rem;
    color: var(--muted);
}

.bubble {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.74rem;
    color: var(--text);
    background: #f8f8f8;
}

.token-input-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 6px;
    display: grid;
    gap: 6px;
    min-height: 40px;
}

.token-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.token-text-input {
    border: 0;
    padding: 0;
    font-size: 0.88rem;
    outline: none;
    background: transparent;
}

.token-text-input:focus {
    outline: none;
}

.archive-inline-row {
    grid-template-columns: 1fr 44px;
    align-items: stretch;
}

.archive-inline-row > button {
    height: 100%;
}

.bubble {
    gap: 6px;
}

.bubble-x {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 0;
    width: auto;
    min-width: auto;
    font-size: 0.82rem;
    line-height: 1;
    cursor: pointer;
}

.bubble-x:hover {
    color: var(--text);
}

.item-hint-row {
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hint-confirm-form {
    width: auto;
    margin: 0;
}

.hint-confirm-btn {
    width: 20px;
    height: 20px;
    min-width: 20px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid #5cb85c;
    background: #66c266;
    color: #fff;
    font-size: 0.74rem;
    line-height: 1;
}

.review-badge {
    margin-top: 4px;
    display: inline-flex;
    align-items: stretch;
    border-radius: 12px;
    overflow: hidden;
    background: #111;
}

.review-label {
    color: #fff;
    padding: 6px 10px;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.review-action-form {
    width: auto;
    margin: 0;
}

.review-btn {
    width: 40px;
    min-width: 40px;
    height: 34px;
    border-radius: 0;
    border: 0;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
    color: #111;
}

.review-btn-confirm {
    background: #4caf50;
    border-left: 1px solid #2e8f33;
}

.review-btn-switch {
    background: #fff200;
    border-left: 1px solid #d8cc00;
}

.shopping-name-wrap {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.review-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
}

.review-pill-label {
    padding: 3px 6px;
    font-size: 0.7rem;
    color: var(--muted);
    white-space: nowrap;
}

.review-action-form {
    width: auto;
    margin: 0;
}

.review-btn {
    width: 22px;
    min-width: 22px;
    height: 22px;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    padding: 0;
    font-size: 0.78rem;
    line-height: 1;
    color: var(--text);
}

.review-btn-confirm {
    background: #f5fbf5;
    color: #2f7d32;
}

.review-btn-switch {
    background: #fffef2;
    color: #7a6c00;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(17, 17, 17, 0.34);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 12px 12px;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(620px, 100%);
    margin: 0;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.modal-close {
    font-size: 1.25rem;
    color: var(--muted);
}

.shopping-variant {
    font-size: 0.66rem;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 1px 5px;
    white-space: nowrap;
}

.meals-controls,
.offers-controls {
    padding: 8px 10px;
}

.meals-list-card {
    padding: 8px 10px;
}

.meals-add-row,
.offers-add-row {
    margin-top: 0;
    display: grid;
    grid-template-columns: 1fr 42px;
    gap: 6px;
}

.meals-add-row input,
.offers-add-row input {
    padding: 8px 10px;
    font-size: 0.95rem;
}

.meals-note-input {
    margin-top: 6px;
    padding: 8px 10px;
    font-size: 0.9rem;
}

.meals-items-box {
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(17, 17, 17, 0.035);
}

.meals-item {
    padding: 7px 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.meals-item + .meals-item {
    border-top: 1px solid var(--line);
}

.meals-item-main {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.meals-item-name {
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meals-item-note {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offers-main {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.home-hero,
.home-stats {
    padding: 10px 12px;
}

.home-stat {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(17, 17, 17, 0.035);
}

.offers-item-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.offers-item-line .shopping-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meal-planner-head {
    padding: 8px 10px;
}

.meal-planner-head h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.meal-planner-toggle {
    margin-top: 0;
}

.meal-planner-add {
    padding: 8px 10px;
}

.meal-row-input {
    margin-top: 0;
    display: grid;
    grid-template-columns: 1fr 42px;
    gap: 6px;
}

.meal-row-input input {
    padding: 8px 10px;
    font-size: 0.95rem;
}

.meal-autocomplete-wrap {
    position: relative;
}

.meal-autocomplete-wrap input {
    width: 100%;
}

.meal-autocomplete-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 8;
    display: grid;
    gap: 1px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(17, 17, 17, 0.08);
}

.meal-autocomplete-list[hidden] {
    display: none !important;
}

.meal-autocomplete-item {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    display: grid;
    justify-items: start;
    gap: 2px;
    text-align: left;
}

.meal-autocomplete-item strong {
    font-size: 0.92rem;
}

.meal-autocomplete-item span {
    font-size: 0.76rem;
    color: var(--muted);
}

.meal-autocomplete-item:hover,
.meal-autocomplete-item:focus {
    background: #f6f7f9;
}
.meal-recipe-list {
    display: grid;
    gap: 8px;
}

.meal-recipe-card {
    padding: 0;
    overflow: hidden;
}

.meal-recipe-summary {
    list-style: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    cursor: pointer;
}

.meal-recipe-summary::-webkit-details-marker {
    display: none;
}

.meal-recipe-title-wrap {
    min-width: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.meal-recipe-title {
    font-size: 1.05rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meal-recipe-count {
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.meal-recipe-icons {
    color: var(--muted);
    font-size: 0.95rem;
    letter-spacing: 2px;
}

.meal-recipe-body {
    border-top: 1px solid var(--line);
    padding: 10px 12px 12px;
    display: grid;
    gap: 10px;
}

.meal-ingredient-add {
    margin-top: 0;
}

.meal-ingredients-box {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
    display: grid;
    gap: 8px;
}

.meal-ingredient-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

.meal-ingredient-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.meal-ingredient-left {
    min-width: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meal-ingredient-qty {
    color: var(--muted);
}

.meal-ingredient-right {
    color: #b8bcc4;
    font-size: 0.92rem;
}

.meal-instruction-head {
    display: block;
    margin-top: 2px;
}

.meal-instruction-head strong {
    font-size: 0.9rem;
    letter-spacing: 0.2px;
}

.meal-to-shopping-form {
    margin-top: 4px;
}

.meal-recipe-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.meal-inline-delete {
    display: inline;
    margin: 0;
}

.meal-ingredient-cat {
    color: var(--muted);
    font-size: 0.78rem;
    margin-left: 4px;
}

.meal-ingredient-edit {
    list-style: none;
    margin: 2px 0 0;
    padding-top: 8px;
    border-top: 1px solid #f1f1f1;
}

.meal-shopping-modal-card {
    width: min(560px, 100%);
}

.meal-modal-checklist {
    max-height: 42vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 8px;
}

.meal-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.btn-light {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--line);
}

.btn-dark {
    background: #1b1d21;
    color: #fff;
    border: 1px solid #1b1d21;
}

.home-stats-main {
    padding: 10px 12px;
}

.home-stat-wide {
    grid-column: 1 / -1;
}

.home-panels {
    display: grid;
    gap: 10px;
}

.home-panel {
    padding: 10px 12px;
}

.home-panel h2 {
    margin-bottom: 8px;
}



.home-calendar-embed {
    width: 100%;
    min-height: 420px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(17, 17, 17, 0.035);
}

.home-calendar-fallback {
    margin-top: 8px;
    font-size: 0.84rem;
}

.home-waste-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.home-waste-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    display: grid;
    gap: 2px;
    font-size: 0.9rem;
}

.home-waste-item span {
    color: var(--muted);
    font-size: 0.82rem;
}

@media (max-width: 760px) {
    .home-calendar-embed {
    width: 100%;
    min-height: 420px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(17, 17, 17, 0.035);
}
}

.home-panel-waste {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 0;
}

.home-panel-scroll {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.home-waste-item {
    position: relative;
    padding: 8px 8px 8px 16px;
    overflow: hidden;
}

.home-waste-item::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 7px;
    bottom: 7px;
    width: 5px;
    border-radius: 999px;
    background: #9aa0aa;
}

.home-waste-item.waste-type-restbio::before {
    background: #54585f;
}

.home-waste-item.waste-type-paper::before {
    background: linear-gradient(180deg, #28a745 0%, #f2c11b 100%);
}

.home-waste-item.waste-type-gift::before {
    background: #d64949;
}

@media (max-width: 760px) {
    .home-panel-scroll {
        max-height: 320px;
    }
}

.meals-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.meals-item-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.meals-check {
    width: 16px;
    height: 16px;
    margin: 0;
}

.meals-grabber {
    cursor: grab;
    touch-action: none;
    color: #b0b5bf;
    font-size: 0.95rem;
    letter-spacing: -1px;
}

.meals-item.is-done .meals-item-name {
    text-decoration: line-through;
    color: var(--muted);
}

.meals-item.is-dragging {
    opacity: 0.5;
}

.tasks-controls {
    padding: 8px 10px;
}

.task-add-open {
    width: auto;
    min-width: 180px;
    padding: 8px 10px;
}

.tasks-list {
    display: grid;
    gap: 10px;
}

.task-card {
    padding: 10px;
    display: grid;
    gap: 8px;
}

.task-head-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
}

.task-open-btn {
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    width: 100%;
    min-width: 0;
    padding: 0;
}

.task-open-btn h3 {
    margin: 0;
    font-size: 1rem;
}

.task-desc-preview {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.88rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.task-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 20px;
}

.task-due {
    font-size: 0.78rem;
    color: var(--muted);
}

.task-assignee-bubble {
    font-size: 0.76rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 7px;
    background: #f7f7f7;
}

.task-check-form,
.task-delete-form {
    width: auto;
    margin: 0;
}

.task-check {
    width: 16px;
    height: 16px;
    margin: 0;
}

.task-grabber {
    cursor: grab;
    touch-action: none;
    color: #b0b5bf;
    font-size: 0.95rem;
    letter-spacing: -1px;
}

.task-card.is-dragging {
    opacity: 0.5;
}

.task-done-section summary {
    user-select: none;
}

.tasks-done-list {
    margin-top: 8px;
    display: grid;
    gap: 6px;
}

.task-done-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.task-done-main strong {
    color: var(--muted);
    text-decoration: line-through;
}

.task-add-modal-card {
    width: min(520px, 100%);
}

.task-add-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-detail-dialog {
    border: 0;
    padding: 0;
    margin: auto;
    width: min(560px, 92vw);
    background: transparent;
}

.task-detail-dialog::backdrop {
    background: rgba(17, 17, 17, 0.35);
}

.task-detail-card {
    border: 0;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    overflow: hidden;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
}

.task-detail-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.task-detail-card h3 {
    margin: 0;
}

.task-detail-body {
    margin-top: 2px;
    color: var(--text);
    white-space: pre-wrap;
}

.task-detail-body .inline-form {
    margin-top: 0;
}

.task-detail-meta {
    margin-top: 10px;
    display: grid;
    gap: 2px;
    font-size: 0.9rem;
}








/* Line icon system */
.icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: currentColor;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
}

.icon-home {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11.5 12 4l9 7.5M6 10v10h12V10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 11.5 12 4l9 7.5M6 10v10h12V10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-cart {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.5 5h2l2.2 10.2a1.5 1.5 0 0 0 1.47 1.18h8.9a1.5 1.5 0 0 0 1.47-1.2l1.1-6.2H7.2M10 20a1 1 0 1 1 0-.01M18 20a1 1 0 1 1 0-.01' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.5 5h2l2.2 10.2a1.5 1.5 0 0 0 1.47 1.18h8.9a1.5 1.5 0 0 0 1.47-1.2l1.1-6.2H7.2M10 20a1 1 0 1 1 0-.01M18 20a1 1 0 1 1 0-.01' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-tag {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 3H5v6l8.5 8.5a1.8 1.8 0 0 0 2.55 0l4.45-4.45a1.8 1.8 0 0 0 0-2.55L12 3Zm-3 4.2a1.2 1.2 0 1 1 0-.01' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 3H5v6l8.5 8.5a1.8 1.8 0 0 0 2.55 0l4.45-4.45a1.8 1.8 0 0 0 0-2.55L12 3Zm-3 4.2a1.2 1.2 0 1 1 0-.01' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-utensils {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3v7M9 3v7M6 7h3M7.5 10v11M15 3c1.9 0 3.5 1.6 3.5 3.5V14h-3V3Zm0 11v7' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3v7M9 3v7M6 7h3M7.5 10v11M15 3c1.9 0 3.5 1.6 3.5 3.5V14h-3V3Zm0 11v7' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-checklist {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6h10M9 12h10M9 18h10M4 6l1.5 1.5L7.8 5.2M4 12l1.5 1.5L7.8 11.2M4 18l1.5 1.5L7.8 17.2' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6h10M9 12h10M9 18h10M4 6l1.5 1.5L7.8 5.2M4 12l1.5 1.5L7.8 11.2M4 18l1.5 1.5L7.8 17.2' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-edit {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m4 20 3.6-.7L18.5 8.4a2 2 0 0 0 0-2.8l-.1-.1a2 2 0 0 0-2.8 0L4.7 16.4 4 20Zm9.9-12.9 3 3' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m4 20 3.6-.7L18.5 8.4a2 2 0 0 0 0-2.8l-.1-.1a2 2 0 0 0-2.8 0L4.7 16.4 4 20Zm9.9-12.9 3 3' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-trash {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 5.5h10M9.2 5.5V4h5.6v1.5M6 7.5h12M7.2 7.5l.7 11.3a1 1 0 0 0 1 .9h6.2a1 1 0 0 0 1-.9l.7-11.3M10 10.2v6.6M14 10.2v6.6' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 5.5h10M9.2 5.5V4h5.6v1.5M6 7.5h12M7.2 7.5l.7 11.3a1 1 0 0 0 1 .9h6.2a1 1 0 0 0 1-.9l.7-11.3M10 10.2v6.6M14 10.2v6.6' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-calendar {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 3v3M17 3v3M4 9h16M5.5 5.5h13a1.5 1.5 0 0 1 1.5 1.5v11a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 18V7a1.5 1.5 0 0 1 1.5-1.5Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 3v3M17 3v3M4 9h16M5.5 5.5h13a1.5 1.5 0 0 1 1.5 1.5v11a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 18V7a1.5 1.5 0 0 1 1.5-1.5Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.icon-logout {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 6h4a1.5 1.5 0 0 1 1.5 1.5v9A1.5 1.5 0 0 1 17 18h-4M10 8 6 12l4 4M6.5 12H15' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 6h4a1.5 1.5 0 0 1 1.5 1.5v9A1.5 1.5 0 0 1 17 18h-4M10 8 6 12l4 4M6.5 12H15' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.nav-emoji {
    width: 18px;
    height: 18px;
    color: #1a1a1a;
}

.icon-plain .icon {
    width: 16px;
    height: 16px;
}

.task-due {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.task-due-icon {
    width: 13px;
    height: 13px;
    color: var(--muted);
}

.task-detail-close-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    line-height: 1;
}

.task-detail-card {
    padding: 8px 10px 8px;
}

.task-detail-card header {
    margin-bottom: 2px;
}

.task-detail-body {
    margin-top: 0;
}

.task-detail-body .inline-form {
    margin-top: 0;
    gap: 6px;
}

.home-calendar-fallback {
    margin-top: 8px;
}

.home-calendar-fallback summary {
    color: var(--muted);
    cursor: pointer;
    font-size: 0.84rem;
}

.home-calendar-fallback p {
    margin-top: 6px;
}




.home-mini-list,
.home-event-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.home-mini-item,
.home-event-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    display: grid;
    gap: 2px;
    background: #fff;
}

.home-mini-item strong,
.home-event-item strong {
    font-size: 0.92rem;
}

.home-mini-item span,
.home-event-item span {
    color: var(--muted);
    font-size: 0.82rem;
}

.home-panel-calendar,
.home-panel-waste {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 0;
}

.home-panel-scroll {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

@media (max-width: 760px) {
    .home-panel-scroll {
        max-height: 320px;
    }
}

.tasks-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 168px;
    gap: 8px;
    align-items: center;
}

.tasks-filter-form {
    margin: 0;
}

.tasks-filter-form select {
    height: 38px;
    font-size: 0.88rem;
}

.task-card {
    position: relative;
    overflow: hidden;
    padding: 10px 10px 10px 16px;
}

.task-done-item {
    position: relative;
    overflow: hidden;
    padding: 8px 8px 8px 16px;
}

.task-card::before,
.task-done-item::before {
    content: '';
    position: absolute;
    left: 6px;
    top: 8px;
    bottom: 8px;
    width: 6px;
    border-radius: 999px;
    background: #9aa0aa;
}

.task-meta-row {
    gap: 8px;
}

.task-meta-right {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.task-category-label,
.task-assignee-bubble {
    font-size: 0.76rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 7px;
    background: #f7f7f7;
}

.task-category-label {
    color: #5f6470;
}

.task-card-category-vorbereitungen::before,
.task-done-item.task-card-category-vorbereitungen::before {
    background: #4f8df7;
}

.task-card-category-notizen::before,
.task-done-item.task-card-category-notizen::before {
    background: #8b95a7;
}

.task-card-category-haus::before,
.task-done-item.task-card-category-haus::before {
    background: #3aa76d;
}

.task-card-category-arbeit::before,
.task-done-item.task-card-category-arbeit::before {
    background: #f0a43a;
}

.task-card-category-allgemein::before,
.task-done-item.task-card-category-allgemein::before {
    background: #6f7682;
}

.task-card-category-kinder::before,
.task-done-item.task-card-category-kinder::before {
    background: #e36b8c;
}

@media (max-width: 640px) {
    .tasks-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .task-meta-row {
        align-items: flex-start;
    }
}
.home-calendar-status {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 0.84rem;
    line-height: 1.35;
}
.archive-section + .archive-section {
    margin-top: 10px;
}

.archive-section-title {
    margin: 0 0 3px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text);
}

.archive-variant-form {
    grid-template-columns: minmax(0, 1fr) 44px;
}

.archive-variant-wrap {
    gap: 8px;
}

.archive-variant-inputs {
    display: grid;
    gap: 6px;
}

.bubble-variant {
    background: #f5f5f5;
}

.bubble-meta {
    color: var(--muted);
    font-size: 0.7rem;
}

.meal-recipe-body > .compact-form {
    margin-top: 0;
    padding-top: 0;
}

.meal-recipe-body > .compact-form textarea {
    min-height: 132px;
}


.topbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.topbar-auth-form {
    width: auto;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.topbar-user {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
}

.topbar-logout {
    width: 32px;
    height: 32px;
    min-width: 32px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
}

.app-shell-auth {
    padding-bottom: 0;
}

.content-auth {
    min-height: calc(100vh - 66px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
}

.login-card {
    width: min(420px, 100%);
}

.login-form {
    margin-top: 10px;
}
@media (min-width: 740px) {
    .bottom-nav {
        left: 50%;
        right: auto;
        width: min(760px, 100vw);
        transform: translateX(-50%);
        border-left: 1px solid var(--line);
        border-right: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
    }
}


/* PWA safety overrides */
.app-shell {
    padding-bottom: calc(117px + env(safe-area-inset-bottom, 0px));
}

.bottom-nav {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 9px);
}

body {
    overscroll-behavior: none;
}


/* Home refresh: tasks + unified calendar */
.home-panel-full {
    grid-column: 1 / -1;
}

.home-event-item {
    position: relative;
    padding: 8px 10px 8px 16px;
    overflow: hidden;
}

.home-event-item::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 7px;
    bottom: 7px;
    width: 5px;
    border-radius: 999px;
    background: #d7d9dd;
}

.home-event-birthday {
    background: #fff1f6;
    border-color: #f2ceda;
}

.home-event-birthday::before {
    background: #e38cab;
}

.home-event-waste-restbio::before {
    background: #54585f;
}

.home-event-waste-paper::before {
    background: linear-gradient(180deg, #28a745 0%, #f2c11b 100%);
}

.home-event-waste-gift::before {
    background: #d64949;
}

/* Soft Utility redesign foundation */
:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f6f6f1;
    --surface-muted: #f1f2eb;
    --text: #1f241f;
    --muted: #667067;
    --line: #d8ddd3;
    --line-strong: #bcc6b8;
    --accent: #2d5b4d;
    --accent-strong: #21483c;
    --accent-soft: #e7f0eb;
    --shadow-soft: 0 10px 30px rgba(31, 36, 31, 0.05);
    --shadow-panel: 0 18px 40px rgba(31, 36, 31, 0.06);
    --ok-bg: #eef8f0;
    --ok-line: #b8d9bf;
    --err-bg: #fff4f2;
    --err-line: #edc7c1;
}

body {
    background:
        radial-gradient(circle at top, #f8faf6 0%, #ffffff 28%),
        #ffffff;
    color: var(--text);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.app-shell {
    max-width: 860px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 16px 16px 14px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(188, 198, 184, 0.7);
    box-shadow: 0 10px 30px rgba(31, 36, 31, 0.04);
}

.topbar-title {
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0;
}

.topbar-user {
    color: var(--muted);
    font-size: 0.8rem;
}

.topbar-logout {
    border-color: var(--line);
    background: var(--surface-soft);
    color: var(--accent-strong);
}

.content {
    padding: 14px 12px 18px;
    gap: 12px;
}

.card,
.shopping-items-box,
.archive-accordion,
.meals-items-box,
.home-stat,
.home-mini-item,
.home-event-item,
.task-card,
.task-done-item,
.home-calendar-embed {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.card,
.home-hero,
.home-stats,
.home-panel,
.shopping-controls,
.archive-controls,
.meals-controls,
.offers-controls,
.meal-planner-head,
.meal-planner-add,
.tasks-controls {
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfa 100%);
    box-shadow: var(--shadow-panel);
}

h1 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

h2 {
    font-size: 1rem;
    margin-bottom: 10px;
}

label,
.market-label,
.bubble-label,
.archive-inline-category,
.task-due,
.item-hint,
.archive-category,
.home-mini-item span,
.home-event-item span {
    color: var(--muted);
}

input,
select,
button,
textarea {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(45, 91, 77, 0.55);
    box-shadow: 0 0 0 4px rgba(45, 91, 77, 0.12);
}

button {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
    border-color: var(--accent-strong);
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn-secondary,
.btn-light,
.market-btn,
.subnav-link,
.topbar-logout,
.undo-btn,
.icon-btn {
    background: var(--surface-soft);
    color: var(--text);
    border-color: var(--line);
    box-shadow: none;
}

.btn-secondary,
.btn-light {
    color: var(--accent-strong);
}

.subnav-toggle {
    padding: 4px;
    border-radius: 14px;
    background: var(--surface-muted);
    border-color: transparent;
    gap: 6px;
}

.subnav-link {
    border-radius: 10px;
    padding: 11px 12px;
    font-weight: 600;
}

.meal-planner-toggle {
    gap: 8px;
}

.meal-planner-head + .meal-planner-add,
.meal-planner-add + .card,
.tasks-controls + .tasks-list,
.tasks-list + .task-done-section {
    margin-top: 12px;
}

.meal-planner-head {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.meal-planner-toggle {
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
}

.meal-planner-toggle .subnav-link {
    background: var(--surface-soft);
    border: 1px solid transparent;
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.meal-planner-toggle .subnav-link.is-active {
    background: #fff;
    border-color: var(--line);
    box-shadow: none;
}

.meal-planner-add {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.meal-row-input {
    gap: 10px;
}

.meal-row-input input {
    padding: 12px 14px;
}

.meals-note-input {
    margin-top: 10px;
    padding: 12px 14px;
    background: var(--surface-soft);
    border-color: transparent;
}

.meals-list-section {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.meals-items-box {
    margin-top: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    display: grid;
    gap: 10px;
}

.meals-item {
    padding: 14px 16px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    border: 0;
    border-radius: 18px;
    background: var(--surface-soft);
    box-shadow: none;
}

.meals-item + .meals-item {
    border-top: 0;
}

.meals-item-left {
    gap: 10px;
}

.meals-item-main {
    gap: 3px;
}

.meals-item-name {
    font-size: 1rem;
}

.meals-item-note {
    font-size: 0.82rem;
}

.meals-grabber {
    color: #b8b8b1;
}

.meals-check {
    accent-color: var(--accent);
}

/* Flat page system for remaining screens */
.shopping-controls,
.tasks-controls,
.archive-controls,
.offers-controls {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.shopping-controls .subnav-toggle,
.archive-controls .subnav-toggle {
    padding: 0;
    margin-bottom: 10px;
    border: 0;
    background: transparent;
    overflow: visible;
}

.shopping-controls .subnav-link,
.archive-controls .subnav-link {
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-soft);
    border: 1px solid transparent;
}

.shopping-controls .subnav-link.is-active,
.archive-controls .subnav-link.is-active {
    background: #fff;
    border-color: var(--line);
    box-shadow: none;
}

.shopping-add-row,
.archive-search-row,
.offers-add-row {
    gap: 10px;
}

.shopping-add-row input,
.archive-search-row input,
.archive-search-row button,
.offers-add-row input {
    padding: 12px 14px;
}

.shopping-meta-row {
    margin-top: 10px;
    padding: 0 2px;
}

.market-switch-wrap {
    gap: 8px;
}

.market-switch {
    gap: 8px;
}

.shopping-controls + .shopping-group {
    margin-top: 10px;
}

.shopping-group {
    margin: 0;
}

.shopping-group + .shopping-group {
    margin-top: 8px;
}

.shopping-group-title {
    margin: 0 0 5px;
    padding-left: 2px;
    font-size: 0.92rem;
}

.shopping-items-box {
    margin-top: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    display: grid;
    gap: 4px;
}

.shopping-item {
    padding: 6px 9px;
    border: 0;
    border-radius: 14px;
    background: var(--surface-soft);
    box-shadow: none;
}

.shopping-item + .shopping-item {
    border-top: 0;
}

.shopping-item-line {
    gap: 6px;
}

.shopping-edit {
    margin-top: 6px;
    border-top: 0;
    padding-top: 0;
}

.shopping-edit-form {
    padding-top: 6px;
}

.tasks-controls + .tasks-list {
    margin-top: 14px;
}

.tasks-toolbar {
    gap: 10px;
}

.task-add-open,
.tasks-filter-form select {
    height: 54px;
    border-radius: 16px;
}

.tasks-list {
    gap: 10px;
}

.task-card,
.task-done-item {
    border: 0;
    border-radius: 18px;
    background: var(--surface-soft);
    box-shadow: none;
}

.task-done-section {
    margin-top: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.task-done-section details {
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--surface-soft);
}

.archive-results-shell {
    margin-top: 14px;
}

.archive-accordion-list {
    gap: 10px;
}

.archive-accordion {
    border: 0;
    border-radius: 18px;
    background: var(--surface-soft);
    box-shadow: none;
}

.archive-accordion-body {
    border-top: 0;
    padding: 0 0 4px;
}

.archive-item {
    padding: 10px 12px;
}

.archive-item + .archive-item {
    border-top: 0;
    margin-top: 8px;
}

.offers-section {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.offers-controls + .offers-section,
.offers-section + .offers-section {
    margin-top: 14px;
}

.offers-section .shopping-items-box {
    margin-top: 12px;
}

.offers-section .chip-wrap {
    gap: 8px;
}

/* Flat home screen */
.home-stats {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    gap: 10px;
}

.home-stats-main {
    padding: 0;
}

.home-stat {
    padding: 16px;
    border: 0;
    border-radius: 18px;
    background: var(--surface-soft);
    box-shadow: none;
}

.home-stat h2 {
    margin-bottom: 6px;
}

.home-panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.home-panel-calendar {
    margin-top: 16px;
}

.home-panel-calendar h2 {
    margin-bottom: 10px;
}

.home-panel-scroll {
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.home-mini-list,
.home-event-list {
    gap: 10px;
}

.home-mini-item,
.home-event-item {
    border: 0;
    border-radius: 18px;
    padding: 14px 16px;
    background: var(--surface-soft);
    box-shadow: none;
}

.home-event-item {
    padding-left: 20px;
}

.home-event-item::before {
    left: 8px;
    top: 10px;
    bottom: 10px;
}

.home-calendar-status {
    margin-bottom: 12px;
}

.home-task-preview-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.home-task-preview {
    padding: 12px 14px 12px 18px;
    background: #fff;
}

.home-task-preview-main {
    display: grid;
    gap: 4px;
}

.home-task-preview-main strong {
    font-size: 0.96rem;
}

.home-task-preview-meta {
    color: var(--muted);
    font-size: 0.82rem;
}

.subnav-link.is-active,
.market-btn.is-active {
    background: var(--surface);
    color: var(--accent-strong);
    border-color: rgba(45, 91, 77, 0.2);
    box-shadow: 0 6px 18px rgba(45, 91, 77, 0.12);
}

.market-switch {
    gap: 6px;
}

.flash {
    border-radius: 14px;
    padding: 10px 12px;
}

.chip,
.badge,
.task-category-label,
.task-assignee-bubble,
.archive-accordion-count,
.shopping-variant,
.bubble {
    background: var(--surface-soft);
    border-color: var(--line);
    color: var(--text);
}

.review-pill {
    border-radius: 999px;
}

.bottom-nav {
    left: 50%;
    right: auto;
    width: min(860px, 100%);
    transform: translateX(-50%);
    margin: 0 auto;
    padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 12px);
    gap: 8px;
    background: rgba(250, 251, 247, 0.96);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(188, 198, 184, 0.82);
    border-bottom: 0;
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    box-shadow: 0 -12px 28px rgba(31, 36, 31, 0.08);
}

.nav-link {
    min-height: 62px;
    padding: 10px 6px;
    border-radius: 16px;
    color: var(--muted);
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-link.is-active {
    color: var(--accent-strong);
    background: var(--surface);
    box-shadow: inset 0 0 0 1px rgba(45, 91, 77, 0.12);
}

.nav-emoji {
    color: currentColor;
}

.env-banner {
    border-color: #d9c47f;
    background: linear-gradient(135deg, #faf4d8 0%, #f4e8b8 100%);
    color: #5e4b17;
    box-shadow: none;
}

.env-banner-label {
    background: rgba(94, 75, 23, 0.11);
}

@media (min-width: 740px) {
    .content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .bottom-nav {
        width: min(860px, calc(100vw - 24px));
    }
}
