:root {
  --purple: #5c2190; --purple2: #8c40bf; --gold: #ffcc33;
  --ink: #1d1b22; --paper: #f4f1f8; --card: #ffffff; --line: #ddd6e6; --muted: #6b6475;
  --mine: #c41a1a; --theirs: #1a33c4; --online: #2fa84f; --away: #e08a00;
}
@media (prefers-color-scheme: dark) {
  :root { --ink: #eee9f5; --paper: #17141c; --card: #221e29; --line: #36303f; --muted: #a79fb3; --mine: #ff6b6b; --theirs: #7d95ff; }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 -apple-system, "Segoe UI", Helvetica, sans-serif; color: var(--ink); background: var(--paper); overflow: hidden; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; }
input, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; width: 100%; }
input[type=search] { -webkit-appearance: none; appearance: none; }
input:focus, textarea:focus { outline: 2px solid var(--purple2); outline-offset: -1px; }

/* Glossy title strips, like the Mac app's headers. */
.strip { background: linear-gradient(var(--purple2), var(--purple)); color: #fff; padding: 7px 12px;
         box-shadow: inset 0 1px 0 rgba(255,255,255,.35); text-shadow: 1px 1px 0 rgba(0,0,0,.35); position: relative; }
.strip .title { font-weight: 800; font-size: 14px; }
.strip .subtitle { font-size: 11px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .actions { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: flex; gap: 4px; }
.strip .actions button { background: none; border: 0; color: #fff; font-size: 16px; cursor: pointer; padding: 2px 4px; }

.button { display: inline-block; padding: 7px 14px; border-radius: 8px; border: 1px solid rgba(0,0,0,.2); cursor: pointer;
          background: var(--card); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.button.primary { background: linear-gradient(var(--purple2), var(--purple)); color: #fff; border-color: rgba(0,0,0,.3);
                  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 1px 3px rgba(0,0,0,.2); }
.button.gold { background: linear-gradient(#ffe27a, #f5b50f); color: #3a2a00; }
.button:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; color: var(--purple2); cursor: pointer; padding: 4px; text-decoration: underline; }
.fine { color: var(--muted); font-size: 12px; }
.error { color: #c42121; background: rgba(220,40,40,.1); border-radius: 6px; padding: 6px 9px; }

/* Sign on */
#signon { max-width: 340px; margin: 5vh auto; background: var(--card); border-radius: 12px; overflow: hidden;
          box-shadow: 0 4px 20px rgba(0,0,0,.18); }
#signon-form { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
#signon-form label { font-weight: 600; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
#signon:not(.registering) .register-only { display: none; }
#signon.registering .signon-only { display: none; }
.forgot { display: block; text-align: center; font-size: 12px; margin-top: 2px; color: var(--purple2); }
/* The icon cropper (icon-crop.js). */
.crop { display: flex; gap: 14px; align-items: flex-start; }
.crop-view { cursor: grab; touch-action: none; border-radius: 4px; outline: 1px solid var(--line); }
.crop-view:active { cursor: grabbing; }
.crop-previews { display: flex; flex-direction: column; gap: 6px; }
.crop-previews canvas { border-radius: 8px; }
.crop-previews canvas + canvas { border-radius: 4px; }
.modal .visible-add { display: flex; gap: 8px; align-items: center; }
.modal .visible-add input { flex: 1; }
.modal .visible-problem { color: #d33; }
.modal .crop-zoom { display: flex; flex-direction: row; align-items: center; gap: 8px; width: 240px; margin-top: 8px; }
.modal .crop-zoom input { flex: 1; width: auto; margin: 0; }
.recovery-code { font: 600 20px/1.4 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 1px; text-align: center; padding: 10px;
                 background: var(--paper); border-radius: 8px; user-select: all; }
/* A classic password's first 8 characters: all ICQ takes (classic.js). */
.recovery-code .first-eight { background: var(--gold); color: #1d1b22; border-radius: 4px; padding: 0 2px; }
#signon-form label.agree { flex-direction: row; align-items: baseline; gap: 8px; font-weight: 400; }
#signon-form label.agree input { width: auto; flex: none; accent-color: var(--purple2); }
html:not(.desktop) .desktop-only { display: none; }
/* The desktop app (desktop.js): each conversation opens in a window of its own (window.html, which
   shows just its pane), so this window is only the buddy list, however wide it is. */
html.windowed #workspace { display: none !important; }
html.windowed #sidebar, html.windowed #app.conversation #sidebar { display: flex; width: 100%; min-width: 0; border-right: 0; }
/* A dialog in a window of its own (Chat Rooms, Find People, Get Info, Settings): it fills the window. */
body.conversation-window > .modal.panel { position: absolute; inset: 0; width: auto; max-height: none; border-radius: 0; box-shadow: none; }
/* The desktop app's update window: the new version's notes, and Settings' Check Now. */
.release-notes { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 2px 12px; font-size: 13px; }
.release-notes h4 { font-size: 13px; margin: 10px 0 2px; }
.release-notes p { margin: 6px 0; }
.release-notes ul { margin: 2px 0 6px; padding-left: 18px; }
.release-notes li { margin: 2px 0; }
.release-notes li.depth-1 { margin-left: 16px; }
.release-notes li.depth-2 { margin-left: 32px; }
.update-row { display: flex; align-items: center; gap: 10px; }
.big-avatar { font-size: 58px; text-align: center; line-height: 1.1; }
.avatar-picker { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-bottom: 6px; }
.avatar-picker button { background: none; border: 2px solid transparent; border-radius: 6px; font-size: 20px; cursor: pointer; padding: 1px 3px; }
.avatar-picker button[aria-checked="true"] { border-color: var(--gold); background: rgba(255,204,51,.25); }

/* Main layout: buddy list on the left, conversations on the right. */
#app { display: flex; height: 100vh; height: 100dvh;
       /* Installed on a phone: clear of the notch, rounded corners, and home indicator. */
       padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#sidebar { width: 260px; min-width: 220px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--card); }
#buddylist { flex: 1; overflow-y: auto; padding: 4px 0; }
#workspace { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.toolbar { display: flex; gap: 2px; padding: 6px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.toolbar button { background: none; border: 0; font-size: 17px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.toolbar button:hover { background: var(--paper); }
/* The first-run tour (tour.js): a card above the toolbar, and the button it's about lit up. */
.toolbar button.tour-on { background: rgba(59,130,246,.18); outline: 2px solid #3b82f6; }
.tour-card { margin: 6px 8px 0; padding: 10px 12px; border: 2px solid #3b82f6; border-radius: 8px; background: var(--card); font-size: 13px; }
.tour-card strong { display: block; font-size: 14px; margin: 2px 0; }
.tour-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.tour-buttons { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.toolbar .spacer { flex: 1; }
#stats-footer { text-align: center; padding: 3px; }

/* Buddy list */
.group-header { display: flex; align-items: center; gap: 4px; padding: 6px 10px 2px; font-size: 11px; font-weight: 700;
                color: var(--muted); text-transform: none; cursor: pointer; user-select: none; }
.group-header .chevron { width: 10px; transition: transform .15s; }
.group.collapsed .chevron { transform: rotate(-90deg); }
.group.collapsed .buddy { display: none; }
.buddy { display: flex; align-items: center; gap: 7px; padding: 4px 10px 4px 20px; cursor: default; user-select: none; }
.buddy:hover, .buddy:focus { background: var(--paper); outline: none; }
.buddy .icon { font-size: 18px; width: 22px; text-align: center; }
.buddy .name { font-weight: 600; }
.buddy.away .name { font-style: italic; }
.buddy.offline { color: var(--muted); }
.buddy.offline .name { font-weight: 400; }
.buddy .note { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buddy .text { min-width: 0; flex: 1; }
.dimmed { opacity: .5; }

.banner { display: flex; gap: 8px; align-items: center; padding: 7px 10px; font-size: 12px; background: rgba(255,204,51,.2); }
.banner.error { background: rgba(255,140,0,.15); border-radius: 0; }
.banner .text { flex: 1; }
.spinner { width: 12px; height: 12px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tabs (Trillian-style) */
#tabs { display: flex; gap: 2px; padding: 4px 6px 0; background: var(--paper); border-bottom: 1px solid var(--line); overflow-x: auto; min-height: 32px; }
.tab { display: flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid var(--line); border-bottom: 0; border-radius: 7px 7px 0 0;
       background: var(--paper); cursor: pointer; white-space: nowrap; font-size: 13px; }
.tab.active { background: var(--card); font-weight: 600; }
.tab .badge { background: #d62c2c; color: #fff; border-radius: 9px; font-size: 10px; padding: 0 5px; }
.tab .close { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0 2px; }
.tab.back { display: none; }
#panes { flex: 1; position: relative; min-height: 0; }
.pane { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--card); }
.pane.empty { align-items: center; justify-content: center; text-align: center; color: var(--muted); }

/* Conversations */
.log { flex: 1; overflow-y: auto; padding: 8px 12px; }
.line { padding: 1px 0; word-wrap: break-word; white-space: pre-line; }  /* line breaks from the server and apps (the welcome) */
.line .who { font-weight: 700; }
.line .who.mine { color: var(--mine); }
.line .who.theirs { color: var(--theirs); }
.line.system { color: var(--muted); font-style: italic; font-size: 12px; }
.line.sending { opacity: .55; }
.line .stamp { color: var(--muted); font-size: 10px; margin-right: 5px; font-variant-numeric: tabular-nums; }
.line .auto { font-size: 10px; font-weight: 700; color: var(--muted); }
.line .status { display: block; font-size: 11px; color: var(--muted); }
.line .status.failed { color: #c42121; }
/* A button on an IM from an app (Kibitz): "Join Spades table 12". */
.line .im-action { display: block; margin: 4px 0 2px; padding: 5px 12px; border-radius: 8px; border: 1px solid rgba(0,0,0,.25);
                   background: linear-gradient(var(--purple2), var(--purple)); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
/* Lines read back from your chat log when an IM opens (desktop.js): dimmed, between a note and a rule. */
.line.from-log { opacity: .55; }
.line.log-first::before { content: "Earlier, from your chat log"; display: block; font-size: 10px; font-style: normal; color: var(--muted); margin-bottom: 2px; }
.line.log-last { border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 6px; }
.buddy .note .join { font-size: 11px; padding: 0; margin-left: 6px; }
img.avatar-icon { width: 1.3em; height: 1.3em; object-fit: contain; border-radius: 20%; vertical-align: middle; }
.big-avatar img.avatar-icon { width: 72px; height: 72px; }
#me-avatar img.avatar-icon { width: 30px; height: 30px; }
.icon-picker { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.icon-picker img.avatar-icon { width: 40px; height: 40px; }
.buddy .name .warning { color: #c26a00; font-size: 12px; font-weight: 400; }
.host-mark { color: var(--purple2); font-weight: 800; }
.game-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.game-picks .fine { flex-basis: 100%; margin: 4px 0 0; }
.challenge { text-align: center; }
.challenge .big { font-size: 48px; line-height: 1.1; }
.challenge .headline { font-weight: 700; font-size: 15px; margin: 6px 0 2px; }
.chips.pick .chip { cursor: pointer; }
.chips.pick .chip.on { background: rgba(140,64,191,.22); outline: 1px solid var(--purple2); }
.interest-people .person { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.interest-people .person .name { font-weight: 600; }
.interest-people .person .fine { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.new-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600;
             background: rgba(47,168,79,.18); color: #0b5a36; vertical-align: 1px; }
@media (prefers-color-scheme: dark) { .new-badge { color: #8fe0b0; } }
.classic-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 600;
                 background: rgba(64,96,200,.16); color: #1d3f9a; vertical-align: 1px; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .classic-badge { color: #a9c1ff; } }
.typing { font-size: 11px; color: var(--muted); padding: 0 12px 2px; min-height: 16px; }
.compose { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.compose input { flex: 1; }

/* Rooms */
.room-body { flex: 1; display: flex; min-height: 0; }
.room-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
canvas.scene { display: block; width: 100%; height: 55%; min-height: 180px; cursor: pointer; border-bottom: 1px solid var(--line); }
.pane.room.text-only canvas.scene { display: none; }
.room-toolbar .overflow-note { font-size: 12px; color: var(--muted); margin-right: auto; }
.room-side { width: 170px; border-left: 1px solid var(--line); overflow-y: auto; }
.occupants { list-style: none; margin: 0; padding: 0; }
.occupants .buddy { padding-left: 10px; }
.directory { max-height: 50vh; overflow-y: auto; margin: -4px -6px 0; }
.room-entry { padding-left: 12px; }
.settings-rule { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.group-header.with-action { display: flex; align-items: center; }
.group-header .header-action { margin-left: auto; font-size: 16px; text-decoration: none; padding: 0 6px; }
.buddy.invite { gap: 6px; }
.buddy.invite .button { padding: 3px 10px; font-size: 12px; }
.buddy.empty { cursor: default; }
.buddy .badge { background: var(--purple2); color: #fff; border-radius: 9px; padding: 0 7px; font-size: 11px; font-weight: 700; }
.picker { max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line);
          border-radius: 8px; padding: 8px; }
.hidden-badge { font-size: 11px; color: #b35900; font-weight: 600; }
.invite-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.invite-row .code { font-family: ui-monospace, Menlo, monospace; font-weight: 700; }
.invite-row .text { flex: 1; min-width: 0; }
@media (max-width: 700px) { .room-side { display: none; } canvas.scene { height: 45%; } }

/* Profiles, Find People */
.profile-top { display: flex; gap: 14px; align-items: flex-start; }
.profile-top .big-avatar { font-size: 52px; }
.profile-name { font-size: 16px; font-weight: 800; }
.profile-top a { color: var(--theirs); font-weight: 600; }
.status-online { color: var(--online); }
.status-away { color: var(--away); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: rgba(255,204,51,.28); border: 0; border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
.chip:hover { background: rgba(255,204,51,.5); }
.about { background: var(--paper); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; }
/* Wraps on phones: the text box keeps a usable width and the rest moves to the next line. */
.search-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search-row input:not([type=checkbox]) { flex: 1 1 180px; min-width: 0; }
.search-row select { flex: 1 1 120px; min-width: 0; max-width: 100%; }
.search-row .check { white-space: nowrap; }
.results { max-height: 38vh; overflow-y: auto; margin: 0 -6px; }
.results .buddy { padding-left: 8px; cursor: pointer; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: var(--muted); opacity: .5; }
.dot.online, .dot.idle { background: var(--online); opacity: 1; }
.dot.away { background: var(--away); opacity: 1; }
.random { background: rgba(255,204,51,.1); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.random p { margin: 0; }

/* Menus and dialogs */
.menu { position: fixed; z-index: 20; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px;
        box-shadow: 0 6px 24px rgba(0,0,0,.2); min-width: 170px; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 5px 10px; border-radius: 5px; cursor: pointer; }
.menu button:hover:not(:disabled) { background: var(--purple2); color: #fff; }
.menu button:disabled { opacity: .4; cursor: default; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.menu .label { font-size: 11px; color: var(--muted); padding: 3px 10px; max-width: 280px; }  /* long headings wrap */
#modal-layer { position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; padding: 12px; }
.modal { background: var(--card); border-radius: 12px; overflow: hidden; width: min(440px, 100%); max-height: 92vh; display: flex; flex-direction: column;
         box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.modal .body { padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.modal .buttons { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
.modal label { font-weight: 600; font-size: 12px; display: flex; flex-direction: column; gap: 3px; }
.modal label.check { flex-direction: row; align-items: center; font-weight: 400; font-size: 13px; }
.modal label.check input { width: auto; }
.modal select { font: inherit; padding: 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }

/* Phones: one thing at a time. */
@media (max-width: 700px) {
  #sidebar { width: 100%; border-right: 0; }
  #app.conversation #sidebar { display: none; }
  #app:not(.conversation) #workspace { display: none; }
  .tab.back { display: flex; }
  #signon { max-width: none; margin: 0; border-radius: 0; min-height: 100dvh; box-shadow: none;
            padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .modal { max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px); }
}
/* Touch screens: phones zoom into any text box under 16px, and fingers need bigger targets. */
@media (pointer: coarse) {
  input, textarea, select { font-size: 16px; }
  .toolbar button { font-size: 20px; padding: 6px 9px; }
  .compose { padding-bottom: 10px; }
}
.line.warning { margin: 6px 0; padding: 8px 10px; border-radius: 8px; font-weight: 600; color: #b35900;
                background: rgba(255,140,0,.12); border: 1px solid rgba(255,140,0,.35); }
@media (prefers-color-scheme: dark) { .line.warning { color: #ffa94d; } }
.strip .title .number { font-weight: 600; opacity: .75; font-size: .85em; }
.former-names { margin: 10px 0; }
.former-names .fine { margin-left: 4px; }
fieldset.rename { border: 1px solid var(--line, rgba(0,0,0,.15)); border-radius: 10px; padding: 8px 12px 4px; margin: 0 0 10px; }
fieldset.rename legend { font-weight: 700; font-size: 12px; padding: 0 4px; }
.blocked-banner { display: flex; gap: 8px; align-items: center; padding: 6px 10px; font-size: 12px; background: rgba(220,40,40,.1); }
.blocked-banner span { flex: 1; }
.buddy.blocked { opacity: .4; }
.evidence { max-height: 120px; overflow-y: auto; font-size: 12px; padding: 6px 8px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); }
.blocked-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.button.danger { color: #c42121; }
.modal h3 { font-size: 13px; margin: 14px 0 4px; }
.request { text-align: center; }
.banner.info { background: rgba(140,64,191,.14); }
/* A buddy went live (live.js): at the top of the buddy list. */
.live-alert { display: flex; gap: 8px; align-items: center; padding: 7px 10px; font-size: 12px; background: rgba(230,40,40,.12); }
.live-alert .text { flex: 1; min-width: 0; }
.live-alert .note { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line.buzz { font-weight: 800; color: #d11; font-size: 14px; }
.line.emote { font-style: italic; color: #8c33b3; }
@media (prefers-color-scheme: dark) { .line.emote { color: #c792ea; } .line.buzz { color: #ff5c5c; } }
.buddy.idle .name { opacity: .6; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
                   30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
.shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97) both; }
@media (prefers-reduced-motion: reduce) { .shake { animation: none; } }
.room-toolbar { display: flex; gap: 12px; justify-content: flex-end; padding: 2px 8px; font-size: 12px; min-height: 22px; }
.room-toolbar .link { text-decoration: none; font-size: 12px; }
.big-emoji { font-size: 24px; }
.prop-ideas { display: flex; flex-wrap: wrap; gap: 2px; }
.prop-ideas .link { font-size: 22px; text-decoration: none; padding: 2px; }
.picture-settings { display: flex; flex-direction: column; gap: 6px; }
.backdrop-preview { width: 240px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.picture-settings progress { width: 100px; }
.prop-thumb { object-fit: contain; image-rendering: auto; }
.wardrobe { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; max-height: 200px; overflow-y: auto; }
.wardrobe-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.wardrobe-item .fine { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wardrobe-item .waiting { color: #e08a00; font-weight: 600; }
.wardrobe-item .remove { position: absolute; top: -4px; right: 4px; }
.wardrobe-item button[disabled] { opacity: .5; }
input.stand-in { width: 3.5em; flex: 0 0 auto !important; text-align: center; }
.format-bar { display: flex; align-items: center; gap: 6px; padding: 4px 8px 0; flex-wrap: wrap; font-size: 12px; }
.format-bar select { font-size: 12px; padding: 1px 2px; }
.format-bar .swatch { width: 26px; height: 20px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; }
.format-bar .fmt { min-width: 18px; text-align: center; color: var(--ink); }
.format-bar .fmt[aria-pressed="false"] { opacity: .45; }
.format-bar .sep { width: 1px; height: 14px; background: var(--line); }
.styled strong { font-weight: 700; }
/* Links in messages keep the sender's (readable) color; a click asks first (format.js). */
.styled a.msg-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.styled a.msg-link:hover { text-decoration-thickness: 2px; }
.modal .link-address { color: var(--muted); word-break: break-all; font-size: 13px; }
.status-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.status-presets .button { text-align: left; }
.buddy .busy { font-size: 11px; }
.room-main { position: relative; }
.scene-overlay { position: absolute; pointer-events: none; overflow: hidden; }
.scene-overlay img { position: absolute; object-fit: contain; }
header.strip.me { display: flex; align-items: center; gap: 8px; }
header.strip.me .me-text { flex: 1; min-width: 0; }  /* so a long status truncates instead of widening the strip */
#me-avatar { font-size: 26px; background: none; border: 0; padding: 0; cursor: pointer; line-height: 1; flex-shrink: 0; }
#me-status { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: left;
             display: block; max-width: 100%; }
#me-status:hover, #me-avatar:hover { opacity: .85; }
.avatar-grid { display: grid; grid-template-columns: repeat(8, 36px); gap: 4px; margin-bottom: 8px; }
.avatar-grid button { font-size: 22px; background: none; border: 1px solid transparent; border-radius: 6px; cursor: pointer; }
.avatar-grid button[aria-pressed="true"] { border-color: var(--line); background: var(--paper); }

/* Other networks (networks.js): AIM accounts' sections at the bottom of the buddy list. */
.network-badge { display: inline-block; font-size: 9px; font-weight: 700; color: #fff; background: #e8a90f; border-radius: 8px;
                 padding: 0 5px; vertical-align: 1px; letter-spacing: .02em; }
.network-status { display: flex; align-items: center; gap: 8px; padding: 4px 10px 6px 20px; font-size: 12px; color: var(--muted); }
.network-status span { flex: 1; }
.network-status.problem { color: #b36b00; cursor: pointer; }
.group.collapsed .network-status { display: none; }
/* The connection bar: a light for Palscape and each AIM account. */
#network-bar { display: flex; gap: 2px; padding: 2px 6px; border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
#network-bar .connection { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 11px; color: var(--ink);
                           background: none; border: 0; border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
#network-bar button.connection { cursor: pointer; }
#network-bar button.connection:hover, #network-bar button.connection:focus-visible { background: var(--paper); }
.light { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); opacity: .5; }
.light.online { background: #2fb344; opacity: 1; }
.light.away { background: #f2c12e; opacity: 1; }
.light.failed { background: #e5484d; opacity: 1; }
.light.invisible { background: none; border: 1.5px solid var(--muted); box-sizing: border-box; opacity: 1; }
.light.connecting { background: #f08c00; opacity: 1; animation: light-pulse 1.2s ease-in-out infinite; }
@keyframes light-pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .light.connecting { animation: none; } }
/* AIM buddy icons, the IM header's icon and Get Info button, and the Get Info dialog. */
.aim-icon { width: 18px; height: 18px; flex: none; object-fit: cover; border-radius: 3px; margin: 0 2px; }
.buddy.offline .aim-icon { opacity: .5; }
.aim-header { display: flex; align-items: center; gap: 8px; }
.aim-header > div:first-child { flex: 1; min-width: 0; }
.aim-header .aim-icon { width: 32px; height: 32px; }
.aim-get-info { background: none; border: 0; color: #fff; font-size: 16px; cursor: pointer; padding: 2px 4px; }
.aim-info { min-width: 280px; max-width: 420px; }
.aim-info-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.aim-info-top .aim-icon { width: 64px; height: 64px; border-radius: 8px; }
.aim-info-top .icon { font-size: 48px; }
.aim-info h4 { margin: 10px 0 4px; font-size: 12px; color: var(--muted); }
.aim-profile { white-space: pre-wrap; margin: 0; user-select: text; }
.network-accounts { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.network-account { display: flex; align-items: center; gap: 6px; }
.network-account > div { flex: 1; min-width: 0; }
.network-server { display: grid; grid-template-columns: 1fr 90px; gap: 8px; }
.network-server.hidden { display: none; }
.styled .highlight { border-radius: 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.compose .messagebox { flex: 1; min-width: 0; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 6px;
                      padding: 7px 9px; max-height: 6.5em; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.compose .messagebox:focus { outline: 2px solid var(--purple2); outline-offset: -1px; }
.compose .messagebox:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.compose .messagebox span[data-back] { border-radius: 2px; }
.format-bar .highlighter { display: inline-flex; align-items: center; gap: 2px; }
.format-bar .highlighter :disabled { opacity: .35; cursor: default; }
