/* === CSS Variables === */
:root {
    --primary-color: #1e90ff;
    --primary-dark: #1873cc;
    --primary-light: #4da6ff;
    --accent-color: #00bfff;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --prediction-color: #d97706;
    --classification-color: #0891b2;
}

/* === Reset === */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* === Base === */
body {
    background: var(--background);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
}

/* === Loading Screen === */
.loading-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--background); display: flex;
    justify-content: center; align-items: center; z-index: 9999;
}
.loading-content { text-align: center; }
.loading-content i { color: var(--primary-color); margin-bottom: 1rem; }
.loading-content h2 { font-size: 1.5rem; margin-bottom: 0.5rem; color: var(--text-primary); }
.loading-content p { color: var(--text-secondary); margin-bottom: 2rem; }
.loading-spinner {
    width: 50px; height: 50px; border: 4px solid var(--border-color);
    border-top-color: var(--primary-color); border-radius: 50%;
    margin: 0 auto; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Main App === */
#main-app { max-width: 1280px; margin: 0 auto; padding: 2rem; }

/* === Hero Section === */
.hero-section {
    background: var(--primary-color); border-radius: 24px; padding: 5.75rem 2rem 3rem;
    text-align: center; color: white; margin-bottom: 2rem;
    box-shadow: var(--shadow-xl); position: relative; overflow: hidden;
}
.hero-section::before {
    content: ''; position: absolute; top: -50%; right: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite; pointer-events: none;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.3; }
}
.hero-title {
    font-size: 3.5rem; font-weight: 700; margin-bottom: 0.5rem;
    position: relative; z-index: 1; text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.hero-caption {
    font-size: 0.95rem; font-weight: 400; opacity: 0.85;
    margin-bottom: 1rem; position: relative; z-index: 1; letter-spacing: 0.5px;
}
.hero-subtitle {
    font-size: 1.25rem; font-weight: 300; opacity: 0.95;
    position: relative; z-index: 1;
}

/* === Navigation Section === */
.navigation-section {
    background: var(--surface); border-radius: 16px; padding: 2rem;
    margin-bottom: 2rem; box-shadow: var(--shadow-md);
}
.navigation-section h2 { font-size: 1.75rem; margin-bottom: 1.5rem; color: var(--text-primary); }
.navigation-subtitle {
    font-size: 0.95rem; color: var(--text-secondary);
    margin-bottom: 1.5rem; margin-top: -0.5rem;
}

/* === Feature Grid & Cards === */
.feature-grid { display: flex; flex-direction: column; gap: 1.5rem; }
.feature-card {
    background: var(--surface); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 1.5rem; transition: all 0.3s ease;
    cursor: pointer; position: relative; overflow: hidden;
}
.feature-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 100%; height: 4px; background: var(--primary-color);
    transform: translateX(-100%); transition: transform 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-4px); box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}
.feature-card:hover::before { transform: translateX(0); }
.feature-card:focus-visible,
button:focus-visible,
a:focus-visible,
.collapsible-header:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 3px;
}
.feature-card.disabled {
    opacity: 0.5; cursor: not-allowed; background: #f5f5f5; pointer-events: none;
}
.feature-card.disabled:hover { transform: none; box-shadow: none; border-color: var(--border-color); }
.feature-card.disabled::before { background: #9ca3af; }
.feature-card-requirement { font-size: 0.75rem; color: #ef4444; margin-top: 0.5rem; font-style: italic; }
.feature-card-title {
    font-size: 1.125rem; font-weight: 600; color: var(--text-primary);
    margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem;
}
.feature-card-icon { color: var(--primary-color); font-size: 1.25rem; }
.feature-card-description { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.5; }

/* === Category Sections === */
.category-section {
    background: var(--background); border-radius: 12px; padding: 1.25rem;
    border-left: 4px solid var(--primary-color); transition: box-shadow 0.3s ease;
}
.category-section:hover { box-shadow: var(--shadow-sm); }
.category-utility { border-left-color: #805ad5; }
.category-explore { border-left-color: #3182ce; }
.category-prediction { border-left-color: var(--prediction-color); }
.category-classification { border-left-color: var(--classification-color); }
.category-preprocessing { border-left-color: #38a169; }
.category-evaluation { border-left-color: #e53e3e; }
.category-multivariate { border-left-color: #0891b2; }
.category-guide { border-left-color: #4f46e5; }
.category-image { border-left-color: #059669; }
.category-audio { border-left-color: #7c3aed; }
.category-predict { border-left-color: #6366f1; }
.category-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.category-icon {
    width: 40px; height: 40px; border-radius: 10px; display: flex;
    align-items: center; justify-content: center; font-size: 1.1rem;
    color: white; flex-shrink: 0;
}
.category-utility .category-icon { background: #805ad5; }
.category-explore .category-icon,
.category-eda .category-icon { background: #3182ce; }
.category-prediction .category-icon { background: var(--prediction-color); }
.category-classification .category-icon { background: var(--classification-color); }
.category-preprocessing .category-icon { background: #38a169; }
.category-evaluation .category-icon { background: #e53e3e; }
.category-multivariate .category-icon { background: #0891b2; }
.category-guide .category-icon { background: #4f46e5; }
.category-image .category-icon { background: #059669; }
.category-audio .category-icon { background: #7c3aed; }
.category-predict .category-icon { background: #6366f1; }
.category-info h3 { font-size: 1.05rem; font-weight: 600; color: var(--text-primary); margin: 0; line-height: 1.3; }
.category-info p { font-size: 0.8rem; color: var(--text-secondary); margin: 0.15rem 0 0 0; line-height: 1.4; }
.category-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }

/* === Analysis Area === */
.analysis-area {
    background: var(--surface); border-radius: 16px; padding: 2rem;
    box-shadow: var(--shadow-md); margin-bottom: 2rem;
}
.analysis-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem; padding-bottom: 1rem; border-bottom: 2px solid var(--border-color);
}
.btn-back {
    background: var(--primary-color); color: white; border: none;
    padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 500;
    cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 0.5rem;
}
.btn-back:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* === Upload Section === */
.upload-section-main {
    background: var(--surface); border-radius: 16px; padding: 1.5rem;
    margin-bottom: 2rem; box-shadow: var(--shadow-md);
}
.upload-section { margin-bottom: 2rem; }
.upload-area {
    border: 3px dashed var(--border-color); border-radius: 16px;
    padding: 1.5rem 2rem; background: var(--background); transition: all 0.3s ease;
    cursor: pointer; position: relative; display: flex;
    align-items: center; justify-content: center; gap: 4rem;
}
.upload-area:hover { border-color: var(--primary-color); background: rgba(30,144,255,0.05); }
.upload-area.drag-over { border-color: var(--primary-color); background: rgba(30,144,255,0.1); transform: scale(1.02); }
.upload-info { display: flex; align-items: center; gap: 1.5rem; text-align: left; }
.upload-icon { font-size: 2.5rem; color: var(--primary-color); animation: float 3s ease-in-out infinite; margin-bottom: 0; }
.upload-area h3 { font-size: 1.25rem; margin-bottom: 0.25rem; color: var(--text-primary); }
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.upload-text { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 0; }
.upload-buttons { text-align: center; flex-shrink: 0; display: flex; align-items: center; gap: 1rem; }
.btn-upload {
    background: var(--primary-color); color: white; border: none;
    padding: 0.75rem 1.75rem; border-radius: 12px; font-weight: 600;
    font-size: 1rem; cursor: pointer; transition: all 0.3s ease;
    display: inline-flex; align-items: center; gap: 0.5rem;
    box-shadow: var(--shadow-md); margin-bottom: 0.5rem;
}
.btn-upload:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.upload-hint { margin: 0 1rem; font-size: 0.8rem; color: var(--text-secondary); display: inline-block; }
.btn-demo {
    background: transparent; color: var(--primary-color); border: 1px solid var(--primary-color);
    padding: 0.6rem 1.5rem; border-radius: 10px; font-weight: 500; font-size: 0.9rem;
}
.btn-demo:hover { background: rgba(30,144,255,0.1); color: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* === File Info & Status === */
.file-info { margin-top: 1.5rem; padding: 1.5rem; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.loading { text-align: center; color: var(--text-secondary); }
.loading i { font-size: 2rem; color: var(--primary-color); margin-bottom: 0.5rem; }
.success-message { text-align: center; color: #10b981; }
.success-message i { font-size: 3rem; margin-bottom: 0.5rem; }
.error-message { text-align: center; color: #ef4444; }
.error-message i { font-size: 3rem; margin-bottom: 0.5rem; }
.file-name { font-weight: 500; color: var(--text-primary); margin-top: 0.5rem; }
.btn-retry {
    margin-top: 1rem; background: var(--primary-color); color: white;
    border: none; padding: 0.75rem 1.5rem; border-radius: 8px;
    cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-retry:hover { background: var(--primary-dark); }

/* === Form Elements === */
input[type="file"], select, input[type="text"], input[type="number"], input[type="password"] {
    width: 100%; padding: 0.75rem; border: 1px solid var(--border-color);
    border-radius: 8px; font-family: inherit; font-size: 0.875rem; transition: all 0.3s ease;
}
input[type="file"]:focus, select:focus, input[type="text"]:focus, input[type="number"]:focus, input[type="password"]:focus {
    outline: none; border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30,144,255,0.1);
}
button {
    background: var(--primary-color); color: white; border: none;
    padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 500;
    cursor: pointer; transition: all 0.3s ease; font-family: inherit;
}
button:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
button:disabled { background: var(--border-color); cursor: not-allowed; transform: none; }

/* === Tables === */
table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
table th, table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--border-color); white-space: nowrap; }
table th { background: var(--background); font-weight: 600; color: var(--text-primary); }
table tr:hover { background: var(--background); }
.table-container { overflow-x: auto; margin: 1rem 0; max-height: 50vh; overflow-y: auto; }

/* === Collapsible Sections === */
.collapsible-section {
    background: var(--surface); border-radius: 12px; margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md); overflow: hidden;
}
.collapsible-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.5rem; background: var(--background); cursor: pointer;
    user-select: none; transition: background 0.2s ease;
}
.collapsible-header:hover { background: #e8f2ff; }
.collapsible-header h3 {
    margin: 0; font-size: 1.125rem; color: var(--text-primary);
    display: flex; align-items: center; gap: 0.5rem;
}
.collapsible-header i.toggle-icon { font-size: 1.25rem; color: var(--primary-color); transition: transform 0.3s ease; }
.collapsible-header.collapsed i.toggle-icon { transform: rotate(-90deg); }
.collapsible-content { padding: 1.5rem; max-height: 2000px; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.collapsible-content.collapsed { max-height: 0; padding: 0 1.5rem; }

/* === Data Overview === */
.data-overview { margin-top: 1.5rem; }
.data-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.data-stat-card { background: var(--background); padding: 1rem; border-radius: 8px; text-align: center; }
.data-stat-card .stat-label { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.data-stat-card .stat-value { font-size: 1.5rem; font-weight: 600; color: var(--primary-color); }

/* === Beginner guidance === */
.beginner-start {
    margin: 0 0 2rem; padding: 1.35rem 1.5rem;
    background: #ffffff; border: 1px solid var(--border-color); border-left: 4px solid #0f766e;
    border-radius: 8px; box-shadow: var(--shadow-sm);
}
.beginner-start-header {
    display: grid; gap: 0.2rem; margin-bottom: 1rem;
}
.beginner-start-kicker {
    margin: 0; color: #0f766e; font-size: 0.75rem; font-weight: 700;
}
.beginner-start h2 {
    margin: 0; color: var(--text-primary); font-size: 1.25rem;
}
.beginner-start-header > p:last-child {
    margin: 0.2rem 0 0; color: var(--text-secondary); font-size: 0.88rem;
}
.beginner-start-steps {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0; margin: 0; padding: 0; list-style: none;
}
.beginner-start-steps li {
    display: grid; grid-template-columns: 1.8rem minmax(0, 1fr); gap: 0.6rem;
    min-width: 0; padding: 0.7rem 1rem; border-left: 1px solid var(--border-color);
}
.beginner-start-steps li:first-child { padding-left: 0; border-left: 0; }
.beginner-start-step-number,
.beginner-guide-number {
    display: inline-flex; align-items: center; justify-content: center;
    width: 1.65rem; height: 1.65rem; flex: 0 0 1.65rem;
    border-radius: 50%; background: #0f766e; color: #ffffff;
    font-size: 0.75rem; font-weight: 700;
}
.beginner-start-steps strong {
    display: block; color: var(--text-primary); font-size: 0.84rem;
}
.beginner-start-steps p {
    margin: 0.2rem 0 0; color: var(--text-secondary); font-size: 0.78rem; line-height: 1.5;
}
.beginner-start-choice {
    margin: 0.8rem 0 0; padding-top: 0.8rem; border-top: 1px solid var(--border-color);
    color: #334155; font-size: 0.84rem;
}
.beginner-start-choice strong { color: #0f766e; }
.beginner-guide {
    margin: 1rem 0 1.25rem; padding: 1rem;
    background: #f8fafc; border: 1px solid var(--border-color); border-left: 4px solid #0f766e;
    border-radius: 8px; color: var(--text-primary);
}
.beginner-guide-heading {
    display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.8rem;
    color: #0f766e; font-size: 0.9rem;
}
.beginner-guide-steps {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
}
.beginner-guide-step {
    display: grid; grid-template-columns: 1.65rem minmax(0, 1fr); gap: 0.55rem;
    min-width: 0; padding: 0.2rem 0.9rem; border-left: 1px solid var(--border-color);
}
.beginner-guide-step:first-child { padding-left: 0; border-left: 0; }
.beginner-guide-step strong { display: block; font-size: 0.78rem; color: #334155; }
.beginner-guide-step p {
    margin: 0.15rem 0 0; color: var(--text-secondary); font-size: 0.78rem; line-height: 1.55;
    overflow-wrap: anywhere;
}
.beginner-guide-caution {
    display: grid; grid-template-columns: 1rem minmax(0, 1fr); gap: 0.45rem;
    margin: 0.85rem 0 0; padding-top: 0.75rem; border-top: 1px solid #fed7aa;
    color: #9a3412; font-size: 0.78rem; line-height: 1.5;
}
.beginner-guide-caution i { margin-top: 0.15rem; }
.beginner-guide-terms {
    margin-top: 0.8rem; padding-top: 0.7rem; border-top: 1px solid var(--border-color);
    color: var(--text-secondary); font-size: 0.78rem;
}
.beginner-guide-terms summary {
    width: fit-content; cursor: pointer; color: #0f766e; font-weight: 700;
}
.beginner-guide-terms dl { display: grid; gap: 0.45rem; margin: 0.65rem 0 0; }
.beginner-guide-terms dl > div {
    display: grid; grid-template-columns: minmax(5rem, auto) minmax(0, 1fr); gap: 0.7rem;
}
.beginner-guide-terms dt { color: var(--text-primary); font-weight: 700; }
.beginner-guide-terms dd { margin: 0; }
.beginner-next-status {
    margin: 0.9rem 0; padding: 0.7rem 0.85rem;
    color: #0f5132; background: #f0fdf4; border-left: 3px solid #16a34a;
    font-size: 0.84rem; line-height: 1.5;
}
.create-model-config-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}
.create-param-row {
    display: grid;
    grid-template-columns: minmax(100px, 1fr) minmax(100px, 120px);
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.create-param-row label { min-width: 0; font-size: 0.85rem; }
.create-param-row .form-select { width: 100%; min-width: 0; font-size: 0.85rem; }

/* === Plot Area === */
#plot-area { margin-top: 2rem; padding: 1rem; background: white; border-radius: 8px; box-shadow: var(--shadow-sm); }

/* === Info Sections === */
.info-sections { margin-bottom: 3rem; }
.info-sections .collapsible-header.collapsed { background: var(--background); }
.info-sections .collapsible-header h3 { font-size: 1.5rem; color: var(--text-primary); }
.info-sections .collapsible-content { line-height: 1.8; }
.info-sections h4 {
    font-size: 1.25rem; color: var(--text-primary); margin-top: 1.5rem;
    margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem;
}
.info-sections ul { list-style: none; padding: 0; margin: 0.5rem 0; }
.info-sections ul li { padding: 0.5rem 0; padding-left: 1.5rem; position: relative; }
.info-sections ul li::before { content: '\2713'; position: absolute; left: 0; color: var(--primary-color); font-weight: bold; }
.info-sections .note { background: #fff8e1; border-left: 4px solid #ffc107; padding: 1rem; margin: 1rem 0; border-radius: 4px; }

/* === Analysis Methods Grid === */
.analysis-methods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; margin-top: 1rem; }
.method-item {
    background: var(--background); border: 1px solid var(--border-color);
    border-radius: 8px; padding: 1rem; display: flex; align-items: center;
    gap: 0.75rem; transition: all 0.3s ease;
}
.method-item:hover { border-color: var(--primary-color); background: rgba(30,144,255,0.05); transform: translateX(4px); }
.method-item i { font-size: 1.5rem; color: var(--primary-color); }
.method-item span { font-weight: 500; color: var(--text-primary); }

/* === Usage Steps === */
.usage-step {
    display: flex; gap: 1rem; margin-bottom: 1.5rem; padding: 1rem;
    background: var(--background); border-radius: 8px; border-left: 4px solid var(--primary-color);
}
.step-number {
    flex-shrink: 0; width: 36px; height: 36px; background: var(--primary-color);
    color: white; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-weight: bold; font-size: 1.125rem;
}
.step-content h4 { margin: 0 0 0.5rem 0; font-size: 1.125rem; color: var(--text-primary); }
.step-content p { margin: 0; color: var(--text-secondary); line-height: 1.6; }

/* === Changelog === */
.changelog { margin-top: 1rem; }
.changelog-entry { border-left: 3px solid var(--primary-color); padding-left: 1.5rem; margin-bottom: 2rem; position: relative; }
.changelog-entry::before {
    content: ''; position: absolute; left: -7px; top: 8px;
    width: 11px; height: 11px; background: var(--primary-color);
    border-radius: 50%; border: 2px solid white;
}
.changelog-header { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 0.75rem; }
.changelog-version { font-size: 1.25rem; font-weight: 600; color: var(--primary-color); }
.changelog-date { font-size: 0.875rem; color: var(--text-secondary); }
.changelog-entry h4 { font-size: 1rem; color: var(--text-primary); margin-top: 1rem; margin-bottom: 0.5rem; }
.changelog-entry ul { list-style-type: disc; padding-left: 1.5rem; margin: 0.5rem 0; }
.changelog-entry ul li { padding: 0.25rem 0; color: var(--text-secondary); }
.changelog-entry ul li::before { display: none; }

/* === GitHub Info === */
.github-info { background: var(--background); border-radius: 8px; padding: 1rem; margin-top: 1.5rem; display: flex; align-items: center; gap: 0.75rem; }
.github-info i { font-size: 1.5rem; color: #333; }
.github-info a { color: var(--primary-color); text-decoration: none; font-weight: 500; }
.github-info a:hover { text-decoration: underline; }

/* === Footer === */
.footer {
    background: var(--surface); border-radius: 16px; padding: 2rem;
    margin-top: 3rem; text-align: center; box-shadow: var(--shadow-md);
}
.footer-content p { color: var(--text-secondary); margin-bottom: 0.5rem; }
.footer-links { margin-top: 1rem; display: flex; justify-content: center; gap: 2rem; }
.footer-links a { color: var(--primary-color); text-decoration: none; font-weight: 500; transition: all 0.3s ease; }
.footer-links a:hover { color: var(--primary-dark); }

/* === Utility Classes === */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }

/* === MultiSelect Component === */
.multiselect-wrapper { position: relative; width: 100%; }
.multiselect-input {
    min-height: 45px; border: 2px solid #cbd5e0; border-radius: 8px;
    padding: 0.5rem 0.75rem; display: flex; flex-wrap: wrap;
    align-items: center; gap: 6px; cursor: pointer; background: white; transition: all 0.3s ease;
}
.multiselect-wrapper.active .multiselect-input { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(30,144,255,0.1); }
.multiselect-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.multiselect-tag {
    background: #e0f2fe; color: var(--primary-dark); border: 1px solid #bae6fd;
    border-radius: 4px; padding: 2px 8px; font-size: 0.9rem;
    display: flex; align-items: center; gap: 6px;
}
.multiselect-tag i { cursor: pointer; font-size: 0.8rem; opacity: 0.6; transition: opacity 0.2s; }
.multiselect-tag i:hover { opacity: 1; color: #ef4444; }
.multiselect-search {
    border: none !important; outline: none !important; padding: 4px !important;
    font-size: 0.95rem; color: var(--text-primary); flex-grow: 1;
    min-width: 60px; background: transparent; cursor: pointer;
}
.multiselect-chevron { margin-left: auto; color: var(--text-secondary); font-size: 0.8rem; padding: 0 8px; }
.multiselect-dropdown {
    position: absolute; top: 100%; left: 0; width: 100%; max-height: 200px;
    overflow-y: auto; background: white; border: 1px solid var(--border-color);
    border-radius: 8px; margin-top: 4px; box-shadow: var(--shadow-lg); z-index: 1000;
}
.multiselect-options { list-style: none; padding: 0; margin: 0; }
.multiselect-options li { padding: 8px 12px; cursor: pointer; transition: background 0.2s; font-size: 0.95rem; }
.multiselect-options li:hover { background: #f1f5f9; }
.multiselect-options .no-options { color: var(--text-secondary); cursor: default; padding: 12px; text-align: center; font-size: 0.9rem; }

/* === Analysis Button === */
.btn-analysis {
    margin-top: 1.5rem; width: 100%; padding: 1rem; font-size: 1.1rem;
    font-weight: bold; color: white; border: none; border-radius: 8px;
    cursor: pointer; display: flex; justify-content: center; align-items: center;
    gap: 0.5rem; transition: filter 0.2s; box-shadow: var(--shadow-md);
}
.btn-analysis:hover { filter: brightness(90%); }
.btn-analysis:disabled,
.btn-analysis[disabled] {
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    box-shadow: none;
    cursor: not-allowed;
    filter: none;
}
.btn-analysis:disabled:hover,
.btn-analysis[disabled]:hover { filter: none; }
.btn-analysis:disabled .va-badge-count,
.btn-analysis[disabled] .va-badge-count {
    background: #cbd5e1 !important;
    color: #64748b !important;
}

/* === Tabs === */
.tab-container {
    display: flex; gap: 0.5rem; max-width: 100%; overflow-x: auto;
    margin-bottom: 2rem; border-bottom: 2px solid var(--border-color);
}
.tab-btn {
    flex: 0 0 auto;
    padding: 0.75rem 1.5rem; background: transparent; border: none;
    border-bottom: 3px solid transparent; font-weight: 600;
    color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
}
.tab-btn:hover { color: var(--primary-color); background: rgba(30,144,255,0.05); }
.tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Modal === */
.modal {
    display: none; position: fixed; z-index: 10000; left: 0; top: 0;
    width: 100%; height: 100%; overflow: auto;
    background-color: rgba(0,0,0,0.5); backdrop-filter: blur(4px); animation: fadeIn 0.3s ease;
}
.modal-content.demo-modal-content {
    background-color: #fefefe; margin: 3% auto; padding: 2rem;
    border: 1px solid #888; width: 95%; max-width: 800px; border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); position: relative; animation: slideUp 0.3s ease;
    max-height: 90vh; overflow-y: auto;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1rem; border-bottom: 2px solid #f1f5f9; padding-bottom: 1rem;
}
.modal-header h3 {
    margin: 0; color: var(--text-primary); font-size: 1.5rem;
    display: flex; align-items: center; gap: 0.75rem;
}
.close-modal { color: #64748b; font-size: 2rem; font-weight: bold; cursor: pointer; line-height: 1; transition: color 0.2s; border: 0; background: transparent; padding: 0.25rem; }
.close-modal:hover, .close-modal:focus { color: var(--text-primary); text-decoration: none; }

.skip-link {
    position: fixed;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10000;
    transform: translateY(-150%);
    background: #ffffff;
    color: #111827;
    padding: 0.65rem 0.9rem;
    border: 2px solid #111827;
}
.skip-link:focus { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* === Gemini AI Assistant === */
.hero-action-left {
    position: absolute; top: 1.5rem; left: 1.5rem; z-index: 10;
}
.hero-action-right {
    position: absolute; top: 1.5rem; right: 1.5rem; z-index: 10;
    display: flex; align-items: center; justify-content: flex-end; gap: 0.65rem;
}
.ai-settings-button {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2); color: white;
    border: 1px solid rgba(255, 255, 255, 0.4); padding: 0.5rem 1rem;
}
.ai-settings-button:hover {
    background: rgba(255, 255, 255, 0.28); color: white;
}
.manual-link-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    margin: 0; padding: 0.5rem 1rem; text-decoration: none;
    background: rgba(255, 255, 255, 0.2); color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
}
.manual-link-button:hover {
    background: rgba(255, 255, 255, 0.28); color: white;
}
.language-switch {
    display: inline-flex; align-items: center; gap: 0.2rem;
    min-height: 36px; padding: 0.2rem 0.25rem 0.2rem 0.55rem;
    border: 1px solid var(--border-color); border-radius: 8px;
    background: var(--surface); color: var(--text-secondary);
}
.language-switch > i {
    margin-right: 0.15rem; font-size: 0.85rem;
}
.language-option {
    min-width: 42px; min-height: 28px; margin: 0; padding: 0.25rem 0.55rem;
    border: 0; border-radius: 5px; background: transparent; color: inherit;
    font: inherit; font-size: 0.78rem; font-weight: 700; line-height: 1;
    cursor: pointer;
}
.language-option:hover {
    background: rgba(30, 144, 255, 0.1);
}
.language-option.active {
    background: var(--primary-color); color: white;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}
.language-option:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.45); outline-offset: 2px;
}
.language-switch-on-dark {
    background: rgba(255, 255, 255, 0.16); color: white;
    border-color: rgba(255, 255, 255, 0.4);
}
.language-switch-on-dark .language-option:hover {
    background: rgba(255, 255, 255, 0.2);
}
.language-switch-on-dark .language-option.active {
    background: white; color: #1d4ed8;
}
.ai-status-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 3.25rem; padding: 0.1rem 0.45rem; border-radius: 9999px;
    background: rgba(255, 255, 255, 0.18); color: white;
    font-size: 0.75rem; font-weight: 700;
}
.ai-status-badge.active {
    background: #dcfce7; color: #166534;
}
.ai-settings-modal {
    align-items: center; justify-content: center; padding: 1rem; overflow: hidden;
}
.ai-settings-modal-content {
    width: min(660px, 100%); max-width: 660px;
    max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem);
    margin: 0; background: var(--surface); border: 1px solid #cbd5e1;
    border-radius: 8px; box-shadow: 0 24px 56px rgba(15, 23, 42, 0.28);
    display: flex; flex-direction: column; overflow: hidden;
    animation: slideUp 0.2s ease;
}
.ai-settings-modal-header {
    flex: 0 0 auto; gap: 1rem; margin: 0; padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color); background: #f8fafc;
}
.ai-settings-heading {
    display: flex; align-items: center; gap: 0.75rem; min-width: 0;
}
.ai-settings-heading-icon {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #075985; background: #e0f2fe; border: 1px solid #bae6fd;
}
.ai-settings-kicker {
    display: block; margin-bottom: 0.1rem; color: #475569;
    font-size: 0.72rem; font-weight: 700; line-height: 1.2;
}
.ai-settings-modal-header h3 {
    min-width: 0; margin: 0; color: var(--text-primary);
    font-size: 1.15rem; line-height: 1.35; overflow-wrap: anywhere;
}
.ai-settings-modal .close-modal {
    width: 40px; height: 40px; min-width: 40px; min-height: 40px;
    margin: 0; padding: 0; border-radius: 6px; font-size: 1rem;
    display: inline-flex; align-items: center; justify-content: center;
    color: #475569; background: transparent;
}
.ai-settings-modal .close-modal:hover,
.ai-settings-modal .close-modal:focus {
    color: #0f172a; background: #e2e8f0; transform: none; box-shadow: none;
}
.ai-settings-scroll {
    min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    padding: 1.25rem;
}
.ai-settings-description {
    margin: 0; color: var(--text-secondary); line-height: 1.6;
}
.ai-settings-lead {
    margin: 0 0 0.9rem; color: #334155; font-size: 0.92rem;
}
.ai-settings-role-note {
    display: grid; grid-template-columns: minmax(7.5rem, auto) minmax(0, 1fr);
    gap: 0.35rem 0.75rem; margin: 0 0 0.9rem; padding: 0.75rem 0;
    border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
    color: #475569; font-size: 0.8rem; line-height: 1.5;
}
.ai-settings-role-note strong { color: #0f766e; }
.ai-settings-routes {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0 0 0.9rem;
    border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden;
}
.ai-settings-routes > div {
    display: grid; grid-template-columns: 1.2rem minmax(0, 1fr); gap: 0.55rem;
    align-items: start; padding: 0.75rem; background: #ffffff;
}
.ai-settings-routes > div + div { border-left: 1px solid var(--border-color); }
.ai-settings-routes i { margin-top: 0.18rem; color: #0369a1; text-align: center; }
.ai-settings-routes p { display: grid; gap: 0.1rem; margin: 0; }
.ai-settings-routes strong { color: var(--text-primary); font-size: 0.8rem; }
.ai-settings-routes span { color: var(--text-secondary); font-size: 0.76rem; line-height: 1.45; }
.ai-settings-summary {
    list-style: none; display: grid; gap: 0.55rem; margin: 0; padding: 0;
}
.ai-settings-summary li {
    display: grid; grid-template-columns: 1.25rem minmax(0, 1fr);
    align-items: start; gap: 0.55rem; color: #475569; font-size: 0.82rem;
}
.ai-settings-summary li i {
    margin-top: 0.22rem; color: #0f766e; text-align: center;
}
.ai-settings-summary li:nth-child(2) i { color: #0369a1; }
.ai-settings-summary li:nth-child(3) i { color: #475569; }
.ai-settings-warning {
    display: grid; grid-template-columns: 1.25rem minmax(0, 1fr);
    align-items: start; gap: 0.55rem; margin: 1rem 0 0; padding: 0.75rem 0.85rem;
    color: #92400e; background: #fffbeb; border-left: 3px solid #d97706;
    font-size: 0.8rem; line-height: 1.5;
}
.ai-settings-warning i { margin-top: 0.2rem; text-align: center; }
.ai-settings-form {
    display: grid; gap: 1rem; margin-top: 1.25rem;
}
.ai-settings-section {
    min-width: 0; margin: 0; padding: 1rem 0 0; border: 0;
    border-top: 1px solid var(--border-color);
}
.ai-settings-section-heading {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; margin-bottom: 0.75rem;
}
.ai-settings-section h4,
.ai-settings-preview-section legend {
    margin: 0; padding: 0; color: var(--text-primary);
    font-size: 0.9rem; font-weight: 700; line-height: 1.4;
}
.ai-settings-required {
    color: #b91c1c; font-size: 0.72rem; font-weight: 700;
}
.ai-settings-field-grid {
    display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(190px, 0.8fr);
    align-items: start; gap: 1rem;
}
.ai-settings-field {
    display: grid; min-width: 0; gap: 0.4rem;
}
.ai-settings-form label {
    color: var(--text-primary); font-size: 0.85rem; font-weight: 600;
}
.ai-settings-form input[type="text"],
.ai-settings-form input[type="password"] {
    min-width: 0; background: #ffffff;
}
.input-hint {
    margin: 0; color: var(--text-secondary); font-size: 0.76rem;
    line-height: 1.5; overflow-wrap: anywhere;
}
.input-hint a {
    color: #0369a1; font-weight: 600; text-underline-offset: 2px;
}
.ai-settings-preview-section legend { margin-bottom: 0.7rem; }
.ai-preview-option {
    display: grid; grid-template-columns: 1.1rem minmax(0, 1fr);
    align-items: start; gap: 0.65rem; cursor: pointer;
}
.ai-preview-option input {
    width: 1.1rem; height: 1.1rem; margin: 0.16rem 0 0;
    accent-color: var(--primary-color);
}
.ai-preview-copy {
    display: grid; min-width: 0; gap: 0.15rem;
}
.ai-preview-copy strong {
    color: var(--text-primary); font-size: 0.85rem;
}
.ai-preview-copy > span {
    color: var(--text-secondary); font-size: 0.76rem; font-weight: 400;
    line-height: 1.5;
}
.ai-settings-status {
    display: grid; grid-template-columns: 0.55rem minmax(0, 1fr);
    align-items: start; gap: 0.6rem; min-height: 0; padding: 0.75rem 0.85rem;
    border: 1px solid var(--border-color); border-radius: 6px;
    background: #f8fafc; color: #475569; font-size: 0.8rem; line-height: 1.5;
}
.ai-settings-after-save {
    margin: 0; color: #475569; font-size: 0.78rem; line-height: 1.5;
}
.ai-settings-status::before {
    content: ''; width: 0.5rem; height: 0.5rem; margin-top: 0.34rem;
    border-radius: 50%; background: #64748b;
}
.ai-settings-status.active {
    background: #f0fdf4; color: #166534; border-color: #bbf7d0;
}
.ai-settings-status.active::before { background: #16a34a; }
.ai-settings-actions {
    display: flex; justify-content: flex-end; gap: 0.75rem;
    flex-wrap: wrap; margin: 0;
}
.ai-settings-actions .btn-analysis,
.ai-settings-actions .btn-demo {
    min-width: 132px; margin: 0;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.ai-assist-floating {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 2000;
    width: min(420px, calc(100vw - 2rem)); max-height: calc(100vh - 2.5rem);
    background: var(--surface); border: 1px solid rgba(30, 144, 255, 0.22);
    border-radius: 12px; box-shadow: var(--shadow-xl); overflow: hidden;
}
@media (min-width: 1280px) {
    body:has(.ai-assist-floating) {
        padding-right: 460px;
    }
}
.ai-assist-header {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    padding: 1rem; color: white; background: #1e90ff;
}
.ai-assist-title {
    display: flex; align-items: center; gap: 0.5rem; font-weight: 700;
}
.ai-assist-subtitle {
    margin-top: 0.2rem; font-size: 0.8rem; opacity: 0.9;
}
.ai-assist-icon-actions {
    display: inline-flex; gap: 0.35rem;
}
.ai-assist-icon-button {
    width: 32px; height: 32px; padding: 0; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, 0.18); color: white;
}
.ai-assist-icon-button:hover {
    background: rgba(255, 255, 255, 0.28);
}
.ai-assist-body {
    padding: 1rem; max-height: calc(100vh - 8rem); overflow: auto;
}
.ai-assist-floating .beginner-guide { margin: 0 0 0.85rem; padding: 0.8rem; }
.ai-assist-floating .beginner-guide-steps { grid-template-columns: 1fr; gap: 0.55rem; }
.ai-assist-floating .beginner-guide-step,
.ai-assist-floating .beginner-guide-step:first-child {
    padding: 0.55rem 0 0; border-left: 0; border-top: 1px solid var(--border-color);
}
.ai-assist-floating .beginner-guide-step:first-child { padding-top: 0; border-top: 0; }
.ai-assist-context {
    display: grid; gap: 0.25rem; padding: 0.75rem; border-radius: 8px;
    background: #f8fafc; border: 1px solid var(--border-color);
    color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 0.85rem;
}
.ai-assist-context strong {
    color: var(--text-primary);
}
.ai-assist-privacy-note {
    display: grid; grid-template-columns: 1rem 1fr; gap: 0.45rem;
    margin-bottom: 0.85rem; padding: 0.65rem 0.75rem; border-radius: 8px;
    background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
    font-size: 0.8rem; line-height: 1.5;
}
.ai-assist-privacy-note i { margin-top: 0.1rem; color: #d97706; }
.ai-assist-storage-note,
.ai-assist-privacy-warning {
    display: grid; grid-template-columns: 1rem minmax(0, 1fr); gap: 0.45rem;
    margin-bottom: 0.85rem; padding: 0.65rem 0.75rem; border-radius: 8px;
    font-size: 0.8rem; line-height: 1.5;
}
.ai-assist-storage-note {
    background: #ecfdf5; border: 1px solid #a7f3d0; color: #166534;
}
.ai-assist-storage-note i { margin-top: 0.1rem; color: #059669; }
.ai-assist-safety-details {
    margin-bottom: 0.85rem; border: 1px solid var(--border-color); border-radius: 8px;
    background: #f8fafc; color: var(--text-secondary); font-size: 0.78rem; line-height: 1.5;
}
.ai-assist-safety-details summary {
    padding: 0.65rem 0.75rem; cursor: pointer; color: var(--text-primary); font-weight: 700;
}
.ai-assist-safety-details .ai-assist-storage-note {
    margin: 0 0.75rem 0.65rem; border-radius: 6px;
}
.ai-assist-safety-details > p { margin: 0; padding: 0 0.75rem 0.75rem; }
.ai-assist-privacy-warning {
    background: #fff7ed; border: 1px solid #fdba74; color: #9a3412;
}
.ai-assist-privacy-warning i { margin-top: 0.1rem; color: #ea580c; }
.ai-assist-payload-preview {
    margin-bottom: 0.75rem; border: 1px solid var(--border-color); border-radius: 8px;
    background: #f8fafc; color: var(--text-secondary); font-size: 0.8rem;
}
.ai-assist-payload-preview summary {
    padding: 0.65rem 0.75rem; cursor: pointer; font-weight: 700; color: var(--text-primary);
}
.ai-assist-payload-preview pre {
    max-height: 12rem; margin: 0; padding: 0.75rem; overflow: auto;
    border-top: 1px solid var(--border-color); white-space: pre-wrap; overflow-wrap: anywhere;
    font-size: 0.72rem; line-height: 1.45;
}
.ai-assist-send-confirmation {
    display: grid; grid-template-columns: auto 1fr; gap: 0.5rem; align-items: start;
    margin-bottom: 0.85rem; color: var(--text-secondary); font-size: 0.8rem; line-height: 1.45;
}
.ai-assist-send-confirmation input { margin-top: 0.15rem; }
.ai-assist-actions {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem;
}
.ai-assist-action-option {
    display: grid; align-content: end; gap: 0.3rem; min-width: 0;
}
.ai-assist-action-option > span {
    color: var(--text-secondary); font-size: 0.7rem; font-weight: 700; text-align: center;
}
.ai-assist-copy,
.ai-assist-generate {
    width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    border-radius: 8px; padding: 0.75rem 1rem; font-weight: 700;
    border: 1px solid transparent;
}
.ai-assist-copy {
    background: #f8fafc; color: #1e3a8a; border-color: #bfdbfe;
}
.ai-assist-copy:hover { background: #eff6ff; }
.ai-assist-generate:disabled {
    opacity: 0.65; cursor: not-allowed;
}
.ai-assist-copy:disabled {
    opacity: 0.65; cursor: not-allowed;
}
.ai-assist-generate.is-loading:disabled {
    cursor: wait;
}
.ai-assist-output {
    margin-top: 0.85rem; padding: 0.9rem; border-radius: 8px; min-height: 8rem;
    background: #0f172a; color: #e2e8f0; font-size: 0.9rem; line-height: 1.7;
    white-space: pre-wrap; overflow-wrap: anywhere;
}
.ai-assist-chat-area {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.5rem;
    margin-top: 0.85rem;
}
.ai-assist-chat-input {
    width: 100%; min-width: 0; resize: vertical; max-height: 8rem;
    border: 1px solid var(--border-color); border-radius: 8px;
    padding: 0.7rem 0.75rem; font: inherit; line-height: 1.5;
}
.ai-assist-chat-send {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
    border-radius: 8px; padding: 0.7rem 0.85rem; font-weight: 700;
    background: #1e90ff; color: white; border: 1px solid #1e90ff;
}
.ai-assist-chat-send:disabled,
.ai-assist-chat-input:disabled {
    opacity: 0.65; cursor: not-allowed;
}
.demo-options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.demo-option-btn {
    display: flex; align-items: center; text-align: left; background: white;
    border: 1px solid var(--border-color); border-radius: 12px; padding: 1rem;
    cursor: pointer; transition: all 0.2s ease; width: 100%; color: var(--text-primary);
}
.demo-option-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); border-color: var(--primary-color); background: #f8fafc; }
.demo-option-btn .icon {
    width: 48px; height: 48px; border-radius: 10px; background: #e0f2fe;
    color: var(--primary-color); display: flex; align-items: center;
    justify-content: center; font-size: 1.5rem; margin-right: 1rem; flex-shrink: 0;
}
.demo-option-btn .info { display: flex; flex-direction: column; }
.demo-option-btn .info strong { font-size: 1.1rem; margin-bottom: 0.25rem; color: var(--text-primary); }
.demo-option-btn .info span { font-size: 0.85rem; color: #64748b; }
.demo-option-btn.primary { border: 2px solid var(--primary-color); background: #f0f9ff; }
.demo-option-btn.primary:hover { background: #e0f2fe; }

/* === Radio-style Labels === */
.ttest-radio-label {
    flex: 1; min-width: 200px; padding: 1rem; border-radius: 8px;
    cursor: pointer; transition: background 0.2s, border-color 0.2s;
    border: 2px solid var(--border-color); background: #fafbfc;
}
.ttest-radio-label:hover { border-color: var(--primary-light); }
.ttest-radio-label.selected { background: #f0f8ff; border-color: var(--primary-color); }

/* =====================================================
   ML-Specific Styles
   ===================================================== */

/* === Step Indicator (Workflow: Setup > Compare > Create > Evaluate) === */
.step-indicator {
    display: flex; align-items: center; gap: 0;
    margin-bottom: 2rem; padding: 1.5rem 1rem;
    background: var(--background); border-radius: 12px; overflow-x: auto;
    min-width: 0;
}
/* Center steps via auto margins on inner wrapper; flex-start prevents left cutoff on overflow */
.step-indicator::before, .step-indicator::after {
    content: ''; flex: 1;
}
.step-indicator .step {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 1.25rem; border-radius: 8px; font-size: 0.875rem;
    font-weight: 500; color: var(--text-secondary); background: transparent;
    border: 2px solid var(--border-color); transition: all 0.3s ease;
    white-space: nowrap; cursor: default;
}
.step-indicator .step i { font-size: 1rem; }
.step-indicator .step-connector {
    width: 32px; height: 2px; background: var(--border-color);
    flex-shrink: 0; transition: background 0.3s ease;
}
.step-indicator .step.active {
    color: var(--primary-color); border-color: var(--primary-color);
    background: rgba(30,144,255,0.08); font-weight: 600; box-shadow: var(--shadow-sm);
}
.step-indicator .step.active i { color: var(--primary-color); }
.step-indicator .step.completed {
    color: #10b981; border-color: #10b981; background: rgba(16,185,129,0.08);
}
.step-indicator .step.completed i { color: #10b981; }
.step-indicator .step.completed + .step-connector { background: #10b981; }

/* === Model Comparison Table === */
.model-comparison-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.875rem; }
.model-comparison-table th {
    background: var(--primary-color); color: white; padding: 0.75rem 1rem;
    text-align: left; font-weight: 600; white-space: nowrap;
    position: sticky; top: 0; z-index: 1;
}
.model-comparison-table th:first-child { border-radius: 8px 0 0 0; }
.model-comparison-table th:last-child { border-radius: 0 8px 0 0; }
.model-comparison-table td {
    padding: 0.7rem 1rem; border-bottom: 1px solid var(--border-color);
    white-space: nowrap; color: var(--text-primary);
}
.model-comparison-table tbody tr { transition: background 0.2s ease; }
.model-comparison-table tbody tr:hover { background: rgba(30,144,255,0.04); }
.model-comparison-table tbody tr:last-child td:first-child { border-radius: 0 0 0 8px; }
.model-comparison-table tbody tr:last-child td:last-child { border-radius: 0 0 8px 0; }

/* Highlight Row - best model */
.model-comparison-table .highlight-row,
.highlight-row { background: rgba(16,185,129,0.08); font-weight: 600; }
.model-comparison-table .highlight-row td { border-bottom-color: #10b981; }
.model-comparison-table .highlight-row td:first-child { position: relative; padding-left: 1.5rem; }
.model-comparison-table .highlight-row td:first-child::before {
    content: '\2605'; position: absolute; left: 0.4rem; top: 50%;
    transform: translateY(-50%); color: #f59e0b; font-size: 0.8rem;
}

/* === Metric Cards & Grid === */
.metrics-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem; margin: 1.5rem 0;
}
.metric-card {
    background: var(--surface); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 1.25rem; text-align: center;
    transition: all 0.3s ease; position: relative; overflow: hidden;
}
.metric-card::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 100%; height: 3px; background: var(--primary-color);
    transform: scaleX(0); transition: transform 0.3s ease;
}
.metric-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.metric-card:hover::after { transform: scaleX(1); }
.metric-card .metric-label {
    font-size: 0.8rem; font-weight: 500; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.5rem;
}
.metric-card .metric-value { font-size: 1.75rem; font-weight: 700; color: var(--primary-color); line-height: 1.2; }
.metric-card .metric-detail { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.25rem; }
.metric-card.good { border-color: #10b981; }
.metric-card.good .metric-value { color: #10b981; }
.metric-card.good::after { background: #10b981; }
.metric-card.warning { border-color: #f59e0b; }
.metric-card.warning .metric-value { color: #f59e0b; }
.metric-card.warning::after { background: #f59e0b; }
.metric-card.bad { border-color: #ef4444; }
.metric-card.bad .metric-value { color: #ef4444; }
.metric-card.bad::after { background: #ef4444; }

/* === Analysis Quality Panel === */
.analysis-quality-panel {
    background: var(--surface); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 1.25rem; margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}
.analysis-quality-panel.analysis-quality-danger { border-color: #fecaca; background: #fff7f7; }
.analysis-quality-panel.analysis-quality-warning { border-color: #fde68a; background: #fffbeb; }
.analysis-quality-panel.analysis-quality-good { border-color: #bbf7d0; background: #f7fef9; }
.analysis-quality-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 1rem; margin-bottom: 1rem;
}
.analysis-quality-header h4 {
    display: flex; align-items: center; gap: 0.5rem;
    margin: 0 0 0.35rem 0; color: var(--text-primary);
}
.analysis-quality-header p {
    margin: 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6;
}
.analysis-quality-badges {
    display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.4rem;
}
.analysis-quality-count {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.25rem 0.55rem; border-radius: 999px;
    font-size: 0.78rem; font-weight: 700; white-space: nowrap;
}
.analysis-quality-count-danger { color: #991b1b; background: #fee2e2; }
.analysis-quality-count-warning { color: #92400e; background: #fef3c7; }
.analysis-quality-count-info { color: #1e40af; background: #dbeafe; }
.analysis-quality-count-good { color: #166534; background: #dcfce7; }
.analysis-quality-items {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.75rem;
}
.analysis-quality-item {
    display: grid; grid-template-columns: 1.25rem 1fr; gap: 0.65rem;
    padding: 0.85rem; border-radius: 10px; background: rgba(255,255,255,0.72);
    border: 1px solid rgba(148,163,184,0.22);
}
.analysis-quality-item i { margin-top: 0.15rem; }
.analysis-quality-item strong { display: block; margin-bottom: 0.25rem; color: var(--text-primary); }
.analysis-quality-item p {
    margin: 0; color: var(--text-secondary); font-size: 0.86rem; line-height: 1.55;
}
.analysis-quality-item-danger { border-color: #fecaca; }
.analysis-quality-item-danger i { color: #dc2626; }
.analysis-quality-item-warning { border-color: #fde68a; }
.analysis-quality-item-warning i { color: #d97706; }
.analysis-quality-item-info { border-color: #bfdbfe; }
.analysis-quality-item-info i { color: #2563eb; }
.analysis-quality-item-good { border-color: #bbf7d0; }
.analysis-quality-item-good i { color: #16a34a; }
.analysis-quality-more {
    padding: 0.85rem; color: var(--text-secondary); font-size: 0.85rem;
}

/* === Progress Bar === */
.progress-bar {
    width: 100%; height: 12px; background: var(--border-color);
    border-radius: 6px; overflow: hidden; margin: 1rem 0; position: relative;
}
.progress-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 6px; transition: width 0.6s ease; position: relative;
}
.progress-fill::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShine 2s ease-in-out infinite;
}
@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.progress-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-size: 0.875rem; }
.progress-label .progress-text { color: var(--text-secondary); font-weight: 500; }
.progress-label .progress-percent { color: var(--primary-color); font-weight: 700; }

/* === Model Configuration === */
.model-config {
    background: var(--background); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 1.5rem; margin: 1.5rem 0;
}
.model-config h4 {
    font-size: 1.05rem; font-weight: 600; color: var(--text-primary);
    margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem;
}
.model-config .config-group { margin-bottom: 1rem; }
.model-config .config-group:last-child { margin-bottom: 0; }
.model-config .config-group label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.35rem; }
.model-config .config-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* === Prediction Results === */
.prediction-results {
    background: var(--surface); border: 2px solid var(--border-color);
    border-radius: 12px; padding: 1.5rem; margin: 1.5rem 0; position: relative;
}
.prediction-results::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--prediction-color), var(--classification-color));
    border-radius: 12px 12px 0 0;
}
.prediction-results h4 {
    font-size: 1.1rem; font-weight: 600; color: var(--text-primary);
    margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem;
}
.prediction-results .result-value {
    font-size: 2rem; font-weight: 700; color: var(--primary-color);
    text-align: center; padding: 1rem; background: var(--background);
    border-radius: 8px; margin: 0.5rem 0;
}
.prediction-results .result-detail { font-size: 0.875rem; color: var(--text-secondary); margin-top: 0.5rem; }

/* === Confusion Matrix === */
.confusion-matrix { margin: 1.5rem auto; max-width: 500px; }
.confusion-matrix table { border-collapse: separate; border-spacing: 4px; margin: 0 auto; }
.confusion-matrix th { background: transparent; color: var(--text-secondary); font-size: 0.8rem; font-weight: 600; text-align: center; padding: 0.5rem 0.75rem; }
.confusion-matrix td {
    text-align: center; padding: 1rem; border-radius: 8px; font-weight: 700;
    font-size: 1.25rem; border: none; min-width: 80px; transition: transform 0.2s ease;
}
.confusion-matrix td:hover { transform: scale(1.05); }
.confusion-matrix .cm-tp, .confusion-matrix .cm-tn { background: rgba(16,185,129,0.15); color: #059669; }
.confusion-matrix .cm-fp, .confusion-matrix .cm-fn { background: rgba(239,68,68,0.1); color: #dc2626; }
.confusion-matrix .cm-label {
    font-weight: 600; font-size: 0.85rem; color: var(--text-primary);
    writing-mode: vertical-rl; text-orientation: mixed; transform: rotate(180deg);
}
.confusion-matrix .cm-header-label { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }

/* === Feature Importance Bar === */
.feature-importance-bar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; padding: 0.5rem 0; }
.feature-importance-bar .feature-name {
    min-width: 120px; max-width: 180px; font-size: 0.85rem; font-weight: 500;
    color: var(--text-primary); text-align: right; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.feature-importance-bar .bar-container {
    flex: 1; height: 24px; background: var(--border-color);
    border-radius: 4px; overflow: hidden; position: relative;
}
.feature-importance-bar .bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px; transition: width 0.8s ease; min-width: 2px;
}
.feature-importance-bar .bar-value { min-width: 50px; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-align: left; }
.feature-importance-bar.top-1 .bar-fill { background: linear-gradient(90deg, #1e90ff, #4da6ff); }
.feature-importance-bar.top-2 .bar-fill { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.feature-importance-bar.top-3 .bar-fill { background: linear-gradient(90deg, #6366f1, #818cf8); }

/* === Badge Styles === */
.badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.2rem 0.65rem; border-radius: 9999px; font-size: 0.75rem;
    font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.badge-regression { background: rgba(217,119,6,0.12); color: #b45309; border: 1px solid rgba(217,119,6,0.25); }
.badge-classification { background: rgba(8,145,178,0.12); color: #0e7490; border: 1px solid rgba(8,145,178,0.25); }
.badge-best { background: rgba(16,185,129,0.12); color: #059669; border: 1px solid rgba(16,185,129,0.25); }
.badge-info { background: rgba(30,144,255,0.12); color: var(--primary-dark); border: 1px solid rgba(30,144,255,0.25); }
.badge-warning { background: rgba(245,158,11,0.12); color: #d97706; border: 1px solid rgba(245,158,11,0.25); }
.badge-danger { background: rgba(239,68,68,0.12); color: #dc2626; border: 1px solid rgba(239,68,68,0.25); }

/* === Select Group === */
.select-group {
    background: var(--background); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 1.25rem; margin-bottom: 1rem;
}
.select-group h4 {
    font-size: 0.95rem; font-weight: 600; color: var(--text-primary);
    margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem;
}
.select-group p { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.75rem; }

/* === Variable Chips === */
.variable-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.variable-chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.85rem; border-radius: 9999px; font-size: 0.825rem;
    font-weight: 500; border: 1.5px solid var(--border-color);
    background: var(--surface); color: var(--text-secondary);
    cursor: pointer; transition: all 0.2s ease; user-select: none;
}
.variable-chip:hover { border-color: var(--primary-light); color: var(--primary-color); background: rgba(30,144,255,0.04); }
.variable-chip.selected {
    border-color: var(--primary-color); background: rgba(30,144,255,0.1);
    color: var(--primary-color); font-weight: 600;
}
.variable-chip.selected::before { content: '\2713'; font-size: 0.7rem; font-weight: 700; }
.variable-chip.target { border-color: var(--prediction-color); background: rgba(217,119,6,0.1); color: var(--prediction-color); font-weight: 600; }
.variable-chip.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* === Split Panel === */
.split-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1.5rem 0; }
.split-panel > .panel-left,
.split-panel > .panel-right {
    background: var(--surface); border: 1px solid var(--border-color);
    border-radius: 12px; padding: 1.5rem;
}
.split-panel > .panel-left { border-left: 4px solid var(--primary-color); }
.split-panel > .panel-right { border-left: 4px solid #10b981; }
.split-panel h4 {
    font-size: 1rem; font-weight: 600; color: var(--text-primary);
    margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem;
}

.preprocess-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1.5rem;
}
.preprocess-summary-item {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 0.5rem;
    color: #15803d;
}
.preprocess-summary-item span {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* === Responsive: 768px === */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    #main-app { padding: 1rem; }
    .analysis-area { padding: 1.5rem; }
    .category-cards { grid-template-columns: 1fr; }
    .upload-area { flex-direction: column; gap: 1.5rem; padding: 1.5rem; }
    .upload-info { flex-direction: column; text-align: center; gap: 1rem; }
    .upload-buttons { flex-direction: column; width: 100%; gap: 0.75rem; align-items: stretch; }
    .upload-hint { margin: 0.5rem 0; }
    .btn-upload, .btn-demo { width: 100%; justify-content: center; margin-bottom: 0; }
    button, select, input[type="text"], input[type="number"], input[type="password"], input[type="file"], .tab-btn {
        min-height: 48px; font-size: 16px; margin-bottom: 0.5rem;
    }
    input, select { padding: 0.75rem 1rem; }
    button { padding: 0.75rem 1.5rem; }
    .hero-section { padding: 2rem 1.5rem; border-radius: 16px; }
    .grid-2-cols, .upload-section .grid { grid-template-columns: 1fr !important; gap: 1rem; }
    .split-panel { grid-template-columns: 1fr; }
    .preprocess-summary-grid { grid-template-columns: 1fr; }
    .analysis-quality-header { flex-direction: column; }
    .analysis-quality-badges { justify-content: flex-start; }
    .analysis-quality-items { grid-template-columns: minmax(0, 1fr); }
    .analysis-quality-item { min-width: 0; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .beginner-start-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .beginner-start-steps li:nth-child(3) { padding-left: 0; border-left: 0; }
    .beginner-guide-steps { grid-template-columns: 1fr; gap: 0.65rem; }
    .beginner-guide-step,
    .beginner-guide-step:first-child {
        padding: 0.65rem 0 0; border-left: 0; border-top: 1px solid var(--border-color);
    }
    .beginner-guide-step:first-child { padding-top: 0; border-top: 0; }
    .step-indicator { justify-content: flex-start; padding: 1rem 0.75rem; }
    .step-indicator .step { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
    .variable-chip { font-size: 0.775rem; padding: 0.3rem 0.65rem; }
    .feature-importance-bar .feature-name { min-width: 80px; max-width: 120px; font-size: 0.775rem; }
    .model-comparison-table th, .model-comparison-table td { padding: 0.5rem 0.6rem; font-size: 0.8rem; }
    .confusion-matrix td { padding: 0.6rem; font-size: 1rem; min-width: 60px; }
    .kwic-panel { width: 100%; right: -100%; }
    .kwic-panel.open { right: 0; }
    .hero-action-left {
        position: static; margin: 0 auto 1rem auto; width: 100%;
    }
    .hero-action-right {
        position: static; width: 100%; margin: 0 auto 1.25rem;
        justify-content: center; flex-wrap: wrap;
    }
    .ai-settings-button {
        width: 100%; justify-content: center;
    }
    .ai-settings-modal {
        align-items: stretch; padding: 0.5rem;
    }
    .ai-settings-modal-content {
        width: 100%; max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem);
    }
    .ai-settings-modal-header { padding: 0.85rem 1rem; }
    .ai-settings-scroll { padding: 1rem; }
    .ai-settings-field-grid { grid-template-columns: minmax(0, 1fr); }
    .ai-settings-routes { grid-template-columns: 1fr; }
    .ai-settings-routes > div + div { border-left: 0; border-top: 1px solid var(--border-color); }
    .ai-settings-actions {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ai-settings-actions .btn-analysis,
    .ai-settings-actions .btn-demo {
        width: 100%; min-width: 0;
    }
    .hero-action-right .manual-link-button {
        width: auto; min-height: 42px; margin: 0;
    }
    .language-option {
        min-height: 30px; margin: 0; padding: 0.25rem 0.55rem; font-size: 0.78rem;
    }
    .ai-assist-floating {
        right: 0.75rem; bottom: 0.75rem; width: calc(100vw - 1.5rem); max-height: 55vh;
    }
    .ai-assist-body { max-height: calc(55vh - 4.5rem); }
}

/* === Responsive: 480px === */
@media (max-width: 480px) {
    .hero-title { font-size: 1.75rem; overflow-wrap: normal; }
    .hero-subtitle { font-size: 1rem; }
    .metrics-grid { grid-template-columns: 1fr; }
    .beginner-start { padding: 1rem; }
    .beginner-start-steps { grid-template-columns: 1fr; }
    .beginner-start-steps li,
    .beginner-start-steps li:first-child,
    .beginner-start-steps li:nth-child(3) {
        padding: 0.65rem 0; border-left: 0; border-top: 1px solid var(--border-color);
    }
    .beginner-start-steps li:first-child { border-top: 0; }
    .beginner-guide-terms dl > div { grid-template-columns: 1fr; gap: 0.1rem; }
    .create-model-config-grid { grid-template-columns: 1fr; }
    .step-indicator .step { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
    .step-indicator .step-connector { width: 16px; }
    .metric-card .metric-value { font-size: 1.5rem; }
    .confusion-matrix td { padding: 0.5rem; font-size: 0.875rem; min-width: 50px; }
    .ai-assist-actions,
    .ai-assist-chat-area { grid-template-columns: 1fr; }
    .ai-settings-heading-icon {
        width: 36px; height: 36px; flex-basis: 36px;
    }
    .ai-settings-modal-header h3 { font-size: 1.02rem; }
    .ai-settings-actions { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================
   動画分析カテゴリのテーマ色 (#dc2626)
   ========================================== */
.category-video { border-left-color: #dc2626; }
.category-video .category-icon { background: #dc2626; }

/* ==========================================
   動画分析タブ (Splyzaライク)
   ========================================== */
.va-root {
    display: flex; flex-direction: column; gap: 1rem;
    color: #1e293b; font-size: 0.95rem;
}
.va-root kbd {
    background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 4px;
    padding: 0 0.35rem; font-family: monospace; font-size: 0.85em;
}
.va-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    flex-wrap: wrap; gap: 1rem;
    background: #fff; padding: 1rem 1.25rem;
    border: 1px solid var(--va-theme-border); border-left: 4px solid var(--va-theme);
    border-radius: 8px;
}
.va-mode-toggle { display: flex; gap: 0.4rem; }
.va-mode-btn {
    padding: 0.5rem 0.9rem; border: 1px solid #cbd5e1; background: #fff;
    border-radius: 6px; cursor: pointer; font-size: 0.9rem; color: #334155;
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.va-mode-btn.active { background: var(--va-theme); color: #fff; border-color: var(--va-theme); }
.va-mode-btn:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.va-stage { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.va-stage-compare { grid-template-columns: 1fr 1fr; }
@media (max-width: 1024px) { .va-stage-compare { grid-template-columns: 1fr; } }
/* 単一モードでは横幅を控えめにし中央寄せ。読込前の余白も整理 */
.va-stage-single .va-panel { max-width: 900px; margin: 0 auto; width: 100%; }

.va-panel {
    display: flex; flex-direction: column; gap: 0.6rem;
    background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 0.85rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.va-panel.va-panel-active {
    border-color: var(--va-theme);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.15), 0 4px 18px rgba(220,38,38,0.06);
}
.va-panel-header {
    display: flex; justify-content: space-between; align-items: center; gap: 0.6rem;
    flex-wrap: wrap;
}
.va-panel-titlewrap { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.va-panel-title {
    font-weight: 600; color: #1e293b;
    display: inline-flex; align-items: center; gap: 0.5rem;
}
.va-media-info {
    font-size: 0.78rem; color: var(--text-secondary);
    display: inline-flex; align-items: center; gap: 0.35rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 360px;
}
.va-media-info:empty { display: none; }
.va-media-info i { color: var(--va-theme); }
.va-media-tag {
    font-size: 0.72rem; font-weight: 600; padding: 0.15rem 0.5rem;
    border-radius: 999px; background: #e2e8f0; color: #475569;
}
.va-media-tag-video { background: #dbeafe; color: #1d4ed8; }
.va-media-tag-image { background: #fef3c7; color: #b45309; }
.va-media-tag:empty { display: none; }
.va-panel-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.va-drop-zone {
    border: 2px dashed #cbd5e1; border-radius: 10px;
    min-height: 240px; display: flex; align-items: center; justify-content: center;
    color: #64748b; background: linear-gradient(180deg,#f8fafc,#f1f5f9);
    transition: all 0.2s;
}
.va-drop-zone.dragover {
    border-color: var(--va-theme); background: var(--va-theme-light); color: var(--va-theme);
    transform: scale(1.005);
}
.va-drop-inner { text-align: center; padding: 1rem; }
.va-drop-icon {
    width: 64px; height: 64px; border-radius: 50%; background: #fff;
    border: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 0.75rem auto; color: var(--va-theme); font-size: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.va-drop-zone.dragover .va-drop-icon { background: var(--va-theme); color: #fff; }
.va-drop-headline { font-weight: 600; color: #334155; margin: 0 0 0.25rem 0; font-size: 1rem; }
.va-drop-sub { color: #64748b; font-size: 0.8rem; margin: 0 0 0.75rem 0; }
.va-drop-cta { margin-top: 0.5rem; }

.va-video-wrap {
    position: relative; background: #000; border-radius: 8px; overflow: hidden;
    aspect-ratio: 16/9;
    width: 100%; max-height: 70vh;
    margin: 0 auto;
}
.va-video-wrap.is-image { background: #0f172a; }
.va-video-wrap video,
.va-video-wrap img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
    display: block;
}
.va-video-wrap canvas {
    position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair;
    touch-action: none;
}
.va-active-badge {
    position: absolute; top: 0.5rem; left: 0.5rem; padding: 0.25rem 0.55rem;
    background: rgba(220,38,38,0.92); color: #fff; font-size: 0.72rem; font-weight: 600;
    border-radius: 999px; pointer-events: none; opacity: 0;
    transition: opacity 0.2s; display: inline-flex; align-items: center; gap: 0.3rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.va-active-badge.on { opacity: 1; }
/* 単一モード時はアクティブ表示が冗長なので非表示 */
.va-stage-single .va-active-badge { display: none; }
.va-stage-single .va-active-toggle { display: none; }
.va-stage-single .va-panel.va-panel-active {
    border-color: var(--border-color);
    box-shadow: none;
}
.va-image-badge {
    position: absolute; top: 0.5rem; right: 0.5rem; padding: 0.25rem 0.55rem;
    background: rgba(245, 158, 11, 0.92); color: #fff; font-size: 0.72rem; font-weight: 600;
    border-radius: 999px; pointer-events: none;
    display: inline-flex; align-items: center; gap: 0.3rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.va-controls { display: flex; flex-direction: column; gap: 0.5rem; }
.va-controls-row {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
}
.va-controls-group { display: inline-flex; gap: 0.25rem; }
.va-time {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #1e293b; font-size: 0.95rem; font-weight: 600;
    background: #f1f5f9; padding: 0.25rem 0.6rem; border-radius: 6px; min-width: 12rem;
    text-align: center;
}
.va-controls.is-image .va-time { color: #b45309; background: #fef3c7; }

.va-seek {
    width: 100%; appearance: none; -webkit-appearance: none;
    height: 6px; background: linear-gradient(90deg, var(--va-theme), #fda4af);
    border-radius: 999px; outline: none; cursor: pointer;
}
.va-seek::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 16px; height: 16px; border-radius: 50%; background: #fff;
    border: 3px solid var(--va-theme); cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.va-seek::-moz-range-thumb {
    width: 16px; height: 16px; border-radius: 50%; background: #fff;
    border: 3px solid var(--va-theme); cursor: pointer;
}
.va-controls.is-image .va-seek { display: none; }
.va-controls.is-image .va-only-video { display: none !important; }
.va-volume input[type="range"] { width: 5rem; }

.va-btn-play {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--va-theme); color: #fff; border: none;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; cursor: pointer; box-shadow: 0 2px 6px rgba(220,38,38,0.3);
    transition: transform 0.1s, box-shadow 0.2s;
}
.va-btn-play:hover:not(:disabled) { transform: scale(1.05); box-shadow: 0 4px 10px rgba(220,38,38,0.4); }
.va-btn-play:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.va-btn-play.is-playing { background: #b91c1c; }
.va-btn-sm { padding: 0.35rem 0.5rem; }
.va-btn-ghost { background: transparent; border-color: transparent; color: #64748b; }
.va-btn-ghost:hover:not(:disabled) { background: #f1f5f9; color: #1e293b; }

.va-tag-strip {
    position: relative; height: 22px; background: #f1f5f9; border-radius: 11px;
    border: 1px solid #e2e8f0;
}
.va-controls.is-image .va-tag-strip { display: none; }
.va-tag-mark {
    position: absolute; top: 2px; bottom: 2px; width: 6px; border: none;
    border-radius: 3px; cursor: pointer; transform: translateX(-3px);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.6);
    transition: transform 0.1s;
}
.va-tag-mark:hover { transform: translateX(-3px) scaleY(1.2); }

.va-sync-bar {
    display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
    background: #eff6ff; border: 1px solid #bfdbfe; padding: 0.5rem 0.75rem;
    border-radius: 8px; color: #1e40af;
}
.va-sync-bar .va-hint { color: #1e40af; }
.va-sync-bar .va-hint.va-note-warn { color: #92400e; font-weight: 500; }

.va-tools {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden;
}
.va-tools-tabs { display: flex; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.va-tool-tab {
    flex: 1; padding: 0.75rem; border: none; background: transparent; cursor: pointer;
    color: #475569; font-weight: 500; display: inline-flex; align-items: center;
    justify-content: center; gap: 0.4rem; border-bottom: 3px solid transparent;
}
.va-tool-tab:hover { background: #f1f5f9; }
.va-tool-tab.active { color: var(--va-theme); border-bottom-color: var(--va-theme); background: #fff; }
.va-tool-pane { display: none; padding: 1rem; }
.va-tool-pane.active { display: block; }

.va-tool-section { margin-bottom: 1rem; }
.va-tool-section h4 { margin: 0 0 0.5rem 0; color: #334155; }
.va-tool-row {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    margin-bottom: 0.5rem;
}
.va-tool-help {
    margin-top: 0.5rem; padding: 0.75rem; background: #f8fafc; border-left: 3px solid var(--va-theme);
    border-radius: 4px; font-size: 0.875rem; color: #475569;
}

.va-btn {
    padding: 0.45rem 0.75rem; border: 1px solid #cbd5e1; background: #fff;
    border-radius: 6px; cursor: pointer; color: #334155; font-size: 0.875rem;
    display: inline-flex; align-items: center; gap: 0.35rem;
}
.va-btn:hover:not(:disabled) { background: #f1f5f9; border-color: #94a3b8; }
.va-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.va-btn.active { background: var(--va-theme); color: #fff; border-color: var(--va-theme); }
.va-btn-primary { background: var(--va-theme); color: #fff; border-color: var(--va-theme); }
.va-btn-primary:hover:not(:disabled) { filter: brightness(110%); background: var(--va-theme); border-color: var(--va-theme); }
.va-active-toggle.active { background: var(--va-theme); color: #fff; border-color: var(--va-theme); }

.va-inline {
    display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.875rem;
    color: #475569;
}
.va-inline input[type="number"], .va-inline select {
    padding: 0.25rem 0.5rem; border: 1px solid #cbd5e1; border-radius: 4px;
}
.va-hint { font-size: 0.8rem; color: #64748b; }

.va-draw-toolbar {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.4rem; margin-bottom: 0.6rem;
}
.va-draw-tool {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.55rem 0.6rem; background: #fff; border: 1px solid #cbd5e1;
    border-radius: 8px; cursor: pointer; color: #334155; font-size: 0.875rem;
}
.va-draw-tool i { font-size: 1rem; }
.va-draw-tool:hover:not(.active) { background: #f1f5f9; border-color: #94a3b8; }
.va-draw-tool.active {
    background: var(--va-theme); color: #fff; border-color: var(--va-theme);
    box-shadow: 0 2px 6px rgba(220,38,38,0.25);
}
.va-num-badge {
    display: inline-block; min-width: 1.4rem; padding: 0 0.35rem;
    background: #f1f5f9; border-radius: 4px; text-align: center; font-weight: 600;
    color: #334155;
}
.va-pill {
    display: inline-flex; align-items: center; padding: 0.15rem 0.6rem;
    background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
    border-radius: 999px; font-size: 0.75rem; font-weight: 500;
}
.va-color-label input[type="color"] {
    width: 32px; height: 28px; border: 1px solid #cbd5e1; border-radius: 4px;
    cursor: pointer; padding: 2px; background: #fff;
}

.va-tag-def {
    display: flex; gap: 0.4rem; align-items: center; padding: 0.4rem 0;
    border-bottom: 1px dashed #e2e8f0;
}
.va-tag-def:last-child { border-bottom: none; }
.va-tag-swatch {
    display: inline-block; width: 14px; height: 14px; border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.15); vertical-align: middle;
}
.va-tag-label-input { flex: 1; padding: 0.3rem 0.5rem; border: 1px solid #cbd5e1; border-radius: 4px; }

.va-tag-quick {
    border-radius: 999px; padding: 0.4rem 0.9rem; font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.va-tag-quick:hover { filter: brightness(110%); }

.va-table-wrap { max-height: 280px; overflow: auto; border: 1px solid #e2e8f0; border-radius: 6px; }
.va-tag-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.va-tag-table th, .va-tag-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid #f1f5f9; text-align: left; }
.va-tag-table thead { background: #f8fafc; position: sticky; top: 0; z-index: 1; }
.va-tag-table thead th { font-weight: 600; color: #475569; }
.va-tag-table tbody tr:nth-child(odd) { background: #fafbfc; }
.va-tag-table tbody tr:hover { background: var(--va-theme-light); }
.va-tag-comment { width: 100%; padding: 0.25rem 0.4rem; border: 1px solid #e2e8f0; border-radius: 4px; }
.va-link {
    background: none; border: none; color: var(--va-theme); cursor: pointer;
    font-family: monospace; padding: 0; text-decoration: underline;
}

.va-pose-angles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; }
.va-angle {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
    padding: 0.5rem 0.75rem;
}
.va-angle-label { font-size: 0.8rem; color: #64748b; }
.va-angle-value { font-size: 1.25rem; font-weight: 600; color: #1e293b; font-family: monospace; }

.va-info-banner {
    background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af;
    padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.875rem;
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 1rem;
}
.va-info-banner i { font-size: 1.1rem; }

.va-badge-count {
    display: inline-block; background: rgba(255,255,255,0.25); color: #fff;
    border-radius: 999px; padding: 0 0.5rem; font-size: 0.78rem; font-weight: 700;
    margin-left: 0.4rem; min-width: 1.2rem;
}
.btn-analysis:disabled .va-badge-count { background: rgba(255,255,255,0.45); }

.va-explainer {
    background: #fff; border: 1px solid #e2e8f0; border-left: 4px solid var(--va-theme);
    border-radius: 6px; padding: 0.85rem 1rem;
}
.va-explainer h4 { margin: 0 0 0.5rem 0; color: var(--va-theme); display: flex; align-items: center; gap: 0.4rem; }
.va-explainer ul { margin: 0; padding-left: 1.25rem; }
.va-explainer li { margin-bottom: 0.25rem; font-size: 0.875rem; color: #475569; }
