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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
}

h1:first-child {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

body > p {
    color: #718096;
    margin-bottom: 24px;
}

#input-text {
    width: 100%;
    max-width: 480px;
    margin-bottom: 24px;
}

input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1.1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    color: #2d3748;
}

input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

input::placeholder {
    color: #a0aec0;
}

h1:has(#output-text) {
    background: white;
    border-radius: 12px;
    padding: 20px 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
}

#output-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: #667eea;
    min-width: 120px;
}

.details-text {
    margin-top: 16px;
    background: white;
    border-radius: 10px;
    padding: 16px 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    color: #4a5568;
    font-size: 0.95rem;
    max-width: 480px;
    width: 100%;
    min-height: 20px;
}

.detail-grid {
    width: 100%;
    border-collapse: collapse;
}

.detail-grid tr:not(:last-child) td {
    border-bottom: 1px solid #f0f0f0;
}

.detail-grid td {
    padding: 6px 4px;
}

.detail-element {
    font-weight: 600;
    color: #2d3748;
    width: 28px;
}

.detail-atomic-mass {
    color: #a0aec0;
    font-size: 0.85rem;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.detail-count {
    color: #718096;
    text-align: left;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    padding-left: 24px !important;
}

.detail-mass {
    font-weight: 600;
    color: #667eea;
    text-align: right;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.detail-source {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 12px;
    text-align: center;
}