:root {
  --bg: #fff8ec;
  --surface: #fffdf8;
  --surface-soft: #fff4df;
  --ink: #172026;
  --muted: #63726a;
  --line: #eadfce;
  --life: #2fbf71;
  --life-deep: #167b4a;
  --sun: #f6c453;
  --coral: #ff7a6b;
  --sky: #48bfe3;
  --life-pastel: #a8e5bf;
  --sun-pastel: #f7dda0;
  --coral-pastel: #ffb8af;
  --sky-pastel: #a8dff0;
  --accent: var(--life);
  --accent-strong: var(--life-deep);
  --error: #d94c4c;
  --cream-wash: #fffaf1;
  --shadow: 0 24px 70px rgba(23, 32, 38, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.72fr);
  gap: 56px;
  align-items: center;
  padding: 48px 0;
}

.intro {
  display: grid;
  gap: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-logo {
  width: min(300px, 72vw);
  height: auto;
  display: block;
}

.compact-logo {
  width: min(248px, 68vw);
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: block;
  box-shadow: 0 10px 26px rgba(47, 191, 113, 0.28);
}

.hero-copy {
  max-width: 720px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent-strong);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

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

h1 {
  margin-bottom: 24px;
  font-size: clamp(2.8rem, 8vw, 5.9rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  color: #3b4b42;
  font-size: 1.15rem;
  line-height: 1.65;
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 720px;
}

.principles div {
  border-top: 1px solid rgba(47, 191, 113, 0.35);
  padding-top: 18px;
}

.principles strong,
.principles span {
  display: block;
}

.principles strong {
  font-size: 1rem;
}

.principles span {
  margin-top: 4px;
  color: var(--muted);
}

.auth-panel {
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(234, 223, 206, 0.95);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 28px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.tab.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(23, 32, 38, 0.08);
}

.panel-header {
  margin: 26px 0 22px;
}

.panel-header h2 {
  margin-bottom: 8px;
  font-size: 1.55rem;
}

.panel-header p {
  color: var(--muted);
  line-height: 1.5;
}

.social-grid {
  display: grid;
  gap: 10px;
}

.provider {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.provider:hover,
.provider:focus-visible,
.primary-action:hover,
.primary-action:focus-visible,
.icon-button:hover,
.icon-button:focus-visible {
  outline: 3px solid rgba(47, 191, 113, 0.28);
  outline-offset: 2px;
}

.provider-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--sun);
  font-weight: 800;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.auth-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.text-action {
  justify-self: start;
  padding: 0;
  border: 0;
  color: var(--life-deep);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
}

.text-action:hover,
.text-action:focus-visible {
  text-decoration: underline;
  outline: none;
}

label {
  font-weight: 700;
}

input[type="email"],
input[type="password"],
input[type="text"],
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: #fffefa;
}

input:focus,
select:focus {
  outline: 3px solid rgba(72, 191, 227, 0.26);
  border-color: var(--accent);
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
}

.icon-button {
  min-width: 48px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.hint,
.field-error,
.status {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

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

.field-error {
  min-height: 20px;
  color: var(--error);
}

.checkline {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: #3b4b42;
  font-weight: 500;
  line-height: 1.45;
}

.checkline input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.captcha-wrap {
  min-height: 65px;
  overflow: hidden;
}

.captcha-wrap iframe {
  max-width: 100%;
}

.primary-action {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #092318;
  background: linear-gradient(105deg, var(--life-pastel) 0%, var(--sun-pastel) 33%, var(--coral-pastel) 66%, var(--sky-pastel) 100%);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(47, 191, 113, 0.28);
}

.primary-action.with-mark::before {
  content: "";
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: url("/assets/lifeestra-mark.svg") center / contain no-repeat;
  box-shadow: 0 6px 14px rgba(23, 32, 38, 0.14);
}

.status {
  min-height: 22px;
  color: var(--life-deep);
  font-weight: 700;
}

.security-note {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.5;
}

.security-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.is-hidden {
  display: none !important;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0 56px;
}

.app-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 48px;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  gap: 24px;
  align-items: start;
}

.app-content {
  min-width: 0;
}

.secondary-action {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.88);
  font-weight: 800;
  cursor: pointer;
}

.secondary-action:hover,
.secondary-action:focus-visible {
  outline: 3px solid rgba(255, 122, 107, 0.24);
  outline-offset: 2px;
}

.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 32px;
  align-items: end;
  margin-bottom: 42px;
}

.profile-hero h1 {
  max-width: 760px;
  font-size: clamp(2.4rem, 7vw, 5rem);
}

.identity-card,
.contribution-panel,
.settings-card {
  border: 1px solid rgba(234, 223, 206, 0.95);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 18px 48px rgba(23, 32, 38, 0.11);
}

.identity-card {
  padding: 22px;
}

.identity-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.identity-card strong {
  display: block;
  margin: 10px 0;
  overflow-wrap: anywhere;
  font-size: 1.25rem;
}

.identity-card p,
.contribution-panel p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.daily-section {
  margin-bottom: 28px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.section-heading h2,
.contribution-panel h2 {
  margin-bottom: 0;
  font-size: 1.8rem;
}

.primary-action.compact {
  width: auto;
  min-width: 230px;
  padding: 0 18px;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.daily-mission {
  min-height: 312px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: 0 10px 28px rgba(23, 32, 38, 0.06);
}

.daily-mission h3 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
}

.daily-mission p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.mission-card-topline,
.mission-controls,
.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mission-kind,
.mission-points {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mission-kind { color: var(--ink); }
.mission-points { color: var(--life-deep); }

.foundation-mission {
  border-top: 4px solid var(--life);
}

.connection-mission {
  border-top: 4px solid var(--sun);
}

.body-mission {
  border-top: 4px solid var(--coral);
}

.growth-mission {
  border-top: 4px solid var(--sky);
}

.mission-controls { align-items: stretch; }

.mission-complete {
  min-height: 40px;
  flex: 1 1 auto;
  border: 0;
  border-radius: 7px;
  color: #092318;
  background: rgba(47, 191, 113, 0.22);
  font-weight: 800;
  cursor: pointer;
}

.mission-text-action {
  border: 0;
  padding: 0 4px;
  color: var(--muted);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}

.mission-complete:hover,
.mission-complete:focus-visible,
.mission-text-action:hover,
.mission-text-action:focus-visible {
  outline: 3px solid rgba(47, 191, 113, 0.22);
  outline-offset: 2px;
}

.daily-mission.is-complete {
  background: rgba(231, 249, 238, 0.85);
  border-color: rgba(47, 191, 113, 0.55);
}

.daily-mission.is-complete h3::before {
  content: "Ukończone: ";
  color: var(--life-deep);
}

.daily-mission.is-complete .mission-complete {
  color: #fff;
  background: var(--life-deep);
}

.contribution-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px;
}

.contribution-actions {
  display: grid;
  gap: 10px;
}

.contribution-status {
  max-width: 260px;
  margin: 0;
  color: var(--life-deep);
  font-weight: 700;
  line-height: 1.4;
}

.contribution-dialog {
  width: min(540px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.contribution-dialog::backdrop { background: rgba(23, 32, 38, 0.38); }

.contribution-form { display: grid; gap: 18px; padding: 24px; }
.dialog-heading h2 { margin: 0; font-size: 1.65rem; }
.dialog-heading .eyebrow { margin-bottom: 6px; }

.dialog-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fffefa;
  font: inherit;
}

textarea:focus { outline: 3px solid rgba(72, 191, 227, 0.26); border-color: var(--accent); }

.visibility-row { display: flex; align-items: center; gap: 10px; color: #3b4b42; font-weight: 600; }
.visibility-row input { width: 18px; height: 18px; accent-color: var(--life); }

.settings-sidebar {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 14px;
}

.settings-card {
  padding: 18px;
}

.profile-summary {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(47, 191, 113, 0.12), rgba(246, 196, 83, 0.1)),
    rgba(255, 253, 248, 0.94);
}

.avatar-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(47, 191, 113, 0.16);
}

.avatar-mark img {
  width: 46px;
  height: 46px;
}

.settings-card h2,
.settings-card h3 {
  margin: 0;
}

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

.profile-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.settings-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.settings-card-header span {
  border: 1px solid rgba(47, 191, 113, 0.28);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--life-deep);
  background: rgba(47, 191, 113, 0.1);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.settings-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: rgba(255, 244, 223, 0.56);
  text-align: left;
  cursor: pointer;
}

.settings-row:hover,
.settings-row:focus-visible {
  outline: 3px solid rgba(72, 191, 227, 0.22);
  outline-offset: 2px;
  border-color: rgba(72, 191, 227, 0.32);
  background: rgba(255, 253, 248, 0.98);
}

.settings-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(23, 32, 38, 0.04);
}

.life-dot {
  background: var(--life);
}

.sun-dot {
  background: var(--sun);
}

.coral-dot {
  background: var(--coral);
}

.sky-dot {
  background: var(--sky);
}

.switch-row {
  min-height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  color: #3b4b42;
  font-weight: 700;
}

.switch-row + .switch-row {
  border-top: 1px solid var(--line);
}

.switch-row input {
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  accent-color: var(--life);
  cursor: pointer;
}

.daily-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(234, 223, 206, 0.72);
}

.daily-meter span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--life), var(--sun), var(--coral));
}

.sidebar-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.profile-view {
  display: grid;
  gap: 0;
}

.profile-view-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.profile-action-group {
  display: flex;
  gap: 10px;
}

.profile-pillar-action {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 16px;
  color: var(--ink);
  background: linear-gradient(105deg, var(--life-pastel) 0%, var(--sun-pastel) 33%, var(--coral-pastel) 66%, var(--sky-pastel) 100%);
  box-shadow: 0 10px 22px rgba(23, 32, 38, 0.12);
  font-weight: 800;
  cursor: pointer;
}

.profile-pillar-action:hover,
.profile-pillar-action:focus-visible {
  outline: 3px solid rgba(72, 191, 227, 0.32);
  outline-offset: 2px;
}

.profile-cover {
  height: 172px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: var(--surface-soft);
}

.profile-cover span:nth-child(1) { background: var(--life); }
.profile-cover span:nth-child(2) { background: var(--sun); }
.profile-cover span:nth-child(3) { background: var(--coral); }
.profile-cover span:nth-child(4) { background: var(--sky); }

.member-header {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 0 28px 28px;
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  background: var(--surface);
}

.member-avatar-wrap {
  width: 116px;
  height: 116px;
  align-self: start;
  margin-top: -58px;
  overflow: hidden;
  border: 6px solid var(--surface);
  border-radius: 8px;
  background: var(--surface-soft);
  box-shadow: 0 16px 36px rgba(23, 32, 38, 0.15);
}

.member-avatar {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.member-intro .eyebrow { margin-bottom: 6px; }

.member-intro h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 5vw, 3.6rem);
}

.member-location,
.member-bio {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.member-bio { margin-top: 10px; max-width: 660px; color: #3b4b42; }

.member-stats {
  display: grid;
  gap: 12px;
  min-width: 440px;
  align-self: end;
  margin-top: 24px;
}

.member-stat-summary,
.member-pillar-stats {
  display: grid;
  justify-content: center;
}

.member-stat-summary { grid-template-columns: repeat(3, minmax(104px, 1fr)); width: 330px; margin: 0 auto; }
.member-pillar-stats { grid-template-columns: repeat(4, minmax(98px, 1fr)); gap: 8px; }

.member-stat-summary > div { padding: 0 10px; text-align: center; }
.member-stat-summary > div + div { border-left: 1px solid var(--line); }
.member-pillar-stats > div { padding: 10px 10px 8px; background: rgba(255, 244, 223, 0.58); }
.member-stats strong,
.member-stats span { display: block; }
.member-stats strong { color: var(--life-deep); font-size: 1.35rem; }
.member-stats span { margin-top: 4px; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.member-stats .stat-foundation strong { color: var(--life-deep); }
.member-stats .stat-connection strong { color: #8b6100; }
.member-stats .stat-body strong { color: #a94135; }
.member-stats .stat-growth strong { color: #176f8c; }
.member-stats .stat-rewards strong { color: #8b6100; }
.member-stats .stat-followers strong { color: #176f8c; }
.pillar-stat i { display: block; height: 4px; margin-top: 9px; border-radius: 999px; }
.pillar-stat.stat-foundation i { background: var(--life); }
.pillar-stat.stat-connection i { background: var(--sun); }
.pillar-stat.stat-body i { background: var(--coral); }
.pillar-stat.stat-growth i { background: var(--sky); }

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 310px);
  gap: 24px;
  margin-top: 28px;
  align-items: start;
}

.profile-section-heading { align-items: flex-end; }
.wall-caption { color: var(--muted); font-size: 0.86rem; font-weight: 700; }

.wall-composer,
.wall-post,
.profile-rail-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 12px 30px rgba(23, 32, 38, 0.06);
}

.wall-composer { padding: 18px; }
.wall-composer textarea { min-height: 94px; }

.wall-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.wall-composer-actions .primary-action { min-height: 44px; padding: 0 16px; }

.wall-feed { display: grid; gap: 14px; margin-top: 16px; }
.wall-post { padding: 18px; }
.wall-post > p { margin: 16px 0; color: #3b4b42; line-height: 1.55; }

.post-heading { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.post-heading strong { display: block; }
.post-heading p { margin: 3px 0 0; color: var(--muted); font-size: 0.85rem; }
.post-heading time { color: var(--muted); font-size: 0.82rem; }

.post-symbol {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 900;
}

.achievement-symbol { background: rgba(246, 196, 83, 0.38); }
.harmony-symbol { background: rgba(47, 191, 113, 0.24); }

.post-actions { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }

.reaction-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}

.reaction-button.is-reacted { color: var(--life-deep); border-color: rgba(47, 191, 113, 0.5); background: rgba(47, 191, 113, 0.1); }

.profile-rail { display: grid; gap: 14px; }
.profile-rail-card { padding: 18px; }
.profile-rail-card h2 { margin-bottom: 14px; font-size: 1.3rem; line-height: 1.2; }
.profile-rail-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.5; }

.achievement-list { display: grid; gap: 12px; }
.achievement-item { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: center; }
.achievement-item strong { display: block; font-size: 0.94rem; }
.achievement-item p { margin: 4px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.35; }

.achievement-badge { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; font-size: 0.76rem; font-weight: 900; }
.green-badge { background: rgba(47, 191, 113, 0.21); color: var(--life-deep); }
.gold-badge { background: rgba(246, 196, 83, 0.28); color: #8b6100; }
.coral-badge { background: rgba(255, 122, 107, 0.21); color: #a94135; }
.sky-badge { background: rgba(72, 191, 227, 0.21); color: #176f8c; }

.identity-preview .secondary-action { width: 100%; margin-top: 4px; }

.profile-dialog { width: min(560px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 8px; padding: 0; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.profile-dialog::backdrop { background: rgba(23, 32, 38, 0.38); }
.profile-form { display: grid; gap: 18px; padding: 24px; }

.profile-photo-field { display: grid; grid-template-columns: 72px auto; column-gap: 14px; align-items: center; }
.profile-photo-field img { grid-row: span 2; width: 72px; height: 72px; border-radius: 8px; object-fit: cover; background: var(--surface-soft); }
.profile-photo-field p { grid-column: 2; margin: 5px 0 0; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.photo-upload { width: fit-content; min-height: 38px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; padding: 0 12px; color: var(--ink); background: var(--surface-soft); cursor: pointer; font-weight: 800; }
.photo-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.profile-form-status { min-height: 18px; margin: -6px 0 0; color: var(--error); font-size: 0.86rem; font-weight: 700; }

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

@media (max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 28px 0;
  }

  .intro {
    gap: 32px;
  }

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

  h1 {
    font-size: clamp(2.55rem, 14vw, 4.2rem);
  }

  .profile-hero,
  .contribution-panel,
  .app-layout,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .member-header { grid-template-columns: 100px minmax(0, 1fr); }
  .member-stats { grid-column: 1 / -1; min-width: 0; }

  .settings-sidebar {
    position: static;
  }

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

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action.compact {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .shell {
    width: min(100% - 20px, 1180px);
  }

  .auth-panel {
    padding: 18px;
  }

  .app-shell {
    width: min(100% - 20px, 1180px);
  }

  .app-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .mission-controls { flex-wrap: wrap; }
  .contribution-actions .primary-action { width: 100%; }
  .profile-view-actions,
  .wall-composer-actions { align-items: stretch; flex-direction: column; }
  .profile-action-group { display: grid; grid-template-columns: 1fr 1fr; }
  .member-header { grid-template-columns: 1fr; padding: 0 18px 20px; }
  .member-avatar-wrap { width: 96px; height: 96px; margin-top: -48px; }
  .member-stats { min-width: 0; }
  .member-stat-summary { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .member-pillar-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .member-pillar-stats > div { padding: 10px; }
  .profile-cover { height: 112px; }
  .post-heading { grid-template-columns: 42px minmax(0, 1fr); }
  .post-heading time { grid-column: 2; }
}
