:root {
    font-family: Inter, system-ui, -apple-system, sans-serif;
    color: #20242b;
    background: #f5f6f8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: white;
    border-bottom: 1px solid #e1e4e8;
}

.header h1 {
    margin: 0;
    font-size: 22px;
}

.header p {
    margin: 5px 0 0;
    color: #737b87;
    font-size: 13px;
}

.privacy-label {
    color: #16834a;
    background: #e5f6ec;
    padding: 7px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(300px, .85fr) minmax(0, 1.5fr);
    gap: 16px;
    padding: 20px;
    align-items: start;
}

.panel {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 10px;
    padding: 16px;
    min-width: 0;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.panel-heading h2 {
    font-size: 16px;
    margin: 0;
}

textarea {
    width: 100%;
    min-height: 390px;
    resize: vertical;
    padding: 12px;
    border: 1px solid #d8dce2;
    border-radius: 7px;
    outline: none;
    font-family: Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    tab-size: 4;
}

textarea:focus {
    border-color: #6489d9;
}

.options {
    display: grid;
    gap: 12px;
    margin: 18px 0;
}

.options h3,
.batch h3,
.diagnostics h3 {
    margin: 0 0 5px;
    font-size: 14px;
}

.options label {
    display: flex;
    gap: 9px;
    align-items: center;
    font-size: 13px;
    cursor: pointer;
}

.options input {
    accent-color: #416bc1;
}

select {
    width: 100%;
    padding: 9px;
    border: 1px solid #d8dce2;
    border-radius: 6px;
    background: white;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

button {
    border: 0;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
}

button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.primary {
    color: white;
    background: #315eb5;
}

.primary:hover:not(:disabled) {
    background: #264d9b;
}

.secondary {
    background: #edf0f4;
    color: #303945;
}

.hint {
    font-size: 11px;
    line-height: 1.5;
    color: #858d98;
    margin-top: 15px;
}

.batch {
    border-top: 1px solid #e1e4e8;
    padding-top: 15px;
    display: grid;
    gap: 10px;
}

.batch input {
    width: 100%;
    font-size: 12px;
}

#batch-results {
    display: grid;
    gap: 7px;
    font-size: 12px;
    overflow-wrap: anywhere;
}

#batch-results a {
    color: #315eb5;
}

.diff-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
}

.diff-panel {
    min-width: 0;
    border: 1px solid #e1e4e8;
    border-radius: 7px;
    overflow: hidden;
}

.diff-panel h3 {
    margin: 0;
    padding: 10px;
    font-size: 12px;
    background: #f5f6f8;
    border-bottom: 1px solid #e1e4e8;
}

.diff-content {
    min-height: 390px;
    max-height: 65vh;
    overflow: auto;
    font-family: Consolas, monospace;
    font-size: 11px;
    line-height: 1.65;
}

.diff-line {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 20px;
}

.diff-line code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 1px 5px;
    font: inherit;
}

.line-number {
    text-align: right;
    padding-right: 7px;
    color: #9299a3;
    background: #f5f6f8;
    user-select: none;
}

.diff-line.changed {
    background: #fff1cc;
}

.diff-line.deleted {
    background: #fde4e4;
}

.diff-line.inserted {
    background: #dcf5e5;
}

.empty {
    padding: 15px;
    color: #9299a3;
    font-size: 12px;
}

.result-status {
    padding: 12px 0;
    font-size: 12px;
    color: #596474;
    overflow-wrap: anywhere;
}

.diagnostics {
    border-top: 1px solid #e1e4e8;
    padding-top: 14px;
}

#diagnostics {
    list-style: none;
    padding: 0;
    margin: 0;
}

.diagnostic {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    margin-top: 5px;
    border-radius: 5px;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.diagnostic.error {
    background: #fde7e7;
    color: #9e3030;
}

.diagnostic.warning {
    background: #fff2d9;
    color: #805c17;
}

.diagnostic.info {
    background: #eaf1fc;
    color: #31578e;
}

footer {
    text-align: center;
    color: #8b929c;
    font-size: 11px;
    padding: 20px;
}

@media (max-width: 1050px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    textarea {
        min-height: 300px;
    }
}

@media (max-width: 650px) {
    .header {
        padding: 16px;
        align-items: flex-start;
        gap: 10px;
    }

    .header h1 {
        font-size: 18px;
    }

    .workspace {
        padding: 10px;
        gap: 10px;
    }

    .panel {
        padding: 12px;
    }

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

    .diff-content {
        max-height: 350px;
        min-height: 120px;
    }

    .privacy-label {
        font-size: 10px;
    }
}