@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;500;600;700&family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #8b6f5c;
    --primary-light: #a4897a;
    --primary-dark: #6b5344;
    --accent: #c4956a;
    --accent-light: #e8cdb5;
    --secondary: #8c8584;
    --bg: #f7f4f2;
    --card: #ffffff;
    --text: #3d3331;
    --text-light: #6b5f5d;
    --border: #e8e0dc;
    --success: #7a9e7e;
    --danger: #b5666a;
    --gold: #b8963e;
}

body {
    font-family: 'Noto Sans JP', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(196, 149, 106, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 111, 92, 0.05) 0%, transparent 50%);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 2.5rem 1rem 0;
    font-size: 16.5px;
}

/* ===== Container ===== */
.container {
    background: var(--card);
    width: 94%;
    max-width: 900px;
    padding: 2.5rem 3rem;
    border-radius: 16px;
    box-shadow:
        0 4px 24px rgba(61, 51, 49, 0.06),
        0 1px 4px rgba(61, 51, 49, 0.04);
    border: 1px solid var(--border);
}

/* ===== Brand Logo ===== */
.brand {
    text-align: center;
    margin-bottom: 2.2rem;
    padding-bottom: 1.5rem;
    position: relative;
}

.brand-mark {
    margin-bottom: 0.6rem;
}

.brand-icon {
    display: inline-block;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: sparkRotate 6s ease-in-out infinite;
}

@keyframes sparkRotate {
    0%, 100% { transform: rotate(0deg) scale(1); opacity: 0.8; }
    50% { transform: rotate(180deg) scale(1.15); opacity: 1; }
}

.brand-logo {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--primary-dark);
    font-family: 'Noto Serif JP', serif;
    position: relative;
    display: inline-block;
}

.brand-logo .spark {
    background: linear-gradient(135deg, var(--accent), #d4a574, var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.brand-logo .spark::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--gold));
    border-radius: 1px;
}

.brand-line {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: 0.7rem auto 0.5rem;
}

.brand-tagline {
    font-size: 0.78rem;
    color: var(--secondary);
    letter-spacing: 0.35em;
    text-transform: uppercase;
    font-weight: 300;
    margin: 0;
}

h1 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.95rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.4rem;
    color: var(--primary-dark);
    letter-spacing: 0.08em;
}

.subtitle {
    text-align: center;
    color: var(--secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* ===== Model Case Buttons ===== */
.model-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 1.8rem;
}

.model-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fdfcfb;
    color: var(--text-light);
    font-size: 0.88rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Noto Sans JP', sans-serif;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.model-btn:hover {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(139, 111, 92, 0.2);
}

.model-btn:active {
    transform: translateY(0);
}

.model-btn .btn-icon {
    font-size: 0.95rem;
}

/* ===== PDF Upload Area ===== */
.upload-area {
    border: 1.5px dashed var(--border);
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #faf8f6, #f5f0ec);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent);
    background: linear-gradient(135deg, #fdf8f3, #f8f0e8);
    box-shadow: 0 2px 12px rgba(196, 149, 106, 0.1);
}

.upload-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.upload-text {
    font-size: 1.02rem;
    color: var(--text-light);
    line-height: 1.7;
}

.upload-link {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid var(--accent-light);
    cursor: pointer;
    transition: all 0.2s;
}

.upload-link:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-dark);
}

.upload-hint {
    font-size: 0.85rem;
    color: var(--secondary);
    margin-top: 0.5rem;
    font-weight: 300;
}

/* ===== PDF Status ===== */
.pdf-status {
    margin-top: 0.75rem;
    background: linear-gradient(135deg, #f0f5f0, #e8f0e8);
    border: 1px solid #c8dcc8;
    border-radius: 10px;
    padding: 0.7rem 1rem;
}

.pdf-status.hidden { display: none; }

.pdf-status-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pdf-filename {
    font-size: 0.95rem;
    color: var(--success);
    font-weight: 500;
}

.pdf-filename::before {
    content: "\2713 ";
}

.pdf-clear {
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s;
}

.pdf-clear:hover {
    color: var(--danger);
    background: rgba(181, 102, 106, 0.08);
}

.pdf-progress {
    margin-top: 0.5rem;
    height: 3px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.pdf-progress.hidden { display: none; }

.pdf-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--primary));
    border-radius: 2px;
    transition: width 0.3s;
}

.pdf-calc-hint {
    margin-top: 1rem;
    font-size: 1.15rem;
    color: white;
    font-weight: 600;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    letter-spacing: 0.06em;
    animation: pulseHint 1.5s ease-in-out infinite;
    cursor: pointer;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.pdf-calc-hint:hover {
    box-shadow: 0 4px 16px rgba(139, 111, 92, 0.3);
    transform: translateY(-1px);
}

@keyframes pulseHint {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

.pdf-calc-hint.hidden { display: none; }

/* ===== Divider ===== */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--secondary);
    font-size: 0.88rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.divider span {
    padding: 0 1rem;
}

/* ===== Text Input ===== */
.input-area {
    /* wrapper - no special styling needed */
}

textarea {
    width: 100%;
    height: 110px;
    padding: 1rem 1.2rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    resize: none;
    font-size: 1.05rem;
    line-height: 1.7;
    transition: all 0.3s ease;
    font-family: 'Noto Sans JP', sans-serif;
    box-sizing: border-box;
    color: var(--text);
    background: #fdfcfb;
}

textarea::placeholder {
    color: #b5a9a5;
    font-weight: 300;
}

textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.12);
    background: #ffffff;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
    margin-top: 1rem;
}

button {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.03em;
}

#voiceBtn {
    background: #f5f0ec;
    color: var(--text-light);
    border: 1px solid var(--border);
}

#voiceBtn:hover {
    background: #ede5df;
    border-color: var(--primary-light);
}

#clearBtn {
    background: #f5f0ec;
    color: var(--text-light);
    border: 1px solid var(--border);
    padding: 0.85rem 0.8rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

#clearBtn:hover {
    background: rgba(181, 102, 106, 0.1);
    color: var(--danger);
    border-color: var(--danger);
}

#voiceBtn.active {
    background: rgba(181, 102, 106, 0.12);
    color: var(--danger);
    border-color: var(--danger);
    animation: pulse 1.5s infinite;
}

#calcBtn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
}

#calcBtn:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(107, 83, 68, 0.25);
}

#calcBtn:active {
    transform: translateY(0);
}

/* ===== Result Card ===== */
.result-card {
    margin-top: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #faf8f6, #f5f0ec);
    border-radius: 14px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
}

.result-card.hidden { display: none; }

.result-card h2 {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
    font-weight: 500;
    letter-spacing: 0.08em;
}

.price-display {
    text-align: center;
    margin: 1rem 0 1.5rem;
}

.price-label {
    display: block;
    font-size: 0.88rem;
    color: var(--secondary);
    font-weight: 400;
    margin-bottom: 0.3rem;
    letter-spacing: 0.05em;
}

#totalPrice {
    font-family: 'Noto Serif JP', serif;
    font-size: 3.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}

.price-display .unit {
    font-size: 1.1rem;
    color: var(--secondary);
    font-weight: 400;
    margin-left: 2px;
}

.discounted-original {
    font-size: 1rem;
    color: var(--secondary);
    text-decoration: line-through;
    margin-right: 0.5rem;
}

.discount-rate-badge {
    display: inline-block;
    background: #c0392b;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.plan-original {
    font-size: 0.8rem;
    color: var(--secondary);
    text-decoration: line-through;
    font-weight: 400;
    margin-right: 0.3rem;
}

.plan-card-price.has-discount {
    color: #c0392b;
}

/* ===== Model Case Badge ===== */
.model-case-badge {
    text-align: center;
    margin-bottom: 1rem;
}

.model-case-badge.hidden { display: none; }

.model-case-badge span {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    letter-spacing: 0.04em;
}

/* ===== App Description ===== */
.app-description {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.85;
    color: var(--text);
}

.app-description .desc-title {
    font-family: 'Noto Serif JP', serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
}

.app-description .desc-body {
    font-weight: 400;
    color: var(--text-light);
}

.app-description.hidden { display: none; }

/* ===== Plan Summary (3プラン概要) ===== */
.plan-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.plan-summary.hidden { display: none; }

.plan-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 0;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plan-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(61, 51, 49, 0.08);
}

.plan-card-header {
    padding: 0.8rem 0.9rem;
    text-align: center;
    font-family: 'Noto Serif JP', serif;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
}

.plan-card.plan-basic .plan-card-header {
    background: linear-gradient(135deg, #e8e0dc, #ddd4cf);
    color: var(--primary-dark);
}

.plan-card.plan-take .plan-card-header {
    background: linear-gradient(135deg, #e8f0e8, #d4e4d4);
    color: #4a6b4a;
}

.plan-card.plan-matsu .plan-card-header {
    background: linear-gradient(135deg, #f0e8d4, #e4d4b8);
    color: #6b5a3a;
}

.plan-card-body {
    padding: 0.8rem 0.9rem;
}

.plan-card-price {
    text-align: center;
    font-family: 'Noto Serif JP', serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.plan-card.plan-basic .plan-card-price { color: var(--primary-dark); }
.plan-card.plan-take .plan-card-price { color: #4a6b4a; }
.plan-card.plan-matsu .plan-card-price { color: #6b5a3a; }

.plan-card-price .plan-unit {
    font-size: 0.7rem;
    font-weight: 400;
}

.plan-card-period {
    text-align: center;
    font-size: 0.75rem;
    color: var(--secondary);
    margin-bottom: 0.7rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.plan-card-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.plan-card-features li {
    font-size: 0.78rem;
    color: var(--text-light);
    padding: 0.2rem 0;
    line-height: 1.5;
}

.plan-card-features li::before {
    content: "✓ ";
    color: var(--success);
    font-weight: 600;
}

.plan-card-label {
    text-align: center;
    font-size: 0.7rem;
    color: var(--secondary);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-weight: 400;
}

/* ===== Feature Sections ===== */
.feature-section {
    margin-bottom: 1.2rem;
    padding: 1.2rem 1.4rem;
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.section-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    letter-spacing: 0.05em;
}

.required-title { color: var(--danger); }
.optional-title { color: var(--primary); }

.section-desc {
    font-size: 0.82rem;
    color: var(--secondary);
    margin-bottom: 0.8rem;
    font-weight: 300;
    letter-spacing: 0.02em;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.6rem;
    border-bottom: 1px solid #f3eeeb;
    font-size: 0.98rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

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

.feature-list li .feat-left {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
}

.feature-list li .feat-icon {
    font-size: 1.05rem;
    flex-shrink: 0;
    opacity: 0.85;
}

.feature-list li .feat-name {
    color: var(--text);
    flex: 1;
    min-width: 0;
    font-weight: 400;
}

.feature-list li .feat-price {
    font-weight: 600;
    white-space: nowrap;
    margin-left: 0.75rem;
    font-size: 0.98rem;
}

.feature-list li .feat-price.required {
    color: var(--danger);
}

.feature-list li .feat-price.optional {
    color: var(--primary);
}

/* ===== Option Items (Toggleable) ===== */
.feature-list li.option-item {
    cursor: pointer;
    user-select: none;
}

.feature-list li.option-item:hover {
    background: #faf7f5;
}

.feature-list li.option-item.disabled {
    opacity: 0.35;
}

.feature-list li.option-item.disabled .feat-price {
    text-decoration: line-through;
}

/* Toggle Checkbox */
.feat-toggle {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: white;
    transition: all 0.25s ease;
}

.option-item:not(.disabled) .feat-toggle {
    background: var(--primary);
    border-color: var(--primary);
}

.option-item:not(.disabled) .feat-toggle::after {
    content: "\2713";
    font-weight: 700;
}

.option-item.disabled .feat-toggle {
    background: transparent;
    border-color: #ccc4c0;
}

/* ===== Subtotal Row ===== */
.section-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0.6rem 0;
    margin-top: 0.4rem;
    border-top: 1.5px solid var(--border);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.subtotal-price {
    color: var(--primary-dark);
    font-weight: 700;
}

/* ===== Option Tiers (竹・松 2列) ===== */
.option-tiers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.tier-column {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tier-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1rem;
    font-weight: 600;
}

.take-header {
    background: linear-gradient(135deg, #e8f0e8, #d4e4d4);
    color: #4a6b4a;
}

.matsu-header {
    background: linear-gradient(135deg, #f0e8d4, #e4d4b8);
    color: #6b5a3a;
}

.tier-icon {
    font-size: 1.2rem;
}

.tier-name {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
}

.tier-label {
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.7;
    margin-left: auto;
}

.tier-column .section-desc {
    padding: 0 1rem;
    margin-top: 0.5rem;
}

.tier-column .feature-list {
    padding: 0 0.6rem;
    flex-grow: 1;
}

.tier-column .feature-list li {
    font-size: 0.88rem;
    padding: 0.5rem 0.4rem;
}

.tier-column .feature-list li .feat-icon {
    font-size: 0.92rem;
}

.tier-column .feature-list li .feat-price {
    font-size: 0.85rem;
}

.tier-column .section-subtotal {
    margin: 0 0.6rem;
    padding: 0.6rem 0.4rem 0;
    font-size: 0.85rem;
}

.tier-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    margin-top: auto;
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
}

.tier-take .tier-total {
    background: linear-gradient(135deg, #5a8a5a, #4a7a4a);
}

.tier-matsu .tier-total {
    background: linear-gradient(135deg, #8a7040, #7a6030);
}

.tier-total-price {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

/* ===== Discount Section ===== */
.discount-section {
    margin-top: 2.5rem;
    text-align: center;
}

.discount-banner {
    position: relative;
    background: #fffcf8;
    border-top: 1px solid #d4c4b0;
    border-bottom: 1px solid #d4c4b0;
    padding: 2rem 1.5rem;
}

.discount-kigen {
    font-family: 'Noto Serif JP', serif;
    font-size: 0.75rem;
    color: #b08968;
    letter-spacing: 0.35em;
    margin-bottom: 0.8rem;
}

.discount-text {
    font-size: 0.88rem;
    color: #8c8584;
    margin-bottom: 1rem;
    line-height: 1.7;
    letter-spacing: 0.03em;
}

.discount-rate {
    font-family: 'Noto Serif JP', serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-dark);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.discount-number {
    font-family: 'Noto Serif JP', serif;
    font-size: 2.6rem;
    font-weight: 700;
    color: #9b3a3a;
    line-height: 1;
    vertical-align: baseline;
    margin: 0 0.05em;
}

.discount-percent {
    font-family: 'Noto Serif JP', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #9b3a3a;
}

.discount-off {
    font-family: 'Noto Serif JP', serif;
    font-size: 1rem;
    font-weight: 500;
    color: #9b3a3a;
    margin-left: 0.1em;
    letter-spacing: 0.1em;
}

.discount-deadline {
    font-size: 0.82rem;
    color: #9b3a3a;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.discount-btn {
    display: inline-block;
    margin-top: 1.2rem;
    padding: 0.7rem 2.2rem;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #9b3a3a;
    background: transparent;
    border: 1.5px solid #9b3a3a;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.08em;
}

.discount-btn:hover {
    background: #9b3a3a;
    color: #fff;
}

.discount-btn:active {
    opacity: 0.85;
}

.discount-btn.applied {
    background: var(--primary-dark);
    color: #fff;
    border-color: var(--primary-dark);
}

.discount-btn.applied:hover {
    opacity: 0.9;
}

/* ===== Result Actions ===== */
.result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
    margin-top: 1.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 1.2rem;
    font-size: 0.92rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    line-height: 1.3;
}

.action-btn .action-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.action-consult {
    grid-column: 1 / -1;
    flex-direction: column;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    font-size: 1.2rem;
    padding: 1.2rem 1.5rem;
    box-shadow: 0 4px 15px rgba(107, 83, 68, 0.25);
    position: relative;
    overflow: hidden;
}

.action-sub {
    font-size: 0.78rem;
    font-weight: 400;
    opacity: 0.85;
    margin-top: 0.15rem;
}

.action-consult::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.action-consult:hover::before {
    left: 100%;
}

.action-consult:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 83, 68, 0.35);
}

.action-pdf {
    color: var(--primary-dark);
    background: linear-gradient(135deg, #f5efe9, #ede5dd);
    border: 1.5px solid var(--border);
}

.action-pdf:hover {
    background: linear-gradient(135deg, #ede5dd, #e5dbd3);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(107, 83, 68, 0.12);
}

.action-speak {
    color: var(--secondary);
    background: #f8f5f2;
    border: 1.5px solid var(--border);
}

.action-speak:hover {
    background: #f0ebe6;
    color: var(--text);
    transform: translateY(-1px);
}

.action-speak.speaking {
    color: white;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #c0392b;
    animation: pulse 1.5s ease-in-out infinite;
}

.action-speak.speaking:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    color: white;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(247, 244, 242, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.loading-overlay.hidden { display: none; }

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--secondary);
    font-weight: 300;
}

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

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ===== Footer ===== */
.footer {
    width: 100%;
    text-align: center;
    margin-top: auto;
    padding: 1.5rem 1rem;
    font-size: 0.88rem;
    color: var(--primary-dark);
    font-family: 'Noto Serif JP', serif;
    letter-spacing: 0.15em;
    font-weight: 500;
}
.footer-brand {
    font-family: 'Noto Serif JP', serif;
    font-weight: 700;
}
.footer-spark {
    background: linear-gradient(135deg, var(--accent), #d4a76a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    body { padding: 0.4rem 0.2rem 0; font-size: 16px; color: #2a2625; }
    .container { padding: 1.2rem 1rem; max-width: 100%; border-radius: 10px; }
    .brand { margin-bottom: 0.8rem; padding-bottom: 0.6rem; }
    .brand-mark { margin-bottom: 0.3rem; }
    .brand-logo { font-size: 2rem; }
    .brand-icon { font-size: 0.85rem; }
    .brand-tagline { font-size: 0.68rem; letter-spacing: 0.2em; }
    h1 { font-size: 1.4rem; margin-bottom: 0.3rem; font-weight: 700; color: var(--primary-dark); }
    .subtitle { font-size: 0.92rem; margin-bottom: 0.8rem; color: #5a504e; }

    /* モデルケースボタン - タップしやすく */
    .model-buttons { gap: 6px; margin-bottom: 1rem; }
    .model-btn { padding: 0.5rem 0.75rem; font-size: 0.85rem; border-radius: 16px; }
    .model-btn .btn-icon { font-size: 0.9rem; }

    /* テキスト入力 */
    textarea { height: 120px; font-size: 1rem; padding: 0.7rem 0.8rem; border-radius: 8px; color: #2a2625; }

    /* ボタン - 大きくタップしやすく */
    .controls { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 0.7rem; }
    .controls button { padding: 0.9rem 0.5rem; font-size: 1rem; min-height: 48px; border-radius: 10px; }
    .controls #clearBtn { grid-column: span 2; min-height: 44px; font-size: 0.9rem; display: none; }
    .controls #clearBtn.show { display: block; }

    /* 区切り */
    .divider { margin: 0.7rem 0; font-size: 0.82rem; }

    /* PDF アップロード */
    .upload-area { padding: 0.7rem 0.8rem; border-radius: 8px; min-height: auto; }
    .upload-icon { font-size: 1.2rem; margin-bottom: 0.2rem; }
    .upload-text { font-size: 0.85rem; line-height: 1.4; color: #3d3331; }
    .upload-text br { display: none; }
    .upload-hint { font-size: 0.72rem; margin-top: 0.2rem; }
    .upload-link { font-size: 0.88rem; }

    /* PDF読み込み状態 */
    .pdf-status { padding: 0.6rem 0.8rem; }
    .pdf-calc-hint { font-size: 0.9rem; padding: 0.6rem 1rem; min-height: 44px; }

    /* 結果カード */
    #totalPrice { font-size: 2.2rem; }
    .price-display .unit { font-size: 1rem; }
    .result-card { padding: 1.2rem; margin-top: 1.2rem; }
    .result-card h2 { font-size: 1.15rem; font-weight: 700; color: var(--primary-dark); }
    .section-title { font-size: 1rem; font-weight: 600; color: #3d3331; }
    .section-desc { font-size: 0.82rem; color: #5a504e; }
    .feature-section { padding: 0.7rem; }
    .feature-list li { padding: 0.5rem 0.4rem; font-size: 0.9rem; color: #3d3331; }
    .section-subtotal { font-size: 0.92rem; padding: 0.5rem 0.4rem; font-weight: 600; }

    /* ティア */
    .option-tiers { grid-template-columns: 1fr; gap: 0.8rem; }
    .tier-column { padding: 0.8rem; }
    .tier-column .feature-list li { font-size: 0.9rem; color: #3d3331; }
    .tier-header { font-size: 1rem; }
    .tier-name { font-size: 1.1rem; }
    .tier-total { font-size: 0.95rem; padding: 0.6rem 0.5rem; }
    .tier-total-price { font-size: 1.05rem; }

    /* プランサマリー */
    .plan-summary { grid-template-columns: 1fr; gap: 0.5rem; }
    .plan-card { padding: 0.8rem; }
    .plan-card-header { font-size: 1rem; }
    .plan-card-name { font-size: 0.95rem; }
    .plan-card-price { font-size: 1.2rem; }
    .plan-card-period { font-size: 0.8rem; }
    .plan-card-features li { font-size: 0.85rem; }
    .plan-card-label { font-size: 0.8rem; }

    /* 割引 */
    .discount-section { margin: 1rem 0; }
    .discount-banner { padding: 1rem; }
    .discount-kigen { font-size: 0.8rem; }
    .discount-text { font-size: 0.92rem; }
    .discount-number { font-size: 2.2rem; }
    .discount-percent { font-size: 1.1rem; }
    .discount-off { font-size: 1.1rem; }
    .discount-btn { padding: 0.7rem 1.5rem; font-size: 0.95rem; min-height: 44px; }

    /* アクションボタン - タップしやすく */
    .result-actions { grid-template-columns: 1fr; gap: 0.6rem; }
    .action-btn { font-size: 0.95rem; padding: 0.85rem 1rem; min-height: 48px; border-radius: 10px; }
    .action-sub { font-size: 0.78rem; }
    .price-label { font-size: 0.92rem; }
    .app-description { font-size: 0.92rem; padding: 0.8rem; color: #3d3331; }

    .footer { font-size: 0.72rem; padding: 0.8rem 0.5rem; }
}

@media (min-width: 481px) and (max-width: 600px) {
    body { padding: 0.8rem 0.5rem 0; }
    .container { padding: 1.5rem 1.2rem; max-width: 100%; }
    .brand-logo { font-size: 2.2rem; }
    .controls { grid-template-columns: 1fr 1fr auto; }
    .controls button { min-height: 46px; }
    #totalPrice { font-size: 2rem; }
    .model-buttons { gap: 6px; }
    .model-btn { padding: 0.45rem 0.75rem; font-size: 0.78rem; }
    .option-tiers { grid-template-columns: 1fr; }
    .plan-summary { grid-template-columns: 1fr; gap: 0.6rem; }
    .result-actions { grid-template-columns: 1fr; }
    .action-btn { min-height: 48px; padding: 0.85rem 1rem; }
    .discount-btn { min-height: 44px; }
}

@media (min-width: 780px) {
    .container { padding: 3rem 4rem; }
}
