/* Responsive behavior is kept separate from the generated Tailwind bundle. */
.mobile-cell-label {
  display: none;
}

.copy-button,
.row-actions summary,
.small-button,
.menu-button,
.dialog-close,
.public-bio-actions .button-link {
  min-height: 44px;
}

.icon-button,
.bio-link-menu > summary,
.dialog-close {
  min-width: 44px;
  width: 44px;
  height: 44px;
}

[data-bio-editor][hidden],
[data-bio-preview][hidden],
[data-bio-view-switcher][hidden],
.bio-surface-profile p[hidden] {
  display: none !important;
}

.bio-view-switcher {
  position: sticky;
  top: 16px;
  z-index: 15;
  display: flex;
  gap: 6px;
  margin-top: 24px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  scroll-margin-top: 80px;
}

.bio-view-switcher button {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}

.bio-view-switcher button[aria-pressed="true"] {
  background: var(--primary-soft);
  color: var(--primary);
}

.bio-surface-card {
  display: grid;
  width: 100%;
  min-width: 0;
  align-content: start;
  gap: 24px;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.bio-surface-profile {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.bio-surface-avatar {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: var(--secondary);
  color: white;
  font-size: 26px;
  font-weight: 800;
}

.bio-surface-profile h1,
.bio-surface-profile h3 {
  max-width: 100%;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.bio-surface-profile code {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.bio-surface-profile p {
  max-width: 100%;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.bio-surface-links {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.bio-surface-link {
  display: flex;
  min-width: 0;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--primary-soft);
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

a.bio-surface-link:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.bio-surface-empty {
  margin: 0;
  padding: 16px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.bio-surface-brand {
  justify-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.bio-visitor-content {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.bio-visitor-page .site-header {
  position: static;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
}

.bio-visitor-page .site-header .brand-logo {
  width: 104px;
  height: auto;
}

.bio-visitor-page .site-header .language-switcher {
  margin-left: auto;
}

.bio-visitor-page .site-footer {
  justify-content: center;
  padding: 16px 24px;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .bio-builder-layout {
    margin-top: 24px;
  }

  .bio-preview-panel {
    width: 100%;
    max-width: 560px;
    justify-self: center;
  }
}

@media (max-width: 1100px) {
  .link-records {
    overflow: visible;
  }

  .link-record-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .link-record-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .link-record-table tbody {
    display: grid;
    gap: 16px;
  }

  .link-record-table tbody tr {
    display: grid;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .link-record-table td {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .link-record-table .mobile-cell-label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
  }

  .link-record-short,
  .link-record-project,
  .link-record-destination,
  .link-record-actions {
    grid-column: 1 / -1;
  }

  .link-record-short { order: 1; }
  .link-record-destination { order: 2; }
  .link-record-project { order: 3; }
  .link-record-status { order: 4; }
  .link-record-clicks { order: 5; }
  .link-record-actions { order: 6; }

  .link-record-short .copy-line {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 12px;
  }

  .link-record-short code {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 14px;
  }

  .link-record-short .copy-button {
    flex-shrink: 0;
  }

  .link-record-actions .row-actions {
    min-width: 0;
  }

  .link-record-actions .row-actions summary {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    font-size: 14px;
  }

  .link-record-actions .compact-form {
    padding-top: 8px;
  }

  .link-record-actions .action-row button {
    min-height: 44px;
  }
}

@media (max-width: 900px) {
  .app-sidebar[aria-hidden="true"] {
    visibility: hidden;
  }

  /* Without JavaScript, show the navigation as ordinary content. */
  .app-shell:not(.has-nav-enhancement) .app-sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    translate: none;
    transform: none;
  }

  .app-shell:not(.has-nav-enhancement) .app-sidebar-header,
  .app-shell:not(.has-nav-enhancement) [data-app-nav-open],
  .app-shell:not(.has-nav-enhancement) .app-sidebar-backdrop {
    display: none;
  }

  .bio-view-switcher {
    top: 76px;
  }
}

@media (max-width: 640px) {
  .bio-surface-card {
    padding: 24px 20px;
  }

  .bio-visitor-content {
    padding: 16px 16px 32px;
  }

  .bio-visitor-page .site-header {
    padding: 12px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .app-sidebar,
  .app-sidebar-backdrop { transition: none; }
}
