:root {
  --bg: #050b15;
  --surface: #0c1728;
  --raised: #101d31;
  --soft: #13213a;
  --border: rgba(160, 180, 222, .14);
  --border-strong: rgba(160, 180, 222, .26);
  --text: #f5f7ff;
  --muted: #8d9bb7;
  --violet: #8b7cff;
  --violet-strong: #7464f4;
  --cyan: #4ee7d0;
  --red: #ff5570;
  --pink: #fe2c55;
  --amber: #ffc25c;
  --green: #3ddc97;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.ms { font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; font-size: 20px; line-height: 1; display: inline-block; white-space: nowrap; direction: ltr; -webkit-font-smoothing: antialiased; font-variation-settings: "FILL" 1, "wght" 500; }
body { display: flex; flex-direction: column; overflow: hidden; }

/* top bar */
.tr-top { flex: none; display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #0a1526, var(--bg)); }
.tr-brand { display: flex; align-items: center; gap: 10px; }
.tr-brand > .ms { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--violet), var(--pink)); font-size: 22px; }
.tr-brand b { display: block; font-size: 16px; }
.tr-brand small { color: var(--muted); font-size: 12px; }
.tr-conn { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.tr-conn i { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 4px rgba(255, 194, 92, .15); }
.tr-conn[data-tone="on"] i { background: var(--green); box-shadow: 0 0 0 4px rgba(61, 220, 151, .15); }
.tr-conn[data-tone="off"] i { background: var(--red); box-shadow: 0 0 0 4px rgba(255, 85, 112, .15); }
.tr-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border-strong); color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px; }
.tr-link .ms { font-size: 17px; }
.tr-link:hover { background: var(--soft); }

/* gate */
.tr-gate { margin: auto; max-width: 460px; text-align: center; padding: 40px 24px; }
.tr-gate .ms { font-size: 44px; color: var(--violet); }
.tr-gate h1 { font-size: 20px; margin: 14px 0 8px; }
.tr-gate p { color: var(--muted); line-height: 1.5; }

/* layout */
.tr-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr) 360px; }
.tr-rooms, .tr-controls { min-height: 0; overflow-y: auto; padding: 16px; background: var(--surface); }
.tr-rooms { border-right: 1px solid var(--border); }
.tr-controls { border-left: 1px solid var(--border); }
.tr-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.tr-col-head h2 { margin: 0; font-size: 15px; }
.tr-count { min-width: 26px; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--soft); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.tr-target { color: var(--cyan); font-size: 12px; font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.tr-empty .ms { font-size: 36px; color: rgba(141, 155, 183, .6); }
.tr-empty p { color: var(--text); font-weight: 600; margin: 10px 0 6px; }
.tr-empty small { line-height: 1.5; display: block; }
.tr-muted { color: var(--muted); margin: 4px 0; font-size: 13px; }

/* room cards */
.tr-room-list { display: flex; flex-direction: column; gap: 8px; }
.tr-room-card { display: flex; gap: 10px; width: 100%; text-align: left; padding: 11px; border-radius: 14px; border: 1px solid var(--border); background: var(--raised); color: var(--text); }
.tr-room-card:hover { border-color: var(--border-strong); }
.tr-room-card.on { border-color: var(--violet); background: linear-gradient(135deg, rgba(139, 124, 255, .18), rgba(254, 44, 85, .08)); }
.tr-avatar { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; background: linear-gradient(135deg, var(--pink), var(--violet)); }
.tr-avatar.sm { width: 38px; height: 38px; font-size: 15px; }
.tr-room-body { flex: 1; min-width: 0; }
.tr-room-top { display: flex; align-items: center; gap: 6px; }
.tr-room-top b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-room-body > small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 2px 0 6px; }
.tr-room-meta { display: flex; flex-wrap: wrap; gap: 5px; font-size: 11px; color: var(--muted); }
.tr-room-meta span { padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, .05); }
.tr-room-meta .live { background: var(--pink); color: #fff; font-weight: 700; }
.tr-room-meta .tag.warn { background: rgba(255, 194, 92, .16); color: var(--amber); }
.tr-room-meta .tag.hot { background: rgba(255, 85, 112, .18); color: #ff8da0; animation: tr-pulse 1.4s ease-in-out infinite; }
@keyframes tr-pulse { 50% { opacity: .55; } }
.tr-credit-chip { flex: none; min-width: 32px; padding: 2px 7px; border-radius: 8px; text-align: center; font-size: 12px; font-weight: 800; background: var(--soft); }
.tr-credit-chip.good { color: var(--green); }
.tr-credit-chip.mid { color: var(--amber); }
.tr-credit-chip.bad { color: var(--red); }

/* watched room */
.tr-watch { min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.tr-watch-empty { margin: auto; max-width: 420px; }
.tr-room { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 16px 18px 12px; gap: 12px; }
.tr-room-head { display: flex; align-items: center; gap: 12px; }
.tr-host { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.tr-host b { display: block; font-size: 17px; }
.tr-host small { color: var(--muted); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-live-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--pink); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.tr-live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: tr-pulse 1.2s infinite; }
.tr-live-pill[data-state="paused"] { background: #6b5a1d; }
.tr-live-pill[data-state="ended"] { background: var(--soft); color: var(--muted); }
.tr-live-pill[data-state="ended"] i { animation: none; background: var(--muted); }
.tr-stats { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 10px; }
.tr-stat { padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.tr-stat > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.tr-stat > b { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.tr-stat > small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-credit-card b em { font-style: normal; font-size: 28px; }
.tr-credit-card b small { color: var(--muted); font-size: 13px; font-weight: 600; }
.tr-credit-card > small { white-space: normal; }
.tr-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 6px; }
.tr-bar i { display: block; height: 100%; width: 100%; background: var(--green); transition: width .4s ease; }
.tr-bar i[data-tone="mid"] { background: var(--amber); }
.tr-bar i[data-tone="bad"] { background: var(--red); }
.tr-ladder { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tr-ladder-title { color: var(--muted); font-size: 12px; font-weight: 600; margin-right: 2px; }
.tr-tier { padding: 4px 9px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.tr-tier b { color: var(--text); }
.tr-tier.hit { border-color: rgba(255, 85, 112, .6); color: #ffb3c0; background: rgba(255, 85, 112, .1); }
.tr-tier.hit b { color: var(--red); }

/* feed */
.tr-observe { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(420px, 1.65fr) minmax(300px, .9fr); gap: 12px; }
.tr-media-pane, .tr-feed-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.tr-feed-pane { position: relative; }
.tr-media-head { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tr-media-head h3 { margin: 0 0 2px; font-size: 14px; }
.tr-media-head small { display: block; color: var(--muted); font-size: 11px; }
.tr-media-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.tr-screen-toggle, .tr-audio-toggle, .tr-media-mode { flex: none; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-strong); background: rgba(255, 255, 255, .04); color: #d9def0; border-radius: 10px; padding: 7px 9px; font-size: 11px; font-weight: 700; }
.tr-screen-toggle { border-color: rgba(78, 231, 208, .42); background: rgba(78, 231, 208, .08); color: var(--cyan); }
.tr-screen-toggle:hover, .tr-audio-toggle:hover, .tr-media-mode:hover { background: rgba(78, 231, 208, .15); border-color: rgba(78, 231, 208, .45); }
.tr-screen-toggle .ms, .tr-audio-toggle .ms, .tr-media-mode .ms { font-size: 16px; }
.tr-screen-toggle[aria-pressed="true"] { border-color: rgba(255, 85, 112, .55); background: rgba(255, 85, 112, .1); color: #ff91a4; }
.tr-audio-toggle[aria-pressed="true"] { color: var(--cyan); border-color: rgba(78, 231, 208, .35); }
.tr-audio-toggle[aria-pressed="false"] { color: #ff9aac; border-color: rgba(255, 85, 112, .35); }
.tr-media-mode[aria-pressed="true"] { color: #fff; background: var(--violet-strong); border-color: var(--violet-strong); }
.tr-screen-toggle:disabled, .tr-audio-toggle:disabled, .tr-media-mode:disabled { opacity: .4; cursor: not-allowed; }
.tr-video-shell { flex: 1; min-height: 270px; position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--border); background: #02050a; display: grid; place-items: center; }
.tr-video-stage { position: absolute; inset: 0; overflow: hidden; background: #02050a; transition: width .2s ease, border-radius .2s ease; }
.tr-video-shell video { width: 100%; height: 100%; object-fit: contain; background: #02050a; opacity: 0; transition: opacity .2s ease; }
.tr-video-shell[data-state="live"] video { opacity: 1; }
.tr-video-shell[data-viewer-mode="true"] .tr-video-stage { inset: 0 auto; left: 50%; width: auto; max-width: 100%; height: 100%; aspect-ratio: 9 / 16; transform: translateX(-50%); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 0 60px rgba(0, 0, 0, .7); }
.tr-video-shell[data-viewer-mode="true"] video { object-fit: cover; }
.tr-video-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; color: var(--muted); background: radial-gradient(circle at 50% 40%, rgba(139, 124, 255, .1), transparent 55%); }
.tr-video-empty .ms { font-size: 42px; color: #65728e; }
.tr-video-empty b { color: #d9def0; font-size: 14px; }
.tr-video-empty small { max-width: 320px; line-height: 1.45; }
.tr-video-shell[data-state="live"] .tr-video-empty { display: none; }
.tr-video-shell[data-state="starting"] .tr-video-empty .ms { color: var(--cyan); animation: tr-pulse 1s ease-in-out infinite; }
.tr-video-shell[data-state="error"] .tr-video-empty .ms { color: var(--red); }
.tr-video-quality { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 4px 7px; border-radius: 7px; background: rgba(2, 5, 10, .72); border: 1px solid rgba(255, 255, 255, .12); color: #d9def0; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.tr-audio-state { position: absolute; left: 10px; bottom: 10px; z-index: 5; display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px; border-radius: 8px; background: rgba(2, 5, 10, .74); border: 1px solid rgba(255, 255, 255, .12); color: #d9def0; font-size: 10px; font-weight: 700; }
.tr-audio-state .ms { font-size: 14px; }
.tr-video-shell[data-state="live"][data-audio="on"] .tr-audio-state { color: var(--cyan); border-color: rgba(78, 231, 208, .28); }
.tr-video-shell[data-viewer-mode="true"] > .tr-video-quality, .tr-video-shell[data-viewer-mode="true"] > .tr-audio-state { opacity: .18; }

/* Reconstructed audience view: the raw WebRTC camera remains untouched underneath. */
.tr-viewer-ui { position: absolute; inset: 0; z-index: 3; display: none; color: #fff; pointer-events: none; font-size: clamp(8px, 1.25vh, 12px); text-shadow: 0 1px 3px rgba(0, 0, 0, .75); background: linear-gradient(180deg, rgba(0, 0, 0, .28), transparent 25%, transparent 52%, rgba(0, 0, 0, .52)); }
.tr-video-shell[data-state="live"][data-viewer-mode="true"] .tr-viewer-ui { display: block; }
.tr-viewer-top { position: absolute; top: 2%; left: 3%; right: 3%; display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.tr-viewer-host { min-width: 0; max-width: 48%; display: flex; align-items: center; gap: 5px; padding: 3px 8px 3px 3px; border-radius: 999px; background: rgba(34, 38, 42, .58); backdrop-filter: blur(8px); }
.tr-viewer-avatar { flex: none; width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #d997ff, #8b7cff); border: 1px solid rgba(255, 255, 255, .55); font-weight: 800; }
.tr-viewer-host > span:last-child { min-width: 0; }
.tr-viewer-host b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.15; }
.tr-viewer-host small { display: flex; align-items: center; gap: 2px; opacity: .9; font-size: .88em; }
.tr-viewer-host small .ms { font-size: 10px; }
.tr-viewer-audience { display: flex; align-items: center; margin-left: auto; }
.tr-viewer-face { width: 23px; height: 23px; margin-left: -5px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .78); background: linear-gradient(135deg, #61756c, #d4b169); }
.tr-viewer-face.face-b { background: linear-gradient(135deg, #6b6273, #d3b7a3); }
.tr-viewer-face.face-c { background: linear-gradient(135deg, #9e7569, #e39e79); }
.tr-viewer-audience b { min-width: 25px; height: 25px; display: grid; place-items: center; margin-left: 4px; padding: 0 5px; border-radius: 50%; background: rgba(34, 38, 42, .52); font-size: .9em; }
.tr-viewer-audience > .ms { margin-left: 6px; font-size: 22px; }
.tr-viewer-badges { position: absolute; top: 9%; left: 3%; right: 3%; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.tr-viewer-badges > span { display: inline-flex; align-items: center; gap: 3px; padding: 5px 8px; border-radius: 999px; background: rgba(55, 59, 61, .5); backdrop-filter: blur(7px); font-weight: 700; white-space: nowrap; }
.tr-viewer-badges .ms { font-size: 14px; color: #ff764f; }
.tr-viewer-badges .goal .ms { color: #ff3f85; }
.tr-viewer-badges i { width: 15px; height: 15px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 12%, #ffc6ee 32%, #ff7cc6 58%, #9a7bff 100%); box-shadow: 0 0 7px #ff9ee2; }
.tr-viewer-limit { position: absolute; top: 14%; right: 1.5%; display: flex; align-items: center; gap: 2px; padding: 4px 5px 4px 7px; border-radius: 6px 0 0 6px; background: rgba(85, 87, 90, .52); font-weight: 700; }
.tr-viewer-limit .ms { font-size: 14px; color: #ff596f; }
.tr-viewer-limit .ms:last-child { color: #fff; }
.tr-viewer-wishlist { position: absolute; top: 17.5%; right: 2%; width: 46%; padding: 8px 10px 6px; display: flex; flex-direction: column; gap: 7px; border-radius: 14px; background: rgba(32, 35, 40, .5); backdrop-filter: blur(6px); }
.tr-viewer-wishlist > b { text-align: center; font-size: 1.18em; }
.tr-viewer-wishlist > span:not(.fold) { display: grid; grid-template-columns: 18px 24px minmax(0, 1fr); align-items: center; gap: 3px; font-weight: 700; }
.tr-viewer-wishlist strong { text-align: center; font-size: .85em; }
.tr-gift-dot { width: 17px; height: 17px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 10%, #ffec88 22%, #fe2c55 60%, #7d2cff); }
.tr-gift-dot.gift-cup { border-radius: 4px 4px 8px 8px; background: linear-gradient(180deg, #f3f4f6 0 36%, #855b48 37% 100%); }
.tr-gift-dot.gift-ice { background: linear-gradient(135deg, #fff, #ff8ab4 52%, #f7c25e); clip-path: polygon(50% 0, 82% 38%, 63% 57%, 50% 100%, 37% 57%, 18% 38%); }
.tr-gift-dot.gift-candy { background: radial-gradient(circle at 38% 34%, #fff, #d899ff 25%, #704cff 60%, #ff76ca); }
.tr-viewer-wishlist .fold { text-align: center; font-size: 17px; opacity: .8; }
.tr-viewer-chat { position: absolute; left: 3%; right: 12%; bottom: 8.5%; display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; max-height: 35%; overflow: hidden; }
.tr-view-comment { display: grid; grid-template-columns: 23px minmax(0, 1fr); align-items: start; gap: 5px; animation: tr-view-in .2s ease-out; }
.tr-view-comment img, .tr-view-comment .avatar { width: 23px; height: 23px; border-radius: 50%; background: rgba(255, 255, 255, .35); overflow: hidden; }
.tr-view-comment .avatar { display: grid; place-items: center; font-size: .85em; font-weight: 800; }
.tr-view-comment b { margin-right: 4px; color: #f2f2f2; }
.tr-view-comment p { margin: 0; line-height: 1.25; font-weight: 600; }
.tr-view-comment small { display: inline-flex; align-items: center; gap: 2px; padding: 1px 4px; margin-right: 3px; border-radius: 3px; background: linear-gradient(90deg, #6757ff, #a168ff); color: #fff; font-weight: 800; }
@keyframes tr-view-in { from { opacity: 0; transform: translateY(6px); } }
.tr-viewer-hearts { position: absolute; right: 4%; bottom: 14%; width: 28px; height: 90px; }
.tr-viewer-hearts .ms { position: absolute; color: #ff7693; font-size: 19px; opacity: .78; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45)); }
.tr-viewer-hearts .h1 { left: 0; bottom: 0; transform: rotate(-14deg); }
.tr-viewer-hearts .h2 { right: 0; bottom: 22px; color: #ffacc5; transform: rotate(14deg); }
.tr-viewer-hearts .h3 { left: 4px; bottom: 47px; color: #ff516f; font-size: 13px; }
.tr-viewer-bottom { position: absolute; left: 3%; right: 3%; bottom: 2%; display: flex; align-items: center; gap: 5px; }
.tr-viewer-input { height: 30px; min-width: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; padding: 0 7px 0 10px; border-radius: 999px; background: rgba(46, 49, 55, .64); color: rgba(255, 255, 255, .8); font-weight: 600; }
.tr-viewer-input .ms { font-size: 18px; }
.tr-viewer-action { flex: none; width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; background: rgba(46, 49, 55, .64); }
.tr-viewer-action .ms { font-size: 18px; }
.tr-viewer-action.rose .ms { color: #ff2765; }
.tr-viewer-action.bag { border-radius: 8px; background: linear-gradient(180deg, #ff4d87, #e51d57); }
.tr-feed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tr-feed-head h3 { margin: 0; font-size: 14px; }
.tr-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.tr-filters button { border: 1px solid var(--border); background: transparent; border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tr-filters button.on { background: var(--violet-strong); border-color: var(--violet-strong); color: #fff; }
.tr-feed { flex: 1; min-height: 0; overflow-y: auto; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); padding: 6px; }
.tr-feed-empty { text-align: center; padding: 30px 0; }
.tr-ev { display: grid; grid-template-columns: 46px 22px minmax(0, 1fr); align-items: start; gap: 6px; padding: 6px 8px; border-radius: 10px; font-size: 13px; line-height: 1.45; }
.tr-ev + .tr-ev { margin-top: 2px; }
.tr-ev time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.tr-ev > .ms { font-size: 17px; color: var(--muted); padding-top: 1px; }
.tr-ev-body b { margin-right: 6px; }
.tr-ev-body span { color: #d9def0; }
.tr-ev .tag { font-style: normal; display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 600; background: rgba(255, 255, 255, .06); color: var(--muted); }
.tr-ev .tag.gold { color: var(--amber); background: rgba(255, 194, 92, .12); }
.tr-ev .tag.reason { color: #ffb3c0; background: rgba(255, 85, 112, .1); }
.tr-ev .tag.trainer { color: var(--cyan); background: rgba(78, 231, 208, .1); }
.tr-ev .tag.bad { color: #fff; background: rgba(255, 85, 112, .5); }
.tr-ev.tone-host { background: rgba(139, 124, 255, .08); }
.tr-ev.tone-host > .ms, .tr-ev.tone-host b { color: #b9b0ff; }
.tr-ev.tone-gift > .ms { color: var(--amber); }
.tr-ev.tone-warn { background: rgba(255, 194, 92, .08); }
.tr-ev.tone-warn > .ms, .tr-ev.tone-warn b { color: var(--amber); }
.tr-ev.tone-bad { background: rgba(255, 85, 112, .1); }
.tr-ev.tone-bad > .ms, .tr-ev.tone-bad b { color: var(--red); }
.tr-ev.tone-good > .ms, .tr-ev.tone-good b { color: var(--green); }
.tr-ev.tone-incident > .ms, .tr-ev.tone-incident b { color: var(--cyan); }
.tr-follow { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 4px; border: 0; border-radius: 999px; padding: 7px 14px; background: var(--violet-strong); color: #fff; font-weight: 700; font-size: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .4); }
.tr-follow .ms { font-size: 16px; }

/* controls */
.tr-panel { padding: 12px; border-radius: 14px; background: var(--raised); border: 1px solid var(--border); margin-bottom: 10px; display: flex; flex-direction: column; gap: 8px; }
.tr-panel h3 { margin: 0; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.tr-panel h3 .ms { font-size: 18px; color: var(--violet); }
.tr-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tr-field > span { font-size: 11px; color: var(--muted); }
.tr-panel select, .tr-panel input, .tr-panel textarea { width: 100%; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); outline: none; }
.tr-panel select:focus, .tr-panel input:focus, .tr-panel textarea:focus { border-color: var(--violet); }
.tr-panel textarea { resize: vertical; min-height: 40px; }
.tr-panel select option, .tr-panel select optgroup { background: var(--surface); }
.tr-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tr-inline { display: flex; gap: 6px; }
.tr-inline input[type="number"] { width: 70px; flex: none; }
.tr-inline select { flex: 1; }
.tr-inline button, .tr-credit-buttons button, .tr-seg button { flex: none; border: 1px solid var(--border-strong); background: var(--soft); border-radius: 10px; padding: 8px 12px; font-weight: 700; }
.tr-inline button:hover, .tr-credit-buttons button:hover, .tr-seg button:hover { border-color: var(--violet); }
.tr-credit-buttons { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.tr-credit-buttons button { padding: 8px 0; color: #ff9aac; }
.tr-credit-buttons button.plus { color: var(--green); }
.tr-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tr-seg button.on { background: var(--violet-strong); border-color: var(--violet-strong); color: #fff; }
.tr-primary { border: 0; border-radius: 10px; padding: 9px 12px; font-weight: 700; background: var(--violet-strong); color: #fff; }
.tr-primary:hover { background: var(--violet); }
.tr-primary.danger { background: #d8344f; }
.tr-primary.danger:hover { background: var(--red); }
.tr-hint { color: var(--muted); font-size: 11px; line-height: 1.45; }
.tr-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; display: inline-grid; place-items: center; }
.tr-appeal { padding: 10px; border-radius: 10px; background: var(--bg); border: 1px solid rgba(255, 85, 112, .35); display: flex; flex-direction: column; gap: 4px; }
.tr-appeal + .tr-appeal { margin-top: 6px; }
.tr-appeal small { color: var(--muted); font-size: 12px; }
.tr-appeal p { margin: 2px 0; font-size: 12px; color: #d9def0; }
.tr-appeal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 4px; }
.tr-appeal-actions button { border: 0; border-radius: 8px; padding: 7px; font-weight: 700; color: #fff; }
.tr-appeal-actions .ok { background: #1f9d6b; }
.tr-appeal-actions .no { background: #a53045; }
.tr-end { width: 100%; border: 1px solid rgba(255, 85, 112, .5); background: transparent; color: #ff8da0; border-radius: 10px; padding: 10px; font-weight: 700; }
.tr-end.armed { background: var(--red); color: #fff; border-color: var(--red); }
body.tr-no-room .tr-controls .tr-panel { opacity: .45; pointer-events: none; }

/* toast */
.tr-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; border-radius: 12px; background: #1f9d6b; color: #fff; font-weight: 600; box-shadow: 0 12px 30px rgba(0, 0, 0, .45); z-index: 10; max-width: calc(100vw - 32px); }
.tr-toast[data-tone="bad"] { background: #b8324a; }

/* narrower screens: stack the columns and let the page scroll */
@media (max-width: 1180px) {
  body { overflow: auto; height: auto; }
  .tr-main { display: flex; flex-direction: column; }
  .tr-rooms, .tr-controls { border: 0; overflow: visible; }
  .tr-room { min-height: 70vh; }
  .tr-observe { display: flex; flex-direction: column; }
  .tr-video-shell { min-height: 420px; aspect-ratio: 16 / 9; }
  .tr-feed { min-height: 360px; }
  .tr-stats { grid-template-columns: repeat(2, 1fr); }
  .tr-credit-card { grid-column: span 2; }
}
@media (max-width: 560px) {
  .tr-top { flex-wrap: wrap; padding: 10px 16px; }
  .tr-rooms, .tr-controls, .tr-room { padding: 12px 16px; }
  .tr-conn { margin-left: 0; order: 3; width: 100%; }
  .tr-video-shell { min-height: 250px; }
}
