:root {
  --uds-ink: #263746;
  --uds-accent: #006dad;
  --uds-accent-dark: #00527f;
  --uds-yellow: #ffd700;
  --uds-green: #2daa3f;
  --uds-gray: #5b5b5b;
  --uds-paper: #f5f8fa;
  --uds-surface: #ffffff;
  --uds-mint: #eaf4fa;
  --uds-muted: #5b5b5b;
  --uds-border: #d7e2ea;
  --uds-focus: #8a4b00;
  --uds-danger: #a42e25;
  --uds-danger-soft: #fff2f0;
  --uds-scrollbar: #8aaabd;
  --uds-scrollbar-hover: #567f98;
  --z-sticky: 100;
  --z-dropdown: 200;
  --z-backdrop: 500;
  --z-dialog: 600;
  --z-toast: 900;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --control-height: 46px;
  --content-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scrollbar-gutter: stable;
  scrollbar-color: var(--uds-scrollbar) var(--uds-paper);
  scrollbar-width: auto;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--uds-ink);
  background: var(--uds-paper);
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

body::-webkit-scrollbar-track,
*::-webkit-scrollbar-track {
  background: var(--uds-paper);
}

body::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-thumb {
  background: var(--uds-scrollbar);
  border: 3px solid var(--uds-paper);
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:hover {
  background: var(--uds-scrollbar-hover);
}

a {
  color: var(--uds-accent);
}

a:hover {
  color: var(--uds-accent-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
dialog:focus-visible {
  outline: 3px solid var(--uds-focus);
  outline-offset: 3px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input[type="checkbox"],
input[type="color"],
input[type="file"] {
  cursor: pointer;
}

input,
select,
textarea {
  width: 100%;
  min-height: var(--control-height);
  padding: 10px 12px;
  color: var(--uds-ink);
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-radius: var(--radius-sm);
}

textarea {
  min-height: 124px;
  resize: none;
}

input::placeholder,
textarea::placeholder {
  color: #80908a;
}

input[type="color"] {
  width: 54px;
  min-height: 42px;
  padding: 4px;
}

input[type="file"] {
  padding: 9px;
  font-size: 0.9rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--uds-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--uds-ink);
  font-family: Montserrat, Arial, sans-serif;
  line-height: 1.12;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.lede {
  max-width: 650px;
  margin: 0;
  color: var(--uds-muted);
}

.button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: Montserrat, Arial, sans-serif;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.button:hover,
.button-link:hover {
  text-decoration: none;
}

.button:disabled,
.button-link:disabled {
  color: #91a099;
  background: #edf1ee;
  border-color: #dfe7e2;
  cursor: not-allowed;
}

.button-primary {
  color: #fff;
  background: var(--uds-accent);
}

.button-primary:hover {
  color: #fff;
  background: var(--uds-accent-dark);
}

.button-secondary {
  color: var(--uds-accent-dark);
  background: var(--uds-mint);
  border-color: #bfd9e8;
}

.button-secondary:hover {
  color: var(--uds-accent-dark);
  background: #d9edf7;
}

.button-quiet {
  color: var(--uds-ink);
  background: transparent;
  border-color: var(--uds-border);
}

.button-quiet:hover {
  color: var(--uds-accent-dark);
  background: var(--uds-surface);
}

.button-danger {
  color: #fff;
  background: var(--uds-danger);
}

.button-block {
  width: 100%;
}

.button-link {
  min-height: auto;
  padding: 4px 0;
  color: var(--uds-accent);
  background: transparent;
  border: 0;
  font-size: 0.9rem;
}

.button-link:hover {
  color: var(--uds-accent-dark);
  text-decoration: underline;
}

.button-danger-link {
  color: var(--uds-danger);
}

.alert {
  margin-bottom: 20px;
  padding: 13px 16px;
  border: 1px solid;
  border-radius: var(--radius-sm);
}

.alert-success {
  color: #1c6428;
  background: #edf8ef;
  background: color-mix(in srgb, var(--uds-green) 10%, white);
  border-color: #a9d9b0;
}

.alert-error {
  color: #812a22;
  background: var(--uds-danger-soft);
  border-color: #f0b9b1;
}

.client-status {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: var(--z-toast);
  width: min(360px, calc(100% - 40px));
  margin: 0;
}

/* Authentication */
.auth-page,
.empty-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card,
.empty-page {
  width: min(100%, 480px);
  padding: clamp(24px, 5vw, 44px);
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-radius: var(--radius-lg);
}

.auth-card h1,
.empty-page h1 {
  margin-bottom: 12px;
}

.auth-brand-logo {
  width: min(100%, 280px);
  margin: 0 auto 26px;
}

.auth-description,
.empty-page p:not(.eyebrow) {
  color: var(--uds-muted);
}

.stack-form {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.stack-form label,
.field label {
  color: var(--uds-ink);
  font-size: 0.9rem;
  font-weight: 750;
}

.stack-form .button {
  margin-top: 10px;
}

/* Administration */
.admin-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 26px 18px 20px;
  background: var(--uds-ink);
}

.brand-lockup,
.public-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-logo-horizontal {
  width: min(100%, 220px);
  min-width: 150px;
}

.brand-logo-mark {
  width: 150px;
  min-width: 150px;
}

.brand-lockup {
  align-items: flex-start;
  flex-direction: column;
  gap: 10px;
  padding: 4px 8px 28px;
  color: #fff;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
}

.brand-lockup strong {
  font-size: 0.96rem;
}

.brand-lockup small {
  margin-top: 3px;
  color: #b9d4e4;
  font-size: 0.74rem;
}

.admin-nav {
  display: grid;
  gap: 5px;
}

.admin-nav-link {
  padding: 11px 12px;
  color: #c5dbe8;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  text-decoration: none;
}

.admin-nav-link:hover,
.admin-nav-link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

.admin-nav-link.is-active {
  padding-inline-start: 9px;
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  border-inline-start: 3px solid var(--uds-yellow);
  font-weight: 750;
}

.admin-logout {
  margin-top: auto;
  padding: 20px 8px 0;
}

.admin-logout .button-quiet {
  color: #d2e3ec;
  border-color: rgba(255, 255, 255, 0.24);
}

.admin-logout .button-quiet:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-content {
  min-width: 0;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 86px;
  padding: 16px clamp(20px, 4vw, 56px);
  background: rgba(245, 248, 250, 0.96);
  border-bottom: 1px solid var(--uds-border);
  backdrop-filter: blur(8px);
}

.admin-header .eyebrow {
  margin-bottom: 2px;
  font-size: 0.64rem;
}

.admin-header-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.admin-main {
  width: min(calc(100% - 40px), var(--content-width));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.page-heading,
.section-heading,
.heading-actions,
.form-actions,
.filter-bar,
.profile-actions,
.preview-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-heading {
  align-items: flex-end;
  margin-bottom: 30px;
}

.page-heading h1 {
  margin-bottom: 0;
}

.heading-actions,
.profile-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel-card {
  margin-bottom: 24px;
  padding: clamp(20px, 3vw, 32px);
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-radius: var(--radius-md);
}

.breadcrumbs {
  margin-bottom: 14px;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  color: var(--uds-muted);
  font-size: 0.84rem;
  list-style: none;
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.breadcrumbs [aria-current="page"] {
  color: var(--uds-ink);
  font-weight: 750;
}

.profile-context-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  align-items: end;
  gap: 20px;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: var(--uds-mint);
  border: 1px solid #bfd9e8;
  border-radius: var(--radius-md);
}

.profile-context-copy .eyebrow {
  margin-bottom: 6px;
}

.profile-context-copy strong,
.profile-context-copy span {
  display: block;
}

.profile-context-copy strong {
  color: var(--uds-ink);
  font-family: Montserrat, Arial, sans-serif;
  font-size: 1.15rem;
}

.profile-context-copy span {
  margin-top: 3px;
  color: var(--uds-muted);
  font-size: 0.84rem;
}

.profile-context-form {
  display: grid;
  gap: 8px;
}

.profile-context-form label {
  color: var(--uds-ink);
  font-size: 0.86rem;
  font-weight: 750;
}

.profile-context-controls {
  display: flex;
  gap: 8px;
}

.profile-context-controls select {
  min-width: 0;
  flex: 1 1 auto;
}

.profile-context-controls .button {
  flex: 0 0 auto;
}

.section-heading {
  align-items: flex-start;
  margin-bottom: 22px;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.section-help,
.field-help,
.preview-note,
.metric-hint {
  color: var(--uds-muted);
  font-size: 0.85rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  min-height: 142px;
  padding: 22px;
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-top: 3px solid var(--uds-accent);
  border-radius: var(--radius-md);
}

.metric-label,
.metric-hint {
  margin-bottom: 9px;
}

.metric-label {
  color: var(--uds-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.metric-value {
  margin-bottom: 6px;
  color: var(--uds-ink);
  font-size: 2rem;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.metric-hint {
  margin-bottom: 0;
}

.metric-value-date {
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  letter-spacing: -0.02em;
}

.report-filter-error {
  margin: 18px 0 0;
}

.report-chart-wrap {
  min-height: 260px;
  margin-bottom: 18px;
  padding: 12px 0 0;
  border-top: 1px solid var(--uds-border);
}

.report-chart {
  display: block;
  width: 100%;
  height: 260px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.compact-empty {
  padding: 26px 12px;
}

.compact-empty h3 {
  margin-bottom: 8px;
}

.settings-section {
  max-width: 860px;
}

.settings-form .form-actions {
  max-width: 860px;
  margin-bottom: 24px;
}

.filter-bar {
  align-items: flex-end;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.field-search {
  flex: 1 1 300px;
}

.filter-submit {
  flex: 0 0 auto;
}

.input-with-action {
  position: relative;
}

.input-with-action input {
  padding-right: 82px;
}

.input-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 32px;
  padding: 5px 8px;
  color: var(--uds-accent);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 750;
  transform: translateY(-50%);
}

.input-clear:hover {
  background: var(--uds-mint);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 84px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 32px;
  padding: 5px 8px;
  color: var(--uds-accent);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 750;
  transform: translateY(-50%);
}

.input-action:hover {
  background: var(--uds-mint);
}

.table-scroll {
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--uds-border);
}

.data-table th {
  color: var(--uds-muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.table-primary,
.table-secondary {
  display: block;
}

.table-primary {
  font-weight: 750;
}

.table-secondary {
  margin-top: 3px;
  color: var(--uds-muted);
  font-size: 0.82rem;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  min-width: 190px;
}

.table-actions form {
  display: inline-flex;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-published {
  color: #1c6428;
  background: #edf8ef;
  background: color-mix(in srgb, var(--uds-green) 10%, white);
}

.status-draft {
  color: #765000;
  background: #fff7cc;
}

.status-archived {
  color: var(--uds-gray);
  background: #eef1f3;
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 48px 20px;
  text-align: center;
}

.empty-state.compact {
  padding: 26px 20px;
}

.empty-state p {
  max-width: 440px;
  margin-bottom: 20px;
  color: var(--uds-muted);
}

.empty-mark {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  place-items: center;
  color: var(--uds-accent);
  background: var(--uds-mint);
  border-radius: 50%;
  font-size: 1.6rem;
}

.profile-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.profile-selection-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 20px;
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-top: 3px solid var(--uds-accent);
  border-radius: var(--radius-md);
}

.profile-selection-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.profile-selection-card-header > div {
  min-width: 0;
}

.profile-selection-card-header .eyebrow {
  margin-bottom: 6px;
}

.profile-selection-card h3 {
  margin-bottom: 5px;
}

.profile-selection-slug {
  margin-bottom: 0;
  color: var(--uds-muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.profile-selection-subtitle {
  margin-bottom: 3px;
  color: var(--uds-ink);
  font-size: 0.88rem;
}

.profile-selection-card-header .status-chip {
  flex: 0 0 auto;
}

.profile-selection-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px solid var(--uds-border);
  border-bottom: 1px solid var(--uds-border);
}

.profile-selection-stats div {
  display: grid;
  gap: 4px;
}

.profile-selection-stats dt {
  color: var(--uds-muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.profile-selection-stats dd {
  display: grid;
  gap: 1px;
  margin: 0;
}

.profile-selection-stats dd strong {
  color: var(--uds-ink);
  font-size: 1.45rem;
  line-height: 1;
}

.profile-selection-stats dd span {
  color: var(--uds-muted);
  font-size: 0.78rem;
}

.profile-selection-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
}

.profile-selection-actions .button {
  flex: 1 1 180px;
}

/* Editor */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.7fr);
  align-items: start;
  gap: 24px;
}

.preview-column {
  position: sticky;
  top: 110px;
}

.preview-label {
  margin-bottom: 10px;
}

.preview-label .eyebrow {
  margin-bottom: 0;
}

.editor-tabs {
  display: flex;
  gap: 8px;
  margin: -4px 0 28px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--uds-border);
}

.editor-tab {
  min-height: 38px;
  padding: 7px 12px;
  color: var(--uds-muted);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 750;
}

.editor-tab:hover,
.editor-tab.is-active {
  color: var(--uds-accent-dark);
  background: var(--uds-mint);
}

.form-section-heading {
  margin: 28px 0 16px;
  padding-top: 22px;
  border-top: 1px solid var(--uds-border);
}

.form-section-heading:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.form-section-heading h2,
.form-section-heading p {
  margin-bottom: 0;
}

.form-section-heading p {
  color: var(--uds-muted);
  font-size: 0.88rem;
}

.form-section-heading-with-action {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field-help {
  margin: -2px 0 0;
}

.color-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-control span {
  color: var(--uds-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
}

.form-actions {
  grid-column: 1 / -1;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--uds-border);
}

.preview-card {
  padding: 24px 20px 28px;
  color: var(--uds-ink);
  background: var(--preview-background, var(--uds-paper));
  border: 1px solid var(--uds-border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.preview-avatar,
.profile-avatar,
.directory-card-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--preview-accent, var(--uds-accent));
  border-radius: 50%;
  font-weight: 850;
}

.preview-institution-logo,
.profile-institution-logo {
  width: 150px;
  margin: 0 auto 18px;
}

.preview-avatar {
  width: 70px;
  height: 70px;
  margin: 0 auto 14px;
}

.preview-avatar + .preview-name {
  margin-bottom: 3px;
}

.preview-name {
  font-size: 1.25rem;
  font-weight: 850;
}

.preview-subtitle,
.preview-bio {
  color: var(--uds-muted);
  font-size: 0.85rem;
}

.preview-bio {
  margin: 14px auto 20px;
  max-width: 320px;
}

.preview-links {
  display: grid;
  gap: 8px;
}

.preview-link {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 750;
}

.preview-button-solid,
.public-link-solid {
  color: #fff;
  background: var(--preview-accent, var(--profile-accent, var(--uds-accent)));
}

.preview-button-outline,
.public-link-outline {
  color: var(--preview-accent, var(--profile-accent, var(--uds-accent)));
  background: transparent;
  border: 1px solid currentColor;
}

.preview-button-soft,
.public-link-soft {
  color: var(--preview-accent, var(--profile-accent, var(--uds-accent)));
  background: var(--uds-mint);
  background: color-mix(in srgb, var(--preview-accent, var(--profile-accent, var(--uds-accent))) 13%, white);
}

/* Link editor */
.sortable-list {
  display: grid;
  gap: 10px;
}

.link-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-radius: var(--radius-sm);
}

.link-row.is-inactive {
  opacity: 0.66;
}

.link-edit-list {
  display: grid;
  gap: 18px;
}

.link-edit-form {
  padding: 18px;
  background: var(--uds-paper);
  border: 1px solid var(--uds-border);
  border-radius: var(--radius-sm);
}

.link-edit-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.link-row.is-dragging {
  border-color: var(--uds-accent);
}

.drag-handle {
  color: var(--uds-muted);
  font-size: 1.2rem;
  letter-spacing: -0.28em;
  cursor: grab;
}

.link-row-main {
  min-width: 0;
}

.link-row-main strong,
.link-row-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-row-main span {
  margin-top: 3px;
  color: var(--uds-muted);
  font-size: 0.8rem;
}

.link-row-actions {
  display: flex;
  gap: 8px;
}

.checkbox-field {
  align-self: end;
  display: flex;
  align-items: center;
  min-height: var(--control-height);
}

.checkbox-field label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.checkbox-field input {
  width: 18px;
  min-height: 18px;
}

/* Public experience */
.public-page {
  background: var(--uds-paper);
}

.public-header,
.public-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(calc(100% - 32px), 1120px);
  margin: 0 auto;
}

.public-header {
  min-height: 82px;
  border-bottom: 3px solid var(--uds-yellow);
}

.public-brand {
  min-width: 0;
}

.public-brand-logo {
  width: min(100%, 220px);
}

.public-directory-link {
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.public-main {
  width: min(calc(100% - 32px), 1120px);
  margin: 0 auto;
  padding: 58px 0 78px;
}

.public-profile-main {
  padding-top: 28px;
}

.public-footer {
  min-height: 76px;
  color: var(--uds-muted);
  border-top: 1px solid var(--uds-border);
  font-size: 0.78rem;
}

.directory-hero {
  max-width: 720px;
  margin-bottom: 58px;
}

.directory-hero h1 {
  max-width: 680px;
}

.directory-hero p:last-child {
  max-width: 590px;
  margin-bottom: 0;
  color: var(--uds-muted);
  font-size: 1.1rem;
}

.directory-section .section-heading {
  align-items: center;
}

.directory-count {
  color: var(--uds-muted);
  font-size: 0.85rem;
}

.directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.directory-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 190px;
  padding: 24px 22px;
  color: var(--uds-ink);
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: border-color 140ms ease, transform 140ms ease;
}

.directory-card:hover {
  color: var(--uds-ink);
  border-color: var(--uds-accent);
  transform: translateY(-2px);
}

.directory-card-line {
  display: block;
  width: 36px;
  height: 4px;
  margin-bottom: 14px;
  border-radius: 99px;
}

.directory-card-avatar {
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.directory-card-avatar img,
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.directory-card strong {
  font-size: 1.05rem;
}

.directory-card > span:not(.directory-card-line):not(.directory-card-avatar):not(.directory-card-arrow) {
  color: var(--uds-muted);
  font-size: 0.86rem;
}

.directory-card-arrow {
  position: absolute;
  right: 20px;
  bottom: 20px;
  color: var(--uds-accent);
  font-size: 1.1rem;
}

.public-empty {
  padding: 62px 20px;
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-radius: var(--radius-md);
}

.profile-page {
  width: min(calc(100% - 32px), 690px);
  margin: 0 auto;
  padding: 0 0 34px;
  text-align: center;
}

.profile-identity {
  display: grid;
  justify-items: center;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 22px;
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-radius: var(--radius-lg);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  margin-bottom: 18px;
  background: var(--profile-accent);
  border: 5px solid var(--uds-surface);
  outline: 1px solid var(--uds-border);
  font-size: 2rem;
}

.profile-identity h1 {
  margin-bottom: 6px;
  font-size: clamp(1.9rem, 5vw, 2.7rem);
}

.profile-subtitle {
  margin-bottom: 10px;
  color: var(--uds-muted);
  font-size: 1.02rem;
  font-weight: 650;
}

.profile-bio {
  max-width: 580px;
  margin-bottom: 22px;
  color: var(--uds-muted);
}

.profile-actions {
  width: 100%;
  justify-content: center;
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--uds-border);
}

.profile-links {
  display: grid;
  width: 100%;
  margin: 18px auto 0;
  gap: 10px;
}

.public-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 12px 18px;
  color: var(--profile-accent);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  overflow: hidden;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease, filter 140ms ease;
}

.public-link:hover {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

.public-link:active {
  transform: translateY(0);
}

.public-link.public-link-solid {
  color: #fff;
  background: var(--profile-accent);
  border-color: var(--profile-accent);
}

.public-link.public-link-solid:hover {
  color: #fff;
}

.public-link.public-link-outline {
  color: var(--profile-accent);
  background: transparent;
  border-color: currentColor;
}

.public-link.public-link-outline:hover,
.public-link.public-link-soft:hover {
  color: var(--profile-accent);
}

.public-link.public-link-soft {
  color: var(--profile-accent);
  background: var(--uds-mint);
  background: color-mix(in srgb, var(--profile-accent) 13%, white);
}

.public-link::after {
  position: absolute;
  right: 50%;
  bottom: 7px;
  width: 48px;
  height: 3px;
  content: '';
  background: var(--uds-yellow);
  border-radius: 999px;
  opacity: 0;
  transform: translateX(50%) scaleX(0);
  transform-origin: center;
  transition: opacity 160ms ease, transform 220ms ease;
}

.public-link:hover::after,
.public-link:focus-visible::after {
  opacity: 1;
  transform: translateX(50%) scaleX(1);
}

.public-link-label {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.profile-empty,
.profile-footnote {
  color: var(--uds-muted);
}

.profile-empty {
  padding: 24px;
  border: 1px dashed var(--uds-border);
  border-radius: var(--radius-sm);
}

.profile-footnote {
  max-width: 690px;
  margin: 18px auto 0;
  font-size: 0.78rem;
}

/* App-owned modal */
dialog.app-dialog {
  width: min(calc(100% - 32px), 460px);
  padding: 0;
  color: var(--uds-ink);
  background: transparent;
  border: 0;
}

dialog.app-dialog::backdrop {
  z-index: var(--z-backdrop);
  background: rgba(24, 50, 42, 0.52);
}

.dialog-card {
  padding: 28px;
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-radius: var(--radius-md);
}

.dialog-card p:not(.eyebrow) {
  color: var(--uds-muted);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

dialog.app-dialog.share-dialog {
  width: min(calc(100% - 32px), 960px);
  max-width: 960px;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  color: var(--uds-ink);
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(38, 55, 70, 0.16);
}

.share-dialog-card {
  display: flex;
  max-height: calc(100dvh - 24px);
  flex-direction: column;
  overflow: hidden;
}

.share-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--uds-border);
}

.share-dialog-heading {
  min-width: 0;
  padding-top: 2px;
}

.share-dialog-eyebrow,
.qr-preview-eyebrow,
.share-options-eyebrow {
  margin: 0;
  color: var(--uds-accent-dark);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.share-dialog-header h2 {
  margin: 0;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.share-dialog-close {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: -2px -4px 0 0;
  padding: 0;
  color: var(--uds-ink);
  background: transparent;
  border: 1px solid var(--uds-border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
}

.share-dialog-close:hover {
  color: var(--uds-accent-dark);
  background: var(--uds-mint);
  border-color: var(--uds-accent);
}

.share-dialog-close .share-icon-image {
  width: 15px;
  height: 15px;
  filter: none;
}

.share-dialog-body {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  min-height: 0;
  overflow-y: auto;
}

.share-preview.qr-fixed-preview {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 30px 32px 32px;
  background: var(--uds-paper);
  border-right: 1px solid var(--uds-border);
}

.qr-preview-intro {
  width: min(100%, 500px);
  text-align: center;
}

.qr-fixed-preview-title {
  margin: 0;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 1.24rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
}

.qr-preview-description {
  margin: 6px 0 0;
  color: var(--uds-muted);
  font-size: 0.86rem;
  line-height: 1.4;
  text-align: center;
}

.share-link-preview-card {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 22px 0 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.qr-fixed-preview-card {
  min-height: 0;
}

.qr-preview-frame {
  display: grid;
  place-items: center;
  width: min(100%, 500px);
  padding: 20px;
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-top: 4px solid var(--uds-yellow);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 28px rgba(38, 55, 70, 0.08);
}

.share-link-preview-qr {
  display: block;
  width: min(100%, 430px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.qr-fixed-preview-canvas {
  width: min(100%, 430px);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.qr-destination {
  display: flex;
  width: min(100%, 500px);
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 10px;
  margin: 0;
  padding: 11px 14px;
  color: var(--uds-ink);
  background: var(--uds-surface);
  border: 1px solid var(--uds-border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  line-height: 1.35;
  text-align: center;
}

.qr-destination-label {
  flex: 0 0 auto;
  color: var(--uds-accent-dark);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.qr-destination-url {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.qr-share-status {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--uds-muted);
  font-size: 0.82rem;
  text-align: center;
}

.qr-share-status[data-status="success"] {
  color: #1c6428;
}

.qr-share-status[data-status="error"] {
  color: var(--uds-danger);
}

.qr-fixed-preview-actions {
  display: grid;
  width: min(100%, 500px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.qr-fixed-preview-actions .button {
  width: 100%;
  padding-right: 10px;
  padding-left: 10px;
}

.share-options {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 32px 30px 26px;
  background: var(--uds-surface);
}

.share-options-intro {
  min-width: 0;
}

.share-options-title {
  margin: 6px 0 0;
  font-family: Montserrat, Arial, sans-serif;
  font-size: 1.24rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.share-options-description {
  margin: 8px 0 0;
  color: var(--uds-muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.share-channels-title {
  margin: 30px 0 0;
  color: var(--uds-ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.share-actions.share-channels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 10px;
  margin: 18px 0 0;
  padding: 0;
  overflow: visible;
  list-style: none;
}

.share-channel-item {
  min-width: 0;
}

.share-channel {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--uds-ink);
  background: transparent;
  border: 0;
  flex-direction: column;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
}

.share-channel:hover {
  color: var(--uds-accent-dark);
  text-decoration: none;
}

.share-channel-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: #fff;
  background: var(--uds-ink);
  border-radius: 999px;
  font-size: 1.24rem;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.share-icon-image {
  width: 19px;
  height: 19px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.share-channel:hover .share-channel-icon,
.share-channel:focus-visible .share-channel-icon {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(38, 55, 70, 0.16);
}

.share-channel:active .share-channel-icon {
  transform: translateY(0);
}

.share-channel-label {
  display: block;
  min-height: 2.4em;
  text-align: center;
}

.share-channel-copy .share-channel-icon {
  color: var(--uds-ink);
  background: #eef0ed;
  border: 1px solid #dfe4df;
}

.share-channel-copy .share-icon-image {
  filter: none;
}

.share-channel-x .share-channel-icon {
  background: #101316;
}

.share-channel-facebook .share-channel-icon {
  background: #1877f2;
}

.share-channel-whatsapp .share-channel-icon {
  background: #12c875;
}

.share-channel-linkedin .share-channel-icon {
  background: #0a66c2;
}

.share-channel-native .share-channel-icon {
  background: var(--uds-accent);
}

.share-channel-copy.is-complete .share-channel-icon {
  color: #fff;
  background: var(--uds-green);
  border-color: var(--uds-green);
}

.share-options-divider {
  margin: auto 0 18px;
  border-top: 1px solid var(--uds-border);
}

.share-dialog-footer {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 0;
}

.share-dialog-footer-copy {
  min-width: 0;
}

.share-dialog-footer-title {
  display: block;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 750;
}

.share-dialog-footer-note {
  margin: 3px 0 0;
  color: var(--uds-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.share-qr-action {
  min-height: 42px;
  padding: 9px 16px;
  white-space: nowrap;
}

.share-qr-canvas {
  display: block;
}

@media (max-width: 900px) {
  dialog.app-dialog.share-dialog {
    width: min(calc(100% - 24px), 720px);
  }

  .share-dialog-body {
    grid-template-columns: 1fr;
  }

  .share-preview.qr-fixed-preview {
    border-right: 0;
    border-bottom: 1px solid var(--uds-border);
  }

  .share-options {
    padding: 28px 30px 26px;
  }

  .qr-fixed-preview-canvas {
    width: min(100%, 420px);
  }
}

@media (max-width: 639px) {
  .share-dialog-card {
    max-height: calc(100dvh - 20px);
  }

  .share-dialog-header {
    padding: 16px 16px 14px;
  }

  dialog.app-dialog.share-dialog {
    width: min(calc(100% - 20px), 520px);
    max-height: calc(100dvh - 20px);
    border-radius: 14px;
  }

  .share-dialog-body {
    overflow-y: auto;
  }

  .share-preview.qr-fixed-preview {
    padding: 24px 16px 26px;
  }

  .share-options {
    padding: 24px 16px 20px;
  }

  .qr-preview-frame {
    padding: 14px;
  }

  .qr-fixed-preview-actions {
    grid-template-columns: 1fr;
  }

  .share-actions.share-channels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 8px;
    margin-top: 22px;
  }

  .share-channel-item {
    min-width: 0;
  }

  .share-channel-icon {
    width: 44px;
    height: 44px;
    font-size: 1.12rem;
  }

  .share-dialog-footer {
    flex-direction: column;
    gap: 12px;
  }

  .share-qr-action {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .public-link:hover,
  .public-link:active {
    transform: none;
  }

  .public-link:hover::after,
  .public-link:focus-visible::after {
    transform: translateX(50%) scaleX(1);
  }

  .share-channel:hover .share-channel-icon,
  .share-channel:focus-visible .share-channel-icon {
    transform: none;
  }
}

@media (forced-colors: active) {
  *:focus-visible {
    outline: 3px solid CanvasText;
  }
}

@media (max-width: 1099px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }

  .preview-column {
    position: static;
  }

  .preview-card {
    max-width: 500px;
    margin: 0 auto;
  }
}

@media (max-width: 991px) {
  .admin-shell {
    display: block;
  }

  .admin-sidebar {
    position: static;
    min-height: auto;
    padding: 14px 20px;
  }

  .brand-lockup {
    padding: 0 0 14px;
  }

  .admin-nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding-bottom: 2px;
  }

  .admin-nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .admin-logout {
    position: absolute;
    top: 14px;
    right: 20px;
    margin: 0;
    padding: 0;
  }

  .admin-logout .button {
    min-height: 38px;
    padding: 8px 11px;
    font-size: 0.8rem;
  }

  .admin-header {
    position: static;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 639px) {
  .admin-main,
  .public-main {
    width: min(calc(100% - 28px), var(--content-width));
  }

  .admin-main {
    padding-top: 28px;
  }

  .admin-header {
    align-items: flex-start;
    padding: 15px 14px;
  }

  .admin-header > .button {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 22px;
  }

  .page-heading .button,
  .heading-actions .button {
    width: 100%;
  }

  .profile-context-bar {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .profile-context-controls .button {
    width: auto;
  }

  .heading-actions {
    width: 100%;
    flex-direction: column;
  }

  .metric-grid,
  .form-grid,
  .directory-grid,
  .profile-selection-grid {
    grid-template-columns: 1fr;
  }

  .form-section-heading-with-action {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .panel-card {
    padding: 18px 15px;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-submit {
    width: 100%;
  }

  .table-actions {
    justify-content: flex-start;
  }

  .link-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .link-row > .status-chip,
  .link-row > .link-row-actions {
    grid-column: 2;
  }

  .link-row > input {
    display: none;
  }

  .link-row-actions {
    justify-content: flex-start;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .form-actions .button {
    width: 100%;
  }

  .public-header,
  .public-footer {
    width: min(calc(100% - 28px), 1120px);
  }

  .public-main {
    padding-top: 40px;
  }

  .public-profile-main {
    padding-top: 20px;
  }

  .public-brand-logo {
    width: 180px;
  }

  .public-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
  }

  .profile-page {
    width: min(calc(100% - 28px), 690px);
  }

  .profile-identity {
    width: 100%;
    padding: 22px 18px 18px;
    border-radius: var(--radius-md);
  }

  .profile-links {
    width: 100%;
    margin-top: 12px;
  }

  .profile-avatar {
    width: 84px;
    height: 84px;
  }

  .profile-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-actions .button {
    width: 100%;
  }

}
