.identity-page {
  --identity-display: "Google Sans Flex", "Google Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --identity-text: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --identity-line: rgba(45, 76, 54, 0.14);
  --identity-felt: #1d4f37;
  max-width: 1120px;
  display: grid;
  gap: 18px;
  padding-bottom: 40px;
  color: var(--ink);
  font-family: var(--identity-text);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#group-games,
#group-rankings,
#group-members {
  display: grid;
  gap: 22px;
  min-width: 0;
}

#group-games[hidden],
#group-rankings[hidden],
#group-members[hidden] {
  display: none !important;
}

.identity-back {
  display: inline-flex;
  align-items: center;
  width: max-content;
  margin: 0 0 -8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.identity-back::before {
  content: "";
  width: 0.38em;
  height: 0.38em;
  margin-right: 0.45em;
  border-left: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg);
  translate: 0 -0.02em;
}

.identity-back:hover,
.identity-back:focus-visible {
  color: var(--green-dark);
}

.identity-page h1,
.identity-page h2,
.identity-page .identity-name {
  font-family: var(--identity-display);
}

.identity-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
}

.identity-title-row h1 {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.identity-hero,
.identity-card {
  display: grid;
  gap: 0;
  border: 1px solid var(--identity-line);
  border-radius: 10px;
  background: var(--paper);
  overflow: hidden;
}

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

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

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

.identity-monogram,
.identity-chip-mono {
  display: grid;
  place-items: center;
  font-family: var(--identity-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #245e42;
}

.identity-monogram {
  font-size: 1.28rem;
  background:
    linear-gradient(180deg, #f7f1dc, #efe4c4);
}

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

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

.identity-name {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.identity-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;
}

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

.identity-quiet[hidden],
.identity-button[hidden],
.identity-button-primary[hidden] {
  display: none !important;
}

.identity-quiet,
.identity-button,
.identity-button-primary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(45, 76, 54, 0.18);
  border-radius: 6px;
  background: #fff;
  color: var(--green-dark);
  box-shadow: none;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.identity-quiet {
  color: var(--muted);
  border-color: rgba(45, 76, 54, 0.14);
  background: transparent;
}

.identity-copy .identity-quiet {
  margin-top: 10px;
  min-height: 30px;
  padding: 0 11px;
}

.identity-quiet:hover,
.identity-button:hover {
  border-color: rgba(45, 76, 54, 0.28);
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.7);
}

.identity-button-primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.identity-button-primary:hover,
.identity-button-primary:focus-visible {
  border-color: #2d614c;
  background: #2d614c;
  color: #fff;
}

.identity-felt .identity-button-primary {
  border-color: rgba(255, 252, 238, 0.22);
  background: rgba(255, 252, 238, 0.94);
  color: #2b523b;
}

.identity-felt .identity-button-primary:hover,
.identity-felt .identity-button-primary:focus-visible {
  background: #fff;
  color: #1f3f2c;
}

.identity-felt .identity-quiet,
.identity-felt .identity-button {
  border-color: rgba(247, 243, 230, 0.46);
  background: transparent;
  color: #f7f3e6;
}

.identity-felt .identity-quiet:hover,
.identity-felt .identity-quiet:focus-visible,
.identity-felt .identity-button:hover,
.identity-felt .identity-button:focus-visible {
  border-color: rgba(247, 243, 230, 0.78);
  background: rgba(247, 243, 230, 0.14);
  color: #fffdf6;
}

.identity-form .identity-button,
.identity-form .identity-button-primary,
.social-form .identity-button,
.social-form .identity-button-primary,
.profile-edit-actions .identity-button,
.profile-edit-actions .identity-button-primary {
  width: auto;
  justify-self: start;
}

.account-form .identity-button,
.account-form .identity-button-primary {
  width: 100%;
}

.identity-stat-rail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  border-top: 1px solid var(--identity-line);
  background: rgba(45, 76, 54, 0.025);
}

.identity-stat-rail span,
.identity-stat-rail strong {
  display: block;
}

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

.identity-stat:last-child {
  border-right: 0;
}

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

.identity-stat strong {
  font-family: var(--identity-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.identity-tabs {
  display: flex;
  gap: 22px;
  margin: 2px 0 8px;
  padding: 0 2px;
  border-bottom: 1px solid var(--identity-line);
}

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

.identity-tabs button[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--green);
}

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

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

.identity-panel {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 18px 20px;
}

.identity-empty-note {
  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;
}

.identity-felt-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.identity-felt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.identity-avatars {
  display: flex;
  align-items: center;
}

.identity-avatars > * {
  width: 28px;
  height: 28px;
  margin-left: -8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #efe4c4;
}

.identity-avatars > :first-child {
  margin-left: 0;
}

.identity-chip-mono {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(45, 76, 54, 0.12);
  object-fit: cover;
  background: linear-gradient(180deg, #f7f1dc, #efe4c4);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.identity-felt {
  display: grid;
  gap: 10px;
  padding: 18px 20px 16px;
  border: 1px solid rgba(255, 226, 122, 0.18);
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 20%, rgba(115, 190, 140, 0.22), transparent 46%),
    linear-gradient(165deg, #2f6a4a 0%, #245e42 52%, #1d4f37 100%);
  color: #f7f3e6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.identity-felt.is-accent {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 24px;
}

.identity-felt h1,
.identity-felt h2,
.identity-felt p {
  margin: 0;
}

.identity-felt h1,
.identity-felt h2 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.identity-felt p {
  color: rgba(247, 243, 230, 0.78);
  font-size: 0.84rem;
  font-weight: 550;
  line-height: 1.45;
}

.identity-felt .identity-invite-link {
  justify-self: end;
}

.identity-empty {
  justify-items: start;
}

.identity-empty .identity-button-primary {
  width: auto;
}

.identity-invite {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 28px 48px;
  padding: clamp(28px, 4vw, 48px) clamp(24px, 4vw, 44px);
  border-radius: 16px;
  background:
    radial-gradient(circle at 28% 22%, rgba(91, 178, 119, 0.22), transparent 48%),
    linear-gradient(165deg, #2a5c40 0%, #1f4a34 52%, #173828 100%);
  color: #f8f5e9;
  box-shadow:
    0 5px 0 #122219,
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.identity-invite-copy {
  max-width: 28rem;
}

.identity-invite-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(1.85rem, 3.2vw, 2.7rem);
  font-weight: 850;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.identity-invite-copy p {
  margin: 0 0 22px;
  color: rgba(247, 243, 230, 0.74);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.55;
}

.identity-invite-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 252, 238, 0.16);
  border-radius: 8px;
  background: rgba(255, 252, 238, 0.92);
  color: #2b523b;
  box-shadow:
    0 2px 0 rgba(18, 50, 32, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.identity-invite-link:hover,
.identity-invite-link:focus-visible {
  color: #1f3f2c;
  transform: translateY(-1px);
  box-shadow:
    0 3px 0 rgba(18, 50, 32, 0.28),
    0 6px 12px rgba(12, 36, 22, 0.16);
}

button.identity-invite-link {
  appearance: none;
  font: inherit;
  cursor: pointer;
}

.identity-invite-art {
  display: grid;
  place-items: center;
  min-height: 220px;
}

.identity-invite-table {
  width: clamp(190px, 78%, 240px);
  min-width: 190px;
  aspect-ratio: 1.35;
  position: relative;
  border: 7px solid #2d6b4b;
  border-radius: 26px;
  background: #428260;
  box-shadow:
    0 6px 0 #153b28,
    0 12px 20px rgba(10, 36, 22, 0.22);
}

.identity-invite-table i {
  position: absolute;
  width: 46px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 4px solid #f1ead3;
  border-radius: 50%;
  color: #61470e;
  background: #afcdb7;
  box-shadow: 0 4px 0 #193d2a;
  font-style: normal;
  font-weight: 900;
  font-size: 1.15rem;
}

.identity-invite-table i:nth-child(1) {
  top: -24px;
  left: calc(50% - 23px);
}

.identity-invite-table i:nth-child(2) {
  top: calc(50% - 23px);
  right: -24px;
  color: #61470e;
  background: #e9c766;
}

.identity-invite-table i:nth-child(3) {
  bottom: -24px;
  left: calc(50% - 23px);
}

.identity-invite-table i:nth-child(4) {
  top: calc(50% - 23px);
  left: -24px;
}

.table-emblem {
  display: grid;
  grid-template-columns: 30px 72px 30px;
  grid-template-rows: 28px 56px 28px;
  place-items: center;
  width: 132px;
  height: 112px;
}

.table-emblem.is-hero {
  grid-template-columns: 36px 96px 36px;
  grid-template-rows: 36px 72px 36px;
  width: 168px;
  height: 144px;
}

.table-emblem-felt {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background:
    radial-gradient(circle at 40% 30%, rgba(115, 190, 140, 0.28), transparent 50%),
    linear-gradient(165deg, #3c8a60, #245e42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.table-emblem img {
  width: 22px;
  height: auto;
  display: block;
}

.table-emblem.is-hero img {
  width: 26px;
}

.table-emblem-seat.is-n { grid-column: 2; grid-row: 1; }
.table-emblem-seat.is-w { grid-column: 1; grid-row: 2; }
.table-emblem-seat.is-e { grid-column: 3; grid-row: 2; }
.table-emblem-seat.is-s { grid-column: 2; grid-row: 3; }
.table-emblem-seat.is-w img { transform: rotate(-90deg); }
.table-emblem-seat.is-e img { transform: rotate(90deg); }

.identity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px 16px;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--identity-line);
  border-radius: 10px;
  background: var(--paper);
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.identity-row:hover,
.identity-row:focus-visible {
  border-color: rgba(45, 76, 54, 0.28);
}

.identity-row.has-mark {
  grid-template-columns: auto minmax(0, 1fr);
}

.identity-row.is-live {
  grid-template-columns: auto minmax(0, 1fr) auto;
  border-color: rgba(36, 101, 64, 0.28);
  background:
    linear-gradient(180deg, rgba(47, 106, 74, 0.04), transparent 40%),
    var(--paper);
}

.identity-row-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.identity-row-copy strong {
  font-family: var(--identity-display);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.identity-row-copy span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.identity-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.identity-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
}

.identity-inline input {
  flex: 1 1 16rem;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(45, 76, 54, 0.16);
  border-radius: 6px;
  background: #fbfaf6;
  color: var(--ink);
  font: inherit;
}

.identity-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

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

.identity-form label.identity-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.identity-toggle span,
.identity-form label.identity-toggle span {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.identity-toggle input {
  appearance: none;
  width: 42px;
  height: 24px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: #c8d0c9;
  box-shadow: inset 0 0 0 1px rgba(45, 76, 54, 0.12);
  cursor: pointer;
  position: relative;
}

.identity-toggle input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(24, 32, 29, 0.18);
  transition: transform 160ms ease;
}

.identity-toggle input:checked {
  background: var(--green);
}

.identity-toggle input:checked::after {
  transform: translateX(18px);
}

.identity-toggle input:focus-visible {
  outline: 2px solid rgba(55, 113, 89, 0.35);
  outline-offset: 2px;
}

.identity-form {
  display: grid;
  gap: 14px;
  padding: 22px 24px;
}

.identity-panel > .identity-form {
  width: 100%;
  justify-self: stretch;
  padding: 0;
}

.identity-form label {
  display: grid;
  gap: 6px;
}

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

.identity-form input,
.identity-form select,
.identity-form textarea {
  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;
}

.identity-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--identity-line);
}

@media (max-width: 720px) {
  .identity-hero-top,
  .identity-row.is-live,
  .identity-invite {
    grid-template-columns: 1fr;
  }

  .groups-hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .groups-hero-actions .groups-join-cancel {
    width: 100%;
  }

  .identity-invite {
    justify-items: start;
    padding: 26px 20px 28px;
  }

  .identity-invite-art {
    min-height: 180px;
    justify-self: center;
  }

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

  .identity-stat:nth-child(2n) {
    border-right: 0;
  }

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

  .identity-felt.is-accent {
    grid-template-columns: 1fr;
  }

  .identity-felt .identity-invite-link {
    justify-self: start;
  }

  .identity-avatar,
  .identity-monogram {
    width: 56px;
    height: 56px;
  }
}

.groups-directory-head,
.groups-directory {
  width: min(1160px, 100%);
  text-align: left;
}

.groups-directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.groups-directory-head h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.groups-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #2a6b46;
  border-radius: 8px;
  background: linear-gradient(180deg, #4ea572 0%, #36905b 48%, #2e7c4f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 1px 1px rgba(24, 32, 29, 0.16),
    0 3px 6px rgba(24, 32, 29, 0.14);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.groups-create svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.groups-create:hover,
.groups-create:focus-visible {
  border-color: #245c3c;
  background: linear-gradient(180deg, #459666 0%, #2f7d4e 48%, #276844 100%);
  color: #fff;
}

.groups-create:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.28),
    0 1px 1px rgba(24, 32, 29, 0.12);
}

.groups-directory {
  display: grid;
  gap: 22px;
}

.groups-yours,
.groups-discover {
  padding: 18px 20px 20px;
  border: 1px solid var(--identity-line);
  border-radius: 10px;
  background: var(--paper);
}

.groups-yours {
  container-type: inline-size;
}

.groups-yours h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-transform: none;
}

.groups-yours-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.groups-yours .groups-yours-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.groups-yours-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(280px, 100%);
  padding: 18px 16px 16px;
  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;
}

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

.groups-yours-card .groups-seal,
.groups-yours-card img {
  width: 72px;
  height: 72px;
  font-size: 1.05rem;
}

.groups-yours-copy {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.groups-yours-copy strong {
  font-family: var(--identity-display);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.groups-yours-copy span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.groups-yours .groups-yours-card {
  width: auto;
  min-width: 0;
}

.groups-yours .groups-empty {
  min-height: 0;
  max-height: none;
  padding: 4px 0 2px;
}

@container (min-width: 640px) {
  .groups-yours .groups-yours-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@container (min-width: 960px) {
  .groups-yours .groups-yours-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.groups-discover .groups-lede {
  margin: 0 0 14px;
}

.groups-discover .groups-search {
  margin: 0 0 12px;
}

.groups-discover .groups-search input,
.groups-discover .groups-row,
.groups-discover a.groups-row,
.groups-discover button.groups-row {
  background: #fffaf0;
}

.groups-discover .groups-row {
  padding: 12px 14px;
}

.groups-discover a.groups-row:hover,
.groups-discover a.groups-row:focus-visible,
.groups-discover button.groups-row:hover,
.groups-discover button.groups-row:focus-visible {
  background: #f7f1e2;
}

.groups-section h2 {
  margin: 0 0 10px;
  color: rgba(90, 98, 94, 0.72);
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.groups-lede {
  margin: -6px 0 14px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.groups-empty {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 80px;
  max-height: 100px;
  padding: 12px 16px;
}

.groups-empty strong {
  font-family: var(--identity-display);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.groups-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
}

.groups-rule {
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--identity-line);
}

.groups-quiet {
  margin: 0;
  padding: 12px 16px 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

[data-my-groups] {
  min-height: 173px;
}

.groups-image-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.groups-image-form input {
  max-width: 16rem;
  font-size: 0.78rem;
}

.groups-search {
  display: flex;
  margin: 0 0 6px;
  padding: 0;
}

.groups-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--identity-line);
  border-radius: 10px;
  background: #fffaf0;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
}

.groups-search input:focus {
  border-color: rgba(54, 144, 91, 0.55);
  outline: 2px solid rgba(54, 144, 91, 0.28);
  outline-offset: 1px;
}

.groups-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--identity-line);
  border-radius: 10px;
  background: #fffaf0;
  text-align: left;
}

.groups-more {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.groups-more:hover,
.groups-more:focus-visible {
  color: #2d614c;
}

.groups-join-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(440px, calc(100vw - 32px));
  margin: 0;
  padding: 28px 28px 22px;
  border: 1px solid var(--identity-line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(24, 32, 29, 0.22);
  text-align: center;
  transform: translate(-50%, -50%);
}

.groups-join-dialog::backdrop {
  background: rgba(24, 32, 29, 0.38);
}

.groups-join-dialog form {
  display: grid;
  justify-items: center;
}

.groups-join-mark {
  margin-bottom: 14px;
}

.groups-join-mark .groups-seal,
.groups-join-mark img {
  width: 72px;
  height: 72px;
  font-size: 1.05rem;
}

.groups-join-dialog h2 {
  margin: 0 0 6px;
  font-family: var(--identity-display);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.groups-join-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.groups-join-members {
  margin-top: 4px;
}

.groups-join-actions,
.groups-invite-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 22px;
}

.groups-invite-actions .groups-join-cancel,
.groups-invite-actions .groups-join-confirm {
  flex: 1 1 0;
  width: 50%;
  min-width: 0;
}

@media (max-width: 720px) {
  .groups-invite-actions {
    flex-direction: column;
  }

  .groups-invite-actions .groups-join-cancel,
  .groups-invite-actions .groups-join-confirm {
    width: 100%;
  }
}

.groups-join-cancel,
.groups-join-confirm {
  min-width: 7.5rem;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  cursor: pointer;
}

.groups-join-cancel {
  border: 1px solid rgba(45, 76, 54, 0.18);
  background: linear-gradient(180deg, #fff 0%, #f3efe6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(24, 32, 29, 0.08),
    0 1px 1px rgba(24, 32, 29, 0.08),
    0 2px 4px rgba(24, 32, 29, 0.08);
  color: var(--ink);
}

.groups-join-confirm {
  border: 1px solid #2a6b46;
  background: linear-gradient(180deg, #4ea572 0%, #36905b 48%, #2e7c4f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22),
    0 1px 1px rgba(24, 32, 29, 0.16),
    0 3px 6px rgba(24, 32, 29, 0.14);
  color: #fff;
}

.groups-join-cancel:hover,
.groups-join-cancel:focus-visible {
  background: linear-gradient(180deg, #fff 0%, #ebe6db 100%);
}

.groups-join-confirm:hover,
.groups-join-confirm:focus-visible {
  border-color: #245c3c;
  background: linear-gradient(180deg, #459666 0%, #2f7d4e 48%, #276844 100%);
}

.identity-who .groups-hero-seal {
  width: 64px;
  height: 64px;
  font-size: 1rem;
}

.groups-hero-actions {
  display: flex;
  justify-content: flex-end;
  align-self: start;
  gap: 6px;
  margin: 0;
}

.groups-hero-actions .groups-join-cancel {
  min-width: 0;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 0.74rem;
}

.groups-sheet-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(440px, calc(100vw - 32px));
  margin: 0;
  padding: 24px 24px 18px;
  border: 1px solid var(--identity-line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(24, 32, 29, 0.22);
  text-align: left;
  transform: translate(-50%, -50%);
}

.groups-sheet-dialog::backdrop {
  background: rgba(24, 32, 29, 0.38);
}

.groups-sheet-dialog form {
  display: grid;
  gap: 12px;
}

.groups-sheet-dialog h2 {
  margin: 0;
  font-family: var(--identity-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.groups-sheet-dialog p {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.groups-sheet-dialog label {
  display: grid;
  gap: 6px;
}

.groups-sheet-dialog label span,
.groups-sheet-dialog legend {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.groups-sheet-dialog input[type="email"],
.groups-sheet-dialog input[type="text"]:not(.groups-create-name):not(.groups-create-subtitle) {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(45, 76, 54, 0.18);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.groups-list .groups-row:first-child {
  border-top: 0;
}

a.groups-row,
button.groups-row {
  width: 100%;
  appearance: none;
  border-right: 0;
  border-left: 0;
  border-bottom: 1px solid rgba(45, 76, 54, 0.08);
  background: #fff;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

a.groups-row:hover,
a.groups-row:focus-visible,
button.groups-row:hover,
button.groups-row:focus-visible {
  background: #f7f6f3;
}

.groups-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 0;
  padding: 11px 2px;
  border: 0;
  border-bottom: 1px solid rgba(45, 76, 54, 0.08);
  border-radius: 0;
}

.groups-list .groups-row:last-child {
  border-bottom: 0;
}

.groups-row img,
.groups-seal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: #f4f1ea;
}

.groups-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(45, 76, 54, 0.22);
  color: #2c4036;
  font-family: var(--identity-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.groups-seal[data-tone="1"] {
  background: #f7f3ea;
  border-color: rgba(92, 74, 48, 0.22);
  color: #5c4a30;
}

.groups-seal[data-tone="2"] {
  background: #eef2ee;
  border-color: rgba(47, 74, 62, 0.24);
  color: #2f4a3e;
}

.groups-seal[data-tone="3"] {
  background: #f3efe8;
  border-color: rgba(74, 68, 58, 0.22);
  color: #4a443a;
}

.groups-seal[data-tone="4"] {
  background: #f6f1ea;
  border-color: rgba(90, 62, 48, 0.2);
  color: #5a3e30;
}

.groups-row-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.groups-row-title {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.groups-official {
  display: inline;
  padding: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: none;
}

.groups-row-facts {
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(90, 98, 94, 0.9);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.groups-meta {
  display: inline-flex;
  align-items: center;
  gap: 0;
}

.groups-meta > span + span::before {
  content: "·";
  margin-right: 7px;
  margin-left: 7px;
  color: rgba(45, 76, 54, 0.35);
  font-weight: 500;
}

.groups-members {
  min-width: 0;
  text-align: right;
}

.groups-join {
  min-width: 2.5rem;
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.groups-chevron {
  width: auto;
  height: auto;
  border: 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  transform: none;
}

.groups-row-head {
  border-top: 0;
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.groups-row strong {
  font-family: var(--identity-display);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.groups-row-copy > span:last-child {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.groups-visibility {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.groups-visibility legend {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.groups-visibility label {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(45, 76, 54, 0.14);
  border-radius: 8px;
  text-align: left;
}

.groups-visibility label span {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.groups-visibility small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.groups-create-form {
  display: grid;
  gap: 18px;
  width: min(720px, 100%);
  margin-top: 18px;
  padding: 22px;
  background: var(--paper);
}

.groups-create-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.groups-create-preview .groups-seal,
.groups-create-preview img {
  width: 64px;
  height: 64px;
  font-size: 1rem;
}

.groups-create-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.groups-create-form .groups-create-name,
.groups-create-form .groups-create-subtitle,
.groups-edit-dialog .groups-create-name,
.groups-edit-dialog .groups-create-subtitle {
  width: 100%;
  border: 1px solid rgba(45, 76, 54, 0.18);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.groups-create-form .groups-create-name,
.groups-edit-dialog .groups-create-name {
  min-height: 40px;
  padding: 0 10px;
  font-family: var(--identity-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.groups-create-form .groups-create-subtitle,
.groups-edit-dialog .groups-create-subtitle {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.groups-create-form .groups-create-name:focus,
.groups-create-form .groups-create-subtitle:focus,
.groups-edit-dialog .groups-create-name:focus,
.groups-edit-dialog .groups-create-subtitle:focus {
  border-color: rgba(54, 144, 91, 0.45);
  outline: 2px solid rgba(54, 144, 91, 0.18);
  outline-offset: 1px;
}

.groups-drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 28px 16px;
  border: 1.5px dashed rgba(45, 76, 54, 0.28);
  border-radius: 10px;
  background: #fffaf0;
  text-align: center;
}

.groups-drop.is-over {
  border-color: var(--green);
  background: rgba(54, 144, 91, 0.06);
}

.groups-drop strong {
  font-size: 0.95rem;
  font-weight: 750;
}

.groups-drop span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.groups-drop input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.groups-create-form .groups-create {
  justify-self: start;
}

.groups-edit-dialog .groups-visibility-locked {
  margin: 0;
}

.social-body[data-social-page="home"] main.identity-page {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.home-layout {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.8fr);
  gap: 16px;
  align-items: stretch;
  min-height: 0;
  margin-top: 8px;
}

.home-main,
.home-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.home-main {
  align-content: start;
}

.home-side {
  display: flex;
  flex-direction: column;
}

.home-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--identity-line);
  border-radius: 10px;
  background: var(--paper);
}

.home-card h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.home-puzzle {
  justify-items: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
}

.home-puzzle-title {
  margin: 2px 0 0;
  font-family: var(--identity-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.home-puzzle-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.home-puzzle .home-puzzle-go {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  font-size: 0.95rem;
}

.home-board {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.home-actions {
  display: grid;
  gap: 8px;
}

.home-actions .hub-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  align-items: center;
  background: linear-gradient(165deg, #fffdf8 0%, #f4ead4 100%);
}

.home-actions .hub-choice-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #36905b;
  color: #fff;
}

.home-actions .hub-choice-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.home-actions .hub-choice-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.home-puzzle-go {
  width: 100%;
}

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

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.home-more {
  color: #2d614c;
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
}

.home-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-groups .groups-yours-card {
  width: auto;
  min-width: 0;
}

.home-groups .groups-yours-copy {
  width: 100%;
  min-width: 0;
}

.home-groups .groups-yours-copy strong,
.home-groups .groups-yours-copy span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-matches {
  display: grid;
}

.home-match {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid rgba(45, 76, 54, 0.1);
  color: inherit;
  text-decoration: none;
}

.home-match:first-child {
  border-top: 0;
  padding-top: 0;
}

.home-match strong {
  font-family: var(--identity-display);
  font-size: 1.1rem;
}

.home-streak {
  background: linear-gradient(165deg, #fffdf8 0%, #f4ead4 100%);
}

.home-streak .puzzle-streak-count {
  justify-content: flex-start;
}

.home-streak .puzzle-streak-days {
  flex-wrap: wrap;
}

.home-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--identity-line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.home-footer p {
  margin: 0;
}

.home-footer-social,
.home-footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.home-footer-social {
  gap: 8px;
}

.home-footer-social a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--identity-line);
  border-radius: 8px;
  background: var(--paper);
  color: #3d4a42;
}

.home-footer-social a:hover,
.home-footer-social a:focus-visible {
  color: var(--green-dark);
  border-color: rgba(45, 97, 76, 0.4);
}

.home-footer-social svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.home-footer-legal {
  gap: 6px 14px;
}

.home-footer-legal a,
.legal-doc a {
  color: #2d614c;
  font-weight: 750;
  text-decoration: none;
}

.home-footer-legal a:hover,
.home-footer-legal a:focus-visible,
.legal-doc a:hover,
.legal-doc a:focus-visible {
  text-decoration: underline;
}

.legal-doc {
  width: min(760px, 100%);
  display: grid;
  gap: 22px;
  padding: 22px 24px 28px;
  border: 1px solid var(--identity-line);
  border-radius: 10px;
  background: var(--paper);
}

.legal-doc header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.legal-doc section {
  display: grid;
  gap: 8px;
}

.legal-doc h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.legal-doc h2 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.legal-doc p,
.legal-doc li {
  margin: 0;
  color: #3c463f;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.55;
}

.legal-doc ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 1.15rem;
}

@media (max-width: 900px) {
  .social-body[data-social-page="home"] main.identity-page {
    min-height: calc(100svh - 64px);
  }

  .home-layout {
    display: flex;
    flex-direction: column;
  }

  .home-main,
  .home-side {
    display: contents;
  }

  .home-main > .home-card:first-child {
    order: 1;
  }

  .home-puzzle {
    order: 2;
  }

  .home-main > [data-home-groups] {
    order: 3;
  }

  .home-main > [data-home-recent] {
    order: 4;
  }

  .home-streak {
    order: 5;
  }

  .home-footer {
    order: 6;
  }
}

.puzzle-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.puzzle-page-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.puzzle-streak {
  display: grid;
  justify-items: end;
  gap: 6px;
  margin-left: auto;
  padding: 10px 12px 12px;
  border: 1px solid var(--identity-line);
  border-radius: 10px;
  background: linear-gradient(165deg, #fffdf8 0%, #f4ead4 100%);
}

.puzzle-streak-count {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
}

.puzzle-streak-count strong {
  font-family: var(--identity-display);
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.puzzle-streak-count span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.puzzle-streak-days {
  display: flex;
  gap: 6px;
}

.puzzle-streak-day {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
}

.puzzle-streak-day .puzzle-tile,
.puzzle-streak-day .puzzle-tile img {
  width: 22px;
}

.puzzle-streak-day .puzzle-solved {
  width: 12px;
  height: 12px;
  right: -3px;
  bottom: -2px;
}

.puzzle-streak-day .puzzle-solved svg {
  width: 8px;
  height: 8px;
}

.puzzle-board {
  width: min(1160px, 100%);
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.puzzle-day-card {
  width: min(720px, 100%);
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid var(--identity-line);
  border-radius: 10px;
  background: var(--paper);
}

.puzzle-live.play-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  grid-template-areas: "stage" "rail";
  width: 100%;
  margin: 12px 0 0;
  margin-left: 0;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow: visible;
}

.puzzle-live .play-stage {
  container-type: size;
  width: min(100%, 52rem);
  justify-self: center;
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 8.5rem);
  aspect-ratio: 1 / 1.22;
  padding: 0;
}

.puzzle-live .play-meta {
  height: auto;
  max-height: 24rem;
  overflow: auto;
  border-left: 0;
  border-top: 1px solid var(--play-line);
}

.puzzle-live .puzzle-rail {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  color: var(--play-ink, #e8eee6);
}

.puzzle-live .puzzle-head {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.puzzle-live .puzzle-title,
.puzzle-live .puzzle-step {
  margin: 0;
}

.puzzle-live .puzzle-title {
  font-size: 1.15rem;
  font-weight: 750;
}

.puzzle-live .puzzle-step {
  color: rgba(244, 239, 228, 0.55);
  font-size: 0.82rem;
}

.puzzle-live .puzzle-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: auto;
  min-height: 0;
}

.puzzle-live .puzzle-beat {
  display: flex;
  max-width: 100%;
}

.puzzle-live .puzzle-beat.is-player {
  justify-content: flex-end;
}

.puzzle-live .puzzle-bubble {
  max-width: 16rem;
  margin: 0;
  padding: 0.7rem 0.8rem;
  border-radius: 0.85rem;
  background: #f7f1e6;
  color: #241c14;
}

.puzzle-live .puzzle-beat.is-player .puzzle-bubble {
  background: #e7f0e4;
}

.puzzle-live .puzzle-bubble.is-correct {
  background: #e7f6ea;
}

.puzzle-live .puzzle-bubble.is-incorrect {
  background: #fdecec;
}

.puzzle-live .puzzle-bubble strong {
  display: block;
  margin-bottom: 0.25rem;
}

.puzzle-live .puzzle-bubble p {
  margin: 0.35rem 0 0;
}

.puzzle-live .puzzle-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.puzzle-live .puzzle-hint,
.puzzle-live .puzzle-next,
.puzzle-live .puzzle-restart {
  width: 100%;
  min-height: 2.7rem;
  border: 0;
  border-radius: 0.55rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.puzzle-live .puzzle-hint,
.puzzle-live .puzzle-restart {
  background: #2a2622;
  color: #f4efe4;
}

.puzzle-live .puzzle-next {
  background: #6fbf73;
  color: #142116;
}

.puzzle-live .mj-tile.is-accepted .mj-tile-body,
.puzzle-live .mj-tile.is-hinted .mj-tile-body,
.puzzle-live .action-chip.is-hinted {
  outline: 3px solid #f1c75b;
  outline-offset: 2px;
}

.puzzle-missing {
  margin-top: 18px;
}

@media (max-width: 900px) {
  .puzzle-live .play-stage {
    container-type: inline-size;
    width: 100%;
    max-height: none;
    aspect-ratio: auto;
  }

  .puzzle-live .puzzle-foot {
    flex-direction: row;
  }
}

.puzzle-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-bottom: 12px;
}

.puzzle-toolbar h2 {
  margin: 0;
  font-family: var(--identity-display);
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.puzzle-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.puzzle-today,
.puzzle-nav {
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  cursor: pointer;
}

.puzzle-nav {
  font-size: 1.15rem;
  line-height: 1;
}

.puzzle-today:hover,
.puzzle-today:focus-visible,
.puzzle-nav:hover,
.puzzle-nav:focus-visible {
  color: var(--ink);
  background: rgba(45, 76, 54, 0.06);
}

.puzzle-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.puzzle-week,
.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
}

.puzzle-week {
  border: 1px solid rgba(45, 76, 54, 0.12);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #fffaf0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.puzzle-week span {
  padding: 6px 0;
  border-right: 1px solid rgba(45, 76, 54, 0.1);
  text-align: center;
}

.puzzle-week span:last-child {
  border-right: 0;
}

.puzzle-grid {
  border: 1px solid rgba(45, 76, 54, 0.12);
  border-radius: 0 0 10px 10px;
  overflow: hidden;
  background: #fff;
}

.puzzle-day,
.puzzle-pad {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-height: 108px;
  padding: 10px 6px 12px;
  border-right: 1px solid rgba(45, 76, 54, 0.1);
  border-bottom: 1px solid rgba(45, 76, 54, 0.1);
  color: inherit;
  text-decoration: none;
}

a.puzzle-day {
  width: 100%;
  border-top: 0;
  border-left: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.puzzle-open-dialog .groups-join-mark .puzzle-tile,
.puzzle-open-dialog .groups-join-mark .puzzle-tile img {
  width: 72px;
  height: auto;
}
.puzzle-day:nth-child(7n),
.puzzle-pad:nth-child(7n) {
  border-right: 0;
}

.puzzle-day:hover,
.puzzle-day:focus-visible {
  background: #fffaf0;
}

.puzzle-day.is-today {
  background: rgba(54, 144, 91, 0.08);
  box-shadow: inset 0 0 0 1px rgba(54, 144, 91, 0.4);
}

.puzzle-today-label {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #245e42;
}

.puzzle-num {
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--muted);
}

.puzzle-day.is-today .puzzle-num {
  color: #245e42;
}

.puzzle-tile {
  position: relative;
  width: 52px;
}

.puzzle-tile img,
.puzzle-tile .tile {
  display: block;
  width: 52px;
  height: auto;
  aspect-ratio: 512 / 704;
}

.puzzle-grid.is-tiles-pending:not(.is-tiles-ready) .puzzle-tile img {
  visibility: hidden;
}

.puzzle-tile.is-sealed img,
.puzzle-day.is-future .puzzle-tile.is-sealed img,
.puzzle-day.is-ahead .puzzle-tile.is-sealed img {
  filter: grayscale(1) brightness(2.1);
  opacity: 0.28;
}

.puzzle-tile.is-faded img,
.puzzle-tile.is-faded .tile {
  opacity: 0.38;
}

.puzzle-day.is-open:not(.is-done):not(.is-future) .puzzle-tile {
  background: #fff;
  border-radius: 8px;
}

.puzzle-day.is-open:not(.is-done):not(.is-future) .puzzle-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: rgba(88, 96, 92, 0.42);
  pointer-events: none;
}

.puzzle-day.is-future .puzzle-num,
.puzzle-day.is-future .puzzle-tile img,
.puzzle-day.is-ahead .puzzle-num,
.puzzle-day.is-ahead .puzzle-tile img {
  filter: grayscale(1);
  opacity: 0.45;
}

.puzzle-day.is-future .puzzle-num {
  opacity: 0.32;
}

.puzzle-solved {
  position: absolute;
  right: -4px;
  bottom: -4px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #36905b;
  color: #fffaf0;
}

.puzzle-solved svg {
  width: 13px;
  height: 13px;
}

.puzzle-day-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.puzzle-day-card .puzzle-tile {
  width: 64px;
}

.puzzle-day-card .puzzle-tile img,
.puzzle-day-card .puzzle-tile .tile {
  width: 64px;
}

.puzzle-day-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.puzzle-day-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.groups-visibility input {
  width: auto;
  min-height: 0;
  margin: 0;
}

@media (min-width: 901px) {
  main.identity-page,
  main.profile-main,
  .social-body main.social-main.identity-page {
    box-sizing: border-box;
    width: auto;
    max-width: none;
    margin-left: var(--sidebar);
    padding-inline: max(28px, calc((100vw - var(--sidebar) - 1120px) / 2));
  }

  .social-body[data-social-page="groups"] main.identity-page,
  .social-body[data-social-page="group-new"] main.identity-page,
  .social-body[data-social-page="puzzle"] main.identity-page,
  .social-body[data-social-page="puzzle-day"] main.identity-page,
  .social-body[data-social-page="learn"] main.identity-page,
  .social-body[data-social-page="home"] main.identity-page {
    padding-inline: max(28px, calc((100vw - var(--sidebar) - 1160px) / 2));
  }
}

@media (max-width: 720px) {
  .puzzle-page-head {
    flex-direction: column;
  }

  .puzzle-streak {
    justify-items: start;
    margin-left: 0;
  }

  .puzzle-day,
  .puzzle-pad {
    min-height: 0;
    gap: 4px;
    padding: 8px 6px 10px;
  }

  .puzzle-grid .puzzle-tile,
  .puzzle-grid .puzzle-tile img,
  .puzzle-grid .puzzle-tile .tile {
    width: 28px;
  }

  .puzzle-num {
    font-size: 0.68rem;
  }

  .puzzle-grid .puzzle-solved {
    width: 15px;
    height: 15px;
  }
}

.upgrade-card {
  display: grid;
  gap: 16px;
  max-width: 32rem;
}

.upgrade-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.upgrade-plan {
  position: relative;
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 14px 14px 12px;
  border: 1px solid var(--identity-line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.account-form .upgrade-plan {
  gap: 2px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 550;
}

.upgrade-plan[hidden] {
  display: none;
}

.upgrade-plan.is-selected {
  border-color: #1d4f37;
  box-shadow: inset 0 0 0 1px #1d4f37;
}

.upgrade-plan input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upgrade-plan-label,
.upgrade-cadence {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.upgrade-price {
  font-family: var(--identity-display);
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.upgrade-payment {
  min-height: 2.5rem;
}

.upgrade-card .identity-button-primary {
  width: 100%;
}
