/* Compact reference and project-start review for editable room attributes. */
.project-history-field > .field-provenance-dot {
  position: absolute;
  z-index: 2;
  right: 5px;
  top: 50%;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin: 0;
  transform: translateY(-50%);
  color: var(--warning);
  background: transparent;
  border-radius: 50%;
}

.project-history-field > .field-provenance-dot::before {
  width: 6px;
  height: 6px;
  box-shadow: 0 0 0 2px var(--bg-card);
}

.project-history-field > .field-provenance-dot:hover,
.project-history-field > .field-provenance-dot[aria-expanded="true"] {
  background: color-mix(in srgb, var(--warning) 12%, transparent);
  color: var(--warning);
}

.project-history-field > .field-provenance-dot:focus-visible {
  outline: 2px solid var(--warning);
  outline-offset: -2px;
}

.project-field-review-popover {
  position: fixed;
  z-index: 100000;
  box-sizing: border-box;
  width: min(340px, calc(100vw - 16px));
  max-height: min(70vh, 520px);
  overflow: auto;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(5px) scale(0.985);
  transform-origin: top right;
  transition: opacity 150ms ease, transform 180ms cubic-bezier(0.2, 0.75, 0.25, 1), visibility 0s linear 180ms;
}

.project-field-review-popover.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.project-field-review-header,
.project-field-review-section-title,
.project-field-review-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-field-review-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
}

.project-field-review-header > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.project-field-review-header > div > span,
.project-field-review-value-label,
.project-field-review-current > span {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.project-field-review-header > div > strong {
  overflow-wrap: anywhere;
  font-size: 0.88rem;
  font-weight: 650;
}

.project-field-review-close {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.project-field-review-close:hover { color: var(--text); background: var(--overlay-hover); }

.project-field-review-body {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
}

.project-field-review-current,
.project-field-review-section {
  min-width: 0;
  padding: 9px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.project-field-review-current {
  display: grid;
  gap: 4px;
}

.project-field-review-current > strong,
.project-field-review-value {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 0.8rem;
  line-height: 1.4;
}

.project-field-review-section-title {
  margin-bottom: 6px;
  font-size: 0.78rem;
}

.project-field-review-section-title > span {
  flex: 0 0 auto;
  padding: 2px 7px;
  color: var(--muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 600;
}

.project-field-review-section.is-different { border-color: var(--warning); }
.project-field-review-section.is-different .project-field-review-section-title > span { color: var(--warning); }
.project-field-review-section.is-matching .project-field-review-section-title > span { color: var(--accent); }
.project-field-review-section.is-loading .project-field-review-section-title > span { color: var(--muted); }

.project-field-review-value-label {
  margin: 7px 0 2px;
  font-size: 0.64rem;
}

.project-field-review-latest {
  margin: 0;
  padding: 0 2px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.35;
}

.project-field-review-footer {
  justify-content: flex-end;
  padding: 9px 12px 11px;
  border-top: 1px solid var(--border);
}

.project-field-review-footer > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 0.7rem;
}

.project-field-review-history {
  padding: 6px 9px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}

.project-field-review-history:hover { border-color: var(--accent); }

/* Room attribute editors keep a predictable row shape as review markers appear. */
.project-room-attribute-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 336px), 1fr));
  align-items: start;
  column-gap: var(--ui-space-3, 12px);
  row-gap: var(--ui-space-1, 4px);
}

.project-room-attribute-status {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  box-sizing: border-box;
  gap: var(--ui-space-2, 8px);
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  margin: 0 0 var(--ui-space-2, 8px);
  padding: var(--ui-space-1, 4px) var(--ui-space-2, 8px);
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--bg-card);
  overflow: auto;
  overscroll-behavior: contain;
  font-size: 0.76rem;
  line-height: 1.35;
}

.project-room-attribute-status:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.project-room-attribute-save-label {
  font-weight: 600;
  white-space: nowrap;
}

.project-room-attribute-save-detail {
  min-width: 0;
  overflow-wrap: anywhere;
}

.project-room-attribute-status[data-state="idle"] { color: var(--muted); }
.project-room-attribute-status[data-state="queued"] { color: var(--warning); background: var(--bg-card); }
.project-room-attribute-status[data-state="saving"] { color: var(--info); background: var(--bg-card); }
.project-room-attribute-status[data-state="saved"] { color: var(--success); background: var(--bg-card); }
.project-room-attribute-status[data-state="error"] {
  align-items: start;
  color: var(--error);
  background: var(--bg-card);
  border-color: var(--error);
}

.project-room-attribute-status[data-state="error"] .project-room-attribute-save-detail {
  max-width: 100%;
}

/* In windowed mode the window body is the real scroller; let the status strip stick there. */
body.windowed-layout [data-win-id="detail"] .window-body #detail-view:has(.project-room-attribute-status) {
  max-height: none;
  overflow: visible;
}

body.windowed-layout [data-win-id="detail"] .window-body #right-column:has(#detail-view .project-room-attribute-status) {
  overflow: visible;
}

.detail-panel .project-room-attribute-grid .project-room-attribute-row {
  grid-template-columns: minmax(108px, 116px) minmax(0, 1fr);
  align-items: start;
  gap: var(--ui-space-2, 8px);
  min-width: 0;
  padding-block: var(--ui-space-1, 4px);
  scroll-margin-block: 52px 12px;
}

.project-room-attribute-label,
.project-room-attribute-value {
  min-width: 0;
}

.project-room-attribute-label {
  display: flex;
  align-items: flex-start !important;
  gap: var(--ui-space-1, 4px);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.project-room-attribute-value {
  min-width: 0;
  --project-attribute-context-rail: 32px;
}

.project-room-attribute-value > .project-history-field--full {
  display: flex;
  align-items: center;
  gap: var(--ui-space-1, 4px);
  width: 100%;
  min-width: 0;
}

.project-room-attribute-value > .project-history-field--full > :is(input, select, textarea) {
  flex: 1 1 0;
  width: auto !important;
  padding-right: 8px !important;
}

.project-room-attribute-value > .project-history-field--full > .field-provenance-dot {
  position: static;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin: 0;
  transform: none;
}

.project-room-attribute-value .field-provenance-dot.is-context-only {
  color: var(--muted);
}

.project-room-attribute-value .field-provenance-dot.is-context-only::before {
  content: 'i';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
}

.project-room-attribute-value :is(input, select, textarea) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  scroll-margin-block: 52px 12px;
}

.project-room-attribute-value :is(input, select) {
  min-height: 32px;
  border-color: var(--input-border);
}

.project-room-attribute-value :is(input, select):not(:disabled):is(:user-invalid, [aria-invalid="true"]) {
  border-color: var(--error) !important;
}

.project-room-attribute-value :is(input, select):not(:disabled):is(:user-invalid, [aria-invalid="true"]):focus-visible {
  outline-color: var(--error);
}

.project-room-attribute-value .field-provenance-dot:hover,
.project-room-attribute-value .field-provenance-dot[aria-expanded="true"] {
  color: var(--accent);
  background: var(--overlay-hover);
}

.project-room-attribute-value .field-provenance-dot:focus-visible {
  outline-color: var(--accent);
}

/* The field-only view reuses the project log and keeps its context with the timeline. */
.modal-overlay > .project-change-log-content {
  width: min(900px, calc(100vw - 24px));
  max-width: 900px;
  max-height: min(88dvh, 860px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.project-change-log-content > .modal-header,
.project-change-log-content > .modal-footer { flex: 0 0 auto; gap: 12px; }
.project-change-log-content > .modal-header h2 { overflow-wrap: anywhere; }
.project-change-log-content .project-change-log-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.project-change-log-content .project-change-log-events { max-height: none; overflow: visible; }
.project-change-log-content [hidden] { display: none !important; }
.project-change-log-content .project-change-log-filter { flex-wrap: wrap; }
.project-change-log-filter input { min-width: 0; flex: 1 1 220px; padding: 8px 10px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 6px; }
.project-history-availability,
.project-history-view-only,
.project-history-event-selection,
.project-history-trace,
.project-history-status { font-size: .78rem; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.project-history-event-selection { margin-bottom: 8px; }
.project-history-event-selection label { display: inline-flex; align-items: center; gap: 8px; color: var(--text); min-height: 32px; cursor: pointer; }
.project-history-event-selection input { width: 18px; height: 18px; accent-color: var(--accent); }
.project-history-selection-count { margin-left: auto; font-size: .78rem; color: var(--muted); }
.project-history-field-link,
.project-history-trace button { border: 0; background: transparent; color: var(--accent); padding: 5px 8px 5px 0; font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.project-history-review-row { border: 1px solid var(--border); border-radius: 8px; margin-block: 10px; padding: 12px; font-size: .82rem; overflow-wrap: anywhere; }
.project-history-review-row > div { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr); gap: 12px; margin-top: 6px; }
.project-history-review-row span { color: var(--muted); }
.project-history-conflicts { color: var(--error); font-size: .82rem; line-height: 1.5; }
.project-history-review-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.project-history-status:empty { display: none; }
.project-change-event:focus { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 600px) {
  .modal-overlay > .project-change-log-content { padding: 12px; max-height: calc(100dvh - 20px); }
  .project-change-log-content .project-change-log-body { padding: 8px 2px; }
  .project-change-log-content > .modal-footer { flex-wrap: wrap; }
  .project-change-log-filter select { max-width: 100%; }
  .project-history-review-row > div { grid-template-columns: 1fr; gap: 2px; }
  .project-history-review-actions button { flex: 1 1 auto; min-height: 40px; }
  .project-history-event-selection label { min-height: 40px; }
}
.project-field-history-modal > .project-change-log-content {
  width: min(820px, calc(100vw - 24px));
  max-width: 820px;
  max-height: min(84dvh, 800px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 20px;
}

.project-field-history-modal > .project-change-log-content > .modal-header {
  flex: 0 0 auto;
  gap: 12px;
  min-width: 0;
  margin-bottom: 12px;
  padding-bottom: 12px;
}

.project-field-history-modal > .project-change-log-content > .modal-header h2 {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.project-field-history-modal .modal-close {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
}

.project-field-history-modal .project-change-log-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 8px 12px;
}

.project-field-history-modal .project-change-log-events {
  max-height: none;
  overflow: visible;
}

.project-field-history-modal .modal-footer {
  flex: 0 0 auto;
  margin-top: 8px;
}

.project-field-history-context {
  display: grid;
  gap: var(--ui-space-2, 8px);
  min-width: 0;
  margin: 0 0 var(--ui-space-3, 12px);
  padding: var(--ui-space-3, 12px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.project-field-history-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 224px), 1fr));
  gap: var(--ui-space-2, 8px) var(--ui-space-3, 12px);
  min-width: 0;
}

.project-field-history-value {
  display: grid;
  align-content: start;
  gap: var(--ui-space-1, 4px);
  min-width: 0;
  padding: 0 var(--ui-space-2, 8px);
}

.project-field-history-value + .project-field-history-value {
  border-left: 1px solid var(--border-subtle);
}

.project-field-history-value > h3,
.project-field-history-value > :first-child,
.project-field-history-value :is(label, .project-field-history-label) {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.project-field-history-value > h3 { margin: 0; }

.project-field-history-value :is(p, div, strong) {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.45;
}

.project-field-history-value > p { color: var(--muted); font-size: 0.72rem; }
.project-field-history-value.is-different > p { color: var(--warning); }
.project-field-history-value.is-matching > p { color: var(--accent); }

.project-field-history-definitions {
  display: grid;
  gap: var(--ui-space-1, 4px);
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
  padding-top: var(--ui-space-2, 8px);
  border-top: 1px solid var(--border-subtle);
}

.project-field-history-latest {
  margin: var(--ui-space-2, 8px) 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.project-field-history-definitions :is(p, ul, ol) { margin-block: 0; }
.project-field-history-definitions :is(ul, ol) { padding-left: 20px; }
.project-field-history-definitions li { overflow-wrap: anywhere; }

@media (max-width: 680px) {
  .project-field-history-modal > .project-change-log-content {
    width: calc(100vw - 16px);
    max-height: calc(min(100dvh, var(--arrange-visual-height, 100dvh)) - 16px);
    padding: 12px;
  }

  .project-field-history-modal .project-change-log-body { padding-inline: 0; }
  .project-field-history-values { grid-template-columns: minmax(0, 1fr); }
  .project-field-history-context { padding: 8px; }
  .project-field-history-value + .project-field-history-value {
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    border-left: 0;
  }
}

@media (max-width: 768px), (max-width: 1024px) and (pointer: coarse) {
  .detail-panel .project-room-attribute-grid .project-room-attribute-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--ui-space-1, 4px);
  }

  .project-room-attribute-label { align-items: baseline !important; }
  .project-room-attribute-value :is(input, select) { min-height: 44px; }
  .project-room-attribute-value { --project-attribute-context-rail: 48px; }
  .project-room-attribute-value .field-provenance-dot {
    right: 2px;
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .project-room-attribute-value > .project-history-field--full > .field-provenance-dot {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

  .project-field-history-modal .modal-close {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-field-review-popover { transition: none; transform: none; }
}

/* Field composition follows the actual group width and semantic field type. */
.project-room-attribute-section { container: room-attribute-group / inline-size; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.project-room-attribute-heading { width: 100%; border: 0; color: var(--text); font: inherit; text-align: left; min-height: 36px; }
.project-room-attribute-heading:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.project-room-attribute-field-count { margin-left: auto; color: var(--muted); font-size: .7rem; white-space: nowrap; }
.project-room-attribute-section .project-room-attribute-grid { grid-template-columns: minmax(0, 1fr); gap: 2px 16px; }
.detail-panel .project-room-attribute-section .project-room-attribute-grid .project-room-attribute-row { grid-template-columns: 104px minmax(0, 1fr); gap: 8px; }
.project-attribute-notes { margin-top: 6px; font-size: .75rem; color: var(--muted); }
.project-attribute-notes summary { cursor: pointer; padding: 6px 0; min-height: 24px; }
.project-attribute-notes label { display: none !important; }
.project-attribute-notes textarea { box-sizing: border-box; }
.room-detail-panel-navigation,
.equipment-detail-navigation { position: sticky; top: 0; z-index: 4; padding: 4px 8px; background: var(--bg-card); border-bottom: 1px solid var(--border); min-height: 36px; box-sizing: border-box; }
.room-detail-panel-navigation label,
.equipment-detail-navigation label { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .76rem; }
.room-detail-panel-navigation select,
.equipment-detail-navigation select { flex: 1; min-width: 0; padding: 5px 8px; color: var(--text); background: var(--input-bg); border: 1px solid var(--border); border-radius: 4px; font: inherit; }
.room-detail-panel-navigation ~ .detail-panel .project-room-attribute-status { top: 40px; }
.room-detail-panel-navigation ~ .detail-panel h3,
.project-room-attribute-heading { scroll-margin-top: 90px; }
.room-detail-overview .room-detail-notes { min-width: 0 !important; flex-basis: 280px !important; }
.room-detail-overview .detail-section-heading { margin-bottom: 8px !important; }
@container room-attribute-group (min-width: 520px) {
  .project-room-attribute-section .project-room-attribute-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-room-attribute-grid [data-layout="wide"] { grid-column: 1 / -1; }
}
@container room-attribute-group (max-width: 340px) {
  .detail-panel .project-room-attribute-section .project-room-attribute-grid [data-layout="wide"] { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
#equipment-detail-modal .modal-content { container: equipment-dialog / inline-size; display: flex; flex-direction: column; max-height: calc(100dvh - 24px); overflow: hidden; }
#equipment-detail-modal .modal-header,
#equipment-detail-modal .modal-footer { flex: 0 0 auto; }
:is(#equipment-detail-content, .reference-equipment-detail-content).eq-compact { min-height: 0; overflow-y: auto; overscroll-behavior: contain; grid-template-columns: minmax(0, 1fr); gap: 10px 20px; }
:is(#equipment-detail-content, .reference-equipment-detail-content).eq-compact .equipment-detail-section { container: equipment-group / inline-size; min-width: 0; padding-bottom: 10px; }
:is(#equipment-detail-content, .reference-equipment-detail-content).eq-compact .equipment-detail-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 8px 16px; }
:is(#equipment-detail-content, .reference-equipment-detail-content).eq-compact .equipment-detail-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); align-items: start; gap: 8px; }
:is(#equipment-detail-content, .reference-equipment-detail-content).eq-compact .equipment-detail-label { min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
:is(#equipment-detail-content, .reference-equipment-detail-content).eq-compact [data-layout="wide"] { grid-column: 1 / -1; }
#equipment-detail-content :is(input,select,textarea) { min-width: 0; max-width: 100%; box-sizing: border-box; }
.equipment-detail-section-heading { scroll-margin-top: 50px; }
@container equipment-dialog (min-width: 880px) {
  :is(#equipment-detail-content, .reference-equipment-detail-content).eq-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container equipment-group (min-width: 470px) {
  :is(#equipment-detail-content, .reference-equipment-detail-content).eq-compact .equipment-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (pointer: coarse) {
  .project-room-attribute-heading,
  .room-detail-panel-navigation select,
  .equipment-detail-navigation select { min-height: 44px; }
  .room-detail-panel-navigation ~ .detail-panel .project-room-attribute-status { top: 56px; }
  .project-room-attribute-heading { scroll-margin-top: 110px; }
}
.arrange-release-update { position: fixed; z-index: 100100; bottom: 48px; right: 16px; max-width: min(440px, calc(100vw - 32px)); box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--text); box-shadow: 0 6px 24px #0003; font-size: .78rem; line-height: 1.4; }
.arrange-release-update button { flex: 0 0 auto; min-height: 36px; border: 1px solid var(--border); border-radius: 5px; color: var(--text); background: var(--input-bg); padding: 6px 10px; font: inherit; cursor: pointer; }
@media (max-width: 420px) { .arrange-release-update { align-items: start; flex-direction: column; } }
.room-detail-overview h3 { overflow-wrap: anywhere; min-width: 0; }
.detail-panel:has(> div h3):has(.equipment-list) > div:first-child { gap: 8px; }
.detail-panel:has(.equipment-list) > div:first-child > div:first-child { flex-wrap: wrap; min-width: 0; }
.detail-panel:has(.equipment-list) > div:first-child > div:first-child > div { flex-wrap: wrap; }
.detail-panel:has(.equipment-list) .equipment-item-header { min-width: 0; flex-wrap: wrap; }
.detail-panel:has(.equipment-list) .equipment-item-header > .project-history-field { min-width: 0; max-width: 100%; }
.detail-panel:has(.equipment-list) .equipment-item-header > .project-history-field:has(input[onchange*="updateEquipmentName"]) { flex: 1 1 180px; }
.detail-panel:has(.equipment-list) .equipment-item-header input[onchange*="updateEquipmentName"] { width: 100% !important; box-sizing: border-box; min-width: 0; }
#equipment-detail-content .equipment-detail-row:has(.equipment-detail-value > span[style*="font-weight: 600"]) { grid-column: 1 / -1; }
#equipment-detail-content .equipment-detail-value > span[style*="font-weight: 600"] { white-space: nowrap; }

/* A field pop-out stays beside its dot, with optional detail inside it. */
.field-popout {
  position: fixed; inset: auto; margin: 0; z-index: 100000;
  box-sizing: border-box; width: min(280px, calc(100vw - 16px));
  max-height: min(360px, calc(100dvh - 16px)); overflow: auto;
  padding: 10px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-card, #fff); color: var(--text, #182129);
  box-shadow: 0 4px 18px #0003; font: 12px/1.4 var(--font-sans, system-ui);
  overflow-wrap: anywhere;
}
.field-popout .field-popout-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.field-popout .field-popout-heading button { width:28px; height:28px; flex:none; padding:0; }
.field-popout p { margin:5px 0; white-space:pre-wrap; }
.field-popout details { margin-top:6px; }
.field-popout summary { cursor:pointer; padding:4px 0; }
.field-popout article { border-top:1px solid var(--border); padding:6px 0; }
.field-popout button { font:inherit; color:inherit; background:var(--bg); border:1px solid var(--border); border-radius:5px; padding:5px 8px; cursor:pointer; }
.field-popout :is(button, summary, input):focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.applet-color-wheel { display:block; width:16px; height:16px; border-radius:50%; background:conic-gradient(#c66363, #d8be65, #69a57d, #679bbf, #9673b7, #c66363); border:1px solid currentColor; }
.applet-color-button { display:inline-flex !important; align-items:center; justify-content:center; }
.applet-color-popout label { display:flex; align-items:center; justify-content:space-between; margin:8px 0; }
.applet-color-popout input { width:48px; height:32px; padding:0; border:0; }
.applet-color-palette { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:5px; margin:8px 0; }
.applet-color-palette button { padding:8px 2px; font-size:11px; }
