.text-editor-dialog { width: 560px; max-width: calc(100% - 24px); max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 1px solid #a5aaad; border-radius: 6px; background: #f5f6f7; color: #202527; box-shadow: 0 12px 48px #0005; overflow: auto; font: 14px Arial, sans-serif; letter-spacing: 0; }
.text-editor-dialog::backdrop { background: #0005; }
.text-editor-dialog * { box-sizing: border-box; letter-spacing: 0; }
.text-editor-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid #ccd0d2; }
.text-editor-dialog h2 { font: bold 16px Arial, sans-serif; margin: 0; }
.text-editor-dialog form { display: grid; gap: 12px; padding: 16px; }
.text-editor-dialog label { display: grid; gap: 6px; font-size: 12px; }
.text-editor-format { display: grid; grid-template-columns: minmax(0,1fr) 100px; gap: 12px; }
.text-editor-dialog input, .text-editor-dialog select, .text-editor-dialog textarea { width: 100%; min-width: 0; border: 1px solid #abb2b5; border-radius: 3px; color: #202527; background: #fff; font: 14px Arial, sans-serif; }
.text-editor-dialog select, .text-editor-dialog input { height: 36px; padding: 6px 8px; }
.text-editor-dialog textarea { height: 240px; resize: vertical; padding: 12px; line-height: 1.22; overflow: auto; }
.text-editor-dialog textarea::placeholder { color: #777; opacity: 1; }
.text-editor-dialog button, .text-placement-tools button { min-height: 36px; padding: 6px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #b0b6b8; border-radius: 3px; color: #202527; background: #fff; font: 14px Arial, sans-serif; cursor: pointer; }
.text-editor-dialog button:hover, .text-placement-tools button:hover { background: #e5ecea; }
.text-editor-dialog :focus-visible, .text-placement-tools :focus-visible { outline: 2px solid #187c70; outline-offset: 2px; }
.text-editor-dialog button[aria-pressed="true"] { color: #0b5349; border-color: #167b6d; background: #d8eee8; box-shadow: inset 0 0 0 1px #167b6d; }
.text-editor-dialog svg, .text-placement-tools svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.text-editor-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.text-editor-toolbar > button, .text-editor-dialog header button { width: 36px; padding: 6px; }
.text-editor-colors { display: flex; gap: 6px; margin-left: auto; }
.text-editor-colors input[type="color"] { width: 40px; margin: 0; padding: 3px; cursor: pointer; }
.text-editor-colors input[type="text"] { width: 90px; font-family: monospace; }
.text-editor-meta { display: flex; gap: 12px; justify-content: space-between; font-size: 12px; color: #616a6e; min-height: 16px; }
#text-editor-error { color: #a52b23; }
#text-editor-count { white-space: nowrap; margin-left: auto; }
.text-editor-dialog footer { display: flex; gap: 8px; justify-content: flex-end; }
.text-editor-dialog .text-editor-primary { background: #126e60; border-color: #126e60; color: #fff; }
.text-editor-dialog .text-editor-primary:hover { background: #0c594e; }
.text-placement-tools { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 115; display: flex; gap: 6px; padding: 6px; border: 1px solid #92999d; background: #f3f4f5; box-shadow: 0 3px 12px #0003; border-radius: 4px; }
.text-placement-tools[hidden] { display: none; }
html.paint98-route .text-editor-dialog, html.paint98-route .text-placement-tools { border: 2px solid; border-color: #fff #555 #555 #fff; border-radius: 0; background: #c0c0c0; }
html.paint98-route .text-editor-dialog header { margin: 2px; padding: 4px 8px; background: #000080; color: #fff; }
html.paint98-route .text-editor-dialog button, html.paint98-route .text-placement-tools button { border-radius: 0; }
@media (max-width: 480px) { .text-editor-dialog form { padding: 12px; gap: 10px; } .text-editor-dialog input, .text-editor-dialog select { font-size: 16px; } .text-editor-dialog textarea { height: 200px; } .text-editor-format { grid-template-columns: minmax(0,1fr) 90px; gap: 8px; } }
