.profile-main {
  --profile-display: "Google Sans Flex", "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --profile-text: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 1120px;
  display: grid;
  gap: 18px;
  padding-bottom: 40px;
  color: var(--ink);
  font-family: var(--profile-text);
}

#profile-overview,
#profile-matches,
#profile-hands,
#profile-stats {
  display: grid;
  gap: 22px;
  min-width: 0;
}

/* —— Profile hero —— */
.profile-hero {
  display: grid;
  gap: 0;
  border: 1px solid rgba(45, 76, 54, 0.14);
  border-radius: 10px;
  background: var(--paper);
  overflow: hidden;
}

.profile-hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 28px;
  align-items: center;
  padding: 18px 20px 16px;
}

.profile-hero-identity {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 16px;
  align-items: start;
  min-width: 0;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0e8c8;
  border: 1px solid rgba(45, 76, 54, 0.12);
}

.profile-identity-copy {
  min-width: 0;
}

.profile-name-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
}

.profile-name {
  margin: 0;
  font-family: var(--profile-display);
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.profile-flag {
  font-size: 1.05rem;
  line-height: 1;
}

.profile-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(55, 113, 89, 0.1);
  color: var(--green-dark);
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: help;
}

.profile-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

.profile-edit-toggle,
.profile-quiet,
.profile-more,
.profile-row-action {
  appearance: none;
  border: 1px solid rgba(45, 76, 54, 0.18);
  border-radius: 6px;
  background: #fff;
  color: var(--green-dark);
  font: inherit;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.profile-edit-toggle {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  min-height: 30px;
  padding: 0 11px;
  color: var(--muted);
  border-color: rgba(45, 76, 54, 0.14);
  background: transparent;
  text-decoration: none;
}

.profile-edit-toggle:hover,
.profile-row-action:hover {
  border-color: rgba(45, 76, 54, 0.28);
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.7);
}

.profile-quiet,
.profile-more {
  min-height: 34px;
  padding: 0 12px;
}

.profile-row-action {
  min-height: 28px;
  padding: 0 10px;
  white-space: nowrap;
}

/* Reusable Island Rating plaque */
.island-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 108px;
  padding: 12px 16px 11px;
  border: 1px solid rgba(36, 101, 64, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.18), transparent 50%),
    linear-gradient(165deg, #2f6a4a 0%, #245e42 48%, #1d4f37 100%);
  color: #f7f3e6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 1px 2px rgba(24, 32, 29, 0.08);
  text-align: center;
}

.island-rating-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(247, 243, 230, 0.78);
}

.island-rating-value {
  font-family: var(--profile-display);
  font-size: 1.75rem;
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fffdf7;
}

.island-rating-peak {
  margin-top: 1px;
  font-size: 0.64rem;
  font-weight: 650;
  line-height: 1.25;
  color: rgba(247, 243, 230, 0.72);
}

/* Compact stat rail inside the hero */
.profile-stat-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid rgba(45, 76, 54, 0.12);
  background: rgba(45, 76, 54, 0.025);
}

.profile-stat-rail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px 13px;
  border-right: 1px solid rgba(45, 76, 54, 0.1);
  min-width: 0;
}

.profile-stat-rail-item:last-child {
  border-right: 0;
}

.profile-stat-rail-item span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
}

.profile-stat-rail-item strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* Stats tab still uses compact modules */
.profile-stat-module {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  padding: 12px 12px 13px;
  border: 1px solid rgba(45, 76, 54, 0.12);
  border-radius: 8px;
  background: var(--paper);
}

.profile-stat-module span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.2;
}

.profile-stat-module strong {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* —— Tabs —— */
.profile-tabs {
  display: flex;
  gap: 22px;
  margin: 2px 0 8px;
  padding: 0 2px;
  border-bottom: 1px solid rgba(45, 76, 54, 0.12);
}

.profile-tabs button {
  margin: 0 0 -1px;
  padding: 10px 2px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-family: var(--profile-display);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.profile-tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--green);
  background: transparent;
  box-shadow: none;
}

.profile-tabs button:hover:not([aria-selected="true"]) {
  color: var(--ink);
}

/* —— Sections —— */
.profile-section-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-block {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.profile-empty {
  margin: 0;
  padding: 18px 16px;
  border: 1px dashed rgba(45, 76, 54, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.45;
  text-align: center;
}

.profile-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

/* —— Match rows —— */
.profile-match-list {
  display: grid;
  gap: 0;
  border: 1px solid rgba(45, 76, 54, 0.14);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}

.profile-match-row {
  display: grid;
  grid-template-columns: 3.4rem 5.5rem 4.2rem minmax(0, 1.5fr) 5.6rem auto;
  gap: 10px 12px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 11px 14px;
  border: 0;
  border-bottom: 1px solid rgba(45, 76, 54, 0.1);
  background: transparent;
  color: inherit;
  font: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-match-row:last-child {
  border-bottom: 0;
}

.profile-match-row:hover {
  background: rgba(55, 113, 89, 0.04);
}

.profile-place {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(45, 76, 54, 0.08);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.profile-place.is-1 {
  background: rgba(198, 161, 90, 0.22);
  color: #7a5a18;
}

.profile-place.is-2 {
  background: rgba(120, 130, 140, 0.16);
  color: #3d4650;
}

.profile-place.is-3 {
  background: rgba(166, 110, 70, 0.16);
  color: #6b4222;
}

.profile-match-score {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.profile-match-score small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}

.profile-match-opponents {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-match-date {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.profile-delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(45, 76, 54, 0.06);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.profile-delta.is-up {
  background: rgba(55, 113, 89, 0.12);
  color: var(--green-dark);
}

.profile-delta.is-down {
  background: rgba(138, 47, 47, 0.1);
  color: #8a2f2f;
}

.profile-delta.is-flat {
  background: rgba(45, 76, 54, 0.06);
  color: var(--muted);
}

/* —— Hand cards —— */
.profile-cards {
  display: grid;
  gap: 8px;
}

.hand-card {
  padding: 0;
  border: 1px solid rgba(45, 76, 54, 0.12);
  border-radius: 8px;
  background: var(--paper);
  overflow: hidden;
}

.hand-card-toggle {
  display: grid;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 12px 14px 13px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.hand-card-toggle:hover {
  background: rgba(55, 113, 89, 0.035);
}

.hand-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
  justify-content: space-between;
}

.hand-card-open {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hand-card h3 {
  margin: 0;
  font-family: var(--profile-display);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.hand-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.hand-card-meta strong {
  color: var(--ink);
  font-weight: 800;
}

.hand-card-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
  margin-top: 10px;
}

.hand-card-cluster {
  position: relative;
  display: inline-flex;
  gap: 1px;
  padding: 3px;
  border-radius: 5px;
}

.hand-card-cluster.is-open {
  border: 1px solid rgba(198, 161, 90, 0.88);
  background: rgba(241, 202, 106, 0.1);
}

.hand-card-cluster.is-concealed {
  border: 1px dashed rgba(45, 76, 54, 0.42);
  background: rgba(45, 76, 54, 0.03);
}

.hand-card-cluster.is-pair {
  border: 1px dashed rgba(45, 76, 54, 0.28);
  background: rgba(45, 76, 54, 0.02);
}

.hand-card-cluster.is-loose,
.hand-card-loose {
  display: inline-flex;
  gap: 1px;
  padding: 3px 0;
  border: 0;
}

.hand-card-detail {
  display: grid;
  gap: 0;
}

.hand-card-seat {
  display: grid;
  gap: 8px;
  padding: 0.7rem 0.1rem 0.55rem;
  border-top: 1px solid rgba(232, 238, 230, 0.1);
}

.hand-card-seat:first-child {
  border-top: 0;
  padding-top: 0.15rem;
}

.hand-card-seat-copy {
  display: grid;
  gap: 2px;
}

.hand-card-seat-name {
  margin: 0;
  color: rgba(245, 248, 244, 0.96);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.hand-card-seat-meta {
  margin: 0;
  color: rgba(232, 238, 230, 0.52);
  font-size: 0.68rem;
  font-weight: 650;
}

.hand-card-seat[data-winner="true"] .hand-card-seat-name {
  color: #f3d98a;
}

.hand-card-rack.is-detail {
  gap: 8px;
}

.hand-card-rack.is-detail img {
  width: 28px;
}

.hand-card-rack img {
  width: 24px;
  height: auto;
  display: block;
  border-radius: 2px;
}

.hand-card-rack img[data-winning="true"] {
  outline: 1.5px solid #c6a15a;
  outline-offset: 1px;
}

.hand-card-patterns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0 0;
}

.hand-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  background: #eef3eb;
  color: var(--green-dark);
  font-size: 0.64rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.hand-chip.is-exposed {
  background: rgba(198, 161, 90, 0.16);
  color: #7a5a18;
}

.hand-chip.is-high {
  background: rgba(55, 113, 89, 0.14);
  color: var(--green-dark);
}

/* —— Stats —— */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.profile-stats-grid .profile-stat-module {
  min-height: 76px;
}

/* —— Edit —— */
.profile-edit-page {
  max-width: 1120px;
  gap: 22px;
}

.profile-edit-header h1,
.profile-edit-page .profile-name,
.profile-edit-card h2,
.profile-membership-plan,
.profile-table-title {
  font-family: var(--profile-display);
}

.profile-edit-header h1 {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.profile-edit {
  display: grid;
  gap: 18px;
}

.profile-edit-card,
.profile-membership {
  display: grid;
  gap: 18px;
  padding: 24px 26px 22px;
  border: 1px solid rgba(45, 76, 54, 0.14);
  border-radius: 10px;
  background: var(--paper);
}

.profile-edit-card-head {
  display: grid;
  gap: 4px;
}

.profile-edit-card h2,
.profile-membership h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.profile-edit-card-head p,
.profile-membership p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 550;
  line-height: 1.45;
}

.profile-edit-public {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 22px 28px;
  align-items: start;
}

.profile-edit-avatar-col {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.profile-edit-avatar {
  width: 132px;
  height: 132px;
  border-radius: 10px;
}

.profile-file {
  position: relative;
  overflow: hidden;
}

.profile-file span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid rgba(45, 76, 54, 0.16);
  border-radius: 6px;
  background: #fff;
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
}

.profile-file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.profile-edit-public-copy {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.profile-edit-identity {
  display: grid;
  gap: 4px;
}

.profile-edit-bio textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px;
  border: 1px solid rgba(45, 76, 54, 0.16);
  border-radius: 8px;
  background: #fbfaf6;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  resize: vertical;
}

.profile-edit-count {
  justify-self: end;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.profile-edit-span {
  grid-column: 1 / -1;
}

.profile-empty[hidden],
#profile-matches[hidden],
#profile-hands[hidden],
#profile-stats[hidden],
#profile-overview[hidden],
.profile-edit label[hidden] {
  display: none !important;
}

.profile-edit label {
  display: grid;
  gap: 6px;
}

.profile-edit label > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-edit input,
.profile-edit select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(45, 76, 54, 0.16);
  border-radius: 8px;
  background: #fbfaf6;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.profile-edit input[readonly] {
  color: var(--muted);
  background: rgba(45, 76, 54, 0.04);
}

.profile-hero-bio {
  margin: 8px 0 0;
  max-width: 36rem;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 550;
  line-height: 1.45;
}

.profile-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.profile-edit-actions .identity-quiet,
.profile-edit-actions .identity-button,
.profile-edit-actions .identity-button-primary {
  min-width: 88px;
}

.profile-membership {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.profile-membership-copy {
  display: grid;
  gap: 6px;
}

.profile-membership-plan {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-membership-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(55, 113, 89, 0.12);
  color: var(--green-dark);
  font-size: 0.68rem;
}

.profile-membership-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  max-width: 360px;
}

.profile-membership-toggle span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
}

.profile-membership-toggle strong {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 750;
}

.profile-membership-toggle input {
  width: 42px;
  min-height: 24px;
  accent-color: var(--green-dark);
}

.profile-table-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1.15rem;
  background: rgba(8, 18, 14, 0.72);
}

.profile-table-modal[hidden] {
  display: none;
}

body.profile-table-open {
  overflow: hidden;
}

.profile-table-modal-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: min(36rem, 100%);
  max-height: min(100%, 40rem);
  padding: 1rem 1.05rem 1.05rem;
  border: 1px solid rgba(255, 226, 122, 0.22);
  border-radius: 0.85rem;
  background:
    linear-gradient(180deg, rgba(68, 116, 81, 0.16), transparent 32%),
    #1a2c24;
  color: rgba(245, 248, 244, 0.96);
  box-shadow: 0 18px 40px rgba(5, 12, 9, 0.45);
}

.profile-table-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 0 0 auto;
}

.profile-table-title {
  margin: 0.12rem 0 0;
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.profile-table-meta {
  margin: 4px 0 0;
  color: rgba(232, 238, 230, 0.52);
  font-size: 0.72rem;
  font-weight: 650;
}

.profile-table-close {
  padding: 0.2rem 0.15rem;
  border: 0;
  background: none;
  color: rgba(232, 238, 230, 0.62);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.profile-table-close:hover,
.profile-table-close:focus-visible {
  color: rgba(245, 248, 244, 0.96);
}

.profile-table-body {
  display: grid;
  align-content: start;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.profile-table-empty {
  margin: 0;
  color: rgba(232, 238, 230, 0.62);
  font-size: 0.82rem;
}

.profile-table-modal .hand-card-cluster.is-open {
  border-color: rgba(255, 226, 122, 0.45);
  background: rgba(255, 226, 122, 0.08);
}

.profile-table-modal .hand-card-cluster.is-concealed,
.profile-table-modal .hand-card-cluster.is-pair {
  border-color: rgba(245, 248, 244, 0.28);
  background: rgba(245, 248, 244, 0.04);
}

@media (max-width: 720px) {
  .profile-hero-top {
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
  }

  .island-rating {
    justify-self: start;
  }

  .profile-stat-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-stat-rail-item:nth-child(3) {
    border-right: 0;
  }

  .profile-stat-rail-item:nth-child(n + 4) {
    border-top: 1px solid rgba(45, 76, 54, 0.1);
  }

  .profile-match-row {
    grid-template-columns: 3.2rem 1fr auto;
    grid-template-areas:
      "place score action"
      "place delta opponents"
      "place date date";
  }

  .profile-match-row .profile-place {
    grid-area: place;
  }

  .profile-match-row .profile-match-score {
    grid-area: score;
  }

  .profile-match-row .profile-delta {
    grid-area: delta;
    justify-self: start;
  }

  .profile-match-row .profile-match-opponents {
    grid-area: opponents;
  }

  .profile-match-row .profile-match-date {
    grid-area: date;
  }

  .profile-match-row .profile-row-action {
    grid-area: action;
  }

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

  .profile-edit-public,
  .profile-membership,
  .profile-edit-grid {
    grid-template-columns: 1fr;
  }

  .profile-membership-toggle {
    max-width: none;
  }
}

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

  .profile-stat-rail-item:nth-child(odd) {
    border-right: 1px solid rgba(45, 76, 54, 0.1);
  }

  .profile-stat-rail-item:nth-child(even) {
    border-right: 0;
  }

  .profile-stat-rail-item:nth-child(n + 3) {
    border-top: 1px solid rgba(45, 76, 54, 0.1);
  }

  .profile-tabs {
    gap: 16px;
    overflow-x: auto;
  }

  .profile-tabs button {
    flex: 0 0 auto;
  }
}

.profile-awards {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--identity-line);
  border-radius: 10px;
  background: var(--paper);
}

.profile-awards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-award {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 96px;
  padding: 12px 8px 10px;
  border: 1px solid var(--identity-line);
  border-radius: 10px;
  background: linear-gradient(165deg, #fffdf8 0%, #f4ead4 100%);
  color: inherit;
  text-align: center;
  text-decoration: none;
}

.profile-award img {
  display: block;
  width: 56px;
  height: auto;
}

.profile-award span {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.profile-award:hover,
.profile-award:focus-visible {
  background: linear-gradient(165deg, #fffaf2 0%, #efe3c8 100%);
  outline: 2px solid rgba(45, 76, 54, 0.28);
  outline-offset: 2px;
}
