/* Obrys — InDesign-style text UI (typeui.js) */
#text-editor.rich { color: transparent !important; caret-color: transparent; background: transparent !important; text-shadow: none !important; -webkit-text-fill-color: transparent; cursor: text; }
#text-editor.rich::selection { background: transparent; color: transparent; }
.ty-caret { animation: ty-blink 1.06s steps(1) infinite; }
@keyframes ty-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ty-caret { animation: none; } }

.ty-tabs { display: flex; gap: 2px; padding: 2px; background: var(--panel-2); border-radius: var(--r); margin: 2px 0 6px; }
.ty-tabs button { flex: 1 1 0; height: 26px; border: 0; border-radius: calc(var(--r) - 2px); background: transparent; color: var(--fg-2, var(--fg)); font: inherit; font-size: 11.5px; cursor: pointer; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ty-tabs button.on { background: var(--panel); color: var(--acc); box-shadow: 0 0 0 1px var(--line); }
.ty-style-row { gap: 6px; }
.ty-style-row .sel { flex: 1 1 0; min-width: 0; }
.ty-sizefld { padding-right: 2px; }
.ty-sizefld .sel { flex: 1 1 0; min-width: 0; height: 26px; border: 0; background: transparent; padding: 0 2px; }
.ty-ag { flex: 0 0 28px; height: 28px; display: grid; place-items: center; border-radius: var(--r); background: #fff; color: #111; font: 600 15px Georgia, 'Times New Roman', serif; border: 1px solid var(--line); }
.ty-selfld { padding-right: 0; }
.ty-selfld .sel { flex: 1 1 0; min-width: 0; background: transparent; height: 26px; border: 0; padding-left: 0; }
.ty-toggles { flex-wrap: wrap; gap: 2px; }
.ty-tb { width: auto; min-width: 26px; padding: 0 4px; font: 600 12px/1 var(--font, system-ui), sans-serif; letter-spacing: .02em; }
.ty-tbl { display: inline-block; white-space: nowrap; line-height: 1; }
.ty-tb small { font-size: 8px; }
.ty-tb sup, .ty-tb sub { font-size: 7px; }
.ty-align { flex-wrap: wrap; gap: 1px; }
.ty-align .ib { width: 26px; }
.ty-chkrow { min-height: 28px; }
.ty-chkrow input[type="color"], .ty-color input[type="color"] { width: 28px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: transparent; cursor: pointer; }
.ty-color { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--fg-2, var(--fg)); cursor: pointer; }
.ty-cols { gap: 4px; }
.ty-cols .ty-lab { flex: 1 1 auto; font-size: 11.5px; }
.ty-cols .ty-num { flex: 0 0 48px; padding: 0 6px; }
.ty-cols .ty-num input { text-align: center; }
.ty-wrap { flex-wrap: wrap; }
.ty-qas { display: grid; gap: 6px; }
.ty-qa { width: 100%; justify-content: center; text-align: center; }
.ty-note { gap: 6px; }
.ty-nl { flex: 0 0 22px; text-align: center; color: var(--fg-3); font-size: 11px; }
.ty-nin { flex: 1 1 0; min-width: 0; height: 26px; border: 1px solid transparent; background: var(--panel-2); border-radius: var(--r); padding: 0 6px; color: inherit; font: inherit; }
.ty-nin:focus { border-color: var(--acc); outline: none; }
section.ps.ty-flash { animation: ty-flash .9s ease-out; }
@keyframes ty-flash { 0% { background: var(--acc-soft); } 100% { background: transparent; } }

/* dialogs */
.ty-dlg-ta { display: grid !important; grid-template-columns: 1fr !important; gap: 6px; align-items: start !important; }
.ty-dlg-ta textarea { width: 100%; min-height: 84px; resize: vertical; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); color: inherit; box-sizing: border-box; }
.ty-dlg-ta textarea.ty-story { min-height: 320px; font-family: Georgia, 'Times New Roman', serif; font-size: 14px; line-height: 1.5; }
.ty-slist { display: grid; gap: 4px; max-height: 46vh; overflow: auto; margin-bottom: 8px; }
.ty-srow { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: var(--r); background: var(--panel-2); }
.ty-srow .ty-sname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ty-srow input[type="text"] { flex: 1 1 0; min-width: 0; height: 26px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: inherit; padding: 0 6px; }
.ty-rul { cursor: copy; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.ty-tabrows { display: grid; gap: 4px; margin: 6px 0; }
.ty-tabrow { display: grid; grid-template-columns: 80px 1fr 70px 28px; gap: 6px; align-items: center; }
.ty-tabrow input, .ty-tabrow select { height: 26px; min-width: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); color: inherit; padding: 0 6px; }
.ty-glyphs { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 3px; max-height: 50vh; overflow: auto; margin-top: 6px; }
.ty-glyphs button { height: 34px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); color: inherit; font-size: 18px; cursor: pointer; padding: 0; }
.ty-glyphs button:hover { border-color: var(--acc); background: var(--acc-soft); }
@media (max-width: 600px) {
  .ty-tabrow { grid-template-columns: 64px 1fr 56px 28px; }
  .ty-glyphs { grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); }
}
