﻿/*_______________________________________________________________________________________________________________
 * |                                                                                                             |
 * |  ████████╗  ██████╗   ██████╗  ██╗      ███╗   ██╗ ███████╗ ███████╗ ████████╗        ███╗   ███╗ ██████╗   |
 * |  ╚══██╔══╝ ██╔═══██╗ ██╔═══██╗ ██║      ████╗  ██║ ██╔════╝ ██╔════╝ ╚══██╔══╝        ████╗ ████║ ██╔══██╗  |
 * |     ██║    ██║   ██║ ██║   ██║ ██║      ██╔██╗ ██║ █████╗   ███████╗    ██║    █████╗ ██╔████╔██║ ██████╔╝  |
 * |     ██║    ██║   ██║ ██║   ██║ ██║      ██║╚██╗██║ ██╔══╝   ╚════██║    ██║    ╚════╝ ██║╚██╔╝██║ ██╔═══╝   |
 * |     ██║    ╚██████╔╝ ╚██████╔╝ ███████╗ ██║ ╚████║ ███████╗ ███████║    ██║           ██║ ╚═╝ ██║ ██║       |
 * |     ╚═╝     ╚═════╝   ╚═════╝  ╚══════╝ ╚═╝  ╚═══╝ ╚══════╝ ╚══════╝    ╚═╝           ╚═╝     ╚═╝ ╚═╝       |
 * |                                                                                                             |
 * |    ███╗   ███╗  █████╗  ███╗   ███╗ ███████╗ ██████╗  ██╗ ███╗   ██╗      ██████╗  ██████╗  ███╗   ███╗     |
 * |    ████╗ ████║ ██╔══██╗ ████╗ ████║ ██╔════╝ ██╔══██╗ ██║ ████╗  ██║     ██╔════╝ ██╔═══██╗ ████╗ ████║     |
 * |    ██╔████╔██║ ███████║ ██╔████╔██║ █████╗   ██████╔╝ ██║ ██╔██╗ ██║     ██║      ██║   ██║ ██╔████╔██║     |
 * |    ██║╚██╔╝██║ ██╔══██║ ██║╚██╔╝██║ ██╔══╝   ██╔═══╝  ██║ ██║╚██╗██║     ██║      ██║   ██║ ██║╚██╔╝██║     |
 * |    ██║ ╚═╝ ██║ ██║  ██║ ██║ ╚═╝ ██║ ███████╗ ██║      ██║ ██║ ╚████║ ██╗ ╚██████╗ ╚██████╔╝ ██║ ╚═╝ ██║     |
 * |    ╚═╝     ╚═╝ ╚═╝  ╚═╝ ╚═╝     ╚═╝ ╚══════╝ ╚═╝      ╚═╝ ╚═╝  ╚═══╝ ╚═╝  ╚═════╝  ╚═════╝  ╚═╝     ╚═╝     |
 * |                                                                                                             |
 * |                                                                                                             |
 * |                                 (C) 2021- mamepin.com - ALL RIGHTS RESERVED                                 |
 * |                                         Unauthorized use prohibited                                         |
 * |_____________________________________________________________________________________________________________|
 */

.tnm-tool-text-editor {
	--tnm-bg: #f2f2f2;
	--tnm-panel: rgba(255, 255, 255, 0.92);
	--tnm-text: #111111;
	--tnm-muted: #5c5c5c;
	--tnm-border: rgba(17, 17, 17, 0.12);
	--tnm-accent: #111111;
	--tnm-accent-strong: #000000;
	--tnm-danger: #3b3b3b;
	--tnm-alert: #c62828;
	--tnm-radius-frame: 8px;
	--tnm-radius-panel: 8px;
	--tnm-radius-control: 6px;
	--tnm-radius-icon: 8px;
	--tnm-radius-tight: 4px;
	--tnm-shadow: 0 20px 45px rgba(0, 0, 0, 0.08);
	background:
		radial-gradient(circle at top left, rgba(0, 0, 0, 0.05), transparent 32%),
		linear-gradient(160deg, #fbfbfb 0%, #efefef 100%);
	color: var(--tnm-text);
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-frame);
	box-shadow: var(--tnm-shadow);
	margin-top: 1.25em;
	padding: 16px;
}

.tnm-tool-text-editor[data-theme="dark"] {
	--tnm-bg: #111111;
	--tnm-panel: rgba(22, 22, 22, 0.94);
	--tnm-text: #f5f5f5;
	--tnm-muted: #b6b6b6;
	--tnm-border: rgba(255, 255, 255, 0.12);
	--tnm-accent: #f5f5f5;
	--tnm-accent-strong: #ffffff;
	--tnm-danger: #d6d6d6;
	--tnm-alert: #ff8a80;
	--tnm-shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
	background:
		radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 32%),
		linear-gradient(160deg, #171717 0%, #090909 100%);
}

.tnm-editor-header,
.tnm-toolbar,
.tnm-panel-grid,
.tnm-status-bar {
	display: flex;
	gap: 8px;
}

.tnm-editor-header {
	align-items: flex-start;
	justify-content: space-between;
	flex-wrap: wrap;
	margin-bottom: 7px;
}

.tnm-editor-title {
	margin: 0;
	font-size: 1.7rem;
	line-height: 1.2;
}

.tnm-editor-tagline {
	margin: 4px 0 0;
	color: var(--tnm-muted);
}

.tnm-toolbar {
	align-items: stretch;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: flex-end;
}

.tnm-toolbar-group {
	align-items: stretch;
	display: flex;
	gap: 5px;
	position: relative;
	padding-right: 8px;
	margin-right: 2px;
}

.tnm-toolbar-group::after {
	content: "";
	position: absolute;
	top: 4px;
	right: 0;
	bottom: 4px;
	width: 1px;
	background: var(--tnm-border);
}

.tnm-toolbar-group:last-child {
	margin-right: 0;
	padding-right: 0;
}

.tnm-toolbar-group:last-child::after {
	display: none;
}

.tnm-toolbar-button,
.tnm-panel input[type="text"],
.tnm-panel input[type="email"],
.tnm-panel input[type="range"],
.tnm-panel select,
	.tnm-save-state-form input[type="text"],
.tnm-editor-input {
	font: inherit;
}

.tnm-toolbar-button {
	align-items: center;
	appearance: none;
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-control);
	background: var(--tnm-panel);
	box-sizing: border-box;
	color: var(--tnm-text);
	cursor: pointer;
	display: inline-flex;
	font-size: 0.8rem;
	justify-content: center;
	min-height: 34px;
	min-width: 5.8rem;
	padding: 5px 8px;
	text-align: center;
	white-space: nowrap;
	text-decoration: none;
	transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.tnm-toolbar-button:hover {
	border-color: var(--tnm-accent);
	transform: translateY(-1px);
}

.tnm-toolbar-button:disabled {
	cursor: default;
	opacity: 0.45;
	transform: none;
	border-color: var(--tnm-border);
}

.tnm-toolbar-button:disabled:hover {
	transform: none;
	border-color: var(--tnm-border);
}

.tnm-toolbar-button-primary {
	background: var(--tnm-accent);
	border-color: var(--tnm-accent);
	color: var(--tnm-bg);
}

.tnm-toolbar-button-primary:hover {
	background: var(--tnm-accent-strong);
}

.tnm-toolbar-button-primary:disabled,
.tnm-toolbar-button-primary:disabled:hover {
	background: var(--tnm-accent);
	border-color: var(--tnm-accent);
	color: var(--tnm-bg);
	opacity: 1;
}

.tnm-toolbar-button-ghost,
.tnm-toolbar-button-ghost:hover,
.tnm-toolbar-button-ghost:disabled,
.tnm-toolbar-button-ghost:disabled:hover {
	background: #fff;
	border-color: var(--tnm-border);
	color: var(--tnm-text);
	opacity: 1;
}

.tnm-toolbar-button-ghost:hover {
	border-color: var(--tnm-accent);
}

.tnm-toolbar-button-symbol {
	font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif;
}

.tnm-help-button {
	appearance: none;
	width: 38px;
	height: 38px;
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-icon);
	background: transparent;
	color: var(--tnm-text);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tnm-help-button:hover {
	border-color: var(--tnm-accent);
	background: rgba(255, 255, 255, 0.5);
	transform: translateY(-1px);
}

.tnm-help-button-inline {
	width: auto;
	height: 28px;
	min-width: 28px;
	padding: 0 10px;
	font-size: 0.78rem;
	font-weight: 400;
}

.tnm-toolbar-button-danger {
	border-color: rgba(17, 17, 17, 0.24);
	color: var(--tnm-danger);
}

.tnm-hidden-input {
	display: none;
}

.tnm-panel-wrap {
	display: grid;
	gap: 8px;
	margin-bottom: 6px;
}

.tnm-panel {
	display: none;
	background: var(--tnm-panel);
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-panel);
	padding: 10px;
	font-size: 0.82rem;
	backdrop-filter: blur(14px);
}

.tnm-state-history {
	display: grid;
	gap: 6px;
}

.tnm-state-history-empty {
	margin: 0;
	color: var(--tnm-muted);
}

.tnm-state-history-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-control);
	background: rgba(255, 255, 255, 0.62);
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-state-history-item {
	background: rgba(255, 255, 255, 0.03);
}

.tnm-state-history-meta {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.tnm-state-history-time,
.tnm-state-history-preview {
	font-size: 0.82rem;
}

.tnm-state-history-actions {
	display: flex;
	gap: 6px;
	flex-wrap: nowrap;
	justify-content: flex-end;
}

.tnm-state-history-actions .tnm-toolbar-button {
	flex: 0 0 auto;
}

.tnm-state-history-meta strong,
.tnm-state-history-meta span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.tnm-state-history-meta span {
	color: var(--tnm-muted);
}

.tnm-panel.is-open {
	display: block;
}


.tnm-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 6px;
}

.tnm-panel-header h3 {
	margin: 0 0 4px;
	font-size: 0.92rem;
	letter-spacing: 0.03em;
}

.tnm-panel-close {
	appearance: none;
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-icon);
	background: transparent;
	color: var(--tnm-muted);
	width: 30px;
	height: 30px;
	padding: 0;
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
	transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.tnm-panel-close:hover {
	border-color: var(--tnm-accent);
	color: var(--tnm-text);
	background: rgba(255, 255, 255, 0.46);
}

.tnm-panel-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 8px;
	align-items: start;
}

.tnm-search-current-line {
	margin: 0;
	color: var(--tnm-muted);
	font-size: 0.8rem;
}

.tnm-search-status {
	display: grid;
	grid-column: 1 / -1;
	gap: 2px;
}

.tnm-history-controls {
	margin-bottom: 8px;
	grid-template-columns: max-content;
	justify-content: end;
}

.tnm-panel .tnm-history-controls label {
	display: flex;
	align-items: center;
	gap: 8px;
	width: max-content;
}

.tnm-panel .tnm-history-controls select {
	width: auto;
	min-width: 0;
}

.tnm-panel .tnm-history-controls span {
	white-space: nowrap;
}

.tnm-panel-options {
	display: grid;
	gap: 1px;
	grid-column: 1 / -1;
	justify-items: start;
}

.tnm-panel label {
	display: grid;
	gap: 4px;
	min-width: 0;
	font-weight: 500;
}

.tnm-field-label-with-action {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.tnm-field-label-with-action > span {
	min-width: 0;
}
.tnm-save-state-form label {
	display: grid;
	gap: 4px;
	min-width: 0;
	font-weight: 500;
}

.tnm-panel label.tnm-check-row {
	display: flex;
	flex-direction: row;
	align-items: center;
	align-self: center;
	gap: 6px;
	min-height: 24px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	font-weight: 400;
}
.tnm-save-state-form label.tnm-check-row {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	min-height: 0;
	padding: 2px 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	font-weight: 400;
	cursor: pointer;
}

.tnm-check-row span {
	min-width: 0;
	line-height: 1.4;
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-check-row {
	background: transparent;
}

.tnm-panel input[type="text"],
.tnm-panel input[type="email"],
	.tnm-panel input[type="number"],
.tnm-panel input[type="range"],
.tnm-panel select,
	.tnm-save-state-form input[type="text"],
	.tnm-save-state-form input[type="email"] {
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-control);
	background: rgba(255, 255, 255, 0.82);
	color: var(--tnm-text);
	min-height: 32px;
	padding: 6px 8px;
	width: 100%;
	box-sizing: border-box;
}

.tnm-panel input[type="range"] {
	padding: 0;
	accent-color: var(--tnm-accent);
}

.tnm-panel input[type="checkbox"] {
	appearance: none;
	width: 18px;
	height: 18px;
	margin: 0 !important;
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-tight);
	background: #ffffff;
	position: relative;
	flex: 0 0 18px;
	cursor: pointer;
}

.tnm-panel input[type="checkbox"]:checked {
	background: var(--tnm-accent);
	border-color: var(--tnm-accent);
}

.tnm-panel input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 4px;
	height: 9px;
	border: solid var(--tnm-bg);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-panel input[type="text"],
.tnm-tool-text-editor[data-theme="dark"] .tnm-panel input[type="email"],
	.tnm-tool-text-editor[data-theme="dark"] .tnm-panel input[type="number"],
.tnm-tool-text-editor[data-theme="dark"] .tnm-panel input[type="range"],
	.tnm-tool-text-editor[data-theme="dark"] .tnm-panel select,
	.tnm-tool-text-editor[data-theme="dark"] .tnm-save-state-form input[type="text"],
	.tnm-tool-text-editor[data-theme="dark"] .tnm-save-state-form input[type="email"] {
	background: rgba(10, 10, 10, 0.88);
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-panel input[type="checkbox"] {
	background: #101010;
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-save-state-form input[type="checkbox"] {
	background: #101010;
}

.tnm-panel-grid > .tnm-toolbar-button {
	align-self: end;
	min-height: 34px;
	justify-self: start;
}

.tnm-panel-actions {
	display: grid;
	gap: 6px;
	grid-column: 1 / -1;
}

.tnm-panel-actions-stack {
	display: grid;
	gap: 6px;
	grid-column: 1 / -1;
	width: min(100%, 19.2rem);
}

.tnm-panel-actions-row {
	grid-column: auto;
	width: 100%;
}

.tnm-panel-actions-row-nav {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tnm-panel-actions-row-search-nav {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	width: min(100%, 12.8rem);
}

.tnm-panel-actions-row-apply {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tnm-replace-summary {
	grid-column: 1 / -1;
	margin: 0;
	color: var(--tnm-muted);
	font-size: 0.82rem;
}

.tnm-search-summary {
	display: flex;
	align-items: baseline;
	gap: 6px;
	flex-wrap: wrap;
}

.tnm-search-summary-note {
	color: var(--tnm-alert);
	font-weight: 600;
}

.tnm-replace-result-log {
	display: grid;
	gap: 6px;
}

.tnm-replace-result-title {
	margin: 0;
	font-size: 0.82rem;
	font-weight: 600;
}

.tnm-replace-result-summary {
	margin: 0 0 8px;
}

.tnm-replace-result-head {
	display: none;
}

.tnm-replace-result-list {
	display: grid;
	gap: 6px;
	max-height: min(62vh, 640px);
	overflow: auto;
	padding-right: 4px;
}

.tnm-replace-result-item {
	display: grid;
	gap: 6px;
	padding: 8px 10px;
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-control);
	background: rgba(255, 255, 255, 0.62);
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-replace-result-item {
	background: rgba(255, 255, 255, 0.03);
}

.tnm-replace-result-line {
	margin: 0;
	font-weight: 600;
}

.tnm-replace-result-fields {
	display: grid;
	gap: 6px;
}

.tnm-replace-result-field {
	display: grid;
	gap: 3px;
}

.tnm-replace-result-label {
	color: var(--tnm-muted);
	font-size: 0.76rem;
}

.tnm-replace-result-value {
	margin: 0;
	padding: 6px 8px;
	border-radius: var(--tnm-radius-tight);
	background: rgba(17, 17, 17, 0.04);
	font-family: "Consolas", "Courier New", monospace;
	font-size: 0.78rem;
	white-space: pre-wrap;
	word-break: break-word;
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-replace-result-value {
	background: rgba(255, 255, 255, 0.06);
}

.tnm-replace-result-dialog {
	width: 100%;
	max-width: none;
}

.tnm-replace-result-actions {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--tnm-border);
}

.tnm-editor-shell {
	display: grid;
	grid-template-columns: calc(var(--tnm-line-number-digits, 3) * 1ch + 18px) minmax(0, 1fr);
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-panel);
	overflow: hidden;
	background: var(--tnm-panel);
	min-height: 52vh;
	position: relative;
}

.tnm-editor-stage {
	position: relative;
	min-width: 0;
	min-height: 52vh;
	isolation: isolate;
}

.tnm-floating-panel {
	position: fixed;
	top: 12px;
	left: 12px;
	max-width: calc(100vw - 16px);
	max-height: calc(100vh - 16px);
	z-index: 9999;
	touch-action: none;
}

.tnm-floating-panel.tnm-panel {
	width: min(420px, calc(100vw - 16px));
	overflow: auto;
	padding: 12px;
	box-sizing: border-box;
	background: rgba(255, 255, 255, 0.98);
	backdrop-filter: none;
	box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
}

.tnm-floating-panel[data-panel="search"] {
	width: min(360px, calc(100vw - 16px));
}

.tnm-floating-panel[data-panel="history"] {
	width: min(640px, calc(100vw - 16px));
}

.tnm-floating-panel[data-panel="replace"],
.tnm-floating-panel[data-panel="settings"] {
	width: min(420px, calc(100vw - 16px));
}

.tnm-floating-panel.tnm-popup-window {
	overflow: visible;
	padding: 0;
	background: #ffffff;
	box-shadow: none;
	border: 0;
	box-sizing: border-box;
}

.tnm-floating-panel.tnm-popup-window[data-popup="save-state"],
.tnm-floating-panel.tnm-popup-window[data-popup="save-file"],
.tnm-floating-panel.tnm-popup-window[data-popup="clear-confirm"] {
	width: min(420px, calc(100vw - 16px));
}

.tnm-floating-panel.tnm-popup-window[data-popup="mail"] {
	width: min(520px, calc(100vw - 16px));
}

.tnm-floating-panel.tnm-popup-window[data-popup="replace-result"] {
	width: min(960px, calc(100vw - 16px));
}

.tnm-floating-panel.tnm-popup-window .tnm-save-state-dialog {
	width: 100%;
	max-width: none;
	max-height: calc(100vh - 16px);
	overflow: auto;
	box-sizing: border-box;
	background: #ffffff;
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-floating-panel.tnm-panel {
	background: rgba(18, 18, 18, 0.96);
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-floating-panel.tnm-popup-window,
.tnm-tool-text-editor[data-theme="dark"] .tnm-floating-panel.tnm-popup-window .tnm-save-state-dialog {
	background: #161616;
}

@media (min-width: 641px) {
	.tnm-replace-result-head {
		display: grid;
		grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr);
		gap: 10px;
		padding: 0 10px 6px;
		color: var(--tnm-muted);
		font-size: 0.76rem;
		font-weight: 600;
	}

	.tnm-replace-result-item {
		grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr);
		align-items: center;
	}

	.tnm-replace-result-fields {
		grid-column: 2 / -1;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: center;
	}

	.tnm-replace-result-line {
		grid-column: 1;
		grid-row: 1;
	}

	.tnm-replace-result-label {
		display: none;
	}

	.tnm-replace-result-dialog .tnm-panel-header,
	.tnm-replace-result-dialog .tnm-save-state-help {
		max-width: none;
	}
}

.tnm-panel-drag-handle {
	cursor: grab;
	user-select: none;
	touch-action: none;
	padding: 8px 10px;
	margin: -4px -4px 10px;
	border: 1px dashed rgba(17, 17, 17, 0.18);
	border-radius: var(--tnm-radius-control);
	background: linear-gradient(135deg, rgba(17, 17, 17, 0.12), rgba(17, 17, 17, 0.04));
}

.tnm-floating-panel.is-dragging .tnm-panel-drag-handle {
	cursor: grabbing;
	border-color: rgba(17, 17, 17, 0.32);
	background: linear-gradient(135deg, rgba(17, 17, 17, 0.18), rgba(17, 17, 17, 0.08));
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-panel-drag-handle {
	border-color: rgba(255, 255, 255, 0.2);
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-floating-panel.is-dragging .tnm-panel-drag-handle {
	border-color: rgba(255, 255, 255, 0.34);
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
}

.tnm-line-numbers {
	display: block;
	gap: 0;
	overflow: hidden;
	padding: 12px 6px 12px 8px;
	border-right: 1px solid var(--tnm-border);
	color: var(--tnm-muted);
	text-align: right;
	line-height: 1.6;
	font-variant-numeric: tabular-nums;
	user-select: none;
	white-space: nowrap;
}

.tnm-line-numbers span {
	display: block;
	min-height: 1.6em;
}

.tnm-line-measure {
	position: absolute;
	left: 0;
	top: 0;
	visibility: hidden;
	pointer-events: none;
	white-space: pre-wrap;
	overflow-wrap: break-word;
	box-sizing: border-box;
	padding: 0;
	z-index: -1;
}

.tnm-line-measure-row {
	min-height: 1.6em;
	box-sizing: border-box;
}

.tnm-editor-input {
	position: relative;
	z-index: 1;
	width: 100%;
	box-sizing: border-box;
	min-height: 52vh;
	height: 52vh;
	border: 0;
	background: transparent;
	color: var(--tnm-text);
	line-height: 1.6;
	outline: none;
	resize: none;
	padding: 12px 14px;
	tab-size: 2;
	overflow-wrap: break-word;
	overflow-y: hidden;
	overflow-x: auto;
	caret-color: var(--tnm-text);
}

.tnm-editor-overlay {
	position: absolute;
	inset: 0;
	z-index: 0;
	margin: 0;
	padding: 12px 14px;
	box-sizing: border-box;
	border: 0;
	pointer-events: none;
	color: transparent;
	line-height: 1.6;
	tab-size: 2;
	white-space: pre-wrap;
	overflow-wrap: break-word;
	overflow: hidden;
	font-family: inherit;
	font-size: inherit;
}

.tnm-overlay-active .tnm-editor-input {
	color: transparent;
	-webkit-text-fill-color: transparent;
}

.tnm-overlay-active .tnm-editor-input::selection {
	background: rgba(120, 170, 255, 0.28);
	color: transparent;
}

.tnm-overlay-active .tnm-editor-overlay {
	z-index: 2;
	color: var(--tnm-text);
}

.tnm-editor-match {
	padding: 0;
	border-radius: 3px;
	background: rgba(255, 214, 102, 0.85);
	box-shadow: 0 0 0 1px rgba(191, 129, 0, 0.24);
	color: inherit;
}

.tnm-editor-match.is-active {
	background: rgba(255, 176, 32, 0.96);
	box-shadow: 0 0 0 1px rgba(148, 86, 0, 0.34);
}

.tnm-editor-match-empty {
	display: inline-block;
	min-width: 0.45em;
	outline: 1px dashed rgba(191, 129, 0, 0.7);
	outline-offset: -1px;
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-editor-match {
	background: rgba(255, 196, 92, 0.34);
	box-shadow: 0 0 0 1px rgba(255, 196, 92, 0.3);
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-editor-match.is-active {
	background: rgba(255, 176, 32, 0.52);
	box-shadow: 0 0 0 1px rgba(255, 196, 92, 0.48);
}

.tnm-show-whitespace .tnm-whitespace-marker {
	display: inline-block;
	position: relative;
	text-align: center;
	color: transparent;
}

.tnm-show-whitespace .tnm-whitespace-marker::after {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(17, 17, 17, 0.36);
	pointer-events: none;
}

.tnm-tool-text-editor[data-theme="dark"].tnm-show-whitespace .tnm-whitespace-marker {
	color: transparent;
}

.tnm-tool-text-editor[data-theme="dark"].tnm-show-whitespace .tnm-whitespace-marker::after {
	color: rgba(255, 255, 255, 0.32);
}

.tnm-whitespace-space,
.tnm-whitespace-full {
	width: auto;
}

.tnm-whitespace-space::after {
	content: '·';
}

.tnm-whitespace-full::after {
	content: '□';
	font-size: 0.78em;
}

.tnm-whitespace-tab {
	width: 2ch;
}

.tnm-whitespace-tab::after {
	content: '→';
	justify-content: flex-start;
	padding-left: 0.3em;
	font-family: "Segoe UI Symbol", "Yu Gothic UI", sans-serif;
}

.tnm-whitespace-newline {
	width: 0;
	overflow: visible;
	vertical-align: baseline;
}

.tnm-whitespace-newline::after {
	content: '↵';
	inset: auto;
	left: 0;
	bottom: 0.1em;
	width: auto;
	display: block;
	transform: translateX(0.35em);
	line-height: 1;
	font-family: "Segoe UI Symbol", "Yu Gothic UI", sans-serif;
}

.tnm-status-bar {
	justify-content: space-between;
	flex-wrap: wrap;
	margin-top: 10px;
	color: var(--tnm-muted);
	font-size: 0.9rem;
}

.tnm-help-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: grid;
	place-items: center;
	padding: 18px;
	background: rgba(17, 17, 17, 0.52);
	backdrop-filter: blur(6px);
}

.tnm-help-modal[hidden],
.tnm-save-state-modal[hidden] {
	display: none !important;
}

.tnm-help-dialog {
	width: min(960px, 100%);
	max-height: min(80vh, 920px);
	overflow: auto;
	padding: 14px;
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-frame);
	background: var(--tnm-panel);
	box-shadow: var(--tnm-shadow);
	font-size: 0.82rem;
}

.tnm-save-state-dialog {
	width: 100%;
	max-width: 100%;
	padding: 14px;
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-frame);
	background: var(--tnm-panel);
	box-shadow: var(--tnm-shadow);
	font-size: 0.82rem;
}

.tnm-save-state-form {
	display: grid;
	gap: 8px;
}

.tnm-save-state-form label {
	display: grid;
	gap: 4px;
	font-weight: 500;
}

.tnm-mail-dialog {
	width: min(520px, 100%);
}

.tnm-mail-form {
	gap: 10px;
}

.tnm-mail-options {
	display: grid;
	gap: 8px;
	padding: 2px 0;
}

.tnm-mail-method-label {
	display: block;
	margin-bottom: 8px;
}

.tnm-mail-form input[type="checkbox"] {
	margin: 0 !important;
	vertical-align: middle;
}

.tnm-save-state-help {
	margin: 0 0 10px;
	color: var(--tnm-muted);
	line-height: 1.5;
	font-size: 0.82rem;
}

.tnm-confirm-copy {
	margin: 0;
	color: var(--tnm-muted);
	line-height: 1.6;
	font-size: 0.84rem;
}

.tnm-save-state-actions {
	display: flex;
	justify-content: flex-end;
	gap: 6px;
	flex-wrap: wrap;
}

.tnm-settings-actions {
	grid-column: 1 / -1;
	justify-items: end;
}

.tnm-help-intro,
.tnm-help-example-item p,
.tnm-help-example-note {
	margin: 0;
	color: var(--tnm-muted);
	line-height: 1.5;
}

.tnm-help-examples {
	display: grid;
	gap: 8px;
}

.tnm-help-examples h4,
.tnm-help-example-item h5 {
	margin: 0;
}

.tnm-help-example-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 8px;
}

.tnm-help-example-item {
	appearance: none;
	display: grid;
	gap: 4px;
	padding: 10px;
	border: 1px solid var(--tnm-border);
	border-radius: var(--tnm-radius-control);
	background: rgba(255, 255, 255, 0.64);
	color: var(--tnm-text);
	cursor: pointer;
	font-family: Consolas, "Courier New", monospace;
	font-size: 0.82rem;
	text-align: left;
	transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tnm-help-example-item:hover,
.tnm-help-example-item:focus-visible {
	border-color: var(--tnm-accent);
	background: rgba(255, 255, 255, 0.82);
	transform: translateY(-1px);
	outline: none;
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-help-example-item {
	background: rgba(255, 255, 255, 0.04);
}

.tnm-tool-text-editor[data-theme="dark"] .tnm-help-example-item:hover,
.tnm-tool-text-editor[data-theme="dark"] .tnm-help-example-item:focus-visible {
	background: rgba(255, 255, 255, 0.09);
}

.tnm-hide-line-numbers .tnm-editor-shell {
	grid-template-columns: minmax(0, 1fr);
}

.tnm-hide-line-numbers .tnm-line-numbers {
	display: none;
}

.tnm-hide-status-bar .tnm-status-bar {
	display: none;
}

@media (max-width: 640px) {
	.tnm-editor-title,
	.tnm-editor-tagline {
		margin: 6px;
	}



	.page-content:has(.tnm-tool-text-editor) {
		margin: 0 !important;
		padding: 0 !important;
	}

	.page-content:has(.tnm-tool-text-editor) .tnm-tool-text-editor {
		margin-top: 1.25em;
	}

	.tnm-tool-text-editor {
		padding: 10px;
		margin-top: 1.25em;
	}

	.tnm-panel {
		padding: 10px;
	}

	.tnm-editor-shell {
		grid-template-columns: calc(var(--tnm-line-number-digits, 3) * 1ch + 14px) minmax(0, 1fr);
	}

	.tnm-line-numbers {
		padding: 10px 3px 10px 4px;
		font-size: 0.76rem;
	}

	.tnm-line-numbers span {
		box-sizing: border-box;
		padding-top: 1px;
	}

	.tnm-editor-input,
	.tnm-editor-overlay {
		padding: 10px 10px 10px 8px;
	}

	.tnm-toolbar {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		align-items: stretch;
		gap: 4px;
		overflow: visible;
		padding-bottom: 0;
	}

	.tnm-toolbar-group {
		display: contents;
		padding-right: 0;
		margin-right: 0;
	}

	.tnm-toolbar-group::after {
		display: none;
	}

	.tnm-toolbar-button,
	.tnm-help-button {
		min-width: 0;
		width: auto;
		min-height: 32px;
		padding: 4px 6px;
		font-size: 0.76rem;
		flex: 0 1 auto;
		text-align: center;
	}

	.tnm-toolbar-group > .tnm-toolbar-button:only-child,
	.tnm-toolbar-group > .tnm-help-button:only-child {
		grid-column: auto;
	}

	.tnm-panel-actions .tnm-toolbar-button {
		width: 100%;
	}

	.tnm-panel-actions {
		overflow: visible;
		padding-bottom: 0;
	}

	.tnm-panel-actions-stack {
		width: 100%;
		overflow: visible;
		padding-bottom: 0;
	}

	.tnm-panel-grid {
		grid-template-columns: 1fr;
	}

	.tnm-help-button-inline {
		width: auto;
	}

	.tnm-help-modal {
		padding: 12px;
	}

	.tnm-floating-panel.tnm-panel {
		width: calc(100vw - 16px);
		max-width: calc(100vw - 16px);
		padding: 10px;
	}

	.tnm-help-dialog {
		padding: 14px;
	}

	.tnm-help-example-list {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 800px) {
	.tnm-tool-text-editor {
		padding: 6px;
		border-radius: var(--tnm-radius-frame);
	}

	.tnm-state-history-item {
		align-items: flex-start;
		flex-direction: column;
	}

	.tnm-state-history-actions {
		width: 100%;
		justify-content: stretch;
	}

	.tnm-state-history-actions .tnm-toolbar-button {
		flex: 1 1 auto;
	}

	.tnm-panel label,
	.tnm-check-row {
		min-width: 100%;
	}

	.tnm-panel-grid > .tnm-toolbar-button {
		justify-self: stretch;
	}

	.tnm-toolbar {
		justify-content: flex-start;
	}
}
