.commons-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.commons-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.9rem;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}

.commons-toolbar__group {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.commons-toolbar__group--actions {
  justify-content: flex-end;
}

.commons-mobile-panel-actions {
  display: none;
}

.commons-switcher {
  display: inline-flex;
  gap: 0.5rem;
  padding: 0.3rem;
  border: 1px solid var(--commons-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.commons-switcher__button {
  min-height: 40px;
  padding: 0 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-family: var(--font-ui);
  color: var(--text);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.commons-switcher__button.is-active {
  background: rgba(0, 0, 0, 0.08);
}

.commons-switcher--mode .commons-switcher__button.is-active {
  background: rgba(23, 29, 27, 0.14);
}

.commons-save-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0 0.9rem;
  border: 1px solid var(--commons-line);
  border-radius: 999px;
  background: var(--commons-surface);
  font-family: var(--font-ui);
  color: var(--muted);
}

.commons-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 40px;
  min-width: 40px;
  padding: 0 0.8rem;
  border: 1px solid var(--commons-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.commons-icon-button:hover,
.commons-icon-button:focus-visible {
  border-color: rgba(23, 29, 27, 0.24);
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

.commons-icon-button:focus-visible {
  outline: 2px solid rgba(63, 111, 147, 0.42);
  outline-offset: 2px;
}

.commons-icon-button__label {
  font-size: 0.88rem;
  line-height: 1.2;
}

.commons-icon-button--primary {
  background: rgba(28, 37, 33, 0.94);
  border-color: rgba(28, 37, 33, 0.94);
  color: #f8f6f0;
}

.commons-icon-button--primary:hover,
.commons-icon-button--primary:focus-visible {
  background: rgba(20, 27, 24, 0.98);
  border-color: rgba(20, 27, 24, 0.98);
  color: #f8f6f0;
}

.commons-icon-button--secondary {
  background: rgba(248, 246, 240, 0.98);
  border-color: rgba(23, 29, 27, 0.16);
}

.commons-icon-button--subtle {
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
}

.filter-section {
  margin-bottom: 1.5rem;
}

.filter-section:last-child {
  margin-bottom: 0;
}

.filter-section .commons-panel__subtitle {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
}

.commons-panel__heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.commons-panel__heading--compact {
  align-items: center;
}

.commons-save-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(78, 102, 87, 0.45);
}

.commons-save-status.is-success {
  color: #355445;
  border-color: rgba(53, 84, 69, 0.16);
  background: rgba(241, 247, 242, 0.94);
}

.commons-save-status.is-success::before {
  background: #4f7a60;
}

.commons-save-status.is-busy {
  color: #5a5d55;
  border-color: rgba(95, 96, 83, 0.18);
  background: rgba(248, 246, 240, 0.96);
}

.commons-save-status.is-busy::before {
  background: #a48f56;
}

.commons-save-status.is-error {
  color: #8d3939;
  border-color: rgba(141, 57, 57, 0.22);
  background: rgba(251, 242, 242, 0.96);
}

.commons-save-status.is-error::before {
  background: #b24a4a;
}

.commons-panel__block,
.entity-panel,
.entity-panel__section,
.entity-panel__list,
.entity-panel__context-grid {
  display: grid;
  gap: 0.55rem;
}

.canvas-stage__header {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 3;
  max-width: min(32rem, calc(100% - 7.5rem));
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(23, 29, 27, 0.08);
  border-radius: 20px;
  background: rgba(249, 247, 241, 0.9);
  backdrop-filter: blur(8px);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.canvas-stage__header--inline {
  position: static;
  max-width: none;
  margin: 1rem 1rem 0;
}

.map-stage__tools {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  display: flex;
  gap: 0.5rem;
}

.map-help-icon {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.canvas-stage__eyebrow {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.canvas-stage__title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.2rem;
  line-height: 1;
}

.canvas-stage__copy,
.commons-panel__note,
.entity-panel__section-copy {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

.commons-panel {
  border: 1px solid var(--commons-line);
  border-radius: 28px;
  background: var(--commons-surface);
  box-shadow: var(--commons-shadow);
}

.commons-workspace {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.commons-panel {
  padding: 1rem;
  overflow: auto;
  scrollbar-gutter: stable;
}

.commons-panel--filters,
.commons-panel--detail {
  background: rgba(249, 247, 241, 0.96);
  backdrop-filter: blur(6px);
}

.commons-panel--filters .filter-bar,
.commons-panel--filters .commons-chip-grid {
  align-items: flex-start;
}

.commons-panel__mobile-close,
.commons-panel__mobile-handle,
.commons-mobile-backdrop {
  display: none;
}

.commons-mobile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  border: 0;
  background: rgba(18, 22, 20, 0.16);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.commons-detail-peek {
  display: none;
}

.commons-panel__eyebrow,
.commons-search__label,
.entity-panel__meta-row dt,
.entity-panel__section h3,
.entity-panel__context-grid h4,
.entity-editor__label {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.commons-panel__title {
  font-family: var(--font-ui);
  font-size: 1.35rem;
  line-height: 1;
}

.commons-panel__subtitle,
.entity-panel__lead,
.entity-editor__hint {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--muted);
}

.commons-chip-grid,
.entity-panel__list--chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.commons-chip,
.entity-panel__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 0.9rem;
  border: 1px solid var(--commons-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-family: var(--font-ui);
  font-size: 0.92rem;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.commons-chip.is-active {
  background: color-mix(in srgb, var(--chip-color, rgba(0, 0, 0, 0.08)) 16%, white);
  border-color: color-mix(in srgb, var(--chip-color, rgba(0, 0, 0, 0.18)) 55%, transparent);
}

.commons-chip--primary {
  background: rgba(28, 37, 33, 0.94);
  border-color: rgba(28, 37, 33, 0.94);
  color: #f8f6f0;
}

.commons-chip--primary.is-active {
  background: rgba(28, 37, 33, 0.94);
  border-color: rgba(28, 37, 33, 0.94);
  color: #f8f6f0;
}

.commons-chip--secondary {
  background: rgba(248, 246, 240, 0.98);
  border-color: rgba(23, 29, 27, 0.16);
}

.commons-chip--ghost {
  background: transparent;
  color: var(--muted);
}

.commons-chip:disabled,
.commons-switcher__button:disabled,
.entity-editor__input:disabled,
.entity-editor__textarea:disabled,
.entity-editor__select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.entity-panel__meta-row dd,
.entity-panel__event,
.commons-search__input,
.commons-search__result,
.entity-editor__select,
.commons-inline-form select {
  font-family: var(--font-ui);
}

.entity-panel__event {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--commons-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.entity-panel__event-title {
  font-weight: 600;
}

.entity-panel__event-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.commons-search {
  position: relative;
  display: block;
  flex: 1 1 auto;
  width: 100%;
  max-width: 640px;
}

.commons-search__input {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 0.95rem;
  border: 1px solid var(--commons-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 1rem;
}

.commons-search__results {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 0.6rem;
  padding: 0.8rem;
  border: 1px solid var(--commons-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.08);
}

.commons-search__results[hidden] {
  display: none !important;
}

.commons-search__group {
  display: grid;
  gap: 0.35rem;
}

.commons-search__group-title {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.commons-search__result {
  display: grid;
  gap: 0.12rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--commons-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.75);
  text-align: left;
}

.commons-search__result span {
  color: var(--muted);
  font-size: 0.88rem;
}

.entity-editor {
  border-top: 1px solid var(--commons-line);
  padding-top: 0.95rem;
}

.entity-editor__status-row,
.commons-inline-form {
  display: grid;
  gap: 0.5rem;
}

.entity-panel {
  align-content: start;
  gap: 0.9rem;
}

.entity-panel__header {
  display: grid;
  gap: 0.55rem;
}

.entity-panel__title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  min-width: 0;
}

.entity-panel__title-block {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  flex: 1 1 auto;
}

.entity-panel__summary {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text);
}

.entity-panel__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.entity-panel__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--commons-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-family: var(--font-ui);
  font-size: 1rem;
  white-space: nowrap;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.entity-panel__tab.is-active {
  background: rgba(23, 29, 27, 0.92);
  border-color: rgba(23, 29, 27, 0.92);
  color: #f8f6f0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.entity-panel__tab:hover,
.entity-panel__tab:focus-visible {
  border-color: rgba(23, 29, 27, 0.24);
  transform: translateY(-1px);
}

.entity-panel__tab:focus-visible {
  outline: 2px solid rgba(63, 111, 147, 0.42);
  outline-offset: 2px;
}

.entity-panel__tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
  line-height: 1;
}

.entity-panel__pane {
  display: none;
  gap: 0.85rem;
}

.entity-panel__pane.is-active {
  display: grid;
}

.entity-panel__section-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.entity-panel__section-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.entity-panel__meta {
  gap: 0.7rem;
}

.entity-panel__meta:empty {
  display: none;
}

.entity-panel__meta-row {
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(23, 29, 27, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
}

.entity-panel__meta-row dd {
  margin: 0;
  color: var(--text);
  line-height: 1.35;
}

.entity-panel__section {
  padding: 0.2rem 0 0;
}

.entity-panel__section h3 {
  margin: 0;
}

.entity-panel__section--assist {
  padding-top: 0.55rem;
  border-top: 1px solid rgba(23, 29, 27, 0.08);
}

.entity-panel__empty {
  display: grid;
  gap: 0.55rem;
  padding: 0.95rem 1rem;
  border: 1px dashed rgba(23, 29, 27, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.entity-panel__empty strong {
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.entity-panel__empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.entity-panel__relation-group {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(23, 29, 27, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
}

.entity-panel__relation-head h4 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  line-height: 1.2;
}

.entity-panel__relation-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.entity-panel__linkchip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 0.9rem;
  border: 1px solid rgba(23, 29, 27, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.entity-panel__linkchip:hover,
.entity-panel__linkchip:focus-visible {
  border-color: rgba(23, 29, 27, 0.28);
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

.entity-panel__linkchip[data-tone="place"] {
  border-color: rgba(63, 111, 147, 0.18);
}

.entity-panel__linkchip[data-tone="person"] {
  border-color: rgba(93, 93, 93, 0.18);
}

.entity-panel__linkchip[data-tone="product"] {
  border-color: rgba(148, 120, 77, 0.2);
}

.entity-panel__linkchip[data-tone="project"],
.entity-panel__linkchip[data-tone="note"] {
  border-color: rgba(76, 97, 109, 0.2);
}

.entity-panel__event-top {
  display: grid;
  gap: 0.18rem;
}

.entity-panel__event {
  appearance: none;
  width: 100%;
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(23, 29, 27, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.entity-panel__event:hover,
.entity-panel__event:focus-visible {
  border-color: rgba(23, 29, 27, 0.22);
  background: rgba(255, 255, 255, 0.84);
  transform: translateY(-1px);
}

.entity-panel__event-copy {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.entity-panel__event-editor {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(23, 29, 27, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.entity-panel__event-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.entity-panel__event-field {
  display: grid;
  gap: 0.34rem;
}

.entity-panel__event-field--wide {
  grid-column: 1 / -1;
}

.entity-editor__form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.entity-editor__field {
  display: grid;
  gap: 0.34rem;
}

.entity-editor__field--wide {
  grid-column: 1 / -1;
}

.entity-editor__input,
.entity-editor__textarea,
.entity-editor__select {
  width: 100%;
  min-height: 42px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--commons-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.entity-editor__textarea {
  min-height: 92px;
  resize: vertical;
}

.entity-editor__input:focus,
.entity-editor__textarea:focus,
.entity-editor__select:focus,
.commons-search__input:focus {
  outline: none;
  border-color: rgba(63, 111, 147, 0.42);
  box-shadow: 0 0 0 3px rgba(63, 111, 147, 0.12);
}

.entity-editor__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.entity-editor__actions--form {
  grid-column: 1 / -1;
}

.entity-editor__placement {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  border: 1px dashed rgba(23, 29, 27, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.entity-editor__placement-copy {
  display: grid;
  gap: 0.3rem;
}

.entity-editor__placement-copy strong {
  font-family: var(--font-ui);
  font-size: 0.95rem;
}

.entity-editor__placement-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.entity-editor__placement-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.entity-editor__feedback {
  grid-column: 1 / -1;
  min-height: 1.4rem;
  margin: 0;
  padding: 0.72rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 14px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--muted);
  background: rgba(248, 246, 240, 0.7);
}

.entity-editor__feedback.is-error {
  color: #8d3939;
  border-color: rgba(141, 57, 57, 0.18);
  background: rgba(251, 242, 242, 0.94);
}

.entity-editor__feedback.is-success {
  color: #355445;
  border-color: rgba(53, 84, 69, 0.16);
  background: rgba(241, 247, 242, 0.94);
}

.entity-editor__feedback.is-busy {
  color: #65593b;
  border-color: rgba(138, 118, 60, 0.16);
  background: rgba(250, 247, 236, 0.96);
}

.entity-panel__section[hidden],
.commons-save-status[hidden] {
  display: none !important;
}

.entity-panel__header,
.entity-panel__header-actions,
.entity-panel__summary,
.entity-panel__meta-row dd,
.entity-panel__event,
.entity-panel__event-copy,
.entity-panel__linkchip,
.entity-panel__tab,
.commons-chip {
  min-width: 0;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.entity-panel__header-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.commons-create-action {
  box-shadow: 0 12px 30px rgba(20, 27, 24, 0.14);
}

.commons-footer {
  padding:
    0.7rem
    0
    calc(0.8rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(180deg, rgba(244, 241, 235, 0.78), rgba(244, 241, 235, 0.96));
}

.commons-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.7rem 1.35rem;
  align-items: center;
  min-height: 2rem;
}

.commons-footer__brand {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--muted) 88%, white);
}

.commons-footer__links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  font-family: var(--font-ui);
  font-size: 0.84rem;
}

.commons-footer__links--meta {
  color: color-mix(in srgb, var(--muted) 86%, white);
}

.commons-footer a {
  text-decoration: none;
  color: var(--muted);
}

.commons-footer a:hover,
.commons-footer a:focus-visible {
  color: var(--text);
}

.commons-chip,
.entity-panel__linkchip {
  line-height: 1.2;
  text-align: center;
}

.legal-page {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(1.4rem, 2vw, 2rem);
  display: grid;
  gap: clamp(1.4rem, 2vw, 2rem);
  overflow: auto;
}

.legal-page__hero {
  display: grid;
  gap: 0.8rem;
  padding-bottom: 0.35rem;
}

.legal-page__eyebrow {
  margin: 0;
}

.legal-page__title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  max-width: 14ch;
}

.legal-page__intro {
  margin: 0;
  max-width: 72ch;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}

.legal-page__grid {
  display: grid;
  gap: 1rem;
}

.legal-card {
  display: grid;
  gap: 1rem;
  padding: 1.25rem 1.3rem;
  border: 1px solid rgba(23, 29, 27, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
}

.legal-card__body {
  display: grid;
  gap: 0.5rem;
}

.legal-card__kicker {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.legal-card__title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.28rem;
  line-height: 1.15;
}

.legal-card__copy {
  margin: 0;
  max-width: 68ch;
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
}

.legal-card__actions {
  display: flex;
  justify-content: flex-start;
}

.legal-card__cta {
  text-decoration: none;
}

.legal-card--notice {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(245, 248, 245, 0.88) 100%);
  border-color: rgba(76, 96, 82, 0.14);
}

.legal-note {
  display: grid;
  gap: 0.35rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(76, 96, 82, 0.16);
  border-radius: 18px;
  background: rgba(241, 247, 242, 0.94);
}

.legal-note strong {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.legal-note p {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

.entity-panel__event-editor {
  gap: 1rem;
  padding: 1.1rem;
  overflow: visible;
}

.graph-stage__header .commons-icon-button,
.entity-panel__header-actions .commons-icon-button,
.entity-panel__section-head .commons-icon-button {
  flex-shrink: 0;
}

.entity-panel__event-form {
  gap: 0.9rem;
  overflow: visible;
}

.entity-panel__event-field,
.entity-editor__field {
  min-width: 0;
}

.entity-editor-launch {
  display: grid;
  gap: 0.9rem;
}

.entity-editor-launch__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.entity-editor-launch__note {
  display: grid;
  gap: 0.35rem;
  padding: 0.9rem 0.95rem;
  border: 1px solid rgba(23, 29, 27, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.entity-editor-launch__note strong,
.place-editor-overlay__intro h2 {
  font-family: var(--font-ui);
}

.entity-editor-launch__note p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

.place-editor-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.place-editor-overlay[hidden] {
  display: none !important;
}

.place-editor-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 24, 22, 0.46);
  backdrop-filter: blur(6px);
}

.place-editor-overlay__dialog {
  position: relative;
  width: min(1120px, 100%);
  max-height: calc(100vh - 2.4rem);
  border: 1px solid rgba(23, 29, 27, 0.12);
  border-radius: 28px;
  background: rgba(249, 247, 241, 0.98);
  box-shadow: 0 36px 80px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.place-editor-overlay__compact {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(23, 29, 27, 0.08);
  border-radius: 22px;
  background: rgba(249, 247, 241, 0.98);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
}

.place-editor-overlay__placement-bar,
.place-editor-overlay__placement-bar[hidden],
.place-editor-overlay:not(.is-placement) .place-editor-overlay__placement-bar {
  display: none !important;
}

.place-editor-overlay__compact-title,
.place-editor-overlay__compact-copy {
  margin: 0;
}

.place-editor-overlay__compact-title {
  font-family: var(--font-ui);
}

.place-editor-overlay__compact-copy {
  color: var(--muted);
  line-height: 1.45;
}

.place-editor-overlay__compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.place-editor-overlay__shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: inherit;
}

.place-editor-overlay__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.25rem 1.35rem 1rem;
  border-bottom: 1px solid rgba(23, 29, 27, 0.08);
  background: rgba(249, 247, 241, 0.98);
}

.place-editor-overlay__intro,
.place-editor-overlay__section-head,
.place-editor-overlay__status {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.place-editor-overlay__section-head h3 {
  margin: 0;
  font-family: var(--font-ui);
}

.place-editor-overlay__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.place-editor-overlay__status {
  min-width: 140px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
}

.place-editor-overlay__form {
  display: grid;
  gap: 1rem;
  padding: 1.2rem 1.35rem 1.35rem;
  overflow: auto;
}

.place-editor-overlay__section {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 1.05rem;
  border: 1px solid rgba(23, 29, 27, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
}

.place-editor-overlay__grid,
.place-editor-overlay__coords {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem 0.9rem;
}

.place-editor-overlay__field--wide {
  grid-column: 1 / -1;
}

.place-editor-overlay__social-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 0.9rem;
}

.place-editor-overlay__social-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.place-editor-overlay__social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  min-width: 2.3rem;
  height: 2.3rem;
  border: 1px solid rgba(23, 29, 27, 0.1);
  border-radius: 999px;
  background: rgba(248, 246, 240, 0.9);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--muted);
}

body.has-place-editor-overlay {
  overflow: hidden;
}

body.is-map-placement-mode .map-stage {
  box-shadow:
    inset 0 0 0 2px rgba(63, 111, 147, 0.24),
      0 0 0 4px rgba(63, 111, 147, 0.08);
}

.place-editor-overlay.is-placement {
  place-items: end right;
  padding: 1rem;
  pointer-events: none;
}

.place-editor-overlay.is-placement .place-editor-overlay__backdrop {
  opacity: 0;
  pointer-events: none;
}

.place-editor-overlay.is-placement .place-editor-overlay__dialog {
  width: min(420px, calc(100vw - 2rem));
  max-height: none;
  border-radius: 24px;
  overflow: visible;
  pointer-events: auto;
}

.place-editor-overlay.is-placement .place-editor-overlay__placement-bar {
  display: grid !important;
}

.place-editor-overlay.is-placement .place-editor-overlay__shell {
  display: none;
}

@media (max-width: 1180px) {
  .commons-topbar {
    position: relative;
    z-index: 12;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    margin-bottom: 0.55rem;
  }

  .commons-toolbar {
    justify-content: space-between;
    gap: 0.55rem;
    align-items: center;
  }

  .commons-toolbar__group--actions {
    margin-left: auto;
    justify-content: flex-end;
  }

  .commons-panel {
    overflow: visible;
  }
}

@media (max-width: 820px) {
  .commons-mobile-panel-actions {
    display: inline-flex;
    gap: 0.4rem;
    flex-wrap: wrap;
  }

  .commons-panel__mobile-close {
    display: inline-flex;
  }

  .commons-map-page.is-mobile-filters-open .commons-mobile-backdrop,
  .commons-map-page.is-mobile-detail-open .commons-mobile-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .commons-detail-peek {
    position: fixed;
    left: max(0.75rem, env(safe-area-inset-left, 0px));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    bottom: calc(var(--commons-footer-height, 56px) + 0.45rem + env(safe-area-inset-bottom, 0px));
    z-index: 44;
    display: grid;
    gap: 0.16rem;
    align-items: start;
    justify-items: start;
    padding: 0.72rem 0.9rem 0.78rem;
    border: 1px solid rgba(23, 29, 27, 0.12);
    border-radius: 22px;
    background: rgba(249, 247, 241, 0.94);
    box-shadow: 0 18px 42px rgba(12, 18, 17, 0.14);
    backdrop-filter: blur(14px);
    text-align: left;
    cursor: pointer;
    transition: opacity 160ms ease, transform 180ms ease, border-color 140ms ease;
  }

  .commons-detail-peek:hover,
  .commons-detail-peek:focus-visible {
    border-color: rgba(23, 29, 27, 0.24);
    transform: translateY(-1px);
  }

  .commons-detail-peek[hidden] {
    display: none !important;
  }

  .commons-detail-peek:disabled {
    cursor: default;
    opacity: 0.86;
  }

  .commons-detail-peek__eyebrow,
  .commons-detail-peek__meta {
    font-family: var(--font-ui);
    color: var(--muted);
  }

  .commons-detail-peek__eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .commons-detail-peek__title {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--text);
  }

  .commons-detail-peek__meta {
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .commons-map-page.is-mobile-filters-open .commons-detail-peek,
  .commons-map-page.is-mobile-detail-open .commons-detail-peek {
    opacity: 0;
    pointer-events: none;
    transform: translateY(1rem);
  }
}

@media (max-width: 720px) {
  .commons-topbar {
    margin-bottom: 0.4rem;
  }

  .commons-toolbar,
  .commons-toolbar__group {
    flex-wrap: wrap;
  }

  .commons-mobile-panel-actions {
    width: auto;
  }

  .commons-mobile-panel-toggle {
    flex: 0 0 auto;
    min-width: 0;
    justify-content: center;
  }

  .commons-switcher {
    flex: 1 1 auto;
    justify-content: space-between;
    padding: 0.2rem;
  }

  .commons-switcher__button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    padding-inline: 0.58rem;
  }

  .commons-search {
    max-width: none;
  }

  .commons-search__input {
    height: 42px;
    min-height: 42px;
    padding-inline: 0.82rem;
    border-radius: 16px;
    font-size: 0.96rem;
  }

  .commons-panel {
    padding: 0.85rem;
    border-radius: 24px;
  }

  .filter-section {
    margin-bottom: 1rem;
  }

  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    scrollbar-width: none;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .commons-footer {
    padding:
      0.38rem
      0
      calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }

  .commons-footer__inner {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    align-items: start;
  }

  .commons-footer__links {
    justify-content: flex-start;
    gap: 0.5rem 0.75rem;
    font-size: 0.76rem;
  }

  .commons-footer__brand {
    font-size: 0.68rem;
  }

  .commons-icon-button__label {
    display: none;
  }

  .commons-panel__mobile-handle {
    display: block;
    width: 2.75rem;
    height: 0.28rem;
    margin: 0 auto 0.65rem;
    border-radius: 999px;
    background: rgba(23, 29, 27, 0.16);
  }

  .entity-panel__tabs {
    justify-content: flex-start;
  }

  .entity-panel__title-row {
    gap: 0.65rem;
  }

  .commons-panel--detail .entity-panel__header {
    gap: 0.8rem;
  }

  .commons-detail-peek {
    left: max(0.5rem, env(safe-area-inset-left, 0px));
    right: max(0.5rem, env(safe-area-inset-right, 0px));
    bottom: calc(var(--commons-footer-height, 56px) + 0.35rem + env(safe-area-inset-bottom, 0px));
    padding: 0.64rem 0.8rem 0.7rem;
    border-radius: 18px;
  }

  .commons-detail-peek__title {
    font-size: 0.94rem;
  }

  .commons-detail-peek__meta {
    font-size: 0.78rem;
  }

  .entity-editor__form {
    grid-template-columns: 1fr;
  }

  .entity-panel__event-form {
    grid-template-columns: 1fr;
  }

  .place-editor-overlay {
    padding: 0.6rem;
  }

  .place-editor-overlay__header {
    padding: 1rem;
  }

  .place-editor-overlay__header,
  .place-editor-overlay__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .place-editor-overlay__form {
    padding: 1rem;
  }

  .place-editor-overlay__grid,
  .place-editor-overlay__coords,
  .place-editor-overlay__social-grid {
    grid-template-columns: 1fr;
  }

  .legal-page {
    padding: 1rem;
  }

  .legal-card {
    padding: 1rem;
  }

  .legal-card__cta {
    width: 100%;
    justify-content: center;
  }
}

/* ========================================
   COMMONS MONO SYSTEM
======================================== */

.commons-switcher,
.commons-save-status,
.commons-icon-button,
.canvas-stage__header,
.commons-panel,
.entity-panel__meta-row,
.entity-panel__empty,
.entity-panel__relation-group,
.entity-panel__event,
.entity-panel__event-editor,
.entity-editor__placement,
.entity-editor__feedback,
.legal-card,
.entity-editor-launch__note,
.place-editor-overlay__section,
.commons-detail-peek {
  border-color: var(--commons-line);
  background: var(--commons-surface);
  color: var(--text);
}

.commons-panel,
.entity-panel__event-editor,
.legal-card,
.place-editor-overlay__section,
.commons-detail-peek {
  box-shadow: var(--commons-shadow);
}

.commons-panel--filters,
.commons-panel--detail,
.canvas-stage__header,
.place-editor-overlay__dialog,
.place-editor-overlay__compact,
.place-editor-overlay__header {
  border-color: var(--commons-line);
  background: var(--commons-surface-strong);
  color: var(--text);
}

.commons-chip,
.entity-panel__chip,
.entity-panel__linkchip,
.commons-search__input,
.commons-search__result,
.entity-editor__input,
.entity-editor__textarea,
.entity-editor__select,
.commons-inline-form select,
.place-editor-overlay__social-icon {
  border-color: var(--commons-line);
  background: var(--commons-surface-strong);
  color: var(--text);
}

.commons-chip--secondary,
.commons-icon-button--secondary,
.commons-icon-button--subtle {
  border-color: var(--commons-line);
  background: var(--commons-surface);
  color: var(--text);
}

.commons-switcher__button.is-active,
.commons-switcher--mode .commons-switcher__button.is-active,
.commons-icon-button--primary,
.commons-icon-button--primary:hover,
.commons-icon-button--primary:focus-visible,
.commons-chip--primary,
.commons-chip--primary.is-active,
.commons-create-action {
  background: var(--commons-primary);
  border-color: var(--commons-primary);
  color: var(--text);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.08);
}

.commons-icon-button:not(.commons-icon-button--primary):hover,
.commons-icon-button:not(.commons-icon-button--primary):focus-visible,
.commons-chip.is-active:not(.commons-chip--primary),
.entity-panel__linkchip:hover,
.entity-panel__linkchip:focus-visible,
.entity-panel__event:hover,
.entity-panel__event:focus-visible,
.commons-detail-peek:hover,
.commons-detail-peek:focus-visible {
  border-color: var(--commons-line-strong);
  background: var(--commons-surface-elevated);
  color: var(--text);
}

.commons-icon-button:focus-visible,
.commons-search__input:focus,
.entity-editor__input:focus,
.entity-editor__textarea:focus,
.entity-editor__select:focus,
.commons-inline-form select:focus {
  outline: 2px solid var(--commons-focus);
  outline-offset: 2px;
  border-color: var(--commons-focus);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.commons-mobile-backdrop,
.place-editor-overlay__backdrop {
  background: var(--commons-backdrop);
}

.commons-footer {
  border-top-color: var(--commons-line);
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--commons-bg) 88%, var(--color-black)));
}

.commons-footer__brand,
.commons-footer__links--meta,
.commons-footer a {
  color: var(--muted);
}

.commons-footer a:hover,
.commons-footer a:focus-visible {
  color: var(--text);
}
