﻿        .visually-hidden {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .line-compare-page {
            max-width: 87.5rem;
            margin: 0 auto;
            padding: 1.25rem 1rem 2.5rem;
        }

        .line-compare-page .page-intro {
            text-align: center;
            margin-bottom: 1.5rem;
        }

        .line-compare-page .page-intro h1 {
            color: #2c3e50;
            font-size: 1.65rem;
            margin: 0 0 0.35rem;
        }

        .line-compare-page .page-intro p {
            margin: 0;
            color: #5c6478;
            font-size: 0.95rem;
        }

        .line-compare-controls {
            background: #fdfdfe;
            padding: 1rem 1.15rem;
            border-radius: 12px;
            border: 1px solid #eceef4;
            box-shadow:
                0 1px 2px rgba(255, 255, 255, 0.9) inset,
                0 1px 2px rgba(22, 28, 38, 0.04);
            margin-bottom: 1.35rem;
            display: flex;
            gap: 1rem 1.25rem;
            align-items: center;
            flex-wrap: wrap;
        }

        .line-compare-controls .control-group {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .line-compare-controls label {
            font-weight: 500;
            font-size: 0.88rem;
            color: #3a3f4d;
        }

        .line-compare-controls input[type="checkbox"] {
            transform: scale(1.1);
        }

        .line-compare-controls #delimiterChar {
            width: 2.25rem;
            padding: 0.25rem 0.35rem;
            border: 1px solid #d5dae8;
            border-radius: 6px;
            font-family: ui-monospace, monospace;
            text-align: center;
        }

        .line-compare-controls .btn {
            background: #3498db;
            color: #fff;
            border: none;
            padding: 0.5rem 1.1rem;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.88rem;
            font-weight: 500;
            transition: background 0.2s, filter 0.2s;
        }

        .line-compare-controls .btn:hover {
            background: #2980b9;
        }

        .line-compare-controls .btn.danger {
            background: #e74c3c;
        }

        .line-compare-controls .btn.danger:hover {
            background: #c0392b;
        }

        .line-compare-controls .btn.example {
            background: #fff;
            color: #2d6a4f;
            border: 1px solid #95d5b2;
            box-shadow: none;
        }

        .line-compare-controls .btn.example:hover {
            background: #d8f3dc;
            border-color: #40916c;
            color: #1b4332;
        }

        .line-compare-section {
            margin-top: 1.75rem;
        }

        .line-compare-section-heading {
            font-size: 1.05rem;
            font-weight: 650;
            margin: 0 0 0.85rem;
            color: #1a1d26;
            letter-spacing: -0.02em;
            border-bottom: 1px solid #e2e5ee;
            padding-bottom: 0.45rem;
        }

        .note-cards-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
            gap: 0.75rem;
            align-items: stretch;
        }

        .note-cards-grid--sources {
            grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
        }

        @media (min-width: 900px) {
            .note-cards-grid--sources {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        .note-card {
            display: flex;
            flex-direction: column;
            min-width: 0;
            padding: 0;
            background: #f6f7fa;
            border: 1px solid #dfe3ec;
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 1px 2px rgba(22, 28, 38, 0.05);
        }

        .line-compare-page .note-card > .note-card-header {
            display: flex;
            flex-direction: row;
            flex-wrap: nowrap;
            align-items: center;
            gap: 0.35rem 0.45rem;
            margin: 0;
            padding: 0.35rem 0.45rem 0.38rem;
            background: linear-gradient(180deg, #eef1f8 0%, #e4e8f2 100%);
            border-bottom: 1px solid #cdd3e0;
            box-shadow:
                0 1px 0 rgba(255, 255, 255, 0.75) inset,
                0 2px 4px rgba(22, 28, 38, 0.04);
            color: inherit;
            width: auto;
            height: auto;
            min-height: 2rem;
        }

        .note-card-title {
            margin: 0;
            font-size: 0.92rem;
            font-weight: 650;
            color: #353b4a;
            letter-spacing: -0.02em;
            flex: 0 1 auto;
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .line-compare-page .note-card > .note-card-header .note-card-title { color: #353b4a; }

        .note-card-stats {
            font-size: 0.72rem;
            color: #6d7485;
            font-variant-numeric: tabular-nums;
            white-space: nowrap;
            flex: 1 1 auto;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            text-align: right;
        }

        .note-card-stats [data-stat-total],
        .note-card-stats [data-stat-duplicates] {
            font-weight: 600;
            color: #6d7485;
        }

        .note-card-stat-sep {
            margin: 0 0.25rem;
            color: #dddfe6;
            font-weight: 400;
        }

        .note-card-textarea {
            flex: 1 1 auto;
            width: 100%;
            box-sizing: border-box;
            font-family: ui-monospace, 'Courier New', monospace;
            font-size: 0.88rem;
            line-height: 1.4;
            margin: 0;
            padding: 0.4rem 0.5rem 0.5rem;
            border: none;
            border-radius: 0 0 9px 9px;
            resize: vertical;
            background: #fff;
            color: #3a3f4d;
            box-shadow: none;
        }

        .note-card--source .note-card-textarea {
            min-height: 15rem;
        }

        .note-card--result .note-card-textarea {
            min-height: 12rem;
        }

        .note-card-textarea:focus {
            outline: none;
            box-shadow: inset 0 0 0 2px rgba(91, 127, 212, 0.35);
        }

        .note-card-textarea[readonly] {
            background: #fbfbfc;
            color: #5c6478;
        }

        .note-card-edit-btn {
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 1.85rem;
            height: 1.85rem;
            padding: 0;
            border: 1px solid #c5cad8;
            border-radius: 6px;
            background: rgba(255, 255, 255, 0.85);
            cursor: pointer;
            color: #4d5568;
        }

        .note-card-edit-btn:hover {
            background: #fff;
            border-color: #a8b0c4;
            color: #2c3348;
        }

        .note-card-edit-btn:focus-visible {
            outline: 2px solid #5b7fd4;
            outline-offset: 1px;
        }

        .note-card-edit-icon {
            width: 1rem;
            height: 1rem;
            display: block;
            flex-shrink: 0;
        }

        .modal-text-editor-overlay {
            position: fixed;
            inset: 0;
            background: rgba(22, 28, 38, 0.52);
            backdrop-filter: blur(2px);
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0.65rem;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.18s ease, visibility 0.18s ease;
        }

        .modal-text-editor-overlay.is-open { opacity: 1; visibility: visible; }

        .modal-text-editor-dialog {
            background: #f8f9fc;
            border-radius: 12px;
            box-shadow:
                0 4px 6px rgba(0, 0, 0, 0.06),
                0 22px 48px rgba(22, 28, 38, 0.18);
            width: min(100%, 58rem);
            min-height: min(72vh, 38rem);
            max-height: min(94vh, 52rem);
            display: flex;
            flex-direction: column;
            border: 1px solid rgba(0, 0, 0, 0.08);
            color: #1a1d26;
        }

        .modal-text-editor-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            padding: 0.85rem 1.1rem;
            background: linear-gradient(180deg, #fff 0%, #f4f5fa 100%);
            border-radius: 12px 12px 0 0;
            border-bottom: 1px solid #e2e5ee;
            gap: 0.75rem;
        }

        .modal-text-editor-header-titles { min-width: 0; flex: 1; }

        #modal-text-editor-field-title {
            margin: 0;
            font-size: 1.2rem;
            font-weight: 700;
            letter-spacing: -0.03em;
            line-height: 1.25;
            color: #141824;
            word-break: break-word;
            border: none;
            padding: 0;
        }

        #modal-text-editor-kicker {
            margin: 0.2rem 0 0;
            font-size: 0.78rem;
            font-weight: 500;
            color: #6b728d;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .modal-text-editor-header-actions {
            display: flex;
            align-items: center;
            gap: 0.35rem;
        }

        .modal-text-editor-header-actions button {
            padding: 0.3rem 0.55rem;
            font-size: 0.75rem;
            border: 1px solid #cfd4e2;
            border-radius: 6px;
            background: #fff;
            cursor: pointer;
            color: #3d4663;
        }

        .modal-text-editor-header-actions button:hover:not(:disabled) {
            background: #eef1ff;
            border-color: #a8b4e8;
        }

        .modal-text-editor-header-actions button:disabled {
            opacity: 0.45;
            cursor: not-allowed;
        }

        .modal-text-editor-close {
            border: none;
            background: transparent;
            font-size: 1.35rem;
            line-height: 1;
            cursor: pointer;
            color: #5c6478;
            padding: 0.2rem 0.45rem;
            border-radius: 6px;
        }

        .modal-text-editor-close:hover {
            background: #e8eaf3;
            color: #1a1d26;
        }

        .modal-text-editor-toolbar {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.35rem 1.25rem;
            padding: 0.5rem 1.1rem;
            border-bottom: 1px solid #e2e5ee;
            background: #fff;
            align-items: start;
        }

        @media (max-width: 560px) {
            .modal-text-editor-toolbar { grid-template-columns: 1fr; }
        }

        .modal-text-editor-toolbar-col {
            display: flex;
            flex-direction: column;
            gap: 0.3rem;
            min-width: 0;
        }

        .modal-text-editor-toolbar-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.3rem 0.45rem;
        }

        .toolbar-label {
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #7a8199;
            margin: 0;
        }

        .modal-text-editor-toolbar button[data-transform],
        .modal-text-editor-toolbar button[data-action="select-all"],
        .modal-text-editor-toolbar button[data-action="copy-all"] {
            padding: 0.32rem 0.6rem;
            font-size: 0.78rem;
            border: 1px solid #d5dae8;
            border-radius: 6px;
            background: #fafbff;
            cursor: pointer;
            color: #2c3348;
        }

        .modal-text-editor-toolbar button[data-transform]:hover,
        .modal-text-editor-toolbar button[data-action="select-all"]:hover,
        .modal-text-editor-toolbar button[data-action="copy-all"]:hover {
            background: #eef2ff;
            border-color: #9aa8e0;
        }

        .modal-text-editor-filter-lines {
            display: flex;
            flex-wrap: wrap;
            align-items: flex-end;
            gap: 0.5rem 0.85rem;
            padding: 0.4rem 1.1rem;
            background: #e8ebf4;
            border-bottom: 1px solid #dde1ed;
        }

        .modal-text-editor-filter-lines > label:first-child {
            flex: 1 1 12rem;
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
            font-size: 0.72rem;
            font-weight: 600;
            color: #5c6478;
            min-width: 0;
        }

        .modal-text-editor-filter-lines input[type="text"] {
            font-size: 0.82rem;
            padding: 0.38rem 0.5rem;
            border: 1px solid #cfd4e2;
            border-radius: 6px;
            font-family: inherit;
        }

        .modal-text-editor-filter-lines .modal-filter-case-label {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.72rem;
            font-weight: 500;
            color: #5c6478;
            cursor: pointer;
            margin-bottom: 0.12rem;
        }

        .modal-text-editor-filter-lines .modal-filter-hint {
            flex: 1 1 100%;
            margin: 0;
            font-size: 0.65rem;
            color: #6b728d;
            line-height: 1.35;
        }

        .modal-text-editor-filter-lines .modal-filter-hint[hidden] {
            display: none !important;
        }

        .modal-editor-with-lines textarea[data-editor]:read-only {
            background: #f2f3f8;
            cursor: default;
        }

        .modal-text-editor-find {
            display: grid;
            grid-template-columns: 1fr 1fr minmax(8.5rem, 10.5rem);
            gap: 0.4rem 0.65rem;
            align-items: end;
            padding: 0.45rem 1.1rem;
            background: #f0f2f8;
            border-bottom: 1px solid #e2e5ee;
        }

        @media (max-width: 640px) {
            .modal-text-editor-find { grid-template-columns: 1fr 1fr; }
            .modal-text-editor-stats.modal-find-stats {
                grid-column: 1 / -1;
                border-left: none;
                border-top: 1px solid #dde1ed;
                margin: 0;
                padding: 0.35rem 0 0;
            }
        }

        @media (max-width: 480px) {
            .modal-text-editor-find { grid-template-columns: 1fr; }
        }

        .modal-text-editor-find label {
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
            font-size: 0.72rem;
            font-weight: 600;
            color: #5c6478;
        }

        .modal-text-editor-find input[type="text"] {
            font-size: 0.82rem;
            padding: 0.38rem 0.5rem;
            border: 1px solid #cfd4e2;
            border-radius: 6px;
            font-family: inherit;
        }

        .modal-text-editor-find .find-row-2 {
            grid-column: 1 / -1;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.4rem 0.65rem;
        }

        .modal-text-editor-find .find-options {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.45rem 0.75rem;
        }

        .modal-text-editor-find .find-options label {
            flex-direction: row;
            align-items: center;
            gap: 0.35rem;
            font-weight: 500;
            cursor: pointer;
        }

        .modal-text-editor-find .find-buttons {
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
            margin-left: auto;
        }

        @media (max-width: 520px) {
            .modal-text-editor-find .find-buttons { margin-left: 0; }
        }

        .modal-text-editor-find .find-buttons button {
            padding: 0.35rem 0.65rem;
            font-size: 0.78rem;
            border-radius: 6px;
            border: 1px solid #cfd4e2;
            background: #fff;
            cursor: pointer;
            color: #2c3348;
        }

        .modal-text-editor-find .find-buttons button:hover {
            background: #e8ebff;
            border-color: #9aa8e0;
        }

        .modal-text-editor-find .find-buttons button[data-action="replace-all"] {
            font-weight: 600;
            border-color: #b8c4f0;
            background: #e8ecff;
        }

        .modal-text-editor-find-hint {
            flex: 1 1 100%;
            margin: 0;
            font-size: 0.65rem;
            color: #6b728d;
            line-height: 1.3;
        }

        @media (min-width: 521px) {
            .modal-text-editor-find-hint { flex: 1 1 14rem; }
        }

        .modal-text-editor-find-hint code {
            font-family: ui-monospace, monospace;
            font-size: 0.66rem;
            background: #e8eaf3;
            padding: 0.05rem 0.25rem;
            border-radius: 3px;
        }

        .modal-text-editor-stats { font-variant-numeric: tabular-nums; }

        .modal-text-editor-stats.modal-find-stats {
            font-size: 0.7rem;
            line-height: 1.35;
            color: #4a5168;
            padding: 0.15rem 0 0.15rem 0.65rem;
            margin-bottom: 0.05rem;
            border-left: 1px solid #d5dae8;
            align-self: stretch;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            align-content: center;
            gap: 0.2rem 0.35rem;
            background: transparent;
        }

        .modal-text-editor-body {
            padding: 0.55rem 1.1rem;
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
            background: #fff;
        }

        .modal-editor-with-lines {
            display: flex;
            flex: 1;
            min-height: 0;
            align-items: stretch;
            border: 1px solid #cfd4e2;
            border-radius: 8px;
            overflow: hidden;
            background: #fff;
            box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
        }

        .modal-editor-gutter {
            flex-shrink: 0;
            min-width: 2.5rem;
            width: 3.25rem;
            box-sizing: border-box;
            padding: 0.5rem 0.35rem 0.5rem 0.45rem;
            margin: 0;
            background: #eceef6;
            color: #8b92a8;
            text-align: right;
            font-family: ui-monospace, monospace;
            font-size: 0.92rem;
            line-height: 1.55;
            overflow-x: hidden;
            overflow-y: auto;
            scrollbar-width: none;
            -ms-overflow-style: none;
            user-select: none;
            pointer-events: none;
            border-right: 1px solid #dde1ed;
            white-space: pre;
            tab-size: 2;
        }

        .modal-editor-gutter::-webkit-scrollbar {
            display: none;
            width: 0;
            height: 0;
        }

        .modal-editor-with-lines textarea[data-editor] {
            flex: 1;
            min-height: 18rem;
            min-width: 0;
            font-family: ui-monospace, monospace;
            font-size: 0.92rem;
            line-height: 1.55;
            padding: 0.55rem 0.6rem;
            border: none;
            border-radius: 0;
            resize: vertical;
            tab-size: 2;
            white-space: pre;
            overflow-x: auto;
            overflow-y: auto;
            background: #fcfcff;
            color: #1a1d26;
        }

        .modal-editor-with-lines textarea[data-editor]:focus {
            outline: none;
            box-shadow: inset 0 0 0 2px #6c7ce7;
        }

        .modal-text-editor-duplicates {
            flex-shrink: 0;
            border-top: 1px solid #e2e5ee;
            background: #f4f5fa;
        }

        .modal-text-editor-duplicates > details { border: none; }

        .modal-text-editor-duplicates summary {
            padding: 0.35rem 1rem;
            font-size: 0.75rem;
            font-weight: 650;
            color: #4a5168;
            cursor: pointer;
            list-style: none;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            user-select: none;
        }

        .modal-text-editor-duplicates summary::-webkit-details-marker { display: none; }

        .modal-text-editor-duplicates summary::before {
            content: '';
            border: solid #7a8199;
            border-width: 0 2px 2px 0;
            display: inline-block;
            padding: 2.5px;
            transform: rotate(-45deg);
            transition: transform 0.15s ease;
        }

        .modal-text-editor-duplicates details[open] summary::before { transform: rotate(45deg); }

        .modal-text-editor-duplicates .dup-body { padding: 0 1rem 0.65rem; }

        .modal-text-editor-duplicates textarea[data-duplicate-list] {
            width: 100%;
            box-sizing: border-box;
            min-height: 4.5rem;
            max-height: 12rem;
            font-family: ui-monospace, monospace;
            font-size: 0.78rem;
            line-height: 1.45;
            padding: 0.4rem 0.5rem;
            border: 1px solid #cfd4e2;
            border-radius: 6px;
            resize: vertical;
            white-space: pre;
            overflow-x: auto;
            background: #fff;
            color: #333;
            tab-size: 4;
        }

        .modal-text-editor-footer {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 0.4rem 0.5rem;
            padding: 0.5rem 1rem;
            border-top: 1px solid #e2e5ee;
            background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
            border-radius: 0 0 12px 12px;
        }

        .modal-text-editor-hints {
            font-size: 0.72rem;
            color: #7a8199;
            line-height: 1.35;
        }

        .modal-text-editor-footer-actions {
            display: flex;
            gap: 0.45rem;
            margin-left: auto;
        }

        .modal-text-editor-footer-actions button {
            padding: 0.45rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.86rem;
        }

        .modal-text-editor-footer .btn-cancel {
            border: 1px solid #cfd4e2;
            background: #fff;
            color: #3d4663;
        }

        .modal-text-editor-footer .btn-apply {
            border: 1px solid #3d5a8a;
            background: linear-gradient(180deg, #5b7fd4 0%, #4a6ec4 100%);
            color: #fff;
            font-weight: 600;
            box-shadow: 0 1px 2px rgba(45, 74, 120, 0.25);
        }

        .modal-text-editor-footer .btn-cancel:hover { background: #f0f2f8; }
        .modal-text-editor-footer .btn-apply:hover { filter: brightness(1.05); }

        @media (max-width: 768px) {
            .line-compare-page { padding: 0.65rem 0.65rem 1.5rem; }
            .line-compare-controls {
                flex-direction: column;
                align-items: stretch;
            }
            .line-compare-controls .control-group {
                justify-content: space-between;
            }
        }

.shell-main.line-compare-page-shell {
  margin: 0;
  padding: 0;
  border: none;
  box-shadow: none;
  border-radius: 0;
  background: transparent;
}

body[data-shell-active] .shell-main.line-compare-page-shell {
  padding: 0;
}

.shell-main.line-compare-page-shell .tool-page-header,
.shell-main.line-compare-page-shell .tool-lead {
  display: none;
}

