/* Body text keeps document geometry; the live caret/selection stays native. */
.flow-text-body{position:absolute;transform-origin:0 0;z-index:15;background:transparent;pointer-events:auto;box-sizing:border-box;touch-action:auto}
.flow-text-content{width:100%;min-height:inherit;margin:0;padding:0;outline:none;border:0;background:transparent;white-space:pre-wrap;overflow-wrap:break-word;word-break:normal;user-select:text;-webkit-user-select:text;cursor:text;touch-action:auto;caret-color:currentColor;font-kerning:normal}
.flow-text-content[data-empty=true]:before{position:absolute;content:attr(data-placeholder);color:#89998b;pointer-events:none;font:18px/1.3 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.flow-text-content .flow-paragraph{margin:0;padding:0;box-sizing:border-box;white-space:pre-wrap;overflow-wrap:break-word}
/* A small writing bar stays visible; the arrow reveals the labelled page tools. */
.inline-text-format.flow-text-format{display:flex;flex-direction:column-reverse;align-items:stretch;width:max-content;max-width:min(660px,calc(100vw - 24px));padding:5px;gap:0;overflow:visible;border-radius:13px;box-shadow:0 6px 24px #14231c1c;touch-action:auto}
.flow-text-compact{display:flex;align-items:center;gap:4px;min-width:0}
.flow-text-primary{display:flex;align-items:center;gap:3px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;min-width:0;touch-action:pan-x}
.flow-text-format .flow-text-compact button,.flow-text-format .flow-text-compact select,.flow-text-format .flow-text-compact input{min-height:32px;height:32px;border-radius:7px;font-size:12px;padding:4px 6px;flex-shrink:0}
.flow-text-format .flow-text-compact button{width:32px;font-size:15px}
.flow-text-format .flow-text-compact [data-text-field=fontFamily]{max-width:158px;width:140px;font-size:12px}
.flow-text-format .flow-text-compact [data-text-field=fontSize]{width:48px;font-size:14px;padding-right:1px}
.flow-text-format .flow-text-compact input[type=color]{width:28px;padding:5px}
.flow-text-separator{width:1px;height:18px;background:var(--theme-line,#d6ddd4);margin:0 3px;flex-shrink:0}
.flow-text-format .flow-text-more{display:grid;place-items:center;margin-left:2px;border-left:1px solid var(--theme-line,#d6ddd4);background:transparent;flex-shrink:0}
.flow-text-more svg{transition:transform .15s ease}
.flow-text-format[data-expanded=true] .flow-text-more svg{transform:rotate(180deg)}
.flow-text-format .flow-text-compact .text-done{position:static;box-shadow:none;width:32px;font-size:18px}
.flow-text-format:has(.flow-text-settings:not([hidden])){width:min(610px,calc(100vw - 24px))}
.flow-text-settings{width:100%;max-height:var(--flow-settings-max-height,65dvh);overflow-y:auto;overscroll-behavior-y:contain;touch-action:pan-y;box-sizing:border-box;padding:10px 9px 12px;border-bottom:1px solid var(--theme-line,#d6ddd4);margin-bottom:5px;scrollbar-width:thin}
.flow-text-settings[hidden]{display:none!important}
.flow-text-settings-heading{display:flex;flex-direction:column;gap:3px;padding:0 1px 10px}
.flow-text-settings-heading strong{font-size:14px;font-weight:600;color:var(--theme-ink,#28372f)}
.flow-text-settings-heading>span{font-size:11px;color:var(--theme-muted,#758173)}
.flow-text-section{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px;padding:12px 0 14px;margin:0;border:0;border-top:1px solid var(--theme-line,#d6ddd4);min-width:0}
.flow-text-section legend{padding:0 8px 0 0;font-size:12px;font-weight:600;color:var(--theme-ink,#28372f)}
.flow-text-field{display:flex;flex-direction:column;gap:5px;font-size:11px;color:var(--theme-muted,#758173);min-width:0}
.flow-text-format .flow-text-settings select,.flow-text-format .flow-text-settings input[type=number]{height:34px;min-height:34px;width:100%;max-width:none;box-sizing:border-box;font-size:13px;border:1px solid var(--theme-line,#d6ddd4);border-radius:7px;background:var(--theme-panel-soft,#edf2e6);color:var(--theme-ink,#28372f);padding:5px 8px}
.flow-text-paragraph-actions{display:flex;gap:5px;grid-column:1/-1}
.flow-text-format .flow-text-paragraph-actions button{height:32px;min-height:32px;width:40px;font-size:15px}
.flow-text-margin-presets{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;grid-column:1/-1}
.flow-text-format .flow-text-margin-presets button{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;width:auto;height:auto;min-height:54px;padding:8px;text-align:left;font-size:11px;white-space:normal;border:1px solid transparent}
.flow-text-margin-presets small{font-size:10px;opacity:.7}
.flow-text-format .flow-text-margin-presets [aria-pressed=true]{border-color:var(--theme-accent,#7a9976);box-shadow:none}
.flow-text-margin-edges{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;grid-column:1/-1}
.flow-text-numbering-switch{display:flex;align-items:center;gap:8px;grid-column:1/-1;font-size:12px;color:var(--theme-ink,#28372f)}
.flow-text-format .flow-text-numbering-switch input{width:15px;height:15px;min-height:0;margin:0;accent-color:var(--theme-accent,#56764d)}
.flow-text-format input:disabled,.flow-text-format select:disabled{opacity:.45}
.flow-text-format button:focus-visible,.flow-text-format select:focus-visible,.flow-text-format input:focus-visible{outline:2px solid var(--theme-accent,#7a9976);outline-offset:2px}
@media(max-width:680px){.inline-text-format.flow-text-format{left:8px;right:auto;max-width:calc(100vw - 16px);width:calc(100vw - 16px);transform:none;padding:4px;border-radius:12px}.flow-text-format .flow-text-compact button,.flow-text-format .flow-text-compact select,.flow-text-format .flow-text-compact input{height:38px;min-height:38px}.flow-text-format .flow-text-compact [data-text-field=fontFamily]{width:104px;max-width:104px}.flow-text-format .flow-text-compact [data-text-field=fontSize]{width:45px;font-size:16px}.flow-text-format .flow-text-settings input[type=number],.flow-text-format .flow-text-settings select{font-size:16px;height:38px;min-height:38px}.flow-text-format .flow-text-numbering-switch input{height:17px;min-height:0}.flow-text-settings{padding:9px 7px}.flow-text-margin-edges{grid-template-columns:repeat(2,minmax(0,1fr))}.flow-text-format .flow-text-margin-presets button{min-height:58px;font-size:10px}.flow-text-format .flow-text-compact .text-done{height:38px;min-height:38px;width:34px}.flow-text-format:has(.flow-text-settings:not([hidden])){width:calc(100vw - 16px)}}
@media(prefers-reduced-motion:reduce){.flow-text-more svg{transition:none}}
.flow-text-font-notice{font-size:10px;line-height:1.45;color:var(--theme-muted,#758173);margin:0 1px 12px;max-width:52ch}
/* Paper gestures scale the document while the writing controls stay fixed. */
.flow-text-content,.inline-text-content{touch-action:none}
.inline-text-format .text-paper-zoom{display:flex;align-items:center;gap:2px;flex:0 0 auto;padding-left:4px;border-left:1px solid var(--theme-line,#d6ddd4)}
.inline-text-format .text-paper-zoom button{width:28px;padding:3px;min-width:0}
.inline-text-format .text-paper-zoom [data-text-zoom=fit]{width:45px;font-size:11px;font-variant-numeric:tabular-nums}
@media(max-width:680px){.inline-text-format .text-paper-zoom button{width:28px}.inline-text-format .text-paper-zoom [data-text-zoom=fit]{width:43px}}
