.research-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.research-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.research-header h1 {
    font-size: 2.4rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.research-header p {
    font-size: 1.05rem;
    color: #667085;
    max-width: 680px;
    margin: 0 auto;
}

.breadcrumb {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #94a3b8;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.playground-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
    border: 1px solid #e2e8f0;
    display: grid;
    gap: 2rem;
}

.playground-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.playground-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #1e293b;
}

.mcp-status {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #ecfdf3;
    color: #027a48;
    font-weight: 600;
    font-size: 0.85rem;
}

.mcp-status.error {
    background: #fef3f2;
    color: #b42318;
}

.input-panel {
    display: grid;
    gap: 0.75rem;
}

.input-panel label {
    font-weight: 600;
    color: #334155;
}

#hanjaInput {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 1rem;
    font-size: 1rem;
    resize: vertical;
    min-height: 140px;
}

.input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #475569;
}

.action-btn {
    --dr-primary: var(--color-primary, #4a6da7);
    --dr-primary-dark: var(--color-primary-hover, #3a5a8a);
    --dr-primary-soft: var(--color-primary-soft, #e8f0fb);
    --dr-surface: var(--color-surface, #ffffff);
    --dr-surface-soft: var(--color-surface-soft, #f8fbff);
    --dr-text: var(--color-text-primary, #1f2f46);
    --dr-border: var(--color-border-default, #d8e1ef);
    --dr-border-soft: color-mix(in srgb, var(--dr-border) 82%, var(--dr-primary) 18%);
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.5rem 0.82rem;
    font-weight: 600;
    font-size: 0.86rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.action-btn i {
    margin-right: 0.1rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px color-mix(in srgb, var(--dr-text) 12%, transparent);
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.action-btn-primary {
    background: var(--dr-surface);
    border-color: var(--dr-border-soft);
    color: var(--dr-primary-dark);
}

.action-btn-primary:hover:not(:disabled) {
    background: var(--dr-surface-soft);
    border-color: var(--dr-border-soft);
}

.action-btn-secondary {
    background: var(--dr-surface);
    color: var(--dr-primary-dark);
    border-color: var(--dr-border-soft);
}

.action-btn-secondary:hover:not(:disabled) {
    background: var(--dr-surface-soft);
    border-color: var(--dr-border-soft);
}

.output-panel {
    display: grid;
    gap: 1.5rem;
}

.output-block {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
    background: #f8fafc;
}

.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.output-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1f2937;
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.output-content {
    min-height: 48px;
    font-size: 1.05rem;
    color: #111827;
    background: #ffffff;
    border-radius: 10px;
    padding: 0.85rem 1rem;
    border: 1px solid #e2e8f0;
}

.token-list {
    display: grid;
    gap: 0.5rem;
}

.token-item {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    display: grid;
    gap: 0.35rem;
    font-size: 0.95rem;
}

.token-item strong {
    color: #1e293b;
}

.token-item span {
    color: #64748b;
}

.raw-output {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    overflow: auto;
    max-height: 240px;
    white-space: pre-wrap;
    word-break: break-word;
}

.empty-state {
    color: #94a3b8;
    font-size: 0.95rem;
}

.hidden {
    display: none !important;
}

.dictionary-panel {
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
    background: #f8fafc;
    display: grid;
    gap: 1rem;
}

.dictionary-help {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}

.dictionary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dictionary-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem;
    display: grid;
    gap: 0.5rem;
}

.dictionary-card h4 {
    margin: 0 0 0.25rem;
    color: #1e293b;
}

.dictionary-card label {
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
}

.dictionary-card input {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 0.65rem 0.75rem;
    font-size: 0.95rem;
}

.dictionary-actions {
    margin-top: 0.25rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dictionary-actions .action-btn {
    min-width: 112px;
}

.dictionary-log {
    margin: 0;
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    min-height: 56px;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 720px) {
    .playground-card {
        padding: 1.5rem;
    }

    .playground-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .dictionary-grid {
        grid-template-columns: 1fr;
    }
}
