/* Global Styles */
:root {
    --primary-color: #FF8c00;
    /* Appetizing orange */
    --accent-color: #4CAF50;
    /* Fresh green */
    --bg-color: #f9f9f9;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #dddddd;
    --input-bg: #f5f5f5;
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.1);

    /* PFC Colors */
    --p-color: #2196F3;
    /* Protein - Blue */
    --f-color: #FBC02D;
    /* Fat - Yellow */
    --c-color: #F44336;
    /* Carb - Red */
    --kcal-color: #E65100;
    
    /* Quick Conversion Board Colors */
    --quick-primary: #ff6f00;
    --quick-secondary: #ff8f00;
    --quick-bg: #fff3e0;
    --quick-accent: #ff5722;
    --volume-color: #2196f3;
    --mass-color: #4caf50;
    --tools-color: #ff9800;
    --international-color: #9c27b0;
}

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

body {
    font-family: 'Zen Maru Gothic', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 1rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    min-height: 1.6em;
    display: flex;
    align-items: center;
    justify-content: center;
}

header h1 a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
    display: block;
}

header h1 a:hover {
    opacity: 0.8;
}

/* Category Tabs Navigation */
.category-tabs {
    display: flex;
    background-color: #fff;
    border-bottom: 2px solid #ffe0b2;
    position: sticky;
    top: 0;
    z-index: 1001;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.category-tabs::-webkit-scrollbar {
    display: none;
    /* Safari/Chrome */
}

.category-tab {
    flex: 0 0 auto;
    text-align: center;
    padding: 12px 15px;
    text-decoration: none;
    color: #8d6e63;
    font-size: 0.85rem;
    font-weight: 700;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.category-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: #fff8eb;
}

/* Nutrition Card Styling */
.nutrition-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.2rem;
    margin-top: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid #eee;
}

.nutrition-card .total-kcal {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px dashed #eee;
}

.nutrition-card .kcal-label {
    display: block;
    font-size: 0.85rem;
    font-weight: bold;
    color: #666;
    margin-bottom: 2px;
}

.nutrition-card .kcal-val {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--kcal-color);
    font-family: 'Zen Maru Gothic', sans-serif;
}

.nutrition-card .kcal-unit {
    font-size: 1rem;
    margin-left: 4px;
}

.pfc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pfc-item {
    text-align: center;
    padding: 10px 5px;
    border-radius: 12px;
}

.pfc-item.p {
    background: #E3F2FD;
    border: 1px solid #BBDEFB;
}

.pfc-item.f {
    background: #FFFDE7;
    border: 1px solid #FFF9C4;
}

.pfc-item.c {
    background: #FFEBEE;
    border: 1px solid #FFCDD2;
}

.pfc-label {
    display: block;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.pfc-item.p .pfc-label {
    color: #1565C0;
}

.pfc-item.f .pfc-label {
    color: #F57F17;
}

.pfc-item.c .pfc-label {
    color: #C62828;
}

.pfc-val {
    font-size: 1.3rem;
    font-weight: 900;
}

.pfc-unit {
    font-size: 0.75rem;
    margin-left: 2px;
}

.nutrition-source {
    margin-top: 1rem;
    font-size: 0.7rem;
    color: #999;
    text-align: center;
}

.nutrition-source a {
    color: #999;
}

@media (max-width: 400px) {
    .nutrition-card .kcal-val {
        font-size: 1.8rem;
    }

    .pfc-val {
        font-size: 1.1rem;
    }
}

.category-tab:hover:not(.active) {
    background-color: #fffaf0;
}

/* Original Navigation (Secondary) */
.main-nav {
    background-color: #fff8eb;
    padding: 0.8rem 0.5rem;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-bottom: 1px solid #ffe0b2;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.main-nav a {
    flex: 0 0 auto;
    text-decoration: none;
    color: #8d6e63;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: #fff;
    border: 1px solid #ffe0b2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.main-nav a.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(255, 140, 0, 0.3);
    transform: translateY(-2px);
}

.main-nav a:hover:not(.active) {
    background-color: #fff;
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Breadcrumb Navigation */
.breadcrumb {
    padding: 10px 1rem;
    font-size: 0.8rem;
    color: #8d6e63;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #ccc;
}

/* Recommend Section at bottom */
.recommend-section {
    margin: 3rem 0;
    padding: 2rem 1rem;
    background-color: #fff;
    border-radius: 24px;
    border: 1px solid #ffe0b2;
    box-shadow: var(--shadow-md);
}

.recommend-header {
    font-size: 1.1rem;
    font-weight: 900;
    color: #795548;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.recommend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
}

.recommend-item {
    background: #fff8f0;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    min-height: 48px;
    justify-content: center;
}

.recommend-item:hover {
    background: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.recommend-item .icon {
    font-size: 1.4rem;
}

.recommend-item .name {
    font-size: 0.8rem;
    font-weight: 700;
}

/* CTA Buttons from QA */
.cta-calc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--accent-color);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transition: all 0.2s ease;
    min-height: 48px;
}

.cta-calc-btn:hover {
    background-color: #43a047;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.4);
}

/* Floating Home Button */
.floating-home-btn {
    position: fixed;
    bottom: 25px;
    right: 20px;
    width: 56px;
    height: 56px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    z-index: 2000;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid white;
}

.floating-home-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.unit-note {
    font-size: 0.7rem;
    color: #888;
    margin-top: 0.5rem;
    text-align: right;
}

/* Ingredient Grid Styles */
.ingredient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    margin-top: 2rem;
}

.ingredient-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem 1rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.ingredient-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--primary-color);
    opacity: 0.6;
}

.ingredient-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(255, 140, 0, 0.15);
    border-color: var(--primary-color);
}

.ingredient-card .emoji {
    font-size: 2.5rem;
    transition: transform 0.3s ease;
}

.ingredient-card:hover .emoji {
    transform: scale(1.1) rotate(5deg);
}

.ingredient-card .name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #444;
}

.ingredient-card.featured-link {
    border: 2px solid #ffccbc;
    background-color: #fff5ee;
}

.ingredient-card.featured-link {
    border: 2px solid #ffccbc;
    background-color: #fff5ee;
}

.ingredient-card::after {
    content: '→';
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
}

.ingredient-card:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #5d4037;
    margin: 2rem 0 1rem;
    padding-bottom: 8px;
    border-bottom: 3px solid #ffe0b2;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hub Section & Cards */
.hub-section {
    margin-bottom: 3rem;
}

.hub-category-title {
    font-size: 1.1rem;
    font-weight: 900;
    color: #795548;
    background: #fff8eb;
    padding: 8px 15px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 1.2rem;
    border-left: 5px solid var(--primary-color);
}

.hub-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 600px) {
    .hub-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.hub-card {
    background: white;
    border-radius: 16px;
    padding: 1.2rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #eee;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
}

.hub-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 140, 0, 0.12);
    border-color: var(--primary-color);
}

.hub-card .icon {
    font-size: 2rem;
    background: #fff3e0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.hub-card .content {
    flex-grow: 1;
}

.hub-card .title {
    display: block;
    font-weight: 900;
    font-size: 1.05rem;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
}

.hub-card .desc {
    display: block;
    font-size: 0.8rem;
    color: #777;
    line-height: 1.4;
}

.hub-card::after {
    content: '›';
    font-size: 1.5rem;
    color: #ccc;
    font-weight: bold;
}

.container .section-title:first-child,
.container section:first-child .section-title {
    margin-top: 0;
}

/* Main Container */
.container {
    flex: 1;
    padding: 1rem;
    max-width: 700px;
    /* Increased from 600px to use more site width */
    margin: 0 auto;
    width: 100%;
}

/* Converter Card */
.converter-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

/* Input Groups */
.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
    color: #333;
}

.input-group select,
.input-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1.1rem;
    /* Large font for readability */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-bg);
    transition: border-color 0.2s, background-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

/* Custom dropdown arrow for better cross-browser look, mostly for mobile */
.ingredient-select {
    position: relative;
    margin-bottom: 1.5rem;
}

.ingredient-select select {
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
}

/* Conversion Row Layout */
.conversion-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 0.5rem;
}

.conversion-row .calc-input {
    flex: 2;
    /* 2/3 width */
    font-size: 1.5rem;
    /* Large font for source */
    font-weight: bold;
    padding: 0.8rem;
}

/* Quick Conversion Board Styles */
.quick-conversion-board {
    background: linear-gradient(135deg, var(--quick-bg) 0%, #ffe0b2 100%);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    border: 2px solid var(--quick-primary);
    box-shadow: 0 8px 25px rgba(255, 152, 0, 0.15);
}

.board-title {
    color: var(--quick-primary);
    font-size: 1.8rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Main Input Area - Simplified */
.main-input-area {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.quick-number {
    flex: 1;
    min-width: 150px;
    max-width: 250px;
    padding: 1.2rem;
    border: 2px solid var(--quick-primary);
    border-radius: 12px;
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

.quick-number:focus {
    outline: none;
    border-color: var(--quick-accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.3);
}

.quick-unit-select {
    padding: 1.2rem 1.5rem;
    border: 2px solid var(--quick-primary);
    border-radius: 12px;
    background: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

.quick-unit-select:focus {
    outline: none;
    border-color: var(--quick-accent);
    transform: translateY(-2px);
}

/* Current Status Display */
.current-status {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(255, 152, 0, 0.2);
}

.status-text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--quick-primary);
}

/* Ingredient Option Toggle */
.ingredient-option-toggle {
    text-align: center;
    margin-bottom: 1rem;
}

.option-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: white;
    border: 2px solid var(--quick-secondary);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--quick-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.15);
}

.option-toggle-btn:hover {
    background: var(--quick-bg);
    border-color: var(--quick-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.25);
}

.option-toggle-btn[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

/* Collapsible Ingredient Selection Panel */
.ingredient-selection-panel {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    border: 2px solid rgba(255, 152, 0, 0.4);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.15);
    min-height: 80px;
}

.ingredient-selection-panel[hidden] {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ingredient-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    overflow: visible;
}

.ingredient-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--quick-secondary);
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color) !important;
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.1);
    min-height: 40px;
    min-width: 80px;
    position: relative;
    z-index: 1;
    text-align: center;
    line-height: 1.2;
}

.ingredient-chip:hover {
    background: var(--quick-bg);
    border-color: var(--quick-primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(255, 152, 0, 0.2);
}

.ingredient-chip.active {
    background: var(--quick-primary);
    color: white;
    border-color: var(--quick-accent);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.3);
}

/* Mobile Responsive - Only apply to actual mobile screens */
@media (max-width: 768px) {
    .ingredient-chip {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        min-height: 36px;
        min-width: 70px;
    }
}

@media (max-width: 480px) {
    .ingredient-chip {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        min-height: 32px;
        min-width: 60px;
    }
}

/* Remove problematic CSS that was hiding text on all screens */
.ingredient-chip span.chip-text {
    display: inline;
}

.ingredient-chip::before {
    display: none;
}

/* Ensure text visibility across all screen sizes */
.ingredient-chip {
    color: var(--text-color) !important;
}

.ingredient-chip.active {
    color: white !important;
}

.quick-results-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.result-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 5px solid;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0.3;
}

.result-card.volume {
    border-left-color: var(--volume-color);
}

.result-card.mass {
    border-left-color: var(--mass-color);
}

.result-card.tools {
    border-left-color: var(--tools-color);
}

.result-card.international {
    border-left-color: var(--international-color);
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-card.volume .card-title {
    color: var(--volume-color);
}

.result-card.mass .card-title {
    color: var(--mass-color);
}

.result-card.tools .card-title {
    color: var(--tools-color);
}

.result-card.international .card-title {
    color: var(--international-color);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    min-width: 60px;
    text-align: right;
}

.result-item .unit {
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    margin-left: 0.5rem;
}

/* SEO Structure (Hidden) */
.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;
}

.quick-results-dl dt {
    font-weight: 600;
    margin-top: 0.5rem;
}

.quick-results-dl dd {
    margin-left: 1rem;
    color: #666;
}

/* 海外レシピSOS - やわらかいUI要素 */
.overseas-sos-header {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #6c5ce7;
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    text-align: center;
    border: 3px solid #fff;
    box-shadow: 0 8px 25px rgba(253, 203, 110, 0.3);
}

.overseas-sos-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.overseas-sos-header p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.9;
}

.soft-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 18px;
    padding: 2rem;
    border: 2px solid #f1f3f5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.soft-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.soft-card h3 {
    color: #6c5ce7;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.soft-card p {
    color: #636e72;
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.gentle-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.3);
    border: none;
    cursor: pointer;
    line-height: 1.4;
}

.gentle-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(116, 185, 255, 0.4);
    background: linear-gradient(135deg, #0984e3 0%, #74b9ff 100%);
}

.friendly-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin: 2rem 0;
}

.friendly-table thead {
    background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
    color: white;
}

.friendly-table th {
    padding: 1.2rem;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
}

.friendly-table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.95rem;
    line-height: 1.6;
}

.friendly-table tr:hover {
    background: #f8f9fa;
}

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

.cute-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
    vertical-align: middle;
    font-size: 1.2rem;
}

.warm-highlight {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-radius: 15px;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 2px solid #fff;
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.2);
}

.warm-highlight h3 {
    color: #d63031;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.warm-highlight p {
    color: #636e72;
    line-height: 1.7;
    margin-bottom: 0;
}

.visual-guide-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.cup-visual-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 1.5rem;
    border: 2px solid #e9ecef;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.cup-visual {
    width: 100%;
    height: 180px;
    background: white;
    border-radius: 10px;
    border: 3px solid #e9ecef;
    position: relative;
    margin: 1.5rem 0;
    overflow: hidden;
}

.cup-fill {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(180deg, #74b9ff 0%, #0984e3 100%);
    border-radius: 0 0 7px 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}

.cup-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #6c5ce7;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.comparison-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.comparison-item {
    text-align: center;
    flex: 1;
}

.comparison-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    display: block;
}

.comparison-text {
    font-size: 0.9rem;
    color: #636e72;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .visual-guide-container {
        grid-template-columns: 1fr;
    }
    
    .comparison-visual {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .gentle-chip {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}
@media (max-width: 768px) {
    .quick-conversion-board {
        padding: 1.5rem;
        margin: 1rem;
    }

    .board-title {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    .main-input-area {
        flex-direction: column;
        gap: 1rem;
    }

    .quick-number {
        max-width: 100%;
        width: 100%;
        font-size: 1.2rem;
    }

    .quick-unit-select {
        width: 100%;
        font-size: 1rem;
    }

    .current-status {
        margin-bottom: 1rem;
        padding: 0.6rem;
    }

    .status-text {
        font-size: 0.8rem;
    }

    .option-toggle-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }

    .ingredient-selection-panel {
        padding: 0.8rem;
        margin-bottom: 1.5rem;
    }

    .ingredient-chips {
        gap: 0.6rem;
    }

    .ingredient-chip {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        min-height: 36px;
        min-width: 70px;
        color: var(--text-color) !important;
    }

    .quick-results-board {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .result-card {
        padding: 1rem;
    }

    .result-item .value {
        font-size: 1.1rem;
    }

    .card-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .quick-results-board {
        grid-template-columns: 1fr;
    }

    .ingredient-chips {
        gap: 0.4rem;
    }

    .ingredient-chip {
        flex: 1;
        min-width: 60px;
        text-align: center;
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        min-height: 32px;
        color: var(--text-color) !important;
    }
}

.ingredient-option {
    margin-bottom: 0.8rem;
    padding: 0.4rem 0.8rem;
    background-color: #fff8e1;
    border-radius: 12px;
    border: 1px solid #ffecb3;
    box-shadow: 0 4px 10px rgba(255, 140, 0, 0.05);
}

.ingredient-option .custom-select-trigger {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
}

.density-info {
    font-size: 0.75rem;
    color: #e65100;
    background-color: #fff3e0;
    padding: 2px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-top: 5px;
    font-weight: bold;
    border: 1px solid #ffe0b2;
}

.unit-select {
    display: none;
    /* Hide original select */
}

/* Custom Select Styles */
.custom-select-wrapper {
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.conversion-row .custom-select-wrapper {
    flex: 1.2;
}

.custom-select-trigger {
    background-color: #f0f0f0;
    padding: 0.8rem 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    color: #444;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.custom-select-trigger::after {
    content: '';
    width: 0.8rem;
    height: 0.8rem;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    z-index: 100;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
}

.custom-options.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 0.8rem 1rem;
    /* Same padding as trigger */
    font-size: 1rem;
    /* Same font size */
    border-bottom: 1px solid #f0f0f0;
    color: #333;
    transition: background-color 0.2s;
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background-color: #f9f9f9;
}

.custom-option.selected {
    background-color: #e8f5e9;
    color: #2e7d32;
    font-weight: bold;
}

/* Reference Section */
.reference-section {
    margin-top: 2rem;
    padding-top: 1rem;
    min-height: 120px;
    /* Prevent CLS */
    border-top: 1px dashed #eee;
}

.ref-title {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
}

#reference-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ref-item {
    font-size: 0.9rem;
    color: #555;
    /* Thin/light color as requested */
    background-color: #f8f8f8;
    padding: 4px 8px;
    border-radius: 4px;
}

.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #fff;
}

/* Directional Arrow / Separator */
.converter-arrow {
    text-align: center;
    margin: 1rem auto;
    /* Adjusted spacing */
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    user-select: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    /* Pop shadow */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Reset Button */
.reset-area {
    text-align: right;
    margin-top: 1rem;
}

#reset-btn {
    background: transparent;
    border: 1px solid #ccc;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #444;
    cursor: pointer;
}

#reset-btn:active {
    background-color: #eee;
}


/* Amazon/Marketing Container */
.amazon-container {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    background-color: #fff3e0;
    /* Light orange bg */
    border-radius: 8px;
    border: 1px solid #ffe0b2;
}

.amazon-text {
    font-size: 1rem;
    color: #222;
    margin-bottom: 1rem;
    font-weight: bold;
}

.amazon-btn {
    display: inline-block;
    background-color: #FF9900;
    /* Amazon Orange */
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    /* Slightly rounded like Amazon buttons */
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s, transform 0.1s;
}

.amazon-btn:hover {
    background-color: #e68a00;
    /* Darker orange */
    transform: translateY(-1px);
}

.amazon-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.9rem;
    color: #777;
    background-color: #f1f1f1;
}

.disclaimer {
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.5rem;
}

/* Responsive adjustments */
@media (min-width: 600px) {
    header h1 {
        font-size: 1.6rem;
    }

    .converter-card {
        padding: 2.5rem;
    }
}

/* Mobile responsive fix */
@media (max-width: 480px) {
    header {
        padding: 0.6rem;
    }

    header h1 {
        font-size: 1.1rem;
        min-height: auto;
    }

    .container {
        padding: 0.8rem;
    }

    .main-nav {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0.5rem 0.8rem;
        gap: 6px;
        scrollbar-width: none;
        /* Firefox */
    }

    .main-nav::-webkit-scrollbar {
        display: none;
        /* Safari and Chrome */
    }

    .main-nav a {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 5px 12px;
        font-size: 0.85rem;
    }

    .ingredient-option {
        padding: 0.5rem 0.8rem;
        margin-bottom: 0.8rem;
    }

    .converter-card {
        padding: 1rem;
    }

    .conversion-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        /* Slightly closer than default */
    }

    .conversion-row .calc-input,
    .conversion-row .unit-select {
        flex: auto;
        width: 100%;
        font-size: 1.1rem;
        /* Ensure readable size */
    }

    /* .conversion-row .unit-select is now hidden via global style, specific mobile override removed */

    .custom-select-wrapper {
        width: 100%;
        flex: auto;
    }

    .custom-select-trigger {
        font-size: 1.1rem;
        /* Large font for mobile */
        padding: 0.8rem;
    }

    .custom-option {
        padding: 0.8rem;
        /* Large touch target */
        font-size: 1.1rem;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

.placeholder-text {
    color: #767676 !important;
    /* Gray text for default preview */
}

/* SEO Content Section */
.seo-content {
    margin-top: 2rem;
}

.container>.seo-content:first-child {
    margin-top: 0;
}

.seo-content {
    padding-top: 1rem;
}

.seo-block {
    margin-bottom: 3rem;
}

/* Recipe Scaler */
.recipe-scaler-card {
    background-color: #fff;
    padding: 1.5rem;
    border-radius: 20px;
    /* More rounded */
    box-shadow: 0 8px 20px rgba(255, 150, 50, 0.15);
    /* Orange glow shadow */
    margin-top: 2rem;
    border: 3px solid #ffecb3;
    /* Pop border */
    min-height: 400px;
    /* Prevent CLS */
    contain: content;
    /* CSS containment for performance */
}

.recipe-scaler-card h2 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    background: #fff8e1;
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Baking Knowledge Content */
.knowledge-box {
    background-color: #fffcf5;
    border: 1.5px solid #ffe0b2;
    border-radius: 16px;
    padding: 1.2rem;
    margin-top: 2rem;
}

.knowledge-box h3 {
    font-size: 1.15rem;
    /* Increased */
    color: #e65100;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px dashed #ffd180;
    padding-bottom: 10px;
    letter-spacing: 0.02em;
}

.knowledge-item {
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.knowledge-item h4 {
    font-size: 1rem;
    /* Increased from 0.9rem */
    color: #8d6e63;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.knowledge-item p {
    font-size: 0.95rem;
    /* Increased from 0.8rem */
    color: #555;
    margin-bottom: 0.3rem;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

.knowledge-item .tip-badge {
    display: inline-block;
    background-color: #fff3e0;
    color: #e65100;
    padding: 1px 6px;
    border: 1px solid #ffe0b2;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-right: 4px;
}

.scaler-inputs {
    margin-bottom: 1.5rem;
}

.servings-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    /* Slightly reduced gap to allow wider pills */
    margin-bottom: 1.5rem;
    background-color: transparent;
    padding: 0;
    width: 100%;
    /* Ensure it spans the width */
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-wrapper label {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0.3rem;
    font-weight: bold;
}

.input-pill {
    display: flex;
    align-items: center;
    background-color: #fefefe;
    border: 2px solid #ddd;
    border-radius: 30px;
    padding: 2px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-width: 120px;
    /* Ensure a minimum width to prevent clipping */
    flex: 1;
    /* Allow equal growth */
    max-width: 160px;
    /* But don't let it get too huge */
}

.input-pill:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 167, 38, 0.2);
}

.input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    /* Take up all available space between buttons */
    min-width: 0;
    /* Allow shrinking if needed, though buttons are fixed */
}

.input-pill input {
    width: 100%;
    /* Take full width of parent container */
    min-width: 30px;
    padding: 0.5rem 0;
    font-size: 1.3rem;
    text-align: center;
    /* Changed to center for better balance in wider pill */
    border: none;
    background: transparent;
    color: #444;
    font-family: 'Zen Maru Gothic', sans-serif;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
    /* Fix lint */
    /* Remove default spinners */
}

.input-pill input::-webkit-outer-spin-button,
.input-pill input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    /* Fix lint */
    margin: 0;
}

.unit-label {
    font-size: 1.2rem;
    /* Significantly increased from 0.9rem */
    color: #555;
    margin-left: 4px;
    font-weight: 700;
    white-space: nowrap;
}

.ctrl-btn {
    min-width: 32px;
    /* Ensure circular shape */
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: #ffe0b2;
    color: #bf360c;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    user-select: none;
    margin: 0 2px;
    padding: 0;
    /* Remove default padding */
    -webkit-tap-highlight-color: transparent;
}

.ctrl-btn:hover {
    background-color: #ffcc80;
}

.ctrl-btn:active {
    background-color: #ffb74d;
    transform: scale(0.95);
}

.scaler-arrow {
    font-size: 1.8rem;
    color: var(--primary-color);
    padding-top: 1rem;
    /* Align with inputs */
}

.ingredients-area label,
.scaler-result-area .result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.scaler-result-area .result-header label {
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 0;
    font-weight: bold;
}

.copy-btn {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #3e2723;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(245, 124, 0, 0.3);
    transition: all 0.2s;
    font-family: 'Zen Maru Gothic', sans-serif;
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(245, 124, 0, 0.4);
    background: linear-gradient(135deg, #ffa726, #fb8c00);
}

.copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(245, 124, 0, 0.3);
}

input[type="number"],
input[type="text"],
select,
textarea {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    appearance: none; /* Remove default appearance for better styling */
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.ingredients-area textarea,
.scaler-result-area textarea {
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.scaler-result-area {
    background-color: #fff0f5;
    /* Light pinkish bg for result */
    padding: 1.2rem;
    border-radius: 12px;
    margin-top: 1rem;
    border: 2px dashed #f8bbd0;
}

.scaler-message-box {
    margin-top: 1rem;
    text-align: center;
    min-height: 60px;
    /* Prevent CLS */
}

#scaler-message {
    font-weight: bold;
    color: #e91e63;
}

#scaler-note {
    font-size: 0.85rem;
    color: #880e4f;
    margin-top: 0.5rem;
}

.scaler-result-area textarea {
    background-color: white;
    border-color: transparent;
    box-shadow: none;
}

/* Reference Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.ref-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    min-width: 300px;
    /* Force scroll on very small screens if needed */
}

.ref-table th,
.ref-table td {
    border: 1px solid #eee;
    padding: 8px 4px;
    /* Reduced horizontal padding */
    text-align: center;
    font-size: 0.9rem;
    /* Slightly smaller font */
}

.ref-table th {
    background-color: #ffe0b2;
    /* Lighter primary */
    color: #bf360c;
    font-weight: bold;
    white-space: nowrap;
}

.unit-sub {
    font-size: 0.75rem;
    font-weight: normal;
}

.ref-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.seo-note {
    font-size: 0.8rem;
    color: #555;
    margin-top: 0.8rem;
    text-align: left;
    /* Changed from right to left */
}

/* FAQ */
.faq-item {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid #eee;
}

.faq-q {
    font-size: 1rem;
    color: #bf360c;
    /* Darker orange for Q */
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.faq-a {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
}

/* Support Section */
.support-section {
    margin: 4rem 0 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #fff5f5 0%, #fff8eb 100%);
    border-radius: 24px;
    border: 2px dashed #ffcdd2;
    text-align: center;
}

.support-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.support-icon {
    font-size: 2.5rem;
    animation: heartBeat 1.5s ease-in-out infinite;
    display: inline-block;
}

@keyframes heartBeat {
    0% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.1);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.1);
    }

    70% {
        transform: scale(1);
    }
}

.support-text {
    font-size: 1rem;
    font-weight: 700;
    color: #5d4037;
    line-height: 1.6;
    max-width: 300px;
}

.ofuse-btn {
    display: inline-block;
    background: linear-gradient(45deg, #ff5252, #ff8c00);
    color: white;
    text-decoration: none;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ofuse-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 82, 82, 0.4);
    color: white;
}

.ofuse-btn:active {
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .support-section {
        padding: 1.5rem 1rem;
        margin: 3rem 0 1rem;
    }

    .support-text {
        font-size: 0.9rem;
    }

    /* Substitute Measuring Styles */
    .guide-card {
        text-align: center;
        padding: 2rem 1rem;
        background: #fff;
        border-radius: 20px;
        border: 2px solid #eee;
        margin-bottom: 1.5rem;
    }

    .measuring-guide-area {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 150px;
        margin: 1rem 0;
    }

    .measuring-circle {
        background-color: #fff9c4;
        border: 3px solid #fbc02d;
        border-radius: 50%;
        margin: 0 auto;
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        color: #f57f17;
        box-shadow: 0 4px 0 rgba(251, 192, 45, 0.2);
    }

    .real-size-note {
        font-size: 0.7rem;
        color: #999;
        margin-top: 10px;
    }

    .cap-result-display {
        font-size: 1.5rem;
        font-weight: 900;
        color: #0288d1;
        margin: 10px 0;
    }

    .sub-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 1rem;
        background: white;
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #eee;
    }

    .sub-table th,
    .sub-table td {
        padding: 12px;
        text-align: center;
        border-bottom: 1px solid #eee;
        font-size: 0.9rem;
    }

    .sub-table th {
        background-color: #f5f5f5;
        color: #666;
        font-weight: 700;
    }

    .ofuse-btn {
        padding: 10px 24px;
        font-size: 1rem;
    }
}

/* Tube Converter Styles */
.tube-converter-card {
    border: 3px solid #ffe0b2;
}

.unit-selection-area {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 1rem 0;
}

.radio-label {
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.result-display {
    text-align: center;
    font-size: 1.1rem;
    font-weight: bold;
    color: #bf360c;
    margin: 1rem 0;
    min-height: 2.4em;
}

/* Ruler UI */
.ruler-container {
    margin-top: 2rem;
    padding: 0 10px;
}

.ruler-scale {
    height: 30px;
    background: #eee;
    border-radius: 4px;
    position: relative;
    border: 1px solid #ddd;
}

.ruler-marker {
    position: absolute;
    top: 100%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: #999;
}

/* Baking Calculator Specific Styles */
.shape-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.shape-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    font-weight: 700;
    color: #8d6e63;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.shape-btn.active {
    border-color: var(--primary-color);
    background-color: #fff8eb;
    color: var(--primary-color);
}

/* Baking Input Improvements */
.baking-input-group {
    margin: 1.5rem 0;
}

.baking-input-group label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
    display: block;
    font-weight: 700;
}

.baking-input-group .calc-input {
    width: 100%;
    font-size: 1.6rem;
    /* Large for mobile */
    padding: 12px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: 'Zen Maru Gothic', sans-serif;
    font-weight: 700;
}

.baking-result-card {
    background: linear-gradient(135deg, #fff3e0 0%, #fff8e1 100%);
    border: 2px solid #ffe0b2;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
}

.ratio-display {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary-color);
    display: block;
    margin: 0.5rem 0;
}

.batch-simulator {
    margin-top: 2rem;
}

.simulator-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.sim-input {
    width: 85px;
    /* Increased from 70px */
    padding: 10px 5px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 1.2rem;
    /* Added font size */
    color: #333;
}

.sim-unit-select {
    padding: 8px 4px;
    border: 1px solid #eee;
    border-radius: 6px;
    font-size: 0.9rem;
    /* Increased */
    color: #666;
    background-color: #fafafa;
}

.sim-arrow {
    color: #ffd180;
    font-weight: bold;
}

.sim-result {
    flex: 1;
    font-weight: 900;
    color: #e65100;
    font-size: 1.4rem;
    /* Increased from 1.1rem */
    text-align: right;
}

.add-row-btn {
    width: 100%;
    padding: 10px;
    background: white;
    border: 2px dashed #ffe0b2;
    border-radius: 8px;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.2s;
}

.add-row-btn:hover {
    background-color: #fff8eb;
    border-style: solid;
}

.ruler-marker::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    width: 1px;
    height: 5px;
    background: #ccc;
}

.tube-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(to bottom, #fffde7, #fff59d);
    width: 0%;
    border-radius: 4px;
    transition: width 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.ruler-label {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-top: 1.5rem;
}

.unit-select-native {
    padding: 0.8rem;
    border-radius: 12px;
    border: 2px solid #eee;
    font-family: inherit;
    font-size: 1rem;
}

/* Emergency / Survival Mode Styles */
.emergency-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 0;
    backdrop-filter: blur(5px);
    border-bottom: 1px solid #eee;
}

.env-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 5px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white;
    color: #444;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
}

.env-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

/* Coin Data Table */
.coin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 1rem;
}

.coin-info-card {
    background: white;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.coin-icon {
    width: 30px;
    height: 30px;
    background: #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.7rem;
    color: #b8860b;
}

/* Paper Cup Simulator */
.cup-simulator {
    width: 120px;
    height: 150px;
    margin: 20px auto;
    position: relative;
    background: #fff;
    border: 2px solid #ddd;
    border-top: none;
    border-radius: 5px 5px 40px 40px;
    overflow: hidden;
}

.cup-water {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #e1f5fe;
    transition: height 0.5s ease;
}

.cup-mark {
    position: absolute;
    left: 0;
    width: 100%;
    border-top: 1px dashed #64b5f6;
    font-size: 0.6rem;
    color: #1976d2;
    padding-left: 5px;
    pointer-events: none;
}

/* Digital Ruler */
.digital-ruler {
    height: 60px;
    background: #fafafa;
    border: 2px solid #333;
    border-radius: 4px;
    position: relative;
    margin: 2rem 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ruler-tick {
    position: absolute;
    bottom: 0;
    width: 2px;
    background: #333;
}

.ruler-tick.major {
    height: 20px;
}

.ruler-tick.minor {
    height: 10px;
    width: 1px;
}

.ruler-num {
    position: absolute;
    bottom: 22px;
    transform: translateX(-50%);
    font-size: 0.7rem;
    font-weight: bold;
}

/* Survival High Contrast UI */
.survival-mode {
    border: 4px solid #333 !important;
    background: white !important;
}

.survival-mode h3 {
    color: #000 !important;
    font-weight: 900 !important;
}

/* Range Slider Styles */
.pasta-slider-container {
    padding: 20px 0;
}

.pasta-range {
    width: 100%;
    height: 12px;
    -webkit-appearance: none;
    background: #eee;
    border-radius: 6px;
    outline: none;
}

.pasta-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* FAQ Section */
.faq-section {
    margin-top: 3rem;
    border-top: 2px solid #eee;
    padding-top: 2rem;
}

.faq-item {
    margin-bottom: 1.5rem;
}

.faq-q {
    font-weight: bold;
    color: #333;
    font-size: 1.1rem;
    margin-bottom: 5px;
    display: block;
}

.faq-a {
    color: #666;
    line-height: 1.6;
}

/* ==========================================
   PWA Install Banner
   ========================================== */
.pwa-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: 90%;
    max-width: 400px;
    background: #fff;
    border: 2px solid #ffca28;
    border-radius: 16px;
    padding: 15px 20px;
    box-shadow: 0 10px 25px rgba(255, 143, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwa-banner.show {
    transform: translateX(-50%) translateY(0);
}

.pwa-banner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pwa-banner-title {
    font-weight: 900;
    color: #ff8f00;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pwa-close-btn {
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.pwa-close-btn:hover {
    color: #999;
}

.pwa-banner-text {
    font-size: 0.9rem;
    color: #5d4037;
    line-height: 1.4;
    margin: 0;
}

.pwa-install-btn {
    background: #ffecb3;
    color: #f57c00;
    border: 2px solid #ffca28;
    border-radius: 20px;
    padding: 8px 15px;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.pwa-install-btn:hover {
    background: #ffca28;
    color: #fff;
}

/* ==========================================
   iOS PWA Install Guide Modal
   ========================================== */
.ios-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ios-modal-overlay[hidden] {
    display: none;
}

.ios-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 90%;
    width: 320px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    animation: popIn 0.3s ease-out;
}

@keyframes popIn {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.ios-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
}

.ios-modal-title {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    text-align: center;
}

.ios-modal-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
}

.ios-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ios-step {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
}

.step-num {
    background: #FFCA28;
    color: #fff;
    font-weight: bold;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.step-text {
    font-size: 0.85rem;
    color: #444;
    line-height: 1.4;
}

/* ==========================================
   Slim Navigation UI & SPA Chip Scroll
   ========================================== */
.app-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
}

.app-header .logo {
    font-size: 1.2rem;
    font-weight: 900;
    margin: 0;
    color: #333;
}

.category-select-wrapper {
    position: relative;
}

.category-select {
    appearance: none;
    -webkit-appearance: none;
    background: #ffecb3;
    border: 1px solid #ffca28;
    border-radius: 20px;
    padding: 4px 24px 4px 12px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #5d4037;
    cursor: pointer;
}

.category-select-wrapper::after {
    content: '▼';
    font-size: 0.7rem;
    color: #f57f17;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.chip-nav-container {
    padding: 0 1rem 0.5rem 1rem;
    width: 100%;
}

.chip-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    margin: 0;
    list-style: none;
    scrollbar-width: none; /* Firefox */
}

.chip-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari */
}

.chip-link {
    display: inline-block;
    white-space: nowrap;
    background: #f5f5f5;
    color: #666;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.chip-link:hover {
    background: #fff8e1;
    color: #f57f17;
}

.chip-link.active {
    background: #fff8e1;
    color: #d84315;
    border-color: #ffca28;
    font-weight: bold;
}