:root {
  --ivory: #f7f0e3;
  --ivory-deep: #eee1cd;
  --cream: #fffaf1;
  --cream-strong: #fffdf8;
  --forest: #315543;
  --forest-deep: #1e372c;
  --forest-soft: #dce8dc;
  --gold: #ae8335;
  --gold-soft: #f2e6c8;
  --terra: #a95f45;
  --terra-soft: #f3dfd5;
  --ink: #28342d;
  --muted: #6b7267;
  --line: #ded2be;
  --line-strong: #cbbd9f;
  --header-bg: rgb(255 250 241 / 0.88);
  --header-line: rgb(203 189 159 / 0.7);
  --card-bg: rgb(255 250 241 / 0.91);
  --footer-bg: var(--forest-deep);
  --footer-text: #e8ddca;
  --footer-accent: var(--gold-soft);
  --footer-hover-text: var(--cream-strong);
  --footer-hover-bg: rgb(255 250 241 / 0.12);
  --footer-hover-line: rgb(255 250 241 / 0.16);
  --user-card-bg: #eee5d5;
  --control-bg: rgb(255 250 241 / 0.86);
  --heading-bg: linear-gradient(130deg, rgb(255 253 248 / 0.95), rgb(248 240 227 / 0.95));
  --admin-heading-bg: linear-gradient(130deg, #f7ead3, #fffaf1);
  --profile-bg: linear-gradient(140deg, var(--cream-strong), #f2e5cf);
  --form-bg: rgb(238 225 205 / 0.45);
  --empty-bg: rgb(255 250 241 / 0.6);
  --reply-bg: #f6eddf;
  --upload-bg: #f5ead8;
  --failure-bg: rgb(243 223 213 / 0.56);
  --failure-text: #7e3f32;
  --body-radial: rgb(242 230 200 / 0.9);
  --body-start: #faf4e9;
  --body-end: #f5eddf;
  --shadow: 0 18px 45px rgb(61 48 29 / 0.1);
  --shadow-small: 0 8px 22px rgb(61 48 29 / 0.08);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Arial, sans-serif;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ivory);
  color-scheme: light;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 4%, var(--body-radial), transparent 24rem),
    linear-gradient(180deg, var(--body-start) 0%, var(--ivory) 42%, var(--body-end) 100%);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

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

button,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

a {
  color: var(--forest);
  text-decoration-color: rgb(49 85 67 / 0.38);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--forest-deep);
  text-decoration-color: currentcolor;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgb(174 131 53 / 0.48);
  outline-offset: 3px;
}

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

h1,
h2,
h3 {
  color: var(--forest-deep);
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.07;
}

h1 {
  margin-bottom: 0.7rem;
  font-size: clamp(2.25rem, 8vw, 4.4rem);
}

h2 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.55rem, 5vw, 2.25rem);
}

h3 {
  margin-bottom: 0.25rem;
  font-size: 1.16rem;
}

.skip-link {
  position: fixed;
  z-index: 20;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  color: var(--cream);
  background: var(--forest-deep);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid var(--header-line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(100% - 2rem, 1240px);
  min-height: 4.75rem;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  flex: 0 0 auto;
  color: var(--forest-deep);
  font-family: var(--serif);
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand:hover {
  color: var(--forest-deep);
}

.brand__logo {
  display: block;
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 auto;
  border: 2px solid var(--gold);
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 4px 12px rgb(31 67 54 / 0.16);
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  min-width: 0;
}

.nav-link {
  padding: 0.5rem 0.55rem;
  color: var(--forest);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  color: var(--terra);
}

.account-link {
  display: none;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  margin-left: 0.25rem;
  color: var(--ink);
  text-decoration: none;
}

.account-link__text {
  display: grid;
  min-width: 0;
  line-height: 1.15;
}

.account-link__name,
.account-link__handle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-link__name {
  max-width: 8.5rem;
  color: var(--forest-deep);
  font-size: 0.8rem;
  font-weight: 800;
}

.account-link__handle {
  max-width: 8.5rem;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.71rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0.68rem 1rem;
  color: var(--cream);
  background: var(--forest);
  border: 1px solid var(--forest);
  border-radius: 999px;
  box-shadow: 0 5px 12px rgb(30 55 44 / 0.14);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.button:hover {
  color: var(--cream);
  background: var(--forest-deep);
  border-color: var(--forest-deep);
  box-shadow: 0 8px 18px rgb(30 55 44 / 0.18);
  transform: translateY(-1px);
}

.button--small {
  min-height: 2.28rem;
  padding: 0.48rem 0.78rem;
  font-size: 0.78rem;
}

.button--wide {
  width: 100%;
  min-height: 3.15rem;
  margin-top: 0.3rem;
}

.button--quiet {
  color: var(--forest);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.button--quiet:hover {
  color: var(--terra);
  background: var(--terra-soft);
  border-color: var(--terra-soft);
  box-shadow: none;
}

.button--secondary {
  color: var(--forest);
  background: var(--cream);
  border-color: var(--line-strong);
  box-shadow: none;
}

.button--secondary:hover {
  color: var(--forest-deep);
  background: var(--gold-soft);
  border-color: var(--gold);
  box-shadow: none;
}

.button--text {
  min-height: auto;
  padding: 0;
  color: var(--forest);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 0.84rem;
  text-decoration: underline;
  text-decoration-color: rgb(49 85 67 / 0.38);
  text-underline-offset: 3px;
}

.button--text:hover {
  color: var(--forest-deep);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.app-banner {
  position: fixed;
  z-index: 30;
  top: 5.35rem;
  right: 1rem;
  left: 1rem;
  width: min(100% - 2rem, 620px);
  margin: 0 auto;
  padding: 0.8rem 1rem;
  color: #fffaf1;
  background: var(--forest-deep);
  border: 1px solid rgb(255 250 241 / 0.36);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  font-weight: 700;
}

.app-banner--error {
  background: #7e3f32;
}

.app-banner--success {
  background: var(--forest);
}

.site-footer {
  margin-top: 3.5rem;
  padding: 1.45rem 0;
  color: var(--footer-text);
  background: var(--footer-bg);
  font-size: 0.81rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  width: min(100% - 2rem, 1240px);
  margin: 0 auto;
}

.site-footer__brand {
  color: var(--footer-accent);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
}

.theme-toggle {
  margin-left: auto;
  color: var(--footer-accent);
  border-color: transparent;
  font-size: 0.78rem;
}

.theme-toggle:hover {
  color: var(--footer-hover-text);
  background: var(--footer-hover-bg);
  border-color: var(--footer-hover-line);
}

.page-shell,
.auth-page {
  width: min(100% - 2rem, 1240px);
  margin: 0 auto;
}

.page-shell {
  padding-top: 2.3rem;
}

.feed-page {
  padding-top: 1.25rem;
}

.feed-page .loading-note:empty {
  display: none;
}

.eyebrow {
  margin-bottom: 0.52rem;
  color: var(--terra);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}

.page-heading {
  display: grid;
  gap: 1.35rem;
  padding: 1.7rem;
  background: var(--heading-bg);
  border: 1px solid rgb(222 210 190 / 0.92);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-small);
}

.page-heading h1 {
  max-width: 15ch;
  margin-bottom: 0.45rem;
  font-size: clamp(2.15rem, 7vw, 3.9rem);
}

.page-heading p:not(.eyebrow) {
  max-width: 51ch;
  margin-bottom: 0;
  color: var(--muted);
}

.feed-sort {
  align-self: end;
  min-width: min(100%, 15rem);
}

.feed-sort label,
.field-group label,
.avatar-upload__field > label,
.reply-form label,
.rating-form__label {
  display: block;
  margin-bottom: 0.42rem;
  color: var(--forest-deep);
  font-size: 0.84rem;
  font-weight: 800;
}

.feed-sort select,
.field-group input,
.field-group textarea,
.reply-form textarea {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.67rem 0.8rem;
  color: var(--ink);
  background: var(--cream-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 1px rgb(50 43 31 / 0.03);
}

.feed-sort select {
  appearance: auto;
  font-size: 0.9rem;
  font-weight: 700;
}

.feed-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.feed-toolbar select {
  width: auto;
  min-width: 11rem;
  min-height: 2.45rem;
  padding: 0.48rem 0.72rem;
  color: var(--forest-deep);
  background: var(--control-bg);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.field-group textarea,
.reply-form textarea {
  min-height: 6.5rem;
  resize: vertical;
}

.field-group input::file-selector-button {
  margin-right: 0.6rem;
  padding: 0.35rem 0.55rem;
  color: var(--forest);
  background: var(--forest-soft);
  border: 0;
  border-radius: 6px;
  font-weight: 800;
}

.loading-note {
  min-height: 1.5rem;
  margin: 1.25rem 0 0.82rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.skeleton {
  display: block;
  min-height: 0.8rem;
  overflow: hidden;
  background: var(--ivory-deep);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse 1.7s ease-in-out infinite;
}

.skeleton--feed-avatar,
.skeleton--profile-avatar {
  flex: 0 0 auto;
  width: 4rem;
  height: 4rem;
  border-radius: var(--radius-sm);
}

.skeleton--profile-avatar {
  width: 5.65rem;
  height: 5.65rem;
  border: 3px solid var(--ivory-deep);
}

.skeleton--identity-name {
  width: min(12rem, 70vw);
  height: 1.08rem;
}

.skeleton--identity-handle {
  width: 7rem;
  height: 0.72rem;
  margin-top: 0.38rem;
}

.skeleton--summary {
  width: 4.9rem;
  height: 4.35rem;
}

.skeleton--meta {
  width: 8rem;
  height: 0.72rem;
}

.skeleton--section-title {
  width: 10rem;
  height: 0.88rem;
  margin-bottom: 0.7rem;
}

.skeleton--context {
  width: min(12rem, 70%);
  height: 2rem;
}

.skeleton--stars {
  width: 7rem;
  height: 1.15rem;
}

.skeleton--score {
  width: 3.5rem;
  height: 0.8rem;
}

.skeleton-comment-lines {
  display: grid;
  gap: 0.45rem;
}

.skeleton--comment {
  width: 100%;
  height: 0.86rem;
  margin: 0;
}

.skeleton--comment-short {
  width: 62%;
}

.skeleton--date {
  width: 8rem;
  height: 0.72rem;
}

.skeleton--action {
  width: 9rem;
  height: 2.28rem;
  margin: 0 1.15rem 1rem;
  border-radius: 999px;
}

.skeleton--profile-name {
  width: min(22rem, 70vw);
  height: 3.1rem;
}

.skeleton--profile-handle {
  width: 7rem;
  height: 0.95rem;
}

.skeleton--profile-joined {
  width: 10rem;
  height: 0.78rem;
  margin-top: 0.45rem;
}

.skeleton--stat {
  width: 3.3rem;
  height: 1.35rem;
}

@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 0.55;
  }

  50% {
    opacity: 1;
  }
}

.feed-list {
  display: grid;
  gap: 1rem;
}

.user-card,
.rating-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-small);
}

.user-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--user-card-bg);
}

.user-card__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  padding: 1.15rem 1.15rem 1rem;
}

.user-card__top .avatar--small {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.identity:hover {
  color: var(--ink);
}

.identity__copy {
  display: grid;
  min-width: 0;
}

.identity__name,
.identity__handle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity__name {
  color: var(--forest-deep);
  font-size: 1rem;
  font-weight: 850;
}

.identity__handle {
  margin-top: 0.08rem;
  color: var(--muted);
  font-size: 0.8rem;
}

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

.anonymous-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--terra);
  background: var(--terra-soft);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
}

.avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 2.85rem;
  height: 2.85rem;
  place-items: center;
  overflow: hidden;
  color: var(--forest-deep);
  background: linear-gradient(145deg, var(--gold-soft), #e7d2a5);
  border: 1px solid rgb(174 131 53 / 0.33);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.avatar img,
.avatar-upload__preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar--nav {
  width: 2.15rem;
  height: 2.15rem;
  font-size: 0.61rem;
}

.avatar--small {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.69rem;
}

.avatar--tiny {
  width: 2rem;
  height: 2rem;
  font-size: 0.58rem;
}

.avatar--profile {
  width: 6.15rem;
  height: 6.15rem;
  border-width: 3px;
  border-radius: var(--radius-md);
  font-size: 1.32rem;
}

.avatar--upload {
  width: 4.7rem;
  height: 4.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.98rem;
}

.score-summary {
  min-width: 4.9rem;
  padding: 0.5rem 0.55rem;
  color: var(--forest-deep);
  background: var(--gold-soft);
  border: 1px solid rgb(174 131 53 / 0.22);
  border-radius: var(--radius-sm);
  text-align: center;
}

.score-summary--gold,
.score-summary--silver,
.score-summary--bronze {
  background-size: 180% 180%;
  animation: holo-shift 7s ease-in-out infinite;
}

.score-summary--gold {
  color: #5c4210;
  background-image: linear-gradient(135deg, #fff1a8 0%, #d39b2b 28%, #fff8cc 47%, #b87917 68%, #f5d76e 100%);
  border-color: #b87917;
}

.score-summary--silver {
  color: #39404a;
  background-image: linear-gradient(135deg, #f8fbff 0%, #9da9b7 29%, #ffffff 49%, #687583 68%, #dce4ed 100%);
  border-color: #8693a2;
}

.score-summary--bronze {
  color: #5d2d19;
  background-image: linear-gradient(135deg, #f4be88 0%, #a95b32 29%, #ffd4a9 49%, #71351f 68%, #d68957 100%);
  border-color: #9b512e;
}

@keyframes holo-shift {
  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.score-summary__value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
}

.score-summary__star {
  color: currentcolor;
  font-family: var(--sans);
  font-size: 0.9rem;
  line-height: 1;
}

.score-summary__label {
  display: block;
  margin-top: 0.18rem;
  color: currentcolor;
  opacity: 0.78;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.user-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  padding: 0 1.15rem 1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.user-card__ratings {
  padding: 0 1.15rem 1rem;
}

.user-card__ratings-title {
  margin-bottom: 0.7rem;
  color: var(--forest-deep);
  font-size: 0.86rem;
  letter-spacing: 0.02em;
}

.user-card__ratings .rating-card {
  box-shadow: none;
}

.user-card__rating-toggle {
  align-self: flex-start;
  margin: 0 1.15rem 1rem;
}

.rating-form {
  margin-top: auto;
  padding: 1rem 1.15rem 1.15rem;
  background: var(--form-bg);
  border-top: 1px solid var(--line);
}

.rating-form__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.72rem;
}

.rating-form__header h3 {
  margin: 0;
  font-size: 1.08rem;
}

.rating-form__hint {
  color: var(--muted);
  font-size: 0.75rem;
}

.rating-stars-fieldset {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  margin: 0 0 0.85rem;
  padding: 0;
  border: 0;
}

.rating-stars-fieldset legend {
  width: 100%;
  margin-bottom: 0.42rem;
  color: var(--forest-deep);
  font-size: 0.84rem;
  font-weight: 800;
}

.rating-stars {
  display: flex;
  gap: 0.28rem;
}

.rating-star {
  position: relative;
}

.rating-star input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.rating-star label {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: #b4a78c;
  background: var(--cream-strong);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.rating-star label::before,
.star-meter__star::before {
  content: "\2605";
}

.rating-star label::before {
  font-size: 1.05rem;
}

.rating-star input:checked + label {
  color: #8c6825;
  background: var(--gold-soft);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.rating-star--active label {
  color: #8c6825;
  background: var(--gold-soft);
  border-color: var(--gold);
}

.rating-star input:focus-visible + label {
  outline: 3px solid rgb(174 131 53 / 0.48);
  outline-offset: 2px;
}

.rating-stars-output {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.rating-form__comment {
  margin-top: 0.75rem;
}

.rating-form__comment textarea {
  width: 100%;
  min-height: 5.4rem;
  padding: 0.66rem 0.75rem;
  color: var(--ink);
  background: var(--cream-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  resize: vertical;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.78rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.checkbox-row input {
  width: 1rem;
  height: 1rem;
  margin: 0.13rem 0 0;
  accent-color: var(--forest);
}

.rating-form .button {
  width: 100%;
}

.empty-state,
.loading-state,
.failure-state {
  display: grid;
  min-height: 8rem;
  place-items: center;
  padding: 1.35rem;
  color: var(--muted);
  background: var(--empty-bg);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  text-align: center;
}

.failure-state {
  color: var(--failure-text);
  background: var(--failure-bg);
}

.profile-hero {
  display: grid;
  gap: 1.5rem;
  padding: 1.55rem;
  background: var(--profile-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-small);
}

.profile-hero__identity {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.profile-edit-button {
  margin-top: 0.9rem;
}

.profile-edit-panel {
  margin-top: 1rem;
  padding: 1.2rem;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-small);
}

.profile-edit-form__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.profile-edit-form .section-heading {
  margin-bottom: 0;
}

.profile-hero h1 {
  margin-bottom: 0.26rem;
  font-size: clamp(2.15rem, 8vw, 3.65rem);
  overflow-wrap: anywhere;
}

.profile-handle,
.profile-joined {
  margin-bottom: 0;
  color: var(--muted);
}

.profile-handle {
  font-weight: 800;
}

.profile-joined {
  margin-top: 0.45rem;
  font-size: 0.84rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
}

.profile-stat {
  display: grid;
  gap: 0.22rem;
  padding: 0.92rem 0.55rem 0 0;
}

.profile-stat + .profile-stat {
  padding-left: 0.55rem;
  border-left: 1px solid var(--line-strong);
}

.profile-stat__value {
  color: var(--forest-deep);
  font-family: var(--serif);
  font-size: 1.42rem;
  font-weight: 700;
  line-height: 1;
}

.profile-stat__label {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
}

.profile-rating-panel {
  margin-top: 1rem;
  background: var(--cream);
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-small);
}

.profile-rating-panel .rating-form {
  border-top: 0;
  border-radius: var(--radius-md);
}

.profile-self-note {
  margin: 0;
  padding: 1rem 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-columns {
  display: grid;
  gap: 2rem;
  margin-top: 2.25rem;
}

.section-heading {
  margin-bottom: 0.95rem;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 5vw, 2.08rem);
}

.rating-list {
  display: grid;
  gap: 0.85rem;
}

.rating-card {
  padding: 1rem;
}

.rating-card__context {
  display: grid;
  gap: 0.72rem;
}

.rating-card__identity-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.rating-card__context-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.rating-card__divider {
  height: 1px;
  background: var(--line);
}

.rating-card__score-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.95rem;
}

.star-meter {
  display: inline-flex;
  gap: 0.08rem;
  color: #b3a58c;
  font-size: 1.05rem;
  line-height: 1;
}

.star-meter__star {
  font-size: 0;
}

.star-meter__star::before {
  font-size: 1.05rem;
}

.star-meter__star--filled {
  color: var(--gold);
}

.rating-card__score-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.anonymous-badge,
.admin-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.28rem 0.52rem;
  color: var(--terra);
  background: var(--terra-soft);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rating-card__comment {
  margin: 0.85rem 0;
  color: var(--ink);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.rating-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.rating-card__date {
  color: var(--muted);
  font-size: 0.76rem;
}

.rating-card__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.rating-replies {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.reply-list {
  display: grid;
  gap: 0.72rem;
}

.reply-card {
  padding: 0.82rem;
  background: var(--reply-bg);
  border-radius: var(--radius-sm);
}

.reply-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.reply-card__body {
  margin: 0.58rem 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.reply-card time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.7rem;
}

.reply-form {
  margin-top: 0.85rem;
}

.reply-form textarea {
  min-height: 4.6rem;
}

.reply-form .button {
  margin-top: 0.55rem;
}

.admin-page .page-heading {
  background: var(--admin-heading-bg);
}

.admin-badge {
  align-self: start;
  color: var(--forest-deep);
  background: var(--forest-soft);
  font-size: 0.75rem;
}

.auth-page {
  min-height: calc(100vh - 10.2rem);
  padding: 2rem 0 0;
}

.auth-layout {
  display: grid;
  gap: 1.2rem;
  align-items: center;
  max-width: 1060px;
  margin: 0 auto;
}

.auth-intro {
  position: relative;
  padding: 1.35rem 0.5rem;
}

.auth-intro h1 {
  margin-bottom: 0;
}

.auth-intro h1 {
  max-width: 11ch;
  font-size: clamp(2.8rem, 12vw, 5rem);
}

.auth-intro__copy {
  max-width: 42ch;
  margin-bottom: 1.15rem;
  color: var(--muted);
  font-size: 1.04rem;
}

.auth-intro__rule {
  width: 4.2rem;
  height: 3px;
  margin: 1.25rem 0;
  background: var(--gold);
}

.auth-intro__note {
  max-width: 35ch;
  margin-bottom: 0;
  color: var(--forest);
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.4;
}

.auth-card {
  padding: 1.5rem;
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin-bottom: 0.35rem;
  font-size: 2.1rem;
}

.auth-card__lead {
  margin-bottom: 1.35rem;
  color: var(--muted);
}

.stack-form {
  display: grid;
  gap: 1rem;
}

.field-group {
  display: grid;
}

.field-hint {
  margin: 0.42rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.auth-card__footer {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.auth-card__footer a {
  font-weight: 800;
}

.avatar-upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem;
  background: var(--upload-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.avatar-upload__preview {
  left: 0.8rem;
  top: 0.8rem;
  width: 4.4rem;
  height: 4.4rem;
  border: 1px solid rgb(174 131 53 / 0.33);
  border-radius: 50%;
}

.avatar-upload__field {
  min-width: 0;
  flex: 1;
}

.avatar-upload__field input[type="file"] {
  width: 100%;
  color: var(--muted);
  font-size: 0.78rem;
}

.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 (min-width: 640px) {
  .site-header__inner,
  .page-shell,
  .auth-page,
  .site-footer__inner {
    width: min(100% - 3rem, 1240px);
  }

  .site-header__inner {
    min-height: 5.2rem;
  }

  .nav-link {
    padding-right: 0.72rem;
    padding-left: 0.72rem;
  }

  .account-link {
    display: inline-flex;
  }

  .page-shell {
    padding-top: 3rem;
  }

  .feed-page {
    padding-top: 1.75rem;
  }

  .page-heading,
  .profile-hero,
  .auth-card {
    padding: 2rem;
  }

  .user-card__top {
    padding: 1.35rem 1.35rem 1rem;
  }

  .user-card__meta {
    padding-right: 1.35rem;
    padding-left: 1.35rem;
  }

  .user-card__ratings {
    padding-right: 1.35rem;
    padding-left: 1.35rem;
  }

  .user-card__rating-toggle {
    margin-right: 1.35rem;
    margin-left: 1.35rem;
  }

  .rating-form {
    padding: 1.15rem 1.35rem 1.35rem;
  }

  .profile-hero {
    padding: 2rem;
  }

  .profile-hero__identity {
    gap: 1.25rem;
  }

  .rating-card {
    padding: 1.2rem;
  }

  .rating-card__context {
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .rating-card__divider {
    width: 1px;
    height: 2rem;
  }

  .auth-page {
    padding-top: 3.7rem;
  }

  .auth-card {
    padding: 2rem;
  }
}

@media (min-width: 820px) {
  .page-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

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

  .profile-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .profile-stats {
    min-width: 20rem;
    border-top: 0;
  }

  .profile-stat {
    padding-top: 0;
  }

  .profile-columns {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    align-items: start;
  }

  .auth-layout {
    grid-template-columns: minmax(0, 1fr) minmax(23rem, 0.8fr);
    gap: clamp(3rem, 8vw, 7rem);
  }

  .auth-layout--register {
    grid-template-columns: minmax(0, 0.9fr) minmax(25rem, 1fr);
  }

  .auth-intro {
    padding: 1rem 0;
  }
}

@media (min-width: 1100px) {
  .site-header__inner,
  .page-shell,
  .auth-page,
  .site-footer__inner {
    width: min(100% - 5rem, 1240px);
  }

  .primary-nav {
    gap: 0.5rem;
  }

  .page-heading {
    padding: 2.25rem;
  }

  .rating-list--admin {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .brand {
    gap: 0.45rem;
    font-size: 1.12rem;
  }

  .primary-nav {
    gap: 0;
  }

  .nav-link {
    padding-right: 0.38rem;
    padding-left: 0.38rem;
    font-size: 0.8rem;
  }

  .button--small {
    padding-right: 0.58rem;
    padding-left: 0.58rem;
  }

  .profile-hero__identity {
    align-items: flex-start;
  }
}

@media (max-width: 819px) {
  .auth-intro {
    display: none;
  }
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ivory: #101916;
  --ivory-deep: #1b2922;
  --cream: #18241e;
  --cream-strong: #203128;
  --forest: #8ac9a0;
  --forest-deep: #d9f0df;
  --forest-soft: #294637;
  --gold: #e0b65e;
  --gold-soft: #4b3d21;
  --terra: #e69475;
  --terra-soft: #4a2d25;
  --ink: #edf5ef;
  --muted: #adbbb0;
  --line: #34483c;
  --line-strong: #506557;
  --header-bg: rgb(20 31 26 / 0.88);
  --header-line: rgb(80 101 87 / 0.72);
  --card-bg: rgb(24 36 30 / 0.94);
  --footer-bg: #0b120f;
  --footer-text: #d7e7da;
  --footer-accent: #f1cf7a;
  --footer-hover-text: #f5fbf6;
  --footer-hover-bg: rgb(215 231 218 / 0.12);
  --footer-hover-line: rgb(215 231 218 / 0.28);
  --user-card-bg: #111b16;
  --unrated-card-bg: #242927;
  --unrated-summary-bg: #353a37;
  --control-bg: rgb(24 36 30 / 0.9);
  --heading-bg: linear-gradient(130deg, rgb(32 49 40 / 0.96), rgb(24 36 30 / 0.96));
  --admin-heading-bg: linear-gradient(130deg, #2d4034, #18241e);
  --profile-bg: linear-gradient(140deg, var(--cream-strong), #2c4034);
  --form-bg: rgb(27 41 34 / 0.78);
  --empty-bg: rgb(24 36 30 / 0.72);
  --reply-bg: #22352b;
  --upload-bg: #24392e;
  --failure-bg: rgb(74 45 37 / 0.7);
  --failure-text: #f2b09a;
  --body-radial: rgb(75 61 33 / 0.5);
  --body-start: #17231d;
  --body-end: #0f1714;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    color-scheme: dark;
    --ivory: #101916;
    --ivory-deep: #1b2922;
    --cream: #18241e;
    --cream-strong: #203128;
    --forest: #8ac9a0;
    --forest-deep: #d9f0df;
    --forest-soft: #294637;
    --gold: #e0b65e;
    --gold-soft: #4b3d21;
    --terra: #e69475;
    --terra-soft: #4a2d25;
    --ink: #edf5ef;
    --muted: #adbbb0;
    --line: #34483c;
    --line-strong: #506557;
    --header-bg: rgb(20 31 26 / 0.88);
    --header-line: rgb(80 101 87 / 0.72);
    --card-bg: rgb(24 36 30 / 0.94);
    --footer-bg: #0b120f;
    --footer-text: #d7e7da;
    --footer-accent: #f1cf7a;
    --footer-hover-text: #f5fbf6;
    --footer-hover-bg: rgb(215 231 218 / 0.12);
    --footer-hover-line: rgb(215 231 218 / 0.28);
    --user-card-bg: #111b16;
    --unrated-card-bg: #242927;
    --unrated-summary-bg: #353a37;
    --control-bg: rgb(24 36 30 / 0.9);
    --heading-bg: linear-gradient(130deg, rgb(32 49 40 / 0.96), rgb(24 36 30 / 0.96));
    --admin-heading-bg: linear-gradient(130deg, #2d4034, #18241e);
    --profile-bg: linear-gradient(140deg, var(--cream-strong), #2c4034);
    --form-bg: rgb(27 41 34 / 0.78);
    --empty-bg: rgb(24 36 30 / 0.72);
    --reply-bg: #22352b;
    --upload-bg: #24392e;
    --failure-bg: rgb(74 45 37 / 0.7);
    --failure-text: #f2b09a;
    --body-radial: rgb(75 61 33 / 0.5);
    --body-start: #17231d;
    --body-end: #0f1714;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
