@charset "UTF-8";

/* =========================================
   1. Design Tokens (変数定義)
   ========================================= */
:root {
    /* カラーパレット: 信頼感のあるインディゴブルーを基調 */
    --primary: #4f46e5;       /* メインカラー */
    --primary-hover: #4338ca; /* ホバー時 */
    --primary-light: #eef2ff; /* 背景用薄い色 */
    --accent: #f59e0b;        /* アクセント（注意など） */
    
    --text-main: #111827;     /* 濃い黒 */
    --text-sub: #6b7280;      /* グレー */
    --bg-body: #f3f4f6;       /* 背景色（薄いグレー） */
    --surface: #ffffff;       /* カード背景（白） */
    
    --border: #e5e7eb;        /* 枠線 */
    --radius-m: 12px;         /* 角丸 */
    --radius-l: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* =========================================
   2. Reset & Base Layout
   ========================================= */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { text-decoration: none; color: inherit; transition: all 0.2s ease; }

/* レイアウト枠 */
.app-container, .main-content {
    width: 100%;
    max-width: 640px; /* 少し広げました */
    margin: 0 auto;
    padding: 0 20px;
}

/* =========================================
   3. Header & Hero Area
   ========================================= */
.site-header {
    background: var(--surface);
    padding: 16px 0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-logo {
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* トップページ等のヒーローエリア */
.hero-area {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
}
h1 {
    font-size: 1.75rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-main);
    line-height: 1.3;
}
.hero-desc {
    font-size: 1rem;
    color: var(--text-sub);
    line-height: 1.8;
}

/* =========================================
   4. Calculator UI (Core)
   ========================================= */
/* カード全体 */
.calculator-card {
    background: var(--surface);
    border-radius: var(--radius-l);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid var(--border);
}

/* 入力セクション */
.input-section {
    padding: 32px 24px;
    background: #fff;
}

.form-group { margin-bottom: 28px; }
.form-group:last-child { margin-bottom: 0; }

label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.label-note {
    font-size: 0.75rem;
    font-weight: normal;
    color: var(--text-sub);
    background: var(--bg-body);
    padding: 2px 8px;
    border-radius: 4px;
}

/* 入力フィールド */
.input-wrapper { position: relative; display: flex; align-items: center; }

input[type="number"], select {
    width: 100%;
    padding: 16px 16px; /* タップしやすく大きく */
    font-size: 1.2rem;  /* 文字も大きく */
    font-weight: 700;
    color: var(--text-main);
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius-m);
    transition: 0.2s ease;
    appearance: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

input[type="number"]::placeholder { color: #d1d5db; font-weight: 500; }

input[type="number"]:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.unit {
    position: absolute;
    right: 16px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-sub);
    pointer-events: none;
}

/* OR divider (1号機など) */
.or-divider {
    display: flex; align-items: center; justify-content: center;
    margin: 24px 0; color: var(--text-sub); font-size: 0.8rem; font-weight: 700;
}
.or-divider::before, .or-divider::after {
    content: ""; height: 1px; background: var(--border); flex: 1; margin: 0 16px;
}

/* 結果表示セクション */
.result-section {
    background-color: var(--primary-light); /* 薄い青背景 */
    padding: 32px 24px;
    text-align: center;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: none; /* JSで表示 */
}
.result-section.active {
    display: block;
    animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px; padding: 0 8px;
}
.highlight-row {
    background: #fff; /* 結果を目立たせる */
    padding: 20px;
    border-radius: var(--radius-m);
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.res-label { font-size: 0.9rem; font-weight: 700; color: var(--text-sub); }
.res-value { font-size: 1.5rem; font-weight: 800; color: var(--text-main); font-variant-numeric: tabular-nums; }

.highlight-row .res-label { font-size: 1rem; color: var(--primary); }
.highlight-row .res-value {
    font-size: 3.2rem; /* 結果数値を巨大に */
    line-height: 1;
    color: var(--primary);
    text-shadow: 0 2px 4px rgba(79, 70, 229, 0.1);
}

.result-sub-info {
    display: flex; justify-content: center; gap: 20px; flex-wrap: wrap;
    padding-top: 10px; border-top: 1px dashed rgba(0,0,0,0.1);
}
.sub-item { text-align: center; min-width: 80px; }
.res-label-sm { font-size: 0.75rem; color: var(--text-sub); display: block; margin-bottom: 4px; }
.res-value-sm { font-size: 1.1rem; font-weight: 700; color: var(--text-main); }

/* コピーボタン */
.btn-copy {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 24px; padding: 10px 24px;
    font-size: 0.9rem; font-weight: 700;
    color: var(--primary); background: #fff;
    border: 2px solid var(--primary); border-radius: 50px;
    cursor: pointer; transition: 0.2s;
    box-shadow: var(--shadow-sm);
}
.btn-copy:hover {
    background: var(--primary); color: #fff;
    transform: translateY(-2px); box-shadow: var(--shadow-md);
}
.btn-copy.copied { background: #10b981; border-color: #10b981; color: #fff; }

.micro-copy {
    text-align: center; font-size: 0.85rem; color: var(--text-sub);
    margin-top: 16px; padding: 0 16px; line-height: 1.6;
}

/* =========================================
   5. SEO Article & Typography
   ========================================= */
.tool-article, .seo-description, .text-content {
    background: transparent;
    color: var(--text-main);
}
.tool-article h2, .text-content h2 {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 48px 0 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
    position: relative;
}
.tool-article h2::after {
    content: ""; position: absolute; bottom: -2px; left: 0;
    width: 60px; height: 2px; background: var(--primary);
}
.tool-article h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 32px 0 16px;
    padding-left: 12px;
    border-left: 4px solid var(--primary);
}
.tool-article p, .text-content p {
    margin-bottom: 24px;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #374151;
}
.tool-article ul {
    background: #fff; padding: 24px 24px 24px 40px; border-radius: var(--radius-m);
    margin-bottom: 24px; border: 1px solid var(--border);
}
.tool-article li { margin-bottom: 8px; font-weight: 500; }

.seo-description {
    background: #fff; padding: 24px; border-radius: var(--radius-m);
    border: 1px solid var(--border); margin-bottom: 40px;
    box-shadow: var(--shadow-sm);
}
.recommend-text {
    margin-top: 16px; font-weight: 700; color: var(--text-main);
    background: var(--primary-light); padding: 12px 16px; border-radius: 8px;
    display: flex; align-items: center; gap: 8px;
}
.recommend-text::before { content: "💡"; }

/* =========================================
   6. Components (Ads, FAQ, List)
   ========================================= */
/* Ads */
.ad-slot { margin: 40px 0; text-align: center; }
.ad-label { font-size: 0.65rem; color: #9ca3af; letter-spacing: 0.1em; margin-bottom: 8px; }
.ad-placeholder {
    width: 100%; min-height: 250px; background: #f3f4f6;
    border-radius: 8px; display: flex; align-items: center; justify-content: center;
    color: #cbd5e1; font-weight: 700; border: 2px dashed #e5e7eb;
}

/* FAQ */
.faq-section { margin-top: 60px; }
.faq-section h2 { text-align: center; border: none; margin-bottom: 30px; }
.faq-section h2::after { display: none; }
.faq-item {
    background: #fff; border-radius: var(--radius-m); margin-bottom: 12px;
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.faq-question {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; font-weight: 700; font-size: 1rem; color: var(--text-main);
    cursor: pointer; transition: background 0.2s;
}
.faq-question:hover { background: #f9fafb; }
.faq-question .icon {
    width: 24px; height: 24px; background: var(--primary-light); color: var(--primary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0; margin-left: 16px;
}
.faq-answer {
    max-height: 0; overflow: hidden; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc; border-top: 1px solid transparent;
}
.faq-answer.is-open { border-top-color: var(--border); }
.faq-content { padding: 24px; font-size: 0.95rem; line-height: 1.7; color: #4b5563; }

/* Tool Grid (Related & Index) */
.tool-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px;
}
.tool-card-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-m);
    padding: 24px 16px; text-align: center;
    color: var(--text-main); font-weight: 700; font-size: 0.9rem;
    transition: all 0.2s; box-shadow: var(--shadow-sm); min-height: 120px;
}
.tool-card-link:hover {
    border-color: var(--primary); color: var(--primary);
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
}
.tool-icon { font-size: 2rem; margin-bottom: 12px; display: block; }
.tool-name { line-height: 1.4; margin-bottom: 8px; display: block; }
.tool-arrow { font-size: 1rem; color: #d1d5db; transition: 0.2s; }
.tool-card-link:hover .tool-arrow { color: var(--primary); transform: translateX(4px); }

/* Related Tools Wrapper */
.related-tools {
    margin-top: 60px; padding: 40px 30px; background: #fff;
    border-radius: var(--radius-l); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.related-tools h2 { border: none; text-align: center; margin-top: 0; font-size: 1.2rem; }
.related-tools h2::after { display: none; }

/* =========================================
   7. Footer
   ========================================= */
.site-footer {
    margin-top: auto; padding: 60px 0 40px; background: #fff;
    border-top: 1px solid var(--border); text-align: center;
}
.site-footer .note { font-size: 0.75rem; color: #9ca3af; margin-bottom: 30px; }
.footer-nav h3 { font-size: 0.9rem; margin-bottom: 24px; color: var(--text-sub); }
.footer-links {
    list-style: none; padding: 0; display: flex; flex-wrap: wrap;
    justify-content: center; gap: 12px; max-width: 800px; margin: 0 auto 40px;
}
.footer-links a {
    font-size: 0.85rem; color: var(--text-sub); background: var(--bg-body);
    padding: 8px 16px; border-radius: 50px; border: 1px solid transparent;
}
.footer-links a:hover {
    color: var(--primary); background: #fff; border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.footer-sub-nav {
    margin-top: 40px; font-size: 0.8rem; color: #9ca3af;
    display: flex; justify-content: center; gap: 16px; flex-wrap: wrap;
}
.footer-sub-nav a { color: #6b7280; }
.footer-sub-nav a:hover { color: var(--primary); text-decoration: underline; }
.separator { color: #e5e7eb; }

.copyright {
    margin-top: 40px; font-size: 0.75rem; color: #9ca3af;
    border-top: 1px solid var(--bg-body); padding-top: 24px;
}

/* =========================================
   8. Specific Tool Adjustments
   ========================================= */
/* 02. 増減率 etc */
.text-plus { color: #16a34a !important; }
.text-minus { color: #dc2626 !important; }

/* 04. 割合分配 */
.ratio-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.ratio-label { width: 60px; flex-shrink: 0; margin: 0; }
.ratio-status {
    text-align: center; margin-top: 24px; padding: 16px; background: var(--bg-body);
    border-radius: var(--radius-m); border: 1px solid var(--border);
    font-weight: 700; color: var(--text-main);
}
.badge {
    padding: 4px 10px; border-radius: 4px; font-size: 0.75rem; margin-left: 8px;
}
.badge-ok { background: #dcfce7; color: #166534; }
.badge-error { background: #fee2e2; color: #991b1b; }
.badge-warn { background: #fef3c7; color: #92400e; }

/* 08. 平均単価 */
.calc-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.row-label { width: 20px; text-align: center; color: var(--text-sub); font-weight: 700; }
.times-mark { color: var(--text-sub); font-size: 1.2rem; }
.input-group { flex: 1; position: relative; display: flex; align-items: center; }

/* スマホ調整 */
@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }
    .highlight-row .res-value { font-size: 2.8rem; }
    .input-section { padding: 24px 16px; }
    .result-section { padding: 32px 16px; }
    .footer-sub-nav { flex-direction: column; gap: 12px; }
    .separator { display: none; }
}

/* =========================================
   【追加】用途別ナビ & 結論行 & 免責
   ========================================= */

/* A. 用途別ナビ (Top Page) */
.purpose-nav {
    background: #fff;
    border-radius: var(--radius-l);
    padding: 30px 24px;
    margin-bottom: 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.purpose-nav h2 {
    font-size: 1.1rem;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-body);
    text-align: center;
}
.purpose-nav h2::after { display: none; } /* 既存の装飾を消す */

.purpose-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* スマホで1列、PCで2列 */
    gap: 16px;
}
.purpose-list li {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-body);
    padding: 16px;
    border-radius: 8px;
}
.purpose-label { font-size: 0.95rem; margin-bottom: 4px; display: block; color: var(--text-main); }
.purpose-links { display: flex; flex-wrap: wrap; gap: 8px; }
.purpose-links a {
    font-size: 0.75rem;
    color: var(--primary);
    background: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
}
.purpose-links a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* B. ツール結論行 (Lead Summary) */
.tool-lead-summary {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    background: #eef2ff; /* 薄い青 */
    padding: 16px 20px;
    border-radius: 8px;
    border-left: 5px solid var(--primary);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* C. フッター免責 */
.footer-disclaimer {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 20px;
    padding: 0 16px;
    line-height: 1.5;
}