/* The BBCode editor (assets/rte.js) */
.rte { margin: .3rem 0 .4rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface-solid); overflow: hidden; }
.rte:focus-within { border-color: var(--tv-signal); box-shadow: 0 0 0 3px rgba(24, 176, 104, .18); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .7rem; padding: .45rem .55rem; border-bottom: 1px solid var(--tv-line); background: var(--tv-surface-raised); }
.rte-group { display: inline-flex; align-items: center; gap: .2rem; padding-right: .6rem; border-right: 1px solid var(--tv-line); }
.rte-group:last-of-type { border-right: 0; }
.rte-btn { min-width: 2rem; height: 2rem; padding: 0 .5rem; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--text); font: 650 .82rem/1 inherit; cursor: pointer; }
.rte-btn:hover { background: rgba(24, 176, 104, .14); border-color: var(--tv-line); }
.rte-btn code { padding: 0 .2rem; font-size: .8rem; }
.rte-select { width: auto; min-width: 6.4rem; height: 2rem; padding: 0 1.4rem 0 .5rem; text-overflow: clip; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface-solid); color: var(--text); font: inherit; font-size: .8rem; }
.rte-tabs { display: inline-flex; margin-left: auto; padding: .15rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface-solid); }
.rte-tab { height: 1.8rem; padding: 0 .85rem; border: 0; border-radius: 3px; background: transparent; color: var(--muted); font: 700 .8rem/1 inherit; cursor: pointer; }
.rte-tab[aria-pressed="true"] { background: var(--tv-signal); color: #06281a; }
.rte.is-previewing .rte-group { opacity: .4; pointer-events: none; }
.rte textarea { display: block; width: 100%; min-height: 12rem; margin: 0; padding: .8rem .9rem; border: 0; border-radius: 0; background: transparent; color: var(--text); font: .93rem/1.55 ui-monospace, "Cascadia Code", Consolas, monospace; resize: vertical; box-shadow: none; }
.rte textarea:focus { outline: none; box-shadow: none; }
.rte textarea[hidden] { display: none; }
.rte-preview { min-height: 12rem; padding: .9rem 1.1rem; }
.rte-preview[hidden], .rte-help[hidden] { display: none; }
.rte-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; padding: .35rem .8rem; border-top: 1px solid var(--tv-line); color: var(--muted); font-size: .76rem; }
.rte-help-btn { padding: 0; border: 0; background: none; color: var(--tv-signal); font: inherit; text-decoration: underline; cursor: pointer; }
.rte-help { padding: .6rem 1rem; border-top: 1px solid var(--tv-line); background: var(--tv-surface); font-size: .84rem; }
.rte-help ul { margin: .3rem 0; padding-left: 1.1rem; }
.rte-help code { font-size: .78rem; }

/* Icon and tag pickers on the title fields */
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: .4rem; }
.icon-choice input { position: absolute; opacity: 0; pointer-events: none; }
.icon-choice > span { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .5rem .3rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface-solid); color: var(--text); cursor: pointer; text-align: center; }
.icon-choice > span .icon { width: 22px; height: 22px; color: var(--tv-signal); }
.icon-choice small { color: var(--muted); font-size: .68rem; line-height: 1.2; }
.icon-none > span { justify-content: center; min-height: 3.4rem; font-size: .8rem; color: var(--muted); }
.icon-choice:hover > span { border-color: var(--tv-signal); }
.icon-choice input:checked + span { border-color: var(--tv-signal); background: rgba(24, 176, 104, .14); box-shadow: 0 0 0 2px rgba(24, 176, 104, .25); }
.icon-choice input:focus-visible + span { outline: 2px solid var(--tv-signal); outline-offset: 2px; }
