:root {
  /* the theme: every value here is set from the workspace's look */
  --navy: #8774e1;          /* primary: buttons, links, the brand */
  --on-primary: #ffffff;
  --gold: #a99cf0;          /* accent: highlights, marks, quotes */
  --gold-soft: #3c3653;
  --sand: #0f0f0f;          /* page */
  --ink: #ffffff;           /* text */
  --muted: #aaaaaa;
  --line: #2f2f2f;
  --card: #212121;          /* panels, lists, dialogs */
  --hover: #2c2c2c;
  --sunk: #282828;          /* empty picture frames, search boxes */
  --input: #2c2c2c;
  --mine: #8774e1;          /* my chat bubbles */
  --on-mine: #ffffff;
  --theirs: #212121;        /* everyone else's */
  --wall: #0f0f0f;          /* behind the bubbles */
  --wall-ink: rgba(255, 255, 255, .07);
  --composer: #181818;
  --link: #a99cf0;
  --r: 14px;                /* corner rounding */
  color-scheme: dark;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-head: var(--font-body);
  --danger: #b42318;
  --ok: #217a4b;
  --tabbar: 62px;
  font-family: var(--font-body);
  color: var(--ink);
}
h1, h2, h3, .brand, .room-list-head h2, .chat-title b, .ws-name, .ws-switch, .info-top h2, .idea h4, #ip-title { font-family: var(--font-head); }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--sand); font-size: 15px; -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 17px; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.error { color: var(--danger); margin: 8px 0; }
.hint { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; }

button, .button {
  font: inherit; font-size: 14px; padding: 8px 13px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center;
  gap: 6px; text-decoration: none; white-space: nowrap; min-height: 38px;
}
button.primary, .button.primary { background: var(--navy); border-color: var(--navy); color: var(--on-primary); }
button.danger { color: var(--danger); border-color: #efc6c1; }
button.link { border: 0; background: none; color: var(--navy); padding: 6px 4px; min-height: 0; }
.danger-text { color: var(--danger) !important; }
button:disabled { opacity: .5; cursor: default; }
button.on { background: var(--gold-soft); border-color: var(--gold); }
input, select, textarea {
  font: inherit; font-size: 16px; /* below 16px a phone zooms in on focus */
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--input); color: var(--ink);
}
select { width: auto; max-width: 100%; }
textarea { resize: none; }
label { display: block; margin: 12px 0; font-weight: 500; font-size: 14px; }
label input, label select, label textarea { margin-top: 4px; }

/* ---- sign in ---------------------------------------------------------------- */
.signin { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) * 1.5); padding: 24px; width: min(380px, 100%); }
.card button { width: 100%; justify-content: center; margin-top: 6px; }

/* ---- frame ------------------------------------------------------------------ */
#app { min-height: 100%; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--card); border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 4px; }
.tab { border-color: transparent; background: transparent; position: relative; }
.tab.active { background: var(--sand); border-color: var(--line); color: var(--navy); font-weight: 600; }
.tab .ico { font-size: 15px; color: var(--gold); }
.badge {
  background: var(--danger); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px;
  font-weight: 600; line-height: 17px; min-width: 17px; text-align: center;
}
.badge.live { background: var(--ok); }
.who { margin-left: auto; display: flex; align-items: center; gap: 6px; min-width: 0; }
.online { display: flex; gap: 3px; }
.dot {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 600; color: #fff; flex: none;
}
.bell { border: 0; background: none; min-height: 0; padding: 6px; color: var(--muted); position: relative; }
.bell.on { color: var(--gold); }
.bell.on::after { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.connection { margin: 0; padding: 6px 16px; background: var(--gold-soft); font-size: 13px; text-align: center; }

.view { padding: 14px 16px 40px; max-width: 1280px; margin: 0 auto; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

.desktop-only { }
.mobile-only { display: none !important; }

/* ---- photos ----------------------------------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.add-buttons, .filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.drop-hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.uploads { display: grid; gap: 6px; margin: 10px 0; }
.upload { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; font-size: 13px; }
.upload .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload progress { width: 120px; accent-color: var(--navy); }
.upload.failed { border-color: #efc6c1; color: var(--danger); }

.albums { display: flex; gap: 10px; overflow-x: auto; padding: 12px 0 6px; scrollbar-width: thin; }
.album {
  flex: none; width: 128px; border: 1px solid var(--line); border-radius: calc(var(--r) * 1.25); background: var(--card);
  padding: 0; overflow: hidden; display: block; text-align: left; min-height: 0;
}
.album.active { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.album .cover { width: 100%; aspect-ratio: 4/3; background: var(--sunk) center/cover no-repeat; display: block; }
.album .label { padding: 6px 8px; font-size: 13px; line-height: 1.3; }
.album .label b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-top: 8px; }
.day { grid-column: 1 / -1; font-weight: 600; font-size: 13px; color: var(--muted); padding: 12px 2px 2px; }
.tile {
  position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--sunk);
  cursor: pointer; border: 0; padding: 0; min-height: 0; display: block; width: 100%;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .play {
  position: absolute; inset: auto 6px 6px auto; background: rgba(0,0,0,.6); color: #fff; border-radius: calc(var(--r) * 1.5);
  font-size: 11px; padding: 2px 7px;
}
.tile .noimg { display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--muted); padding: 6px; text-align: center; }
.tile .check {
  position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0,0,0,.25); display: none;
}
.selecting .tile .check { display: block; }
.tile.selected .check { background: var(--navy); }
.tile.selected::after { content: ""; position: absolute; inset: 0; border: 3px solid var(--navy); border-radius: 6px; }
.selection-bar {
  position: sticky; top: 56px; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--navy); color: var(--on-primary); padding: 8px 12px; border-radius: calc(var(--r) * 1.25); margin: 8px 0;
}
.selection-bar span { margin-right: auto; }
.more { margin: 16px auto; display: flex; }

.dropzone {
  position: fixed; inset: 0; z-index: 60; background: rgba(13, 47, 79, .82); display: grid; place-items: center;
  color: #fff; font-size: 26px; pointer-events: none;
}
.dropzone div { border: 3px dashed rgba(255,255,255,.7); border-radius: 18px; padding: 50px 70px; }

/* ---- lightbox --------------------------------------------------------------- */
.lightbox { position: fixed; inset: 0; z-index: 50; background: #0b0f14; color: #fff; display: grid; grid-template-rows: auto 1fr auto; }
.lb-top, .lb-bottom { display: flex; gap: 8px; padding: 10px 12px; align-items: center; }
.lb-top { padding-top: max(10px, env(safe-area-inset-top)); }
.lb-bottom { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.lb-meta { margin-right: auto; font-size: 13px; color: #c9ced6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox button, .lightbox .button { background: #1f2630; border-color: #333c48; color: #fff; }
.lightbox input, .lightbox select { background: #1f2630; border-color: #333c48; color: #fff; }
.lb-stage { min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-nav { position: fixed; top: 50%; transform: translateY(-50%); font-size: 30px; width: 46px; height: 64px; justify-content: center; opacity: .8; z-index: 51; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }

/* ---- rooms (chat and ideas) ------------------------------------------------- */
.rooms-view { display: grid; grid-template-columns: 340px 1fr; gap: 16px; align-items: start; }
.room-list { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) * 1.75); padding: 8px 0; position: sticky; top: 70px; max-height: calc(100dvh - 96px); overflow-y: auto; }
.room-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 14px 8px; }
.room-list-head h2 { font-size: 22px; }
.room-list ul { list-style: none; margin: 0; padding: 0; }
.search { margin: 0 12px 8px; width: calc(100% - 24px); border-radius: calc(var(--r) * 1.25); background: var(--sand); border-color: transparent; padding: 8px 12px; }
.icon-btn { border: 0; background: none; min-height: 0; padding: 6px; color: var(--navy); border-radius: 50%; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--sand); }
.room-none { grid-column: 2; }
.room { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) * 1.75); display: flex; flex-direction: column; min-height: 0; }
.room-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.room-title { flex: 1; min-width: 0; }
.room-title p { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { display: none !important; }

/* a conversation in the list: picture, name and time, last line and count */
.conv {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 14px; border: 0; border-radius: 0;
  background: transparent; text-align: left; min-height: 64px;
}
.conv:hover { background: var(--hover); }
.conv.active { background: var(--sand); }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 16px; letter-spacing: .02em;
}
.avatar.big { width: 40px; height: 40px; font-size: 14px; }
.conv-main { flex: 1; min-width: 0; display: grid; gap: 3px; border-bottom: 1px solid var(--line); padding-bottom: 9px; margin-bottom: -9px; }
.conv-top, .conv-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conv-top b { flex: 1; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.conv-top time { font-size: 12px; color: var(--muted); flex: none; }
.conv-line { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .conv-top time { color: var(--ok); font-weight: 600; }
.conv.unread .conv-line { color: var(--ink); }
.count { background: var(--ok); color: #fff; border-radius: 999px; font-size: 12px; min-width: 21px; height: 21px; line-height: 21px; text-align: center; padding: 0 6px; flex: none; }
.typing-line { color: var(--ok) !important; font-style: italic; }

/* ---- one conversation ------------------------------------------------------- */
#chat-room { height: calc(100vh - 100px); height: calc(100dvh - 100px); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--card); }
.chat-who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 2px 6px; text-align: left; min-height: 0; }
.chat-title { display: grid; min-width: 0; }
.chat-title b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-title span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.messages-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.messages {
  flex: 1; overflow-y: auto; padding: 10px 4% 14px; display: flex; flex-direction: column; overscroll-behavior: contain;
  /* the wall behind the bubbles: sand, with a faint pattern of the gulf */
  background-color: var(--wall);
}
.pill-row { display: flex; justify-content: center; margin: 8px 0; }
.pill-row.sticky { position: sticky; top: 4px; z-index: 2; }
.pill {
  background: var(--card); color: var(--muted); font-size: 12.5px; padding: 5px 12px; border-radius: var(--r);
  box-shadow: 0 1px 1px rgba(0,0,0,.08); display: inline-flex; align-items: center; gap: 8px; border: 0; min-height: 0;
}
.pill .join { background: var(--ok); color: #fff; border: 0; border-radius: 999px; padding: 3px 12px; min-height: 0; font-size: 12.5px; font-weight: 600; }
.unread-divider { display: flex; justify-content: center; margin: 10px -4%; background: var(--hover); padding: 4px 0; }
.unread-divider span { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.msg { display: flex; align-items: flex-end; gap: 6px; margin-top: 2px; max-width: 100%; transition: transform .15s; position: relative; }
.msg.first { margin-top: 10px; }
.msg.mine { justify-content: flex-end; }
.msg .gutter { width: 30px; flex: none; }
.msg .gutter .dot { width: 30px; height: 30px; }
.msg .stack { display: flex; flex-direction: column; max-width: min(560px, 78%); min-width: 0; }
.msg.mine .stack { align-items: flex-end; }
.bubble-row { display: flex; align-items: flex-start; gap: 2px; max-width: 100%; }
.msg.mine .bubble-row { flex-direction: row-reverse; }
.bubble {
  position: relative; background: var(--theirs); color: var(--ink); border-radius: calc(var(--r) * 1.5); padding: 6px 9px 7px 10px;
  box-shadow: 0 1px 1px rgba(0,0,0,.1); min-width: 0; max-width: 100%; overflow-wrap: anywhere; line-height: 1.38; font-size: 15px;
}
.msg.mine .bubble { background: var(--mine); color: var(--on-mine); }
.msg.mine .bubble .stamp, .msg.mine .bubble .ticks:not(.seen) { color: color-mix(in srgb, var(--on-mine) 60%, transparent); }
/* the little tail on the last bubble of a run */
.msg.last:not(.mine) .bubble { border-bottom-left-radius: 4px; }
.msg.last.mine .bubble { border-bottom-right-radius: 4px; }
.msg.last:not(.mine) .bubble::before, .msg.last.mine .bubble::before {
  content: ""; position: absolute; bottom: 0; width: 10px; height: 13px; background: inherit;
}
.msg.last:not(.mine) .bubble::before { left: -6px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.msg.last.mine .bubble::before { right: -6px; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.bubble .who { display: block; font-size: 13px; margin-bottom: 2px; }
.bubble .text { white-space: pre-wrap; }
.bubble a { color: var(--link); }
.msg.mine .bubble a { color: inherit; text-decoration: underline; }
/* the time sits in the bubble's corner, with room kept for it at the end of the text */
.stamp { float: right; margin: 8px 0 -3px 10px; font-size: 11px; line-height: 1; color: var(--muted); display: inline-flex; gap: 3px; align-items: center; white-space: nowrap; }
.ticks { display: inline-flex; color: var(--muted); }
.ticks.seen { color: #2f8fd8; }
.bubble.only-media { padding: 3px; }
.bubble.only-media .stamp {
  position: absolute; right: 8px; bottom: 8px; top: auto; float: none; margin: 0;
  background: rgba(0,0,0,.45); color: #fff; padding: 1px 6px; border-radius: var(--r);
}
.bubble.only-media .ticks { color: #fff; }

.quote {
  display: grid; text-align: left; width: 100%; background: color-mix(in srgb, var(--ink) 7%, transparent); border: 0; border-left: 4px solid var(--q, var(--gold));
  border-radius: 6px; padding: 5px 8px; margin: 2px 0 5px; min-height: 0; font-size: 13px; gap: 1px; cursor: pointer;
}
.quote b { color: var(--q, var(--gold)); font-size: 12.5px; }
.quote span, .quote i { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.bubble-media { display: grid; gap: 2px; border-radius: 9px; overflow: hidden; margin: 1px 0 3px; }
.bubble.only-media .bubble-media { margin: 0; }
.bubble-media .tile { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.bubble-media.n1 { width: min(300px, 64vw); }
.bubble-media.n1 .tile { aspect-ratio: 4 / 3; }
.bubble-media.n2 { grid-template-columns: 1fr 1fr; width: min(300px, 64vw); }
.bubble-media.n2 .tile, .bubble-media.n4 .tile { aspect-ratio: 1; }
.bubble-media.n3 { grid-template-columns: 1fr 1fr; width: min(300px, 64vw); }
.bubble-media.n3 .tile:first-child { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
.bubble-media.n3 .tile:not(:first-child) { aspect-ratio: 1; }
.bubble-media.n4 { grid-template-columns: 1fr 1fr; width: min(300px, 64vw); }
.more-count { position: absolute; inset: 0; background: rgba(0,0,0,.45); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 600; }

.more {
  border: 0; background: none; min-height: 0; padding: 2px 6px; color: var(--muted); opacity: 0; font-size: 16px; line-height: 1;
  border-radius: 50%; align-self: center;
}
.msg:hover .more { opacity: 1; }
.reactions { display: flex; flex-wrap: wrap; gap: 3px; margin: -6px 8px 0; position: relative; z-index: 1; }
.react {
  min-height: 0; padding: 1px 7px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px;
  box-shadow: 0 1px 1px rgba(0,0,0,.06); gap: 3px;
}
.react span { font-size: 12px; color: var(--muted); }
.react.mine { background: var(--gold-soft); border-color: var(--gold); }
.seen-by { align-self: flex-end; font-size: 11.5px; color: var(--muted); margin: 3px 4px 0; }
.msg.flash .bubble { animation: flash 1.4s; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px var(--gold); } 100% { box-shadow: 0 1px 1px rgba(0,0,0,.1); } }
.msg.held .bubble { filter: brightness(.94); }
.msg.will-reply::before { content: "↩"; position: absolute; left: -30px; top: 50%; transform: translateY(-50%); color: var(--navy); font-size: 18px; }

.typing-bubble {
  align-self: flex-start; margin: 8px 0 0 36px; background: var(--theirs); border-radius: calc(var(--r) * 1.5); padding: 10px 12px; display: flex; gap: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,.1);
}
.typing-bubble span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.typing-bubble span:nth-child(2) { animation-delay: .15s; }
.typing-bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.jump {
  position: absolute; right: 16px; bottom: 14px; width: 42px; height: 42px; border-radius: 50%; background: var(--card); border: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.18); display: grid; place-items: center; color: var(--muted); padding: 0; z-index: 3;
}
.jump b { position: absolute; top: -6px; right: -4px; background: var(--ok); color: #fff; font-size: 11px; border-radius: 999px; min-width: 20px; height: 20px; line-height: 20px; text-align: center; padding: 0 5px; }

/* options for one message */
.menu-scrim { position: fixed; inset: 0; z-index: 70; background: transparent; }
.msg-menu {
  position: fixed; z-index: 71; background: var(--card); border-radius: calc(var(--r) * 1.75); box-shadow: 0 8px 28px rgba(0,0,0,.2);
  padding: 8px; width: 300px; display: grid; gap: 6px;
}
.menu-reactions { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; padding: 2px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.menu-reactions button { border: 0; background: none; font-size: 22px; padding: 4px; min-height: 0; border-radius: 50%; width: 38px; height: 38px; justify-content: center; }
.menu-reactions button:hover, .menu-reactions button.on { background: var(--sand); }
.menu-actions { display: grid; }
.menu-actions button { border: 0; background: none; justify-content: flex-start; padding: 10px 10px; border-radius: var(--r); font-size: 15px; }
.menu-actions button:hover { background: var(--sand); }
.msg-menu.sheet {
  left: 0; right: 0; bottom: 0; width: auto; border-radius: 16px 16px 0 0; padding: 12px 12px max(14px, env(safe-area-inset-bottom));
  animation: up .18s ease-out;
}
.msg-menu.sheet ~ .menu-scrim, .menu-scrim:has(+ .msg-menu.sheet) { background: rgba(0,0,0,.25); }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }

/* writing */
.thumbs { display: flex; flex-wrap: wrap; gap: 4px; }
.thumbs .tile { width: 110px; height: 110px; aspect-ratio: auto; }
.attach-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 6px; }
.attach-row:empty { display: none; }
.attach { position: relative; width: 64px; height: 64px; border-radius: var(--r); overflow: hidden; background: var(--sunk); font-size: 11px; display: grid; place-items: center; }
.attach img { width: 100%; height: 100%; object-fit: cover; }
.attach .x { position: absolute; top: 2px; right: 2px; min-height: 0; padding: 0 6px; font-size: 13px; border-radius: calc(var(--r) * 1.25); }
.attach progress { position: absolute; left: 4px; right: 4px; bottom: 4px; width: auto; height: 6px; }
.composer { background: var(--composer); padding: 6px 8px; padding-bottom: max(6px, env(safe-area-inset-bottom)); display: grid; gap: 6px; border-top: 1px solid var(--line); }
.composer-row { display: flex; gap: 6px; align-items: flex-end; }
.composer-row textarea {
  max-height: 140px; border-radius: 22px; border: 0; padding: 10px 16px; background: var(--input); color: var(--ink); line-height: 1.35;
  box-shadow: 0 1px 1px rgba(0,0,0,.06); min-height: 44px;
}
.composer-row textarea:focus { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--navy) 30%, transparent); }
.menu-reactions button { flex: none; }
.attach-btn { margin: 0; width: 44px; height: 44px; color: var(--muted); flex: none; cursor: pointer; }
.send {
  width: 44px; height: 44px; min-height: 44px; border-radius: 50%; border: 0; background: var(--navy); color: var(--on-primary); padding: 0;
  justify-content: center; flex: none; transition: transform .1s, background .15s; opacity: .55;
}
.composer.has-text .send { opacity: 1; background: var(--ok); }
.send:active { transform: scale(.92); }
.reply-bar { display: flex; align-items: center; gap: 6px; padding: 0 6px; }
.reply-quote { flex: 1; min-width: 0; background: var(--card); border-left: 4px solid var(--gold); border-radius: var(--r); padding: 6px 10px; display: grid; font-size: 13px; }
.reply-quote span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar .icon-btn { font-size: 22px; color: var(--muted); width: 36px; height: 36px; }

/* ---- ideas ------------------------------------------------------------------ */
#ideas-room { padding-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px; align-items: center; }
.chip { min-height: 0; padding: 5px 11px; border-radius: 999px; font-size: 13px; }
.chip.active { background: var(--navy); color: var(--on-primary); border-color: var(--navy); }
.chips select { margin-left: auto; font-size: 14px; padding: 5px 8px; }
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; padding: 4px 14px; }
.idea {
  border: 1px solid var(--line); border-radius: calc(var(--r) * 1.5); background: var(--card); padding: 12px 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; text-align: left; min-height: 0; align-items: stretch;
}
.idea:hover { border-color: var(--gold); }
.idea h4 { margin: 0; font-size: 15px; }
.idea p { margin: 0; color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.idea .cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--r); background: var(--sunk); }
.idea .foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.idea .foot .vote { margin-left: auto; }
.status { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; background: #eef0f3; color: var(--muted); }
.status.considering { background: #fff4d6; color: #8a6100; }
.status.doing { background: #dcebff; color: #154a8a; }
.status.done { background: #dff3e7; color: var(--ok); }
.status.parked { background: #eee; color: #888; }
.vote { min-height: 0; padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.vote.on { background: var(--gold-soft); border-color: var(--gold); color: #6d531b; font-weight: 600; }

.panel { position: fixed; inset: 0; z-index: 40; background: rgba(13, 20, 30, .45); display: flex; justify-content: flex-end; }
.panel-inner {
  width: min(560px, 100%); height: 100%; overflow-y: auto; background: var(--card); padding: 16px 18px 40px;
  padding-top: max(16px, env(safe-area-inset-top));
}
.panel-head { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.panel-head #ip-close { margin-left: auto; }
.idea-body { white-space: pre-wrap; line-height: 1.5; margin: 12px 0; overflow-wrap: anywhere; }
#ip-vote { margin-top: 12px; }
.comments { display: grid; gap: 10px; margin-bottom: 12px; }
.comment { background: var(--sand); border-radius: calc(var(--r) * 1.25); padding: 8px 12px; }
.comment .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.comment .meta button { min-height: 0; padding: 0 4px; font-size: 12px; margin-left: auto; }
.comment .text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }

/* ---- video ------------------------------------------------------------------ */
.calls { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.calls li { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) * 1.5); padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.calls li .info { flex: 1; min-width: 0; }
.calls li .info b { display: block; }
.call { position: fixed; inset: 0; z-index: 30; background: #0b0f14; color: #fff; display: grid; grid-template-rows: auto 1fr auto; }
.call-head { display: flex; gap: 12px; align-items: baseline; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); }
.call-head .muted { color: #9aa4b1; }
.tiles { display: grid; gap: 8px; padding: 0 12px; min-height: 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); grid-auto-rows: minmax(0, 1fr); }
.vtile { position: relative; background: #1a2029; border-radius: calc(var(--r) * 1.5); overflow: hidden; min-height: 140px; }
.vtile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #1a2029; }
.vtile.screen video { object-fit: contain; }
.vtile.me video { transform: scaleX(-1); }
.vtile.me.screen video, .vtile.me.rear video { transform: none; }
.vtile .name { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.55); padding: 3px 9px; border-radius: calc(var(--r) * 1.25); font-size: 13px; }
.vtile .state { position: absolute; right: 8px; top: 8px; background: rgba(0,0,0,.55); padding: 3px 9px; border-radius: calc(var(--r) * 1.25); font-size: 12px; }
.vtile .state:empty { display: none; }
.call-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.call-controls button { background: #1f2630; border-color: #333c48; color: #fff; }
.call-controls button.on { background: #6d531b; border-color: var(--gold); }
.call-controls button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---- dialog ----------------------------------------------------------------- */
.dialog { border: 1px solid var(--line); border-radius: calc(var(--r) * 1.5); padding: 18px; width: min(420px, calc(100% - 32px)); }
.dialog::backdrop { background: rgba(13, 20, 30, .45); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dialog .attach-row { margin-top: 8px; }

/* ---- phones ----------------------------------------------------------------- */
@media (max-width: 760px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex !important; }
  body { font-size: 15px; }
  .top { padding: 6px 12px; padding-top: max(6px, env(safe-area-inset-top)); gap: 8px; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--card); border-top: 1px solid var(--line);
    height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  }
  .tab { flex-direction: column; gap: 2px; font-size: 11px; border-radius: 0; border: 0; justify-content: center; }
  .tab.active { background: transparent; border: 0; }
  .tab .ico { font-size: 19px; }
  .tab .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
  #app { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .view { padding: 10px 12px 24px; }
  .online .dot:nth-child(n+4) { display: none; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .tile { border-radius: 3px; }
  .toolbar { gap: 8px; }
  .add-buttons { width: 100%; }
  .add-buttons .button { flex: 1; justify-content: center; }
  .filters select { flex: 1; min-width: 0; }
  .selection-bar { top: 50px; }

  .rooms-view { display: block; }
  .rooms-view .room-list { position: static; }
  .rooms-view .room, .room-none { display: none; }
  .rooms-view.in-room .room-list { display: none; }
  .rooms-view.in-room .room { display: flex; }
  .room { border-radius: 0; border-left: 0; border-right: 0; margin: -10px -12px -24px; }
  .back { display: inline-grid !important; }
  .thumbs .tile { width: 92px; height: 92px; }
  .rooms-view .room-list { border-radius: 0; border-left: 0; border-right: 0; margin: -10px -12px 0; max-height: none; }
  /* an open chat has the whole screen, as in any phone messenger */
  body.in-chat .top, body.in-chat .tabs { display: none; }
  body.in-chat #app { padding-bottom: 0; }
  body.in-chat #view-chat { padding: 0; }
  body.in-chat #chat-room { position: fixed; inset: 0; margin: 0; height: 100dvh; border: 0; z-index: 26; padding-top: env(safe-area-inset-top); }
  .messages { padding: 8px 3% 12px; }
  .msg .stack { max-width: 82%; }
  .more { display: none; }
  .room-head { padding: 8px 10px; gap: 6px; }
  .ideas { grid-template-columns: 1fr; padding: 4px 10px; }
  .chips { padding: 10px; }
  .chips select { margin-left: 0; }
  .tiles { grid-template-columns: 1fr 1fr; padding: 0 6px; gap: 6px; }
  .tiles.solo { grid-template-columns: 1fr; }
  .vtile { min-height: 0; }
  .lb-nav { display: none; }
  .lb-top .button, .lb-top button { padding: 6px 10px; }
}

/* ---- Huddle --------------------------------------------------------------------- */
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 30px; font-weight: 700; color: var(--navy); letter-spacing: -.01em; margin-bottom: 8px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: calc(var(--r) * 1.5); background: var(--navy); color: var(--on-primary); display: inline-grid; place-items: center;
  font-size: 26px; font-weight: 800; line-height: 1;
}
.brand.small { margin: 0; }
.brand.small .brand-mark { width: 32px; height: 32px; font-size: 20px; border-radius: 9px; }
.ws-name { font-weight: 700; font-size: 16px; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.ws-switch { font-weight: 600; max-width: 300px; padding: 6px 8px; font-size: 15px; }
#join h2 { margin: 4px 0; }
#join-form label, #signin label { margin: 10px 0; }

/* guests: chats only */
body.guest .staff-only, body.guest #new-chat-ideas, body.guest [data-new-room] { display: none !important; }

/* avatars for models and people */
.avatar { position: relative; }
.avatar.ai .spark { position: absolute; right: -2px; bottom: -2px; font-style: normal; font-size: 12px; background: var(--card); color: var(--gold); border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--card); }
.avatar.online::after { content: ""; position: absolute; right: 1px; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: #31a24c; box-shadow: 0 0 0 2px var(--card); }
.avatar.plus { background: var(--sand) !important; color: var(--navy); font-size: 24px; border: 1px dashed #c9bfae; }
.ai-badge { font-size: 10px; font-weight: 700; letter-spacing: .04em; background: currentColor; border-radius: 4px; padding: 0 4px; margin-left: 6px; vertical-align: 1px; }
.ai-badge { color: inherit; }
.who .ai-badge { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.bubble.error { background: var(--sunk) !important; color: var(--muted); font-style: italic; }
.bubble.pending .text::after { content: ""; }
.caret { display: inline-block; width: 7px; height: 15px; background: currentColor; opacity: .55; margin-left: 2px; vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.dots { display: inline-flex; gap: 4px; padding: 6px 2px; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; }
.dots span:nth-child(3) { animation-delay: .3s; }

/* the contacts picker and other side panels */
.panel .panel-inner { display: flex; flex-direction: column; gap: 6px; }
.panel-head h2 { flex: 1; }
.picker .search { margin: 4px 0 6px; width: 100%; }
.picker-list { flex: 1; overflow-y: auto; margin: 0 -18px; padding: 0 6px; }
.picker-list h3, .panel h3 { margin: 14px 12px 6px; }
.provider { font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 12px 2px; }
.pick {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 0; border-radius: calc(var(--r) * 1.25); background: transparent;
  text-align: left; min-height: 58px;
}
button.pick:hover { background: var(--hover); }
.pick.on { background: var(--gold-soft); }
.pick:disabled { opacity: .55; }
.pick-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pick-main b, .pick-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; }
.pick.on .tick { background: var(--ok); border-color: var(--ok); }
.pick select { width: auto; font-size: 14px; padding: 4px 6px; }
.invite-row b { color: var(--navy); }
.more-models { margin: 6px 12px; }
.pad { padding: 4px 12px; }
.picker-foot { display: grid; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.picker-foot:empty { display: none; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-row .chip { cursor: default; }
button.wide { width: 100%; justify-content: center; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.info-top { display: grid; justify-items: center; gap: 6px; padding: 8px 0 4px; text-align: center; }
.info-top .avatar { width: 72px; height: 72px; font-size: 24px; }
.menu-item { width: 100%; justify-content: flex-start; border: 0; border-radius: var(--r); background: transparent; padding: 11px 10px; font-size: 15px; }
.menu-item:hover { background: var(--sand); }
table.usage { width: 100%; border-collapse: collapse; font-size: 13px; }
table.usage th, table.usage td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) {
  .ws-name, .ws-switch { max-width: 150px; font-size: 15px; }
  .picker-list { margin: 0 -18px; }
  .top .brand.small { display: none; }
}
.msg .gutter .avatar { width: 30px; height: 30px; font-size: 11px; }
.msg .gutter .avatar.ai .spark { width: 13px; height: 13px; font-size: 9px; right: -3px; bottom: -3px; }

/* ---- chat wallpaper ------------------------------------------------------------- */
/* doodles: line drawings, coloured by the look through a mask */
body.wall-doodles .room.chat::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .09;
  background: color-mix(in srgb, var(--ink) 55%, var(--navy));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22320%22 height=%22320%22 viewBox=%220 0 320 320%22%3E%3Cg fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath transform=%22translate(18 14) rotate(-12 12 12) scale(1.2)%22 d=%22M12 3l2.6 5.6 6 .7-4.5 4.1 1.2 6-5.3-3-5.3 3 1.2-6L3.4 9.3l6-.7z%22/%3E%3Cpath transform=%22translate(96 30) rotate(8 12 12) scale(1.3)%22 d=%22M4 5h16v10H10l-4 4v-4H4z M8 9h8 M8 12h5%22/%3E%3Cpath transform=%22translate(186 12) rotate(-6 12 12) scale(1.2)%22 d=%22M9 18V6l10-2v12 M9 18a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM19 16a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z%22/%3E%3Cpath transform=%22translate(262 36) rotate(10 12 12) scale(1.25)%22 d=%22M5 9h11v6a5 5 0 0 1-5 5h-1a5 5 0 0 1-5-5zM16 11h2a2 2 0 0 1 0 4h-2 M8 3c0 2 2 2 2 4 M12 3c0 2 2 2 2 4%22/%3E%3Cpath transform=%22translate(40 92) rotate(15 12 12) scale(1.1)%22 d=%22M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z%22/%3E%3Cpath transform=%22translate(140 96) rotate(-18 12 12) scale(1.3)%22 d=%22M3 11l18-7-6 17-3-7zM12 14l9-10%22/%3E%3Cpath transform=%22translate(222 104) rotate(20 12 12) scale(1.2)%22 d=%22M5 19C5 10 10 5 20 4c-1 10-6 15-15 15zM5 19l8-8%22/%3E%3Cpath transform=%22translate(290 120) rotate(-10 12 12) scale(1.0)%22 d=%22M12 20s-7-4.4-7-9.5A4 4 0 0 1 12 8a4 4 0 0 1 7 2.5C19 15.6 12 20 12 20z%22/%3E%3Cpath transform=%22translate(10 170) rotate(-8 12 12) scale(1.25)%22 d=%22M3 8h4l2-3h6l2 3h4v11H3zM12 17a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z%22/%3E%3Cpath transform=%22translate(96 178) rotate(6 12 12) scale(1.25)%22 d=%22M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM8.5 14.5a4.5 4.5 0 0 0 7 0M9 9.5v.5M15 9.5v.5%22/%3E%3Cpath transform=%22translate(176 170) rotate(-14 12 12) scale(1.25)%22 d=%22M12 15c-3.5 0-6-3-6-6.5a6 6 0 0 1 12 0C18 12 15.5 15 12 15zM12 15l-1 2h2l-1-2M12 17c0 2-2 3-1 5%22/%3E%3Cpath transform=%22translate(258 190) rotate(12 12 12) scale(1.1)%22 d=%22M13 2L5 14h6l-1 8 8-12h-6z%22/%3E%3Cpath transform=%22translate(40 252) rotate(10 12 12) scale(1.15)%22 d=%22M4 10h16v4H4zM5 14h14v7H5zM12 10v11M12 10c-2-4-6-4-6-1.5S10 10 12 10zM12 10c2-4 6-4 6-1.5S14 10 12 10z%22/%3E%3Cpath transform=%22translate(124 256) rotate(-10 12 12) scale(1.15)%22 d=%22M12 21s-6-6-6-11a6 6 0 0 1 12 0c0 5-6 11-6 11zM12 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4z%22/%3E%3Cpath transform=%22translate(198 252) rotate(6 12 12) scale(1.3)%22 d=%22M7 18a4 4 0 0 1-.5-8A5.5 5.5 0 0 1 17 9a4.5 4.5 0 0 1 .5 9z%22/%3E%3Cpath transform=%22translate(278 262) rotate(0 12 12) scale(1.0)%22 d=%22M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5 18 18M6 18l2.5-2.5M15.5 8.5 18 6%22/%3E%3C/g%3E%3C/svg%3E") 0 0 / 320px 320px repeat; mask: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22320%22 height=%22320%22 viewBox=%220 0 320 320%22%3E%3Cg fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.5%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpath transform=%22translate(18 14) rotate(-12 12 12) scale(1.2)%22 d=%22M12 3l2.6 5.6 6 .7-4.5 4.1 1.2 6-5.3-3-5.3 3 1.2-6L3.4 9.3l6-.7z%22/%3E%3Cpath transform=%22translate(96 30) rotate(8 12 12) scale(1.3)%22 d=%22M4 5h16v10H10l-4 4v-4H4z M8 9h8 M8 12h5%22/%3E%3Cpath transform=%22translate(186 12) rotate(-6 12 12) scale(1.2)%22 d=%22M9 18V6l10-2v12 M9 18a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM19 16a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z%22/%3E%3Cpath transform=%22translate(262 36) rotate(10 12 12) scale(1.25)%22 d=%22M5 9h11v6a5 5 0 0 1-5 5h-1a5 5 0 0 1-5-5zM16 11h2a2 2 0 0 1 0 4h-2 M8 3c0 2 2 2 2 4 M12 3c0 2 2 2 2 4%22/%3E%3Cpath transform=%22translate(40 92) rotate(15 12 12) scale(1.1)%22 d=%22M20 14.5A8 8 0 1 1 9.5 4a6.5 6.5 0 0 0 10.5 10.5z%22/%3E%3Cpath transform=%22translate(140 96) rotate(-18 12 12) scale(1.3)%22 d=%22M3 11l18-7-6 17-3-7zM12 14l9-10%22/%3E%3Cpath transform=%22translate(222 104) rotate(20 12 12) scale(1.2)%22 d=%22M5 19C5 10 10 5 20 4c-1 10-6 15-15 15zM5 19l8-8%22/%3E%3Cpath transform=%22translate(290 120) rotate(-10 12 12) scale(1.0)%22 d=%22M12 20s-7-4.4-7-9.5A4 4 0 0 1 12 8a4 4 0 0 1 7 2.5C19 15.6 12 20 12 20z%22/%3E%3Cpath transform=%22translate(10 170) rotate(-8 12 12) scale(1.25)%22 d=%22M3 8h4l2-3h6l2 3h4v11H3zM12 17a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z%22/%3E%3Cpath transform=%22translate(96 178) rotate(6 12 12) scale(1.25)%22 d=%22M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM8.5 14.5a4.5 4.5 0 0 0 7 0M9 9.5v.5M15 9.5v.5%22/%3E%3Cpath transform=%22translate(176 170) rotate(-14 12 12) scale(1.25)%22 d=%22M12 15c-3.5 0-6-3-6-6.5a6 6 0 0 1 12 0C18 12 15.5 15 12 15zM12 15l-1 2h2l-1-2M12 17c0 2-2 3-1 5%22/%3E%3Cpath transform=%22translate(258 190) rotate(12 12 12) scale(1.1)%22 d=%22M13 2L5 14h6l-1 8 8-12h-6z%22/%3E%3Cpath transform=%22translate(40 252) rotate(10 12 12) scale(1.15)%22 d=%22M4 10h16v4H4zM5 14h14v7H5zM12 10v11M12 10c-2-4-6-4-6-1.5S10 10 12 10zM12 10c2-4 6-4 6-1.5S14 10 12 10z%22/%3E%3Cpath transform=%22translate(124 256) rotate(-10 12 12) scale(1.15)%22 d=%22M12 21s-6-6-6-11a6 6 0 0 1 12 0c0 5-6 11-6 11zM12 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4z%22/%3E%3Cpath transform=%22translate(198 252) rotate(6 12 12) scale(1.3)%22 d=%22M7 18a4 4 0 0 1-.5-8A5.5 5.5 0 0 1 17 9a4.5 4.5 0 0 1 .5 9z%22/%3E%3Cpath transform=%22translate(278 262) rotate(0 12 12) scale(1.0)%22 d=%22M12 3v4M12 17v4M3 12h4M17 12h4M6 6l2.5 2.5M15.5 15.5 18 18M6 18l2.5-2.5M15.5 8.5 18 6%22/%3E%3C/g%3E%3C/svg%3E") 0 0 / 320px 320px repeat;
}
body.wall-dots .room.chat {
  background-image: radial-gradient(circle at 20% 20%, var(--wall-ink) 0 2px, transparent 3px), radial-gradient(circle at 70% 60%, var(--wall-ink) 0 1.5px, transparent 2.5px);
  background-size: 46px 46px, 64px 64px;
}
body.wall-waves .room.chat {
  background-image: radial-gradient(ellipse 40px 12px at 50% 100%, transparent 70%, var(--wall-ink) 72% 80%, transparent 82%);
  background-size: 56px 22px;
}
body.wall-grid .room.chat {
  background-image: linear-gradient(var(--wall-ink) 1px, transparent 1px), linear-gradient(90deg, var(--wall-ink) 1px, transparent 1px);
  background-size: 28px 28px;
}
body.wall-diagonal .room.chat { background-image: repeating-linear-gradient(135deg, var(--wall-ink) 0 1px, transparent 1px 14px); }
body.wall-plain .room.chat { background-image: none; }
/* dark looks: native controls and scrollbars follow */
body.dark { color-scheme: dark; }
body.dark .pill, body.dark .bubble, body.dark .react, body.dark .jump { box-shadow: none; }
body.dark button.danger { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
body.dark .status { background: color-mix(in srgb, var(--ink) 12%, transparent); color: var(--ink); }

/* ---- the look and feel panel ---------------------------------------------------- */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 4px; }
.preset {
  display: grid; gap: 6px; padding: 10px; border: 2px solid var(--line); border-radius: calc(var(--r) * 1.25); background: var(--card);
  text-align: left; min-height: 0; align-items: start; justify-items: stretch;
}
.preset.on { border-color: var(--navy); box-shadow: 0 0 0 2px color-mix(in srgb, var(--navy) 25%, transparent); }
.preset .sample { height: 64px; border-radius: 8px; display: grid; align-content: center; gap: 4px; padding: 8px; overflow: hidden; }
.preset .sample i { display: block; height: 12px; border-radius: 7px; width: 70%; }
.preset .sample i:nth-child(2) { margin-left: auto; width: 55%; }
.preset b { font-size: 14px; }
.preset span { font-size: 12px; color: var(--muted); white-space: normal; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 4px 12px; }
.theme-grid label { margin: 6px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 500; }
.theme-grid input[type=color] { width: 44px; height: 32px; padding: 2px; flex: none; cursor: pointer; }
.segments { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.segments button { min-height: 0; padding: 6px 12px; border-radius: 999px; }
.segments button.on { background: var(--navy); color: var(--on-primary); border-color: var(--navy); }
.theme-actions { position: sticky; bottom: 0; background: var(--card); padding: 10px 0 4px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }
#look-panel .panel-inner { padding-bottom: 0; }
#look-panel .theme-actions { padding-bottom: max(14px, env(safe-area-inset-bottom)); margin-top: 12px; }

/* ---- invitations and accounts ------------------------------------------------------ */
.invitations { max-width: 760px; margin: 14px auto 0; padding: 0 16px; display: grid; gap: 8px; }
.invitation { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--gold); border-radius: calc(var(--r) * 1.5); padding: 12px 14px; }
.invitation-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.account { border-bottom: 1px solid var(--line); padding: 12px 0; }
.account-top { display: flex; align-items: center; gap: 12px; }
.account-where { margin: 6px 0 0 60px; }
.account .share-row { margin: 8px 0 0 60px; }
.account .share-row button { min-height: 0; padding: 5px 10px; font-size: 13px; }
.temp-pw { background: var(--gold-soft); color: var(--ink); border: 1px solid var(--gold); padding: 3px 8px; border-radius: 6px; font-size: 13px; user-select: all; }
@media (max-width: 760px) { .account-where, .account .share-row { margin-left: 0; } }

/* ---- Your Gallery ------------------------------------------------------------------- */
.gallery-avatar { background: var(--gold) !important; color: var(--on-primary); }
.photos-head { margin-bottom: 8px; justify-content: flex-start; gap: 12px; }
.photos-head h2 { font-size: 20px; }

/* ---- the feed ----------------------------------------------------------------------- */
.feed-view { max-width: 680px; }
.feed-list { display: grid; gap: 12px; margin-top: 12px; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) * 1.5); padding: 14px 16px; display: grid; gap: 10px; }
.post.pinned { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.post.new { box-shadow: inset 3px 0 0 var(--navy); }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-head .avatar { width: 42px; height: 42px; font-size: 14px; }
.post-who { flex: 1; min-width: 0; display: grid; }
.post-menu { display: flex; gap: 4px; }
.post-menu .link { font-size: 13px; }
.post-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; font-size: 15.5px; }
.post-text a { color: var(--link); }
.post-media { display: grid; gap: 3px; border-radius: var(--r); overflow: hidden; }
.post-media .tile { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.post-media.n1 .tile { aspect-ratio: 16 / 10; }
.post-media.n2, .post-media.n3, .post-media.n4 { grid-template-columns: 1fr 1fr; }
.post-media.n2 .tile, .post-media.n4 .tile { aspect-ratio: 1; }
.post-media.n3 .tile:first-child { grid-column: 1 / -1; aspect-ratio: 2 / 1; }
.post-media.n3 .tile:not(:first-child) { aspect-ratio: 1; }
.post-reacts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.post-reacts .react { box-shadow: none; }
.post-reacts .react.add { color: var(--muted); }
.post-reacts .comments-toggle { margin-left: auto; font-size: 13px; }
.post-comments { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.post-comments .comment { background: var(--hover); }
.compose { gap: 8px; }
.compose textarea { border: 0; background: transparent; padding: 4px 2px; font-size: 16px; min-height: 48px; }
.compose textarea:focus { outline: none; }
.compose-bar { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 8px; }
.compose-bar .attach-btn { width: 40px; height: 40px; }
@media (max-width: 760px) {
  .feed-view { padding-top: 10px; }
  .post { padding: 12px; border-radius: var(--r); }
}

/* ---- the owner's administration screen ---- */
.admin-home { max-width: 760px; display: grid; gap: 12px; }
.admin-home > h2 { font-size: 24px; margin: 8px 0 4px; }
.admin-card { background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) * 1.5); padding: 14px 16px; display: grid; gap: 6px; }
.admin-card h3 { margin: 0; font-size: 17px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.admin-section { margin: 10px 0 0; }

/* ---- connections ---------------------------------------------------------------------- */
.hook-address { display: grid; gap: 6px; margin-top: 6px; }
.hook-address input { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.recent { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.key-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.key-row input[type=password] { flex: 1; min-width: 200px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0; font-weight: 500; }
label.inline input { width: auto; margin: 0; }
.post-link { font-size: 14px; color: var(--link); }
.error.small { font-size: 13px; }

/* ---- Feed | Reels | Chat | + ------------------------------------------------- */
.tab-create .plus {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px;
  background: var(--navy); color: var(--on-primary); font-size: 18px; font-weight: 700; line-height: 1;
}
.tab-create .plus { transition: transform .18s ease; }
.tab-create.open .plus { transform: rotate(45deg); }
.create-scrim { background: rgba(13, 20, 30, .28); }
.create-menu {
  position: fixed; z-index: 71; width: min(300px, calc(100vw - 16px)); display: flex; flex-direction: column; gap: 6px;
}
.create-item {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 9px 12px; border: 0;
  background: var(--card); box-shadow: 0 4px 16px rgba(0,0,0,.18); border-radius: 999px;
  text-align: left; cursor: pointer; font-weight: 400; font-size: 15px; justify-content: flex-start; min-height: 0;
  animation: rise .2s ease-out both;
}
.create-menu.down .create-item { animation-name: drop; }
.create-item:hover { background: var(--sand); }
.create-item .count { margin-left: auto; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes drop { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
.create-ico {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--gold-soft); color: var(--navy); font-size: 16px;
}
.create-main { display: grid; gap: 1px; min-width: 0; }

/* inside Chat: a running video session, ideas rooms, sessions */
.chat-live {
  display: flex; align-items: center; gap: 10px; width: calc(100% - 20px); margin: 2px 10px 8px; padding: 10px 12px;
  border: 0; border-radius: var(--r); background: var(--ok); color: #fff; text-align: left; justify-content: flex-start;
}
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; flex: none; animation: live 1.4s ease-in-out infinite; }
@keyframes live { 50% { opacity: .35; } }
.chat-live-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-live-join { font-weight: 700; flex: none; }
.shortcut-avatar { background: var(--gold-soft); color: var(--navy); font-size: 20px; }
.chat-shortcut { min-height: 60px; }
.to-chat { flex: none; }

/* reels: one video a screen, swiped up */
.reels-view { max-width: none; padding: 0; }
.reels {
  position: fixed; left: 0; right: 0; top: var(--top-h, 56px); bottom: 0; z-index: 1;
  overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain; background: #0b0b0c; scrollbar-width: none;
}
.reels::-webkit-scrollbar { display: none; }
.reel { height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; overflow: hidden; }
.reel-frame { position: relative; height: 100%; aspect-ratio: 9 / 16; max-width: 100%; background: #000; overflow: hidden; }
.reel-frame video { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.reel-paused {
  position: absolute; inset: 0; display: none; place-items: center; font-size: 64px; color: rgba(255,255,255,.85);
  pointer-events: none; text-shadow: 0 2px 14px rgba(0,0,0,.5);
}
.reel.held .reel-paused { display: grid; }
.reel-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 72px 18px 14px; color: #fff; pointer-events: none;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.reel-info a { pointer-events: auto; color: #fff; }
.reel-who { display: flex; align-items: center; gap: 8px; }
.reel-who .avatar { width: 34px; height: 34px; font-size: 12px; }
.reel-who .small { opacity: .8; }
.reel-text { margin-top: 8px; max-height: 6.5em; overflow-y: auto; pointer-events: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.reel-actions { position: absolute; right: 8px; bottom: 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.reel-act {
  display: flex; flex-direction: column; align-items: center; gap: 3px; border: 0; background: none; color: #fff;
  padding: 0; min-height: 0; text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.reel-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.35); font-size: 21px; }
.reel-act.like.on .reel-ico { color: #ff3b5c; }
.reel-n { font-size: 12px; font-weight: 600; min-height: 14px; }
.reels-empty { text-align: center; padding: 60px 16px; display: grid; justify-items: center; gap: 4px; }
.reels-empty label { display: inline-flex; margin: 4px 0; }
.reel-compose { display: grid; gap: 10px; }
.reel-preview { background: #000; border-radius: var(--r); overflow: hidden; display: grid; place-items: center; max-height: 52vh; }
.reel-preview video { max-height: 52vh; max-width: 100%; display: block; }
.reel-upload { display: flex; align-items: center; gap: 10px; }
.reel-upload progress { flex: 1; }

@media (max-width: 760px) {
  /* as many tabs as this person has, side by side */
  .tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .tab-create .tab-create-label { font-size: 11px; }
  .reels { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  .reel-frame { width: 100%; aspect-ratio: auto; }
}

/* ---- mail ------------------------------------------------------------------- */
.tab-create.has-mail .plus { position: relative; }
.tab-create.has-mail .plus::after {
  content: ""; position: absolute; top: -4px; right: -4px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--card);
}
.mail-tools { display: flex; align-items: center; gap: 4px; }
.mail-tools .icon-btn { font-size: 20px; width: 36px; height: 36px; }
.mail-boxes { padding: 0 14px 8px; }
.mail-boxes select { width: 100%; }
.mail-error { margin: 0 14px 8px; padding: 8px 10px; border-radius: var(--r); background: var(--gold-soft); }
.mail-none { padding: 18px 16px; }
.mail-item { align-items: flex-start; }
.mail-item .conv-main { gap: 2px; }
.mail-subject { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-item.unread .mail-subject, .mail-item.unread .conv-top b { font-weight: 700; }
.mail-item.unread .conv-top b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; vertical-align: middle; }
.mail-read { min-height: calc(100dvh - 110px); }
.mail-read .room-title h2 { font-size: 19px; overflow-wrap: anywhere; }
.mail-meta { padding: 10px 14px; display: grid; gap: 4px; font-size: 14px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.mail-from { display: flex; align-items: center; gap: 10px; }
.mail-from .avatar { width: 38px; height: 38px; font-size: 13px; }
.mail-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.mail-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px; }
.mail-files:not(:empty) { padding: 8px 14px; border-bottom: 1px solid var(--line); }
.mail-file { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; text-decoration: none; color: var(--ink); }
.mail-body { flex: 1; display: flex; min-height: 0; }
.mail-frame { flex: 1; width: 100%; min-height: 62vh; border: 0; background: #fff; border-radius: 0 0 calc(var(--r) * 1.75) calc(var(--r) * 1.75); }
.mail-text { padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.mail-compose-inner { width: min(720px, 100%); }
.mail-compose { display: grid; gap: 8px; }
.mail-field { display: grid; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; margin: 0; }
.mail-field span { color: var(--muted); font-size: 14px; font-weight: 400; }
.mail-field input, .mail-field select { margin: 0; }
.mail-compose textarea { min-height: 260px; font-family: inherit; }
.mail-servers { display: grid; grid-template-columns: 1fr 90px; gap: 0 10px; }
.mail-servers label:last-child { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .mail-read { min-height: calc(100dvh - var(--tabbar) - 70px); }
  .mail-frame { min-height: 70vh; border-radius: 0; }
}
.reel-act, .reel-act:hover, .reel-act:focus, .reel-act:active { background: none !important; box-shadow: none; outline: none; }
.reel-act:focus-visible .reel-ico { outline: 2px solid #fff; }
.reel-ico { color: #fff; }
.create-main span, .create-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- PDFs in chats ---------------------------------------------------------- */
.file-cards { display: grid; gap: 6px; margin: 4px 0; }
.file-card {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 320px; padding: 8px 10px; min-height: 0;
  border: 1px solid var(--line); border-radius: calc(var(--r) * 1.25); background: var(--card); color: var(--ink);
  text-align: left; justify-content: flex-start; cursor: pointer;
}
.file-card:hover { background: var(--hover); }
.file-ico {
  flex: none; width: 38px; height: 46px; border-radius: 6px; background: #c8372d; color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; letter-spacing: .04em;
}
.file-main { display: grid; gap: 2px; min-width: 0; }
.file-main b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-main .small { color: var(--muted); }
.file-viewer { position: fixed; inset: 0; z-index: 80; background: rgba(13, 20, 30, .92); display: flex; flex-direction: column; }
.file-viewer-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--card); border-bottom: 1px solid var(--line);
}
.file-viewer-bar .icon-btn { font-size: 26px; }
.file-viewer-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-viewer-frame { flex: 1; width: 100%; border: 0; background: #fff; }

/* ---- voice messages ---------------------------------------------------------- */
/* the round button is a mic while there is nothing typed, a send arrow after */
.composer.can-voice:not(.has-text) #composer-send { display: none; }
.composer.has-text #voice-start { display: none; }
.send.mic { opacity: 1; background: var(--navy); }
.composer.recording .composer-row { display: none; }
/* a grid item: without min-width 0 the unwrapped words stretch it past the screen */
.voice-bar { display: flex; align-items: center; gap: 10px; padding: 4px 6px; min-height: 52px; min-width: 0; max-width: 100%; }
.voice-dot { width: 12px; height: 12px; border-radius: 50%; background: #d92d20; flex: none; transition: transform .1s; }
.voice-time { font-variant-numeric: tabular-nums; font-weight: 600; flex: none; }
.voice-words { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; }
.voice-go { opacity: 1 !important; background: var(--ok) !important; }
.voice-player { display: flex; align-items: center; gap: 8px; min-width: 220px; max-width: 300px; padding: 2px 0 4px; }
.vp-play {
  width: 36px; height: 36px; min-height: 0; border-radius: 50%; border: 0; padding: 0; flex: none; justify-content: center;
  background: var(--navy); color: var(--on-primary); font-size: 13px;
}
.msg.mine .vp-play { background: color-mix(in srgb, var(--on-mine) 85%, transparent); color: var(--mine); }
.vp-bar { flex: 1; min-width: 60px; accent-color: var(--navy); margin: 0; }
.vp-time { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .75; flex: none; }
.vp-speed { border: 0; background: none; min-height: 0; padding: 2px 4px; font-size: 12px; font-weight: 700; opacity: .75; flex: none; color: inherit; }
.text.transcript { font-size: 14px; opacity: .88; }
.speak-btn { border: 0; background: none; min-height: 0; padding: 0 4px; font-size: 14px; opacity: .55; vertical-align: baseline; cursor: pointer; }
.speak-btn:hover, .speak-btn.on { opacity: 1; }
.speak-toggle.on { color: var(--ok); }

/* ---- Projects ------------------------------------------------------------
   A project's screen is a list on the left and one module at a time on the
   right, which is the shape chat and mail already have. The rows below are
   the only new furniture: a line per record, built so that a module with no
   line of its own still reads as a list rather than as a dump. */
.workspaces-view .room-ico { width: 1.4em; text-align: center; opacity: .75; }
.workspaces-view .room-text { display: flex; flex-direction: column; min-width: 0; }

.proj-open { display: flex; flex-direction: column; min-height: 0; }
.proj-head-tools { margin-left: auto; display: flex; gap: 4px; }

.proj-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 12px; border-bottom: 1px solid var(--line); }
.proj-tab {
  background: none; border: none; border-bottom: 2px solid transparent; color: inherit;
  padding: 10px 12px; white-space: nowrap; cursor: pointer; font: inherit; opacity: .6;
}
.proj-tab.active { opacity: 1; border-bottom-color: currentColor; }

.proj-note { margin: 8px 12px 0; }
.proj-body { flex: 1; overflow-y: auto; padding: 8px 12px 16px; min-height: 0; }
.proj-foot { padding: 10px 12px; border-top: 1px solid var(--line); }

.proj-rows { display: flex; flex-direction: column; }
.proj-row {
  display: flex; gap: 10px; align-items: center; padding: 10px 4px;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.proj-row:hover { background: rgba(127, 127, 127, .07); }
.proj-row.done { opacity: .5; }
.proj-row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
/* where a piece is: Live, Hidden, Publishing…, Problem */
.live-badge { display: inline-block; font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 7px; border-radius: 999px; vertical-align: 1px; white-space: nowrap; }
.live-badge.ok { background: rgba(52, 199, 89, .18); color: #2fa84f; }
.live-badge.off { background: rgba(127, 127, 127, .18); color: inherit; opacity: .75; }
.live-badge.busy { background: rgba(255, 159, 10, .18); color: #d98400; }
.live-badge.bad { background: rgba(255, 69, 58, .18); color: #e5443a; }
.live-where { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.live-where-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-where-row > span:first-child { min-width: 9em; }
.proj-row-do { display: flex; gap: 8px; margin-top: 4px; white-space: normal; }
.proj-row-do:empty { display: none; }
.proj-more > summary { cursor: pointer; padding: 6px 0; opacity: .8; }
.proj-more[open] { display: flex; flex-direction: column; gap: 10px; }
.proj-row-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the body of a message is the one thing allowed to run to a second line */
.proj-row-body { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; opacity: .75; }
.proj-right { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: none; }
.proj-when { flex: none; }
.proj-tick { flex: none; display: flex; align-items: center; }

.proj-thumb { width: 42px; height: 42px; object-fit: cover; border-radius: var(--r); flex: none; background: rgba(127, 127, 127, .15); }
.proj-thumb.round { border-radius: 50%; }

.proj-form { display: flex; flex-direction: column; gap: 12px; }
.proj-field { display: flex; flex-direction: column; gap: 4px; font-size: .9em; }
.proj-field.tick { flex-direction: row; align-items: center; gap: 8px; }
.proj-field input, .proj-field textarea, .proj-field select { width: 100%; }
.proj-field.tick { font-size: 1em; font-weight: 600; cursor: pointer; }
.proj-field.tick input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--navy); }
.proj-sheet-foot { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.proj-sheet-foot .primary { margin-left: auto; }
.proj-source { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.proj-source-do { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.danger { color: #c0392b; }

@media (max-width: 760px) {
  /* the list is the whole screen until a project is chosen, and then the
     project is — the same way chat and mail behave on a phone */
  .workspaces-view .room-list { display: block; width: 100%; max-width: none; border-right: 0; }
  .workspaces-view #proj-list { display: block; }
  .workspaces-view #proj-list .room-btn { width: 100%; }
  .workspaces-view.in-room .room-list { display: none; }
  .workspaces-view .proj-open { width: 100%; }
  .workspaces-view .room-none { display: none; }
}

.proj-pick-shot { max-width: 160px; max-height: 160px; object-fit: cover; border-radius: var(--r); display: block; }
.proj-field input[type="file"] { font-size: .85em; }

/* A channel is a card, not a row: it has a name, which way things travel
   through it, how it is getting on, and what can be done to it. */
.proj-channel { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin-bottom: 10px;
                display: flex; flex-direction: column; gap: 6px; }
.proj-channel-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.proj-channel-way { font-size: .8em; opacity: .65; }
.proj-channel-do { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.proj-channel-head2 { margin: 18px 0 8px; }
.proj-channel.new > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.proj-channel.new[open] { gap: 10px; }
.proj-channel input[readonly] { font-size: .8em; }

/* five tabs have to fit a phone, so they give up some side padding first */
@media (max-width: 420px) {
  .tabs .tab { padding-inline: 6px; }
  .tabs .tab span:not(.ico) { font-size: .72rem; }
}

/* Six tabs do not fit a phone and Channels is the last of them, so on a narrow
   screen it also has a button of its own in the project's header. */
.proj-channels-btn { display: none; }
@media (max-width: 760px) {
  .proj-channels-btn { display: inline-block; font-size: .82rem; padding: 5px 10px; }
}

/* ---- Home ----------------------------------------------------------------
   The person's own front page: what is theirs, then the projects they are in
   and what each is asking of them. */
.home-view { overflow-y: auto; }
.home-inner { max-width: 820px; margin: 0 auto; padding: 18px 16px 40px; }
.home-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 22px 0 10px; }
.home-head h2 { margin: 0; flex: 1; }
.home-head:first-child { margin-top: 0; }
.home-mine { display: flex; flex-wrap: wrap; gap: 8px; }
.home-chip {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  border-radius: var(--r); padding: 10px 12px; background: none; color: inherit;
  font: inherit; cursor: pointer; text-align: left;
}
.home-chip:hover { background: rgba(127, 127, 127, .07); }
.home-chip b { font-weight: 600; }
.home-workspaces { display: flex; flex-direction: column; gap: 10px; }
.home-workspace {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r); padding: 14px;
  background: none; color: inherit; font: inherit; cursor: pointer;
}
.home-workspace:hover { background: rgba(127, 127, 127, .07); }
.home-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.home-workspace-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.home-workspace-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-asks { display: flex; flex-wrap: wrap; gap: 6px; }
.home-ask { font-size: .78em; border-radius: 999px; padding: 2px 9px; background: rgba(127, 127, 127, .14); }
.home-ask.loud { background: hsl(40 61% 56% / .3); }
.home-ask.bad { background: #c0392b22; color: #c0392b; }

/* On a person's own front page there is no project to be in, so the switcher
   between them has nothing to say. */
body.at-home #online { display: none !important; }

/* Where you are, at the top: nothing on your own Huddle, and inside a
   workspace its name with the way back out. */
.ws-crumb {
  display: inline-flex; align-items: center; gap: 6px;
  /* as wide as its name, and never squeezed down to just the arrow */
  flex: 0 1 auto; min-width: 7em;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px 4px 9px; color: inherit; font: inherit; cursor: pointer;
  max-width: 42vw;
}
.ws-crumb:hover { background: rgba(127, 127, 127, .1); }
.ws-crumb .ws-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600;
  /* the old header gave this a width for a chooser that no longer exists */
  max-width: none; font-size: inherit; color: inherit; min-width: 0;
}
.ws-crumb-back { opacity: .6; }
/* the old chooser is never shown: a workspace is picked on Home */
.ws-switch { display: none !important; }
@media (max-width: 760px) { .ws-crumb { max-width: 46vw; font-size: .9rem; } }

/* This screen is one workspace's work, never a list of workspaces: that is
   what Home is for. One pane, the whole width. */
.workspaces-view { display: block; }
.workspaces-view .proj-open { width: 100%; }
.workspaces-view #proj-none { max-width: 560px; margin: 24px auto; text-align: center; }

/* ---- floating panels ------------------------------------------------------------
   One frame for every look: the list and the open chat sit on the page as
   rounded panels with no rules between rows; the chat's name and the
   composer float over the wallpaper, and the conversation keeps to a
   readable column in the middle however wide the screen is. */
.top { background: var(--sand); border-bottom: 0; }
.tab.active { background: color-mix(in srgb, var(--navy) 16%, transparent); border-color: transparent; color: var(--navy); }
.badge { background: var(--navy); color: var(--on-primary); }
.card, .dialog, .room-list, .room { border: 0; }
.dialog { background: var(--card); color: var(--ink); border-radius: calc(var(--r) * 1.4); }

.rooms-view { gap: 12px; grid-template-columns: 380px 1fr; max-width: none; }
.room-list { padding: 8px; border-radius: calc(var(--r) * 1.5); }
.room-list-head { padding: 4px 8px 10px; }
.search {
  margin: 0 0 8px; width: 100%; border-radius: 999px; border: 2px solid transparent; padding: 9px 16px 9px 44px;
  background: color-mix(in srgb, var(--ink) 7%, var(--card)) no-repeat 16px center / 18px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23909090' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
}
.search:focus { outline: none; border-color: var(--navy); background-color: var(--card); }
.icon-btn:hover { background: var(--hover); }

.conv { border-radius: calc(var(--r) * .85); padding: 9px 10px; min-height: 72px; gap: 12px; }
.conv-main { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; gap: 4px; }
.avatar { width: 54px; height: 54px; font-size: 18px; }
.conv-top b { font-size: 16px; }
.conv-line { font-size: 15px; }
.conv.unread .conv-top time { color: var(--muted); font-weight: 400; }
.count { background: var(--navy); color: var(--on-primary); font-weight: 600; min-width: 24px; height: 24px; line-height: 24px; padding: 0 8px; font-size: 13px; }
.conv.active { background: var(--navy); color: var(--on-primary); }
.conv.active .conv-top time, .conv.active .conv-line, .conv.active .muted, .conv.active .typing-line { color: color-mix(in srgb, var(--on-primary) 78%, transparent) !important; }
.conv.active .count { background: var(--on-primary); color: var(--navy); }
.conv.active .avatar.online::after, .conv.active .avatar.ai .spark { box-shadow: 0 0 0 2px var(--navy); }
.avatar.online::after, .avatar.ai .spark { box-shadow: 0 0 0 2px var(--card); }

/* the open chat */
.room.chat { position: relative; background: var(--wall); border-radius: calc(var(--r) * 1.5); }
.room.chat > * { position: relative; z-index: 1; }
.chat-head {
  margin: 8px 8px 0; border-bottom: 0; border-radius: calc(var(--r) * 1.15); padding: 5px 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .12); z-index: 3;
}
.messages { background: transparent; padding: 12px max(12px, calc((100% - 760px) / 2)) 12px; }
.bubble { border-radius: min(calc(var(--r) * 1.1), 16px); padding: 6px 10px 7px; }
.msg.last:not(.mine) .bubble { border-bottom-left-radius: 5px; }
.msg.last.mine .bubble { border-bottom-right-radius: 5px; }
.quote { border-left-width: 3px; background: color-mix(in srgb, var(--q, var(--gold)) 13%, transparent); border-radius: 6px; }
.pill { background: color-mix(in srgb, var(--card) 88%, transparent); border-radius: 999px; }
.unread-divider { margin: 10px calc(-1 * max(12px, calc((100% - 760px) / 2))); }
.jump { background: var(--card); }
.jump b { background: var(--navy); color: var(--on-primary); }
.msg.mine .bubble .ticks.seen { color: var(--on-mine); }
/* names picked for light paper are too dim on a dark wall */
body.dark .bubble .who, body.dark .quote b { filter: brightness(1.5) saturate(1.15); }

/* the composer: one pill over the wallpaper, the round button inside it */
.composer {
  background: transparent; border-top: 0;
  padding: 4px max(8px, calc((100% - 776px) / 2)) max(10px, env(safe-area-inset-bottom));
}
.composer .composer-row {
  background: var(--card); border-radius: 26px; padding: 4px; gap: 2px; align-items: flex-end;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .12);
}
.composer .composer-row textarea { background: transparent; box-shadow: none; padding: 11px 6px; min-height: 44px; border-radius: 0; }
.composer .composer-row textarea:focus { box-shadow: none; }
.composer .send, .composer.has-text .send { opacity: 1; background: var(--navy); color: var(--on-primary); }
.composer:not(.has-text):not(.can-voice) .send { opacity: .55; }
.voice-bar, .reply-bar { background: var(--card); border-radius: 26px; padding: 4px 6px; }
.reply-quote { background: color-mix(in srgb, var(--gold) 12%, transparent); }

/* menus and sheets sit on the same panels */
.msg-menu, .create-item { background: var(--card); }
.menu-reactions button:hover, .menu-reactions button.on, .menu-actions button:hover, .menu-item:hover, .create-item:hover { background: var(--hover); }

body.dark .chat-head, body.dark .composer .composer-row { box-shadow: none; }
body.dark .search { background-color: color-mix(in srgb, var(--ink) 8%, var(--card)); }
body.dark .search:focus { background-color: var(--card); }

@media (max-width: 760px) {
  .top { background: var(--sand); }
  .tabs { border-top: 0; }
  .tab.active { background: transparent; }
  .rooms-view .room-list { padding: 6px; }
  .room.chat { border-radius: 0; }
  body.in-chat #chat-room { background: var(--wall); }
  .chat-head { margin: 6px 6px 0; }
  .messages { padding: 10px 8px 10px; }
  .unread-divider { margin: 10px -8px; }
  .composer { padding: 4px 6px max(8px, env(safe-area-inset-bottom)); }
  .avatar { width: 52px; height: 52px; }
}

/* ---- workspaces in the chat list ----------------------------------------------
   One folder, pinned under your gallery, holds the workspaces. Each workspace
   is a group like any other chat; opened out, it shows what it is connected
   to and the chats inside it, indented beneath it. */
.folder-avatar { background: color-mix(in srgb, var(--navy) 22%, var(--card)); color: var(--navy); }
.ws-avatar { border-radius: 30%; }
.ws-caret { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--muted); transition: transform .15s; transform: rotate(-90deg); vertical-align: 1px; }
.open > .conv-main .ws-caret { transform: none; }
.conv.active .ws-caret { color: inherit; }
.ws-folder-inside > ul, .ws-inside > ul { list-style: none; margin: 0; padding: 0; }
.ws-folder-inside > ul { margin-left: 14px; padding-left: 8px; border-left: 2px solid color-mix(in srgb, var(--navy) 22%, transparent); }
.ws-folder-inside:has(> ul:empty) { display: none; }
.ws-inside > ul { margin: 0 0 4px 30px; padding-left: 8px; border-left: 2px solid var(--line); }
.conv.sub { min-height: 56px; padding: 6px 10px; }
.conv.sub .avatar { width: 40px; height: 40px; font-size: 14px; }
.conv.sub .conv-top b { font-size: 15px; }
.conv.sub .conv-line { font-size: 14px; }
.ws-links { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 8px 8px; }
.ws-link {
  min-height: 0; padding: 4px 10px 4px 8px; border-radius: 999px; border: 0; font-size: 12.5px; gap: 6px;
  background: color-mix(in srgb, var(--ink) 7%, var(--card)); color: var(--ink);
}
.ws-link i { width: 7px; height: 7px; border-radius: 50%; background: #31a24c; flex: none; }
.ws-link.bad i { background: var(--danger); }
.ws-link.add { color: var(--navy); }
.ws-link.add i { display: none; }
.ws-link:hover { background: var(--hover); }

/* ---- a workspace's parts, as tabs in its chat ----------------------------------- */
.ws-tabs {
  position: relative; z-index: 2; margin: 6px 8px 0; padding: 4px; gap: 2px; border-bottom: 0;
  background: var(--card); border-radius: 999px; align-items: center; scrollbar-width: none;
}
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tabs .proj-tab { border: 0; border-radius: 999px; padding: 6px 14px; opacity: .7; min-height: 0; flex: none; background: none; color: inherit; }
.ws-tabs .proj-tab.active { opacity: 1; background: var(--navy); color: var(--on-primary); }
.ws-tabs .proj-tab.active .muted { color: inherit; opacity: .8; }
.ws-tabs .ws-proj { width: auto; flex: none; border-radius: 999px; padding: 4px 10px; font-size: 14px; margin-right: 4px; }
.ws-pane {
  position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; flex-direction: column;
  margin: 8px; background: var(--card); border-radius: calc(var(--r) * 1.15); overflow: hidden;
}
.ws-pane .proj-body { flex: 1; }
.ws-pane .mail-none { padding: 24px; text-align: center; }
.ws-pane .proj-foot { border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .ws-tabs { margin: 6px 6px 0; }
  .ws-pane { margin: 6px; margin-bottom: max(6px, env(safe-area-inset-bottom)); }
}
/* ideas rooms and video sessions open from each workspace's drop-down */
#chat-ideas, #chat-sessions { display: none !important; }
.ws-link.tool { color: var(--muted); }
.ws-link.tool i { display: none; }
.ws-caret { font-size: 13px; }
/* on the feed and the reels the name at the top picks which workspace's */
.ws-crumb-back { display: none; }
.ws-crumb::after { content: "▾"; font-size: 12px; opacity: .6; margin-left: 2px; }
.ws-crumb { min-width: 0; }

/* ---- workspace tools ---------------------------------------------------- */
.tool-list { display: grid; gap: 10px; padding: 4px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tool-card { display: flex; gap: 12px; align-items: center; text-align: left; padding: 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.tool-card:hover { background: var(--hover); }
.tool-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--navy); color: var(--on-primary); }
.tool-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tool-screen { position: fixed; inset: 0; z-index: 60; background: var(--sand); color: var(--ink); display: flex; flex-direction: column; }
.tool-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.tool-head h2 { flex: 1; margin: 0; font-size: 1.05em; }
.tool-body { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 640px; margin: 0 auto; box-sizing: border-box; }
.tool-start { display: flex; flex-direction: column; gap: 12px; margin-top: 8vh; }
button.big { padding: 16px; font-size: 1.05em; border-radius: var(--r); }
.tool-done { padding: 10px 12px; border-radius: var(--r); background: rgba(52, 199, 89, .15); }
.tool-picture { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tool-picture img { max-width: 100%; max-height: 42vh; border-radius: 10px; background: var(--sunk); }
.tool-ai { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: -8px; }
.tool-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tool-dims { display: flex; align-items: center; gap: 8px; }
.tool-dims input { flex: 1; min-width: 0; }
.tool-dim { display: flex; align-items: center; gap: 8px; flex: 1; }
.tool-dim[hidden] { display: none; }
.times { opacity: .6; }
.tool-mini { display: inline-flex; align-items: center; gap: 6px; font-size: .9em; }
.tool-mini select { width: auto; }
.tool-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.tool-inline[hidden] { display: none; }
.tool-inline input[type="text"] { flex: 1; min-width: 140px; }
.tool-foot { position: sticky; bottom: 0; padding: 10px 0 4px; background: linear-gradient(transparent, var(--sand) 30%); }
.tool-foot button { width: 100%; }
.tool-codes { display: flex; flex-direction: column; gap: 12px; padding: 4px; }
.tool-next { font-size: 1.6em; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; padding: 7px 14px; }
.seg button.on { background: var(--navy); color: var(--on-primary); }
.seg.small button { padding: 4px 10px; font-size: .85em; }
.proj-field .seg { align-self: flex-start; }
.label-row { cursor: pointer; }
.label-row.off { opacity: .55; cursor: default; }
.label-foot { display: flex; gap: 10px; align-items: center; }
.label-foot select { width: auto; flex: none; }
.label-foot button { flex: 1; }
.label-ask { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r); background: var(--gold-soft); }
.label-ask span { flex: 1; min-width: 160px; }

/* payouts */
.payout-total { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.payout-total b { font-size: 1.8em; }
.payout-row { width: 100%; text-align: left; background: transparent; border: 0; border-radius: 0; }
.payout-nobody { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r); background: rgba(255, 159, 10, .12); }
.payout-methods { flex-wrap: wrap; border-radius: 14px; }
.statement { background: #fff; color: #111; border-radius: 10px; padding: 18px; font-family: Arial, Helvetica, sans-serif; }
.statement h2 { margin: 0 0 6px; font-size: 1.2em; }
.statement p { margin: 4px 0; }
.statement .muted { color: #555; }
.statement table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .9em; }
.statement th, .statement td { text-align: left; padding: 6px 4px; border-bottom: 1px solid #ddd; vertical-align: top; }
.statement .num { text-align: right; white-space: nowrap; }
.statement tfoot td { font-weight: 700; border-bottom: 0; }

/* the label sheets: US Letter, four by four, to the paper's edge, cut along
   the faint lines — the Venue's own layout. Shown to the printer only. */
#label-print { display: none; }
@media print {
  @page { size: letter; margin: 0; }
  body.printing-labels { background: #fff !important; }
  body.printing-labels > *:not(#label-print) { display: none !important; }
  body.printing-labels #label-print { display: block; }
  .label-page { width: 8.5in; height: 11in; display: grid; grid-template-columns: repeat(4, 2.125in); grid-template-rows: repeat(4, 2.75in); break-after: page; page-break-after: always; }
  .label-page:last-child { break-after: auto; page-break-after: auto; }
  .label-cell { box-sizing: border-box; border: 0.5pt solid #d7d7d7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.17in; padding: 0.14in 0.17in; color: #000; background: #fff; font-family: Arial, Helvetica, sans-serif; text-align: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .label-cell.empty { border-color: transparent; }
  .label-code svg { width: 1.5in; height: 1.5in; display: block; }
  .label-words { display: flex; flex-direction: column; align-items: center; gap: 0.09in; max-width: 1.78in; }
  .label-line { display: flex; align-items: baseline; gap: 4pt; font-size: 6.5pt; }
  .label-sku { font-size: 6.2pt; }
  .label-dot { color: #777; }
  .label-title { font-weight: 700; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .label-title.short { font-size: 11pt; }
  .label-title.mid { font-size: 9.5pt; }
  .label-title.long { font-size: 8pt; }
  .label-artist { font-size: 8pt; color: #808080; }
  /* a statement is a page of its own, with margins */
  body.printing-statement .statement { padding: 0.7in; border-radius: 0; font-size: 11pt; }
}

/* squaring a photograph up: the yellow corners */
.corners-panel { position: fixed; inset: 0; z-index: 70; background: #0d0d0d; color: #fff; display: flex; flex-direction: column; padding: 10px 12px; gap: 8px; overflow: auto; }
.corners-top h2 { margin: 0 0 2px; font-size: 1em; }
.corners-hint, .corners-readout { margin: 0; font-size: .82em; opacity: .85; }
.corners-stage { position: relative; flex: 1 1 auto; min-height: 45vh; display: flex; align-items: center; justify-content: center; touch-action: none; }
.corners-stage img { display: block; max-width: 100%; max-height: 58vh; user-select: none; -webkit-user-drag: none; }
.corners-svg { position: absolute; pointer-events: none; overflow: visible; }
.corners-shape { fill: rgba(255, 215, 0, .12); stroke: #ffd700; stroke-width: .4; vector-effect: non-scaling-stroke; }
.corner-handle { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; padding: 0; border-radius: 50%; border: 3px solid #ffd700; background: rgba(0, 0, 0, .25); touch-action: none; cursor: grab; z-index: 2; }
.corner-handle.chosen { border-color: #fff; background: rgba(255, 215, 0, .55); }
.corner-loupe { position: absolute; width: 116px; height: 116px; border-radius: 50%; border: 3px solid #ffd700; background-repeat: no-repeat; box-shadow: 0 4px 18px rgba(0, 0, 0, .5); z-index: 3; pointer-events: none; }
.corner-loupe::after { content: ''; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border: 2px solid #ffd700; border-radius: 50%; }
.corner-pad { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pad-label { margin: 0; font-size: .8em; opacity: .8; flex-basis: 100%; }
.pad-keys { display: grid; grid-template-columns: repeat(3, 40px); grid-template-rows: repeat(2, 36px); gap: 4px; }
.pad-key { padding: 0; color: #fff; background: #222; border-color: #333; }
.pad-key.up { grid-column: 2; grid-row: 1; }
.pad-key.left { grid-column: 1; grid-row: 2; }
.pad-key.right { grid-column: 3; grid-row: 2; }
.pad-key.down { grid-column: 2; grid-row: 2; }
.pad-pick { display: flex; gap: 4px; }
.pad-corner { width: 38px; height: 38px; padding: 6px; color: #ffd700; background: #222; border-color: #333; }
.pad-corner.active { background: #ffd700; color: #111; }
.pad-corner svg { width: 100%; height: 100%; }
.pad-toggle { font-size: .82em; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.pad-toggle input { width: 18px; height: 18px; flex: none; margin: 0; accent-color: #ffd700; }
.corners-actions, .corners-menu { display: flex; gap: 8px; }
.corners-actions button, .corners-menu button { flex: 1; color: #fff; background: #222; border-color: #333; }
.corners-menu button.primary { background: #ffd700; border-color: #ffd700; color: #111; font-weight: 600; }
@media (max-width: 700px) {
  .corner-handle { width: 40px; height: 40px; margin: -20px 0 0 -20px; border-width: 4px; }
  .corner-loupe { width: 104px; height: 104px; }
  .corners-stage img { max-height: 54vh; }
}
