/* === Accessibility utilities === */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Brand Design Tokens === */
:root {
    --color-primary:    #BF4B26;
    --color-accent:     #F0997B;
    --color-bg-soft:    #FAECE7;
    --color-text-dark:  #712B13;
    --color-text-mid:   #993C1D;
    --color-herb:       #639922;
    --color-warm-white: #FFF5F0;

    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body:    'Lato', 'Source Sans 3', sans-serif;

    --radius-card:   16px;
    --radius-button: 10px;
    --radius-pill:   999px;

    --space-section:    80px;
    --space-card-gap:   24px;
    --content-max-width: 760px;
}

/* === Base Reset === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background-color: var(--color-warm-white);
    color: var(--color-text-dark);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* === Typography Scale === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    color: var(--color-text-dark);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.375rem; }
small { font-size: 0.875rem; }

/* === Links === */
a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-text-mid);
}

/* === Buttons === */
.btn-primary {
    display: inline-block;
    background-color: var(--color-primary);
    color: white;
    border: 1.5px solid transparent;
    border-radius: var(--radius-button);
    padding: 0.625rem 1.25rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--color-text-mid);
    color: white;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Cards === */
.card {
    background-color: var(--color-bg-soft);
    border-radius: var(--radius-card);
    padding: var(--space-card-gap);
}

/* === Global Form Utilities === */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text-dark);
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.form-row .form-group {
    flex: 1;
    min-width: 180px;
}

.form-input {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text-dark);
    border: 1.5px solid var(--color-accent);
    border-radius: var(--radius-button);
    padding: 0.625rem 0.875rem;
    background: white;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s, outline-color 0.15s;
}

.form-input:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 1px;
    border-color: var(--color-primary);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

.form-group--inline {
    flex-direction: column;
    gap: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text-dark);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.form-hint {
    font-size: 0.8125rem;
    color: var(--color-text-mid);
    margin: 0;
}

.form-error {
    font-size: 0.875rem;
    color: #c62828;
    margin: 0.25rem 0 0;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.required {
    color: var(--color-primary);
}

.page-header {
    margin-bottom: 1.75rem;
}

.page-header .back-link {
    display: inline-block;
    color: var(--color-text-mid);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: 0.625rem;
    transition: color 0.15s;
}

.page-header .back-link:hover {
    color: var(--color-primary);
}

/* === Secondary Button === */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid var(--color-accent);
    border-radius: var(--radius-button);
    padding: 0.625rem 1.25rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--color-text-mid);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}

.btn-secondary:hover,
.btn-secondary.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === Sage AI Persona === */
.sage-icon {
    color: var(--color-herb);
    margin-right: 0.3em;
}

/* === GDPR Cookie Consent Banner === */
#cookie-consent-banner {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: min(560px, calc(100vw - 2rem));
    background: white;
    border: 1.5px solid var(--color-accent);
    border-radius: var(--radius-card);
    box-shadow: 0 8px 32px rgba(113, 43, 19, 0.15);
    animation: consent-slide-up 0.35s ease;
}

#cookie-consent-banner.consent-banner--hiding {
    animation: consent-slide-down 0.35s ease forwards;
}

@keyframes consent-slide-up {
    from { opacity: 0; transform: translateX(-50%) translateY(1rem); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes consent-slide-down {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to   { opacity: 0; transform: translateX(-50%) translateY(1rem); }
}

.consent-inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.125rem 1.25rem;
    flex-wrap: wrap;
}

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

.consent-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--color-text-dark);
    margin-bottom: 0.25rem;
}

.consent-body {
    font-size: 0.875rem;
    color: var(--color-text-mid);
    line-height: 1.5;
    margin: 0;
}

.consent-actions {
    display: flex;
    gap: 0.625rem;
    flex-shrink: 0;
}

.consent-btn {
    padding: 0.4rem 1rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-button);
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.consent-btn--accept {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.consent-btn--accept:hover {
    background-color: var(--color-text-dark);
    border-color: var(--color-text-dark);
    color: white;
}

.consent-btn--decline {
    background-color: transparent;
    color: var(--color-text-mid);
    border-color: var(--color-accent);
}

.consent-btn--decline:hover {
    border-color: var(--color-text-mid);
    color: var(--color-text-dark);
}

/* === Tags / Badges === */
.tag {
    background-color: var(--color-herb);
    color: white;
    border-radius: var(--radius-pill);
    padding: 0.2rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

/* === Tag Input Autocomplete === */
.tag-input-wrapper {
    position: relative;
}

.tag-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100;
    background: white;
    border: 1.5px solid var(--color-accent);
    border-radius: var(--radius-button);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tag-suggestion-item {
    background: none;
    border: none;
    padding: 0.5rem 0.875rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--color-text-dark);
    text-align: left;
    cursor: pointer;
    transition: background-color 0.1s;
}

.tag-suggestion-item:hover {
    background-color: var(--color-bg-soft);
    color: var(--color-primary);
}

/* === Layout === */
.content-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: var(--space-section) 0;
}

/* === Blazor Validation === */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* === App Shell === */
.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content { flex: 1; }

/* === Site Footer === */
.site-footer {
    background: var(--color-bg-soft);
    border-top: 1px solid var(--color-accent);
    padding: 1.25rem 1.5rem;
    margin-top: auto;
}

.site-footer-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.site-footer-brand {
    font-family: var(--font-heading);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-text-mid);
}

.site-footer-links {
    display: flex;
    gap: 1.25rem;
}

.site-footer-links a {
    font-size: 0.875rem;
    color: var(--color-text-mid);
    text-decoration: none;
    transition: color 0.15s;
}

.site-footer-links a:hover { color: var(--color-primary); }

/* === Legal Pages (Privacy / Terms) === */
.legal-page {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
}

.legal-page h1 { margin-bottom: 0.375rem; }

.legal-date {
    font-size: 0.875rem;
    color: var(--color-text-mid);
    margin-bottom: 2rem;
}

.legal-page h2 {
    font-size: 1.375rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--color-bg-soft);
}

.legal-page h3 {
    font-size: 1.0625rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-mid);
}

.legal-page p {
    margin-bottom: 0.875rem;
    line-height: 1.7;
}

.legal-page ul {
    padding-left: 1.5rem;
    margin-bottom: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    line-height: 1.7;
}

/* === Blazor Error UI === */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

#blazor-error-ui {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: var(--color-primary);
    color: white;
    padding: 0.75rem 1rem;
    display: none;
    z-index: 1000;
}

@media print {
    .site-header,
    .app-shell > *:not(.main-content) {
        display: none !important;
    }
}

/* === Help System === */

.help-hero {
    background-color: var(--color-bg-soft);
    text-align: center;
    padding: 5rem 1rem 4.5rem;
}

.help-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    color: var(--color-text-dark);
    margin-bottom: 1rem;
}

.help-hero-sub {
    font-size: 1.125rem;
    color: var(--color-text-mid);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.8;
}

.help-categories-section {
    padding: 4.5rem 1rem;
}

.help-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    margin-top: 2.5rem;
}

.help-category-card {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding: 2rem;
    background: white;
    border: 1.5px solid var(--color-bg-soft);
    border-radius: var(--radius-card);
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
}

.help-category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(113, 43, 19, 0.1);
    border-color: var(--color-accent);
}

.help-category-icon {
    font-size: 2rem;
    color: var(--color-primary);
    line-height: 1;
}

.help-category-card h3 {
    color: var(--color-text-dark);
    font-size: 1.125rem;
    margin: 0;
}

.help-category-card p {
    color: var(--color-text-mid);
    font-size: 0.9375rem;
    margin: 0;
    flex: 1;
    line-height: 1.65;
}

.help-category-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.help-faq-section {
    background-color: var(--color-bg-soft);
    padding: 4.5rem 1rem;
}

.help-faq-section h2 {
    margin-bottom: 2rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    background: white;
    border: 1.5px solid rgba(240, 153, 123, 0.4);
    border-radius: var(--radius-button);
    overflow: hidden;
}

.faq-item summary {
    cursor: pointer;
    padding: 1.125rem 1.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text-dark);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '\203A';
    font-size: 1.25rem;
    color: var(--color-accent);
    transform: rotate(90deg);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.faq-item[open] summary::after {
    transform: rotate(270deg);
}

.faq-item[open] summary {
    color: var(--color-primary);
    border-bottom: 1px solid var(--color-bg-soft);
}

.faq-body {
    padding: 1.25rem 1.5rem 1.5rem;
    color: var(--color-text-mid);
    font-size: 0.9375rem;
    line-height: 1.8;
}

.faq-body a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.help-article-page {
    padding: 3rem 1rem 5rem;
}

.help-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-mid);
    text-decoration: none;
    margin-bottom: 2.5rem;
    transition: color 0.15s;
}

.help-back-link:hover { color: var(--color-primary); }

.help-article-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding-bottom: 2.5rem;
    border-bottom: 2px solid var(--color-bg-soft);
}

.help-article-hero-icon {
    font-size: 3rem;
    color: var(--color-primary);
    flex-shrink: 0;
}

.help-article-hero h1 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: var(--color-text-dark);
    margin: 0 0 0.5rem;
}

.help-article-hero p {
    color: var(--color-text-mid);
    font-size: 1.0625rem;
    margin: 0;
    line-height: 1.7;
}

.help-toc {
    border-left: 3px solid var(--color-herb);
    background: #f4fbe8;
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius-button) var(--radius-button) 0;
    margin-bottom: 3rem;
}

.help-toc-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-herb);
    margin-bottom: 0.75rem;
}

.help-toc ol {
    margin: 0;
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.help-toc a {
    font-size: 0.9375rem;
    color: var(--color-text-dark);
    text-decoration: none;
    font-weight: 600;
}

.help-toc a:hover { color: var(--color-primary); }

.help-section {
    margin-bottom: 3.5rem;
    padding-bottom: 3.5rem;
    border-bottom: 1px solid var(--color-bg-soft);
    scroll-margin-top: 5rem;
}

.help-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.help-section h2 {
    color: var(--color-text-dark);
    font-size: 1.375rem;
    margin-bottom: 1.25rem;
    scroll-margin-top: 5rem;
}

.help-section h3 {
    color: var(--color-text-dark);
    font-size: 1.0625rem;
    margin: 1.75rem 0 0.75rem;
}

.help-section p {
    color: var(--color-text-mid);
    line-height: 1.8;
    margin-bottom: 1.125rem;
}

.help-section ul, .help-section ol {
    padding-left: 1.5rem;
    color: var(--color-text-mid);
    line-height: 1.8;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.help-use-case {
    border-left: 3px solid var(--color-herb);
    background: #f4fbe8;
    padding: 1.125rem 1.375rem;
    border-radius: 0 var(--radius-button) var(--radius-button) 0;
    margin: 1.5rem 0;
}

.help-use-case-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-herb);
    margin-bottom: 0.5rem;
}

.help-use-case p {
    font-size: 0.9375rem;
    color: var(--color-text-dark);
    margin: 0;
    font-style: italic;
    line-height: 1.7;
}

.help-explore-band {
    background: var(--color-bg-soft);
    border-radius: var(--radius-card);
    padding: 2.25rem 2.5rem;
    margin-top: 4rem;
}

.help-explore-band h3 {
    color: var(--color-text-dark);
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.help-explore-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.help-explore-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1.5px solid var(--color-accent);
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-dark);
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s;
}

.help-explore-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

@media (max-width: 900px) {
    .help-categories { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .help-categories { grid-template-columns: 1fr; }
    .help-article-hero { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .help-article-hero-icon { font-size: 2rem; }
    .help-article-page { padding: 2rem 1rem 4rem; }
    .help-explore-band { padding: 1.75rem; }
}

/* === Recipe ownership badge === */

.recipe-ownership-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.recipe-ownership-shared {
    background: #eef5ff;
    color: #2563eb;
}

.recipe-ownership-public {
    background: #f0fdf4;
    color: #16a34a;
}

.recipe-ownership-cross {
    background: var(--color-bg-soft);
    color: var(--color-text-mid);
}

/* === Sharing picker (RecipeAdd / RecipeEdit) === */

.sharing-picker {
    border: 1.5px solid var(--color-accent);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--color-warm-white);
}

.sharing-picker-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sharing-code-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.sharing-code-input {
    max-width: 140px;
    font-family: monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sharing-code-confirm {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    background: #f0fdf4;
    border-radius: 8px;
    border: 1px solid #86efac;
}

.sharing-error {
    font-size: 0.875rem;
    color: var(--color-primary);
}

.sharing-name-results {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-accent);
    border-radius: 8px;
    overflow: hidden;
    max-height: 180px;
    overflow-y: auto;
}

.sharing-name-result {
    background: white;
    border: none;
    padding: 0.6rem 1rem;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    color: var(--color-text-dark);
    border-bottom: 1px solid var(--color-bg-soft);
    transition: background 0.15s;
}

.sharing-name-result:last-child { border-bottom: none; }
.sharing-name-result:hover { background: var(--color-bg-soft); color: var(--color-primary); }

.shared-family-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.shared-family-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--color-bg-soft);
    color: var(--color-text-dark);
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
}

.shared-family-tag .tag-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-mid);
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

.shared-family-tag .tag-remove:hover { color: var(--color-primary); }

.sharing-empty-hint {
    font-size: 0.875rem;
    color: var(--color-text-mid);
    font-style: italic;
    margin: 0;
}

/* Small action buttons used in the sharing picker (RecipeAdd / RecipeEdit) */
.btn-primary-sm {
    display: inline-flex;
    align-items: center;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-button);
    padding: 0.3rem 0.75rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary-sm:hover:not(:disabled) { background: var(--color-text-mid); color: white; }
.btn-primary-sm:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-ghost-sm {
    display: inline-flex;
    align-items: center;
    background: transparent;
    color: var(--color-text-mid);
    border: 1px solid transparent;
    border-radius: var(--radius-button);
    padding: 0.3rem 0.75rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.btn-ghost-sm:hover { color: var(--color-primary); border-color: var(--color-accent); }

/* ── Accessibility ──────────────────────────────────────────────────────── */

/* Skip to main content — visually hidden until focused */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-button);
    text-decoration: none;
    transition: top 0.15s;
}

.skip-link:focus {
    top: 1rem;
}

/* Global focus-visible ring for keyboard navigation */
:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Suppress the default browser outline for mouse/pointer users */
:focus:not(:focus-visible) {
    outline: none;
}

/* Ensure inputs keep a subtle visible border even without focus-visible */
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Ask Sage button — shared across pages */
.btn-sage {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: transparent;
    color: var(--color-herb);
    border: 1px solid var(--color-herb);
    border-radius: var(--radius-button, 10px);
    padding: 0.375rem 0.875rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.4;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-sage:hover {
    background: var(--color-herb);
    color: #fff;
}
