/*
 * Respect With Me: design system.
 *
 * The look comes from the logo: a cartoon cup drawn with thick roast-brown
 * outlines, rounded heavy lettering, crema and caramel. Surfaces that matter
 * (posts, primary buttons, the composer) are "stickers": a roast outline with
 * a solid offset shadow, which presses down when tapped. Everything else is
 * quiet: flat crema, hairlines, plain system text.
 *
 * Pages opt in by overriding {% block page %} in base.html and wrapping their
 * content in .rwm-page. Older pages keep the previous layout until moved over.
 *
 * Fredoka is by Milena Brandão and Hafontia, SIL Open Font License 1.1.
 */

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/fredoka-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/fredoka-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --crema: #FADEC4;      /* page */
  --milk: #FFF9F2;       /* surfaces */
  --cream: #FCEAD3;      /* choices on the dark table */
  --foam: #F3DDC5;       /* hairlines, chips, quiet fills */
  --caramel: #DE9F52;    /* honours */
  --roast: #803E00;      /* brand, outlines, actions */
  --roast-deep: #552800; /* sticker shadow, pressed */
  --espresso: #2B1405;   /* text */
  --grounds: #7A5A43;    /* secondary text */

  --display: 'Fredoka', ui-rounded, -apple-system, system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* 1.25 scale from 16px */
  --t-xs: 0.8125rem;  /* 13 */
  --t-sm: 0.9375rem;  /* 15 */
  --t-md: 1.0625rem;  /* 17 */
  --t-lg: 1.3125rem;  /* 21 */
  --t-xl: 1.625rem;   /* 26 */
  --t-2xl: 2.0625rem; /* 33 */
  --t-3xl: 2.625rem;  /* 42 */

  --line: 2px solid var(--roast);
  --sticker-shadow: 0 3px 0 var(--roast-deep);
  --radius: 20px;
}

/* ---------- Page ---------- */

body.rwm {
  background: var(--crema);
  color: var(--espresso);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.rwm a { color: var(--roast); }
body.rwm a:hover { color: var(--roast-deep); text-decoration: none; }

.rwm-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 14px 14px 112px;
}
.rwm-page :focus-visible {
  outline: 3px solid var(--caramel);
  outline-offset: 2px;
}

.rwm-heading {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-xl);
  line-height: 1.15;
  color: var(--roast);
  margin: 8px 4px 14px;
}
.is-native-app .rwm-heading--duplicate { display: none; }

/* ---------- Sticker: outlined surface with a solid offset shadow ---------- */

.sticker {
  background: var(--milk);
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--sticker-shadow);
}

/* ---------- Buttons ---------- */

.rwm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: var(--line);
  border-radius: 999px;
  background: var(--roast);
  color: var(--milk) !important;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
  letter-spacing: 0.01em;
  box-shadow: var(--sticker-shadow);
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease, background-color 120ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.rwm-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--roast-deep);
}
.rwm-btn:disabled { opacity: 0.45; cursor: default; }
.rwm-btn--quiet {
  background: var(--milk);
  color: var(--roast) !important;
}
.rwm-btn--block { display: flex; width: 100%; }
.rwm-btn--small { min-height: 36px; padding: 0 16px; font-size: var(--t-sm); }

/* ---------- Avatars ---------- */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: var(--line);
  background: var(--foam);
  overflow: hidden;
  color: var(--roast);
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none !important;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar--sm { width: 28px; height: 28px; font-size: 0.75rem; border-width: 1.5px; }
.avatar--lg { width: 108px; height: 108px; font-size: 2.6rem; border-width: 3px; }

/* ---------- Respecter of the Year / Month ----------
   A two-handled cup (a coffee cup that is also a trophy) after the name,
   and a ring around the photo: gold for the Year, silver for the Month. */

.rwm { --gold: #F0B429; --silver: #C9CED6; }
.honor-mark { display: inline-block; width: 21px; height: 21px; flex-shrink: 0; vertical-align: -4px; color: var(--roast); }
.honor-mark + .honor-mark { margin-left: 2px; }
.honor-mark--year { --honor-fill: var(--gold); }
.honor-mark--month { --honor-fill: var(--silver); }
.post-name + .honor-mark { margin-left: 2px; }
.post-who > .honor-mark:last-of-type { margin-right: 6px; }
.avatar--year { box-shadow: 0 0 0 2px var(--milk), 0 0 0 5px var(--gold); }
.avatar--month { box-shadow: 0 0 0 2px var(--milk), 0 0 0 5px var(--silver); }
.avatar--lg.avatar--year { box-shadow: 0 0 0 3px var(--milk), 0 0 0 8px var(--gold); }
.avatar--lg.avatar--month { box-shadow: 0 0 0 3px var(--milk), 0 0 0 8px var(--silver); }
.person-name-row { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.person-name-row .honor-mark { margin: 0; }
.standing-title .honor-mark, .plaque-title .honor-mark, .profile-honors .honor-mark { width: 18px; height: 18px; vertical-align: -3px; }

/* ---------- Respect score chip ---------- */

.score {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--foam);
  color: var(--roast);
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-xs);
  line-height: 1.5;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- Post (one logged drink) ---------- */

.post {
  padding: 14px 16px 14px;
  margin-bottom: 14px;
}
.post-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 11px;
}
.post-who { min-width: 0; line-height: 1.2; }
.post-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
  color: var(--espresso) !important;
  margin-right: 4px;
  overflow-wrap: anywhere;
}
.post-time {
  align-self: start;
  padding-top: 2px;
  color: var(--grounds) !important;
  font-size: var(--t-xs);
  white-space: nowrap;
}
.post-drink {
  margin: 12px 0 0;
  color: var(--espresso);
  font-size: var(--t-md);
  line-height: 1.35;
}
.post-drink b { color: var(--roast); font-weight: 600; }
.post-comment {
  margin: 8px 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--t-lg);
  line-height: 1.28;
  color: var(--espresso);
  overflow-wrap: anywhere;
}
.post-comment a { text-decoration: underline; }
.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  min-height: 36px;
}
.post-foot:not(:has(*)) { display: none; }

.respecters {
  display: flex;
  align-items: center;
  min-width: 0;
}
.respecters .avatar { margin-left: -7px; box-shadow: 0 0 0 2px var(--milk); }
.respecters .avatar:first-child { margin-left: 0; }
.respecters-more {
  margin-left: 8px;
  color: var(--grounds);
  font-size: var(--t-xs);
  white-space: nowrap;
}

/* ---------- Paying respect: a small ceremony ----------
 * Hold the button and coffee pours into it (app.js drives --fill from 0 to
 * 1); let go early and it drains. When it's full the button gives way, beans
 * fly, and the Society's seal is stamped onto the post. The seal stays: every
 * drink you've respected carries one, each at its own angle. */

.post-foot { flex-wrap: wrap; position: relative; }
.post-foot:has(.seal) { min-height: 62px; }

.respect-form { flex: 1 0 100%; margin: 2px 0 0; }
.respect-btn {
  --fill: 0;
  position: relative;
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  overflow: hidden;
  border: var(--line);
  border-radius: 999px;
  background: var(--milk);
  color: var(--roast);
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-lg);
  letter-spacing: 0.01em;
  box-shadow: var(--sticker-shadow);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  isolation: isolate;
}
.respect-btn.is-holding { box-shadow: 0 1px 0 var(--roast-deep); transform: translateY(2px); }
.respect-pour {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--fill) * 100%);
  background: var(--roast);
  z-index: -1;
}
/* The surface of the coffee: a little wave that rolls while you pour. */
.respect-pour::before {
  content: '';
  position: absolute;
  left: -40px;
  right: -40px;
  top: -6px;
  height: 7px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='7' viewBox='0 0 40 7'%3E%3Cpath d='M0 7 V4 Q10 0 20 4 T40 4 V7 Z' fill='%23803E00'/%3E%3C/svg%3E") repeat-x;
  background-size: 40px 7px;
  opacity: calc(var(--fill) * 40);
  animation: respect-wave 0.8s linear infinite;
}
@keyframes respect-wave { to { transform: translateX(40px); } }
.respect-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  pointer-events: none;
}
.respect-label--poured {
  position: absolute;
  inset: 0;
  color: var(--milk);
  clip-path: inset(calc((1 - var(--fill)) * 100% - 3px) 0 0 0);
}

.seal {
  position: absolute;
  right: -2px;
  bottom: -6px;
  width: 68px;
  height: 68px;
  color: var(--roast);
  opacity: 0.9;
  transform: rotate(var(--seal-tilt, -8deg));
  pointer-events: none;
}

/* Effects, added and removed by app.js */
.rwm-fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.bean {
  position: absolute;
  width: 11px;
  height: 15px;
  margin: -7px 0 0 -5px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #8A4B1C, var(--roast-deep) 70%);
}
.bean::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 2px;
  bottom: 2px;
  width: 1.8px;
  border-radius: 2px;
  background: #D6955A;
  transform: rotate(10deg);
}
.ink-ring {
  position: absolute;
  right: -2px;
  bottom: -6px;
  width: 68px;
  height: 68px;
  border: 3px solid var(--roast);
  border-radius: 50%;
  pointer-events: none;
}
.steam {
  position: absolute;
  right: 12px;
  bottom: 44px;
  width: 40px;
  height: 50px;
  color: var(--grounds);
  pointer-events: none;
  overflow: visible;
}
.score { position: relative; }
.score-float {
  position: absolute;
  left: 50%;
  top: -4px;
  transform: translateX(-50%);
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--t-md);
  color: var(--roast);
  pointer-events: none;
  white-space: nowrap;
}
.respect-hint {
  animation: respect-nudge 360ms ease;
}
@keyframes respect-nudge {
  20% { transform: translateX(-5px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-2px); }
}

@media (prefers-reduced-motion: reduce) {
  .respect-pour::before { animation: none; }
  .respect-hint { animation: none; }
}

/* ---------- Feed masthead (app only: the title bar is hidden there) ---------- */

.masthead { margin: 2px auto 4px; text-align: center; line-height: 0; }
.masthead img { width: min(300px, 82%); height: auto; }

/* Holding Post: a big glass mug over the page, and a coffee pot that
   swings in above it and tips forward to pour. */
.composer .rwm-btn.is-holding { transform: translateY(3px); box-shadow: 0 0 0 var(--roast-deep); }
.pour-stage {
  position: fixed;
  inset: 0;
  z-index: 9997;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6vh;
  background: rgba(250, 222, 196, 0);
  -webkit-backdrop-filter: blur(0);
          backdrop-filter: blur(0);
  pointer-events: none;
  transition: background-color 0.22s ease, backdrop-filter 0.22s ease, -webkit-backdrop-filter 0.22s ease;
}
.pour-stage.is-open { background: rgba(250, 222, 196, 0.9); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.pour-stage.is-leaving { background: rgba(250, 222, 196, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); transition-duration: 0.55s; }
.pour-scene {
  width: min(86vw, 340px);
  height: auto;
  overflow: visible;
  opacity: 0;
  transform: scale(0.9) translateY(14px);
  transition: transform 0.3s cubic-bezier(0.3, 1.4, 0.5, 1), opacity 0.18s ease;
}
.pour-stage.is-open .pour-scene { opacity: 1; transform: none; }

.pour-glass { fill: var(--milk); fill-opacity: 0.6; }
.pour-outline { fill: none; stroke: var(--roast); stroke-width: 5; stroke-linejoin: round; }
.pour-handle { fill: none; stroke: var(--roast); stroke-width: 15; stroke-linecap: round; }
.pour-glint { stroke: #fff; stroke-opacity: 0.75; stroke-width: 6; stroke-linecap: round; }
.pour-wave path { fill: #6B3410; }
.pour-wave .pour-crema { fill: none; stroke: #B7773B; stroke-width: 4; }
.pour-wave { animation: pour-wave 0.8s linear infinite; }
.pour-stage:not(.is-pouring) .pour-wave { animation-duration: 2.6s; }
@keyframes pour-wave { to { transform: translateX(-40px); } }

.pour-stream {
  fill: none;
  stroke: #6B3410;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 0 2;
}
.pour-splash circle { fill: #6B3410; opacity: 0; }
.pour-stage.is-pouring .pour-splash circle { animation: pour-splash 0.45s ease-out infinite; }
.pour-stage.is-pouring .pour-splash circle:nth-child(1) { --dx: -9px; }
.pour-stage.is-pouring .pour-splash circle:nth-child(2) { --dx: 9px; animation-delay: 0.15s; }
.pour-stage.is-pouring .pour-splash circle:nth-child(3) { --dx: 2px; animation-delay: 0.3s; }
@keyframes pour-splash {
  from { opacity: 0.9; transform: translate(0, 0); }
  to   { opacity: 0;   transform: translate(var(--dx), -16px); }
}

/* The pot: swings in when the stage opens, lifts away when the mug is full. */
.pour-pot-wrap {
  opacity: 0;
  transform: translate(70px, -50px);
  transition: transform 0.34s cubic-bezier(0.3, 1.2, 0.5, 1), opacity 0.2s ease;
}
.pour-stage.is-open .pour-pot-wrap { opacity: 1; transform: none; }
.pour-stage.is-full .pour-pot-wrap { opacity: 0; transform: translate(60px, -90px); transition-duration: 0.5s; }
.pour-pot-fill { fill: var(--milk); }
.pour-pot-coffee { fill: #6B3410; }
.pour-pot-body { fill: none; stroke: var(--roast); stroke-width: 5; stroke-linejoin: round; }
.pour-pot-spout { fill: var(--milk); stroke: var(--roast); stroke-width: 5; stroke-linejoin: round; }
.pour-pot-handle { fill: none; stroke: var(--roast); stroke-width: 12; stroke-linecap: round; }
.pour-pot-lid { fill: var(--roast); }
.pour-pot-knob { fill: var(--roast); }
.pour-pot-glint { fill: none; stroke: #fff; stroke-opacity: 0.8; stroke-width: 5; stroke-linecap: round; }

.pour-steam path { fill: none; stroke: var(--roast); stroke-width: 5; stroke-linecap: round; opacity: 0; }
.pour-stage.is-full .pour-steam path { animation: pour-steam 1.6s ease-out infinite; }
.pour-stage.is-full .pour-steam path:nth-child(2) { animation-delay: 0.25s; }
.pour-stage.is-full .pour-steam path:nth-child(3) { animation-delay: 0.5s; }
@keyframes pour-steam {
  0%   { opacity: 0;   transform: translateY(12px); }
  40%  { opacity: 0.85; }
  100% { opacity: 0;   transform: translateY(-18px); }
}
.pour-name {
  margin: 10px 0 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-xl);
  color: var(--roast);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.pour-stage.is-open .pour-name { opacity: 1; }
.pour-stage.is-leaving .pour-name { opacity: 0; }
.pour-stage.is-leaving .pour-scene { opacity: 0; transform: translateY(30px) scale(0.92); transition-duration: 0.28s; }

/* Long presses are for pouring and paying respect, never for selecting
   text or opening the iOS callout. */
.rwm-btn, .drink-usual, .respect-btn, [data-pour-hold] {
  -webkit-user-select: none;
          user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
html.is-pouring-drink, html.is-pouring-drink * { -webkit-user-select: none !important; user-select: none !important; }

@media (prefers-reduced-motion: reduce) {
  .pour-wave, .pour-stage.is-pouring .pour-splash circle { animation: none; }
  .pour-stage.is-full .pour-steam path { animation: none; opacity: 0.6; }
}

/* ---------- Composer (log a drink) ---------- */

.composer {
  padding: 16px 16px 14px;
  margin-bottom: 16px;
}
.composer-greeting {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--t-md);
  color: var(--grounds);
}
.composer-prompt {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-xl);
  line-height: 1.15;
  color: var(--roast);
}
.composer-finish { margin-top: 2px; }
.composer-finish[hidden] { display: none; }
.rwm-select.drink-select ~ .composer-finish .rwm-input { margin-bottom: 12px; }
.drink-usuals {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 0 10px;
}
.drink-usual {
  min-height: 46px;
  padding: 6px 12px;
  border: 1.5px solid var(--roast);
  border-radius: 14px;
  background: var(--milk);
  color: var(--roast);
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
  cursor: pointer;
  transition: background-color 100ms ease, color 100ms ease;
}
.drink-usual[aria-pressed="true"] { background: var(--roast); color: var(--milk); }
.rwm-select.drink-select {
  margin-bottom: 10px;
  padding: 0 44px; /* even on both sides, so the centred name sits in the middle */
  box-shadow: none;
  border-width: 1.5px;
  border-radius: 14px;
  text-align: center;
  text-align-last: center;
}
.rwm-select.drink-select.is-chosen {
  background-color: var(--roast);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23FFF9F2' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color: var(--milk);
}
.rwm-input {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1.5px solid var(--roast);
  border-radius: 14px;
  background: #fff;
  color: var(--espresso);
  font-family: var(--text);
  font-size: var(--t-md); /* 17px keeps iOS from zooming in on focus */
}
.rwm-input::placeholder { color: #A88A72; }
.rwm-input:focus { outline: 3px solid var(--caramel); outline-offset: 1px; }

/* The composer is a dark roast surface, so it never reads as one more
   post. Choices sit on it in cream; a chosen drink turns honey. */
.composer {
  background: var(--roast);
  border-color: var(--roast-deep);
  box-shadow: inset 0 3px 0 #9A5A1E, var(--sticker-shadow);
}
.composer-greeting { color: var(--foam); }
.composer-prompt { color: var(--milk); }
.composer .drink-usual,
.composer .rwm-select.drink-select { border-color: var(--roast-deep); background-color: var(--cream); }
.composer .drink-usual[aria-pressed="true"],
.composer .rwm-select.drink-select.is-chosen {
  background-color: #F7C978; /* honey: lighter than caramel, so the dark name reads clearly */
  color: var(--espresso);
  box-shadow: inset 0 0 0 1.5px var(--roast-deep);
}
.composer .rwm-select.drink-select.is-chosen {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%232B1405' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* Once a drink is chosen, the rest is a second step below a seam in the
   table: the comment box is a dark well you write into, not a choice. */
.composer .composer-finish {
  margin-top: 4px;
  padding-top: 14px;
  border-top: 2px dashed rgba(243, 221, 197, 0.3);
}
.composer .composer-finish:not([hidden]) { animation: composer-finish-in 0.24s ease-out; }
@keyframes composer-finish-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
.composer .rwm-input {
  border-color: transparent;
  background-color: var(--roast-deep);
  color: var(--milk);
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.28);
}
.composer .rwm-input::placeholder { color: rgba(243, 221, 197, 0.6); }
@media (prefers-reduced-motion: reduce) {
  .composer .composer-finish:not([hidden]) { animation: none; }
}
.composer .rwm-btn {
  border-color: var(--roast-deep);
  background: var(--cream);
  color: var(--roast) !important;
}
.composer :focus-visible { outline-color: var(--caramel); }
/* Once a drink is picked, the other choices step back so the chosen one
   (honey) is the only one that stands out. Tapping another still works. */
.composer .drink-usual,
.composer .rwm-select.drink-select { transition: background-color 100ms ease, color 100ms ease, opacity 120ms ease; }
.composer.has-drink .drink-usual[aria-pressed="false"],
.composer.has-drink .rwm-select.drink-select:not(.is-chosen) { opacity: 0.55; }

/* ---------- Plaque (Respecter of the Month notice) ---------- */

.plaque {
  position: relative;
  margin-bottom: 14px;
  padding: 14px 44px 14px 16px;
  border: 2px solid var(--caramel);
  border-radius: var(--radius);
  background: linear-gradient(var(--milk), var(--milk)) padding-box;
}
.plaque-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
  color: var(--roast);
  margin: 0 0 2px;
}
.plaque p { margin: 0; font-size: var(--t-sm); color: var(--espresso); }
.plaque a { font-weight: 600; }
.plaque-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--grounds);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Endless feed ---------- */

.feed-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 0 6px;
  color: var(--roast);
  font-family: var(--display);
  font-weight: 600;
  text-decoration: none;
}
.feed-empty {
  padding: 28px 20px;
  text-align: center;
  color: var(--grounds);
}
.feed-empty b {
  display: block;
  font-family: var(--display);
  font-size: var(--t-lg);
  color: var(--roast);
  margin-bottom: 4px;
}

/* ---------- Profile ---------- */

.profile-hero {
  text-align: center;
  padding: 10px 8px 18px;
}
.profile-photo { position: relative; display: inline-block; }
.profile-photo-edit {
  position: absolute;
  right: -2px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: var(--line);
  border-radius: 50%;
  background: var(--milk);
  color: var(--roast);
  box-shadow: 0 2px 0 var(--roast-deep);
  cursor: pointer;
}
.profile-name-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}
.profile-name-row[hidden] { display: none; }
.profile-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-2xl);
  line-height: 1.1;
  color: var(--espresso);
  overflow-wrap: anywhere;
}
.profile-name-edit {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--grounds);
  cursor: pointer;
}
.profile-name-form { max-width: 360px; margin: 12px auto 0; }
.profile-name-form .rwm-input { margin-bottom: 10px; text-align: center; font-family: var(--display); font-weight: 600; }
.profile-name-actions { display: flex; justify-content: center; gap: 10px; }
.profile-realname { margin: 4px 0 0; color: var(--grounds); }
.profile-honors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 10px 0 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--t-sm);
  color: var(--roast);
}

/* The ledger: the respect score, then the numbers behind it. */
.ledger {
  padding: 18px 18px 16px;
  margin-bottom: 22px;
  text-align: center;
}
.ledger-score { margin: 0; }
.ledger-score-value {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-3xl);
  line-height: 1;
  color: var(--roast);
  font-variant-numeric: tabular-nums;
}
.ledger-score-label {
  display: block;
  margin-top: 4px;
  font-size: var(--t-sm);
  color: var(--grounds);
}
.ledger-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1.5px solid var(--foam);
}
.ledger-stats div + div { border-left: 1.5px solid var(--foam); }
.ledger-stats dt {
  order: 2;
  font-weight: 400;
  font-size: var(--t-xs);
  color: var(--grounds);
}
.ledger-stats div { display: flex; flex-direction: column; }
.ledger-stats dd {
  order: 1;
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-lg);
  color: var(--espresso);
  font-variant-numeric: tabular-nums;
}
.ledger-follows {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 14px 0 0;
  font-size: var(--t-sm);
  color: var(--grounds);
}
.ledger-follows a { color: var(--grounds) !important; }
.ledger-follows b { color: var(--espresso); font-weight: 600; }

/* Settings on your own profile: grouped cards, as in iOS Settings */
.settings { margin: 0 0 26px; }
.settings-title, .section-title {
  margin: 0 4px 10px;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-lg);
  color: var(--roast);
}
.settings-group {
  display: block;
  margin: 0 0 14px;
  padding: 0 16px;
}
.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  margin: 0;
  font-size: var(--t-md);
  color: var(--espresso);
  cursor: pointer;
}
.setting-label { display: flex; align-items: baseline; gap: 10px; }
.setting-status { font-size: var(--t-sm); color: var(--grounds); }
.settings-group noscript .rwm-btn { margin: 0 0 14px; }
.settings-logout {
  min-height: 56px;
  line-height: 56px;
  text-align: center;
  font-size: var(--t-md);
  font-weight: 600;
  color: #B3261E !important;
  text-decoration: none;
}

/* A switch from a plain checkbox */
.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 999px;
  background: #D9C4B0;
  cursor: pointer;
  transition: background-color 150ms ease;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(43, 20, 5, 0.25);
  transition: transform 150ms ease;
}
.switch:checked { background: var(--roast); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 3px solid var(--caramel); outline-offset: 2px; }

/* Bottom sheet dialog */
.sheet {
  width: min(420px, calc(100% - 28px));
  padding: 20px;
  color: var(--espresso);
}
.sheet::backdrop { background: rgba(43, 20, 5, 0.45); }
.sheet form { display: grid; gap: 10px; }
.sheet-title {
  margin: 0 0 6px;
  text-align: center;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-lg);
  color: var(--roast);
}
.sheet-file { position: relative; overflow: hidden; margin: 0; }
.sheet-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sheet-destructive, .sheet-cancel {
  min-height: 44px;
  border: 0;
  background: transparent;
  font-weight: 600;
  font-size: var(--t-md);
  cursor: pointer;
}
.sheet-destructive { color: #B3261E; }
.sheet-cancel { color: var(--grounds); }

/* ---------- Memories: Hall of Fame and standings ---------- */

.honor-roll, .standings {
  list-style: none;
  margin: 0 0 10px;
  padding: 4px 0;
  overflow: hidden;
}
.honor-roll li + li, .standing + .standing { border-top: 1.5px solid var(--foam); }
.honor {
  display: grid;
  grid-template-columns: 4.2rem auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--espresso) !important;
}
.honor-year {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-xl);
  color: var(--roast);
  font-variant-numeric: tabular-nums;
}
.honor-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
  min-width: 0;
  overflow-wrap: anywhere;
}
.honor-points, .standing-points {
  font-family: var(--display);
  font-weight: 600;
  color: var(--roast);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.board-note {
  margin: 0 6px 26px;
  font-size: var(--t-xs);
  color: var(--grounds);
}

.board-picker { margin: 0 0 12px; }
.rwm-select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 46px;
  padding: 0 44px 0 16px;
  border: var(--line);
  border-radius: 999px;
  background: var(--milk) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23803E00' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 18px center;
  color: var(--roast);
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
  box-shadow: var(--sticker-shadow);
}
.rwm-select:focus { outline: 3px solid var(--caramel); outline-offset: 2px; }

.standing {
  display: grid;
  grid-template-columns: 1.6rem auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 11px 16px;
}
.standing-rank {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
  color: var(--grounds);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.standing-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.standing-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
  color: var(--espresso) !important;
  overflow-wrap: anywhere;
}
.standing-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--t-xs);
  color: var(--roast);
}
.standing-detail { font-size: var(--t-xs); color: var(--grounds); }
.standing-points { font-size: var(--t-lg); }
.standing--winner { background: #FFF1DE; }
.standing--winner .standing-rank { color: var(--roast); }

/* ---------- Friends: segmented tabs and people lists ---------- */

.segmented {
  display: flex;
  gap: 4px;
  margin: 4px 0 16px;
  padding: 4px;
  border-radius: 999px;
}
.segmented-option {
  flex: 1;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--roast);
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-sm);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.segmented-option[aria-selected="true"] { background: var(--roast); color: var(--milk); }
.segmented-option:focus-visible { outline: 3px solid var(--caramel); outline-offset: 2px; }
.segmented-count { font-weight: 500; opacity: 0.75; font-variant-numeric: tabular-nums; }

.rwm-search { margin-bottom: 12px; background: var(--milk); }
.people { margin: 0 0 16px; padding: 0; list-style: none; overflow: hidden; }
.person {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
}
.person + .person { border-top: 1.5px solid var(--foam); }
.person[hidden] { display: none; }
.person-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.person-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-md);
  line-height: 1.2;
  color: var(--espresso) !important;
  overflow-wrap: anywhere;
}
.person-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: var(--t-xs);
  color: var(--grounds);
}
.person-follows-you {
  padding: 1px 8px;
  border: 1.5px solid var(--caramel);
  border-radius: 999px;
  color: var(--roast);
  font-weight: 600;
}
.person form { margin: 0; }
.person form[hidden] { display: none; }

/* ---------- News ---------- */

.news-admin { margin: 0 0 12px; text-align: right; }
.news { margin: 0; padding: 0; list-style: none; }
.news li + li { margin-top: 12px; }
.news-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 16px;
  color: var(--espresso) !important;
  text-decoration: none !important;
}
.news-item:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--roast-deep); }
.news-date { font-size: var(--t-xs); color: var(--grounds); }
.news-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-lg);
  line-height: 1.2;
  color: var(--roast);
}
.news-preview {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: var(--t-sm);
  color: var(--grounds);
}

.announcement { padding: 18px 18px 20px; margin-bottom: 16px; overflow: hidden; }
.announcement-title {
  margin: 4px 0 14px;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-2xl);
  line-height: 1.1;
  color: var(--roast);
}

/* Announcement bodies come from a rich-text editor. */
.rich-content { font-size: var(--t-md); line-height: 1.5; color: var(--espresso); overflow-wrap: anywhere; }
.rich-content > :last-child { margin-bottom: 0; }
.rich-content img { display: block; width: 100%; max-width: 100%; height: auto; margin: 12px 0; border-radius: 12px; }
.rich-content p, .rich-content div, .rich-content figure { max-width: 100%; }
.rich-content a { color: var(--roast); text-decoration: underline; }
.rich-content ul, .rich-content ol { padding-left: 1.4em; }
.rich-content table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin-bottom: 1rem; font-size: var(--t-sm); }
.rich-content th, .rich-content td { padding: 8px; border: 1px solid var(--foam); text-align: left; }
.rich-content th { background: var(--roast); color: var(--milk); }
.rich-content tr:nth-child(even) td { background: #FFF4E8; }
.rich-content pre { padding: 12px; border-radius: 10px; background: var(--foam); white-space: pre-wrap; overflow-x: auto; }
.rich-content code { padding: 1px 4px; border-radius: 4px; background: var(--foam); }

/* ---------- Signed-out welcome ---------- */

.welcome {
  display: grid;
  gap: 14px;
  max-width: 400px;
  margin: 12vh auto 0;
  text-align: center;
}
.welcome-logo { width: 100%; max-width: 340px; margin: 0 auto; }
.welcome-line {
  margin: 0 0 18px;
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--t-lg);
  color: var(--roast);
}

/* ---------- Log in, sign up, password reset ---------- */

.auth { max-width: 420px; margin: 0 auto; padding-top: 4vh; padding-bottom: 32px; }
.auth-logo { display: block; width: min(200px, 56%); height: auto; margin: 0 auto 18px; }
.auth-card { padding: 20px 18px 22px; }
.auth-title {
  margin: 0 0 14px;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-2xl);
  line-height: 1.1;
  color: var(--roast);
}
.auth-note { margin: -4px 0 16px; font-size: var(--t-sm); color: var(--grounds); }
.auth-card .rwm-btn--block { margin-top: 4px; }
.field-label {
  display: block;
  margin: 0 0 6px 4px;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-sm);
  color: var(--roast);
}
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-links { margin: 14px 0 0; text-align: center; font-size: var(--t-sm); }
.auth-switch { margin: 18px 0 0; text-align: center; font-size: var(--t-md); color: var(--espresso); }
.auth-links a, .auth-switch a, .auth-fine a { color: var(--roast) !important; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.auth-fine { margin: 14px 6px 0; text-align: center; font-size: var(--t-xs); line-height: 1.45; color: var(--grounds); }
.auth-fine--inside { margin: 2px 2px 12px; text-align: left; }

.rwm-error {
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1.5px solid #B4532A;
  border-radius: 14px;
  background: #FBE1D2;
  color: #7A2E0C;
  font-size: var(--t-sm);
}
.rwm-error p { margin: 0; }
.rwm-error p + p { margin-top: 4px; }

/* ---------- Privacy Policy and Terms ---------- */

.legal { padding: 20px 18px 24px; margin-bottom: 24px; font-size: var(--t-sm); line-height: 1.55; color: var(--espresso); overflow-wrap: anywhere; }
.legal h1, .legal h2, .legal h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; color: var(--roast); }
.legal h1 { margin: 26px 0 8px; font-size: var(--t-xl); }
.legal h1:first-child { margin-top: 0; font-size: var(--t-2xl); }
.legal h2 { margin: 18px 0 6px; font-size: var(--t-lg); }
.legal h3 { margin: 14px 0 4px; font-size: var(--t-md); }
.legal ul { padding-left: 1.2em; }
.legal li p { margin-bottom: 6px; }
.legal a { color: var(--roast); text-decoration: underline; }

/* ---------- Web navigation (the iOS app has its own tab bar) ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px max(16px, calc((100vw - 1080px) / 2));
  background: var(--crema);
  border-bottom: 2px solid var(--foam);
}
.site-nav-brand { display: block; line-height: 0; }
.site-nav-brand img { width: 168px; height: auto; }
.site-nav-tabs { display: flex; gap: 4px; }
.site-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--roast) !important;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--t-sm);
  text-decoration: none !important;
  transition: background-color 120ms ease;
}
.site-nav-tab:hover { background: rgba(128, 62, 0, 0.08); }
.site-nav-tab[aria-current="page"] { background: var(--roast); color: var(--milk) !important; }
.site-nav-tab i { font-size: 15px; }
.site-nav-auth { display: flex; gap: 8px; }

/* On a phone the sections move to a tab bar at the bottom, as in the app. */
@media (max-width: 700px) {
  .site-nav { position: static; padding: 8px 12px; border-bottom: 0; }
  .site-nav-brand img { width: 150px; }
  .site-nav-tabs {
    position: fixed;
    z-index: 30;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    justify-content: space-around;
    gap: 0;
    padding: 6px;
    border: 2px solid var(--roast-deep);
    border-radius: 22px;
    background: var(--milk);
    box-shadow: 0 3px 0 var(--roast-deep), 0 10px 24px rgba(43, 20, 5, 0.18);
  }
  .site-nav-tab {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-height: 48px;
    padding: 4px 0;
    border-radius: 16px;
    font-size: 11px;
  }
  .site-nav-tab i { font-size: 18px; }
}

/* Focus rings for keyboard users only; a tap or click shouldn't leave one. */
.rwm :focus:not(:focus-visible) { outline: none; }
.rwm a:focus-visible, .rwm button:focus-visible, .rwm summary:focus-visible { outline: 3px solid var(--caramel); outline-offset: 2px; }

/* ---------- Messages (Django messages framework) ---------- */

.rwm-flash {
  margin-bottom: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--espresso);
  color: var(--milk);
  font-size: var(--t-sm);
}

@media (prefers-reduced-motion: reduce) {
  .rwm-btn, .drink-usual { transition: none; }
}

/* In a list of people, Unfollow is the quiet way out; Follow stands up. */
.person .rwm-btn--quiet { box-shadow: none; border-width: 1.5px; background: none; color: var(--grounds) !important; border-color: #C9A98C; }
.person--plain { grid-template-columns: auto 1fr; }
.page-back { margin: 8px 0 24px; text-align: center; }
.rich-content h1, .rich-content h2, .rich-content h3, .rich-content h4 { font-family: var(--display); font-weight: 600; line-height: 1.15; color: var(--roast); margin: 18px 0 8px; }
