* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f3f0;
    color: #333;
}

body {
    min-height: 100vh;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 16px 40px;
}

.app-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.title-block h1 {
    margin: 0 0 4px;
    font-size: 28px;
}

.subtitle {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.today-block {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.today-block .label {
    padding: 2px 8px;
    border-radius: 999px;
    background: #fff3cd;
    color: #856404;
}

.app-footer {
    margin-top: 24px;
    font-size: 12px;
    color: #777;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 16px;
}

.panel {
    background: #ffffff;
    border-radius: 12px;
    padding: 16px 16px 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.04);
}

.panel h2 {
    margin: 0 0 4px;
    font-size: 20px;
}

.panel-desc {
    margin: 0 0 12px;
    font-size: 13px;
    color: #666;
}

.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.tab {
    flex: 1;
    border-radius: 999px;
    border: none;
    padding: 6px 8px;
    font-size: 12px;
    background: #f1f1f1;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.tab.active {
    background: #ffcf7d;
    box-shadow: 0 4px 10px rgba(255, 159, 64, 0.35);
    transform: translateY(-1px);
}

.tab-content-wrapper {
    border-radius: 10px;
    background: #faf7f3;
    padding: 8px 8px 10px;
    margin-bottom: 14px;
    max-height: 260px;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 6px;
}

.ingredient-card {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.ingredient-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.ingredient-card input[type="checkbox"] {
    accent-color: #ff9f40;
}

.ingredient-icon {
    font-size: 18px;
}

.ingredient-name {
    font-size: 13px;
}

.custom-input {
    margin-top: 4px;
}

.custom-input label {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
}

.custom-input-row {
    display: flex;
    gap: 6px;
}

.custom-input-row input {
    flex: 1;
    padding: 6px 8px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.current-stock {
    margin-top: 12px;
}

.current-stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.current-stock-header h3 {
    margin: 0;
    font-size: 14px;
}

.chip-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #fff7e6;
    font-size: 12px;
}

.chip button {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 12px;
    padding: 0 0 0 2px;
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag-filter {
    border-radius: 999px;
    border: none;
    padding: 4px 9px;
    font-size: 11px;
    background: #f1f1f1;
    cursor: pointer;
}

.tag-filter.active {
    background: #ffe3b3;
}

.recipe-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.recipe-card {
    background: #fffaf2;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
}

.recipe-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.6), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.recipe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.recipe-card:hover::after {
    opacity: 1;
}

.recipe-title {
    margin: 0 0 4px;
    font-size: 14px;
}

.recipe-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.recipe-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 999px;
    background: #ffe3b3;
}

.recipe-match {
    font-size: 11px;
    color: #777;
}

.recipe-match span {
    font-weight: bold;
    color: #ff9f40;
}

.recipe-detail {
    margin-top: 12px;
    border-radius: 10px;
    background: #fffef8;
    border: 1px solid #ffe3b3;
    padding: 10px 10px 12px;
}

.recipe-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.recipe-detail-header h3 {
    margin: 0;
    font-size: 15px;
}

.recipe-detail-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 10px;
}

.detail-section h4 {
    margin: 0 0 4px;
    font-size: 13px;
}

.detail-section ul,
.detail-section ol {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
}

.recipe-detail-footer {
    margin-top: 10px;
    text-align: right;
}

.hidden {
    display: none !important;
}

.suggestion-info {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

/* Buttons */
.primary-btn {
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff9f40, #ff6f48);
    color: #fff;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(255, 111, 72, 0.4);
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.1s ease;
}

.primary-btn.large {
    padding: 8px 18px;
    font-size: 14px;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(255, 111, 72, 0.45);
    filter: brightness(1.03);
}

.ghost-btn {
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #fff;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}

.ghost-btn.small {
    padding: 2px 8px;
    font-size: 11px;
}

.icon-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 18px;
}

/* 小さめの画面対応 */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .app {
        padding: 10px 10px 30px;
    }

    .panel {
        padding: 12px 12px 14px;
    }

    .app-header {
        align-items: flex-start;
    }

    .recipe-detail-body {
        grid-template-columns: minmax(0, 1fr);
    }
}
