.phone-cover {
  background-image: var(--phone-cover-image);
  background-position: center;
  background-size: cover;
}

.phone-cover::before,
.phone-cover::after {
  display: none;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.gallery-image-card,
.gallery-add-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfc;
}

.gallery-image-card img {
  display: block;
  width: 100%;
  height: 74px;
  object-fit: cover;
}

.gallery-image-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 7px 8px;
}

.gallery-image-meta strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 8px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-gallery {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--soft-muted);
  font-size: 14px;
  line-height: 1;
}

.remove-gallery:hover {
  color: #b44b55;
  background: #fff0f0;
}

.gallery-add-card {
  min-height: 104px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--accent-dark);
  cursor: pointer;
  text-align: center;
}

.gallery-add-card:hover {
  border-color: #9ed8d4;
  background: #f4fbfa;
}

.gallery-add-card strong {
  font-size: 9px;
}

.gallery-add-card small {
  color: var(--muted);
  font-size: 7px;
}

.gallery-add-card input,
.upload-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.gallery-add-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #9ed8d4;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 400;
}

.media-settings-section {
  padding-bottom: 21px;
}

.media-editor-card {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fbfcfc;
}

.media-editor-card-avatar {
  grid-template-columns: 70px minmax(0, 1fr);
}

.media-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  background-position: center;
  background-size: cover;
}

.media-preview-banner {
  height: 72px;
  border-radius: 7px;
}

.media-preview-avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
}

.media-preview-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-editor-copy {
  min-width: 0;
}

.media-editor-copy strong,
.media-editor-copy small {
  display: block;
}

.media-editor-copy strong {
  color: var(--ink);
  font-size: 10px;
}

.media-editor-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
}

.upload-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid #9ed8d4;
  border-radius: 7px;
  color: var(--accent-dark);
  background: #eff9f7;
  cursor: pointer;
  font-size: 8px;
  font-weight: 800;
}

.upload-button:hover {
  background: #e1f5f1;
}

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

  .media-editor-card,
  .media-editor-card-avatar {
    grid-template-columns: 1fr;
  }

  .media-preview-banner {
    height: 90px;
  }
}

/* Workspace pages */
.page-shell {
  padding: 4px 0 34px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin: 6px 0 22px;
}

.page-header h2 {
  margin: 7px 0 0;
  color: var(--ink);
  font-size: 26px;
  letter-spacing: -.7px;
}

.page-header p {
  max-width: 560px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.page-actions,
.settings-actions,
.device-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.page-card {
  min-width: 0;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 15px;
}

.stat-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 7px 18px rgba(29, 58, 76, .04);
}

.stat-card > span,
.stat-card > small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.stat-card strong {
  display: block;
  margin: 9px 0 7px;
  color: var(--ink);
  font-size: 25px;
  letter-spacing: -.7px;
}

.stat-card small em {
  font-style: normal;
  color: var(--muted);
}

.trend-up {
  color: #2d9b7e !important;
  font-weight: 800;
}

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .9fr);
  gap: 15px;
  margin-bottom: 15px;
}

.analytics-grid .page-card {
  min-height: 300px;
}

.chart-card {
  overflow: hidden;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.card-heading h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.card-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.muted-pill,
.live-dot {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef8f6;
  color: #368f7c;
  font-size: 9px;
  font-weight: 800;
}

.range-switch,
.filter-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f7fafb;
}

.range-switch button,
.filter-tabs button {
  border: 0;
  border-radius: 7px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}

.range-switch button.active,
.filter-tabs button.active {
  background: #fff;
  color: var(--accent-dark);
  box-shadow: 0 2px 7px rgba(25, 57, 74, .08);
  font-weight: 800;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  height: 210px;
  padding: 22px 7px 0;
  border-bottom: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 51px, #edf3f4 52px);
}

.bar-column {
  display: flex;
  align-items: center;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-width: 20px;
  gap: 6px;
}

.bar-column small,
.bar-value {
  color: var(--muted);
  font-size: 9px;
}

.bar-value {
  opacity: 0;
  transition: opacity .2s ease;
}

.bar-column:hover .bar-value {
  opacity: 1;
}

.chart-bar {
  width: min(28px, 72%);
  min-height: 10px;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, var(--accent), #a6ded8);
}

.rank-list,
.activity-list {
  display: grid;
  gap: 7px;
}

.rank-row,
.activity-list > div {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid #eef3f4;
  background: transparent;
  text-align: left;
}

.rank-row:last-child,
.activity-list > div:last-child {
  border-bottom: 0;
}

.rank-row {
  cursor: pointer;
}

.rank-row:hover {
  color: var(--accent-dark);
}

.rank-row .profile-thumb {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
}

.rank-number {
  width: 18px;
  color: #9aacb6;
  font-size: 10px;
  font-weight: 800;
}

.rank-row span:not(.rank-number):not(.profile-thumb),
.activity-list p {
  min-width: 0;
  flex: 1;
}

.rank-row strong,
.rank-row small,
.activity-list strong,
.activity-list small {
  display: block;
}

.rank-row strong,
.activity-list strong {
  color: var(--ink);
  font-size: 10px;
}

.rank-row small,
.activity-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row b,
.activity-list b {
  color: var(--accent-dark);
  font-size: 10px;
}

.activity-card {
  margin-bottom: 15px;
}

.activity-icon,
.device-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 11px;
  background: #e8f5f3;
  color: var(--accent-dark);
  font-weight: 800;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.page-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(100%, 360px);
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--soft-muted);
}

.page-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
}

.table-card {
  padding: 0;
  overflow-x: auto;
}

.data-table-head,
.data-row,
.team-table-head,
.team-row {
  display: grid;
  grid-template-columns: minmax(185px, 1.25fr) minmax(130px, 1fr) minmax(100px, .7fr) minmax(165px, 1fr) 70px;
  align-items: center;
  gap: 16px;
  min-width: 760px;
  padding: 14px 20px;
}

.data-table-head,
.team-table-head {
  border-bottom: 1px solid var(--line);
  color: #8b9ca7;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.data-row,
.team-row {
  min-height: 70px;
  border-bottom: 1px solid #eef3f4;
  color: #546d80;
  font-size: 10px;
}

.data-row:last-child,
.team-row:last-child {
  border-bottom: 0;
}

.person-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.person-cell > span:last-child {
  min-width: 0;
}

.person-cell strong,
.person-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-cell strong {
  color: var(--ink);
  font-size: 11px;
}

.person-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.contact-cell small {
  display: block;
  margin: 3px 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #eef7f4;
  color: #348b78;
  font-size: 9px;
  font-weight: 800;
}

.status-chip::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-chip.draft,
.status-chip.invited,
.status-chip.available {
  background: #fff7e9;
  color: #a9761e;
}

.status-chip.disconnected {
  background: #f3f5f6;
  color: #81909a;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.icon-button {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #6b8190;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

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

.device-card {
  position: relative;
}

.device-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.device-card h3 {
  margin: 17px 0 5px;
  color: var(--ink);
  font-size: 15px;
}

.device-card > p {
  margin: 0 0 19px;
  color: var(--muted);
  font-size: 10px;
}

.device-card .control {
  margin-bottom: 16px;
}

.device-card .control select {
  width: 100%;
}

.device-meta {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid #eef3f4;
  color: var(--muted);
  font-size: 9px;
}

.device-meta b {
  color: var(--ink);
}

.device-actions {
  justify-content: flex-end;
}

.compact-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.member-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 36px;
  border-radius: 50%;
  background: #dceff0;
  color: #277175;
  font-size: 11px;
  font-weight: 800;
}

.team-table-head,
.team-row {
  grid-template-columns: minmax(230px, 1.4fr) minmax(110px, .7fr) minmax(100px, .6fr) minmax(145px, 1fr) 40px;
}

.team-row select,
.settings-card select {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 10px;
}

.muted-text {
  color: var(--muted);
  font-size: 9px;
}

.settings-card {
  display: grid;
  align-content: start;
  gap: 17px;
}

.settings-card .card-heading {
  margin-bottom: 3px;
}

.settings-card .control {
  gap: 7px;
}

.settings-card .control input[type="text"] {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 10px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-top: 4px;
}

.toggle-row span {
  min-width: 0;
}

.toggle-row strong,
.toggle-row small {
  display: block;
}

.toggle-row strong {
  color: var(--ink);
  font-size: 10px;
}

.toggle-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.toggle-row input {
  width: 40px;
  height: 22px;
  accent-color: var(--accent);
}

.settings-save-state {
  color: var(--muted);
  font-size: 10px;
}

.settings-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.empty-state {
  padding: 42px 20px;
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 14px;
}

.empty-state p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
}

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

  .page-grid,
  .device-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions > * {
    flex: 0 0 auto;
  }
}

@media (max-width: 560px) {
  .page-shell {
    padding-bottom: 20px;
  }

  .page-header h2 {
    font-size: 22px;
  }

  .page-header p {
    font-size: 11px;
  }

  .page-actions,
  .page-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions > *,
  .page-toolbar .filter-tabs,
  .page-search {
    width: 100%;
  }

  .page-actions > button {
    width: 100%;
  }

  .range-switch,
  .filter-tabs {
    width: 100%;
  }

  .range-switch button,
  .filter-tabs button {
    flex: 1;
  }

  .stat-grid,
  .compact-stats {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 15px;
  }

  .bar-chart {
    gap: 4px;
  }

  .page-card {
    padding: 16px;
  }

  .settings-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .settings-actions > button {
    width: 100%;
  }
}

.social-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.social-link-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  background: #fbfcfc;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
}

.social-row-icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  color: var(--accent-dark);
  background: #e8f5f3;
  border-radius: 8px;
}

.social-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.social-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.social-link-copy {
  min-width: 0;
}

.social-link-copy strong,
.social-link-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-link-copy strong {
  color: var(--ink);
  font-size: 10px;
}

.social-link-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.social-row-platform {
  color: var(--soft-muted);
  font-size: 8px;
  white-space: nowrap;
}

.remove-social {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #9aa8b6;
  font-size: 16px;
  line-height: 1;
}

.remove-social:hover {
  color: #b44b55;
  background: #fff0f0;
}

.social-add-form .control-grid {
  grid-template-columns: 1fr 1fr;
}

.social-url-control {
  grid-column: 1 / -1;
}

.social-add-button {
  margin-top: 14px;
}

.phone-social-item {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #eef3f4;
  color: #536c80;
}

.phone-social-item .social-icon {
  width: 12px;
  height: 12px;
}

@media (max-width: 560px) {
  .social-link-row {
    grid-template-columns: 34px minmax(0, 1fr) 24px;
  }

  .social-row-platform {
    display: none;
  }

  .social-add-form .control-grid {
    grid-template-columns: 1fr;
  }

  .social-url-control {
    grid-column: auto;
  }
}

:root {
  --preview-bg: #ffffff;
  --preview-ink: #10243e;
  --preview-muted: #67798c;
  --preview-accent: var(--accent);
  --preview-secondary: #eff3f4;
  --preview-cover: #d8efec;
  --preview-frame: #14243a;
  --preview-button-text: #ffffff;
}

/* Keep every editor control writable and touch-friendly on real phones. */
.editor-panel input,
.editor-panel textarea,
.editor-panel select,
.modal-card input,
.modal-card textarea,
.modal-card select {
  pointer-events: auto;
  user-select: text;
  touch-action: manipulation;
  caret-color: var(--accent);
}

.editor-panel input:focus,
.editor-panel textarea:focus,
.editor-panel select:focus,
.modal-card input:focus,
.modal-card textarea:focus,
.modal-card select:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 1px;
}

html[data-theme="ivory"] {
  --preview-bg: #fffaf1;
  --preview-ink: #392f2a;
  --preview-muted: #7d7066;
  --preview-accent: #b66e43;
  --preview-secondary: #f3e9dc;
  --preview-cover: #ead8c1;
  --preview-frame: #4a392d;
}

html[data-theme="ink"] {
  --preview-bg: #172a40;
  --preview-ink: #f7fbff;
  --preview-muted: #c1cfdd;
  --preview-accent: #63d3cb;
  --preview-secondary: #294058;
  --preview-cover: #35566d;
  --preview-frame: #0b1728;
}

html[data-theme="lilac"] {
  --preview-bg: #fcf9ff;
  --preview-ink: #302342;
  --preview-muted: #7f718f;
  --preview-accent: #8660c9;
  --preview-secondary: #efe8fb;
  --preview-cover: #ded0f5;
  --preview-frame: #35265b;
}

html[data-theme="slates"] {
  --preview-bg: #f5f8fc;
  --preview-ink: #20364e;
  --preview-muted: #6d7c8e;
  --preview-accent: #2f6eaf;
  --preview-secondary: #e6edf5;
  --preview-cover: #cbdced;
  --preview-frame: #1b3048;
}

.phone {
  background: var(--preview-frame);
}

.phone-screen {
  background: var(--preview-bg);
  color: var(--preview-ink);
}

.phone-cover {
  background-color: var(--preview-cover);
  background-blend-mode: soft-light;
}

.phone-body h2 {
  color: var(--preview-ink);
}

.phone-role {
  color: var(--preview-accent);
}

.phone-company,
.phone-bio {
  color: var(--preview-muted);
}

.phone-actions .primary {
  color: var(--preview-button-text);
  background: var(--preview-accent);
}

.phone-actions .secondary {
  color: var(--preview-ink);
  background: var(--preview-secondary);
}

.phone-actions a {
  display: block;
  border: 0;
  border-radius: 20px;
  padding: 9px 8px;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.phone-socials span {
  color: var(--preview-ink);
  background: var(--preview-secondary);
}

.phone-powered {
  color: color-mix(in srgb, var(--preview-muted) 70%, transparent);
}

.phone-powered strong {
  color: var(--preview-accent);
}

html[data-button-shape="rounded"] .phone-actions button {
  border-radius: 14px;
}

html[data-button-shape="pill"] .phone-actions button {
  border-radius: 999px;
}

html[data-button-shape="square"] .phone-actions button {
  border-radius: 5px;
}

html[data-font="modern"] .phone-screen {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-font="editorial"] .phone-screen {
  font-family: Georgia, "Times New Roman", serif;
}

html[data-font="classic"] .phone-screen {
  font-family: "Trebuchet MS", Arial, sans-serif;
}

/* Local lifecycle and public-card surfaces */
.profile-status.archived,
.profile-status.disabled {
  color: #9a5f4d;
  background: #fff0eb;
}

.profile-action-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 8px;
}

.profile-action-list button {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #dbe5e8;
  border-radius: 12px;
  background: #fff;
  color: #1d334a;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.profile-action-list button:hover {
  border-color: var(--accent);
  background: #f5fbfa;
}

.profile-action-list .danger-action {
  color: #a14842;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(17, 31, 46, 0.32);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(100%, 480px);
  padding: 30px;
  border: 1px solid #e1eaec;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(18, 39, 56, 0.2);
}

.modal-card h2 {
  margin: 6px 0 8px;
  color: #172f46;
}

.modal-card > p {
  margin: 0;
  color: #6c8091;
  line-height: 1.55;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f6;
  color: #5c7180;
  font-size: 22px;
  cursor: pointer;
}

.modal-form {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.featured-links-editor {
  display: grid;
  gap: 10px;
}

.link-row {
  grid-template-columns: 28px minmax(120px, 1fr) minmax(130px, 1fr) 28px;
}

.link-row input {
  min-width: 0;
}

.public-shell {
  min-height: 100vh;
  padding: 30px 20px 60px;
  background: linear-gradient(145deg, #eef7f6 0%, #f7f9fb 52%, #f3effa 100%);
}

.public-topbar {
  width: min(100%, 560px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto 18px;
}

.public-back {
  color: #35546b;
}

.public-badge {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #587082;
  font-size: 12px;
  font-weight: 700;
}

.public-card {
  width: min(100%, 560px);
  overflow: hidden;
  margin: 0 auto;
  border: 1px solid rgba(210, 225, 228, 0.9);
  border-radius: 28px;
  background: var(--preview-bg);
  color: var(--preview-ink);
  box-shadow: 0 25px 70px rgba(32, 59, 77, 0.13);
}

.public-cover {
  min-height: 190px;
  background-color: var(--preview-cover);
  background-position: center;
  background-size: cover;
}

.public-card-body {
  position: relative;
  padding: 0 34px 34px;
  text-align: center;
}

.public-avatar {
  display: grid;
  width: 104px;
  height: 104px;
  margin: -52px auto 18px;
  border: 6px solid var(--preview-bg);
  border-radius: 50%;
  overflow: hidden;
  place-items: center;
  background: #dcecec;
  color: #2c6c70;
  font-size: 26px;
  font-weight: 800;
}

.public-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-card h1 {
  margin: 0;
  color: var(--preview-ink);
  font-size: clamp(28px, 6vw, 40px);
  letter-spacing: -0.04em;
}

.public-role {
  margin: 8px 0 0;
  color: var(--preview-accent);
  font-weight: 700;
}

.public-bio {
  max-width: 430px;
  margin: 18px auto 0;
  color: var(--preview-muted);
  line-height: 1.65;
}

.public-actions {
  display: grid;
  gap: 10px;
  margin: 26px auto 0;
}

.public-actions a {
  display: block;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}

.public-actions .primary {
  color: #fff;
  background: var(--preview-accent);
}

.public-actions .secondary {
  color: var(--preview-ink);
  background: var(--preview-secondary);
}

.public-socials {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 24px;
}

.public-socials a {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--preview-secondary);
  color: var(--preview-ink);
}

.public-socials .social-icon {
  width: 18px;
  height: 18px;
}

.public-contact {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  color: var(--preview-muted);
  font-size: 13px;
}

.public-disabled-message {
  padding: 20px 0 28px;
}

.public-disabled-message h1 {
  margin-top: 10px;
  font-size: 30px;
}

.public-disabled-message p {
  margin: 12px auto 0;
  max-width: 360px;
  color: var(--preview-muted);
  line-height: 1.6;
}

@media (max-width: 680px) {
  .modal-card {
    padding: 24px 20px;
  }

  .link-row {
    grid-template-columns: 24px minmax(0, 1fr) 28px;
  }

  .link-row input:nth-of-type(2) {
    grid-column: 2 / 3;
  }

  .public-shell {
    padding: 18px 12px 40px;
  }

  .public-card-body {
    padding: 0 22px 26px;
  }
}

@media (max-width: 820px) {
  .workspace {
    width: 100%;
    overflow-x: hidden;
  }

  .profile-library,
  .section-menu {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .section-menu button,
  .profile-card,
  .add-profile,
  .copy-button,
  .more-button,
  .mode-switch button,
  .outline-button,
  .primary-button,
  .text-button,
  .add-link,
  .social-add-button,
  .upload-button {
    min-height: 42px;
  }

  .section-menu button {
    padding: 11px 13px;
  }

  .preview-footer {
    flex-wrap: wrap;
  }
}

@media (max-width: 1180px) and (min-width: 821px) {
  .profile-library {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .profile-library .profile-card,
  .profile-library .add-profile,
  .profile-library .profile-card:nth-child(n + 4) {
    display: flex !important;
    flex: 0 0 190px;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 10px;
  }

  .profile-library {
    margin-inline: -2px;
    gap: 8px;
  }

  .profile-card,
  .add-profile {
    flex-basis: 148px;
  }

  .selected-header {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .selected-identity {
    min-width: 0;
  }

  .selected-identity strong,
  .selected-identity small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
  }

  .share-control {
    grid-column: 1 / -1;
    width: 100%;
  }

  .share-control .link-value {
    min-width: 0;
    flex: 1;
  }

  .editor-panel {
    padding-inline: 13px;
  }

  .theme-row {
    overflow-x: auto;
    align-items: stretch;
    padding-bottom: 4px;
  }

  .theme-option {
    flex: 0 0 58px;
  }

  .theme-row .view-all {
    flex: 0 0 auto;
    margin-left: 0;
    padding-inline: 8px;
  }

  .link-row {
    grid-template-columns: 24px minmax(0, 1fr) 30px;
    display: grid;
  }

  .link-row input:nth-of-type(2) {
    grid-column: 2 / 3;
    grid-row: 2;
  }

  .link-row .more-button {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .editor-footer {
    gap: 10px;
  }

  .footer-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .footer-actions:has(> :only-child),
  .footer-actions:has(> :nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-actions button {
    width: 100%;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .modal-actions button {
    width: 100%;
  }

  .public-topbar {
    gap: 8px;
    align-items: flex-start;
  }

  .public-badge {
    white-space: nowrap;
  }
}

.topbar-user {
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.topbar-user:hover strong {
  color: var(--accent-dark);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at 20% 10%, #e6f4f2 0, transparent 35%), var(--page);
}

.auth-card {
  width: min(420px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 20px 55px rgba(16, 36, 62, .1);
}

.auth-card .brand-mark {
  margin-bottom: 20px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 34px;
}

.auth-brand strong,
.auth-brand small {
  display: block;
}

.auth-brand strong {
  font-size: 15px;
}

.auth-brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.auth-card h1 {
  margin: 4px 0 8px;
  font-size: 26px;
  letter-spacing: -.7px;
}

.auth-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding-block: 11px;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: .68;
}

.auth-error {
  margin: 0 !important;
  padding: 10px 11px;
  border: 1px solid #f0c8c8;
  border-radius: 8px;
  background: #fff6f6;
  color: #a33d48 !important;
  font-size: 10px !important;
}

.auth-help {
  margin-top: 18px !important;
  font-size: 9px !important;
}

.auth-card-loading {
  text-align: center;
}

.auth-card-loading .brand-mark {
  margin-inline: auto;
}
