#marketChatPanel[hidden], .mc-panel [hidden] { display: none; }
#workspaceRail .workspace-rail-buttons { height: 100%; align-content: start; grid-template-rows: auto auto auto 1fr auto; }
#workspaceRail .workspace-rail-buttons .mc-desktop { grid-row: 5; align-self: end; }
.mc-launcher { position: relative; }
.mc-launcher.mc-mobile { display: none; }
.mc-unread { display: none; position: absolute; width: 9px; height: 9px; right: 4px; top: 4px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--panel); pointer-events: none; }
.mc-has-unread .mc-unread { display: block; }
.mc-panel {
  position: fixed; z-index: 26; inset: 58px 48px 29px auto;
  width: min(348px, 42vw); display: flex; flex-direction: column;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; box-shadow: 0 12px 42px #0005; isolation: isolate;
  font-size: 13px;
}
.mc-panel :where(button,textarea):focus-visible, .mc-prefs :where(button,input):focus-visible, .mc-history:focus-visible, button.mc-launcher:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px;
}
.mc-panel h2 { margin: 0; color: inherit; font-size: 15px; font-weight: 700; margin-inline-end: auto; }
.mc-panel > .mc-heading { flex: 0 0 auto; display: flex; position: static; height: auto; min-height: 43px;
  justify-content: flex-end; align-items: center; gap: 3px; padding: 3px 7px 3px 13px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.mc-button {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 6px; min-width: 34px; height: 34px; padding: 4px 7px;
  color: var(--muted); background: transparent; cursor: pointer; font: inherit;
}
.mc-button .icon { width: 17px; height: 17px; }
.mc-button:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.mc-button:disabled { cursor: default; opacity: .5; }
.mc-history { min-height: 0; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 9px 10px 10px; }
.mc-history .mc-earlier { display: flex; margin: 0 auto 8px; padding-inline: 10px; }
.mc-empty { max-width: 210px; margin: 37px auto 0; text-align: center; color: var(--muted); line-height: 1.55; }
.mc-message { display: flex; align-items: flex-start; gap: 8px; padding: 8px 4px; border-radius: 6px; }
.mc-message.mc-highlight { background: var(--hover); outline: 1px solid var(--accent); outline-offset: -1px; }
.mc-avatar {
  flex: none; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%;
  background: var(--hover); color: var(--accent); font-size: 12px; font-weight: 700; overflow: hidden;
}
.mc-message-content { min-width: 0; flex: 1; }
.mc-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 5px; }
.mc-name { font-weight: 680; overflow-wrap: anywhere; }
.mc-tag { font-size: 10px; font-weight: 650; color: var(--accent); background: var(--hover);
  border-radius: 4px; padding: 0 4px; white-space: nowrap; }
.mc-time { color: var(--muted); font-size: 10px; margin-inline-start: auto; white-space: nowrap; }
.mc-message-text { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.mc-pictures { margin-top: 6px; display: grid; gap: 5px; }
.mc-picture { display: block; width: 100%; max-width: 100%; text-align: left; padding: 0; overflow: hidden;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; }
.mc-picture img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; }
.mc-picture > span { display: block; padding: 4px 7px; overflow: hidden; white-space: nowrap;
  text-overflow: ellipsis; color: var(--muted); font-size: 11px; }
dialog.mc-image-viewer {
  --mc-viewer-top: max(8px, env(safe-area-inset-top));
  --mc-viewer-right: max(8px, env(safe-area-inset-right));
  --mc-viewer-bottom: max(8px, env(safe-area-inset-bottom));
  --mc-viewer-left: max(8px, env(safe-area-inset-left));
  position: fixed;
  inset: var(--mc-viewer-top) var(--mc-viewer-right) var(--mc-viewer-bottom) var(--mc-viewer-left);
  margin: auto;
  width: min(1600px, calc(100vw - var(--mc-viewer-left) - var(--mc-viewer-right)));
  height: min(1050px, calc(100dvh - var(--mc-viewer-top) - var(--mc-viewer-bottom)));
  max-width: none;
  max-height: none;
  padding: 0;
  color: var(--ink);
  background: var(--popup-surface);
  border: 1px solid var(--popup-edge);
  border-radius: 10px;
  box-shadow: var(--popup-shadow);
  overflow: hidden;
}
.mc-image-viewer[open] { display: flex; flex-direction: column; }
.mc-image-viewer::backdrop { background: #060709b8; }
.mc-image-viewer [hidden] { display: none; }
.mc-image-header {
  display: flex; align-items: center; gap: 4px; padding: 0 5px 0 12px; flex: none;
  border-bottom: 1px solid var(--line);
}
.mc-image-header h2 {
  flex: 1; min-width: 0; margin: 0; font-size: 14px; font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mc-image-header .mc-button { min-width: 44px; height: 44px; font-size: 12px; }
.mc-image-header .mc-button[aria-disabled="true"] { background: transparent; color: var(--muted); cursor: default; opacity: .5; }
.mc-image-header .mc-button:focus-visible, .mc-image-stage:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px;
}
.mc-image-stage {
  min-height: 0; flex: 1; overflow: hidden; background: var(--bg);
  touch-action: pan-x pan-y; overscroll-behavior: contain; overflow-anchor: none;
}
.mc-image-canvas { display: grid; place-items: center; width: 100%; height: 100%; }
.mc-preview-image { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; }
.mc-image-stage.is-zoomed { overflow: auto; }
.mc-image-stage.is-zoomed .mc-image-canvas {
  width: max(100%, var(--mc-zoom-width)); height: max(100%, var(--mc-zoom-height));
}
.mc-image-stage.is-zoomed .mc-preview-image {
  width: var(--mc-zoom-width); height: var(--mc-zoom-height); max-width: none; max-height: none;
}
.mc-image-status { margin: 18px 14px; color: var(--muted); text-align: center; }
.mc-delivery { color: var(--muted); margin: 4px 0 0; font-size: 11px; }
.mc-panel .mc-jump { position: absolute; align-self: center; top: 46px; background: var(--bg);
  border-color: var(--line); box-shadow: 0 2px 8px #0004; }
.mc-compose { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 8px 9px 6px; }
.mc-text {
  display: block; width: 100%; padding: 9px 10px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; font: inherit;
}
textarea.mc-text { resize: vertical; min-height: 48px; max-height: 120px; }
.mc-text::placeholder { color: var(--muted); }
.mc-tools { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.mc-send { margin-inline-start: auto; padding-inline: 12px; background: var(--accent); color: #16121b; }
.mc-button.mc-send:hover:not(:disabled) { background: var(--accent); color: #16121b; filter: brightness(1.12); }
.mc-feedback { font-size: 11px; color: var(--muted); margin: 4px 0 0; }
.mc-feedback:empty { display: none; }
.mc-drafts { display: grid; gap: 5px; }
.mc-drafts:empty { display: none; }
.mc-draft { display: flex; gap: 7px; align-items: center; min-width: 0; margin-bottom: 5px; padding: 4px;
  border: 1px solid var(--line); border-radius: 6px; }
.mc-draft img { flex: none; width: 56px; height: 36px; object-fit: contain; border-radius: 4px; background: var(--bg); }
.mc-draft span { flex: 1; min-width: 0; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mc-prefs { display: grid; gap: 11px; width: min(410px, 100%); color: var(--ink); }
.mc-prefs > label { display: grid; gap: 4px; }
.mc-prefs small { color: var(--muted); }
.mc-prefs .mc-secondary { width: max-content; padding-inline: 10px; color: var(--ink); border-color: var(--line); }
.mc-tg-preview { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 155px; overflow: auto;
  margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px; }
.mc-confirm { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
@media (max-width: 760px) {
  #tools .rail-actions > .mc-mobile { display: inline-flex; padding: 0; }
  #tools .rail-actions > .mc-mobile:is([aria-expanded="true"], :active) {
    background: var(--hover); color: var(--accent);
  }
  .mc-panel { inset: auto 0 var(--mc-keyboard, 0px);
    width: 100%; height: min(570px, 72dvh, var(--mc-available, 100dvh));
    border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .mc-panel .mc-heading { min-height: 46px; }
  .mc-panel .mc-button, .mc-prefs .mc-button { min-width: 44px; height: 44px; }
  .mc-panel .mc-text { min-height: 44px; font-size: 16px; }
  .mc-panel .mc-compose { padding: 6px 9px 4px; }
  .mc-drafts { display: flex; gap: 6px; }
  .mc-draft { flex: 1; }
  .mc-draft img { width: 33px; height: 30px; }
}

#toast.is-terminal-alert {
  inset-block: max(54px, env(safe-area-inset-top)) auto;
  z-index: 31;
}
#toast.is-terminal-alert > .icon { margin-inline-end: 7px; vertical-align: middle; }

.mc-reply-button {
  min-width: 30px; height: 30px; padding: 0;
}
@media (hover: hover) and (pointer: fine) {
  .mc-message:not(:hover, :focus-within) .mc-reply-button { opacity: 0; }
}
.mc-reply-quote, .mc-reply-draft {
  display: flex; gap: 6px; align-items: center; min-width: 0;
  padding: 5px 7px; margin-block: 4px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--bg);
}
.mc-reply-quote {
  display: grid; gap: 2px; width: 100%; min-height: 40px; height: auto;
  text-align: start; justify-content: stretch;
}
.mc-reply-quote strong, .mc-reply-copy strong { color: var(--accent); font-size: 11px; }
.mc-reply-quote small, .mc-reply-copy small {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 11px;
}
.mc-reply-copy { display: grid; flex: 1; min-width: 0; gap: 2px; }
.mc-compose { position: relative; }
.mc-mention-list {
  position: absolute; z-index: 2; inset: auto 8px 100%;
  max-height: min(220px, 34dvh); overflow: auto; overscroll-behavior: contain;
  padding: 4px; background: var(--popup-surface); border: 1px solid var(--popup-edge);
  border-radius: 7px; box-shadow: var(--popup-shadow);
}
.mc-mention-list .mc-mention {
  display: flex; justify-content: flex-start; gap: 6px; width: 100%; min-height: 36px;
  text-align: start; color: var(--ink);
}
.mc-mention[aria-selected="true"] { background: var(--hover); }
.mc-mention > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
  .mc-panel .mc-reply-button { min-width: 44px; height: 44px; }
  .mc-panel .mc-reply-quote { min-height: 44px; height: auto; }
}
