:root {
    --primary: #0056b3;
    --secondary: #e6f2ff;
    --accent: #ff4d4d;
    --gold: #ffc107;
    --text: #333;
    --bg: #f4f6f9;
    --white: #ffffff;
}

body {
    font-family: "Noto Sans JP", sans-serif;
    color: var(--text);
    background-color: var(--bg);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
.header {
    background-color: var(--white);
    border-bottom: 3px solid var(--primary);
    padding: 15px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

.logo img {
    height: 50px;
}

.header-desc {
    font-size: 0.8rem;
    color: #666;
    text-align: right;
    line-height: 1.4;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #003366 100%);
    color: var(--white);
    text-align: center;
    padding: 40px 0;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.2rem;
    line-height: 1.4;
    margin-bottom: 20px;
}

.hero h1 .sub {
    font-size: 1.2rem;
    background: var(--gold);
    color: #000;
    /* Ensure text is black */
    padding: 5px 15px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 10px;
    font-weight: bold;
}

.hero h1 span:not(.sub) {
    color: var(--gold);
}

.hero p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Ranking Cards */
.area-title {
    text-align: center;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 30px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}

.rank-card {
    background: var(--white);
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.rank-1 {
    border: 3px solid var(--gold);
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.crown {
    background: var(--gold);
    color: #000;
    padding: 5px 20px;
    position: absolute;
    top: 0;
    left: 0;
    font-weight: bold;
    font-size: 1.2rem;
    border-bottom-right-radius: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
}

.rank-badge {
    background: #bbb;
    color: var(--white);
    padding: 5px 15px;
    position: absolute;
    top: 0;
    left: 0;
    font-weight: bold;
    border-bottom-right-radius: 8px;
}

.rank-2 {
    background: #c0c0c0;
}

/* Silver */
.rank-3 {
    background: #cd7f32;
}

/* Bronze */

.rank-header {
    background: var(--secondary);
    padding: 40px 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.company-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-rec {
    background: var(--accent);
    color: var(--white);
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.rating-star {
    font-weight: bold;
    color: #f39c12;
    font-size: 1.1rem;
}

.rank-body {
    padding: 20px;
    display: flex;
    gap: 20px;
}

.rank-img {
    flex: 0 0 150px;
}

.rank-img img {
    width: 100%;
    height: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.rank-detail {
    flex: 1;
}

.full-width {
    width: 100%;
}

.point-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.point-list li {
    margin-bottom: 5px;
    border-bottom: 1px dashed #eee;
    padding-bottom: 5px;
}

.point-list strong {
    color: var(--accent);
}

.btn-wrap {
    text-align: right;
}

.btn {
    display: inline-block;
    text-decoration: none;
    padding: 12px 30px;
    border-radius: 5px;
    font-weight: bold;
    transition: opacity 0.3s;
}

.btn-rank1 {
    background: linear-gradient(to bottom, #ff6666, #ff0000);
    color: var(--white);
    font-size: 1.1rem;
    box-shadow: 0 4px 0 #cc0000;
    width: 100%;
    text-align: center;
}

.btn-normal {
    background: var(--primary);
    color: var(--white);
    padding: 8px 20px;
    font-size: 0.9rem;
}

.btn:hover {
    opacity: 0.8;
}

.criteria-box {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #666;
}

/* Footer */
.footer {
    background: #333;
    color: #aaa;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
    }

    .header-desc {
        text-align: center;
        font-size: 0.75rem;
    }

    .hero {
        padding: 30px 0;
    }

    .hero h1 {
        font-size: 1.4rem;
        line-height: 1.5;
    }

    .hero h1 .sub {
        font-size: 0.9rem;
        padding: 4px 10px;
        white-space: normal;
        /* Allow wrapping */
        display: inline-block;
        width: auto;
        max-width: 90%;
    }

    .rank-body {
        flex-direction: column;
    }

    .rank-img {
        width: 100%;
        text-align: center;
        margin-bottom: 20px;
    }

    .rank-img img {
        width: 100%;
        max-width: 300px;
        /* Limit image size on mobile */
    }

    .rank-header {
        flex-direction: column;
        align-items: center;
        /* Center align for mobile */
        gap: 10px;
        text-align: center;
    }

    .company-name {
        flex-direction: column;
        gap: 5px;
    }

    .badge-rec {
        margin-left: 0;
    }

    .rank-visual {
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        /* Allow full width to center content properly */
        margin: 0 auto 20px;
        flex-direction: row;
        /* Try horizontal adjustment or keeping column */
        justify-content: center;
    }

    /* Hide Radar Chart on Mobile as requested to declutter */
    .chart-box {
        display: none;
    }

    .rank-img {
        width: 100%;
        max-width: 300px;
    }
}

/* Rank Visuals */
.rank-visual {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-right: 20px;
    align-items: center;
    width: 150px;
    flex-shrink: 0;
}

.rank-img {
    width: 100%;
}

.rank-img img {
    width: 100%;
    border-radius: 5px;
}

/* Rich Detail Texts */
.detail-title {
    font-size: 1.1rem;
    color: var(--primary);
    margin: 0 0 10px 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.detail-desc {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Radar Chart CSS Placeholder */
.chart-box {
    width: 140px;
    height: 140px;
    background: #f8f9fa;
    border-radius: 50%;
    position: relative;
    border: 1px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chart-box.small {
    width: 100px;
    height: 100px;
}

.radar-chart {
    width: 100%;
    height: 100%;
    position: relative;
}

.chart-bg {
    width: 100%;
    height: 100%;
    background: repeating-radial-gradient(#fff, #fff 10px, #eee 11px);
    border-radius: 50%;
}

.chart-poly {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: rgba(0, 86, 179, 0.4);
    border: 2px solid var(--primary);
    /* 4-axis Radar Chart: Top, Right, Bottom, Left */
    /* Center is 50% 50%. Radius is 50%. */
    /* Variable range 0-100 maps to 0-50% distance from center */
    clip-path: polygon(50% calc(50% - (var(--s1) * 0.5%)),
            /* Top: Trust */
            calc(50% + (var(--s2) * 0.5%)) 50%,
            /* Right: Tech */
            50% calc(50% + (var(--s3) * 0.5%)),
            /* Bottom: Speed */
            calc(50% - (var(--s4) * 0.5%)) 50%
            /* Left: Cost */
        );
}

.chart-label {
    position: absolute;
    font-size: 0.6rem;
    color: #555;
    background: rgba(255, 255, 255, 0.8);
    padding: 0 2px;
}

.chart-label.top {
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.chart-label.right {
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
}

.chart-label.bottom {
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
}

.chart-label.left {
    top: 50%;
    left: 5px;
    transform: translateY(-50%);
}

/* Comparison Table */
.section-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.bg-white {
    background: var(--white);
    padding: 40px 20px;
    border-radius: 10px;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 30px;
}

.table-scroll {
    overflow-x: auto;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    min-width: 800px;
}

.compare-table th,
.compare-table td {
    padding: 15px;
    text-align: center;
    border: 1px solid #ddd;
    font-size: 0.95rem;
}

.compare-table th {
    background: var(--primary);
    color: var(--white);
}

.compare-table .name {
    font-weight: bold;
    text-align: left;
    background: #f9f9f9;
}

.highlight-row {
    background: #e6f2ff;
    border: 2px solid var(--primary);
}

/* Flow Chart */
.flow-chart {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

.flow-step {
    background: var(--white);
    padding: 20px;
    width: 200px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative;
    border: 1px solid #eee;
}

.flow-step.highlight {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.flow-step.highlight p {
    color: #e6f2ff;
}

.step-num {
    background: #ddd;
    color: #555;
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.flow-step.highlight .step-num {
    background: #fff;
    color: var(--primary);
}

.flow-step h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.flow-step p {
    font-size: 0.9rem;
    color: #666;
}

.flow-arrow {
    display: flex;
    align-items: center;
    color: var(--primary);
    font-size: 1.5rem;
    padding-top: 50px;
}

.btn-detail {
    background: #fff;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 8px 20px;
    border-radius: 5px;
    font-size: 0.9rem;
}

.btn-detail:hover {
    background: #e6f2ff;
}

@media (max-width: 768px) {
    .rank-card .rank-body {
        flex-direction: column;
    }

    .rank-visual {
        margin-right: 0;
        margin-bottom: 20px;
        justify-content: center;
    }

    .chart-box {
        display: none !important;
    }

    .flow-chart {
        flex-direction: column;
        align-items: center;
    }

    .flow-arrow {
        transform: rotate(90deg);
        padding: 0;
        margin: 10px 0;
    }
}