/* styles of js/patterns/text-helpers.js and js/patterns/text/*.js (all rules start with .th-, so they work in Simple and in the list forms). Logical properties only (RTL-safe). */
.th-row{display:flex;gap:6px;align-items:stretch;}
.th-row>input,.th-row>textarea{flex:1 1 auto;min-width:0;}
.th-btn{min-height:40px;padding:0 12px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);border-radius:9px;font:inherit;font-size:12.5px;font-weight:700;cursor:pointer;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center;}
.th-btn:hover{border-color:var(--border-strong);}
.th-btn.th-icon{min-width:44px;padding:0;}
.th-btn.ghost{background:transparent;}
.th-btn[hidden]{display:none;}
.th-block{margin-block-start:8px;display:flex;flex-direction:column;gap:8px;align-items:flex-start;}
.th-block>*{max-inline-size:100%;}
.th-cap{font-size:11.5px;font-weight:700;color:var(--text-faint);margin-inline-end:8px;}
.th-pills{display:flex;flex-wrap:wrap;gap:6px;}
.th-pill{min-height:40px;padding:0 13px;border-radius:99px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer;display:inline-flex;align-items:center;gap:6px;}
.th-pill:hover{border-color:var(--border-strong);}
.th-pill.on,.th-pill[aria-pressed="true"]{border-color:var(--accent);background:var(--pink-soft);}
.th-n{display:inline-grid;place-items:center;min-inline-size:18px;block-size:18px;border-radius:99px;background:var(--accent);color:#fff;font-size:11px;}
.th-link{background:none;border:0;padding:8px 2px;min-height:40px;color:var(--pink-dark,var(--accent));font:inherit;font-size:12.5px;font-weight:700;cursor:pointer;text-decoration:underline;}
.th-link[hidden]{display:none;}
.th-live{display:flex;gap:6px;align-items:flex-start;font-size:12.5px;line-height:1.4;color:var(--text-faint);}
.th-live svg{flex:none;margin-block-start:1px;}
.th-live.ok{color:var(--success);}
.th-live.warn{color:var(--warn);}
.th-live span{color:var(--text);}
.th-result{font-size:12.5px;color:var(--text-faint);overflow-wrap:anywhere;}
.th-result[hidden],.th-live[hidden],.th-block [hidden]{display:none;}
/* chips */
.th-chips{align-items:stretch;}
.th-chipbox{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:6px;background:var(--surface-2);border:1px solid var(--border);border-radius:9px;min-height:44px;}
.th-chipbox:focus-within{border-color:var(--accent);}
.th-chip{display:inline-flex;align-items:center;gap:2px;min-height:34px;padding-inline:11px 4px;border-radius:99px;background:var(--pink-soft);border:1px solid var(--accent);font-size:12.5px;font-weight:600;max-inline-size:100%;}
.th-chip-t{overflow-wrap:anywhere;}
.th-x{inline-size:32px;block-size:32px;border:0;background:none;color:inherit;border-radius:99px;display:inline-grid;place-items:center;cursor:pointer;}
.th-x:hover{background:rgba(0,0,0,.08);}
.th-chipin{flex:1 1 140px;min-width:100px;min-height:36px;border:0;background:transparent;font:inherit;font-size:13px;color:var(--text);outline:0;}
/* calendar */
/* the date box: the box itself opens the calendar; the little picture at its end only says so */
.th-row.th-daterow{position:relative;}
.th-daterow > .th-datein{cursor:pointer;flex:1 1 auto;min-width:0;padding-inline-end:44px !important;caret-color:transparent;}
.th-dateicon{position:absolute;inset-inline-end:14px;inset-block-start:50%;transform:translateY(-50%);display:inline-flex;color:var(--text-muted);pointer-events:none;}
.th-dateicon svg{inline-size:18px;block-size:18px;}
.th-datein[aria-expanded="true"]{border-color:var(--accent) !important;}
.th-time{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-block-start:10px;padding-block-start:10px;border-block-start:1px solid var(--border);min-height:40px;}
.th-clock{display:inline-flex;align-items:center;gap:6px;}
.th-time-sel{min-width:68px;min-height:40px;padding:0 8px;border:1px solid var(--border-strong,var(--border));border-radius:9px;background:var(--surface-2);color:var(--text);font:inherit;font-size:13px;}
.th-cal{margin-block-start:8px;padding:10px;border:1px solid var(--border);border-radius:12px;background:var(--surface);max-inline-size:340px;}
.th-cal[hidden]{display:none;}
.th-cal-head{display:flex;align-items:center;gap:2px;margin-block-end:6px;}
.th-cal-title{flex:1;text-align:center;font-size:13.5px;}
.th-nav{display:inline-flex;align-items:center;justify-content:center;inline-size:40px;min-height:40px;border:0;background:none;color:var(--text);cursor:pointer;border-radius:8px;display:inline-flex;flex-direction:row;align-items:center;justify-content:center;gap:0;}
.th-nav svg + svg{margin-inline-start:-8px;}
.th-nav:hover{background:var(--surface-2);}
.th-cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;}
.th-cal-week span{text-align:center;font-size:11px;font-weight:700;color:var(--text-faint);padding-block:4px;}
.th-day{min-height:40px;border:1px solid transparent;border-radius:8px;background:none;color:var(--text);font:inherit;font-size:13px;cursor:pointer;}
.th-day:hover{background:var(--surface-2);}
.th-day.out{color:var(--text-faint);opacity:.6;}
.th-day.today{border-color:var(--border-strong);font-weight:800;}
.th-day.sel{background:var(--accent);color:#fff;border-color:var(--accent);}
.th-cal-foot{display:flex;gap:6px;margin-block-start:8px;flex-wrap:wrap;}
/* tiles (date formats, save-as, paper sizes) */
.th-tilebox,.th-more{inline-size:100%;}
.th-more{margin-block-start:8px;}
.th-more[hidden]{display:none;}
.th-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:6px;inline-size:100%;}
.th-tile{display:flex;flex-direction:column;gap:2px;align-items:flex-start;text-align:start;min-height:52px;padding:8px 11px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);color:var(--text);font:inherit;cursor:pointer;}
.th-tile:hover{border-color:var(--border-strong);}
.th-tile[aria-pressed="true"]{border-color:var(--accent);background:var(--pink-soft);}
.th-tile-main{font-size:13px;font-weight:800;overflow-wrap:anywhere;}
.th-tile-sub{font-size:11px;color:var(--text-faint);line-height:1.3;}
.th-dfmt .th-tile-main{font-variant-numeric:tabular-nums;}
.th-picktiles>input,.th-dfmt{margin-block-start:8px;}
.th-searchsel{display:block;margin-block-end:4px;}
.th-exrow,.th-insrow{display:flex;flex-wrap:wrap;align-items:center;gap:6px;}
.th-phrases,.th-vars{align-items:flex-start;}
@media (max-width:480px){.th-tiles{grid-template-columns:repeat(2,1fr);}.th-cal{max-inline-size:none;inline-size:100%;}}
