/*
 * Damp UI — shared component classes.
 * Consumers must ensure the CSS-variable tokens (--color-*, --font-*) are
 * defined at :root (Damp.Web and Damp.Online.Web both generate them via
 * Tailwind's @theme block in their own input.css).
 *
 * Source of truth for the .damp-* component layer across the product.
 */

/* ====== TOP BAR ====== */
.damp-topbar {
  height: 64px;
  background: var(--color-raised);
  border-bottom: 1px solid var(--color-border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  font-family: var(--font-heading);
}
.damp-topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-gold);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 2px;
  text-decoration: none;
}
.damp-topbar-logo img { width: 36px; height: 36px; border-radius: 2px; object-fit: contain; }
.damp-topbar-sep { width: 1px; height: 2rem; background: rgba(255, 255, 255, 0.06); margin: 0 2rem; }
.damp-topbar-links { display: flex; align-items: center; gap: 2rem; height: 100%; }
.damp-topbar-link {
  display: flex;
  align-items: center;
  height: 100%;
  color: var(--color-secondary);
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.15s;
}
.damp-topbar-link:hover { color: var(--color-body); }
.damp-topbar-link--active { color: var(--color-heading); font-weight: 700; }
.damp-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 0.625rem; }
.damp-topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 2px;
  border: 1px solid var(--color-border-interactive);
  background: var(--color-elevated);
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
/* When a background-image (avatar) is set, suppress the initials text so the
   image shows cleanly through. */
.damp-topbar-avatar--image {
  border-color: var(--color-border-gold-hover);
  color: transparent;
}
.damp-topbar-menu {
  position: absolute; top: 42px; right: 0;
  width: 11rem; background: var(--color-raised);
  border: 1px solid var(--color-border-interactive);
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 50;
  padding: 0.25rem 0;
}
.damp-topbar-menu a, .damp-topbar-menu button {
  display: flex; align-items: center; gap: 0.625rem;
  width: 100%; padding: 0.5rem 0.75rem;
  color: var(--color-secondary);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  background: transparent; border: none; text-align: left; cursor: pointer;
  text-decoration: none;
}
.damp-topbar-menu a:hover, .damp-topbar-menu button:hover {
  background: var(--color-hover);
  color: var(--color-body);
}

/* ====== DATA TABLE TOOLBAR ====== */
.damp-table-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  min-height: 2.125rem;
}
.damp-table-search-wrap { position: relative; flex: 1; display: flex; }
.damp-table-search-wrap .damp-table-search { width: 100%; padding-right: 2.25rem; }
.damp-table-search-clear {
  position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
  width: 1.5rem; height: 1.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--color-muted); border-radius: 2px;
}
.damp-table-search-clear:hover { color: var(--color-body); background: var(--color-hover); }
.damp-table-search-clear svg { width: 0.75rem; height: 0.75rem; }
.damp-table-search {
  height: 2.125rem;
  background: var(--color-card);
  border: 1px solid var(--color-border-interactive);
  border-radius: 2px;
  padding: 0 0.75rem;
  color: var(--color-body);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  line-height: 1;
  outline: none;
  transition: all 0.12s;
}
.damp-table-search::placeholder { color: var(--color-muted); }
.damp-table-search:hover { background: var(--color-hover); border-color: var(--color-border-gold-hover); }
.damp-table-search:focus { background: var(--color-hover); border-color: var(--color-border-gold-hover); }
.damp-page-size {
  display: inline-flex; align-items: center; gap: 0.375rem;
  line-height: 1;
  background: var(--color-card); border: 1px solid var(--color-border-interactive);
  border-radius: 2px; padding: 0 0.625rem;
  color: var(--color-body); font-family: var(--font-heading); font-size: 0.75rem;
  cursor: pointer; height: 2.125rem;
  transition: all 0.12s;
}
.damp-page-size:hover {
  background: var(--color-hover);
  color: var(--color-body);
  border-color: var(--color-border-gold-hover);
}
.damp-page-size-label { color: var(--color-secondary); text-transform: uppercase; font-size: 0.625rem; letter-spacing: 0.08em; font-weight: 600; line-height: 1; }
.damp-page-size-value { color: var(--color-heading); font-size: 0.75rem; font-weight: 600; line-height: 1; min-width: 1.25rem; text-align: right; display: inline-block; }
.damp-page-size-caret {
  color: var(--color-secondary);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}
.damp-page-size--open .damp-page-size-caret { transform: rotate(180deg); }
.damp-icon-btn {
  width: 2.125rem; height: 2.125rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-card); border: 1px solid var(--color-border-interactive);
  border-radius: 2px; color: var(--color-secondary);
  cursor: pointer; transition: all 0.12s;
}
.damp-icon-btn:hover { background: var(--color-hover); color: var(--color-body); border-color: var(--color-border-gold-hover); }
.damp-icon-btn svg { width: 1rem; height: 1rem; }

/* ====== DATA TABLE HEADER + BULK ====== */
.damp-table-header, .damp-table-header-bulk {
  display: grid;
  gap: 0.875rem;
  padding: 0 0.875rem;
  align-items: center;
  height: 2.5rem;
  font-family: var(--font-heading);
}
.damp-table-header {
  background: var(--color-raised);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--color-border-interactive);
  line-height: 1;
}
.damp-table-header > span,
.damp-table-row > span {
  text-align: left;
}
.damp-table-header > span,
.damp-table-header-bulk > span {
  line-height: 1;
  padding-top: 1px;
}
.damp-table-header-bulk {
  background: var(--color-elevated);
  border: 1px solid var(--color-border-gold-hover);
  border-radius: 2px;
  line-height: 1;
}
.damp-table-bulk-count {
  font-family: var(--font-heading); font-weight: 400;
  color: var(--color-gold); font-size: 0.75rem;
  line-height: 1;
}
.damp-table-bulk-count-of {
  color: var(--color-secondary); font-weight: 400; font-size: 0.75rem;
  margin-left: 0.375rem; line-height: 1;
}
.damp-table-bulk-actions { display: flex; gap: 0.5rem; justify-self: end; align-items: center; padding-top: 0; }
.damp-table-bulk-actions > button { white-space: nowrap; }

/* ====== DATA TABLE ROW ====== */
.damp-table-row {
  display: grid;
  gap: 0.875rem;
  padding: 0.6875rem 0.875rem;
  background: var(--color-card);
  border-left: 1px solid var(--color-border-interactive);
  border-right: 1px solid var(--color-border-interactive);
  border-bottom: 1px solid var(--color-border-interactive);
  font-size: 0.875rem;
  color: var(--color-body);
  align-items: center;
  transition: background 0.12s;
  position: relative;
}
.damp-table-row:hover { background: var(--color-raised); }
.damp-table-row--selected { background: var(--color-elevated); }
.damp-table-empty {
  background: var(--color-card);
  border-left: 1px solid var(--color-border-interactive);
  border-right: 1px solid var(--color-border-interactive);
  border-bottom: 1px solid var(--color-border-interactive);
  color: var(--color-secondary);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-style: italic;
  text-align: center;
  padding: 1.5rem 0.875rem;
}

/* ====== CHECKBOX ====== */
.damp-checkbox {
  width: 1rem; height: 1rem;
  border: 1.5px solid var(--color-border-interactive);
  border-radius: 2px;
  background: var(--color-card);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  line-height: 1;
  font-size: 0;
}
.damp-checkbox:hover { border-color: var(--color-gold); }
.damp-checkbox input { position: absolute; opacity: 0; width: 0; height: 0; }
.damp-checkbox--on {
  background: var(--color-gold); border-color: var(--color-gold);
  position: relative;
}
.damp-checkbox--on::after {
  content: "";
  position: absolute;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--color-surface);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") center/contain no-repeat;
}
.damp-checkbox--indeterminate {
  background: var(--color-gold); border-color: var(--color-gold);
  position: relative;
}
.damp-checkbox--indeterminate::after {
  content: ""; position: absolute;
  left: 3px; right: 3px; height: 2px;
  background: var(--color-surface);
}

/* ====== NAME CELL ====== */
.damp-name-cell { display: flex; align-items: center; gap: 0.625rem; min-width: 0; }
.damp-name-cell-thumb {
  width: 2.5rem; height: 2.5rem; border-radius: 2px;
  object-fit: cover; flex-shrink: 0;
  background: var(--color-elevated);
  border: 1px solid var(--color-border-subtle);
}
.damp-name-cell-body { min-width: 0; }
.damp-name-cell-title {
  color: var(--color-heading);
  font-family: var(--font-heading); font-weight: 500; font-size: 0.8125rem;
  text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: block;
}
a.damp-name-cell-title:hover {
  color: var(--color-gold); text-decoration: underline; text-underline-offset: 3px;
}
.damp-name-cell-sub {
  color: var(--color-muted); font-size: 0.6875rem;
  font-family: var(--font-body); margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ====== ROW ACTIONS ====== */
.damp-row-actions { display: flex; gap: 2px; justify-self: start; position: relative; }
.damp-row-icon {
  width: 1.625rem; height: 1.625rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 2px;
  color: var(--color-secondary); cursor: pointer; transition: all 0.12s;
  opacity: 0.6;
}
.damp-row-icon:hover { background: var(--color-hover); color: var(--color-body); opacity: 1; }
.damp-row-icon--danger:hover { color: var(--color-danger); background: rgba(239, 68, 68, 0.08); }
.damp-row-icon svg { width: 0.875rem; height: 0.875rem; }
.damp-table-row:hover .damp-row-icon,
.damp-table-row--selected .damp-row-icon { opacity: 1; }

/* ====== ROW OVERFLOW POPOVER ====== */
.damp-row-overflow {
  position: absolute; right: 0; top: 1.875rem; z-index: 30;
  background: var(--color-elevated);
  border: 1px solid var(--color-border-gold-hover);
  border-radius: 2px; padding: 0.25rem;
  min-width: 10rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.damp-row-overflow-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4375rem 0.625rem;
  color: var(--color-body); font-size: 0.75rem;
  font-family: var(--font-heading); cursor: pointer;
  border-radius: 2px; background: transparent; border: none;
  width: 100%; text-align: left;
}
.damp-row-overflow-item:hover { background: var(--color-hover); color: var(--color-heading); }
.damp-row-overflow-item--danger { color: var(--color-danger); }
.damp-row-overflow-item--danger:hover { background: rgba(239, 68, 68, 0.08); }
.damp-row-overflow-sep { height: 1px; background: var(--color-border-subtle); margin: 0.25rem 0; }
.damp-row-overflow-item svg { width: 0.75rem; height: 0.75rem; }

/* ====== PAGINATOR / TABLE FOOTER ====== */
.damp-paginator {
  display: flex; justify-content: space-between; align-items: center;
  height: 2.5rem;
  padding: 0 0.875rem;
  background: var(--color-raised);
  border-left: 1px solid var(--color-border-interactive);
  border-right: 1px solid var(--color-border-interactive);
  border-bottom: 1px solid var(--color-border-interactive);
  font-family: var(--font-heading); font-size: 0.75rem;
  color: var(--color-secondary);
}
.damp-paginator-range { color: var(--color-body); }
.damp-paginator-range b { color: var(--color-heading); font-weight: 600; }
.damp-paginator-pages { display: flex; gap: 2px; align-items: center; }
.damp-pg-btn {
  min-width: 1.875rem; height: 1.875rem; padding: 0 0.5rem;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--color-border-interactive);
  border-radius: 2px; color: var(--color-secondary); cursor: pointer;
  font-family: var(--font-heading); font-size: 0.75rem;
}
.damp-pg-btn:hover { background: var(--color-hover); color: var(--color-body); border-color: var(--color-border-gold-hover); }
.damp-pg-btn--active { background: var(--color-gold); color: var(--color-surface); border-color: var(--color-gold); font-weight: 600; }
.damp-pg-btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.damp-pg-ellipsis { color: var(--color-muted); padding: 0 0.25rem; }

/* ====== STATUS BADGE ====== */
.damp-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.1875rem 0.5rem 0.1875rem 0.4375rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  justify-self: start;
  width: max-content;
}
.damp-status-badge-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--color-muted);
  flex-shrink: 0;
}
.damp-status-badge-label {
  color: var(--color-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 1px; /* Oxanium visual centering */
}
.damp-status-badge--ok {
  background: rgba(45, 212, 191, 0.10);
  border-color: rgba(45, 212, 191, 0.35);
}
.damp-status-badge--ok .damp-status-badge-dot { background: var(--color-teal); }
.damp-status-badge--ok .damp-status-badge-label { color: var(--color-teal); }
.damp-status-badge--warn {
  background: rgba(212, 168, 67, 0.10);
  border-color: rgba(212, 168, 67, 0.35);
}
.damp-status-badge--warn .damp-status-badge-dot { background: var(--color-gold); }
.damp-status-badge--warn .damp-status-badge-label { color: var(--color-gold); }
.damp-status-badge--bad {
  background: rgba(239, 68, 68, 0.10);
  border-color: rgba(239, 68, 68, 0.35);
}
.damp-status-badge--bad .damp-status-badge-dot { background: var(--color-danger); }
.damp-status-badge--bad .damp-status-badge-label { color: var(--color-danger); }
.damp-status-badge--neutral {
  background: rgba(140, 136, 128, 0.08);
  border-color: rgba(140, 136, 128, 0.20);
}
.damp-status-badge--neutral .damp-status-badge-dot { background: var(--color-secondary); }
.damp-status-badge--neutral .damp-status-badge-label { color: var(--color-secondary); }

/* ====== CUSTOM TOOLTIP ====== */
[data-damp-tooltip] { position: relative; }
[data-damp-tooltip]::after {
  content: attr(data-damp-tooltip);
  position: absolute;
  bottom: calc(100% + 0.375rem);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-elevated);
  border: 1px solid var(--color-border-interactive);
  color: var(--color-body);
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 2px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 60;
  text-transform: uppercase;
}
[data-damp-tooltip]:hover::after { opacity: 1; }

/* ====== GOLD BUTTON ====== */
.damp-btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  background: var(--color-gold);
  color: var(--color-surface);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: background 0.15s;
}
/* Fallback hard-codes the "darker gold" so this rule works in hosts that don't
   emit --color-gold-dark (Tailwind v4 tree-shakes unused theme tokens — Damp.Web
   has `bg-gold-dark` utility usages that keep the token alive, Damp.Online.Web
   doesn't). Without the fallback the hover background resolved to nothing and
   the dark button text read black-on-dark-card. */
.damp-btn-gold:hover { background: var(--color-gold-dark, #c49a38); }
.damp-btn-gold:disabled, .damp-btn-gold[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ====== PROFILE PAGE — HERO + ROUTER ====== */
.damp-profile-hero {
  position: relative;
  background: var(--color-raised);
  border: 1px solid var(--color-border-subtle);
  border-radius: 2px;
  margin-bottom: 1.5rem;
}
/* Clipping layer — keeps the gold slash/gradient inside the hero's rounded corners
   without clipping overlay children like the overflow menu. */
.damp-profile-hero-clip {
  position: absolute; inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.damp-profile-hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(110deg, rgba(212, 168, 67, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(212, 168, 67, 0.10), transparent 50%);
  pointer-events: none;
}
.damp-profile-hero-slash {
  position: absolute; top: 0; right: 0;
  width: 200px; height: 100%;
  background: linear-gradient(100deg, transparent 0%, transparent 40%, rgba(212, 168, 67, 0.12) 40%, rgba(212, 168, 67, 0.12) 42%, transparent 42%);
  pointer-events: none;
}
.damp-profile-hero-inner {
  position: relative;
  padding: 1.5rem 1.75rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.damp-profile-avatar {
  width: 68px; height: 68px;
  background: var(--color-gold);
  color: var(--color-surface);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(14% 0, 100% 0, 100% 86%, 86% 100%, 0 100%, 0 14%);
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.15), 0 0 24px rgba(212, 168, 67, 0.12);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}
.damp-profile-hero-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.damp-profile-hero-label {
  color: var(--color-gold);
  font-family: var(--font-heading);
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.damp-profile-hero-name {
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.01em;
  line-height: 1;
}
.damp-profile-hero-tag {
  color: var(--color-gold);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
  margin-left: 0.25rem;
}
.damp-profile-hero-meta {
  color: var(--color-secondary);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}
.damp-profile-hero-meta-sep {
  color: var(--color-border-interactive);
}
.damp-profile-hero-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}
.damp-profile-hero-overflow {
  width: 32px; height: 32px;
  border: 1px solid var(--color-border-interactive);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 0;
  padding: 0;
}
.damp-profile-hero-overflow:hover {
  color: var(--color-body);
  background: var(--color-hover);
}
.damp-profile-hero-overflow:focus-visible {
  outline: none;
  color: var(--color-gold);
  border-color: var(--color-border-gold-hover);
}
.damp-profile-hero-menu {
  position: absolute; top: 40px; right: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border-interactive);
  border-radius: 2px;
  padding: 0.25rem;
  min-width: 14rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
  z-index: 40;
}
.damp-profile-hero-menu button {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.625rem;
  background: transparent;
  border: none;
  color: var(--color-body);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  border-radius: 2px;
}
.damp-profile-hero-menu button:hover { background: var(--color-hover); }
.damp-profile-hero-menu-sep { height: 1px; background: var(--color-border-subtle); margin: 0.25rem 0; }
.damp-profile-hero-menu-item--danger { color: var(--color-danger); }
.damp-profile-hero-menu-item--danger:hover { background: rgba(239, 68, 68, 0.08); }

/* Router */
.damp-profile-router {
  display: grid;
  grid-template-columns: 180px 1fr;
  background: var(--color-raised);
  border: 1px solid var(--color-border-subtle);
  border-radius: 2px;
  min-height: 380px;
}
.damp-profile-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0.875rem 0.625rem;
  border-right: 1px solid var(--color-border-subtle);
}
.damp-profile-side-item {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--color-secondary);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  background: transparent;
  text-align: left;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  font-weight: 500;
}
.damp-profile-side-item:hover { color: var(--color-body); }
.damp-profile-side-item:focus-visible {
  outline: none;
  color: var(--color-body);
  background: var(--color-hover);
  box-shadow: inset 2px 0 0 var(--color-border-gold-hover);
}
.damp-profile-side-item--active {
  color: var(--color-gold);
  background: rgba(212, 168, 67, 0.06);
  border-left-color: var(--color-gold);
}
.damp-profile-side-item--active:focus-visible {
  background: rgba(212, 168, 67, 0.12);
  color: var(--color-gold);
}

.damp-profile-main {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}
.damp-profile-panel-head {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: 0.625rem;
  flex-wrap: wrap;
}
.damp-profile-panel-head h2 {
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  margin: 0;
}
.damp-profile-panel-sub {
  color: var(--color-secondary);
  font-size: 0.75rem;
}
.damp-profile-panel-trail { margin-left: auto; }

.damp-profile-subtitle {
  color: var(--color-gold);
  font-family: var(--font-heading);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.damp-profile-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.8125rem;
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: 2px;
}
.damp-profile-row--current {
  border-color: var(--color-border-gold-hover);
  background: linear-gradient(90deg, rgba(212, 168, 67, 0.05), transparent 60%);
}
.damp-profile-row-icon {
  width: 28px; height: 28px;
  border: 1px solid var(--color-border-interactive);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8125rem;
  flex-shrink: 0;
}
.damp-profile-row-icon--brand {
  background: var(--color-elevated);
  border-color: var(--color-border-subtle);
}
.damp-profile-row-icon--brand svg { width: 16px; height: 16px; display: block; }
.damp-profile-row-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.damp-profile-row-name {
  color: var(--color-heading);
  font-weight: 500;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.2;
}
.damp-profile-row-meta {
  color: var(--color-secondary);
  font-size: 0.6875rem;
}

.damp-profile-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 0.5625rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  /* Oxanium caps sit slightly above mid-line — extra top padding centers them. */
  padding: 3px 6px 2px;
  border-radius: 2px;
  border: 1px solid;
  line-height: 1;
  white-space: nowrap;
}
.damp-profile-badge--current  { color: var(--color-teal);      border-color: rgba(45, 212, 191, 0.3); background: rgba(45, 212, 191, 0.1); }
.damp-profile-badge--linked   { color: var(--color-teal);      border-color: rgba(45, 212, 191, 0.3); background: rgba(45, 212, 191, 0.1); }
.damp-profile-badge--unlinked { color: var(--color-secondary); border-color: var(--color-border-interactive); background: var(--color-elevated); }
.damp-profile-badge--companion{ color: var(--color-gold);      border-color: var(--color-border-gold-hover); background: rgba(212, 168, 67, 0.08); }

.damp-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: transparent;
  border: 1px solid var(--color-border-interactive);
  color: var(--color-body);
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3125rem 0.625rem;
  border-radius: 2px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.12s;
  font-weight: 600;
}
.damp-btn-ghost:hover { background: var(--color-hover); }
.damp-btn-ghost:disabled, .damp-btn-ghost[disabled] { opacity: 0.4; cursor: not-allowed; }
.damp-btn-ghost--gold {
  color: var(--color-gold);
  border-color: var(--color-border-gold-hover);
}
.damp-btn-ghost--gold:hover { background: rgba(212, 168, 67, 0.08); }
.damp-btn-ghost--danger {
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.35);
}
.damp-btn-ghost--danger:hover { background: rgba(239, 68, 68, 0.08); }

.damp-profile-avatar-edit {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: 2px;
  max-width: 520px;
}
.damp-profile-avatar-edit .damp-profile-avatar { width: 72px; height: 72px; font-size: 1.5rem; }

/* Visibility toggle on Profile panel */
.damp-profile-visibility {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.875rem 1rem;
  background: var(--color-card);
  border: 1px solid var(--color-border-subtle);
  border-radius: 2px;
  max-width: 520px;
}
.damp-profile-visibility-col { flex: 1; min-width: 0; }
.damp-profile-visibility-title {
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}
.damp-profile-visibility-desc {
  color: var(--color-secondary);
  font-size: 0.75rem;
  line-height: 1.45;
}
.damp-profile-visibility-desc strong { color: var(--color-body); }

/* Switch (iOS-style) */
.damp-switch {
  display: inline-flex;
  flex-shrink: 0;
  width: 2.75rem; height: 1.5rem;
  background: var(--color-elevated);
  border: 1px solid var(--color-border-interactive);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
}
.damp-switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 1.125rem; height: 1.125rem;
  background: var(--color-secondary);
  border-radius: 50%;
  transition: left 0.15s, background 0.15s;
}
.damp-switch[aria-checked="true"] {
  background: rgba(212, 168, 67, 0.25);
  border-color: var(--color-border-gold-hover);
}
.damp-switch[aria-checked="true"]::after {
  left: calc(100% - 1.125rem - 3px);
  background: var(--color-gold);
}
.damp-switch:disabled { opacity: 0.5; cursor: not-allowed; }

/* Modal dialog — used by DeleteAccountDialog */
.damp-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.damp-modal {
  background: var(--color-card);
  border: 1px solid var(--color-border-interactive);
  border-radius: 2px;
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.damp-modal-title {
  color: var(--color-heading);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}
.damp-modal-desc {
  color: var(--color-secondary);
  font-size: 0.8125rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.damp-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Responsive: below 900px, sidebar becomes horizontal chips */
@media (max-width: 900px) {
  .damp-profile-router {
    grid-template-columns: 1fr;
  }
  .damp-profile-side {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border-subtle);
    padding: 0.75rem;
    gap: 0.375rem;
  }
  .damp-profile-side-item {
    border-left: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    padding: 0.5rem 0.625rem;
  }
  .damp-profile-side-item--active {
    border-bottom-color: var(--color-gold);
    border-left-color: transparent;
  }
  .damp-profile-hero-inner { padding: 1rem 1.25rem; gap: 0.75rem; }
  .damp-profile-avatar { width: 48px; height: 48px; font-size: 1.125rem; }
  .damp-profile-hero-name { font-size: 1.125rem; }
  .damp-profile-hero-tag { font-size: 1rem; }
}

/* ====== SKELETON LOADER ====== */
.damp-skeleton {
  display: block;
  height: 0.75rem;
  background: var(--color-elevated);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.damp-skeleton::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
  animation: damp-skeleton-shimmer 1.4s infinite;
}
@keyframes damp-skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
