/* UI Builder: drag-and-drop canvas editor. Editor chrome uses site theme vars; .r-* classes style the design elements. */

.ub__h1 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.page-builder .site-footer { display: none; }
.page-builder main { margin: 0; }
@media (min-width: 961px) { .page-builder { overflow: hidden; } }

.ub {
  display: grid; grid-template-columns: 224px minmax(0, 1fr) 300px; grid-template-rows: auto minmax(0, 1fr);
  height: calc(100vh - 64px); height: calc(100dvh - 64px); min-height: 520px; background: var(--bg);
}
.ub.is-full { position: fixed; inset: 0; z-index: 2000; height: 100vh; height: 100dvh; }
.ub.is-preview { grid-template-columns: minmax(0, 1fr); }
.ub.is-preview .ub__palette, .ub.is-preview .ub__inspector { display: none; }

/* Toolbar */
.ub__bar { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 8px 14px; background: var(--bg-elevated); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tb { display: flex; align-items: center; gap: 4px; }
.tb--end { margin-left: auto; }
.tb__zoom { min-width: 46px; text-align: center; font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tbtn { display: inline-flex; align-items: center; gap: 6px; height: 32px; min-width: 32px; justify-content: center; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 0.82rem; font-weight: 500; cursor: pointer; }
.tbtn:hover:not(:disabled) { background: var(--card-bg); border-color: var(--border); }
.tbtn:disabled { opacity: 0.35; cursor: default; }
.tbtn.is-on { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.tbtn--primary { background: var(--accent-grad); color: #fff; padding: 0 14px; }
.tbtn--primary:hover:not(:disabled) { background: var(--accent-grad); filter: brightness(1.08); border-color: transparent; }
.ub svg.ic { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Palette */
.ub__palette { overflow-y: auto; padding: 14px; background: var(--bg-elevated); border-right: 1px solid var(--border); }
.ub__hint { margin: 0 0 14px; font-size: 0.78rem; color: var(--text-muted); }
.pal-group { margin-bottom: 18px; }
.pal-group h3 { margin: 0 0 8px; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.pal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pal { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); color: var(--text); font: inherit; font-size: 0.76rem; font-weight: 500; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.pal svg.ic { width: 22px; height: 22px; color: var(--accent-2); }
.pal:hover { border-color: var(--accent); transform: translateY(-1px); }
.pal:active { cursor: grabbing; }
.pal-ghost { position: fixed; z-index: 10000; pointer-events: none; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--accent-grad); color: #fff; font-size: 0.82rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); transform: translate(-50%, -50%); }

/* Viewport + canvas */
.ub__viewport { position: relative; display: flex; overflow: auto; padding: 32px; background: color-mix(in srgb, var(--bg) 88%, #000); }
.ub__viewport.is-drop::after { content: ""; position: absolute; inset: 8px; border: 2px dashed var(--accent-2); border-radius: 12px; pointer-events: none; }
.ub__sizer { position: relative; margin: auto; flex: none; }
.ub__canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }
.ub__canvas.pv { overflow: hidden; }
/* Matrix-style grid: green lines over the canvas color, brighter every 5th line. Line width is divided by zoom so it stays 1 screen pixel. */
.ub__canvas.grid {
  --gl: calc(var(--iz, 1) * 1px);
  background-image:
    linear-gradient(to right, rgba(0, 255, 65, 0.5) var(--gl), transparent var(--gl)),
    linear-gradient(to bottom, rgba(0, 255, 65, 0.5) var(--gl), transparent var(--gl)),
    linear-gradient(to right, rgba(0, 255, 65, 0.16) var(--gl), transparent var(--gl)),
    linear-gradient(to bottom, rgba(0, 255, 65, 0.16) var(--gl), transparent var(--gl));
  background-size:
    calc(var(--grid) * 5) calc(var(--grid) * 5), calc(var(--grid) * 5) calc(var(--grid) * 5),
    var(--grid) var(--grid), var(--grid) var(--grid);
  background-position: 0 0;
}

.ub__empty { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 5000; }
.ub__empty[hidden] { display: none; }
.ub__empty-card { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 22px 26px; max-width: 320px; border-radius: 14px; background: var(--card-bg); border: 1px solid var(--border); color: var(--text-muted); font-size: 0.85rem; pointer-events: auto; box-shadow: var(--shadow); }
.ub__empty-card strong { color: var(--text); font-size: 1rem; }

/* Items on the canvas */
.it { position: absolute; touch-action: none; user-select: none; -webkit-user-select: none; }
.it__in { width: 100%; height: 100%; overflow: hidden; }
.ed .it { cursor: move; }
.ed .it__in, .ed .it__in * { pointer-events: none; }
.ed .it:hover { outline: 1px solid var(--accent-2); outline-offset: 0; }
.ed .it.is-sel { outline: 2px solid var(--accent-2); }
.ed .it.is-editing { cursor: text; }
.ed .it.is-editing .it__in, .ed .it.is-editing .it__in * { pointer-events: auto; }
.it.is-editing [data-inline] { user-select: text; -webkit-user-select: text; outline: none; cursor: text; }
.hd { position: absolute; width: 11px; height: 11px; background: #fff; border: 2px solid var(--accent-2); border-radius: 3px; transform: translate(-50%, -50%) scale(var(--iz, 1)); pointer-events: auto; z-index: 2; }
.hd::after { content: ""; position: absolute; inset: -6px; }
.hd--n { left: 50%; top: 0; cursor: ns-resize; } .hd--s { left: 50%; top: 100%; cursor: ns-resize; }
.hd--e { left: 100%; top: 50%; cursor: ew-resize; } .hd--w { left: 0; top: 50%; cursor: ew-resize; }
.hd--ne { left: 100%; top: 0; cursor: nesw-resize; } .hd--sw { left: 0; top: 100%; cursor: nesw-resize; }
.hd--nw { left: 0; top: 0; cursor: nwse-resize; } .hd--se { left: 100%; top: 100%; cursor: nwse-resize; }

/* Inspector */
.ub__inspector { overflow-y: auto; padding: 14px; background: var(--bg-elevated); border-left: 1px solid var(--border); }
.ins__head { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-weight: 700; font-size: 0.95rem; }
.ins__head svg.ic { color: var(--accent-2); }
.ins__sec { margin: 18px 0 8px; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.ins__geo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fld { display: grid; gap: 5px; margin-bottom: 11px; font-size: 0.8rem; color: var(--text-muted); }
.fld > span:first-child { display: flex; justify-content: space-between; }
.fld output { color: var(--text); font-variant-numeric: tabular-nums; }
.fld input[type=text], .fld input[type=number], .fld select, .fld textarea { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); font: inherit; font-size: 0.85rem; }
.fld textarea { resize: vertical; min-height: 64px; }
.fld input[type=range] { width: 100%; accent-color: var(--accent); }
.fld--row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fld--row input[type=color] { width: 36px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
.fld--check { display: flex; align-items: center; gap: 9px; color: var(--text); cursor: pointer; }
.fld--check input { accent-color: var(--accent); width: 16px; height: 16px; }
.ins__btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ins__btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); font: inherit; font-size: 0.78rem; cursor: pointer; }
.ins__btn:hover { border-color: var(--accent); }
.ins__btn--danger:hover { border-color: var(--error); color: var(--error); }
.ins__note { font-size: 0.75rem; color: var(--text-muted); margin: 0 0 12px; }

@media (max-width: 960px) {
  .ub { grid-template-columns: 1fr; grid-template-rows: auto auto minmax(60vh, auto) auto; height: auto; }
  .ub__palette { display: flex; gap: 14px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .ub__hint { display: none; }
  .pal-group { margin: 0; flex: none; }
  .ub__inspector { border-left: 0; border-top: 1px solid var(--border); }
  .tb--end { margin-left: 0; }
}

/* Design elements (rendered inside .it__in) */
.r-header, .r-msgs, .r-input, .r-inbox, .r-panel, .r-text, .r-button, .r-image, .r-form { width: 100%; height: 100%; box-sizing: border-box; font-family: "Inter", system-ui, sans-serif; line-height: 1.35; }
.r-header svg.ic, .r-input svg.ic { width: 20px; height: 20px; }
.r-av { border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; }

.r-header { display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.r-header__who { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.r-header__who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-header__who small { opacity: 0.65; font-size: 0.8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-header__acts { display: flex; gap: 12px; }

.r-msgs { display: flex; flex-direction: column; gap: 8px; padding: 14px; overflow: hidden; }
.pv .r-msgs { overflow-y: auto; }
.r-msgs > :first-child { margin-top: auto; }
.r-msg { display: flex; align-items: flex-end; gap: 8px; }
.r-msg--me { justify-content: flex-end; }
.r-msg__col { display: grid; gap: 2px; max-width: 78%; }
.r-msg--me .r-msg__col { justify-items: end; }
.r-bub { margin: 0; padding: 0.6em 0.95em; width: fit-content; overflow-wrap: anywhere; }
.r-msg time { font-size: 0.72em; opacity: 0.55; padding: 0 4px; }

.r-input { display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.r-input__tools { display: flex; gap: 10px; }
.r-input__field { flex: 1; min-width: 0; height: 70%; max-height: 42px; border: 0; outline: 0; border-radius: 999px; padding: 0 16px; font: inherit; font-size: 15px; }
.r-input__field::placeholder { color: inherit; opacity: 0.55; }
.r-input__send { border: 0; background: transparent; padding: 0; display: grid; place-items: center; cursor: pointer; }

.r-inbox { display: flex; flex-direction: column; padding: 16px 8px 8px; gap: 8px; }
.r-inbox__title { padding: 0 8px; font-weight: 800; font-size: 1.4em; }
.r-inbox__search { margin: 0 8px; padding: 8px 14px; border-radius: 999px; background: rgba(128, 128, 128, 0.2); font-size: 0.9em; }
.r-inbox__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; overflow: hidden; }
.r-inbox__row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; min-width: 0; }
.r-inbox__row div { min-width: 0; display: grid; }
.r-inbox__row b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-inbox__row small { font-size: 0.82em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.r-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.r-button { display: flex; align-items: center; justify-content: center; text-align: center; font-weight: 600; text-decoration: none; cursor: pointer; }
.pv a.r-button:hover { filter: brightness(1.1); text-decoration: none; }
.r-image { display: block; object-fit: cover; }
.r-image--empty { display: grid; place-items: center; background: rgba(128, 128, 128, 0.18); color: rgba(128, 128, 128, 0.9); border: 2px dashed rgba(128, 128, 128, 0.5); font-size: 13px; }
.r-image--empty svg.ic { width: 28px; height: 28px; }

.r-form { display: flex; flex-direction: column; gap: 10px; padding: 18px; }
.r-form h4 { margin: 0 0 2px; font-size: 1.15em; }
.r-form input, .r-form textarea { width: 100%; box-sizing: border-box; border: 0; outline: 0; border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 14px; }
.r-form textarea { flex: 1; min-height: 40px; resize: none; }
.r-form input::placeholder, .r-form textarea::placeholder { color: inherit; opacity: 0.55; }
.r-form button { border: 0; border-radius: 8px; padding: 10px; font: inherit; font-weight: 600; color: #fff; cursor: pointer; }

/* Workspace tabs + module tiles */
.tb--views { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 2px; }
.tbtn--tab { height: 28px; }
.tbtn--tab.is-on { background: var(--accent-grad); color: #fff; }
.pal--module { border-style: dashed; }
.pal--module svg.ic { color: var(--accent); }
.pal-back { display: flex; align-items: center; gap: 8px; width: 100%; margin-bottom: 14px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); color: var(--text); font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.pal-back:hover { border-color: var(--accent); }
.fld__mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
.fld__note { font-size: 0.74rem; line-height: 1.35; }
.fld--id .ins__btns { margin: 2px 0 2px; }

/* Taskbar */
.r-dock { display: flex; align-items: stretch; gap: 4px; width: 100%; height: 100%; box-sizing: border-box; padding: 6px; font-family: "Inter", system-ui, sans-serif; line-height: 1.2; overflow: hidden; }
.r-dock--h { flex-direction: row; }
.r-dock--v { flex-direction: column; }
.r-dock svg.ic { width: var(--ic, 24px); height: var(--ic, 24px); stroke-width: 1.8; }
.r-dock__it { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 0; padding: 4px 12px; border: 0; border-radius: 12px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.r-dock--h .r-dock__it { flex: 1 1 0; max-width: 140px; }
.r-dock--v .r-dock__it { flex: 1 1 0; max-height: 96px; padding: 6px 4px; }
.r-dock__ic { position: relative; display: grid; place-items: center; }
.r-dock__lab { max-width: 100%; font-size: calc(var(--ic, 24px) * 0.46 + 1px); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-dock__badge { position: absolute; top: -6px; left: 62%; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box; border-radius: 999px; color: #fff; font-style: normal; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.r-dock__live { position: absolute; top: -3px; right: -5px; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35); }
.r-dock--underline .r-dock__it { border-radius: 0; }
.r-dock--underline.r-dock--h .r-dock__it.is-on { box-shadow: inset 0 -3px 0 var(--ul, currentColor); }
.r-dock--underline.r-dock--v .r-dock__it.is-on { box-shadow: inset 3px 0 0 var(--ul, currentColor); }
.pv .r-dock__it:hover:not(.is-on) { background: rgba(128, 128, 128, 0.16); }
.pv .r-dock--underline .r-dock__it:hover:not(.is-on) { background: transparent; opacity: 0.8; }

.r-dock--v .r-dock__it--acct { margin-top: auto; }

/* Login form (private account; synced with the game's public id) */
.r-lg { display: flex; flex-direction: column; gap: 10px; width: 100%; height: 100%; box-sizing: border-box; padding: 18px; overflow: hidden; font-family: "Inter", system-ui, sans-serif; line-height: 1.3; }
.r-lg svg.ic { width: 26px; height: 26px; flex: none; }
.r-lg__head { display: flex; align-items: center; gap: 12px; }
.r-lg__head > div { display: grid; min-width: 0; }
.r-lg__head small { font-size: 0.78em; }
.r-lg__tabs { display: flex; border-bottom: 1px solid rgba(128, 128, 128, 0.3); }
.r-lg__tab { flex: 1; padding: 8px 4px; border: 0; border-bottom: 3px solid transparent; background: transparent; font: inherit; font-size: 0.9em; font-weight: 600; cursor: pointer; }
.r-lg input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 0; outline: 0; border-radius: 8px; font: inherit; font-size: 14px; }
.r-lg input::placeholder { color: inherit; opacity: 0.55; }
.r-lg__go { padding: 10px; border: 0; border-radius: 8px; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.r-lg__skip { padding: 6px; border: 0; background: transparent; font: inherit; font-size: 0.85em; text-decoration: underline; cursor: pointer; }
.r-lg__gid { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding: 8px 10px; border: 1px dashed; border-radius: 8px; font-size: 0.78em; }
.r-lg__gid code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

/* Podcast streamer (viewer card: picture + title only) */
.r-pod { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; box-sizing: border-box; overflow: hidden; font-family: "Inter", system-ui, sans-serif; line-height: 1.25; }
.r-pod__pic { flex: 1; min-height: 0; width: 100%; object-fit: cover; display: block; }
.r-pod__pic--empty { display: grid; place-items: center; text-align: center; background: rgba(128, 128, 128, 0.18); color: rgba(128, 128, 128, 0.95); font-size: 13px; }
.r-pod__pic--empty svg.ic { width: 34px; height: 34px; }
.r-pod__title { flex: none; padding: 14px 16px 16px; font-weight: 700; overflow-wrap: anywhere; }
.r-pod--overlay .r-pod__title { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 16px; background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }

/* Voice chat (placeholder participants) */
.r-vc { display: flex; flex-direction: column; width: 100%; height: 100%; box-sizing: border-box; overflow: hidden; font-family: "Inter", system-ui, sans-serif; line-height: 1.25; }
.r-vc svg.ic { width: 18px; height: 18px; flex: none; }
.r-vc__head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; flex: none; }
.r-vc__count { margin-left: auto; font-size: 0.8em; white-space: nowrap; }
.r-vc__body { flex: 1; min-height: 0; overflow: hidden; padding: 12px; }
.r-vc--list .r-vc__body { display: flex; flex-direction: column; gap: 8px; }
.r-vc--list .r-vc__u { display: flex; align-items: center; gap: 12px; padding: 4px 6px; min-width: 0; }
.r-vc--list .r-vc__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-vc--grid .r-vc__body { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; align-content: start; }
.r-vc--grid .r-vc__u { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px 12px; border: 2px solid transparent; border-radius: 12px; background: rgba(128, 128, 128, 0.12); min-width: 0; }
.r-vc--grid .r-vc__name { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-vc--grid .r-vc__u > svg.ic { position: absolute; top: 8px; right: 8px; }
.r-vc__foot { display: flex; justify-content: center; gap: 12px; padding: 10px; flex: none; }
.r-vc__btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; }

/* Public chat */
.r-pub { display: flex; flex-direction: column; font-family: "Inter", system-ui, sans-serif; line-height: 1.35; width: 100%; height: 100%; box-sizing: border-box; }
.r-pub svg.ic { width: 1.25em; height: 1.25em; }
.r-pub__head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid rgba(128, 128, 128, 0.25); flex: none; }
.r-pub__count { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8em; margin-left: 6px; }
.r-pub__dot { width: 8px; height: 8px; border-radius: 50%; background: #23a55a; flex: none; display: inline-block; }
.r-pub__body { flex: 1; min-height: 0; display: flex; }
.r-pub__msgs { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; overflow: hidden; }
.pv .r-pub__msgs { overflow-y: auto; }
.r-pub__msgs > :first-child { margin-top: auto; }
.r-pub__users { width: 28%; min-width: 96px; flex: none; padding: 12px; display: grid; align-content: start; gap: 8px; font-size: 0.9em; border-left: 1px solid rgba(128, 128, 128, 0.25); overflow: hidden; }
.r-pub__utitle { font-size: 0.7em; letter-spacing: 0.08em; font-weight: 700; }
.r-pub__user { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-pub__input { display: flex; align-items: center; gap: 10px; padding: 10px 14px 14px; flex: none; }
.r-pub__input input { flex: 1; min-width: 0; height: 38px; border: 0; outline: 0; border-radius: 8px; padding: 0 12px; font: inherit; }
.r-pub__input input::placeholder { color: inherit; opacity: 0.55; }
.r-pub__input button { border: 0; background: transparent; padding: 0; display: grid; place-items: center; cursor: pointer; }
.r-pm { display: flex; gap: 10px; align-items: flex-start; }
.r-pm__col { min-width: 0; display: grid; gap: 2px; }
.r-pm__head { display: flex; align-items: baseline; gap: 8px; }
.r-pm__head time, .r-pm time { font-size: 0.72em; }
.r-pm__text { overflow-wrap: anywhere; }
.r-pm--compact { display: block; overflow-wrap: anywhere; }
.r-pm--compact time { margin-right: 6px; }
.r-pm--compact .r-pm__name { font-weight: 700; }

/* Email workspace */
.r-mtop, .r-mside, .r-mlist, .r-mread, .r-mcomp { font-family: "Inter", system-ui, sans-serif; line-height: 1.35; width: 100%; height: 100%; box-sizing: border-box; }
.r-mtop svg.ic, .r-mside svg.ic, .r-mlist svg.ic, .r-mread svg.ic, .r-mcomp svg.ic { width: 18px; height: 18px; flex: none; }
.r-chk { width: 15px; height: 15px; border: 2px solid currentColor; border-radius: 3px; opacity: 0.55; flex: none; box-sizing: border-box; }

.r-mtop { display: flex; align-items: center; gap: 16px; padding: 0 16px; }
.r-mtop__title { font-size: 20px; font-weight: 500; }
.r-mtop__search { flex: 1; max-width: 720px; height: 70%; max-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-radius: 999px; overflow: hidden; white-space: nowrap; }
.r-mtop > .r-av { margin-left: auto; }

.r-mside { padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; font-size: 14px; }
.r-mside__compose { display: flex; align-items: center; gap: 12px; align-self: flex-start; padding: 14px 22px 14px 16px; border-radius: 16px; font-weight: 600; margin: 6px 0 12px 4px; }
.r-mside__row { display: flex; align-items: center; gap: 14px; padding: 6px 12px 6px 16px; border-radius: 0 999px 999px 0; }
.r-mside__row.is-on { font-weight: 700; }
.r-mside__row span { flex: 1; }
.r-mside__row em { font-style: normal; font-size: 0.85em; }
.r-mside__sec { padding: 16px 16px 6px; font-size: 0.85em; font-weight: 600; }
.r-mside__dot { width: 12px; height: 12px; border-radius: 50%; margin: 0 3px; flex: none; }

.r-mlist { display: flex; flex-direction: column; overflow: hidden; container-type: inline-size; }
.r-mlist__tb { display: flex; align-items: center; gap: 16px; padding: 8px 14px; flex: none; }
.r-mlist__tabs { display: flex; flex: none; border-bottom: 1px solid rgba(128, 128, 128, 0.25); }
.r-mlist__tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-bottom: 3px solid transparent; font-weight: 600; font-size: 0.92em; white-space: nowrap; }
.r-mlist__rows { flex: 1; min-height: 0; overflow: hidden; }
.r-mrow { display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-bottom: 1px solid rgba(128, 128, 128, 0.18); min-width: 0; }
.r-mrow.is-compact { padding: 4px 14px; }
.r-mrow__from { width: 22%; min-width: 80px; flex: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-mrow__mid { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-mrow__chip { font-style: normal; font-size: 0.75em; font-weight: 600; padding: 1px 7px; border-radius: 4px; margin-right: 8px; }
.r-mrow__time { flex: none; font-size: 0.82em; }
@container (max-width: 420px) { .r-mrow > .r-chk, .r-mrow > svg { display: none; } .r-mrow__from { width: 30%; } }

.r-mread { display: flex; flex-direction: column; overflow: hidden; }
.r-mread__tb { display: flex; align-items: center; gap: 18px; padding: 10px 16px; flex: none; }
.r-mread__body { flex: 1; min-height: 0; overflow: hidden; padding: 6px 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.r-mread__subject { display: flex; align-items: center; gap: 10px; }
.r-mread__subject h3 { margin: 0; font-size: 1.5em; font-weight: 400; }
.r-mread__subject em { font-style: normal; font-size: 0.7em; padding: 2px 8px; border-radius: 4px; }
.r-mread__who { display: flex; align-items: center; gap: 12px; }
.r-mread__nm { flex: 1; min-width: 0; }
.r-mread__meta { display: flex; align-items: center; gap: 12px; font-size: 0.8em; white-space: nowrap; }
.r-mread__body p { margin: 0; white-space: pre-wrap; }
.r-mread__att { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; border: 1px solid; border-radius: 8px; padding: 8px 12px; font-size: 0.9em; }
.r-mread__acts { display: flex; gap: 10px; margin-top: auto; }
.r-mread__btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid; border-radius: 999px; padding: 8px 18px; font-weight: 600; font-size: 0.9em; }

.r-mcomp { display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(128, 128, 128, 0.3); font-size: 14px; }
.r-mcomp__head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; flex: none; }
.r-mcomp__head b { flex: 1; font-weight: 600; }
.r-mcomp__hicons { display: flex; gap: 12px; }
.r-mcomp__row { display: flex; gap: 12px; padding: 9px 14px; border-bottom: 1px solid rgba(128, 128, 128, 0.2); flex: none; }
.r-mcomp__body { flex: 1; min-height: 0; padding: 12px 14px; overflow: hidden; white-space: pre-wrap; }
.r-mcomp__foot { display: flex; align-items: center; gap: 16px; padding: 10px 14px; flex: none; }
.r-mcomp__send { padding: 8px 22px; border-radius: 999px; font-weight: 600; }
.r-mcomp__fmt { display: flex; gap: 12px; }
