.cc-profile {
  --profile-rule: var(--cc-line, #d9e0dc);
  --profile-muted: var(--cc-surface-muted, #f8faf9);
  --profile-emphasis: var(--cc-accent, #176b50);
  align-content: start;
  color: var(--cc-ink, #17211d);
  letter-spacing: 0;
}

html[data-theme="night"] .cc-profile {
  --profile-rule: var(--cc-line, #29434e);
  --profile-muted: var(--cc-surface-muted, #13232b);
  --profile-emphasis: var(--cc-accent, #2dd4bf);
}

.cc-profile .panel {
  overflow: visible;
}

.cc-profile__overview-canvas {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
  min-width: 0;
}

.cc-profile__overview-canvas > [data-module-canvas-block] {
  min-width: 0;
}

.cc-profile__overview-canvas [data-module-canvas-block] {
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--profile-rule);
  border-radius: 4px;
  background: var(--cc-surface, #fff);
}

.cc-profile__overview-head[data-module-canvas-block] {
  padding: 18px 20px;
  border-top: 3px solid var(--profile-emphasis);
}

.cc-profile__summary-grid[data-module-canvas-block] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-block: 1px solid var(--profile-rule);
}

.cc-profile__summary-grid[data-module-canvas-block] > div,
.cc-profile__summary-grid[data-module-canvas-block] > div:first-child {
  min-height: 50%;
  padding: 14px 15px;
  border-right: 1px solid var(--profile-rule);
  border-bottom: 1px solid var(--profile-rule);
}

.cc-profile__summary-grid[data-module-canvas-block] > div:nth-child(2n) {
  border-right: 0;
}

.cc-profile__summary-grid[data-module-canvas-block] > div:nth-child(n + 3) {
  border-bottom: 0;
}

.cc-profile__structure-entry[data-module-canvas-block] {
  padding: 17px 18px;
  border-left: 3px solid var(--profile-emphasis);
  background: color-mix(in srgb, var(--profile-emphasis) 5%, var(--cc-surface, #fff));
}

.cc-profile__overview-foot[data-module-canvas-block] {
  align-items: stretch;
  flex-direction: column;
  justify-content: space-between;
  padding: 17px 18px;
  border-top: 3px solid color-mix(in srgb, #b48a45 72%, var(--profile-rule));
}

.cc-profile__eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--profile-emphasis);
  font-family: var(--cc-font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.cc-profile__overview-head,
.cc-profile__editor-head,
.cc-profile__overview-foot,
.cc-profile__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.cc-profile__overview-head h3,
.cc-profile__editor-head h3 {
  margin: 0;
  color: var(--cc-ink, #17211d);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.cc-profile__overview-head p,
.cc-profile__editor-head p {
  max-width: 720px;
  margin: 6px 0 0;
  color: var(--cc-ink-soft, #52605a);
  font-size: 13px;
  line-height: 1.65;
}

.cc-profile__completion {
  display: grid;
  width: 116px;
  min-width: 116px;
  min-height: 76px;
  align-content: center;
  justify-items: end;
  border-left: 3px solid var(--profile-emphasis);
  padding-left: 20px;
}

.cc-profile__completion strong {
  color: var(--profile-emphasis);
  font-size: 28px;
  line-height: 1;
}

.cc-profile__completion span {
  margin-top: 8px;
  color: var(--cc-ink-faint, #7b8781);
  font-family: var(--cc-font-mono, monospace);
  font-size: 12px;
}

.cc-profile__summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 24px;
  border-block: 1px solid var(--profile-rule);
}

.cc-profile__summary-grid > div {
  min-width: 0;
  padding: 15px 18px;
  border-right: 1px solid var(--profile-rule);
}

.cc-profile__summary-grid > div:first-child {
  padding-left: 0;
}

.cc-profile__summary-grid > div:last-child {
  border-right: 0;
}

.cc-profile__summary-grid span,
.cc-profile__saved-at span,
.cc-profile__overview-foot > div > span {
  display: block;
  color: var(--cc-ink-faint, #7b8781);
  font-size: 11px;
  line-height: 1.4;
}

.cc-profile__summary-grid strong {
  display: block;
  margin-top: 6px;
  color: var(--cc-ink, #17211d);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.cc-profile__overview-foot {
  align-items: flex-end;
  margin-top: 20px;
}

.cc-profile__structure-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  border: 1px solid color-mix(in srgb, var(--profile-emphasis) 34%, var(--profile-rule));
  border-left: 4px solid var(--profile-emphasis);
  border-radius: 8px;
  background: color-mix(in srgb, var(--profile-emphasis) 7%, var(--cc-surface, #fff));
  padding: 14px 16px;
}

.cc-profile__structure-entry > div {
  min-width: 0;
}

.cc-profile__structure-entry strong {
  display: block;
  color: var(--cc-ink, #17211d);
  font-size: 15px;
}

.cc-profile__structure-entry p {
  margin: 6px 0 0;
  color: var(--cc-ink-soft, #52605a);
  font-size: 12px;
  line-height: 1.5;
}

.cc-profile__missing {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.cc-profile__missing span {
  border: 1px solid var(--profile-rule);
  border-radius: 4px;
  background: var(--profile-muted);
  padding: 4px 7px;
  color: var(--cc-ink-soft, #52605a);
  font-size: 12px;
}

.cc-profile__all-fields {
  margin-top: 16px;
  min-width: 0;
  border: 1px solid var(--profile-rule);
  border-top: 3px solid var(--profile-emphasis);
  background: var(--cc-surface, #fff);
}

.cc-profile__all-fields-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 18px;
}

.cc-profile__all-fields-head h3 {
  margin: 0;
  color: var(--cc-ink, #17211d);
  font-size: 17px;
  letter-spacing: 0;
}

.cc-profile__all-fields-head p {
  margin: 5px 0 0;
  color: var(--cc-ink-soft, #52605a);
  font-size: 12px;
  line-height: 1.5;
}

.cc-profile__all-fields-head > strong {
  flex: 0 0 auto;
  color: var(--profile-emphasis);
  font-family: var(--cc-font-mono, monospace);
  font-size: 12px;
}

.cc-profile__view-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--profile-rule);
}

.cc-profile__view-group {
  min-width: 0;
  padding: 0 18px 12px;
}

.cc-profile__view-group:nth-child(2n) {
  border-left: 1px solid var(--profile-rule);
}

.cc-profile__view-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  border-bottom: 1px solid var(--profile-rule);
}

.cc-profile__view-group h4,
.cc-profile__view-group dl,
.cc-profile__view-group dd,
.cc-profile__view-empty {
  margin: 0;
}

.cc-profile__view-group h4 {
  color: var(--cc-ink, #17211d);
  font-size: 13px;
  letter-spacing: 0;
}

.cc-profile__view-group > header span {
  color: var(--cc-ink-faint, #7b8781);
  font-family: var(--cc-font-mono, monospace);
  font-size: 10px;
}

.cc-profile__view-field {
  display: grid;
  grid-template-columns: minmax(100px, .36fr) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 10px 0;
}

.cc-profile__view-field + .cc-profile__view-field {
  border-top: 1px solid color-mix(in srgb, var(--profile-rule) 66%, transparent);
}

.cc-profile__view-field dt {
  color: var(--cc-ink-faint, #7b8781);
  font-size: 11px;
  line-height: 1.55;
}

.cc-profile__view-field dd {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--cc-ink, #17211d);
  cursor: text;
  font-size: 12px;
  line-height: 1.65;
  user-select: text;
}

.cc-profile__view-field dd:focus {
  border-radius: 2px;
  outline: 2px solid color-mix(in srgb, var(--profile-emphasis) 34%, transparent);
  outline-offset: 2px;
}

.cc-profile__view-empty {
  grid-column: 1 / -1;
  padding: 18px;
  color: var(--cc-ink-faint, #7b8781);
  font-size: 12px;
}

.cc-profile__editor-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--profile-rule);
  padding-bottom: 16px;
}

.cc-profile__editor {
  min-height: 0;
  max-height: calc(100dvh - var(--cc-desktop-topbar-height, 68px) - var(--cc-desktop-tabs-height, 44px) - 24px);
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-gutter: stable;
  padding-bottom: 72px;
}

.cc-profile__editor-tools {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.cc-profile__structure {
  margin: 18px 0;
  border-block: 1px solid var(--profile-rule);
  background: var(--profile-muted);
  padding: 16px 0;
  scroll-margin-top: 112px;
}

.cc-profile__structure[hidden] { display: none; }

.cc-profile__structure > header,
.cc-profile__structure-section-meta,
.cc-profile__add-section,
.cc-profile__add-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.cc-profile__structure > header { align-items: center; margin-bottom: 14px; }
.cc-profile__structure > header h4 { margin: 0; font-size: 15px; }
.cc-profile__structure > header p { margin: 4px 0 0; color: var(--cc-ink-soft, #52605a); font-size: 12px; }
.cc-profile__structure > header > span { color: var(--profile-emphasis); font-family: var(--cc-font-mono, monospace); font-size: 12px; }
.cc-profile__add-section { margin-bottom: 14px; }
.cc-profile__structure label { display: grid; gap: 5px; min-width: 0; }
.cc-profile__structure label > span { color: var(--cc-ink-soft, #52605a); font-size: 11px; }
.cc-profile__structure input,
.cc-profile__structure select { width: 100%; min-width: 0; min-height: 38px; border: 1px solid var(--cc-line-strong, #bac6c0); border-radius: 5px; background: var(--cc-surface, #fff); padding: 8px 10px; color: var(--cc-ink, #17211d); font: inherit; font-size: 13px; }
.cc-profile__structure-section { border: 1px solid var(--profile-rule); background: var(--cc-surface, #fff); }
.cc-profile__structure-section + .cc-profile__structure-section { margin-top: 10px; }
.cc-profile__structure-section > summary { padding: 10px 12px; cursor: pointer; list-style: none; }
.cc-profile__structure-section > summary::-webkit-details-marker { display: none; }
.cc-profile__structure-section > summary strong,
.cc-profile__structure-section > summary small { display: block; }
.cc-profile__structure-section > summary small { margin-top: 3px; color: var(--cc-ink-faint, #7b8781); font-size: 11px; }
.cc-profile__structure-section-body { border-top: 1px solid var(--profile-rule); padding: 12px; }
.cc-profile__structure-section-meta { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; margin-bottom: 12px; }
.cc-profile__structure-fields { display: grid; gap: 8px; }
.cc-profile__structure-field { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(120px, .7fr) minmax(160px, 1.2fr) auto; gap: 8px; align-items: end; border-top: 1px solid var(--profile-rule); padding-top: 10px; }
.cc-profile__row-actions { display: flex; gap: 4px; align-items: center; }
.cc-profile__icon-button { display: inline-grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--profile-rule); border-radius: 5px; background: var(--cc-surface, #fff); color: var(--cc-ink-soft, #52605a); cursor: pointer; }
.cc-profile__icon-button:hover:not(:disabled) { border-color: var(--profile-emphasis); color: var(--profile-emphasis); }
.cc-profile__icon-button:disabled { cursor: not-allowed; opacity: .35; }
.cc-profile__icon-button svg { width: 15px; height: 15px; }
.cc-profile__add-field { grid-template-columns: minmax(160px, 1fr) minmax(120px, .7fr) auto; margin-top: 12px; border-top: 1px dashed var(--profile-rule); padding-top: 12px; }
.cc-profile__structure-empty,
.cc-profile__empty-fields { margin: 0; padding: 12px; color: var(--cc-ink-soft, #52605a); font-size: 12px; }
.cc-profile__structure-empty { display: grid; gap: 4px; border: 1px dashed var(--profile-rule); }
.cc-profile__structure-empty strong { color: var(--cc-ink, #17211d); }

.cc-profile__archive-manager {
  margin-top: 18px;
  border-top: 1px solid var(--profile-rule);
  padding-top: 16px;
  scroll-margin-top: 112px;
}

.cc-profile__archive-manager > header,
.cc-profile__archive-grid > section > header,
.cc-profile__archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cc-profile__archive-manager > header h5 {
  margin: 0;
  color: var(--cc-ink, #17211d);
  font-size: 14px;
  letter-spacing: 0;
}

.cc-profile__archive-manager > header p {
  margin: 4px 0 0;
  color: var(--cc-ink-soft, #52605a);
  font-size: 12px;
  line-height: 1.5;
}

.cc-profile__archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 12px;
}

.cc-profile__archive-grid > section {
  min-width: 0;
  border: 1px solid var(--profile-rule);
  background: var(--cc-surface, #fff);
}

.cc-profile__archive-grid > section > header {
  min-height: 42px;
  border-bottom: 1px solid var(--profile-rule);
  padding: 9px 11px;
}

.cc-profile__archive-grid > section > header strong {
  color: var(--cc-ink, #17211d);
  font-size: 12px;
}

.cc-profile__archive-grid > section > header span {
  color: var(--profile-emphasis);
  font-family: var(--cc-font-mono, monospace);
  font-size: 11px;
}

.cc-profile__archive-item {
  align-items: flex-start;
  min-width: 0;
  padding: 11px;
}

.cc-profile__archive-item + .cc-profile__archive-item {
  border-top: 1px solid var(--profile-rule);
}

.cc-profile__archive-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.cc-profile__archive-copy strong {
  overflow-wrap: anywhere;
  color: var(--cc-ink, #17211d);
  font-size: 13px;
}

.cc-profile__archive-copy span,
.cc-profile__archive-copy small {
  overflow-wrap: anywhere;
  color: var(--cc-ink-soft, #52605a);
  font-size: 11px;
  line-height: 1.45;
}

.cc-profile__archive-copy small {
  color: var(--cc-ink-faint, #7b8781);
}

.cc-profile__archive-item .hud-button {
  flex: 0 0 auto;
  min-height: 36px;
}

.cc-profile__archive-empty {
  margin: 0;
  padding: 16px 11px;
  color: var(--cc-ink-faint, #7b8781);
  font-size: 12px;
}

.cc-profile__saved-at {
  min-width: 180px;
  text-align: right;
}

.cc-profile__saved-at strong {
  display: block;
  margin-top: 6px;
  color: var(--cc-ink-soft, #52605a);
  font-family: var(--cc-font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
}

.cc-profile__vault-notice {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 18px 0;
  border: 1px solid var(--cc-warning, #946100);
  border-radius: 8px;
  background: var(--cc-warning-soft, #fbf1d9);
  padding: 13px 14px;
  color: var(--cc-ink, #17211d);
}

.cc-profile__vault-notice[hidden] {
  display: none;
}

.cc-profile__vault-notice > svg {
  width: 20px;
  height: 20px;
  color: var(--cc-warning, #946100);
}

.cc-profile__vault-notice strong {
  font-size: 13px;
}

.cc-profile__vault-notice p {
  margin: 3px 0 0;
  color: var(--cc-ink-soft, #52605a);
  font-size: 12px;
  line-height: 1.55;
}

.cc-profile__form {
  display: grid;
  gap: 10px;
}

.cc-profile__group {
  border: 1px solid var(--profile-rule);
  border-radius: 6px;
  background: var(--cc-surface, #fff);
}

.cc-profile__group > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 58px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.cc-profile__group > summary::-webkit-details-marker {
  display: none;
}

.cc-profile__group > summary::before {
  content: "+";
  grid-column: 2;
  grid-row: 1;
  width: 22px;
  color: var(--cc-ink-faint, #7b8781);
  font-size: 20px;
  line-height: 1;
  text-align: right;
}

.cc-profile__group[open] > summary::before {
  content: "−";
}

.cc-profile__group > summary > span:first-child {
  grid-column: 1;
  grid-row: 1;
}

.cc-profile__group > summary strong,
.cc-profile__group > summary small {
  display: block;
}

.cc-profile__group > summary strong {
  color: var(--cc-ink, #17211d);
  font-size: 14px;
}

.cc-profile__group > summary small {
  margin-top: 3px;
  color: var(--cc-ink-faint, #7b8781);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
}

.cc-profile__group-count {
  grid-column: 2;
  grid-row: 1;
  margin-right: 30px;
  color: var(--cc-ink-soft, #52605a);
  font-family: var(--cc-font-mono, monospace);
  font-size: 11px;
}

.cc-profile__fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 16px;
  border-top: 1px solid var(--profile-rule);
  background: var(--profile-muted);
  padding: 16px;
}

.cc-profile__field {
  position: relative;
  display: grid;
  flex: 0 1 auto;
  box-sizing: border-box;
  width: calc(50% - 8px);
  min-width: 240px;
  max-width: 100%;
  min-height: 78px;
  grid-template-rows: auto minmax(38px, 1fr);
  gap: 6px;
  --profile-field-handle-size: 18px;
}

.cc-profile__resize-handle {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 4;
  width: var(--profile-field-handle-size);
  height: var(--profile-field-handle-size);
  border-right: 2px solid color-mix(in srgb, var(--profile-emphasis) 72%, transparent);
  border-bottom: 2px solid color-mix(in srgb, var(--profile-emphasis) 72%, transparent);
  border-radius: 0 0 4px 0;
  cursor: nwse-resize;
  pointer-events: auto;
  background: linear-gradient(135deg, transparent 48%, color-mix(in srgb, var(--profile-emphasis) 18%, transparent) 49%, transparent 58%);
}

.cc-profile__resize-handle:hover,
.cc-profile__field:focus-within .cc-profile__resize-handle {
  border-color: var(--profile-emphasis);
  background: linear-gradient(135deg, transparent 42%, color-mix(in srgb, var(--profile-emphasis) 30%, transparent) 43%, transparent 60%);
}

.cc-profile__field--custom-inline {
  border: 1px dashed color-mix(in srgb, var(--profile-emphasis) 45%, var(--profile-rule));
  border-radius: 6px;
  background: color-mix(in srgb, var(--profile-emphasis) 6%, var(--cc-surface, #fff));
  padding: 10px;
}

.cc-profile__field--custom-inline label {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.cc-profile__inline-field-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cc-profile__inline-field-actions .mini-action {
  min-height: 30px;
}

.cc-profile__inline-field-actions .mini-action.danger {
  border-color: color-mix(in srgb, var(--cc-danger, #ae3e4b) 45%, var(--profile-rule));
  color: var(--cc-danger, #ae3e4b);
}

.cc-profile__field > span {
  color: var(--cc-ink-soft, #52605a);
  font-size: 12px;
  font-weight: 600;
}

.cc-profile__field input,
.cc-profile__field textarea,
.cc-profile__group-add-field input,
.cc-profile__group-add-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--cc-line-strong, #bac6c0);
  border-radius: 5px;
  background: var(--cc-surface, #fff);
  padding: 9px 10px;
  color: var(--cc-ink, #17211d);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.cc-profile__field input {
  min-height: 38px;
}

@media (min-width: 761px) {
  .cc-profile__field {
    min-width: 240px;
    max-width: 100%;
    resize: both;
    overflow: auto;
    align-content: start;
  }

  .cc-profile__field input,
  .cc-profile__field textarea {
    box-sizing: border-box;
    height: 100%;
  }
}

.cc-profile__group-add-field {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.5fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--profile-rule);
  border-left: 3px solid var(--profile-emphasis);
  border-radius: 6px;
  background: var(--cc-surface, #fff);
  padding: 12px;
}

.cc-profile__group-add-field label {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.cc-profile__group-add-field label > span {
  color: var(--cc-ink-soft, #52605a);
  font-size: 11px;
  font-weight: 650;
}

.cc-profile__group-add-field .hud-button {
  min-height: 38px;
}

.cc-profile__field textarea {
  min-height: 88px;
  line-height: 1.55;
  resize: both;
}

.cc-profile__field input:focus,
.cc-profile__field textarea:focus {
  border-color: var(--profile-emphasis);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--profile-emphasis) 20%, transparent);
  outline: none;
}

.cc-profile__actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: 4px;
  border-top: 1px solid var(--profile-rule);
  background: var(--cc-surface, #fff);
  padding: 13px 0 2px;
}

.cc-profile__actions > div {
  display: flex;
  gap: 8px;
}

.cc-profile__actions .hud-button,
.cc-profile__overview-foot .hud-button,
.cc-profile__vault-notice .mini-action {
  min-height: 38px;
  letter-spacing: 0;
}

.cc-profile__status {
  min-width: 0;
  margin: 0;
  color: var(--cc-ink-soft, #52605a);
  font-size: 12px;
  line-height: 1.5;
}

.cc-profile__status[data-kind="saved"] {
  color: var(--cc-accent-strong, #0f573f);
}

.cc-profile__status[data-kind="error"],
.cc-profile__status[data-kind="blocked-sensitive"] {
  color: var(--cc-danger, #ae3e4b);
  font-weight: 700;
}

.cc-profile[data-profile-busy="true"] {
  cursor: progress;
}

@media (max-width: 900px) {
  .cc-profile__summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cc-profile__summary-grid > div:nth-child(2) {
    border-right: 0;
  }

  .cc-profile__summary-grid > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--profile-rule);
  }
}

@media (max-width: 760px) {
  .cc-profile {
    padding-bottom: calc(var(--cc-mobile-nav-height, 64px) + 24px);
  }

  .cc-profile__editor {
    max-height: calc(100dvh - var(--cc-mobile-topbar-height, 104px) - var(--cc-mobile-tabs-height, 44px) - var(--cc-mobile-nav-height, 64px) - 24px);
  }

  .cc-profile__overview-head,
  .cc-profile__editor-head,
  .cc-profile__overview-foot,
  .cc-profile__structure-entry,
  .cc-profile__actions {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .cc-profile__all-fields-head {
    gap: 12px;
    padding: 15px 13px;
  }

  .cc-profile__view-groups {
    grid-template-columns: minmax(0, 1fr);
  }

  .cc-profile__view-group {
    padding-inline: 13px;
  }

  .cc-profile__view-group:nth-child(2n) {
    border-left: 0;
  }

  .cc-profile__view-group + .cc-profile__view-group {
    border-top: 1px solid var(--profile-rule);
  }

  .cc-profile__view-field {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }

  .cc-profile__structure-entry {
    grid-template-columns: minmax(0, 1fr);
  }

  .cc-profile__structure-entry .hud-button {
    width: 100%;
    justify-content: center;
  }

  .cc-profile__editor-tools { align-items: stretch; flex-direction: column; gap: 10px; }
  .cc-profile__structure > header,
  .cc-profile__add-section,
  .cc-profile__structure-section-meta,
  .cc-profile__add-field,
  .cc-profile__group-add-field,
  .cc-profile__structure-field { grid-template-columns: minmax(0, 1fr); }
  .cc-profile__structure > header > span { justify-self: start; }
  .cc-profile__structure .cc-profile__row-actions { justify-content: flex-start; flex-wrap: wrap; }
  body.owner-shell-v1 .cc-profile__structure .hud-button,
  body.owner-shell-v1 .cc-profile__structure .cc-profile__icon-button { min-height: 44px; }
  .cc-profile__archive-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cc-profile__structure,
  .cc-profile__archive-manager { scroll-margin-top: calc(var(--cc-mobile-topbar-height, 104px) + var(--cc-mobile-tabs-height, 44px) + 8px); }
  .cc-profile__archive-item { align-items: stretch; flex-direction: column; }
  .cc-profile__archive-item .hud-button { width: 100%; justify-content: center; }

  .cc-profile__overview-head h3,
  .cc-profile__editor-head h3 {
    font-size: 19px;
  }

  .cc-profile__completion {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    justify-items: start;
    gap: 10px;
    border-left-width: 2px;
    padding-left: 12px;
  }

  .cc-profile__completion strong {
    font-size: 24px;
  }

  .cc-profile__summary-grid,
  .cc-profile__fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .cc-profile__summary-grid > div,
  .cc-profile__summary-grid > div:first-child {
    border-right: 0;
    border-bottom: 1px solid var(--profile-rule);
    padding: 12px 0;
  }

  .cc-profile__summary-grid > div:last-child {
    border-bottom: 0;
  }

  body.owner-shell-v1 .cc-profile__overview-foot .hud-button,
  body.owner-shell-v1 .cc-profile__actions .hud-button,
  body.owner-shell-v1 .cc-profile__vault-notice .mini-action {
    height: auto;
    min-height: 44px;
  }

  .cc-profile__saved-at {
    min-width: 0;
    text-align: left;
  }

  .cc-profile__vault-notice {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .cc-profile__vault-notice .mini-action {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .cc-profile__group > summary {
    min-height: 64px;
    padding: 10px 12px;
  }

  .cc-profile__group > summary small {
    max-width: 250px;
  }

  .cc-profile__fields {
    padding: 13px 12px;
  }

  .cc-profile__field {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    resize: none;
    overflow: auto;
  }

  .cc-profile__field::after {
    display: none;
  }

  .cc-profile__actions {
    position: static;
    bottom: auto;
    padding: 10px 0;
  }

  .cc-profile__actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.cc-profile__life {
  min-width: 0;
}

.cc-profile__life-head,
.cc-profile__life-editor > header,
.cc-profile__life-event header > div,
.cc-profile__life-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cc-profile__life-head {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--profile-rule);
}

.cc-profile__life-head h3,
.cc-profile__life-editor h4 {
  margin: 3px 0 0;
}

.cc-profile__life-workbench {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  min-width: 0;
  padding-top: 18px;
}

.cc-profile__life-editor,
.cc-profile__life-browser {
  min-width: 0;
}

.cc-profile__life-editor {
  align-self: start;
  display: grid;
  gap: 13px;
  padding: 16px;
  border: 1px solid var(--profile-rule);
  border-top: 3px solid var(--profile-emphasis);
  background: var(--profile-muted);
}

.cc-profile__life-editor label,
.cc-profile__life-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--cc-muted, #64716b);
  font-size: 12px;
}

.cc-profile__life-editor input,
.cc-profile__life-editor select,
.cc-profile__life-editor textarea,
.cc-profile__life-filters input,
.cc-profile__life-filters select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

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

.cc-profile__life-status {
  min-height: 18px;
  margin: 0;
  color: var(--cc-muted, #64716b);
  font-size: 12px;
}

/* Let the filter row wrap inside the right-hand canvas card. */
.cc-profile__life-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cc-profile__life-filters label:first-child {
  grid-column: span 2;
}

.cc-profile__life-filters {
  display: grid;
  grid-template-columns: minmax(140px, 1.4fr) repeat(4, minmax(108px, 1fr));
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--profile-emphasis) 20%, var(--profile-rule));
  border-left: 3px solid var(--profile-emphasis);
  background:
    radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--profile-emphasis) 10%, transparent) 0 1px, transparent 2px),
    radial-gradient(circle at 86% 76%, color-mix(in srgb, var(--profile-emphasis) 8%, transparent) 0 1px, transparent 2px),
    color-mix(in srgb, var(--profile-muted) 78%, var(--cc-surface, #fff));
  background-size: 18px 18px, 23px 23px, auto;
}

/* The history browser is a distinct reading card, separate from the editor. */
.cc-profile__life-browser {
  position: relative;
  display: grid;
  min-height: 360px;
  max-height: 518px;
  gap: 0;
  padding: 12px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--profile-emphasis) 24%, var(--profile-rule));
  border-left: 4px solid var(--profile-emphasis);
  background:
    radial-gradient(circle at 14% 12%, color-mix(in srgb, var(--profile-emphasis) 9%, transparent) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 88%, color-mix(in srgb, var(--profile-emphasis) 7%, transparent) 0 1px, transparent 2px),
    color-mix(in srgb, var(--profile-muted) 62%, var(--cc-surface, #fff));
  background-size: 20px 20px, 26px 26px, auto;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--cc-ink, #17211c) 6%, transparent);
}

.cc-profile__life-archived-toggle {
  display: flex !important;
  align-items: center;
  gap: 7px;
  min-height: 34px;
}

.cc-profile__life-archived-toggle input {
  width: auto;
}

.cc-profile__life-timeline {
  display: grid;
  gap: 0;
  min-width: 0;
  padding: 14px 2px 4px 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  border-top: 1px solid color-mix(in srgb, var(--profile-emphasis) 18%, var(--profile-rule));
}

.cc-profile__life-event {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  min-width: 0;
}

.cc-profile__life-event::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 7px;
  border-left: 1px solid var(--profile-rule);
}

.cc-profile__life-marker {
  position: relative;
  z-index: 1;
  width: 15px;
  height: 15px;
  margin-top: 17px;
  border: 3px solid var(--cc-surface, #fff);
  background: var(--profile-emphasis);
}

.cc-profile__life-card {
  min-width: 0;
  margin-bottom: 12px;
  padding: 14px 15px;
  border: 1px solid color-mix(in srgb, var(--profile-emphasis) 18%, var(--profile-rule));
  border-left: 3px solid color-mix(in srgb, var(--profile-emphasis) 58%, var(--profile-rule));
  background: color-mix(in srgb, var(--cc-surface, #fff) 86%, var(--profile-muted));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--cc-ink, #17211c) 5%, transparent);
}

.cc-profile__life-card header {
  display: grid;
  gap: 7px;
}

.cc-profile__life-card time,
.cc-profile__life-card header span {
  color: var(--cc-muted, #64716b);
  font-size: 12px;
}

.cc-profile__life-card header span::before {
  content: "/";
  margin-right: 10px;
}

.cc-profile__life-card p {
  margin: 9px 0;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.cc-profile__life-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cc-profile__life-tags span {
  padding: 3px 7px;
  border: 1px solid var(--profile-rule);
  color: var(--cc-muted, #64716b);
  font-size: 11px;
}

.cc-profile__life-detail {
  margin-top: 11px;
  padding: 10px 11px;
  border-left: 3px solid var(--profile-emphasis);
  background: color-mix(in srgb, var(--profile-emphasis) 5%, var(--cc-surface, #fff));
}

.cc-profile__life-detail.is-reflection {
  border-left-color: #b48a45;
}

.cc-profile__life-detail span {
  display: block;
  color: var(--cc-muted, #64716b);
  font-family: var(--cc-font-mono, monospace);
  font-size: 11px;
}

.cc-profile__life-detail p {
  margin: 5px 0 0;
}

.cc-profile__life-evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cc-profile__life-evidence span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--profile-emphasis) 38%, var(--profile-rule));
  background: color-mix(in srgb, var(--profile-emphasis) 6%, var(--cc-surface, #fff));
  padding: 3px 7px;
  color: var(--profile-emphasis);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.cc-profile__life-evidence-input textarea {
  font-family: var(--cc-font-mono, monospace);
  font-size: 12px;
  line-height: 1.55;
}

.cc-profile__life-evidence-picker {
  min-width: 0;
  border: 1px solid var(--profile-rule);
  background: var(--cc-surface, #fff);
}

.cc-profile__life-evidence-picker > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
  padding: 0 11px;
  cursor: pointer;
  color: var(--cc-muted, #64716b);
  font-size: 12px;
  list-style: none;
}

.cc-profile__life-evidence-picker > summary::-webkit-details-marker {
  display: none;
}

.cc-profile__life-evidence-picker > summary::after {
  content: "+";
  margin-left: auto;
  color: var(--profile-emphasis);
  font-family: var(--cc-font-mono, monospace);
  font-size: 16px;
}

.cc-profile__life-evidence-picker[open] > summary::after {
  content: "-";
}

.cc-profile__life-evidence-picker > summary span {
  display: inline-grid;
  min-width: 20px;
  min-height: 20px;
  place-items: center;
  margin-left: 4px;
  border: 1px solid color-mix(in srgb, var(--profile-emphasis) 35%, var(--profile-rule));
  color: var(--profile-emphasis);
  font-family: var(--cc-font-mono, monospace);
}

.cc-profile__life-evidence-options {
  display: grid;
  gap: 6px;
  max-height: 236px;
  overflow: auto;
  padding: 0 9px 9px;
  border-top: 1px solid var(--profile-rule);
}

.cc-profile__life-evidence-option {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid transparent;
  background: var(--profile-muted);
  cursor: pointer;
}

.cc-profile__life-evidence-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--profile-emphasis) 48%, var(--profile-rule));
  background: color-mix(in srgb, var(--profile-emphasis) 7%, var(--cc-surface, #fff));
}

.cc-profile__life-evidence-option input {
  width: auto;
  margin: 0;
}

.cc-profile__life-evidence-option span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.cc-profile__life-evidence-option strong,
.cc-profile__life-evidence-option small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cc-profile__life-evidence-option strong {
  color: var(--cc-ink, #17211c);
  font-size: 12px;
}

.cc-profile__life-evidence-option small,
.cc-profile__life-evidence-option em,
.cc-profile__life-evidence-empty,
.cc-profile__life-evidence-error {
  color: var(--cc-muted, #64716b);
  font-size: 11px;
}

.cc-profile__life-evidence-option em {
  font-style: normal;
}

.cc-profile__life-evidence-empty,
.cc-profile__life-evidence-error {
  margin: 4px 0;
  line-height: 1.5;
}

.cc-profile__life-evidence-error {
  padding: 0 10px 9px;
  color: #b04a31;
}

.cc-profile__life-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.cc-profile__life-event.is-archived {
  opacity: 0.68;
}

.cc-profile__life-empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 28px 18px;
  border: 1px dashed color-mix(in srgb, var(--profile-emphasis) 35%, var(--profile-rule));
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--profile-emphasis) 12%, transparent) 0 2px, transparent 3px),
    color-mix(in srgb, var(--profile-muted) 68%, var(--cc-surface, #fff));
  background-size: 22px 22px, auto;
  color: var(--cc-muted, #64716b);
  text-align: center;
}

.cc-profile__life-empty::before {
  content: "✦";
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--profile-emphasis) 45%, var(--profile-rule));
  color: var(--profile-emphasis);
  font-size: 16px;
}

/* Keep the right-hand history card contained when canvas utilities are layered on top. */
body.owner-shell-v1 .cc-profile__life-browser {
  box-sizing: border-box;
  border-left: 4px solid var(--profile-emphasis) !important;
}

body.owner-shell-v1 .cc-profile__life-filters {
  box-sizing: border-box;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
}

body.owner-shell-v1 .cc-profile__life-filters > * {
  min-width: 0;
}

/* The card title must be a real filter-grid row, not a browser grid pseudo-item. */
body.owner-shell-v1 .cc-profile__life-filters::before {
  content: "履历历史";
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  min-height: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--profile-emphasis) 22%, var(--profile-rule));
  color: var(--cc-ink, #17211c);
  font-family: var(--cc-font-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

@media (max-width: 760px) {
  .cc-profile__life-workbench {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .cc-profile__life-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cc-profile__life-browser {
    min-height: 300px;
    max-height: none;
  }

  .cc-profile__life-form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .cc-profile__life-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cc-profile__life-actions .mini-action {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .cc-profile__group > summary {
    grid-template-columns: minmax(0, 1fr) 28px;
    gap: 8px;
  }

  .cc-profile__group-count {
    grid-column: 1;
    grid-row: 2;
    margin-right: 0;
    justify-self: start;
  }

  .cc-profile__inline-field-actions,
  .cc-profile__actions > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .cc-profile__inline-field-actions .mini-action,
  .cc-profile__actions .hud-button,
  .cc-profile__structure-entry .hud-button {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-profile__field input,
  .cc-profile__field textarea {
    transition: none;
  }
}

/* Formal r6 module finish: one dense profile ledger, without nested cards. */
html[data-theme="day"] body.owner-shell-v1:not(.auth-required) .cc-profile {
  --profile-rule: #c8d3cf;
  --profile-muted: #f1f4ec;
  --profile-emphasis: #246c69;
}

html[data-theme="night"] body.owner-shell-v1:not(.auth-required) .cc-profile {
  --profile-rule: #29434a;
  --profile-muted: #102a32;
  --profile-emphasis: #7dc8bc;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) .cc-profile > .panel,
html[data-theme="night"] body.owner-shell-v1:not(.auth-required) .cc-profile > .panel {
  border-radius: 4px;
  box-shadow: none;
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) .cc-profile > .panel {
  border: 1px solid #c6d1cd;
  border-top: 3px solid var(--profile-emphasis);
  background:
    linear-gradient(112deg, rgb(36 108 105 / 5%), transparent 42%),
    rgb(251 250 244 / 96%);
}

html[data-theme="night"] body.owner-shell-v1:not(.auth-required) .cc-profile > .panel {
  border: 1px solid rgb(126 196 189 / 22%);
  border-top: 2px solid var(--profile-emphasis);
  border-left: 2px solid #d4ad67;
  background:
    repeating-linear-gradient(90deg, transparent 0 71px, rgb(126 196 189 / 2.5%) 71px 72px),
    rgb(10 29 36 / 92%);
  box-shadow: 0 16px 34px rgb(0 5 8 / 18%);
}

html[data-theme="day"] body.owner-shell-v1:not(.auth-required) .cc-profile > .cc-profile__overview,
html[data-theme="night"] body.owner-shell-v1:not(.auth-required) .cc-profile > .cc-profile__overview {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

html[data-theme="day"] body.owner-shell-v1 .cc-profile__overview-canvas [data-module-canvas-block] {
  background: rgb(251 250 244 / 96%);
  box-shadow: 0 10px 24px rgb(30 56 51 / 9%);
}

html[data-theme="night"] body.owner-shell-v1 .cc-profile__overview-canvas [data-module-canvas-block] {
  border-color: rgb(126 196 189 / 22%);
  background: rgb(10 29 36 / 92%);
  box-shadow: 0 16px 34px rgb(0 5 8 / 18%);
}

body.owner-shell-v1 .cc-profile__overview-head h3 {
  font-family: var(--formal-serif, "Noto Serif SC", "Songti SC", SimSun, serif);
  font-size: 20px;
  font-weight: 650;
}

body.owner-shell-v1 .cc-profile__editor-head h3 {
  font-size: 18px;
}

body.owner-shell-v1 .cc-profile__eyebrow,
body.owner-shell-v1 .cc-profile__completion span,
body.owner-shell-v1 .cc-profile__saved-at strong,
body.owner-shell-v1 .cc-profile__structure > header > span,
body.owner-shell-v1 .cc-profile__archive-grid > section > header span {
  font-family: var(--formal-mono, "Cascadia Mono", Consolas, monospace);
  font-variant-numeric: tabular-nums;
}

body.owner-shell-v1 .cc-profile__summary-grid {
  margin-top: 18px;
}

body.owner-shell-v1 .cc-profile__summary-grid[data-module-canvas-block] {
  margin: 0;
}

body.owner-shell-v1 .cc-profile__summary-grid > div {
  min-height: 68px;
  padding-block: 12px;
}

body.owner-shell-v1 .cc-profile__structure-entry {
  margin-top: 16px;
  padding: 13px 14px;
  border: 0;
  border-block: 1px solid var(--profile-rule);
  border-left: 3px solid var(--profile-emphasis);
  border-radius: 0;
  background: color-mix(in srgb, var(--profile-emphasis) 5%, transparent);
}

body.owner-shell-v1 .cc-profile__structure-entry[data-module-canvas-block] {
  margin: 0;
  padding: 17px 18px;
  border: 1px solid var(--profile-rule);
  border-left: 3px solid var(--profile-emphasis);
  border-radius: 4px;
  background: color-mix(in srgb, var(--profile-emphasis) 5%, var(--cc-surface, #fff));
}

body.owner-shell-v1 .cc-profile__vault-notice,
body.owner-shell-v1 .cc-profile__group,
body.owner-shell-v1 .cc-profile__field--custom-inline,
body.owner-shell-v1 .cc-profile__group-add-field {
  border-radius: 4px;
}

body.owner-shell-v1 .cc-profile__field--custom-inline {
  border: 0;
  border-left: 3px solid color-mix(in srgb, var(--profile-emphasis) 62%, var(--profile-rule));
  background: color-mix(in srgb, var(--profile-emphasis) 5%, transparent);
}

body.owner-shell-v1 .cc-profile__structure-section,
body.owner-shell-v1 .cc-profile__archive-grid > section {
  border-radius: 0;
  background: color-mix(in srgb, var(--cc-surface, #fff) 84%, transparent);
}

html[data-theme="night"] body.owner-shell-v1 .cc-profile__actions {
  background: rgb(10 29 36 / 96%);
}

@media (max-width: 760px) {
  .cc-profile__overview-canvas {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  body.owner-shell-v1 .cc-profile__overview-canvas [data-module-canvas-block] {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 14px 13px;
    overflow: visible;
  }

  body.owner-shell-v1 .cc-profile__overview-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    align-items: start;
    gap: 12px;
  }

  body.owner-shell-v1 .cc-profile__overview-head h3,
  body.owner-shell-v1 .cc-profile__editor-head h3 {
    font-size: 18px;
  }

  body.owner-shell-v1 .cc-profile__completion {
    width: 84px;
    min-width: 84px;
    min-height: 58px;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    justify-items: end;
    gap: 4px;
    padding-left: 10px;
  }

  body.owner-shell-v1 .cc-profile__completion strong {
    font-size: 23px;
  }

  body.owner-shell-v1 .cc-profile__completion span {
    margin-top: 0;
    font-size: 10px;
  }

  body.owner-shell-v1 .cc-profile__summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
  }

  body.owner-shell-v1 .cc-profile__summary-grid > div,
  body.owner-shell-v1 .cc-profile__summary-grid > div:first-child {
    min-height: 62px;
    padding: 10px 8px;
    border-right: 1px solid var(--profile-rule);
    border-bottom: 1px solid var(--profile-rule);
  }

  body.owner-shell-v1 .cc-profile__summary-grid > div:nth-child(2n) {
    border-right: 0;
  }

  body.owner-shell-v1 .cc-profile__summary-grid > div:nth-child(n + 3) {
    border-bottom: 0;
  }

  body.owner-shell-v1 .cc-profile__summary-grid strong {
    font-size: 13px;
  }

  body.owner-shell-v1 .cc-profile__structure-entry {
    gap: 11px;
    margin-top: 14px;
    padding: 12px 10px;
  }

  body.owner-shell-v1 .cc-profile__overview-foot {
    gap: 11px;
    margin-top: 14px;
  }

  body.owner-shell-v1 .cc-profile__summary-grid[data-module-canvas-block] {
    margin: 0;
    padding: 0;
  }

  body.owner-shell-v1 .cc-profile__structure-entry[data-module-canvas-block],
  body.owner-shell-v1 .cc-profile__overview-foot[data-module-canvas-block] {
    margin: 0;
  }
}

@media (max-width: 390px) {
  body.owner-shell-v1 .cc-profile__overview-head {
    grid-template-columns: minmax(0, 1fr) 76px;
    gap: 9px;
  }

  body.owner-shell-v1 .cc-profile__completion {
    width: 76px;
    min-width: 76px;
    padding-left: 8px;
  }
}

/* Keep the custom-section creator compact and distinct from the archive area. */
.cc-profile__add-section[data-profile-add-section-layout="compact"] {
  display: grid;
  grid-template-columns: minmax(190px, .9fr) minmax(240px, 1.35fr) auto;
  gap: 14px;
  align-items: end;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--profile-rule);
  border-left: 3px solid var(--profile-emphasis);
  border-radius: 4px;
  background: color-mix(in srgb, var(--profile-emphasis) 5%, var(--cc-surface, #fff));
}

.cc-profile__add-section[data-profile-add-section-layout="compact"] label {
  gap: 6px;
}

.cc-profile__add-section[data-profile-add-section-layout="compact"] input {
  min-height: 42px;
}

.cc-profile__add-section[data-profile-add-section-layout="compact"] .hud-button {
  min-height: 42px;
  padding-inline: 14px;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .cc-profile__add-section[data-profile-add-section-layout="compact"] {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .cc-profile__add-section[data-profile-add-section-layout="compact"] .hud-button {
    width: 100%;
  }
}
