/*
 * Right panel on computers, from 1100 px (redesign 2026-11, as in the
 * approved mockup "Main"). Tabs: Room · Chat · Versions · Files · Inspector
 * (src/ui/inspectorDock.js sets data-sw-side-tab on .workspace). Room shows
 * "Where you are" (Desk / Local / Stream / Away), "In the room · N" and the
 * recent activity (src/ui/roomPanelLook.js). Chat shows the chat and the full
 * history. Versions shows the saved versions. Files opens the room files.
 * Below 1100 px the panel is exactly as before.
 */

.sw-where,
.sw-recent-head,
.sw-recent-time {
  display: none;
}

/* ---------- Tabs ---------- */

body .workspace.inspector-docked > .room-side > .side-dock-tabs {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 0.2rem !important;
  padding: 0.45rem 0.45rem !important;
}

body .workspace.inspector-docked > .room-side .side-dock-tab {
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  min-height: 2.9rem;
  padding: 0.3rem 0.1rem;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

body .workspace.inspector-docked > .room-side .side-dock-tab span {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .workspace.inspector-docked > .room-side .side-dock-tab svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* ---------- Which sections each tab shows ---------- */

body .workspace.inspector-docked.inspector-panel-collapsed[data-sw-side-tab="chat"] > .room-side,
body .workspace.inspector-docked.inspector-panel-collapsed[data-sw-side-tab="versions"] > .room-side {
  grid-template-rows: auto minmax(0, 1fr) !important;
}

body .workspace.inspector-docked.inspector-panel-collapsed[data-sw-side-tab="chat"] > .room-side > .tool-section:first-child,
body .workspace.inspector-docked.inspector-panel-collapsed[data-sw-side-tab="versions"] > .room-side > .tool-section {
  display: none !important;
}

body .workspace.inspector-docked.inspector-panel-collapsed[data-sw-side-tab="chat"] > .room-side > .room-chat-section {
  grid-row: 2 !important;
}

body .workspace.inspector-docked > .room-side > .side-dock-versions {
  display: none;
}

body .workspace.inspector-docked.inspector-panel-collapsed[data-sw-side-tab="versions"] > .room-side > .side-dock-versions:not([hidden]) {
  display: grid;
  grid-row: 2;
  align-content: start;
  min-height: 0;
  padding: 0.8rem 0.8rem 1rem;
  overflow: auto;
}

body .workspace.inspector-docked > .room-side > .side-dock-versions .version-list {
  display: grid !important;
  gap: 0.35rem;
  max-height: none !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* ---------- Room tab ---------- */

body .workspace.inspector-docked > .room-side .sw-panel-label {
  color: #a7a197;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* The tab already says Room. */
body .workspace.inspector-docked > .room-side > .tool-section:first-child > .section-title,
body .workspace.inspector-docked > .room-side > .tool-section:first-child > .room-help-copy {
  display: none !important;
}

body .workspace.inspector-docked > .room-side .sw-where {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

body .workspace.inspector-docked > .room-side .sw-where-segs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid #2f2d27;
  border-radius: 0.7rem;
  background: #0f0f0d;
}

body .workspace.inspector-docked > .room-side .sw-where-seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 0;
  min-height: 3.1rem;
  padding: 0.35rem 0.1rem;
  border: 1px solid transparent;
  border-radius: 0.55rem;
  background: transparent;
  color: #c9c2b3;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
}

body .workspace.inspector-docked > .room-side .sw-where-seg:nth-child(1) { --sw-mode: var(--sw-mode-desk); --sw-ico: var(--sw-ico-desk); }
body .workspace.inspector-docked > .room-side .sw-where-seg:nth-child(2) { --sw-mode: var(--sw-mode-local); --sw-ico: var(--sw-ico-local); }
body .workspace.inspector-docked > .room-side .sw-where-seg:nth-child(3) { --sw-mode: var(--sw-mode-stream); --sw-ico: var(--sw-ico-stream); }
body .workspace.inspector-docked > .room-side .sw-where-seg:nth-child(4) { --sw-mode: var(--sw-mode-away); --sw-ico: var(--sw-ico-away); }

body .workspace.inspector-docked > .room-side .sw-where-icon {
  width: 1.15rem;
  height: 1.15rem;
  background: currentColor;
  -webkit-mask: var(--sw-ico) center / contain no-repeat;
  mask: var(--sw-ico) center / contain no-repeat;
}

body .workspace.inspector-docked > .room-side .sw-where-seg:hover:not(:disabled):not(.active) {
  background: rgba(255, 248, 232, 0.05);
  color: #f4efe4;
}

body .workspace.inspector-docked > .room-side .sw-where-seg.active {
  border-color: color-mix(in srgb, var(--sw-mode) 55%, transparent);
  background: color-mix(in srgb, var(--sw-mode) 16%, #12110e);
  color: var(--sw-mode);
  cursor: default;
}

body .workspace.inspector-docked > .room-side .sw-where-seg:disabled {
  color: #6f6a60;
  cursor: default;
}

body .workspace.inspector-docked > .room-side .sw-where-seg:focus-visible {
  outline: 2px solid #e8bf6a;
  outline-offset: 1px;
}

/* Under the segments: only the row you are in (with its button), plus the
   Desk row while someone else holds it. */
body .workspace.inspector-docked > .room-side .room-state-list .room-state-row:not(.sw-current):not(.sw-desk-info) {
  display: none !important;
}

body .workspace.inspector-docked > .room-side .room-state-list .room-state-row.sw-desk-info {
  opacity: 0.85;
}

body .workspace.inspector-docked > .room-side .room-panel-heading[data-sw-label] {
  font-size: 0 !important;
}

body .workspace.inspector-docked > .room-side .room-panel-heading[data-sw-label]::after {
  content: attr(data-sw-label);
  color: #a7a197;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* Recent activity: the room-chat section shows its last three history
   entries, with a History button that opens the Chat tab on History. */
body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side > .room-chat-section {
  align-content: start !important;
  grid-template-rows: auto auto !important;
}

body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side > .room-chat-section > .sw-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

body .workspace.inspector-docked > .room-side .sw-recent-history {
  height: 1.7rem;
  padding: 0 0.6rem;
  border: 1px solid #3a372f;
  border-radius: 0.45rem;
  background: transparent;
  color: #e8bf6a;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

body .workspace.inspector-docked > .room-side .sw-recent-history:hover {
  border-color: #6b5426;
}

body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side > .room-chat-section > .room-panel-tabs-head,
body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side > .room-chat-section > #roomChatPanel {
  display: none !important;
}

body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side > .room-chat-section > #roomHistoryPanel {
  display: grid !important;
  min-height: 0;
  overflow: hidden;
}

body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side #historyPreviewList {
  max-height: none !important;
  overflow: hidden !important;
}

body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side #historyPreviewList > :nth-child(n + 4) {
  display: none !important;
}

/* Recent activity entries: time and text on one line, easy to read (the
   entry stays the same undo button as before). */
body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side #historyPreviewList {
  display: grid !important;
  gap: 0.1rem !important;
}

body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side #historyPreviewList .history-preview-item:nth-child(-n + 3) {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: baseline !important;
  gap: 0.6rem !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0.3rem 0.15rem !important;
  border: 0 !important;
  border-radius: 0.4rem !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #e8e2d4 !important;
  font-family: inherit !important;
  opacity: 1 !important;
  text-align: left !important;
}

body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side #historyPreviewList .history-preview-item > span {
  display: none !important;
}

body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side #historyPreviewList .history-preview-item > strong {
  overflow: hidden !important;
  color: #e8e2d4 !important;
  font-family: inherit !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  line-height: 1.3 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side #historyPreviewList .history-preview-item .sw-recent-time {
  display: inline;
  color: #8f897d;
  font: 500 0.72rem/1.3 "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

body .workspace.inspector-docked.inspector-panel-collapsed:not([data-sw-side-tab="chat"]) > .room-side #historyPreviewList .history-preview-item:hover:not(:disabled) {
  background: rgba(255, 248, 232, 0.05) !important;
}
