:root {
    --bg-primary: #fdf6ee;
    --bg-secondary: #fff9f2;
    --bg-card: #ffffff;
    --text-primary: #2d2013;
    --text-secondary: #6b5b4e;
    --text-muted: #9c8b7d;
    --accent: #c4613a;
    --accent-hover: #a84e2e;
    --accent-light: #f4ddd4;
    --border: #e8ddd4;
    --shadow: rgba(45, 32, 19, 0.08);
    --shadow-hover: rgba(45, 32, 19, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --header-bg: #ffffff;
    --tag-bg: #f4ebe3;
    --input-bg: #ffffff;
    --overlay: rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] {
    --bg-primary: #1a1510;
    --bg-secondary: #231d16;
    --bg-card: #2d2519;
    --text-primary: #f0e6db;
    --text-secondary: #bfad9e;
    --text-muted: #8c7b6d;
    --accent: #e07650;
    --accent-hover: #f08a64;
    --accent-light: #3d2820;
    --border: #3d3228;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-hover: rgba(0, 0, 0, 0.5);
    --header-bg: #231d16;
    --tag-bg: #3d3228;
    --input-bg: #2d2519;
    --overlay: rgba(0, 0, 0, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.5rem;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-actions {
    padding-top: 0.1rem;
}

.hamburger-nav {
    position: relative;
}

.hamburger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--tag-bg);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.hamburger-btn:hover,
.hamburger-nav.open .hamburger-btn {
    color: var(--accent);
    background: var(--accent-light);
}

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

.hamburger-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 210px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 32px var(--shadow-hover);
    padding: 0.35rem;
    z-index: 200;
}

.hamburger-nav.open .hamburger-menu {
    display: block;
}

.hamburger-item {
    display: block;
    width: 100%;
    padding: 0.65rem 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent);
    background: var(--accent-light);
}

.theme-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.theme-btn:hover {
    background: var(--accent-light);
}

/* Main */
main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.3rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--tag-bg);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-favorite-active {
    background: #e8a838;
    color: #fff;
    border-color: #e8a838;
}

.btn-favorite-active:hover {
    background: #d49520;
}

.card-fav-star {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1.3rem;
    color: #e8a838;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--input-bg);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Cards grid */
.recipe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.recipe-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.recipe-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--shadow-hover);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--accent-light);
}

.card-image-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--accent-light), var(--tag-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.card-body {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-body h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.card-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.card-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.card-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.tag {
    background: var(--tag-bg);
    color: var(--text-secondary);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Search & Filters */
.search-bar {
    margin-bottom: 2rem;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.search-input-wrapper input {
    width: 100%;
    padding: 0.9rem 1.2rem 0.9rem 3rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    background: var(--bg-card);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
}

.filters {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
}

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

.filter-chip {
    background: var(--tag-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover, .filter-chip.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.category-menu {
    position: relative;
}

.category-menu-btn {
    min-width: 170px;
    text-align: left;
}

.category-menu-list {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 32px var(--shadow-hover);
    padding: 0.35rem;
    z-index: 150;
}

.category-menu.open .category-menu-list {
    display: block;
}

.category-menu-item {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    padding: 0.65rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
}

.category-menu-item.subcategory {
    padding-left: 1.4rem;
}

.category-menu-item:hover,
.category-menu-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

/* Tag Filter Menu */
.tag-menu {
    position: relative;
}

.tag-menu-btn {
    min-width: 120px;
    text-align: left;
}

.tag-menu-list {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 32px var(--shadow-hover);
    padding: 0.35rem;
    z-index: 150;
}

.tag-menu.open .tag-menu-list {
    display: block;
}

.tag-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    user-select: none;
}

.tag-menu-item:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.tag-menu-item input[type=checkbox] {
    accent-color: var(--accent);
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.tag-menu-clear {
    display: block;
    width: 100%;
    background: none;
    border: none;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem;
    margin-top: 0.25rem;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
}

.tag-menu-clear:hover {
    color: var(--accent);
}

/* Recipe Detail */
.recipe-detail {
    max-width: 800px;
    margin: 0 auto;
}

.recipe-detail-header {
    margin-bottom: 2rem;
}

.recipe-detail-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.recipe-detail-header .description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.recipe-hero-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.recipe-meta-bar {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
}

.meta-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.meta-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-item .value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.recipe-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
}

.recipe-content h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.ingredients-list {
    list-style: none;
}

.ingredients-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s, text-decoration 0.2s;
}

.ingredients-list li.checked-off {
    text-decoration: line-through;
    opacity: 0.45;
}

/* Star Rating */
.star-rating {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-top: 0.6rem;
}

.star-rating .star {
    font-size: 1.6rem;
    color: var(--border);
    cursor: pointer;
    transition: color 0.15s, transform 0.15s;
    user-select: none;
    line-height: 1;
}

.star-rating .star.star-filled {
    color: #f5a623;
}

.star-rating .star.star-hover {
    color: #f5c563;
    transform: scale(1.15);
}

.star-rating .star:active {
    transform: scale(0.9);
}

.star-rating .rating-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.card-stars {
    font-size: 0.85rem;
    color: #f5a623;
    margin-bottom: 0.25rem;
}

.card-stars .card-rating-count {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.ingredients-list li:last-child {
    border-bottom: none;
}

.instructions-list {
    list-style: none;
    counter-reset: step;
}

.instructions-list li {
    counter-increment: step;
    padding: 1rem 0;
    padding-left: 3rem;
    position: relative;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    line-height: 1.7;
}

.instructions-list li:last-child {
    border-bottom: none;
}

.instructions-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1rem;
    width: 2rem;
    height: 2rem;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.recipe-notes {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--accent);
}

.recipe-notes h3 {
    margin-bottom: 0.5rem;
}

.recipe-notes p {
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.recipe-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

/* Scale control */
.scale-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
}

.scale-control label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.scale-control input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
}

.scale-control .scale-value {
    font-weight: 700;
    color: var(--accent);
    min-width: 5ch;
    text-align: center;
}

/* Import page */
.import-section {
    max-width: 600px;
    margin: 0 auto;
}

.import-section h2 {
    margin-bottom: 1rem;
}

.import-url-form {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.import-url-form input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-primary);
}

.import-url-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.import-preview {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.import-preview h3 {
    margin-bottom: 1rem;
    color: var(--accent);
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
}

.spinner {
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.75rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px var(--shadow-hover);
    border-left: 4px solid var(--accent);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Confirm modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px var(--shadow-hover);
}

.modal h3 {
    margin-bottom: 1rem;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .header-brand,
    .hamburger-nav,
    .hamburger-btn {
        width: 100%;
    }

    .hamburger-btn {
        justify-content: center;
    }

    .hamburger-menu {
        width: 100%;
    }

    nav {
        width: 100%;
        justify-content: center;
    }

    .recipe-grid {
        grid-template-columns: 1fr;
    }

    .recipe-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .recipe-detail-header h2 {
        font-size: 1.5rem;
    }

    .import-url-form {
        flex-direction: column;
    }

    .recipe-meta-bar {
        gap: 1rem;
    }

    .recipe-actions {
        flex-wrap: wrap;
    }
}

/* Auth Pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 20px var(--shadow);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
}

.auth-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.auth-submit {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    margin-top: 0.5rem;
}

.auth-error {
    background: #fdecea;
    color: #c62828;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

[data-theme="dark"] .auth-error {
    background: #3d2020;
    color: #ef9a9a;
}

/* Nav user display */
.nav-user {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.5rem 0.5rem;
    font-weight: 500;
}

/* Admin Page */
.admin-page {
    max-width: 800px;
    margin: 0 auto;
}

.admin-page h2 {
    margin-bottom: 1.5rem;
}

.admin-page h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.admin-create-user {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px var(--shadow);
}

.admin-users-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
}

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

.admin-table th {
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table input,
.admin-table select {
    width: 100%;
    min-width: 120px;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text-primary);
    font: inherit;
}

.pantry-table input {
    min-width: 130px;
}

.pantry-form-row {
    grid-template-columns: 2fr 1fr 1fr;
}

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

    .admin-table {
        display: block;
        overflow-x: auto;
    }
}

.role-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.role-admin {
    background: var(--accent-light);
    color: var(--accent);
}

.role-user {
    background: var(--tag-bg);
    color: var(--text-secondary);
}

/* Alpha Scrubber */
.alpha-scrubber {
    position: fixed;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    z-index: 90;
    padding: 6px 3px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px var(--shadow);
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.alpha-scrubber .alpha-letter {
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 1.5px 6px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1.4;
    transition: color 0.15s, background 0.15s;
}

.alpha-scrubber .alpha-letter:hover,
.alpha-scrubber .alpha-letter.active {
    color: var(--accent);
    background: var(--accent-light);
}

.alpha-scrubber .alpha-letter.disabled {
    color: var(--border);
    cursor: default;
}

.alpha-scrubber .alpha-letter.disabled:hover {
    background: transparent;
    color: var(--border);
}

@media (max-width: 768px) {
    .alpha-scrubber {
        right: 2px;
        padding: 4px 2px;
    }
    .alpha-scrubber .alpha-letter {
        font-size: 0.55rem;
        padding: 1px 5px;
    }
}

@media (max-width: 480px) {
    .alpha-scrubber {
        right: 1px;
        padding: 3px 1px;
        border-radius: 8px;
    }
    .alpha-scrubber .alpha-letter {
        font-size: 0.5rem;
        padding: 0.5px 4px;
        line-height: 1.3;
    }
}

/* Print */
@media print {
    header, footer, .recipe-actions, .scale-control, .theme-btn, nav, .alpha-scrubber {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    main {
        max-width: 100%;
        padding: 0;
    }

    .recipe-content {
        grid-template-columns: 1fr 2fr;
    }

    .recipe-hero-image {
        max-height: 250px;
    }

    .instructions-list li::before {
        background: black;
    }
}

/* Nav dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.nav-dropdown-btn {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: inherit;
    transition: background 0.2s;
}
.nav-dropdown-btn:hover {
    background: rgba(0,0,0,0.05);
}
[data-theme="dark"] .nav-dropdown-btn:hover {
    background: rgba(255,255,255,0.1);
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-primary, #fff);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 170px;
    z-index: 100;
    overflow: hidden;
}
.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-item {
    display: block;
    padding: 0.6rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    white-space: nowrap;
}
.nav-dropdown-item:hover {
    background: rgba(0,0,0,0.05);
}
[data-theme="dark"] .nav-dropdown-item:hover {
    background: rgba(255,255,255,0.1);
}
