:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f4ef;
  color: #1d2522;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 1px solid #18241f;
  background: #18241f;
  color: #fff;
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
}

button.secondary,
.button-row button + button,
.tab-button {
  background: #fff;
  color: #18241f;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #c9cec8;
  border-radius: 6px;
  padding: 0.7rem 0.75rem;
  background: #fff;
  color: #1d2522;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 0.35rem;
  color: #52615b;
  font-size: 0.86rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.4rem;
  line-height: 1.05;
}

h2 {
  margin-bottom: 12px;
  font-size: 1rem;
}

h3 {
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.muted {
  color: #65736d;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  max-width: 1320px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  justify-content: end;
}

.topbar-profile {
  display: none;
  gap: 6px;
  color: #52615b;
  font-size: 0.82rem;
  min-width: 220px;
}

.topbar-profile span {
  white-space: nowrap;
}

.topbar-profile select {
  min-width: 220px;
}

#share-top {
  display: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: #6e5b2f;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.pane {
  min-width: 0;
  border: 1px solid #d6dad4;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(30, 41, 35, 0.06);
}

.shell-pane {
  min-height: 720px;
}

.pane-title,
.button-row,
.chat-form,
.chat-rename-form,
.chat-column-top {
  display: flex;
  gap: 8px;
}

.pane-title,
.chat-column-top {
  align-items: center;
  justify-content: space-between;
}

form {
  display: grid;
  gap: 10px;
}

.card,
.circle-entry,
.chat-room-card {
  border: 1px solid #e1e5df;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  background: #fbfcfa;
}

.card.active,
.circle-entry.active {
  border-color: #18241f;
  background: #eef3ef;
}

.card,
.circle-entry {
  cursor: pointer;
}

.card[data-circle-drag-source='true'],
.circle-entry[data-circle-drag-source='true'],
.circle-svg [data-circle-drag-source='true'],
#circle-svg [data-circle-id],
#circle-svg [data-profile-id],
#circle-svg [data-invitation-id] {
  cursor: grab;
  user-select: none;
  touch-action: none;
  -webkit-user-drag: none;
}

.card[data-circle-drag-source='true']:active,
.circle-entry[data-circle-drag-source='true']:active,
.circle-svg [data-circle-drag-source='true']:active,
.card[data-circle-drag-source='true'].is-dragging,
.circle-entry[data-circle-drag-source='true'].is-dragging,
.circle-svg [data-circle-drag-source='true'].is-dragging,
#circle-svg [data-circle-id].is-dragging,
#circle-svg [data-profile-id].is-dragging,
#circle-svg [data-invitation-id].is-dragging {
  cursor: grabbing;
}

.card strong,
.chat-room-card strong {
  display: block;
}

.card p,
.circle-entry p {
  margin-bottom: 0;
}

.compact-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid #d6dad4;
  border-radius: 999px;
  background: #fff;
  color: #52615b;
  font-size: 0.75rem;
}

.identity form + form {
  margin-top: 12px;
}

.signed-out-stack {
  display: grid;
}

.signed-out-panel {
  display: none;
  gap: 12px;
}

.signed-out-panel.active {
  display: grid;
}

.signed-out-actions,
.panel-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.checkbox-row {
  display: flex;
  align-items: start;
  gap: 8px;
}

.checkbox-row input {
  width: auto;
  margin: 0.15rem 0 0;
}

.app-pane,
.tab-panel {
  display: none;
}

.workspace.authenticated #signed-out-view {
  display: none;
}

.workspace.authenticated .identity {
  display: none;
}

.workspace.authenticated .layout {
  grid-template-columns: 1fr;
}

.workspace.authenticated .app-pane,
.tab-panel.active {
  display: block;
}

#logout-top {
  display: none;
}

.workspace.authenticated .topbar-profile,
.workspace.authenticated #share-top,
.workspace.authenticated #logout-top {
  display: inline-grid;
}

.share-sheet {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 22, 0.46);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}

.share-sheet.hidden {
  display: none;
}

.share-shell {
  width: min(560px, 100%);
  background: #fff;
  border: 1px solid #d6dad4;
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(20, 24, 22, 0.18);
  padding: 18px;
}

.share-panel {
  display: grid;
  gap: 12px;
}

.share-note textarea {
  min-height: 96px;
}

.share-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.share-qr {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.share-qr img {
  width: 220px;
  height: 220px;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
}

#identity-error {
  min-height: 1.25rem;
  margin: 10px 0;
  color: #8f1f1f;
}

.tabbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.tab-button.active {
  background: #18241f;
  color: #fff;
}

.messages {
  min-height: 360px;
  max-height: 520px;
  overflow: auto;
  border: 1px solid #e1e5df;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  background: #fbfcfa;
}

.chat-modebar {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 4px 0 12px;
  border: 1px solid #e1e5df;
  border-radius: 999px;
  background: #f4f6f2;
}

.chat-mode-button {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: #52615b;
}

.chat-mode-button.active {
  background: #18241f;
  color: #fff;
}

.video-room {
  border: 1px solid #d6dad4;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: #17221d;
  color: #f6faf6;
}

.video-room-head,
.video-room-head > div,
.video-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-room-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.video-room-head .muted { color: #a9b8ae; margin-left: 6px; }
.video-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #c7df8c; box-shadow: 0 0 0 4px rgba(199,223,140,.12); }
.video-encryption { border: 1px solid #496153; color: #c6d7ca; border-radius: 999px; padding: 4px 8px; font-size: .72rem; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; min-height: 230px; }
.video-tile { position: relative; min-height: 180px; overflow: hidden; border-radius: 9px; background: linear-gradient(145deg, #354d41, #1d2d26); display: grid; place-items: center; text-align: center; padding: 14px; }
.video-tile video { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.video-tile video.mirrored { transform: scaleX(-1); }
.video-tile-label { position: absolute; left: 10px; bottom: 8px; z-index: 1; padding: 4px 7px; border-radius: 5px; background: rgba(13, 21, 17, .68); font-size: .78rem; }
.video-tile-empty { border: 1px dashed #496153; color: #c6d7ca; gap: 7px; }
.video-tile-empty span { max-width: 240px; color: #9caf9f; font-size: .82rem; }
.video-empty-icon { font-size: 2rem; color: #c7df8c; }
.video-controls { justify-content: center; flex-wrap: wrap; margin: 12px 0 4px; }
.video-control, .video-join { border-color: #496153; background: #273b31; color: #f6faf6; }
.video-control.active { background: #f6faf6; color: #17221d; }
.video-join { background: #c7df8c; color: #17221d; border-color: #c7df8c; }
.video-note { margin: 10px 0 0; color: #9caf9f; font-size: .74rem; text-align: center; }
.video-control:disabled, .video-join:disabled { opacity: .5; cursor: not-allowed; }

.message {
  padding: 10px 0;
  border-bottom: 1px solid #edf0eb;
  display: grid;
  gap: 8px;
}

.message:last-child {
  border-bottom: 0;
}

.message-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 4px;
  color: #65736d;
  font-size: 0.82rem;
}

.message-head,
.profile-card-head,
.avatar-field {
  display: flex;
  gap: 10px;
  align-items: center;
}

.message-head {
  align-items: flex-start;
}

.profile-card-body {
  min-width: 0;
}

.avatar-field {
  align-items: start;
}

.avatar-dropzone {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px dashed #c9cec8;
  border-radius: 12px;
  background: #fbfcfa;
  cursor: pointer;
}

.avatar-dropzone:focus-visible,
.avatar-dropzone.is-drag-over {
  border-color: #18241f;
  background: #eef3ef;
  outline: none;
}

.avatar-drop-copy {
  display: grid;
  gap: 4px;
}

.avatar-drop-copy strong {
  color: #1d2522;
}

.avatar-drop-copy .muted {
  font-size: 0.82rem;
}

.profile-avatar {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  background: #dfe4de;
  border: 1px solid #d6dad4;
}

.profile-avatar-preview {
  width: 56px;
  height: 56px;
}

.member-avatar,
.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
}

.chat-form {
  grid-template-columns: 1fr auto;
}

.chat-rename-form {
  align-items: center;
  min-width: 240px;
}

.chat-control-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.chat-capability-options {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid #e1e5df;
  border-radius: 8px;
  background: #f8faf7;
}

.chat-capability-options .checkbox-row {
  margin: 0;
}

.chat-invite-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.chat-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
}

.guides-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.guides-sidebar,
.guide-detail-layout {
  display: grid;
  gap: 14px;
  align-content: start;
  align-items: start;
}

.guide-template-list,
.guide-run-list,
.guide-step-list {
  display: grid;
  gap: 8px;
}

#guide-archived-list {
  display: grid;
  gap: 8px;
}

.guide-template-card,
.guide-run-card,
.guide-step-card {
  width: 100%;
  text-align: left;
  border: 1px solid #e1e5df;
  border-radius: 8px;
  background: #fbfcfa;
  padding: 10px 12px;
}

.guide-run-card.active,
.guide-step-card.active {
  border-color: #18241f;
  background: #eef3ef;
}

.guide-workspace {
  display: grid;
  gap: 14px;
  align-self: start;
  align-content: start;
  align-items: start;
}

.guide-workspace-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.guide-detail-layout {
  grid-template-columns: 260px minmax(0, 1fr);
}

.guide-step-list {
  align-content: start;
  align-self: start;
}

.guide-question-pane {
  min-height: 420px;
  align-self: start;
}

.guide-question-header,
.guide-question-actions,
.guide-nav-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-question-actions {
  justify-content: flex-end;
  align-items: center;
}

.guide-question-title-row {
  display: flex;
  align-items: start;
  gap: 8px;
  flex-wrap: wrap;
}

.guide-question-title-row h3 {
  margin-bottom: 0.35rem;
}

.guide-quality-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: -2px;
  font-size: 0.88rem;
}

.guide-blur-toggle,
.guide-blur-fields {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
}

.guide-blur-toggle {
  position: relative;
  width: 32px;
  height: 32px;
  min-height: 32px;
  justify-content: center;
  border: 1px solid #c9cec8;
  border-radius: 999px;
  background: #fff;
  color: #52615b;
  cursor: pointer;
}

.guide-blur-toggle input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.guide-blur-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.guide-blur-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guide-blur-toggle:has(input:focus-visible) {
  outline: 2px solid rgba(92, 123, 217, 0.5);
  outline-offset: 2px;
}

.guide-blur-toggle:has(input:checked) {
  border-color: #5c7bd9;
  background: #eef2ff;
  color: #243f9f;
}

.guide-blur-fields select,
.guide-blur-fields input {
  width: auto;
  min-width: 88px;
  max-width: 150px;
  padding: 0.32rem 0.48rem;
}

.guide-choice-list {
  display: grid;
  gap: 8px;
}

.guide-location-input,
.guide-sort-list,
.guide-axis-widget {
  display: grid;
  gap: 10px;
}

.guide-sort-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid #e1e5df;
  border-radius: 8px;
  background: #fff;
}

.guide-sort-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #d6dad4;
  border-radius: 999px;
  color: #52615b;
  font-size: 0.78rem;
}

.guide-sort-actions {
  display: flex;
  gap: 6px;
}

.guide-sort-actions button {
  padding: 0.42rem 0.55rem;
}

.guide-axis-title {
  color: #52615b;
  font-size: 0.84rem;
  font-weight: 700;
}

.guide-axis-scale,
.guide-axis-lanes {
  display: grid;
  gap: 8px;
}

.guide-axis-labels,
.guide-axis-ticks,
.guide-axis2d-x {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #65736d;
  font-size: 0.76rem;
}

.guide-axis-line {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #c4684b, #b6933d, #4c7a67);
}

.guide-axis-lane {
  display: grid;
  gap: 6px;
}

.guide-axis-lane-label {
  color: #1d2522;
  font-size: 0.84rem;
  font-weight: 600;
}

.guide-axis-lane-track {
  position: relative;
  height: 54px;
  border: 1px solid #e1e5df;
  border-radius: 8px;
  background: #fff;
}

.guide-axis-lane-track::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
  background: #d6dad4;
}

.guide-axis2d-shell {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: minmax(260px, 360px) auto;
  gap: 8px;
}

.guide-axis2d-board {
  position: relative;
  grid-column: 2;
  min-height: 300px;
  border: 1px solid #e1e5df;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.guide-axis2d-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), #edf0eb calc(50% - 1px), #edf0eb calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(50% - 1px), #edf0eb calc(50% - 1px), #edf0eb calc(50% + 1px), transparent calc(50% + 1px));
}

.guide-axis2d-x {
  grid-column: 2;
}

.guide-axis2d-y {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #65736d;
  font-size: 0.76rem;
}

.guide-placement-token {
  position: absolute;
  z-index: 1;
  max-width: 160px;
  min-height: 34px;
  padding: 0.45rem 0.6rem;
  border-color: #9ab7ab;
  background: #eef3ef;
  color: #18241f;
  transform: translate(-50%, -50%);
  touch-action: none;
  cursor: grab;
}

.guide-placement-token.dragging {
  cursor: grabbing;
  z-index: 5;
  border-color: #18241f;
  box-shadow: 0 10px 24px rgba(30, 41, 35, 0.18);
}

.guide-choice-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid #e1e5df;
  border-radius: 8px;
  background: #fff;
}

.guide-choice-item input {
  width: auto;
  margin: 0;
}

.guide-step-card .muted,
.guide-run-card .muted,
.guide-template-card .muted {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
}

.chat-room-list {
  border-right: 1px solid #edf0eb;
  padding-right: 14px;
}

.chat-room-card {
  width: 100%;
  text-align: left;
}

.chat-room-select {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.chat-room-select .muted {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
}

.chat-room-capabilities { display: flex; gap: 4px; margin-top: 8px; }
.capability-chip { border: 1px solid #d6dad4; border-radius: 999px; padding: 3px 7px; color: #65736d; background: #fff; font-size: 0.68rem; }
.capability-chip.available { border-color: #c8d9c4; color: #35613b; background: #f1f8ef; }
.capability-chip.unavailable { color: #8a5b5b; background: #fbf4f2; }

.chat-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chat-room-actions button {
  padding: 0.45rem 0.6rem;
}

.chat-room-card.active {
  border-color: #18241f;
  background: #eef3ef;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}

.profile-workspace {
  display: grid;
  gap: 14px;
}

.profile-editor {
  display: grid;
  gap: 12px;
}

.profile-editor-head {
  display: grid;
  gap: 14px;
  align-items: start;
}

.profile-editor-head p {
  margin-bottom: 0;
}

.profile-target-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.profile-target-pill {
  display: inline-grid;
  gap: 1px;
  min-width: 96px;
  max-width: 180px;
  min-height: 42px;
  padding: 0.45rem 0.9rem;
  border: 2px solid #d6dad4;
  border-radius: 999px;
  background: #fff;
  color: #18241f;
  text-align: center;
  box-shadow: none;
}

.profile-target-pill span,
.profile-target-pill small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-target-pill small {
  color: #65736d;
  font-size: 0.68rem;
}

.profile-target-pill.selected {
  border-color: #18241f;
  background: #eef3ef;
}

.profile-target-pill.active {
  box-shadow: inset 0 0 0 2px #fff;
}

.profile-target-pill.different {
  border-color: #b6933d;
  background: #fff8e7;
}

.profile-target-pill.withheld {
  border-style: dashed;
  border-color: #8f1f1f;
}

.profile-target-pill.blurred {
  outline: 2px solid rgba(92, 123, 217, 0.32);
  outline-offset: 2px;
}

.profile-overview #profiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.profile-overview .card {
  margin-bottom: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.circles-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px;
}

.circle-board {
  position: relative;
  border: 1px solid #e1e5df;
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbf7 0%, #f4f3ee 100%);
  padding: 10px;
}

.circle-sidebar {
  max-height: 620px;
  overflow: auto;
}

.circle-svg {
  width: 100%;
  height: auto;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  touch-action: none;
}

.circle-svg .circle-region {
  filter: url(#circle-shadow);
  cursor: pointer;
}

.circle-svg .circle-region.is-drop-target > circle:first-child {
  stroke: #5c7bd9;
  stroke-opacity: 0.95;
  stroke-width: 5;
}

.circle-svg .profile-node {
  filter: url(#circle-shadow);
  cursor: pointer;
}

.circle-svg .invitation-node {
  filter: url(#circle-shadow);
  cursor: grab;
}

.circle-svg .invitation-node.is-dragging {
  opacity: 0.92;
}

.circle-trash-drop {
  position: absolute;
  right: 22px;
  bottom: 22px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 10px;
  border: 1px solid #c9cec8;
  border-radius: 50%;
  background: #fff;
  color: #8b3d35;
}

.circle-trash-drop svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.circle-trash-drop.is-drop-target {
  border-color: #8b3d35;
  background: #fff0ee;
  box-shadow: 0 0 0 4px rgba(139, 61, 53, 0.14);
}

.circle-svg .profile-node.is-drop-target > circle:first-child {
  stroke: #5c7bd9;
  stroke-width: 5;
}

.circle-svg .circle-label {
  font-size: 18px;
  font-weight: 700;
}

.circle-svg .profile-label {
  font-size: 14px;
  font-weight: 600;
}

.circle-svg .profile-role {
  font-size: 12px;
}

.circle-svg .link-line {
  stroke: rgba(78, 95, 86, 0.38);
  stroke-width: 2;
}

.circle-svg .is-dim {
  opacity: 0.22;
}

.circle-svg .is-active {
  opacity: 1;
}

.circle-svg .is-related {
  opacity: 1;
}

.circle-drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  max-width: 240px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(24, 36, 31, 0.92);
  color: #fff;
  font-size: 0.82rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  transform: translate(0, 0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-content {
  display: grid;
  gap: 18px;
}

.stats-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.stats-metric,
.stats-section {
  border: 1px solid #e1e5df;
  border-radius: 8px;
  background: #fbfcfa;
  padding: 14px;
}

.stats-metric-label {
  color: #65736d;
  font-size: 0.8rem;
}

.stats-metric-value {
  display: block;
  margin-top: 4px;
  color: #18241f;
  font-size: 1.55rem;
  font-weight: 700;
}

.stats-section h3 {
  margin-bottom: 12px;
}

.stats-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 18px;
}

.stats-detail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e7ebe5;
  padding: 7px 0;
}

.stats-detail strong {
  text-align: right;
}

.stats-login-list {
  display: grid;
  gap: 8px;
}

.stats-login-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.8fr) minmax(170px, 1fr) minmax(160px, 1fr);
  gap: 12px;
  border-bottom: 1px solid #e7ebe5;
  padding: 8px 0;
}

@media (max-width: 700px) {
  .stats-login-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

/* Keep the profile switcher compact until it is opened. */
.topbar-profile {
  display: none;
  min-width: 0;
  width: auto;
}

.topbar-profile select {
  width: auto;
  min-width: 0;
  max-width: 180px;
  padding: 0.42rem 1.8rem 0.42rem 0.7rem;
  border-color: transparent;
  background-color: transparent;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.topbar-profile select:hover,
.topbar-profile select:focus-visible {
  border-color: var(--line);
  background-color: #fff;
  outline: none;
}

.workspace.authenticated .topbar-profile {
  display: block;
}

.circle-entry.related,
.card.related {
  border-color: #9ab7ab;
  background: #f4f8f4;
}

.circle-entry.is-drop-target {
  border-color: #5c7bd9;
  background: #eef2ff;
}

.circle-entry .meta {
  color: #65736d;
  font-size: 0.84rem;
}

.trashed-invitations {
  margin: 14px 0;
  border-top: 1px solid #e1e5df;
  padding-top: 12px;
}

.trashed-invitations h3 {
  color: #52615b;
}

.trashed-invitation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #e7ebe5;
  padding: 7px 0;
  color: #52615b;
  font-size: 0.86rem;
}

.trashed-invitation-row button {
  padding: 0.35rem 0.55rem;
  font-size: 0.78rem;
}

.editor-pane {
  border: 1px solid #e1e5df;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfa;
  align-self: start;
}

.editor-pane form[hidden],
.editor-pane p[hidden],
.editor-pane section[hidden] {
  display: none;
}

.member-detail {
  border: 1px solid #e1e5df;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.member-detail-label {
  margin-bottom: 4px;
  color: #65736d;
  font-size: 0.76rem;
  text-transform: uppercase;
}

select[multiple] {
  min-height: 200px;
  padding: 0.4rem;
}

@media (max-width: 980px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .layout,
  .guides-layout,
  .detail-layout,
  .profile-editor-head,
  .guide-detail-layout,
  .chat-layout,
  .circles-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chat-room-list {
    border-right: 0;
    padding-right: 0;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .card,
  .circle-entry {
    padding: 10px;
  }

  .compact-meta {
    gap: 4px;
  }

  .meta-chip {
    min-height: 22px;
    padding: 0 7px;
    font-size: 0.72rem;
  }
}

/* Responsive workspace polish */
:root {
  --ink: #18241f;
  --ink-soft: #52615b;
  --line: #dfe5de;
  --surface: #ffffff;
  --surface-soft: #f7faf6;
  --accent: #c7df8c;
}

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(199, 223, 140, 0.18), transparent 32rem),
    #f4f6f1;
}

.app-shell {
  padding: clamp(12px, 3vw, 32px);
}

.topbar {
  align-items: center;
  margin-bottom: 14px;
}

.topbar h1 {
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  letter-spacing: -0.03em;
}

.eyebrow {
  color: #6b7e63;
  letter-spacing: 0.11em;
}

.topbar-actions {
  align-items: center;
}

button {
  min-height: 42px;
  border-radius: 10px;
  font-weight: 650;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

button:hover {
  box-shadow: 0 5px 14px rgba(24, 36, 31, 0.1);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

input,
select,
textarea {
  border-radius: 10px;
  border-color: #cfd8cf;
  min-height: 44px;
}

textarea {
  min-height: 88px;
}

.shell-pane {
  min-height: 0;
  padding: clamp(12px, 2vw, 22px);
}

.tabbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  gap: 6px;
  margin: calc(clamp(12px, 2vw, 22px) * -1) calc(clamp(12px, 2vw, 22px) * -1) 22px;
  padding: 10px clamp(12px, 2vw, 22px);
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}

.tabbar::-webkit-scrollbar {
  display: none;
}

.tab-button {
  flex: 0 0 auto;
  min-height: 40px;
  border-color: transparent;
  color: var(--ink-soft);
  white-space: nowrap;
}

.tab-button.active {
  box-shadow: 0 5px 14px rgba(24, 36, 31, 0.12);
}

.pane-title {
  margin-bottom: 16px;
}

.pane-title h2,
.guide-workspace-head h2,
.chat-column-top h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.profile-workspace,
.guides-layout,
.chat-layout,
.circles-layout {
  gap: 18px;
}

.editor-pane,
.circle-board,
.circle-entry,
.card,
.chat-room-card,
.stats-metric,
.stats-section {
  border-radius: 12px;
}

.profile-editor,
.circle-editor,
.guides-sidebar .editor-pane,
.chat-room-list {
  background: var(--surface-soft);
}

.circle-board {
  min-width: 0;
  padding: 12px;
  background: linear-gradient(145deg, #fbfdf9 0%, #eef4ea 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8);
}

.circle-board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 12px;
}

.circle-board-toolbar > div:first-child {
  display: grid;
  gap: 3px;
}

.circle-board-toolbar .muted {
  font-size: 0.76rem;
}

.circle-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.circle-zoom-controls button {
  min-width: 38px;
  min-height: 38px;
  padding: 0.4rem 0.55rem;
}

.circle-zoom-controls span {
  min-width: 46px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-align: center;
}

.circle-svg {
  height: clamp(460px, 55vw, 650px);
  min-height: 460px;
  border: 1px solid rgba(207, 216, 207, 0.8);
  border-radius: 12px;
  background: rgba(255,255,255,.42);
  overscroll-behavior: contain;
}

.circle-sidebar {
  max-height: none;
}

.circle-sidebar > .muted {
  padding: 0 2px;
  font-size: 0.8rem;
  line-height: 1.45;
}

.circle-svg .circle-label {
  font-size: 22px;
}

@media (max-width: 700px) {
  .app-shell {
    padding: 8px;
  }

  .topbar {
    align-items: flex-start;
    gap: 10px;
    margin: 4px 4px 12px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions button {
    min-height: 38px;
    padding: 0.5rem 0.65rem;
  }

  .shell-pane {
    padding: 12px;
    border-radius: 14px;
  }

  .tabbar {
    margin: -12px -12px 18px;
    padding: 8px 10px;
  }

  .tab-button {
    min-height: 44px;
    padding-inline: 12px;
  }

  .circle-board {
    padding: 8px;
  }

  .circle-board-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .circle-zoom-controls {
    width: 100%;
  }

  .circle-zoom-controls button {
    flex: 1;
  }

  .circle-zoom-controls span {
    flex: 0 0 48px;
  }

  .circle-svg {
    height: min(68vh, 560px);
    min-height: 460px;
  }

  .profile-target-pill {
    min-height: 46px;
  }

  .chat-form,
  .chat-invite-form {
    grid-template-columns: 1fr;
  }

  .chat-rename-form {
    min-width: 0;
    width: 100%;
  }
}
