:root {
    --primary-color: #0066cc;
    --primary-gradient: linear-gradient(135deg, #0066cc 0%, #00b4d8 100%);
    --secondary-color: #fca311;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --danger-color: #ff4d4d;
    --success-color: #28a745;
    --border-radius: 12px;
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans JP', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 480px;
    /* Mobile width cap */
    background-color: var(--card-bg);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow-x: hidden;
}

/* Header */
.app-header {
    background: var(--card-bg);
    padding: 16px 20px;
    border-bottom: 1px solid #eeeeee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Screen visibility */
.screen {
    display: none;
    padding: 24px 20px;
    animation: fadeIn 0.4s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Text Styles */
h1 {
    font-size: 1.6rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
}

h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.hero-text {
    margin-bottom: 2rem;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-main);
}

label i {
    color: var(--primary-color);
    margin-right: 6px;
    width: 16px;
    text-align: center;
}

select,
input {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    background-color: #fff;
    transition: all 0.2s;
    appearance: none;
    /* Remove default arrow */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

input {
    background-image: none;
}

textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    display: block;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s;
    margin-top: 1rem;
    text-align: center;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
    box-shadow: 0 4px 15px rgba(252, 163, 17, 0.3);
}

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.98);
}

/* Results */
.result-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.main-result {
    background: #f0f7ff;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-top: 10px;
}

.main-result .label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.main-result .value {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.main-result .value small {
    font-size: 1rem;
    margin-left: 5px;
    font-weight: 400;
}

.message-box {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    font-size: 0.9rem;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin-bottom: 1rem;
}

/* Bridge specific */
.bridge-content {
    text-align: center;
    padding-top: 2rem;
}

.icon-large {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    opacity: 0.2;
}

.privacy-note {
    font-size: 0.75rem;
    margin-top: 1rem;
    color: #999;
}

/* Full Result specific */
.result-header.premium .badge {
    background: var(--primary-color);
    color: #fff;
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.warning-zone {
    background: linear-gradient(to right, #fff5f5, #ffe0e0);
    color: #d63031;
    padding: 15px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.warning-zone i {
    font-size: 1.5rem;
}

.warning-zone p {
    margin: 0;
    color: #d63031;
    font-weight: 500;
    font-size: 0.9rem;
    text-align: left;
}

/* Action Cards */
.action-buttons h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.card-btn {
    background: #fff;
    border: 1px solid #eee;
    padding: 16px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.card-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.card-btn .icon {
    width: 40px;
    height: 40px;
    background: #f0f7ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.card-btn .text {
    flex: 1;
}

.card-btn .text strong {
    display: block;
    color: var(--text-main);
    font-size: 0.95rem;
}

.card-btn .text small {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 2px;
}

.card-btn>i {
    color: #ccc;
}

/* =========================================
   New Styles for Updated UI (2026-01-27)
   ========================================= */

/* Chart Annotation */
.chart-wrapper {
    position: relative;
    height: 300px;
    width: 100%;
}

.chart-annotation {
    text-align: center;
    color: var(--text-muted);
    margin-top: -10px;
    margin-bottom: 20px;
}

/* Messages */
.sub-message {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #666;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
    padding-top: 8px;
}

.security-note {
    background: #f0fff4;
    color: #2e7d32;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Action Selection (A/B/C) */
.action-selection {
    margin-top: 30px;
}

.action-selection h3 {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.option-card {
    background: #fff;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.option-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
    transform: translateY(-2px);
}

.option-card:active {
    transform: scale(0.98);
}

.option-card .tag {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: #fff;
    flex-shrink: 0;
}

.tag-a {
    background: linear-gradient(135deg, #ff6b6b, #ee5253);
    box-shadow: 0 4px 10px rgba(238, 82, 83, 0.4);
}

.tag-b {
    background: linear-gradient(135deg, #48dbfb, #0abde3);
    box-shadow: 0 4px 10px rgba(10, 189, 227, 0.4);
}

.tag-c {
    background: linear-gradient(135deg, #1dd1a1, #10ac84);
    box-shadow: 0 4px 10px rgba(16, 172, 132, 0.4);
}

.option-card .content {
    flex: 1;
}

.option-card .content h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-main);
}

.option-card .content p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.option-card>i {
    color: #ddd;
}

/* Final Steps & Forms */
.confirm-header {
    text-align: center;
    margin-bottom: 24px;
}

.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

/* Checkbox Item Styling */
.checkbox-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 14px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-item:hover {
    border-color: #ddd;
}

.checkbox-item input {
    display: none;
}

.custom-check {
    width: 24px;
    height: 24px;
    border: 2px solid #ccc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    background: #fff;
    transition: all 0.2s;
    flex-shrink: 0;
}

.custom-check i {
    opacity: 0;
    color: var(--primary-color);
    /* Blue Icon */
    font-size: 14px;
    /* Hidden by default */
    transform: scale(0.5);
    /* Animation effect */
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.checkbox-item input:checked~.custom-check {
    background: #fff;
    border-color: var(--primary-color);
}

.checkbox-item input:checked~.custom-check i {
    opacity: 1;
    /* Show on check */
    transform: scale(1);
}

.checkbox-item input:checked+.custom-check+.text strong {
    color: var(--primary-color);
}

.checkbox-item .text strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
}

.checkbox-item .text small {
    font-size: 0.85rem;
    color: #888;
}

/* Radio Item Styling */
.radio-item {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.radio-item input {
    display: none;
}

.custom-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
}

.radio-item input:checked~.custom-radio {
    border-color: var(--secondary-color);
}

.radio-item input:checked~.custom-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--secondary-color);
    border-radius: 50%;
}

.label-text {
    font-weight: 600;
}

.radio-item input:checked~.label-text {
    color: var(--secondary-color);
}

.info-note {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-note p {
    font-size: 0.8rem;
    color: #666;
    margin: 0;
}

.btn-text {
    background: none;
    border: none;
    color: #999;
    text-decoration: underline;
    margin-top: 10px;
    display: block;
    width: 100%;
    cursor: pointer;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    border-radius: 12px;
    padding: 24px;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    text-align: center;
    color: var(--primary-color);
}

.modal-body {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #333;
}

.modal-body h4 {
    font-size: 1rem;
    margin-top: 20px;
    margin-bottom: 8px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}

/* Article Banners */
.articles-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.article-banner {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.article-image {
    width: 80px;
    height: 60px;
    background-color: #f0f0f0;
    border-radius: 4px;
    margin-right: 15px;
    flex-shrink: 0;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    flex: 1;
}

.article-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-main);
    line-height: 1.4;
}

.article-summary {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}/* Toggle Styles for Result Page */
.btn-toggle-details {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 10px 0;
}

.btn-toggle-details:hover {
    text-decoration: underline;
}

.details-content {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
