:root {
  --navy: #08131f;
  --navy-2: #101e2c;
  --blue: #1688e8;
  --green: #36c65c;
  --green-dark: #27a94a;
  --white: #ffffff;
  --bg: #f5f7f9;
  --text: #14202b;
  --muted: #6c7884;
  --border: #dfe5ea;
  --danger: #c93c3c;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(8, 19, 31, .08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Outfit", sans-serif;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
}

a {
  color: var(--blue);
  text-decoration: none;
}

button, input, textarea, select {
  font: inherit;
}

input, textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--white);
  color: var(--text);
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 136, 232, .12);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

label span {
  display: block;
  margin-bottom: 6px;
  font-size: .9rem;
  font-weight: 600;
}

h1, h2, h3, p {
  margin-top: 0;
}

.muted {
  color: var(--muted);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: white;
  font-weight: 700;
  letter-spacing: .08em;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(22,136,232,.10), transparent 32%),
    radial-gradient(circle at bottom left, rgba(54,198,92,.10), transparent 30%),
    var(--bg);
}

body.login-page {
  --login-ink: #f4f7f6;
  min-height: 100vh;
  color: var(--login-ink);
  background: #080d12;
}

.login-page .auth-shell {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 18% 22%, rgba(66, 158, 224, .16), transparent 38%),
    radial-gradient(ellipse at 82% 78%, rgba(55, 207, 154, .13), transparent 38%),
    radial-gradient(ellipse at 72% 18%, rgba(49, 190, 189, .08), transparent 34%),
    #080d12;
}

.login-page .auth-card {
  color: #f4f7f6;
  background: rgba(17, 27, 34, .92);
  border-color: rgba(225, 241, 237, .14);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .42), inset 0 1px rgba(255, 255, 255, .05);
  backdrop-filter: blur(14px);
}

.login-page .auth-card .muted {
  color: #a2adb2;
}

.login-page .auth-card label span {
  color: #dbe5e2;
}

.login-page .auth-card input {
  color: #15212a;
  background: #f4f7f6;
  border-color: rgba(225, 241, 237, .24);
}

.login-page .auth-card input:focus {
  border-color: #5bdab6;
  box-shadow: 0 0 0 3px rgba(91, 218, 182, .2);
}

.login-page .auth-card .btn-primary {
  background: linear-gradient(110deg, #65c9f0, #5ae6a3);
}

.auth-card {
  width: min(100%, 430px);
  padding: 34px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 24px 0 6px;
  font-size: 2rem;
}

.form-stack {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: var(--green);
  color: #07150b;
}

.btn-primary:hover {
  background: var(--green-dark);
  color: white;
}

.btn-blue {
  background: var(--blue);
  color: white;
}

.btn-dark {
  background: var(--navy);
  color: white;
}

.alert {
  margin-top: 18px;
  padding: 11px 13px;
  border-radius: 9px;
}

.alert-error {
  background: #fff0f0;
  border: 1px solid #f0caca;
  color: var(--danger);
}

.alert-success {
  background: rgba(54, 198, 92, .11);
  border: 1px solid rgba(54, 198, 92, .32);
  color: #167534;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px 1fr;
}

.sidebar {
  background: var(--navy);
  color: white;
  padding: 24px 18px;
}

.sidebar .brand-mark {
  margin-bottom: 30px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar nav a {
  padding: 10px 12px;
  border-radius: 8px;
  color: #d9e2e9;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: var(--navy-2);
  color: white;
}

.workspace {
  min-width: 0;
}

.topbar {
  min-height: 70px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-bottom: 1px solid var(--border);
}

.content {
  padding: 28px;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .content,
  .topbar {
    padding-left: 18px;
    padding-right: 18px;
  }
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-heading h1 {
  margin-bottom: 4px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.actions {
  text-align: right;
}

.status {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
}

.status-active {
  background: rgba(54, 198, 92, .14);
  color: #19863a;
}

.status-inactive {
  background: rgba(201, 60, 60, .12);
  color: var(--danger);
}

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

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

.full-width {
  grid-column: 1 / -1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.account-status-card {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.admin-password-card {
  margin-top: 20px;
}

.account-status-card h2 {
  margin-bottom: 4px;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

@media (max-width: 760px) {
  .page-heading,
  .account-status-card {
    align-items: stretch;
    flex-direction: column;
  }

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

  .full-width {
    grid-column: auto;
  }
}

.profile-image-editor {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}

.profile-image-editor form {
  flex: 1;
  display: flex;
  align-items: end;
  gap: 12px;
}

.profile-image-editor label {
  flex: 1;
}

.profile-thumb,
.profile-placeholder {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.profile-placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--green));
  color: white;
  font-size: 2rem;
  font-weight: 700;
}

.account-form {
  margin-top: 24px;
}

.account-heading {
  padding: 6px 0;
}

.eyebrow,
.section-kicker {
  margin-bottom: 7px;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.account-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, .82fr) 192px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  padding: 0;
  margin-bottom: 20px;
}

.account-profile-summary {
  min-height: 100%;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.account-overview-grid > .profile-image-editor {
  min-width: 0;
  min-height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0;
}
.account-overview-grid .profile-image-editor form { width: 100%; margin-top: 12px; }
.account-overview-grid .section-kicker { margin: 0 0 7px; }
.account-overview-grid h2 { margin: 0 0 8px; }
.profile-summary-copy { min-width: 0; }
.profile-qr-slot { position: relative; min-width: 0; min-height: 0; }
.profile-qr-slot img { position: absolute; left: 50%; top: 50%; display: block; width: min(180px, 100%); height: min(180px, 100%); max-width: 100%; object-fit: contain; transform: translate(-50%, -50%); }
.profile-url-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.profile-url-row .profile-url { min-width: 0; overflow-wrap: anywhere; }
.profile-url-unavailable { color: var(--muted); font-size: .82rem; }
.profile-url-copy { flex: 0 0 auto; padding: 5px 9px; border: 1px solid #cbdce0; border-radius: 7px; color: #0758c9; background: #fff; font-size: .78rem; font-weight: 650; cursor: pointer; }
.profile-url-copy:hover { background: #f3fafb; }
.account-overview-grid .profile-upload-heading { margin: 0; color: var(--muted); font-size: 1rem; font-weight: 600; }

.account-profile-summary h2,
.profile-image-editor h2,
.section-heading h2 {
  margin-bottom: 5px;
}

.profile-thumb-large {
  width: 104px;
  height: 104px;
}

.profile-url {
  display: inline-block;
  font-weight: 600;
}

.field-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.dashboard-section + .dashboard-section {
  margin-top: 20px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.section-heading > p {
  max-width: 390px;
  margin-bottom: 4px;
  text-align: right;
}

.password-form {
  margin-top: 24px;
}

.password-guidance {
  align-self: end;
  display: grid;
  gap: 4px;
  padding: 11px 0;
  font-size: .9rem;
}

.public-profile-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 28px 18px;
  background:
    radial-gradient(circle at top, rgba(22,136,232,.13), transparent 34%),
    var(--bg);
}

.public-profile-card {
  width: min(100%, 460px);
  padding: 34px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.profile-hero {
  text-align: center;
}

.public-avatar {
  width: 112px;
  height: 112px;
  margin: 0 auto 18px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-hero h1 {
  margin-bottom: 4px;
  font-size: 2rem;
}

.profile-title {
  margin-bottom: 2px;
  color: var(--blue);
  font-weight: 600;
}

.profile-company {
  color: var(--muted);
}

.profile-bio {
  margin: 24px 0;
  line-height: 1.55;
  text-align: center;
}

.profile-actions {
  display: grid;
  gap: 9px;
  margin: 24px 0;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
}

.contact-row span {
  color: var(--muted);
}

.contact-row strong {
  color: var(--blue);
  text-align: right;
}

.save-contact {
  width: 100%;
}

.public-brand {
  color: var(--muted);
  font-size: .82rem;
}

/* Public TAP profile */
.public-profile-shell {
  display: block;
  padding: 0 20px 30px;
  background: #f3f7f8;
}
.public-topline { width: min(100%, 760px); min-height: 76px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.tap-wordmark { color: #fff; font-size: 1.16rem; font-weight: 800; letter-spacing: .13em; }
.own-card-link { color: white; font-size: .88rem; font-weight: 600; padding: 10px 13px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; }
.public-profile { width: min(100%, 760px); margin: 0 auto; padding: 0 0 8px; overflow: hidden; background: #fff; border: 1px solid #dce7e9; border-radius: 20px; box-shadow: 0 18px 55px rgba(11,48,60,.13); }
.identity-card { display: grid; grid-template-columns: minmax(205px, .82fr) 1.18fr; min-height: 270px; background: #0b7290; color: white; }
.identity-photo { min-height: 270px; background: #075c78; }
.identity-photo img { display: block; width: 100%; height: 100%; min-height: 270px; object-fit: cover; }
.identity-placeholder { display: grid; place-items: center; height: 100%; min-height: 270px; color: #fff; font-size: 5rem; font-weight: 700; background: linear-gradient(135deg,#06738e,#159c9a); }
.identity-copy { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 32px clamp(24px, 5vw, 54px); }
.identity-brand { margin-bottom: 15px; color: #c7edf1; font-size: .66rem; font-weight: 700; letter-spacing: .12em; }
.identity-copy h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1.05; overflow-wrap: anywhere; }
.identity-copy .profile-title { margin: 0 0 5px; color: #e5f7f7; font-weight: 500; }
.identity-copy .profile-company { margin: 0; color: #bce1e5; }
.profile-primary-actions { display: flex; gap: 12px; padding: 22px clamp(20px, 5vw, 40px); border-bottom: 1px solid #e9eef0; }
.profile-primary-actions .btn { flex: 1; min-height: 48px; }
.btn-outline { color: #075c78; background: white; border: 1px solid #0b7894; }
.public-section { margin: 0 clamp(20px, 5vw, 42px); padding: 24px 0; border-bottom: 1px solid #edf0f1; }
.public-section:last-of-type { border-bottom: 0; }
.public-section h2 { margin-bottom: 15px; color: #19313c; font-size: 1.02rem; letter-spacing: .02em; }
.profile-bio { max-width: 66ch; margin: 0 0 8px; color: #40545e; line-height: 1.65; text-align: left; white-space: pre-line; }
.profile-bio.bio-collapsed { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 5; }
.bio-toggle { padding: 3px 0; border: 0; background: transparent; color: #087793; cursor: pointer; font-size: .88rem; font-weight: 650; }
.bio-toggle[hidden] { display: none; }
.profile-link-groups { display: grid; gap: 16px; }
.link-group h3 { margin: 0 0 8px; color: #667780; font-size: .82rem; font-weight: 600; }
.profile-link-list { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-link { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 12px 6px 7px; color: #24414e; background: #f6f9fa; border: 1px solid #e6edef; border-radius: 10px; font-size: .88rem; }
.profile-link:hover { border-color: #9ccbd4; background: #eff8f9; }
.link-mark { display: inline-grid; width: 27px; height: 27px; place-items: center; border-radius: 8px; background: #d8eef1; color: #086d86; font-size: .75rem; font-weight: 700; }
.link-arrow { color: #80939b; font-size: .8rem; }
.contact-list { display: grid; }
.contact-list a { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 48px; padding: 8px 0; color: #176e87; border-top: 1px solid #f0f3f4; }
.contact-list a:first-child { border-top: 0; }
.contact-list span { color: #73828a; font-size: .88rem; }
.contact-list strong { max-width: 72%; text-align: right; overflow-wrap: anywhere; font-size: .9rem; }
.public-brand { padding: 20px 10px 0; text-align: center; color: #62747c; }
.public-brand a { color: #315867; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.exchange-shell { min-height: 100vh; padding: 25px 18px; background: #f3f7f8; }
.exchange-shell > .tap-wordmark { display: block; width: min(100%,520px); margin: 4px auto 22px; }
.exchange-card { width: min(100%,520px); margin: auto; padding: clamp(22px,6vw,36px); background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.exchange-card h1 { margin-bottom: 8px; }
.exchange-form { display: grid; gap: 15px; margin-top: 24px; }
.exchange-form .field-note { margin: 0; }
.exchange-success { display: grid; gap: 12px; }
.exchange-success .btn { margin-top: 8px; }
.exchange-back { text-align: center; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #f0ae3d; outline-offset: 3px; }
.profile-carousel { margin: 24px 0; padding: 20px; background: white; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.carousel-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.carousel-heading h2 { margin: 0; }
.profile-carousel-track { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x mandatory; overscroll-behavior-inline: contain; }
.profile-preview, .profile-create-card { flex: 0 0 min(300px, 82vw); scroll-snap-align: start; min-height: 150px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.profile-preview { display: grid; grid-template-columns: 86px 1fr; }
.profile-preview > img, .profile-preview > .profile-placeholder { width: 86px; height: 100%; min-height: 150px; object-fit: cover; border-radius: 0; }
.profile-preview-copy { padding: 12px 12px 7px; min-width: 0; }
.profile-preview-copy h3 { margin: 8px 0 3px; font-size: 1rem; overflow-wrap: anywhere; }
.profile-preview-copy p { margin: 0; color: var(--muted); font-size: .84rem; }
.profile-preview-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border-top: 1px solid #edf0f1; }
.profile-preview-actions .btn { min-height: 36px; padding: 7px 10px; background: #f2f6f7; color: #264451; font-size: .8rem; }
.profile-preview-actions .btn-primary { background: var(--green); color: #07150b; }
.profile-preview-actions .btn-danger { background: #fff0f0; color: var(--danger); }
.profile-create-card { display: grid; place-items: center; padding: 20px; border-style: dashed; }
.profile-create-card label { width: 100%; }
.profile-create-card .btn { width: 100%; margin-top: 10px; }
.is-live { border-color: #35b862; box-shadow: 0 0 0 2px rgba(54,198,92,.14); }
.profile-selector { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 18px; }
.profile-chip { white-space: nowrap; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; background: white; }
.profile-chip.selected { color: #075c78; border-color: #0b7894; background: #edf8fa; }
.admin-profile-choice { display: inline-flex; align-items: center; gap: 6px; }
.admin-profile-choice .btn { min-height: 34px; padding: 6px 9px; font-size: .8rem; }
.admin-create-profile { display: flex; gap: 8px; max-width: 440px; margin: 0 0 18px; }
.link-json-form { margin-top: 20px; }
.exchange-list { display: grid; }
.exchange-entry { display: grid; grid-template-columns: minmax(140px,.7fr) 1.3fr; gap: 15px; padding: 15px 0; border-top: 1px solid #edf0f1; }
.exchange-entry:first-child { border-top: 0; }
.exchange-entry > div:first-child { display: grid; align-content: start; gap: 5px; }
.exchange-entry > div:first-child span, .exchange-details { color: var(--muted); font-size: .88rem; }
.exchange-details { display: grid; gap: 5px; overflow-wrap: anywhere; }
.exchange-details p { margin: 4px 0 0; white-space: pre-line; }
@media (max-width: 560px) { .profile-carousel { padding: 15px; } .carousel-heading { align-items: flex-start; flex-direction: column; gap: 4px; } }
@media (max-width: 600px) {
  .public-profile-shell { padding: 0 12px 24px; background: #f3f7f8; }
  .public-topline { min-height: 64px; }
  .own-card-link { padding: 8px 10px; font-size: .78rem; }
  .identity-card { grid-template-columns: 112px 1fr; min-height: 172px; }
  .identity-photo, .identity-photo img, .identity-placeholder { min-height: 172px; }
  .identity-copy { padding: 18px 16px; }
  .identity-brand { margin-bottom: 9px; font-size: .54rem; letter-spacing: .06em; }
  .identity-copy h1 { font-size: 1.48rem; }
  .identity-copy .profile-title, .identity-copy .profile-company { font-size: .88rem; }
  .profile-primary-actions { gap: 8px; padding: 16px 14px; }
  .profile-primary-actions .btn { padding: 8px 10px; font-size: .86rem; }
}

@media (max-width: 560px) {
  .public-profile-card {
    padding: 26px 20px;
  }

  .profile-image-editor,
  .profile-image-editor form {
    align-items: stretch;
    flex-direction: column;
  }
  .account-overview-grid > .account-profile-summary { padding: 18px; gap: 12px; }
  .account-overview-grid > .profile-image-editor { padding: 18px; }
  .account-overview-grid .profile-thumb-large { width: 80px; height: 80px; }
  .profile-qr-slot img { width: 92px; height: 92px; }
}

@media (max-width: 1100px) {
  .account-overview-grid {
    grid-template-columns: minmax(0, 1fr) 112px;
  }
  .account-overview-grid > .profile-image-editor { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .section-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }

  .section-heading > p {
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .account-profile-summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Curated TAP profile themes. Theme backgrounds belong to each card itself. */

.public-profile-shell {
  display: block;
  min-height: 100vh;
  padding: 0 20px 32px;
  overflow-x: clip;
  background: #f3f7f8;
}
.public-topline { width: min(100%, 840px); min-height: 62px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: space-between; }
.tap-wordmark { color: #08738e; }
.own-card-link { color: #08738e; border-color: #b9d7dd; background: #fff; }
.public-profile { width: min(100%, 840px); margin: 0 auto; padding: 0 0 8px; overflow: hidden; background: #fff; border: 1px solid #dce7e9; border-radius: 22px; box-shadow: 0 18px 55px rgba(11,48,60,.13); }
.identity-card { display: grid; grid-template-columns: minmax(240px, .9fr) 1.1fr; min-height: clamp(286px, 34vw, 350px); background: var(--theme-gradient); color: #fff; }
.identity-photo { min-width: 0; min-height: 0; padding: 18px; background: transparent; }
.identity-photo img { display: block; width: 100%; height: 100%; min-height: 250px; border-radius: 13px; object-fit: cover; }
.identity-placeholder { display: grid; place-items: center; width: 100%; height: 100%; min-height: 250px; border-radius: 13px; color: white; font-size: 5rem; font-weight: 700; background: linear-gradient(135deg,rgba(3,44,67,.2),rgba(255,255,255,.12)); }
.identity-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 34px clamp(24px, 4vw, 46px); background: transparent; }
.identity-card[data-theme="black-white"] .identity-copy { border-right: 12px solid #fff; }
.identity-brand { margin-bottom: 17px; color: rgba(255,255,255,.88); font-size: .68rem; font-weight: 700; letter-spacing: .11em; }
.identity-copy h1 { max-width: 100%; margin: 0 0 10px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; overflow-wrap: anywhere; }
.identity-copy .profile-title { margin: 0 0 5px; color: #fff; font-size: 1.12rem; font-weight: 600; }
.identity-copy .profile-company { margin: 0; color: rgba(255,255,255,.88); font-size: 1rem; }
.profile-primary-actions { display: flex; gap: 12px; padding: 22px clamp(20px, 4vw, 38px); border-bottom: 1px solid #e9eef0; }
.profile-primary-actions .btn { min-width: 0; flex: 1 1 0; min-height: 50px; }
.public-section { margin: 0 clamp(20px, 4vw, 40px); padding: 25px 0; border-bottom: 1px solid #edf0f1; }
.profile-bio { max-width: 68ch; margin: 0 0 8px; color: #40545e; line-height: 1.68; text-align: left; white-space: pre-line; }
.public-brand { padding: 20px 10px 0; text-align: center; color: #62747c; }
.exchange-shell { background: #f3f7f8; }

/* Fixed-size card browsing keeps every profile and action row aligned. */
.profile-carousel-track { max-width: 100%; gap: 16px; padding: 4px 3px 14px; touch-action: pan-x; cursor: grab; }
.profile-carousel-track.is-dragging { cursor: grabbing; user-select: none; }
.profile-tile { flex: 0 0 274px; width: 274px; height: 288px; display: grid; grid-template-rows: 170px 42px 42px 22px; align-content: start; scroll-snap-align: start; }
.profile-card-preview { width: 274px; height: 170px; display: grid; grid-template-columns: 38% 62%; overflow: hidden; border: 0; border-radius: 13px; color: #fff; background: var(--theme-gradient); box-shadow: 0 7px 18px rgba(11,48,60,.16); text-align: left; }
.profile-tile.is-live .profile-card-preview { outline: 3px solid #35b862; outline-offset: 2px; }
.profile-card-photo { min-width: 0; height: 170px; padding: 8px; }
.profile-card-photo img { display: block; width: 100%; height: 100%; border-radius: 8px; object-fit: cover; }
.profile-card-photo > span { display: grid; width: 100%; height: 100%; place-items: center; border-radius: 8px; background: rgba(4,32,52,.25); color: #fff; font-size: 2rem; font-weight: 700; }
.profile-card-copy { min-width: 0; padding: 13px 11px 10px 5px; display: flex; flex-direction: column; justify-content: center; grid-column: 1 / -1; overflow: hidden; }
.profile-card-preview[data-theme="black-white"] .profile-card-copy { border-right: 8px solid #fff; }
.profile-card-brand { margin-bottom: 8px; color: rgba(255,255,255,.8); font-size: .49rem; font-weight: 700; letter-spacing: .055em; white-space: nowrap; }
.profile-card-copy strong { display: -webkit-box; min-height: 2.25em; max-height: 2.25em; overflow: hidden; color: white; font-size: .91rem; line-height: 1.12; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.profile-card-copy > span:not(.profile-card-brand) { display: -webkit-box; min-height: 2.35em; max-height: 2.35em; overflow: hidden; color: rgba(255,255,255,.92); font-size: .7rem; line-height: 1.18; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.profile-card-copy small { overflow: hidden; color: rgba(255,255,255,.8); font-size: .64rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-live-slot { height: 42px; display: grid; place-items: center; }
.profile-live-slot form { width: 100%; }
.live-indicator, .go-live-button { width: 100%; min-height: 34px; display: grid; place-items: center; border-radius: 8px; font-size: .82rem; font-weight: 750; letter-spacing: .07em; }
.live-indicator { color: #176b37; background: #e2f5e8; border: 1px solid #b7e5c5; }
.go-live-button { padding: 5px 10px; }
.profile-actions-row { height: 42px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: center; gap: 4px; }
.profile-actions-row a, .profile-actions-row button { width: 100%; min-width: 0; padding: 7px 2px; border: 0; border-radius: 7px; color: #285061; background: #edf4f5; font-size: .69rem; font-weight: 650; text-align: center; white-space: nowrap; cursor: pointer; }
.profile-archive-slot { height: 22px; text-align: center; }
.profile-archive-slot button { padding: 2px 5px; border: 0; color: #78878d; background: transparent; font-size: .68rem; text-decoration: underline; cursor: pointer; }
.profile-add-tile { grid-template-rows: 170px 42px 42px 22px; }
.profile-add-tile form { height: 170px; }
.profile-card-preview.profile-add-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 16px; border: 1px dashed #7caeb8; color: #17677c; background: #f5fbfc; text-align: center; cursor: pointer; }
.profile-add-card strong { font-size: 1.02rem; }
.profile-add-card small, .profile-add-caption { color: #73858c; font-size: .76rem; }
.add-profile-plus { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: white; background: #087c91; font-size: 1.4rem; }
.profile-add-caption { display: grid; place-items: center; text-align: center; }

/* Theme picker swatches and the matching live preview. */
.theme-settings-section { margin-top: 20px; }
.theme-settings-section + .dashboard-section { margin-top: 20px; }
.theme-settings-form { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(230px,.8fr); gap: 22px; padding-top: 20px; }
.theme-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.theme-option { min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.theme-option:has(.theme-radio:checked) { border-color: #087c91; box-shadow: 0 0 0 2px rgba(8,124,145,.12); background: #f6fbfc; }
.theme-radio { width: 1px; height: 1px; position: absolute; opacity: 0; }
.theme-radio:focus-visible + .theme-option-swatch { outline: 3px solid #f0ae3d; outline-offset: 3px; }
.theme-option-swatch { flex: 0 0 44px; height: 38px; border-radius: 7px; background: var(--theme-gradient); }
.theme-option-copy { min-width: 0; display: grid; gap: 2px; }
.theme-option-copy strong { font-size: .82rem; }
.theme-option-copy small { color: var(--muted); font-size: .7rem; }
.theme-preview-wrap { display: grid; align-content: start; gap: 10px; }
.theme-preview-card { min-height: 144px; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 18px; border-radius: 12px; color: white; background: linear-gradient(112deg,rgba(3,30,62,.2),rgba(3,30,62,.08)),var(--theme-gradient); box-shadow: 0 7px 18px rgba(11,48,60,.14); }
.theme-preview-brand { color: rgba(255,255,255,.8); font-size: .55rem; font-weight: 700; letter-spacing: .08em; }
.theme-preview-card strong { font-size: 1.12rem; }
.theme-preview-card > span:not(.theme-preview-brand), .theme-preview-card small { color: rgba(255,255,255,.88); }

@media (max-width: 700px) {
  .public-profile-shell { padding: 0 12px 24px; }
  .public-topline { min-height: 56px; margin-bottom: 8px; }
  .public-profile { border-radius: 17px; }
  .identity-card { grid-template-columns: minmax(108px, 37%) minmax(0,1fr); min-height: 218px; }
  .identity-photo { padding: 12px; }
  .identity-photo img, .identity-placeholder { min-height: 190px; }
  .identity-copy { padding: 18px clamp(13px,4vw,24px); }
  .identity-brand { margin-bottom: 10px; font-size: .53rem; letter-spacing: .04em; }
  .identity-copy h1 { font-size: clamp(1.28rem,5vw,1.8rem); }
  .identity-copy .profile-title { font-size: .91rem; }
  .identity-copy .profile-company { font-size: .84rem; }
  .profile-primary-actions { gap: 8px; padding: 15px 12px; }
  .profile-primary-actions .btn { padding: 8px 7px; font-size: .82rem; }
  .theme-settings-form { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .profile-tile { flex-basis: min(274px, calc(100vw - 48px)); width: min(274px, calc(100vw - 48px)); }
  .profile-card-preview { width: 100%; }
  .theme-options { grid-template-columns: 1fr; }
}

/* Theme-aware TAP actions and compact editors. */
.profile-primary-actions .btn-primary, .theme-button-preview .btn-primary { color: var(--theme-cta-text); background: var(--theme-cta-bg); border-color: var(--theme-cta-bg); }
.profile-primary-actions .btn-primary:hover, .theme-button-preview .btn-primary:hover { background: var(--theme-cta-hover); border-color: var(--theme-cta-hover); }
.profile-primary-actions .btn-outline, .theme-button-preview .btn-outline { color: var(--theme-outline-text); background: #fff; border: 1px solid var(--theme-outline); }
.profile-primary-actions .btn-outline:hover, .theme-button-preview .btn-outline:hover { background: var(--theme-outline-hover); }
.profile-primary-actions .btn:focus-visible { outline-color: var(--theme-focus); }
.theme-button-preview { display:flex; gap:8px; }
.theme-button-preview .btn { display:inline-flex; justify-content:center; align-items:center; min-height:38px; padding:7px 10px; font-size:.77rem; }
.own-card-link { color:#284957; border-color:#cfdee2; background:#fff; box-shadow:0 2px 8px rgba(15,48,58,.06); }
.own-card-link:hover { color:#0758c9; border-color:#8daed5; }
.public-topline { min-height:50px; }
.identity-copy h1, .identity-copy .profile-title, .identity-copy .profile-company { max-width:100%; overflow-wrap:anywhere; }
.identity-copy h1 { display:-webkit-box; max-height:2.16em; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.identity-copy .profile-title, .identity-copy .profile-company { display:-webkit-box; max-height:2.6em; overflow:hidden; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.contact-address { display:flex; justify-content:space-between; gap:18px; padding:9px 0; border-top:1px solid #f0f3f4; }
.contact-address span { color:#73828a; font-size:.88rem; }
.contact-address strong { max-width:72%; text-align:right; overflow-wrap:anywhere; font-size:.9rem; }
.contact-editor, .link-editor { display:grid; gap:20px; }
.editor-group { padding-top:12px; border-top:1px solid #e8edef; }
.editor-group h3 { margin:0 0 12px; font-size:1rem; }
.editor-entry-form { padding:14px; border:1px solid #e1e8ea; border-radius:10px; background:#fbfcfc; }
.editor-fields, .link-editor-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.editor-fields label, .link-editor-fields label { min-width:0; }
.editor-fields input, .editor-fields select, .link-editor-fields input, .provider-dialog input { width:100%; }
.editor-actions { display:flex; justify-content:flex-end; margin-top:10px; }
.inline-delete { display:flex; justify-content:flex-end; margin:-11px 4px 12px; }
.inline-delete button { border:0; background:none; color:#8d4040; text-decoration:underline; cursor:pointer; }
.editor-add-form { border-style:dashed; background:#fff; }
.link-editor-row { display:grid; grid-template-columns:40px minmax(0,1fr); gap:12px; padding:14px; border:1px solid #e1e8ea; border-radius:10px; background:#fbfcfc; }
.link-editor-row > .link-mark { margin-top:22px; }
.provider-dialog { width:min(94vw,560px); max-height:90vh; padding:22px; border:0; border-radius:16px; box-shadow:0 24px 80px rgba(0,0,0,.25); }
.provider-dialog::backdrop { background:rgba(13,32,40,.48); }
.provider-dialog-head { display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:14px; }
.provider-dialog-head h2 { margin:0; }
.provider-dialog-head p { margin:4px 0; color:#718087; }
.dialog-close { width:38px; height:38px; border:0; border-radius:50%; font-size:1.5rem; background:#edf2f3; cursor:pointer; }
.provider-picker-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; max-height:220px; overflow:auto; margin:12px 0; }
.provider-choice { display:flex; align-items:center; gap:9px; padding:8px; border:1px solid #e1e8ea; border-radius:8px; text-align:left; background:#fff; cursor:pointer; }
.provider-choice:hover { border-color:#75a7b3; background:#f3fafb; }
.provider-create-form { display:grid; gap:12px; padding-top:14px; border-top:1px solid #e4eaec; }
.provider-create-form button:disabled { opacity:.5; cursor:not-allowed; }
.selected-provider { margin:0; color:#425963; font-weight:650; }
[hidden] { display:none !important; }
.contact-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px 28px; }
.contact-editor { gap:0; }
.editor-group { min-width:0; padding-top:0; border:0; }
.editor-group h3 { margin-bottom:8px; }
.compact-entry { min-width:0; display:flex; align-items:center; gap:10px; padding:9px 0; border-top:1px solid #edf0f1; }
.compact-entry > span:nth-child(2), .compact-entry > span:first-child { min-width:0; flex:1; display:grid; gap:2px; }
.compact-entry strong,.compact-entry small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.compact-entry small { color:#61717a; }
.compact-actions { display:flex; align-items:center; gap:4px; }
.compact-actions form { display:inline-flex; margin:0; }
.compact-actions button { padding:5px 7px; border:0; border-radius:6px; color:#285061; background:#edf4f5; cursor:pointer; }
.compact-actions .delete-control { color:#8d4040; background:transparent; }
.visibility-form { display:inline; margin:0; }
.text-add-button { margin-top:10px; padding:7px 10px; border:1px solid #cbdce0; border-radius:8px; color:#0758c9; background:white; font-weight:650; cursor:pointer; }
.small-editor-dialog { width:min(94vw,500px); max-height:90vh; padding:22px; border:0; border-radius:15px; box-shadow:0 24px 80px rgba(0,0,0,.25); }
.small-editor-dialog::backdrop { background:rgba(13,32,40,.48); }
.dialog-title { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:14px; }
.dialog-title h2,.dialog-title h3 { margin:0; }
.dialog-title button { width:34px; height:34px; border:0; border-radius:50%; font-size:1.3rem; background:#edf2f3; cursor:pointer; }
.visibility-choice { display:flex; align-items:center; gap:8px; margin-top:12px; }
.visibility-choice input { width:auto; }
.provider-create-form[hidden],.provider-picker[hidden] { display:none; }
.profile-create-inline { display:flex; width:min(100%,460px); gap:10px; margin:12px 0; }
.profile-create-inline input { flex:1; min-width:0; }
.profile-create-inline .btn { white-space:nowrap; }
.profile-selector-track { align-items:stretch; }
.profile-selector-card { flex:0 0 208px; width:208px; height:88px; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:8px; padding:12px 14px; border:1px solid #dce5e9; border-radius:11px; color:#203c48; background:#fff; text-align:left; scroll-snap-align:start; }
.profile-selector-card strong { display:-webkit-box; width:100%; min-height:1.2em; overflow:hidden; color:inherit; font-size:.94rem; line-height:1.2; text-overflow:ellipsis; -webkit-box-orient:vertical; -webkit-line-clamp:1; }
.profile-selector-card.selected { border-color:#087c91; background:#f3fafb; box-shadow:0 0 0 2px rgba(8,124,145,.12); }
.profile-selector-card:not(button) { cursor:pointer; }
.profile-add-selector { align-items:center; border-style:dashed; color:#0758c9; text-align:center; cursor:pointer; }
.profile-live-badge { display:inline-flex; align-items:center; gap:5px; color:#168347; font-size:.73rem; font-weight:750; letter-spacing:.04em; }
.profile-live-badge > span,.selected-live-status > span { color:#28a653; font-size:.76em; }
.profile-card-hint { color:#75848c; font-size:.72rem; }
.selected-profile-actions { min-height:58px; display:flex; align-items:center; gap:14px; margin-top:10px; padding:10px 13px; border:1px solid #e3eaed; border-radius:10px; background:#fbfcfc; }
.selected-profile-actions > div { display:grid; gap:2px; margin-right:auto; }
.selected-profile-actions small { color:#75848c; font-size:.72rem; }
.selected-profile-actions strong { overflow:hidden; max-width:220px; text-overflow:ellipsis; white-space:nowrap; }
.selected-live-status { color:#168347; font-size:.86rem; font-weight:700; }
.selected-profile-actions form { margin:0; }
.profile-archive-action { border:0; color:#79878d; background:transparent; text-decoration:underline; cursor:pointer; }
.profile-limit-note { margin:8px 0 0; }
.profile-card-preview { grid-template-columns:1fr; }
.profile-card-copy strong { font-size:1rem; -webkit-line-clamp:2; }
.profile-card-copy small { margin-top:5px; }
.profile-card-photo { display:none; }
.identity-card { background:var(--theme-gradient); }
.theme-preview-card { background:var(--theme-gradient); }
@media(max-width:560px) { .editor-fields,.link-editor-fields { grid-template-columns:1fr; } .link-editor-row { grid-template-columns:30px minmax(0,1fr); padding:10px; } .provider-picker-list { grid-template-columns:1fr; } .theme-button-preview { flex-wrap:wrap; } }
@media(max-width:700px) { .contact-grid { grid-template-columns:1fr; } .profile-create-inline { width:100%; } }
@media(max-width:560px) { .selected-profile-actions { align-items:flex-start; flex-wrap:wrap; } .selected-profile-actions > div { flex-basis:100%; } }
