/* ====================================================
   Unicode Normalizer Tool — style.css
   Prefix: un-
   ==================================================== */

/* Container */
.un-container {
    max-width: 800px;
    margin: 0 auto;
}

/* ── Feature Banner ── */
.un-feature-banner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 28px;
    padding: 16px;
    background: linear-gradient(135deg, #e8eaf6, #c5cae9);
    border-radius: 12px;
}

.un-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.5;
}

.un-feature-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.un-feature-item strong {
    display: block;
    font-size: 12.5px;
    color: #283593;
}

.un-feature-item p {
    margin: 2px 0 0;
    color: #455a64;
    font-size: 11px;
}

/* ── Input Section ── */
.un-input-section {
    margin-bottom: 20px;
}

.un-input-section>label {
    display: block;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
    color: #263238;
}

.un-input-section textarea {
    width: 100%;
    min-height: 160px;
    padding: 14px;
    border: 2px solid #cfd8dc;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
    transition: border-color .2s;
    box-sizing: border-box;
}

.un-input-section textarea:focus {
    outline: none;
    border-color: #5c6bc0;
    box-shadow: 0 0 0 3px rgba(92, 107, 192, .15);
}

.un-input-section textarea.un-has-nfd {
    border-color: #ff7043;
    box-shadow: 0 0 0 3px rgba(255, 112, 67, .12);
}

.un-input-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.un-input-stats {
    margin-top: 6px;
    font-size: 12.5px;
    color: #607d8b;
}

.un-nfd-detected {
    color: #e65100;
    font-weight: 700;
}

/* ── Settings ── */
.un-settings {
    margin-bottom: 20px;
    padding: 18px;
    background: #f5f5f5;
    border-radius: 10px;
}

.un-radio-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.un-radio-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    background: #fff;
}

.un-radio-label:hover {
    border-color: #9fa8da;
}

.un-radio-label input[type="radio"] {
    margin-top: 3px;
    accent-color: #5c6bc0;
}

.un-radio-label input[type="radio"]:checked+.un-radio-text strong {
    color: #283593;
}

.un-radio-label:has(input:checked) {
    border-color: #5c6bc0;
    background: #e8eaf6;
}

.un-radio-text {
    flex: 1;
}

.un-radio-text strong {
    display: block;
    font-size: 13.5px;
    color: #37474f;
}

.un-radio-text small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #78909c;
    line-height: 1.4;
}

.un-auto-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    font-size: 13px;
    color: #455a64;
    cursor: pointer;
}

.un-auto-toggle input {
    accent-color: #5c6bc0;
}

/* ── Buttons ── */
.un-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s, box-shadow .2s;
}

.un-btn:active {
    transform: scale(.97);
}

.un-btn-primary {
    background: #5c6bc0;
    color: #fff;
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(92, 107, 192, .25);
}

.un-btn-primary:hover {
    background: #3f51b5;
    box-shadow: 0 4px 14px rgba(63, 81, 181, .30);
}

.un-btn-primary:disabled {
    background: #bdbdbd;
    box-shadow: none;
    cursor: not-allowed;
}

.un-btn-sample {
    background: #e8eaf6;
    color: #3949ab;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
}

.un-btn-sample:hover {
    background: #c5cae9;
}

.un-btn-clear {
    background: #fafafa;
    color: #78909c;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.un-btn-clear:hover {
    background: #f5f5f5;
    color: #d32f2f;
    border-color: #ef9a9a;
}

/* ── Result Section ── */
.un-result-section {
    margin-top: 24px;
    padding: 20px;
    background: #e8f5e9;
    border: 2px solid #a5d6a7;
    border-radius: 10px;
}

.un-result-section>label {
    display: block;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
    color: #2e7d32;
}

.un-result-section textarea {
    width: 100%;
    min-height: 140px;
    padding: 14px;
    border: 1.5px solid #c8e6c9;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    background: #fff;
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
    box-sizing: border-box;
}

.un-result-section textarea:focus {
    outline: none;
    border-color: #66bb6a;
}

.un-result-stats {
    margin-top: 8px;
    font-size: 12.5px;
    color: #558b2f;
    line-height: 1.6;
}

.un-result-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.un-btn-copy {
    background: #5c6bc0;
    color: #fff;
    flex: 1;
}

.un-btn-copy:hover {
    background: #3f51b5;
}

.un-btn-copy.copied {
    background: #43a047;
}

.un-btn-download {
    background: #fff;
    color: #5c6bc0;
    border: 1.5px solid #5c6bc0;
    flex: 1;
}

.un-btn-download:hover {
    background: #e8eaf6;
}

/* ── Analysis Panel ── */
.un-analysis {
    margin-top: 20px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.un-analysis summary {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    color: #37474f;
    background: #fafafa;
    cursor: pointer;
    user-select: none;
}

.un-analysis summary:hover {
    background: #f5f5f5;
}

.un-analysis-body {
    padding: 16px;
    overflow-x: auto;
}

.un-codepoint-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

.un-codepoint-table th {
    padding: 8px 10px;
    background: #eceff1;
    text-align: left;
    font-weight: 600;
    color: #455a64;
    border-bottom: 2px solid #cfd8dc;
    white-space: nowrap;
}

.un-codepoint-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #eceff1;
    vertical-align: middle;
}

.un-codepoint-table .un-changed {
    background: #fff3e0;
}

.un-char {
    font-size: 16px;
    text-align: center;
    min-width: 32px;
}

.un-combining {
    color: #d32f2f;
    font-weight: 700;
}

.un-code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    color: #5c6bc0;
    white-space: nowrap;
}

.un-truncate-note {
    margin-top: 10px;
    font-size: 11.5px;
    color: #90a4ae;
}

/* ── Alerts ── */
.un-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 12px;
    line-height: 1.5;
    white-space: pre-line;
}

.un-alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.un-alert-error {
    background: #fbe9e7;
    color: #bf360c;
    border: 1px solid #ffab91;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .un-feature-banner {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .un-radio-group {
        grid-template-columns: 1fr;
    }

    .un-result-actions {
        flex-direction: column;
    }

    .un-btn-copy,
    .un-btn-download {
        flex: none;
        width: 100%;
        justify-content: center;
    }

    .un-codepoint-table {
        font-size: 11px;
    }

    .un-char {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .un-feature-banner {
        grid-template-columns: 1fr;
    }
}