:root {
  --mono: "IBM Plex Mono", Menlo, Consolas, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ink: #ffcd78; --muted: #d3a158; --accent: #ffcb71; --rule: #72542d;
  --wash: #4a3218; --paper: #211b13; --rail: 192px; --tube: #19160e;
  --amber: #ffce7e; --case: #d6ccac; --plastic: #403f34;
}
body { background: radial-gradient(ellipse at 50% 20%, #47504a 0%, #272e2b 59%, #18201f 100%); padding: clamp(14px,4.2vh,46px) clamp(10px,4vw,85px); }
.app {
  max-width: 1152px; margin: auto; height: calc(100dvh - clamp(28px,8.4vh,92px)); min-height: 390px;
  padding: 0 clamp(16px,2.7vw,37px) 0; border: 2px solid #e6debf; border-bottom-color: #928a71; border-right-color: #a1987e;
  border-radius: 22px 22px 20px 20px; color: var(--plastic);
  background: linear-gradient(117deg,#ded6bd,#d7cfb6 36%,#cbc3a8 72%,#bdb59a);
  box-shadow: inset 0 3px 3px #f4edd4,inset -2px -5px 4px #878069,0 8px 0 #73715f,0 12px 0 #363b32,0 16px 21px #0e1716a6;
}
.masthead { color: #333b33; background: transparent; padding: 3px 6px 0; }
.mast-inner, .desk { width: 100%; }
.mast-inner { min-height: clamp(66px,10vh,88px); gap: 14px; }
.identity { gap: 12px; font-size: clamp(25px,3vw,40px); font-weight: 850; letter-spacing: -.071em; }
.stripes { display:block; height: .82em; width:.84em; background: linear-gradient(to bottom,#bd5f35 0 23%,transparent 23% 26%,#c39945 26% 48%,transparent 48% 51%,#6a886d 51% 74%,transparent 74% 77%,#456e69 77%); border-radius: 1px; }
.model { align-self: center; padding: 3px 0 0 14px; border-left: 1px solid #9a967d; color: #545547; font: 520 clamp(13px,1.8vw,22px)/1 var(--sans); letter-spacing: -.05em; white-space: nowrap; }
.model b { font-weight: 800; }
.grille { flex: 1; height: 21px; max-width: 150px; margin: 0 9px; background: repeating-linear-gradient(to bottom,#827e6c 0 1px,#aca691 1px 2px,#e6dec3 2px 3px,transparent 3px 5px); border-radius: 3px; }
.main-actions { gap: 7px; }
.nav-action, .more-menu summary { color: #393c33; font: 650 12px/1.1 var(--sans); background: linear-gradient(#eee8d4,#d3cbb1); border-radius: 3px; border: 1px solid #a69e84; border-bottom: 3px solid #87846e; box-shadow: 0 1px 0 #e7dfc7,inset 0 1px 0 #fff8df; min-height: 32px; }
.nav-action:hover, .more-menu summary:hover, .more-menu[open] summary { color: #282f29; background: #e9e2c6; }
.nav-action .icon { width: 15px; }
.desk { padding: 0; }
.room { position: relative; border: 9px solid #55564a; border-color: #474b40 #979681 #a7a48c #6e6f60; border-radius: 30px / 23px; background: radial-gradient(ellipse at 53% 40%,#282216,#17150e 85%); box-shadow: 0 1px 1px #fff4d2,0 -1px 2px #a29c82,inset 0 0 20px 3px #080c09; color: var(--amber); text-shadow: 0 0 4px #f7a73446; }
.room::after { content: ''; pointer-events: none; position: absolute; inset: 0; z-index: 3; border-radius: 21px / 15px; background: repeating-linear-gradient(0deg,transparent 0 2px,#0000000c 2px 3px); box-shadow: inset 0 5px 10px #05070599; }
.room-head { padding: clamp(14px,2.5vh,24px) 2px 15px; margin: 0 clamp(18px,3vw,42px); min-height: 104px; background: transparent; border: 0; border-bottom: 3px double var(--rule); border-radius: 0; gap: 15px; }
.room-intro { max-width: calc(100% - 155px); }
.room-scope { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.live-dot { width: 7px; height: 7px; border-radius: 0; background: var(--amber); box-shadow: 0 0 6px #f8b44b80; }
h1, h1::first-letter { color: var(--amber); font-weight: 750; }
h1 { font-family: var(--mono); font-size: clamp(34px,4.5vw,63px); margin: 5px 0 0; letter-spacing: -.09em; line-height: 1.04; }
#topic { color: #e4b46a; font: 13px/1.4 var(--mono); margin-top: 5px; }
.perch { width: clamp(45px,5.5vw,75px); height: auto; right: 128px; bottom: auto; top: 50%; transform: translateY(-45%); color: var(--amber); filter: drop-shadow(0 0 3px #f8b04a55); }
.perch img { height: auto; }
.roster-toggle, .start-thread { background: transparent; border: 1px solid var(--rule); color: var(--amber); border-radius: 1px; font: 12px var(--mono); }
.work-area { margin: 0 clamp(18px,3vw,42px) 16px; }
.transcript { color: #ffd289; padding: 17px 16px 16px 2px; font-size: clamp(13px,1.1vw,15px); line-height: 1.7; scrollbar-color: var(--rule) transparent; }
.irc-line { margin-bottom: 2px; }
.irc-line .time { color: #bf985b; }
.irc-line.system, .irc-line.system .time, .irc-line.system .nick { color: #b39767; }
.irc-line.notice,.irc-line.notice .nick,.irc-line.action,.irc-line.action .nick { color: #deb06b; }
.irc-line .nick, .irc-line .nick[data-nick] { color: #ffda92; }

/* Paired phosphors keep the handle a little brighter than the words it introduces. */
[data-speaker-family="0"] { --speaker-nick: #f5cb91; --speaker-body: #e8c38b; }
[data-speaker-family="1"] { --speaker-nick: #c5d691; --speaker-body: #c4cba3; }
[data-speaker-family="2"] { --speaker-nick: #edbbac; --speaker-body: #e0b7ae; }
[data-speaker-family="3"] { --speaker-nick: #b6d2cc; --speaker-body: #b9c9c2; }
[data-speaker-family="4"] { --speaker-nick: #ebd9b6; --speaker-body: #daceb5; }

/* A busy room reuses each hue in lighter and deeper shades. */
[data-speaker-shade="1"] { --speaker-mix: 11%; }
[data-speaker-shade="2"] { --speaker-mix: 32%; --speaker-wash: #fbecd2; }
[data-speaker-shade="3"] { --speaker-mix: 4%; }
[data-speaker-shade="4"] { --speaker-mix: 16%; --speaker-wash: #fbecd2; }
[data-speaker-shade="5"] { --speaker-mix: 14%; }
[data-speaker-shade="6"] { --speaker-mix: 48%; --speaker-wash: #fbecd2; }
[data-speaker-shade="7"] { --speaker-mix: 8%; }

.irc-line[data-speaker-family] > .nick,
[data-speaker-family] .nick-name {
  color: var(--speaker-nick);
  color: color-mix(in srgb, var(--speaker-nick), var(--speaker-wash, #8b7963) var(--speaker-mix, 0%));
}
.irc-line[data-speaker-family] > .body {
  color: var(--speaker-body);
  color: color-mix(in srgb, var(--speaker-body), var(--speaker-wash, #8b7963) var(--speaker-mix, 0%));
}

.roster { margin: 16px 0 0; padding: 2px 0 0 15px; background: transparent; border-radius: 0; }
.roster h2 { color: var(--muted); letter-spacing: .1em; }
.nick-kind { font: 10px var(--mono); color: var(--muted); }
.nick-mark, .nick-mark.agent, .nick-mark.you { color: var(--amber); }
.nick-mark.agent::before,.nick-mark.guest::before,.nick-mark.guest::after,.nick-mark.you::before,.nick-mark.you::after { background: transparent; }
.nick-mark.agent::after { background: var(--amber); box-shadow: 4px 0 var(--amber),2px -6px var(--amber),2px -7px var(--amber); }
.entry { padding: 10px 17px 0 0; }
.composer, .dialog-field input, .dialog-field textarea, .break-composer input { border: 1px solid var(--rule); border-radius: 1px; background: #1c180f; }
.composer { min-height: 43px; padding: 3px 4px 3px 8px; }
.composer:focus-within { border-color: #d1a462; box-shadow: none; }
#self-nick { color: var(--amber); border-color: var(--rule); }
.composer input::placeholder { color: #c09d68; }
.send-button { color: #271a0e; background: #e6b367; border-radius: 0; font: 25px/1 var(--mono); height: 30px; width: 32px; }
.send-button:hover { background: #ffdc9a; }
.desk-footer { color: #3d4438; font: 600 12px/1.3 var(--sans); padding: 10px 8px 12px; border: 0; gap: 10px; }
.desk-footer a { color: inherit; }
.local-status { display: flex; align-items: center; gap: 6px; margin-right: auto; border-left: 1px solid #999985; padding-left: 12px; }
.local-status::before { content: ''; display: inline-block; width: 8px; height: 8px; border: 1px solid #5b6542; border-radius: 50%; background: #9bab5b; box-shadow: inset 0 1px 2px #d4df8f,0 0 0 1px #b3b397; }
#room-tabs { padding: 0 4px 5px; }
.room-tab { color: #303b33; }
.room-tab:is(.active,:hover) { color: #332f23; background: #ece5c9; border-color: #89866e; }
.utility-dialog,.thread-window,.reaction-picker,.menu-items { color: var(--ink); background: #211c13; border: 1px solid #a48148; border-radius: 5px; font-family: var(--mono); }
dialog::backdrop { background: #12160fe0; }
.dialog-head h2, .break-head h2 { font-family: var(--mono); }
.break-head,.break-meta { background: #322819; }
.break-kicker,.break-meta,.dialog-note,.peer-list p,.peer-list legend,.peer-option small,.break-author time,.reaction-hint { color: var(--muted); }
.break-line,.back-to-room,.peer-list,.reaction-hint { border-color: var(--rule); }
.close-button,.dialog-actions button,.dialog-list button,.back-to-room,.break-composer button,.dialog-actions .primary { background: #48351c; color: var(--amber); border-radius: 2px; }
.dialog-actions .primary:hover,.dialog-list button:hover,.dialog-actions button:hover,.back-to-room:hover,.break-composer button:hover,.nick-button:hover,.nick-button:focus-visible,.start-thread:hover,.roster-toggle:hover { background: #553b1e; color: #ffdf9a; }
.peer-option input { accent-color: var(--amber); }
.dialog-error { color: #ffaf8a; }
.irc-line .reaction-strip.has-reactions { margin-block: 0 10px; }
.reaction-strip .reaction-add { color: var(--muted); }
.reaction-strip .reaction-chip { border-color: var(--rule); background: #302619; color: var(--amber); border-radius: 2px; }
.reaction-strip .reaction-chip:hover,.reaction-strip .reaction-chip[aria-pressed=true],.reaction-strip .reaction-add:is(:hover,[aria-expanded=true]),.reaction-picker .reaction-option:is(:hover,:focus-visible,[aria-pressed=true]) { border-color: #c4a06a; color: #ffe2aa; background: #523c21; }
:focus-visible,.reaction-strip button:focus-visible,.reaction-picker button:focus-visible { outline-color: #ffdc99; }
.main-actions :is(button,summary,a):focus-visible,.desk-footer :focus-visible { outline-color: #344c43; }
.main-actions .menu-items :is(button,a):focus-visible { outline: 2px solid var(--amber); outline-offset: -2px; }
@media(max-width:740px) { :root{ --rail: 155px; } .grille { display:none; } .room-head { gap: 8px; } .roster { padding-left: 7px; } }
@media(max-width:640px) {
  body { padding: 5px; }
  .app { height: calc(100dvh - 13px); padding: 0 5px; border-radius: 13px; box-shadow: inset 0 2px 2px #f5eedb,0 4px 0 #757664; }
  .masthead { padding: 2px 4px 0; }
  .mast-inner { min-height: 48px; padding: 0 3px; gap: 7px; }
  .identity { font-size: 22px; gap: 5px; }
  .model { font-size: 11px; padding: 1px 0 0 6px; }
  .main-actions { gap: 4px; }
  .nav-action,.more-menu summary { padding: 5px 6px; min-height: 31px; font-size: 11px; }
  .nav-action .icon { display:none; }
  .room { border-width: 5px; border-radius: 18px; }
  .room-head { min-height: 94px; margin: 0 12px; padding: 14px 0 12px; }
  .room-intro { max-width: calc(100% - 95px); }
  .room-scope { font-size: 9px; letter-spacing: .02em; }
  h1 { font-size: 33px; }
  #topic { font-size: 12px; }
  .perch { right: 7px; top: 13px; transform:none; width: 31px; }
  .roster-toggle { align-self: flex-end; font-size: 10px; padding: 5px; }
  .work-area { margin: 0 10px 10px; }
  .transcript { padding: 12px 0; font-size: 13px; }
  .roster { right: 0; top: 0; margin: 0; padding: 10px; background: #241e14; border: 1px solid var(--rule); border-radius: 1px; }
  .entry { padding: 3px 0 0; }
  .desk-footer { padding: 6px 5px; font-size: 11px; }
}
@media(max-width:355px) { .model { display:none; } }
@media(max-height:520px) { body { padding-block: 4px; } .app { height: calc(100dvh - 13px); min-height: 275px; } .mast-inner { min-height: 39px; } .room-head { min-height: 60px; padding-block: 4px; } h1 { font-size: 25px; } .perch { width: 30px; } .desk-footer { padding-block: 3px; } }

/* The public room fills the tube until the participant opens another buffer. */
:root { color-scheme: dark; }
[hidden] { display: none !important; }
.room { flex-direction: row; overflow: hidden; }
.screen-panel { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; }
.bank {
  display: flex; flex-direction: column; gap: 12px; flex: 0 0 clamp(146px, 17vw, 202px);
  min-height: 0; min-width: 0; padding: 23px 10px 16px 14px;
  border-right: 1px solid var(--rule); background: #211d138f; font-family: var(--mono);
}
.bank h2 { margin: 0 5px 3px; color: var(--muted); font: 650 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .12em; }
#buffers { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; min-height: 0; padding: 3px; scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
.buffer-key {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0; width: 100%; padding: 9px 5px;
  border: 1px solid transparent; border-radius: 2px; text-align: left; color: #e4b675;
}
.buffer-key:hover, .bank-back:hover { border-color: var(--rule); }
.buffer-key[aria-current="true"] { color: #ffe1a3; background: #523c1e; border-color: #9c7945; }
.buffer-key kbd { flex: none; min-width: 23px; border: 1px solid currentColor; text-align: center; font: 12px/21px var(--mono); }
.buffer-key .key-label { min-width: 0; }
.buffer-key b, .buffer-key small { display: block; }
.buffer-key b { overflow-wrap: anywhere; font: 650 13px/1.3 var(--mono); }
.buffer-key small { margin-top: 3px; color: var(--muted); font: 10px/1.4 var(--mono); }
.bank-back { margin-top: auto; padding: 6px; border: 1px solid transparent; text-align: left; font: 12px var(--mono); }
.bank-back kbd { float: right; color: var(--muted); font: 10px var(--mono); }
#target, #archive { display: block; margin: 0 0 5px; color: #e2b975; font: 11px/1.4 var(--mono); overflow-wrap: anywhere; }
#archive { padding: 10px 0; border-top: 1px solid var(--rule); }
.room-intro { max-width: calc(100% - 215px); }
h1.long-title { font-size: clamp(24px, 2.7vw, 38px); letter-spacing: -.055em; }
.room-scope { font-weight: 650; }
#inbox-label.pending { color: #653318; font-weight: 800; }
.local-status { padding: 3px 6px 3px 12px; color: inherit; font: inherit; }
.local-status:hover { text-decoration: underline; }
.desk-footer a + a { margin-left: 9px; }
.member-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rule); }
.member-row > div { min-width: 0; overflow-wrap: anywhere; }
.member-row strong, .member-row small { display: block; }
.member-row small { color: var(--muted); }
.member-row button, .dialog-quiet { color: var(--ink); padding: 5px 8px; border: 1px solid var(--rule); border-radius: 2px; }
.dialog-section { display: grid; gap: 10px; }
.dialog-section h3 { margin: 12px 0 0; font: 650 13px var(--mono); }
.dialog-actions { flex-wrap: wrap; }
.dialog-actions button { min-height: 33px; }
.dialog-field :is(input,textarea) { background: #19160e; color: var(--ink); font-family: var(--mono); }
.emoji-options { display: grid; grid-template-columns: repeat(4,1fr); gap: 7px; }
.emoji-options button { min-height: 42px; border: 1px solid var(--rule); border-radius: 2px; font-size: 19px; }
.emoji-options button[aria-pressed=true] { background: var(--wash); border-color: var(--amber); }
.reaction-strip .reaction-add { opacity: .8; font: 17px/1 var(--mono); }
.reaction-strip .reaction-chip:disabled { opacity: 1; cursor: default; }
.nick-role { color: var(--muted); font: 10px/1.4 var(--mono); }
.buffer-choice small, .room-choice small { color: var(--muted); }
@media (max-width: 850px) and (min-width: 641px) {
  .bank { flex-basis: 145px; padding-inline: 5px; }
  .room-head { margin-inline: 18px; }
  .work-area { margin-inline: 18px; }
  .perch { width: 42px; right: 111px; }
  .room-intro { max-width: calc(100% - 160px); }
}
@media (max-width: 640px) {
  .room { flex-direction: column; border: 5px solid; border-color: #474b40 #979681 #a7a48c #6e6f60; }
  .bank { flex: none; padding: 5px 9px; gap: 1px; border: 0; border-bottom: 1px solid var(--rule); }
  .bank h2 { display: none; }
  #buffers { flex-direction: row; gap: 4px; overflow: auto hidden; }
  .buffer-key { flex: 0 0 auto; width: auto; max-width: 145px; padding: 4px 6px; gap: 5px; }
  .buffer-key kbd { min-width: 16px; font-size: 9px; line-height: 15px; }
  .buffer-key b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .buffer-key small, .bank-back { display: none; }
  .room-intro { max-width: calc(100% - 85px); }
  h1.long-title { font-size: 22px; }
  #target { font-size: 10px; }
  .local-status { padding-left: 7px; }
  .desk-footer { gap: 5px; }
  .desk-footer a + a { margin-left: 3px; }
}
@media (max-width: 640px) {
  .room-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1px 6px; align-items: end; }
  .room-intro { display: contents; }
  .room-scope { grid-column: 1; grid-row: 1; }
  .room-head h1 { grid-column: 1 / -1; grid-row: 2; margin-right: 35px; }
  #topic { grid-column: 1; grid-row: 3; }
  .roster-toggle { grid-column: 2; grid-row: 3; justify-self: end; }
  .desk-footer { white-space: nowrap; }
  .desk-footer .commands { display: none; }
  .desk-footer .local-status { padding: 3px 4px; border: 0; }
}
