
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(circle at top, #f0f4ff 0, #f5f5f7 45%, #f5f5f7 100%);
    margin: 0;
    padding: 0;
    color: #111827;
}

.page {
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 32px auto;
    background: rgba(255, 255, 255, 0.96);
    padding: 24px 32px 40px;
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.15);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

h1 {
    margin-top: 0;
    font-size: 28px;
    letter-spacing: 0.02em;
}

.subtitle {
    color: #4b5563;
    margin-top: 4px;
    margin-bottom: 10px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1.1fr);
    gap: 20px;
    align-items: flex-start;
}

.result-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.7fr);
}

.left-panel, .right-panel {
    min-width: 0;
}

.card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    padding: 16px 18px 18px;
    margin-bottom: 18px;
    background: #fcfcff;
}

.learning-card {
    background: linear-gradient(135deg, #f5f3ff, #eff6ff);
}

.card h2 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.card h2 .hint {
    font-size: 12px;
    font-weight: normal;
    color: #6b7280;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px 14px;
}

.brands-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.checkbox, .radio {
    display: flex;
    align-items: center;
    font-size: 14px;
}

.checkbox input, .radio input {
    margin-right: 6px;
}

.brand-item {
    padding: 4px 6px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.brand-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-info img {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    object-fit: cover;
    background: #fff;
}

.row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.row label {
    font-size: 14px;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

select {
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
}

.actions {
    text-align: center;
    margin-top: 22px;
}

button {
    padding: 10px 26px;
    font-size: 15px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: white;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

button:hover {
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
}

.error {
    padding: 10px 14px;
    background: #fef2f2;
    color: #b91c1c;
    border-radius: 10px;
    margin-bottom: 12px;
    border: 1px solid #fecaca;
}

.hint {
    color: #6b7280;
    font-size: 12px;
}

.hint.small {
    font-size: 11px;
}

.learning-card ul {
    padding-left: 18px;
    margin: 4px 0 0 0;
}

.learning-card li {
    font-size: 14px;
    margin-bottom: 4px;
}

code {
    font-family: "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 12px;
    background: #111827;
    color: #a5b4fc;
    padding: 1px 4px;
    border-radius: 4px;
}

#log-box {
    width: 100%;
    height: 260px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-family: "SF Mono", Menlo, Monaco, Consolas, "Courier New", monospace;
    font-size: 13px;
    resize: vertical;
    background: #020617;
    color: #22c55e;
}

.option-icon {
    margin-right: 6px;
}

.option-text {
    font-size: 14px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 10px;
}

.chart-card {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    padding: 8px 10px 10px;
    box-shadow: 0 4px 10px rgba(148, 163, 184, 0.25);
}

.chart-title {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
}

.chart-title .metric {
    font-size: 14px;
    font-weight: 600;
}

.chart-title .chart-type {
    font-size: 12px;
    color: #6b7280;
}

.chart-card img {
    max-width: 100%;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    cursor: zoom-in;
}

.link-button {
    display: inline-block;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
    text-decoration: none;
    font-size: 14px;
}

.link-button:hover {
    background: #e0e7ff;
}

/* Fullscreen lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.lightbox.hidden {
    display: none;
}

.lightbox-content {
    max-width: 96%;
    max-height: 96%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
