* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Yu Gothic", "Meiryo", sans-serif;
    background: #f4f5f7;
    color: #222;
    line-height: 1.75;
}

.container {
    width: 100%;
    max-width: 780px;
    margin: 0 auto;
    padding: 24px 14px 50px;
}

.hero,
.card,
.result-card {
    background: #fff;
    border-radius: 22px;
    padding: 24px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.07);
    margin-bottom: 18px;
}

/* ==============================
   Common typography
   ============================== */

.badge {
    display: inline-block;
    background: #e60000;
    color: #fff;
    font-weight: 800;
    padding: 4px 13px;
    border-radius: 999px;
    font-size: 13px;
    margin: 0 0 12px;
}

h1 {
    font-size: 29px;
    line-height: 1.35;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 20px;
    line-height: 1.45;
    margin: 0 0 14px;
}

.lead,
.step-lead {
    font-size: 16px;
    margin: 0 0 14px;
}

.note {
    font-size: 13px;
    color: #555;
    background: #f3f3f3;
    border-radius: 12px;
    padding: 12px;
}

.mini-note {
    color: #666;
    font-size: 13px;
    margin: 4px 0 12px;
}

/* ==============================
   Hero
   ============================== */

.hero-image-wrap {
    padding: 0;
    overflow: hidden;
    background: #fff;
}

.hero-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 22px 22px 0 0;
}

.hero-note {
    margin: 0;
    border-radius: 0 0 22px 22px;
    background: #111;
    color: #fff;
}

.hero-points {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0;
}

.hero-points div {
    background: #fff3f3;
    color: #b50000;
    border-radius: 12px;
    text-align: center;
    padding: 9px 6px;
    font-size: 13px;
    font-weight: 800;
}

/* ==============================
   Progress
   ============================== */

.progress-wrap {
    margin-bottom: 20px;
}

.progress-text {
    font-size: 13px;
    color: #666;
    text-align: right;
    margin-bottom: 6px;
}

.progress-bar,
.bar {
    width: 100%;
    height: 12px;
    background: #eee;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill,
.bar-inner {
    height: 100%;
    background: #e60000;
    border-radius: 999px;
    transition: width .25s ease;
}

/* ==============================
   Question steps
   ============================== */

.step {
    display: none;
}

.step.active {
    display: block;
}

.check-label {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    background: #f8f8f8;
    padding: 13px;
    border-radius: 12px;
    font-weight: 700;
}

.choices {
    display: grid;
    gap: 10px;
}

.choices label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 2px solid #e8e8e8;
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: .15s ease;
}

.choices label:hover {
    border-color: #e60000;
    background: #fff7f7;
}

.choices input {
    width: 18px;
    height: 18px;
    accent-color: #e60000;
}

/* ==============================
   Buttons
   ============================== */

button,
.btn {
    display: block;
    width: 100%;
    margin-top: 22px;
    padding: 15px 18px;
    background: #e60000;
    color: #fff;
    border: none;
    border-radius: 14px;
    text-align: center;
    text-decoration: none;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
}

button:hover,
.btn:hover {
    opacity: 0.92;
}

button:disabled,
.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.nav-buttons {
    margin-top: 10px;
}

.back-btn {
    display: none;
    background: #555;
    margin-top: 12px;
}

.sub-link {
    display: block;
    margin-top: 18px;
    text-align: center;
    color: #555;
    text-decoration: underline;
}

/* ==============================
   Photo upload step
   ============================== */

.photo-step {
    padding-bottom: 6px;
}

.photo-step-kicker {
    display: inline-block;
    margin: 0 0 10px;
    background: #0b63ce;
    color: #fff;
    font-weight: 900;
    border-radius: 999px;
    padding: 5px 13px;
    font-size: 13px;
}

.no-photo-ok-box {
    display: grid;
    gap: 6px;
    background: #eaf4ff;
    border: 2px solid #8cc5ff;
    border-radius: 18px;
    padding: 16px;
    margin: 16px 0;
}

.no-photo-ok-box strong {
    display: block;
    color: #003366;
    font-size: 20px;
    line-height: 1.45;
    font-weight: 900;
}

.no-photo-ok-box span {
    display: block;
    color: #36536f;
    font-size: 14px;
    line-height: 1.7;
    font-weight: 700;
}

.photo-limit-note {
    display: grid;
    gap: 6px;
    background: #fff7e8;
    border: 2px solid #ffb24a;
    border-radius: 18px;
    padding: 15px;
    margin: 14px 0;
}

.photo-limit-note strong {
    display: block;
    color: #7a3b00;
    font-size: 17px;
    line-height: 1.45;
    font-weight: 900;
}

.photo-limit-note span {
    display: block;
    color: #6c4a20;
    font-size: 14px;
    line-height: 1.7;
    font-weight: 700;
}

.photo-guide-image-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: #fff;
    border: 2px solid #e5edf7;
    border-radius: 18px;
    padding: 8px;
    margin: 18px 0;
    box-shadow: 0 8px 22px rgba(0, 45, 100, 0.07);
}

.photo-guide-image-wrap img,
.photo-guide-image,
.photo-step img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 14px;
}

.photo-guide-text {
    background: #f7fbff;
    border-left: 5px solid #0b63ce;
    border-radius: 14px;
    padding: 15px;
    margin: 18px 0;
}

.photo-guide-text h3 {
    margin: 0 0 8px;
    font-size: 17px;
    color: #003366;
}

.photo-guide-text ul {
    margin: 0;
    padding-left: 1.2em;
}

.photo-guide-text li {
    margin: 6px 0;
    color: #333;
    font-size: 14px;
    line-height: 1.75;
}

.upload-card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin: 18px 0;
}

.upload-card-grid-single {
    grid-template-columns: 1fr;
}

.upload-card {
    background: #fff;
    border: 2px solid #e6eaf0;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.04);
}

.upload-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.upload-card-head strong {
    font-size: 17px;
    color: #111;
}

.upload-badge {
    display: inline-block;
    background: #e60000;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    border-radius: 999px;
    padding: 3px 9px;
}

.upload-badge.sub {
    background: #555;
}

.upload-card p {
    margin: 0 0 12px;
    color: #555;
    font-size: 13px;
    line-height: 1.7;
}

.file-label {
    display: block;
    font-weight: 800;
    margin: 14px 0 6px;
}

.file-input {
    width: 100%;
    border: 2px dashed #ddd;
    padding: 14px;
    border-radius: 14px;
    background: #fafafa;
}

.upload-card .file-input {
    background: #f9fbff;
    border-color: #b9d7f5;
}

.photo-step .submit-btn {
    margin-top: 18px;
    background: linear-gradient(90deg, #e60000, #ff4d00);
    box-shadow: 0 10px 24px rgba(230, 0, 0, 0.22);
}

.photo-step .submit-btn::after {
    content: " →";
}

/* ==============================
   Loading UI
   ============================== */

.loading-box {
    display: none;
    margin-top: 18px;
    background: #fff7f2;
    border: 2px solid #ff8a00;
    border-radius: 18px;
    padding: 18px;
    text-align: center;
}

.loading-box.active {
    display: block;
}

.loading-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto;
    border: 4px solid #ffd6b0;
    border-top-color: #ff4d00;
    border-radius: 50%;
    animation: agaSpin 0.8s linear infinite;
}

.loading-box strong {
    display: block;
    color: #111;
    font-size: 17px;
    font-weight: 900;
    margin-top: 10px;
}

.loading-box p {
    margin: 8px 0 0;
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    font-weight: 700;
}

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

/* ==============================
   Result score
   ============================== */

.score-panel {
    background: #fff7f2;
    border: 2px solid #ff8a00;
    border-radius: 18px;
    padding: 18px;
    margin: 22px 0;
}

.score-title {
    text-align: center;
    font-weight: 900;
    font-size: 18px;
    margin: 0 0 6px;
    color: #111;
}

.score-box {
    text-align: center;
    margin: 22px 0 8px;
}

.score {
    font-size: 72px;
    font-weight: 900;
    color: #e60000;
    line-height: 1;
}

.score-total {
    font-size: 24px;
    color: #666;
}

.score-caption {
    text-align: center;
    color: #555;
    font-size: 13px;
    margin: 4px 0 14px;
}

.state-label {
    text-align: center;
    font-weight: 900;
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 9px 12px;
    margin: 14px 0 0;
}

.message {
    background: #fff5f5;
    border-left: 5px solid #e60000;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    font-weight: 700;
}

/* ==============================
   Result common sections
   ============================== */

.photo-section,
.factor-box,
.advice,
.article-box,
.cta-box {
    margin-top: 22px;
    background: #f8f8f8;
    border-radius: 18px;
    padding: 18px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.photo-grid-single {
    grid-template-columns: 1fr;
}

.photo-grid img {
    display: block;
    width: 100%;
    border-radius: 14px;
    background: #eee;
}

.photo-label {
    margin: 0 0 6px;
    font-weight: 900;
}

.factor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fff;
    border-radius: 14px;
    padding: 13px;
    margin-top: 10px;
}

.factor-row p {
    margin: 3px 0 0;
    font-size: 13px;
    color: #555;
}

.factor-row span {
    flex: 0 0 auto;
    color: #e60000;
    font-weight: 900;
}

.section-kicker {
    display: inline-block;
    margin: 0 0 8px;
    background: #ff8a00;
    color: #111;
    font-weight: 900;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
}

/* ==============================
   AI image result
   ============================== */

.ai-image-box {
    margin-top: 22px;
    background: #f7fbff;
    border: 2px solid #8cc5ff;
    border-radius: 18px;
    padding: 18px;
}

.ai-image-box-v2 {
    background: #f7fbff;
    border: 2px solid #8cc5ff;
    border-radius: 20px;
    padding: 20px;
    margin-top: 24px;
}

.ai-image-box h2,
.ai-image-box-v2 h2 {
    color: #003366;
    margin-bottom: 10px;
}

.ai-main-comment {
    background: linear-gradient(180deg, #ffffff, #eef7ff);
    border: 3px solid #0b63ce;
    border-radius: 18px;
    padding: 18px;
    margin: 18px 0;
    box-shadow: 0 10px 24px rgba(11, 99, 206, 0.12);
}

.ai-main-comment strong {
    display: inline-block;
    background: #0b63ce;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    border-radius: 999px;
    padding: 5px 13px;
    margin-bottom: 10px;
}

.ai-main-comment p {
    margin: 0;
    color: #111;
    font-size: 16px;
    line-height: 1.9;
    font-weight: 800;
}

.ai-main-warning {
    border-color: #ff8a00;
    background: #fff8ef;
}

.ai-main-warning strong {
    background: #ff8a00;
    color: #111;
}

.ai-reason-box {
    background: #fff;
    border: 2px solid #dcecff;
    border-radius: 18px;
    padding: 16px;
    margin: 16px 0;
}

.ai-reason-box > strong {
    display: block;
    color: #003366;
    font-size: 16px;
    font-weight: 900;
    margin-bottom: 10px;
}

.ai-reason-box ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ai-reason-box li {
    position: relative;
    background: #f4f9ff;
    border-radius: 12px;
    padding: 11px 12px 11px 38px;
    margin-top: 8px;
    color: #333;
    font-size: 14px;
    line-height: 1.75;
    font-weight: 700;
}

.ai-reason-box li::before {
    content: "✓";
    position: absolute;
    left: 12px;
    top: 11px;
    width: 20px;
    height: 20px;
    background: #0b63ce;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
    font-weight: 900;
}

.ai-positive-box {
    background: #f1fff5;
    border: 2px solid #46b96c;
    border-radius: 18px;
    padding: 16px;
    margin: 16px 0;
}

.ai-positive-box strong {
    display: inline-block;
    background: #168a3a;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    border-radius: 999px;
    padding: 5px 13px;
    margin-bottom: 10px;
}

.ai-positive-box p {
    margin: 0;
    color: #124d24;
    font-size: 15px;
    line-height: 1.85;
    font-weight: 800;
}

.ai-detail-box {
    margin-top: 18px;
}

.ai-detail-box h3 {
    margin: 0 0 12px;
    color: #003366;
    font-size: 17px;
    font-weight: 900;
}

.ai-result-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.ai-result-item,
.ai-comment {
    background: #fff;
    border: 2px solid #e3f0ff;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 6px 16px rgba(0, 45, 100, 0.05);
}

.ai-result-item strong,
.ai-comment strong {
    display: block;
    color: #003366;
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 5px;
}

.ai-result-item p,
.ai-comment p {
    margin: 0;
    color: #333;
    font-size: 14px;
    line-height: 1.8;
}

.ai-comment {
    margin-top: 12px;
    border-left: 5px solid #0b63ce;
}

.ai-next-action {
    background: #fff7f2;
    border: 2px solid #ff8a00;
    border-radius: 18px;
    padding: 16px;
    margin-top: 16px;
}

.ai-next-action strong {
    display: inline-block;
    background: #ff8a00;
    color: #111;
    font-size: 14px;
    font-weight: 900;
    border-radius: 999px;
    padding: 5px 13px;
    margin-bottom: 10px;
}

.ai-next-action p {
    margin: 0;
    color: #333;
    font-size: 15px;
    line-height: 1.85;
    font-weight: 800;
}

/* ==============================
   Article cards
   ============================== */

.article-box {
    background: #fff;
    border: 2px solid #ff8a00;
}

.article-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 2px solid #eee;
    border-radius: 15px;
    padding: 15px;
    text-decoration: none;
    color: #222;
    margin-top: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.article-card:hover {
    border-color: #ff8a00;
    background: #fff8ef;
}

.article-text {
    flex: 1;
}

.article-card strong {
    display: block;
    line-height: 1.5;
}

.article-card span {
    display: block;
    color: #666;
    font-size: 13px;
    margin-top: 6px;
}

.article-button {
    flex: 0 0 auto;
    background: #111;
    color: #fff;
    font-weight: 900;
    border-radius: 999px;
    padding: 10px 14px;
    font-size: 13px;
    white-space: nowrap;
}

/* ==============================
   Primary consultation CTA
   ============================== */

.primary-consult-cta {
    margin-top: 20px;
    margin-bottom: 22px;
    background: linear-gradient(180deg, #111, #2a1600);
    border: 3px solid #ff8a00;
    color: #fff;
    box-shadow: 0 14px 34px rgba(255, 90, 0, 0.22);
}

.primary-consult-cta h2 {
    color: #fff;
    font-size: 24px;
    line-height: 1.45;
}

.primary-consult-cta p {
    color: #f5f5f5;
    font-weight: 700;
}

.primary-consult-cta .section-kicker {
    background: #ff8a00;
    color: #111;
}

.final-cta {
    background: #111;
    border: 3px solid #ff8a00;
    color: #fff;
}

.final-cta h2 {
    color: #fff;
    font-size: 23px;
}

.final-cta p {
    color: #f3f3f3;
}

.final-btn,
.primary-consult-cta .final-btn {
    background: linear-gradient(90deg, #ff8a00, #ff4d00);
    color: #fff;
    box-shadow: 0 10px 24px rgba(255, 90, 0, 0.35);
    font-size: 18px;
}

.final-btn::after,
.primary-consult-cta .final-btn::after {
    content: " →";
}

/* ==============================
   Share box
   ============================== */

.share-box {
    margin-top: 22px;
    background: #f4fff8;
    border: 2px solid #46b96c;
    border-radius: 18px;
    padding: 18px;
}

.share-box h2 {
    color: #124d24;
}

.share-box p {
    color: #333;
    margin: 0 0 12px;
}

.share-limit-note {
    background: #fff;
    border-left: 5px solid #46b96c;
    border-radius: 12px;
    padding: 12px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.7;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.share-btn {
    display: block;
    width: 100%;
    margin: 0;
    padding: 14px 16px;
    border-radius: 14px;
    border: none;
    text-align: center;
    text-decoration: none;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

.line-share {
    background: #06c755;
    color: #fff;
}

.copy-share {
    background: #111;
    color: #fff;
}

.copy-done {
    margin: 10px 0 0;
    color: #168a3a;
    font-size: 13px;
    font-weight: 900;
}

/* ==============================
   Responsive
   ============================== */

@media (max-width: 520px) {
    .container {
        padding: 14px 10px 40px;
    }

    .hero,
    .card,
    .result-card {
        padding: 20px;
        border-radius: 18px;
    }

    .hero-image {
        border-radius: 18px 18px 0 0;
    }

    .hero-note {
        border-radius: 0 0 18px 18px;
        font-size: 12px;
        line-height: 1.6;
    }

    h1 {
        font-size: 25px;
    }

    h2 {
        font-size: 19px;
    }

    .hero-points {
        grid-template-columns: 1fr;
    }

    .score {
        font-size: 64px;
    }

    .choices label {
        padding: 13px;
        font-size: 15px;
    }

    .photo-grid,
    .upload-card-grid,
    .ai-result-grid,
    .share-buttons {
        grid-template-columns: 1fr;
    }

    .no-photo-ok-box,
    .photo-limit-note {
        padding: 14px;
    }

    .no-photo-ok-box strong {
        font-size: 18px;
    }

    .photo-limit-note strong {
        font-size: 16px;
    }

    .photo-guide-image-wrap {
        padding: 6px;
        border-radius: 16px;
    }

    .photo-guide-image {
        border-radius: 12px;
    }

    .ai-image-box-v2 {
        padding: 16px;
        border-radius: 18px;
    }

    .ai-main-comment {
        padding: 16px;
    }

    .ai-main-comment p {
        font-size: 15px;
        line-height: 1.85;
    }

    .ai-reason-box,
    .ai-positive-box,
    .ai-next-action {
        padding: 14px;
    }

    .ai-reason-box li {
        padding: 10px 10px 10px 36px;
        font-size: 13px;
    }

    .article-card {
        display: block;
    }

    .article-button {
        display: block;
        text-align: center;
        margin-top: 12px;
        padding: 12px 14px;
    }

    .final-cta h2,
    .primary-consult-cta h2 {
        font-size: 20px;
    }

    .primary-consult-cta p {
        font-size: 14px;
        line-height: 1.8;
    }
}