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

:root {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --surface2: #242424;
    --border: #333;
    --text: #e8e8e8;
    --text-dim: #888;
    --accent: #ffe234;
    --accent-dim: #b89e00;
    --kakao: #fee500;
    --success: #4caf50;
    --error: #ef5350;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--kakao);
    letter-spacing: -1px;
}

.subtitle {
    color: var(--text-dim);
    margin-top: 8px;
    font-size: 1rem;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface);
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--kakao);
    background: var(--surface2);
}

.drop-zone-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.drop-zone-text {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 8px;
}

.drop-zone-hint {
    font-size: 0.85rem;
    color: var(--text-dim);
}

/* How to */
.how-to {
    margin-top: 20px;
}

.how-to details {
    background: var(--surface);
    border-radius: 12px;
    padding: 16px 20px;
}

.how-to summary {
    cursor: pointer;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.how-to ol {
    margin-top: 12px;
    padding-left: 20px;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.how-to li {
    margin-bottom: 4px;
}

/* Progress */
.progress-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--kakao);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

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

#progress-text {
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 20px;
}

.progress-bar-container {
    background: var(--surface2);
    border-radius: 8px;
    height: 6px;
    overflow: hidden;
    max-width: 400px;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    background: var(--kakao);
    border-radius: 8px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-bar.indeterminate {
    animation: indeterminate 2s ease-in-out infinite;
}

@keyframes indeterminate {
    0% { width: 10%; margin-left: 0; }
    50% { width: 40%; margin-left: 30%; }
    100% { width: 10%; margin-left: 90%; }
}

.eta-text {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-top: 12px;
}

/* Result */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.result-header h2 {
    font-size: 1.5rem;
    color: var(--kakao);
}

#chat-meta {
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 4px;
}

.share-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-share {
    flex: 1;
    padding: 14px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-share:hover {
    background: var(--surface2);
    border-color: var(--text-dim);
}

.btn-share-primary {
    background: var(--kakao);
    color: #000;
    border-color: var(--kakao);
}

.btn-share-primary:hover {
    background: var(--accent-dim);
    border-color: var(--accent-dim);
}

.btn-share.copied {
    background: var(--success);
    color: #000;
    border-color: var(--success);
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface2);
    color: var(--text);
    padding: 12px 24px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    z-index: 1000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.7s forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.result-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.card {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-body {
    font-size: 0.95rem;
    line-height: 1.8;
}

/* Markdown 스타일 */
.markdown h2 {
    font-size: 1.15rem;
    color: var(--kakao);
    margin: 20px 0 10px;
}

.markdown h2:first-child {
    margin-top: 0;
}

.markdown ul, .markdown ol {
    padding-left: 20px;
    margin: 8px 0;
}

.markdown li {
    margin-bottom: 4px;
}

.markdown p {
    margin: 8px 0;
}

.markdown a {
    color: var(--accent);
    text-decoration: underline;
}

.markdown strong {
    color: var(--kakao);
}

/* Participants */
.participant-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.participant-row:last-child {
    border-bottom: none;
}

.participant-name {
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.participant-count {
    color: var(--kakao);
    font-weight: 700;
    margin-left: 12px;
    white-space: nowrap;
}

.participant-peak {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-left: 12px;
    white-space: nowrap;
}

.participant-bar {
    height: 4px;
    background: var(--kakao);
    border-radius: 2px;
    margin-top: 4px;
    transition: width 0.5s;
}

/* Error */
.error-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    border: 1px solid var(--error);
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

#error-text {
    color: var(--error);
    margin-bottom: 20px;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 24px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--kakao);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-dim);
}

.btn-secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.hidden {
    display: none;
}

/* Ad slots */
.ad-slot {
    margin: 20px 0;
    min-height: 0;
    text-align: center;
}

/* Footer */
footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.footer-sub {
    margin-top: 4px;
    font-size: 0.75rem;
    opacity: 0.6;
}

.footer-links {
    margin-top: 8px;
    font-size: 0.75rem;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--kakao);
}

/* Filter / Date Selection */
.filter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 24px;
    text-align: center;
}

.filter-card h2 {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.filter-meta {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.filter-card h3 {
    font-size: 1.05rem;
    margin-bottom: 16px;
    color: var(--kakao);
}

.quick-filters {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.btn-filter {
    padding: 10px 20px;
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-filter:hover {
    background: var(--kakao);
    color: #000;
    border-color: var(--kakao);
}

.custom-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.custom-filter label {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.custom-filter input {
    padding: 8px 12px;
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.detail-level {
    margin: 20px 0 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.detail-level > label {
    display: block;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.detail-options {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-detail {
    padding: 8px 18px;
    background: var(--surface2);
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-detail:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

.btn-detail.active {
    background: var(--kakao);
    color: #000;
    border-color: var(--kakao);
    font-weight: 700;
}

.detail-desc {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-top: 8px;
}

.btn-full {
    margin-top: 8px;
    width: 100%;
    opacity: 0.7;
}

.btn-full:hover {
    opacity: 1;
}

/* Support / Donate */
.support-section {
    margin-top: 40px;
}

.support-card {
    text-align: center;
    padding: 28px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.support-emoji {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.support-text {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 16px;
}

.btn-coffee {
    display: inline-block;
    padding: 10px 28px;
    background: #ffdd00;
    color: #000;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-coffee:hover {
    background: #e6c800;
}

.support-hint {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-dim);
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 20px 16px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .drop-zone {
        padding: 40px 20px;
    }

    .card {
        padding: 16px;
    }
}
