/* The hidden attribute must win over every display rule below; otherwise a
   .btn or a flex panel marked hidden by the script still shows. */
[hidden] { display: none !important; }

:root {
  --bg:        #0e1116;
  --bg-panel:  #151a21;
  --bg-raised: #1c232c;
  --bg-input:  #10151b;
  --line:      #263039;
  --line-soft: #1e262e;
  --text:      #e6edf3;
  --text-dim:  #8b97a5;
  --text-mute: #5f6b78;
  --accent:    #4da3ff;
  --accent-dk: #1b64b4;
  --good:      #3fb950;
  --warn:      #d29922;
  --bad:       #f85149;
  --radius:    8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 16px;
  height: 56px;
  flex: 0 0 auto;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: baseline; gap: 8px; }

.logo {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.4px;
  color: var(--text);
}

.brand-sub {
  color: var(--text-mute);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Owner-only replacement for .brand-sub: the same small caps, but a select. */
.topbar select.ws-switch {
  min-width: 0;
  padding: 2px 22px 2px 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-mute);
}

.home-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 50vh;
  overflow-y: auto;
}
.home-list .workspace-row { text-decoration: none; color: var(--text); font-weight: 600; }
.home-list .workspace-row:hover { border-color: var(--accent); }

.home-label {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.home-form { display: flex; flex-direction: column; gap: 12px; }
.home-form[hidden] { display: none; }
.btn-small { font-size: 11px; padding: 4px 8px; align-self: flex-end; }

.selectors {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.topbar-actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* ------------------------------------------------------------------ fields */

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.grow { flex: 1 1 auto; }

.field > span {
  font-size: 11px;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.field > span em {
  font-style: normal;
  color: var(--accent);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}

select, input[type="text"], input[type="password"], input[type="file"], textarea {
  background: var(--bg-input);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 9px;
  font: inherit;
  min-width: 0;
  width: 100%;
}

select { cursor: pointer; }
textarea { resize: vertical; font: inherit; }

select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(77, 163, 255, 0.18);
}

.topbar select { min-width: 170px; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--text);
  padding: 7px 12px;
  font: 500 13px/1 var(--font);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, border-color .12s, opacity .12s;
}

.btn:hover { background: #232c36; border-color: #38434f; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent-dk);
  border-color: #2b7ad4;
  color: #fff;
}
.btn-primary:hover { background: #2276cf; border-color: #4093e8; }

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--bg-raised); }

.btn-icon { padding: 6px 10px; font-size: 12px; }
.btn-icon[aria-pressed="true"] {
  background: var(--accent-dk);
  border-color: #2b7ad4;
  color: #fff;
}

.badge {
  font: 600 10px/1 var(--font);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  padding: 4px 7px;
  border-radius: 4px;
  align-self: center;
}

.badge-latest { background: rgba(63, 185, 80, .15); color: var(--good); border: 1px solid rgba(63, 185, 80, .35); }

/* Who the page thinks you are, next to the workspace name. */
.role-badge { margin-left: 4px; white-space: nowrap; }
.role-owner    { background: rgba(63, 185, 80, .15);  color: var(--good);      border: 1px solid rgba(63, 185, 80, .35); }
.role-reviewer { background: rgba(77, 163, 255, .15); color: var(--accent);    border: 1px solid rgba(77, 163, 255, .35); }
.role-public   { background: rgba(139, 151, 165, .12); color: var(--text-dim); border: 1px solid rgba(139, 151, 165, .3); }
.badge-old    { background: rgba(210, 153, 34, .15); color: var(--warn); border: 1px solid rgba(210, 153, 34, .35); }

/* ------------------------------------------------------------------ layout */

.layout {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

.viewer-pane {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  background: radial-gradient(ellipse at 50% 35%, #1a222c 0%, #0c1015 75%);
}

.canvas-host { position: absolute; inset: 0; }
.canvas-host canvas { display: block; }

.viewer-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 4px;
  padding: 5px;
  background: rgba(21, 26, 33, .82);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  z-index: 3;
}

.toolbar-sep { width: 1px; background: var(--line); margin: 2px 4px; }

.viewer-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-dim);
  background: rgba(12, 16, 21, .72);
  z-index: 4;
  text-align: center;
  padding: 24px;
}

.viewer-status[hidden] { display: none; }
.viewer-status p { margin: 0; max-width: 420px; }
.viewer-status.is-error { color: var(--bad); }
.viewer-status.is-error .spinner { display: none; }

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.model-meta {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 3;
  padding: 9px 12px;
  background: rgba(21, 26, 33, .82);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: 11px/1.6 var(--mono);
  color: var(--text-dim);
  max-width: 60%;
}

.model-meta strong { color: var(--text); font-weight: 600; }
.model-meta .note { color: var(--text); display: block; margin-top: 4px; font-family: var(--font); font-size: 12px; }

/* -------------------------------------------------------------------- chat */

.chat-pane {
  flex: 0 0 380px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-panel);
  border-left: 1px solid var(--line);
}

.chat-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: 14px; font-weight: 600; }

.chat-context {
  margin: 4px 0 0;
  font: 12px var(--mono);
  color: var(--text-dim);
}

.comment-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment {
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.comment-author { font-weight: 600; font-size: 13px; }

.comment-target {
  font: 10px/1 var(--mono);
  color: var(--accent);
  background: rgba(77, 163, 255, .1);
  border: 1px solid rgba(77, 163, 255, .28);
  border-radius: 4px;
  padding: 3px 6px;
}

.comment-time {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-mute);
  white-space: nowrap;
}

.comment-body { white-space: pre-wrap; word-wrap: break-word; font-size: 13px; }

.empty {
  color: var(--text-mute);
  text-align: center;
  padding: 32px 12px;
  font-size: 13px;
}

/* ---------------------------------------------------------------- composer */

.composer {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 12px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--bg-panel);
}

.composer-row { display: flex; gap: 9px; }

.composer-foot {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hint { font-size: 11px; color: var(--text-mute); flex: 1 1 auto; }

/* Shown instead of the composer on a public workspace opened without its key. */
.view-only {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-mute);
}
.view-only[hidden] { display: none; }
.view-only p { margin: 0; }
.composer[hidden] { display: none; }
.hint.is-error { color: var(--bad); }

/* ------------------------------------------------------------------ dialog */

.dialog {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  color: var(--text);
  border-radius: 12px;
  padding: 0;
  width: min(460px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}

.dialog::backdrop { background: rgba(4, 7, 10, .65); }

.dialog form { padding: 20px; display: flex; flex-direction: column; gap: 13px; }
.dialog h2 { margin: 0; font-size: 16px; }

.seg { display: flex; gap: 4px; background: var(--bg-input); padding: 4px; border-radius: 8px; }

.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: 6px;
  padding: 7px 8px;
  font: 500 12px var(--font);
  cursor: pointer;
}

.seg-btn.is-active { background: var(--bg-raised); color: var(--text); }

.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.error {
  margin: 0;
  color: var(--bad);
  font-size: 12px;
  background: rgba(248, 81, 73, .1);
  border: 1px solid rgba(248, 81, 73, .3);
  border-radius: 6px;
  padding: 8px 10px;
}

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

.toast.is-error { border-color: rgba(248, 81, 73, .5); color: #ffb4ae; }

/* ------------------------------------------------------------------ mobile */

@media (max-width: 860px) {
  body { overflow: auto; }
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 12px; gap: 12px; }
  .selectors { order: 3; flex-basis: 100%; }
  .topbar select { min-width: 0; }
  .layout { flex-direction: column; }
  .viewer-pane { flex: 0 0 55vh; min-height: 340px; }
  .chat-pane { flex: 1 1 auto; border-left: none; border-top: 1px solid var(--line); }
  .model-meta { max-width: calc(100% - 24px); }
}

/* -------------------------------------------------------------- measuring */

.measure-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.measure-label {
  position: absolute;
  transform: translate(-50%, -50%);
  background: rgba(13, 17, 22, .9);
  border: 1px solid var(--accent);
  color: var(--text);
  border-radius: 5px;
  padding: 3px 7px;
  font: 600 11px/1 var(--mono);
  white-space: nowrap;
}

.measure-panel {
  position: absolute;
  top: 60px;
  left: 12px;
  z-index: 3;
  width: 290px;
  max-width: calc(100% - 24px);
  padding: 10px;
  background: rgba(21, 26, 33, .92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.measure-hint {
  margin: 0 0 8px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-dim);
}

.measure-hint:empty { display: none; }

.measure-items { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.measure-items:empty { display: none; }

.measure-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 5px 7px;
}

.measure-value { font: 600 12px var(--mono); flex: 1 1 auto; }

.measure-detail {
  font-size: 10px;
  color: var(--text-mute);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 4px;
  cursor: help;
}

.measure-row .btn-icon { padding: 3px 6px; font-size: 10px; }

/* ----------------------------------------------------------------- photos */

.photo-preview { display: flex; flex-wrap: wrap; gap: 6px; }

.photo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 6px 4px 4px;
  max-width: 100%;
}

.photo-chip img { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; }

.photo-name {
  font-size: 11px;
  color: var(--text-dim);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-chip button {
  border: none;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.photo-chip button:hover { color: var(--bad); }

.comment-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.photo-thumb {
  border: 1px solid var(--line);
  background: var(--bg-input);
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 1;
}

.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb:hover { border-color: var(--accent); }

.lightbox {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 94vw;
  max-height: 94vh;
  overflow: visible;
}

.lightbox::backdrop { background: rgba(4, 7, 10, .88); }

.lightbox img {
  display: block;
  max-width: 94vw;
  max-height: 86vh;
  border-radius: 8px;
  background: var(--bg-panel);
}

.lightbox-caption {
  margin: 8px 0 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

/* --------------------------------------------------------- comment delete */

.comment-del {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-mute);
  border-radius: 4px;
  cursor: pointer;
  font: 500 14px/1 var(--font);
  padding: 2px 6px;
  opacity: 0;
  transition: opacity .12s, color .12s, background .12s;
}

.comment:hover .comment-del,
.comment-del:focus-visible,
.comment-del.is-armed { opacity: 1; }

.comment-del:hover { color: var(--bad); background: rgba(248, 81, 73, .12); }

.comment-del.is-armed {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--bad);
  border-color: var(--bad);
}

.comment-del:disabled { cursor: default; opacity: 1; }

/* Touch devices have no hover, so the control must simply be visible. */
@media (hover: none) {
  .comment-del { opacity: 1; }
}

/* ----------------------------------------------------------------- markup */

.markup-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.markup-badge {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 1px solid rgba(13, 17, 22, .85);
  border-radius: 10px;
  background: var(--mark, var(--accent));
  color: #0d1116;
  font: 700 11px/1 var(--mono);
  cursor: pointer;
  opacity: .75;
  transition: opacity .12s, transform .12s;
}

.markup-badge.is-hot {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .18);
}

.mark-hint {
  /* top-right: .model-meta owns bottom-left, .measure-panel owns top-left */
  position: absolute;
  right: 12px;
  top: 60px;
  max-width: min(280px, calc(100% - 24px));
  z-index: 3;
  padding: 7px 11px;
  background: rgba(21, 26, 33, .92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 12px;
}

.mark-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.mark-preview[hidden] { display: none; }

.mark-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 8px;
  background: var(--bg-input);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-dim);
}

.mark-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.mark-chip button {
  border: 0;
  background: none;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px 4px;
}

.mark-chip button:hover { color: var(--bad); }

/* --- marks on a posted comment */

.comment.is-marked {
  border-left: 3px solid var(--mark);
  padding-left: 10px;
}

.comment-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--mark);
  color: #0d1116;
  font: 700 11px/1 var(--mono);
}

.comment-marks {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--mark);
  border-radius: 20px;
  color: var(--mark);
  font-size: 12px;
  cursor: pointer;
}

.comment-marks:hover {
  background: color-mix(in srgb, var(--mark) 18%, transparent);
}

.mark-hint p { margin: 0; }

.mark-note {
  margin-top: 6px !important;
  color: var(--text-mute);
  font-size: 11px;
}

.mark-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.mark-swatch {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--sw, transparent);
  cursor: pointer;
}

.mark-swatch.is-auto {
  width: auto;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--text-dim);
  font: 600 10px/16px var(--mono);
  background: var(--bg-input);
}

.mark-swatch[aria-pressed="true"] {
  border-color: var(--text);
  box-shadow: 0 0 0 2px rgba(230, 237, 243, .35);
}

.mark-lead {
  color: var(--text-mute);
  font-size: 11px;
  width: 100%;
}

.mark-lead.is-unsaved { color: var(--warn); }

.mark-preview {
  border: 1px dashed var(--warn);
  border-radius: var(--radius);
  padding: 7px 9px;
}

.markup-dim {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  padding: 2px 7px;
  border: 1px solid var(--mark, var(--accent));
  border-radius: 5px;
  background: rgba(13, 17, 22, .9);
  color: var(--mark, var(--text));
  font: 600 11px/1.4 var(--mono);
  white-space: nowrap;
}

/* A download button that is visibly present but inert until the owner
   releases the version - the absence of a button would be less honest. */
.btn.is-disabled {
  opacity: .45;
  cursor: not-allowed;
}

#downloadLink { text-decoration: none; }

.unenforced {
  position: absolute;
  top: 60px;
  left: 12px;
  right: 12px;
  z-index: 4;
  margin: 0 auto;
  max-width: 620px;
  padding: 9px 13px;
  background: rgba(60, 40, 10, .94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  color: #f0d9a8;
  font-size: 12px;
  line-height: 1.5;
}

.unenforced[hidden] { display: none; }

.btn.is-owner {
  border-color: var(--good);
  color: var(--good);
}

/* "Make private" while a workspace is public: the open state should be seen. */
.btn.is-on {
  border-color: var(--accent);
  color: var(--accent);
}

/* ------------------------------------------------------------- workspaces */

.unlock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.unlock[hidden] { display: none; }

.unlock-card {
  width: min(380px, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.unlock-card h1 {
  margin: 0;
  font-size: 19px;
}

.unlock-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.unlock-foot #unlockCancel { margin-right: auto; }

.workspace-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  max-height: 240px;
  overflow-y: auto;
}

.workspace-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: var(--bg-input);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  font-size: 13px;
}

.workspace-row.is-current { border-color: var(--accent); }
.workspace-row a { color: var(--text); text-decoration: none; font-weight: 600; }
.workspace-row a:hover { color: var(--accent); }

.workspace-meta {
  margin-left: auto;
  color: var(--text-mute);
  font: 11px var(--mono);
}

/* Each workspace is a <details>: the row is the summary, the access list
   sits underneath it. The marker is dropped so the row keeps its layout. */
.workspace-item > summary { list-style: none; cursor: pointer; }
.workspace-item > summary::-webkit-details-marker { display: none; }
.workspace-item[open] > summary { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.workspace-people {
  padding: 6px 10px 8px 14px;
  border: 1px solid var(--line-soft);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--bg-panel);
  font-size: 12px;
}

.workspace-people .people { list-style: none; margin: 0; padding: 0; }
.workspace-people .people li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 3px 0;
}
.person-name { font-weight: 600; }
.person-when { color: var(--text-mute); font: 11px var(--mono); }
.person-remove { margin-left: auto; font-size: 11px; }
.person-remove:hover { color: var(--bad); border-color: var(--bad); }
.person-remove.is-armed {
  color: #fff;
  background: var(--bad);
  border-color: var(--bad);
  font-weight: 600;
}
.person-remove:disabled { cursor: default; }
.people-none { margin: 0; color: var(--text-mute); }

/* ---------------------------------------------------------------- history */

.history {
  margin-bottom: 4px;
  padding: 8px 10px;
  background: rgba(16, 21, 27, .6);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.history > summary {
  cursor: pointer;
  color: var(--text-mute);
  font: 11px/1.5 var(--mono);
  list-style: none;
}

.history > summary::before { content: '▸ '; }
.history[open] > summary::before { content: '▾ '; }
.history > summary:hover { color: var(--text-dim); }
.history .comment { margin-top: 8px; }

/* Earlier versions read as background, not as current business. */
.comment.is-historic {
  opacity: .72;
  background: transparent;
  border-style: dashed;
}

.comment.is-historic:hover { opacity: 1; }

.comment-old {
  padding: 0 6px;
  border: 1px solid var(--text-mute);
  border-radius: 9px;
  color: var(--text-mute);
  font: 600 10px/16px var(--mono);
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.comment-carry {
  margin-top: 8px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}

.comment-carry:hover { border-color: var(--accent); color: var(--accent); }

/* A mark from an older version: dashed ring, so it cannot be mistaken for a
   mark placed on the geometry now on screen. */
.markup-badge.is-historic {
  opacity: .8;
  border-style: dashed;
  border-width: 2px;
  border-color: var(--text);
  font-size: 9px;
}
