@font-face { font-family: Geist; src: url(geist.ttf) format("truetype"); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url(jetbrains-mono.ttf) format("truetype"); font-style: normal; font-weight: 100 800; font-display: swap; }
@font-face { font-family: Tektur; src: url(tektur.ttf) format("truetype"); font-style: normal; font-weight: 400 900; font-display: swap; }
:root {
  color-scheme: dark;
  font-family: Geist, system-ui, sans-serif;
  --bg: #0b0f19;
  --panel: #121827;
  --input: #0e1421;
  --line: #283147;
  --ink: #eceefa;
  --muted: #a1aac1;
  --primary: #6366f1;
  --lavender: #818cf8;
  --blue: #38bdf8;
  --red: #fda4af;
  --green: #86efac;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(ellipse at 43% -25%, #202049 0%, transparent 53%), var(--bg); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .53; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
.topbar { border-bottom: 1px solid var(--line); background: #0b0f19bd; }
.topbar-inner, main { width: min(1180px, calc(100% - 56px)); margin-inline: auto; }
.topbar-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: flex; align-items: center; gap: 13px; font-size: 18px; font-weight: 700; }
.wordmark { font: 800 21px Tektur, Geist, sans-serif; letter-spacing: .02em; }
.login-page { display: grid; justify-items: center; gap: clamp(23px, 4vh, 38px); padding-top: clamp(48px, 10vh, 100px); }
.login-wordmark { font-size: clamp(27px, 5.5vw, 43px); text-align: center; line-height: 1.15; }
.login-card { width: min(100%, 420px); padding: clamp(23px, 5vw, 40px); border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 24px 75px #03050c66; }
.login-card h1 { font-size: 37px; margin-bottom: 27px; }
.login-card .primary { justify-self: stretch; margin-top: 3px; }
.login-card .remember { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--muted); }
.login-card .remember input { width: 17px; height: 17px; padding: 0; accent-color: var(--primary); flex: 0 0 auto; margin: 0; }
.header-logo { display: block; flex: 0 0 auto; border-radius: 9px; }
.login-logo { display: block; width: clamp(126px, 30vw, 166px); height: auto; margin-top: clamp(20px, 5vh, 46px); filter: url("eask-theme.svg#dark-logo"); }
.envelope { display: block; position: relative; width: 17px; height: 12px; border: 1.5px solid currentColor; border-radius: 3px; overflow: hidden; }
.envelope::after { content: ""; position: absolute; left: 2px; top: -8px; width: 10px; height: 10px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.brand-divider { height: 18px; width: 1px; background: var(--line); margin-inline: 2px; }
.brand-section { color: var(--muted); font-size: 14px; font-weight: 500; }
.connection { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.connection::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8790a7; flex: 0 0 auto; }
.connection[data-state="connected"]::before { background: var(--green); }
.connection[data-state="error"]::before { background: var(--red); }
main { padding-block: 66px 42px; }
.intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
h1 { font-size: clamp(36px, 5vw, 54px); line-height: 1.05; letter-spacing: -.055em; margin: 0 0 12px; }
.intro p { margin: 0; color: var(--muted); font-size: 16px; }
.primary, .secondary, .row-action { border-radius: 9px; min-height: 42px; padding: 8px 14px; font-size: 14px; font-weight: 650; }
.primary { color: #fff; background: #5356d9; border: 1px solid var(--lavender); white-space: nowrap; }
.primary:not(:disabled):hover { background: #494bd2; }
.primary span { display: inline-block; margin-right: 5px; font-size: 18px; line-height: 1; }
.board { background: var(--panel); border: 1px solid var(--line); border-radius: 17px; overflow: hidden; box-shadow: 0 20px 60px #03050c4d; }
.toolbar, .board-footer { display: flex; align-items: center; justify-content: space-between; padding: 17px 21px; gap: 16px; }
.tabs, .filters { display: flex; align-items: center; gap: 8px; }
.tab { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; min-height: 42px; padding: 7px 12px; font-size: 14px; font-weight: 650; background: transparent; white-space: nowrap; }
.pending { color: var(--red); --tab-fill: #3a202d; --tab-line: #714151; }
.completed { color: var(--green); --tab-fill: #18352e; --tab-line: #326650; }
.progress { color: #fde68a; --tab-fill: #3b3020; --tab-line: #715a34; }
.tabs { flex-wrap: wrap; }
#workspace { width: min(1740px, calc(100% - 56px)); }
.workspace-grid { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(0, 4fr) minmax(180px, 1.1fr); gap: 18px; align-items: start; }
.side-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 16px; min-width: 0; }
.side-panel h2 { margin: 0 0 10px; font-size: 17px; }
.my-work h2 { color: #fde68a; }
.side-panel p { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.side-letters { list-style: none; margin: 10px 0 0; padding: 0; }
.side-letters li { border-top: 1px solid var(--line); padding-block: 7px; }
.side-letters button { max-width: 100%; }
.side-letters .letter-open { width: 100%; }
.team-mail .letter-open span { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
.team-mail .side-letters > li { border: 1px solid transparent; border-top-color: var(--line); padding: 10px; margin-bottom: 7px; border-radius: 9px; }
.team-mail .side-letters > .shared-active { background: #3b3020; border-color: #715a34; }
.team-mail .side-letters > .shared-completed { background: #18352e; border-color: #326650; }
.shared-closed { display: block; color: var(--green); font-size: 12px; margin-top: 7px; }
.shared-reopen { display: block; margin: 8px 0 0 auto; text-align: right; font-size: 12px; }
.transfer-plus { display: inline-grid; place-items: center; }
.transfer-symbol { display: block; width: 20px; height: 20px; background: currentColor; mask: url("/transfer-icon.png") center / contain no-repeat; -webkit-mask: url("/transfer-icon.png") center / contain no-repeat; }
#team-toggle { width: 100%; }
#team-setup, #team-more { margin-top: 8px; }
.team-mail { display: flex; flex-direction: column; max-height: min(680px, 76vh); max-height: min(680px, 76dvh); overflow: hidden; }
#team-toggle { flex-shrink: 0; }
#team-content { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
#team-content > :not(.side-letters) { flex-shrink: 0; }
#team-letters { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.task-actions { display: flex; align-items: center; gap: 7px; min-width: 0; }
.task-actions select { min-width: 0; flex: 1; padding-inline: 7px; }
.transfer-plus { flex: 0 0 34px; width: 34px; height: 36px; border: 1px solid #715a34; background: #3b3020; color: #fde68a; border-radius: 8px; font-size: 24px; cursor: pointer; }
#transfer-dialog { width: min(560px, calc(100% - 28px)); max-height: 70dvh; }
.transfer-users { display: grid; gap: 10px; }
.transfer-users button { text-align: left; }
.attachment-target { display: grid; gap: 6px; width: 100%; font-size: 13px; color: var(--muted); }
.attachment-target select { width: 100%; }
@media (max-width: 570px) { .task-actions { grid-column: 2; grid-row: 1 / span 2; } .task-actions .row-action { max-width: 95px; } }
@media (max-width: 1160px) {
  .workspace-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .workspace-grid > .board { grid-column: 1 / -1; grid-row: 2; }
  .workspace-grid > .team-mail { grid-column: 2; grid-row: 1; }
}
@media (max-width: 670px) {
  #workspace { width: calc(100% - 28px); }
  .workspace-grid { display: flex; flex-direction: column; }
  .workspace-grid > * { width: 100%; }
  .team-mail { order: -2; }
  .my-work { order: -1; }
}
.tab[aria-pressed="true"], .tab:hover { border-color: var(--tab-line); background: var(--tab-fill); }
.tab span { font: 600 12px "JetBrains Mono", monospace; padding: 2px 5px; min-width: 21px; border-radius: 5px; text-align: center; background: #ffffff12; }
.search { display: flex; align-items: center; gap: 9px; padding: 0 12px; }
.search, select { min-height: 42px; color: var(--muted); background: var(--input); border: 1px solid var(--line); border-radius: 9px; }
.search input { width: min(17vw, 210px); color: var(--ink); border: 0; padding: 10px 0; background: transparent; font-size: 14px; }
.search input:focus-visible { outline: 0; }
.search:focus-within { border-color: var(--blue); }
.search input::placeholder { color: var(--muted); }
.magnifier { width: 12px; height: 12px; border: 1.5px solid currentColor; border-radius: 50%; position: relative; flex-shrink: 0; }
.magnifier::after { content: ""; width: 5px; height: 1.5px; background: currentColor; position: absolute; right: -4px; bottom: -2px; transform: rotate(45deg); }
select { padding: 0 10px; font-size: 14px; }
.list-head, .letter { display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) 150px 170px; gap: 16px; padding-inline: 22px; }
.list-head { min-height: 42px; background: #101623; border-block: 1px solid var(--line); color: var(--muted); font: 500 12px "JetBrains Mono", monospace; }
.letters { list-style: none; margin: 0; padding: 0; }
.letter { min-height: 78px; border-bottom: 1px solid var(--line); }
.letter-open { display: grid; gap: 5px; text-align: left; color: var(--ink); background: transparent; border: 0; padding: 9px 0; min-width: 0; }
.letter-open:hover strong { color: #b3baff; }
.letter-open strong, .letter-open span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.letter-open span, .letter time { color: var(--muted); font-size: 13px; }
.row-action, .secondary { color: var(--ink); background: var(--input); border: 1px solid var(--line); }
.row-action:hover, .secondary:hover { border-color: var(--lavender); }
.empty { min-height: 340px; display: grid; place-content: center; justify-items: center; text-align: center; padding: 30px 18px; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; color: #b0baff; background: #242c55; border: 1px solid #404c82; border-radius: 17px; margin-bottom: 17px; }
.empty-icon .envelope { transform: scale(1.45); }
.empty h2 { font-size: 21px; margin: 0 0 7px; letter-spacing: -.02em; }
.empty p { font-size: 14px; color: var(--muted); margin: 0; max-width: 34ch; }
.board-footer { min-height: 58px; border-top: 1px solid var(--line); color: var(--muted); font: 500 12px "JetBrains Mono", monospace; }
.notice { color: var(--muted); font-size: 14px; }
dialog { width: min(620px, calc(100% - 28px)); max-height: 82vh; padding: 0; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--panel); }
dialog::backdrop { background: #03050cc9; }
.account { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account .connection { overflow-wrap: anywhere; }
.account button { min-height: 34px; font-size: 12px; }
.detail-content { padding: 25px; overflow-wrap: anywhere; }
.detail-content h2 { margin: 0 45px 10px 0; }
.detail-content p { color: var(--muted); }
.detail-content pre { white-space: pre-wrap; font: inherit; line-height: 1.6; }
.review-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; position: sticky; top: -25px; z-index: 1; padding-block: 12px; margin-top: -12px; margin-bottom: 12px; background: var(--panel); }
.review-tools form { order: 3; margin-left: auto; }
#review-result { color: var(--green); font-size: 14px; }
.close { float: right; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 36px; font-size: 22px; }
.connect-form, .connect-form label { display: grid; gap: 8px; }
.connect-form { gap: 16px; }
.connect-form input { color: var(--ink); background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 10px; width: 100%; }
.connect-form a { color: var(--blue); font-size: 14px; }
.connect-form .primary { justify-self: start; }
.form-error { color: var(--red) !important; margin: 0; }
.form-note { margin: 0; font-size: 13px; }
.inbox-dialog { width: min(760px, calc(100% - 28px)); overflow: hidden; }
.inbox-dialog .detail-content { display: flex; flex-direction: column; max-height: min(82vh, 82dvh); overflow: hidden; }
.inbox-dialog .detail-content > :not(.inbox-list) { flex-shrink: 0; }
.inbox-dialog .inbox-list { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.inbox-footer { background: var(--panel); border-top: 1px solid var(--line); padding-top: 14px; }
.inbox-controls { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.inbox-controls .search { flex: 1; }
.inbox-controls input { width: 100%; }
.inbox-list { list-style: none; margin: 12px 0; padding: 0; }
.inbox-list li { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.inbox-list label { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 0; padding-block: 9px; cursor: pointer; }
.inbox-list button { min-height: 36px; font-size: 13px; }
.inbox-list label input { accent-color: var(--primary); width: 18px; height: 18px; flex: 0 0 auto; }
.inbox-list label span { display: grid; gap: 4px; overflow-wrap: anywhere; }
.inbox-list small { color: var(--muted); }
.inbox-footer .primary { margin-inline-start: auto; }
@media (max-width: 820px) {
  .topbar-inner { flex-wrap: wrap; padding-block: 10px; }
  .account { flex-wrap: wrap; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { flex: 1; }
  .search input { width: 100%; }
}
@media (max-width: 570px) {
  .topbar-inner, main { width: calc(100% - 28px); }
  .brand-section, .brand-divider { display: none; }
  main { padding-top: 37px; }
  .login-page { padding-top: 58px; }
  .intro { align-items: flex-start; flex-direction: column; gap: 15px; }
  .toolbar, .board-footer { padding-inline: 12px; }
  .tab { padding-inline: 8px; }
  .tab, select, .search input { font-size: 13px; }
  .list-head { display: none; }
  .letter { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; padding: 9px 12px; }
  .letter time { grid-column: 1; grid-row: 2; }
  .row-action { grid-column: 2; grid-row: 1 / span 2; max-width: 107px; font-size: 12px; }
  .empty { min-height: 280px; }
}

.provider-list { display: grid; gap: 10px; }
.provider-list button { text-align: start; }
.task-state { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; flex: 1; }
.completion-check { flex: 0 0 32px; width: 32px; height: 36px; color: var(--green); background: #18352e; border: 1px solid #326650; border-radius: 8px; font-size: 21px; cursor: pointer; }
#moderation-dialog, #approval-dialog { width: min(600px, calc(100% - 28px)); }
.approval-files { display: grid; gap: 9px; margin-block: 16px; }
#approval-content pre { white-space: pre-wrap; font: inherit; line-height: 1.6; }
#messenger { position: fixed; bottom: 0; right: 22px; z-index: 8; width: min(400px, calc(100% - 28px)); filter: drop-shadow(0 8px 26px #0007); }
#chat-toggle { display: block; width: 100%; min-height: 43px; color: var(--ink); background: #202b43; border: 1px solid #475576; border-bottom: 0; border-radius: 13px 13px 0 0; font-weight: 650; }
#chat-unread { padding: 2px 7px; margin-left: 6px; border-radius: 9px; background: var(--primary); }
#chat-panel { display: flex; flex-direction: column; height: min(560px, 78dvh); min-height: 0; background: var(--panel); border: 1px solid var(--line); border-bottom: 0; padding: 14px; gap: 10px; }
.chat-heading { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.chat-heading h2 { font-size: 17px; margin: 0; }
.chat-heading button { min-height: 30px; padding: 1px 9px; }
.chat-peer-label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
#chat-messages { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; flex: 1; overscroll-behavior: contain; }
#chat-messages li { padding: 10px; margin-bottom: 8px; border-radius: 10px; background: #1e283b; overflow-wrap: anywhere; }
#chat-messages li.mine { background: #292955; margin-left: 16px; }
#chat-messages small { color: var(--muted); font-size: 11px; }
#chat-messages p { margin: 5px 0; font-size: 14px; white-space: pre-wrap; }
#chat-messages button { margin-top: 6px; min-height: 34px; font-size: 12px; }
#chat-form { display: flex; align-items: flex-end; gap: 8px; }
#chat-text { flex: 1; width: 100%; resize: none; color: var(--ink); background: var(--input); border: 1px solid var(--line); border-radius: 8px; padding: 9px; font: inherit; font-size: 14px; }
#chat-notice { color: var(--muted); font-size: 12px; margin: 0; }
.chat-favorites h3 { color: var(--muted); font-size: 12px; margin: 0 0 7px; }
#chat-contacts, #chat-support { list-style: none; margin: 0; padding: 0; max-height: 140px; overflow-y: auto; overscroll-behavior: contain; }
#chat-contacts li, #chat-support li { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
#chat-contacts button, #chat-support button { min-height: 31px; padding: 5px 7px; font-size: 13px; }
#chat-contacts .favorite-name, #chat-support .favorite-name { flex: 1; text-align: left; min-width: 0; overflow-wrap: anywhere; }
#chat-contacts button[aria-pressed="true"], #chat-support button[aria-pressed="true"], #chat-saved[aria-pressed="true"] { border-color: var(--lavender); background: #292955; }
#chat-saved { width: 100%; text-align: left; color: #c5c9ff; }
.chat-conversation { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
#chat-favorites-empty { font-size: 12px; margin: 0; color: var(--muted); }
#chat-pin { font-size: 12px; min-height: 30px; padding: 4px 8px; align-self: flex-start; }
#chat-panel > :not(#chat-messages) { flex-shrink: 0; }
#workspace { padding-bottom: 70px; }
@media (max-width: 570px) { #messenger { right: 14px; } .task-actions { flex-wrap: wrap; max-width: 112px; } .task-state { flex-basis: 100%; } }
#provider-status { margin-bottom: 0; }

/* Contacts stay on the right; the conversation has its own central window. */
#messenger { filter: none; }
#chat-panel { box-shadow: 0 8px 26px #0007; }
#chat-contacts { flex: 1; max-height: none; min-height: 0; }
#conversation-window { position: fixed; left: calc((100vw - 444px) / 2); top: 88px; bottom: 20px; transform: translateX(-50%); width: min(800px, calc(100vw - 480px)); display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--panel); border: 1px solid #475576; border-radius: 16px; box-shadow: 0 16px 60px #0008; min-height: 0; }
#conversation-window > :not(#chat-messages) { flex-shrink: 0; }
#conversation-window .chat-heading { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
#conversation-window .chat-heading h2 { font-size: 20px; }
#conversation-window #chat-form { padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
  #conversation-window { left: 12px; right: 12px; top: 76px; bottom: 12px; width: auto; transform: none; z-index: 10; padding: 14px; }
}

#conversation-window .chat-heading { cursor: grab; user-select: none; touch-action: none; }
#conversation-window.dragging .chat-heading { cursor: grabbing; }
#conversation-window .chat-heading button { cursor: pointer; }
.chat-resize { position: absolute; z-index: 2; touch-action: none; user-select: none; }
.chat-resize-n, .chat-resize-s { height: 10px; left: 14px; right: 14px; cursor: ns-resize; }
.chat-resize-n { top: -4px; } .chat-resize-s { bottom: -4px; }
.chat-resize-e, .chat-resize-w { width: 10px; top: 14px; bottom: 14px; cursor: ew-resize; }
.chat-resize-e { right: -4px; } .chat-resize-w { left: -4px; }
.chat-resize-ne, .chat-resize-nw, .chat-resize-se, .chat-resize-sw { width: 18px; height: 18px; }
.chat-resize-ne, .chat-resize-se { right: -4px; } .chat-resize-nw, .chat-resize-sw { left: -4px; }
.chat-resize-ne, .chat-resize-nw { top: -4px; } .chat-resize-se, .chat-resize-sw { bottom: -4px; }
.chat-resize-ne, .chat-resize-sw { cursor: nesw-resize; } .chat-resize-nw, .chat-resize-se { cursor: nwse-resize; }
.chat-resize-se::after { content: ''; position: absolute; width: 7px; height: 7px; right: 7px; bottom: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); opacity: .7; }
#announcement-form { display: grid; gap: 8px; margin-top: 14px; }
#announcement-text { width: 100%; resize: vertical; min-height: 80px; max-height: 260px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--input); font: inherit; font-size: 14px; }
#announcements { max-height: 60dvh; overflow-y: auto; overscroll-behavior: contain; }
#announcements small, #announcement-notice { color: var(--muted); font-size: 12px; }
.announcement-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; margin: 8px 0; }

.announcement-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.announcement-delete { flex-shrink: 0; min-height: 24px; padding: 0 7px; font-size: 18px; }
:root { --header-bg: #0b0f19bd; --glow: #202049; --raised: #202b43; --bubble: #1e283b; --mine: #292955; }
:root[data-theme="light"] { color-scheme: light; --bg:#f4f5f8; --panel:#ffffff; --input:#f0f1f6; --line:#cfd3df; --ink:#202333; --muted:#596174; --lavender:#5b59cd; --blue:#007fac; --red:#b32140; --green:#18743d; --header-bg:#ffffffed; --glow:#e7e6fb; --raised:#e5e7f0; --bubble:#eef0f5; --mine:#e5e2ff; }
:root[data-theme="gray"] { --bg:#303136; --panel:#393a40; --input:#2b2c31; --line:#55565e; --ink:#f0f0f3; --muted:#c0c1cb; --header-bg:#2b2c31; --glow:transparent; --raised:#45464e; --bubble:#45464e; --mine:#4b456d; }
:root[data-theme="onyx"] { --bg:#000; --panel:#090909; --input:#111; --line:#303036; --ink:#f3f3f6; --muted:#aaaab5; --header-bg:#000; --glow:transparent; --raised:#17171b; --bubble:#19191e; --mine:#222039; }
body { background: radial-gradient(ellipse at 43% -25%, var(--glow) 0%, transparent 53%), var(--bg); }
.topbar { background:var(--header-bg); }
.topbar-inner { padding-right:76px; }
.list-head { background:var(--input); }
#chat-toggle { background:var(--raised); border-color:var(--line); }
#chat-messages li { background:var(--bubble); }
#chat-messages li.mine, #chat-contacts button[aria-pressed="true"], #chat-support button[aria-pressed="true"], #chat-saved[aria-pressed="true"] { background:var(--mine); }
#chat-saved { color:var(--ink); }
#conversation-window { border-color:var(--line); }
#theme-picker { position:fixed; right:16px; top:14px; z-index:20; }
#theme-toggle { background:var(--panel); color:var(--ink); }
#theme-panel { position:absolute; top:50px; right:0; width:300px; max-width:calc(100vw - 24px); padding:18px; background:var(--panel); color:var(--ink); border:1px solid var(--line); border-radius:14px; box-shadow:0 12px 40px #0005; }
.theme-options { display:flex; gap:10px; margin-top:18px; }
.theme-options button { flex:1; min-width:0; padding:0; border:0; color:var(--muted); background:transparent; }
.theme-options span { position:relative; display:block; height:47px; border:1px solid #85858f; border-radius:9px; margin-bottom:7px; }
.theme-options small { font-size:11px; }
[data-theme-choice="light"] span { background:#fff; }
[data-theme-choice="gray"] span { background:#303136; }
[data-theme-choice="dark"] span { background:#0b0f19; }
[data-theme-choice="onyx"] span { background:#000; }
.theme-options [aria-pressed="true"] span { outline:3px solid #7774ff; outline-offset:1px; }
.theme-options [aria-pressed="true"] span::after { content:'✓'; position:absolute; right:-4px; top:-8px; background:#6366f1; color:#fff; border-radius:50%; width:20px; height:20px; }
:root[data-theme="light"] .login-logo {
  filter: contrast(1.12) saturate(1.08);
  mix-blend-mode: multiply;
}
:root[data-theme="light"] .progress, :root[data-theme="light"] .my-work h2 { color:#806000; }
:root[data-theme="light"] .pending { --tab-fill:#fce6ec; --tab-line:#d9a2ad; }
:root[data-theme="light"] .completed { --tab-fill:#def5e6; --tab-line:#9fcab0; }
:root[data-theme="light"] .progress { --tab-fill:#fff2c6; --tab-line:#d2ba6d; }
:root[data-theme="light"] .shared-closed { color:#18743d; }
:root[data-theme="light"] .team-mail .side-letters > .shared-active { background:#fff2c6; border-color:#d2ba6d; }
:root[data-theme="light"] .team-mail .side-letters > .shared-completed { background:#def5e6; border-color:#9fcab0; }
:root[data-theme="light"] .completion-check { color:#18743d; background:#def5e6; }
:root[data-theme="light"] .transfer-plus { color:#806000; background:#fff2c6; }
:root[data-theme="light"] .empty-icon { color:#5356af; background:#e7e8ff; border-color:#b8bce4; }
@media(max-width:600px) { .topbar-inner { flex-wrap:wrap; padding-block:14px; } .account { flex-wrap:wrap; } .login-page { padding-top:90px; } }

.team-disconnect-row { display:flex; justify-content:flex-end; margin-top:20px; }
#team-disconnect { color:var(--red); }

.username, .favorite-name, #chat-conversation-title, .connection { font-weight: 700; }

.cancel-transfer { width:34px; height:36px; flex-shrink:0; border:1px solid #914355; border-radius:8px; color:var(--red); background:var(--panel); font-size:25px; }
.cancel-transfer:hover { background:#91435533; }

#chat-messages .accept-transfer { color:var(--green); border-color:#326650; }
#chat-messages .reject-transfer { color:var(--red); border-color:#914355; margin-left:6px; }
.transfer-status { color:var(--muted); font-size:12px !important; }
/* Header shortcut with a contact popover below it. */
#messenger { top:14px; bottom:auto; right:116px; width:auto; z-index:19; }
#chat-toggle { width:auto; min-height:42px; padding:8px 14px; border:1px solid var(--line); border-radius:9px; background:var(--panel); font-size:14px; }
#chat-panel { position:absolute; top:50px; right:0; width:min(400px, calc(100vw - 28px)); height:min(560px, calc(100dvh - 90px)); border:1px solid var(--line); border-radius:14px; }
.topbar-inner { padding-right:220px; }
@media(max-width:600px) {
  .topbar-inner { padding-right:0; padding-top:68px; }
  #messenger { right:116px; }
  #chat-panel { position:fixed; top:64px; right:14px; }
}
.conversation-controls { display:flex; gap:6px; }
#conversation-restore { position:fixed; right:22px; bottom:0; z-index:18; min-width:180px; max-width:calc(100vw - 28px); min-height:43px; padding:10px 18px; background:var(--raised); color:var(--ink); border:1px solid var(--line); border-radius:12px 12px 0 0; font:inherit; font-weight:700; overflow-wrap:anywhere; }
#chat-panel > .chat-heading { cursor:grab; user-select:none; touch-action:none; }
#chat-panel > .chat-heading.dragging { cursor:grabbing; }
#chat-panel > .chat-heading button { cursor:pointer; }

#chat-support { padding-bottom:10px; border-bottom:1px solid var(--line); margin-bottom:2px; flex-shrink:0; }
#chat-support li:last-child { margin-bottom:0; }

#chat-support { border-bottom-color:var(--ink); }
/* Account status beside Messages; theme settings in the lower corner. */
#theme-picker { top:auto; bottom:14px; right:16px; }
#theme-panel { top:auto; bottom:50px; }
#logout { position:fixed; right:16px; top:14px; min-height:42px; background:var(--panel); }
#messenger { right:104px; }
#account { position:fixed; top:14px; right:236px; min-height:42px; display:flex; align-items:center; gap:10px; z-index:18; max-width:calc(100vw - 660px); }
#connection { min-width:0; overflow-wrap:anywhere; }
.topbar-inner { padding-right:0; }
#conversation-restore { right:120px; }
@media(max-width:1000px) {
  .topbar-inner { padding-top:72px; padding-bottom:16px; }
  #account { top:66px; right:16px; max-width:calc(100vw - 32px); flex-wrap:wrap; }
  .topbar-inner .brand { margin-top:42px; }
}
@media(max-width:600px) {
  #messenger { right:104px; }
  #theme-picker { bottom:12px; }
  #conversation-restore { right:110px; min-width:150px; max-width:calc(100vw - 126px); }
}
.topbar-inner { width:calc(100% - 32px); position:relative; justify-content:flex-start; }
.welcome { position:absolute; left:50%; transform:translateX(-50%); font-size:15px; text-align:center; }
@media(min-width:1001px) and (max-width:1500px) { .topbar-inner { min-height:112px; align-items:flex-start; padding-top:18px; } .welcome { top:76px; } }
@media(max-width:1000px) { .topbar-inner { flex-direction:column; align-items:flex-start; gap:12px; } .welcome { position:static; transform:none; width:100%; padding-bottom:4px; } }

.welcome { opacity:1; filter:blur(0); transition:opacity 1.4s ease, filter 1.4s ease; }
.welcome.welcome-faded { opacity:0; filter:blur(12px); pointer-events:none; visibility:hidden; transition:opacity 1.4s ease, filter 1.4s ease, visibility 0s 1.4s; }
@media(prefers-reduced-motion:reduce) { .welcome, .welcome.welcome-faded { transition:none; } }
#chat-contacts .favorite-name { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.contact-name { min-width:0; overflow-wrap:anywhere; }
.contact-presence { flex-shrink:0; max-width:70%; text-align:right; font-weight:400; color:var(--muted); font-size:11px; }
.presence-state { display:flex; align-items:center; justify-content:flex-end; gap:5px; }
.presence-state::before { content:''; width:6px; height:6px; border-radius:50%; background:#8790a7; flex-shrink:0; }
.contact-presence.online { color:var(--green); }
.online .presence-state::before { background:var(--green); }
.last-seen { display:block; margin-top:3px; font-size:10px; }
#chat-toggle { position:relative; overflow:visible; }
#chat-unread { position:absolute; top:-7px; right:-7px; display:inline-flex; align-items:center; justify-content:center; min-width:21px; height:21px; padding:0 5px; margin:0; border-radius:999px; background:#dc354f; color:#fff; border:2px solid var(--panel); font-size:11px; font-weight:750; line-height:1; }
