/* ===========================
   BBQ AI
   WalicaインスパイアのクリーンUI
   =========================== */

:root {
    --brand: #E27D60;
    --brand-hover: #D06A4E;
    --brand-bg: rgba(226, 125, 96, 0.08);

    --bg: #EFF1F5;
    --bg-card: #FFFFFF;
    --bg-input: #F5F6F8;

    --text: #1E293B;
    --text-sub: #64748B;
    --text-light: #94A3B8;

    --border: #E8EBF0;

    --green: #06C755;
    --green-hover: #05B34C;

    --shadow: 0 1px 3px rgba(0,0,0,0.04);

    --radius: 24px;
    --radius-btn: 50px;
    --radius-input: 12px;

    --font: 'Zen Maru Gothic', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover { text-decoration: underline; }

/* --- ヘッダー --- */
.site-header {
    background: var(--bg);
    padding: 32px 20px 0;
    text-align: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.5px;
}

.site-title .brand-icon {
    display: inline-block;
    margin-right: 4px;
    font-size: 1.3rem;
    vertical-align: middle;
}

.site-subtitle {
    font-size: 0.85rem;
    color: var(--text-sub);
    font-weight: 400;
    margin-top: 6px;
}

/* --- コンテナ --- */
.container {
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
    padding: 8px 16px 48px;
    flex: 1;
}

/* --- カード --- */
.card {
    background: var(--bg-card);
    padding: 28px 24px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-sub);
    margin-bottom: 16px;
    text-align: center;
}

/* --- ラベル --- */
label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.75rem;
    text-align: center;
}

/* --- 入力フィールド --- */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}

.input-box {
    flex: 1;
}

input[type="number"],
select {
    width: 100%;
    padding: 14px 12px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: var(--font);
    border-radius: var(--radius-input);
    border: none;
    background: var(--bg-input);
    color: var(--text);
    text-align: center;
    transition: all 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    background: #EDEEF2;
    box-shadow: 0 0 0 3px var(--brand-bg);
}

select {
    text-align: left;
    padding: 14px 40px 14px 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394A3B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

/* --- チェックボックス --- */
.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-top: 20px;
    padding: 14px;
    background: var(--bg-input);
    border-radius: var(--radius-input);
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-sub);
    user-select: none;
    gap: 10px;
}

.checkbox-label:hover {
    background: #EAEBEF;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand);
    flex-shrink: 0;
    margin: 0;
}

.checkbox-label.checked {
    background: var(--brand-bg);
    color: var(--text);
}

/* --- ボタン（共通） --- */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 24px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font);
    color: #FFF;
    border: none;
    border-radius: var(--radius-btn);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--brand);
    margin-bottom: 16px;
}

.btn-primary:hover {
    background: var(--brand-hover);
}

/* --- 結果エリア --- */
#resultArea {
    display: none;
    margin-top: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 予算ボックス --- */
.budget-box {
    background: var(--bg-card);
    padding: 28px 20px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.budget-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
}

.budget-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--brand);
    margin: 6px 0 2px;
}

.budget-note {
    font-size: 0.78rem;
    color: var(--text-light);
}

/* --- リスト --- */
.list-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 4px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.list-title {
    font-weight: 700;
    text-align: center;
    padding: 14px 0;
    color: var(--text);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.list-row {
    display: flex;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid #F3F4F6;
}

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

.list-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--brand);
    flex-shrink: 0;
    margin-right: 12px;
    cursor: pointer;
}

.list-row input[type="text"] {
    flex: 1;
    padding: 4px 6px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 0.9rem;
    font-family: var(--font);
    outline: none;
}

.list-row input[type="text"]:focus {
    background: var(--bg-input);
    border-radius: 6px;
}

.list-row.checked input[type="text"] {
    text-decoration: line-through;
    color: var(--text-light);
}

.header-text {
    color: var(--text-sub) !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    letter-spacing: 0.3px;
}

/* --- 削除ボタン --- */
.del-btn {
    width: auto;
    padding: 4px 10px;
    margin: 0;
    background: var(--bg-input);
    color: var(--text-light);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font);
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.del-btn:hover {
    background: #E05C5C;
    color: #FFF;
}

/* --- 追加ボタン --- */
.btn-add {
    background: transparent;
    border: 2px dashed #D5D8DE;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 12px;
    border-radius: var(--radius-btn);
}

.btn-add:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-bg);
}

/* --- アクションボタン --- */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.btn-copy {
    background: var(--text-sub);
    flex: 1;
    border-radius: var(--radius-btn);
}

.btn-copy:hover { background: #536471; }

.btn-line {
    background: var(--green);
    flex: 1;
    border-radius: var(--radius-btn);
}

.btn-line:hover { background: var(--green-hover); }

/* --- リセットボタン --- */
.btn-reset {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.82rem;
    border-radius: var(--radius-btn);
    margin-bottom: 16px;
    padding: 12px 24px;
}

.btn-reset:hover {
    border-color: #E05C5C;
    color: #E05C5C;
    background: rgba(224, 92, 92, 0.04);
}

/* --- 確認モーダル --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 32px 28px;
    max-width: 340px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-message {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.modal-sub {
    font-size: 0.8rem;
    color: var(--text-sub);
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-modal-cancel {
    flex: 1;
    background: var(--bg-input);
    color: var(--text-sub);
    border-radius: var(--radius-btn);
    font-size: 0.85rem;
    padding: 12px;
}

.btn-modal-cancel:hover {
    background: #E5E7EB;
}

.btn-modal-confirm {
    flex: 1;
    background: #E05C5C;
    color: #FFF;
    border-radius: var(--radius-btn);
    font-size: 0.85rem;
    padding: 12px;
}

.btn-modal-confirm:hover {
    background: #D04848;
}

/* --- セクション --- */
.content-section {
    margin-top: 56px;
    margin-bottom: 36px;
    text-align: center;
}

.section-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 6px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.section-desc {
    font-size: 0.82rem;
    color: var(--text-sub);
    margin-bottom: 28px;
    line-height: 1.7;
}

.btn-link {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 280px;
    margin: 0 auto;
    padding: 14px 24px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font);
    color: var(--brand);
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-btn);
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.btn-link:hover {
    border-color: var(--brand);
    background: var(--brand-bg);
    text-decoration: none;
}

/* --- 使い方ステップ --- */
.steps-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: left;
}

.step-num {
    width: 28px;
    height: 28px;
    background: var(--brand);
    color: #FFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.step-body h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.step-body p {
    font-size: 0.8rem;
    color: var(--text-sub);
    line-height: 1.6;
}

/* --- 特徴グリッド --- */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    text-align: center;
}

.feature-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 24px 14px;
    box-shadow: var(--shadow);
}

/* --- 便利ツールグリッド --- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
    text-align: left;
}

.tool-card {
    background: #fff;
    border-radius: var(--radius-card);
    padding: 24px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--brand);
}

.tool-card-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--brand);
    background: var(--brand-bg);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    width: fit-content;
    margin-bottom: 12px;
}

.tool-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 8px;
    color: var(--text);
}

.tool-card-desc {
    font-size: 0.85rem;
    color: var(--text-sub);
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.tool-card-action {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--brand);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}
.tool-card-action::after {
    content: "→";
    transition: transform 0.2s;
}
.tool-card:hover .tool-card-action::after {
    transform: translateX(4px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    background: var(--brand-bg);
    color: var(--brand);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.feature-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.feature-desc {
    font-size: 0.72rem;
    color: var(--text-sub);
    line-height: 1.5;
}

/* --- 計算方法 --- */
.calc-section {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 22px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    text-align: left;
}

.calc-heading {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.calc-text {
    font-size: 0.8rem;
    color: var(--text-sub);
    line-height: 1.7;
    margin-bottom: 12px;
}

.calc-text:last-child {
    margin-bottom: 0;
}

.calc-table {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.calc-row {
    display: flex;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
}

.calc-row:last-child {
    border-bottom: none;
}

.calc-row span {
    flex: 1;
    color: var(--text);
}

.calc-row-header {
    background: var(--bg-input);
    font-weight: 700;
}

.calc-row-header span {
    color: var(--text-sub);
}

/* --- 目次 --- */
.toc ol {
    list-style: none;
    counter-reset: toc-counter;
    padding: 0;
    margin: 0;
}

.toc li {
    counter-increment: toc-counter;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
}

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

.toc a {
    display: block;
    padding: 12px 4px;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.toc a::before {
    content: counter(toc-counter) ". ";
    color: var(--brand);
    font-weight: 700;
}

.toc a:hover {
    color: var(--brand);
    text-decoration: none;
}

/* --- フッター --- */
.site-footer {
    background: var(--brand);
    padding: 32px 20px;
    margin-top: auto;
}

.footer-inner {
    max-width: 460px;
    margin: 0 auto;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.footer-nav a {
    color: rgba(255,255,255,0.8);
    font-size: 0.75rem;
    font-weight: 500;
}

.footer-nav a:hover {
    color: #FFF;
    text-decoration: none;
}

.footer-copy {
    text-align: center;
    font-size: 0.68rem;
    color: rgba(255,255,255,0.5);
}

/* --- 広告 --- */
.ad-unit {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 0; /* 広告未表示時に空白にならないようにする */
}

/* 広告が空の場合は非表示にする（モダンブラウザ対応） */
.ad-unit:empty,
.ad-unit:has(ins[data-ad-status="unfilled"]) {
    display: none;
    margin: 0;
}

.ad-unit-large { min-height: 250px; }

/* --- トースト --- */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: var(--text);
    color: #FFF;
    padding: 12px 28px;
    border-radius: var(--radius-btn);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- レスポンシブ --- */
@media (max-width: 480px) {
    .site-header { padding: 36px 16px 8px; }

    .card { padding: 24px 20px; }

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

    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
}

/* --- 固定ページ --- */
.static-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 32px 20px;
    flex: 1;
}

.static-page h1 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
    color: var(--text);
}

.static-page h2 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 10px;
    color: var(--text);
}

.static-page p,
.static-page li {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 10px;
    line-height: 1.8;
}

.static-page ul {
    padding-left: 18px;
    margin-bottom: 14px;
}

.static-page li { margin-bottom: 5px; }

.back-link {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 16px;
}

.back-link:hover {
    color: var(--brand);
    text-decoration: none;
}

/* --- お問い合わせ --- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.contact-form label {
    text-align: left;
    font-size: 0.82rem;
    margin-bottom: 0;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 0.9rem;
    font-family: var(--font);
    border-radius: var(--radius-input);
    border: none;
    background: var(--bg-input);
    color: var(--text);
    transition: all 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    background: #EDEEF2;
    box-shadow: 0 0 0 3px var(--brand-bg);
}

.contact-form textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.contact-form .btn {
    width: auto;
    align-self: center;
    padding: 14px 48px;
    font-size: 0.9rem;
}

.contact-form select {
    font-family: var(--font);
    width: 100%;
    padding: 14px 16px;
    font-size: 0.9rem;
    border-radius: var(--radius-input);
    border: none;
    background: var(--bg-input);
    color: var(--text);
    transition: all 0.2s ease;
}

.contact-form select:focus {
    outline: none;
    background: #EDEEF2;
    box-shadow: 0 0 0 3px var(--brand-bg);
}

/* --- 割り勘計算用スタイル --- */
.split-group {
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 16px;
    background: #fcfcfc;
    margin-bottom: 16px;
}

.split-group-header {
    margin-bottom: 12px;
}

.split-group-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--brand);
    margin: 0;
}

.split-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.split-inputs .input-with-unit {
    width: 90px;
}

.split-ratio-label {
    font-size: 0.85rem;
    color: var(--text-sub);
    white-space: nowrap;
}

.ratio-select {
    flex: 1;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: calc(var(--radius-card) / 2);
    font-size: 0.9rem;
    background-color: #fff;
    color: var(--text);
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%2394A3B8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

.result-area {
    animation: slideUp 0.3s ease-out;
}

.result-title {
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text);
    font-weight: 800;
}

.split-result-heading {
    font-size: 1.1rem;
    color: var(--brand);
    margin-top: 0;
    margin-bottom: 8px;
    text-align: center;
}

.split-result-desc {
    font-size: 0.8rem;
    color: var(--text-sub);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

.split-box {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.split-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fdfdfd;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.split-label {
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.split-people-badge {
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 20px;
    color: var(--text-sub);
}

.split-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}

.split-amount .yen {
    font-size: 0.9rem;
    margin-left: 4px;
    color: var(--text-sub);
    font-weight: 500;
}

.split-total-check {
    margin-top: 16px;
    padding: 12px;
    background: var(--brand-bg);
    border-radius: calc(var(--radius-card) / 2);
    font-size: 0.85rem;
    text-align: center;
    color: var(--brand);
    font-weight: 700;
}
