
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Parchment */
  --paper-hi: #faf1d8;
  --paper: #f4e8ca;
  --paper-lo: #ead9b4;
  --paper-edge: #d9c194;

  /* Ink / text on paper */
  --ink: #4a2d12;
  --ink-title: #5a3410;
  --ink-body: #6b4a2a;
  --ink-muted: #8a6a42;
  --name: #b5652f;

  /* Gilding + hardware */
  --gold: #c8a25c;
  --gold-soft: #e6be74;
  --gold-deep: #a06f2c;
  --line: #d5bc8c;

  /* Tinted card shadow (matches the warm wood, never pure black) */
  --shadow-card: 62 38 14;

  /* Wood / leather */
  --wood-deep: #160b06;
  --wood: #241309;
  --leather-hi: #6a4023;
  --leather: #4a2c15;
  --leather-lo: #2f1a0b;

  --r: 12px;
}

body {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ink);
  background: var(--wood-deep);
  /* Prevent page-level scrollbars — content should fit inside the book */
  overflow: hidden;
}

.bg-frame {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* ---------- Top navigation (copied/tuned from meal-planner.css) ---------- */
.top-navigation {
  position: fixed;
  top: 0;
  left: clamp(6px, 1.3vw, 20px);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  padding: 22px 0;
  z-index: 100;
}

.ui-btn {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition:
    transform var(--t),
    filter var(--t);
}

.nav-btn {
  width: clamp(84px, 9vw, 130px);
  height: clamp(72px, 7.6vw, 110px);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Icon+label PNGs (labels are baked into the artwork) */
.nav-btn .title-logo,
.title-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(2px 4px 5px rgba(0, 0, 0, 0.5));
}

.ui-btn:hover {
  transform: translateY(-3px) scale(1.04);
  filter: brightness(1.08);
}

.ui-btn:active {
  transform: translateY(0) scale(0.98);
}



/* ---------- Page surface (dark wood) ---------- */
.account-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  padding: clamp(20px, 3vw, 48px);
  /* remove large left offset (side-rail removed) so book centers */
  padding-left: clamp(14px, 4vw, 28px);
  background:
    radial-gradient(130% 95% at 50% 8%, #3a2416 0%, #1d0f07 62%, #120904 100%),
    repeating-linear-gradient(92deg, rgba(0, 0, 0, .10) 0 3px, rgba(255, 232, 190, .015) 3px 7px);
  background-blend-mode: multiply, normal;
}

.account-page::after {
  /* soft vignette */
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 45%, transparent 55%, rgba(0, 0, 0, .5) 100%);
}

/* =====================================================================
   Left navigation rail
   ===================================================================== */
.side-rail {
  position: fixed;
  left: clamp(8px, 1vw, 18px);
  top: 50%;
  transform: translateY(-50%);
  width: clamp(84px, 8vw, 116px);
  z-index: 20;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2.4vw, 30px);
  padding: clamp(18px, 2vw, 28px) 0;

  background: linear-gradient(180deg, #3c2415 0%, #24130a 55%, #180d06 100%);
  border: 2px solid #120a05;
  border-radius: 46px;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(255, 220, 160, .10),
    inset 0 0 0 1px rgba(0, 0, 0, .4);
}

.rail-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  text-decoration: none;
  color: #cbb083;
  transition: transform .18s ease, color .18s ease, filter .18s ease;
}

.rail-ic-wrap {
  width: clamp(40px, 4vw, 54px);
  height: clamp(40px, 4vw, 54px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  transition: box-shadow .25s ease, background .25s ease;
}

.rail-ic {
  width: 100%;
  height: 100%;
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, .55));
}

.rail-label {
  font-family: "Cinzel", serif;
  font-weight: 600;
  font-size: clamp(.58rem, .82vw, .78rem);
  letter-spacing: .07em;
  line-height: 1.08;
  text-align: center;
  text-transform: uppercase;
  color: inherit;
}

.rail-item:hover,
.rail-item:focus-visible {
  transform: translateY(-2px);
  color: #f4d9a6;
  filter: brightness(1.08);
  outline: none;
}

.rail-item.is-active {
  color: #f4d29a;
}

.rail-item.is-active .rail-ic-wrap.seal {
  background: radial-gradient(circle, rgba(244, 197, 122, .38), transparent 68%);
  box-shadow: 0 0 20px 5px rgba(244, 197, 122, .38);
}

/* =====================================================================
   Close button
   ===================================================================== */
.close-btn {
  position: fixed;
  top: clamp(12px, 1.4vw, 24px);
  right: clamp(14px, 1.6vw, 28px);
  width: clamp(40px, 3.4vw, 52px);
  height: clamp(40px, 3.4vw, 52px);
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 30;
  transition: transform .18s ease, filter .18s ease;
}

.close-btn svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .55));
}

.close-btn:hover,
.close-btn:focus-visible {
  transform: scale(1.08) rotate(4deg);
  filter: brightness(1.08);
  outline: none;
}

/* =====================================================================
   The book
   ===================================================================== */
.book {
  position: relative;
  margin: auto;
  /* Wider book, shorter height per request */
  /* match Chief Journal proportions: responsive wide book */
  width: min(90vw, 1000px);
  aspect-ratio: 3 / 2;
  /* ensure the book fits within the viewport with minimal page chrome */
  max-height: calc(100vh - 40px);
  display: flex;
  align-items: stretch;

  /* center the book and ensure it doesn't flow offscreen */
  margin-left: auto;
  margin-right: auto;

  padding: clamp(4px, 0.6vw, 8px);
  border-radius: 10px;
  /* Use the provided chefbook image instead of the CSS leather effect */
  background-image: url("../img/book.png");
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  /* keep subtle outer shadow but let the image provide the visual book */
  box-shadow: 0 25px 40px rgba(0, 0, 0, 0.35);
  /* raise pages slightly by reducing top padding */
  padding: 1% 5%;

  animation: bookIn .55s cubic-bezier(.2, .7, .25, 1) both;
}

@keyframes bookIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* center spine */
.book-spine {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 46px;
  transform: translateX(-50%);
  z-index: 4;
  pointer-events: none;
  background: linear-gradient(90deg,
      rgba(74, 44, 21, 0) 0%,
      rgba(60, 34, 14, .28) 40%,
      rgba(40, 22, 9, .5) 50%,
      rgba(60, 34, 14, .28) 60%,
      rgba(74, 44, 21, 0) 100%);
}

/* ---------- Parchment page ---------- */
.page {
  position: relative;
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  /* Allow pages to fill the book height while keeping the header fixed */
  height: 100%;
  /* reduce vertical padding so content sits a bit higher */
  padding: clamp(12px, 1.5vw, 24px) clamp(16px, 2vw, 32px);
  /* Make pages transparent so the chefbook image shows through */
  background: transparent;
  overflow: hidden;
}

.page-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(14px, 2vw, 24px) 8px clamp(14px, 2vw, 24px) 0;
  scrollbar-width: none;
  /* Soft fade at the top/bottom scroll edges so cards melt away instead of
     being sliced through the middle when the content scrolls. */
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0, #000 18px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(to bottom,
    transparent 0, #000 18px, #000 calc(100% - 22px), transparent 100%);
}

.page-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}


/*5 faint aged-paper grain */
.page::after {
  /* parchment grain removed when using the chefbook image */
  display: none;
}

/* WebKit-based browsers: hide scrollbar for page panels */
.page::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* inner gilt frame */
.page::before {
  /* inner gilt frame hidden when using the chefbook image */
  display: none;
}

/* keep content above the frame + grain */
.page > * {
  position: relative;
  z-index: 2;
}

/* =====================================================================
   Headings + divider ornament
   ===================================================================== */
.page-head {
  text-align: center;
  margin-bottom: clamp(10px, 1.2vw, 18px);
}

.page-title {
  font-family: "Cinzel", serif;
  font-weight: 800;
  color: var(--ink-title);
  letter-spacing: .02em;
  line-height: 1.14;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
  font-size: clamp(1.5rem, 2.4vw, 2.3rem);
}

.page-title.sm {
  font-size: clamp(1.24rem, 1.9vw, 1.78rem);
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: .55rem auto 0;
  width: min(76%, 360px);
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1.5px;
}

.divider::before {
  background: linear-gradient(90deg, transparent, var(--gold-deep) 92%);
}

.divider::after {
  background: linear-gradient(270deg, transparent, var(--gold-deep) 92%);
}

.divider .diamond {
  position: relative;
  flex: none;
  width: 9px;
  height: 9px;
  margin: 0 12px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--gold-soft), #b3823a);
  box-shadow:
    0 0 0 1px rgba(255, 244, 220, .5),
    0 0 0 3px rgba(160, 111, 44, .22);
}

/* =====================================================================
   Left page — menu rows
   ===================================================================== */
.menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vw, 16px);
  margin-top: clamp(10px, 1.2vw, 16px);
}

.menu-item {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 18px);
  padding: clamp(10px, 1.2vw, 15px) clamp(12px, 1.4vw, 20px);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  overflow: hidden;

  background: linear-gradient(180deg, #fdf5e2 0%, #f1e4c3 100%);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r);
  box-shadow:
    0 2px 6px rgba(var(--shadow-card) / .16),
    inset 0 1px 0 rgba(255, 255, 255, .6),
    inset 0 0 0 1px rgba(200, 162, 92, .18);
  transition: transform .22s cubic-bezier(.22,1,.36,1),
              box-shadow .22s cubic-bezier(.22,1,.36,1),
              filter .22s ease;
}

/* gilt accent bar that slides in from the binding edge on hover */
.menu-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 12%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep));
  transform: scaleY(0);
  transform-origin: center;
  opacity: 0;
  transition: transform .24s cubic-bezier(.22,1,.36,1), opacity .24s ease;
}

.menu-item:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 22px rgba(var(--shadow-card) / .24),
    inset 0 1px 0 rgba(255, 255, 255, .65),
    inset 0 0 0 1px rgba(200, 162, 92, .3);
  filter: brightness(1.015);
}

.menu-item:hover::before {
  transform: scaleY(1);
  opacity: 1;
}

.menu-item:active {
  transform: translateY(0);
  box-shadow:
    0 2px 5px rgba(var(--shadow-card) / .18),
    inset 0 2px 6px rgba(var(--shadow-card) / .16);
}

.menu-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.menu-item--compact {
  width: auto;
  max-width: clamp(180px, 34vw, 260px);
  margin: 0 auto;
  padding-left: clamp(14px, 1.4vw, 18px);
  padding-right: clamp(14px, 1.4vw, 18px);
  justify-content: center;
}

.menu-item--compact .menu-text {
  align-items: center;
}

.menu-ic {
  flex: none;
  width: clamp(44px, 4.4vw, 58px);
  height: clamp(44px, 4.4vw, 58px);
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 30%, #fdf6e6, #e9d7ae);
  border: 1px solid rgba(160, 111, 44, .45);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, .7),
    inset 0 0 0 1px rgba(255, 255, 255, .4),
    0 1px 3px rgba(var(--shadow-card) / .2);
  transition: box-shadow .22s ease, transform .22s cubic-bezier(.22,1,.36,1);
}

.menu-item:hover .menu-ic {
  transform: scale(1.04);
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, .75),
    0 0 0 1px rgba(200, 162, 92, .5),
    0 2px 8px rgba(var(--shadow-card) / .28);
}

.menu-ic svg {
  width: 62%;
  height: 62%;
}

.menu-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.menu-title {
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: var(--ink);
  font-size: clamp(1rem, 1.35vw, 1.28rem);
  letter-spacing: .01em;
}

.menu-sub {
  font-style: italic;
  color: var(--ink-muted);
  font-size: clamp(.9rem, 1.15vw, 1.08rem);
  line-height: 1.2;
}

.menu-chevron {
  flex: none;
  width: clamp(18px, 1.8vw, 24px);
  height: clamp(18px, 1.8vw, 24px);
  opacity: .85;
  transition: transform .18s ease;
}

.menu-item:hover .menu-chevron {
  transform: translateX(3px);
}

/* =====================================================================
   Right page — household & shared kitchen
   ===================================================================== */
.hh-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.4vw, 18px);
  margin-top: clamp(10px, 1.2vw, 16px);
}

.hh-panel[hidden] { display: none; }

.hh-lead {
  font-style: italic;
  color: var(--ink-body);
  font-size: clamp(1rem, 1.25vw, 1.16rem);
  line-height: 1.35;
  text-align: center;
}

.hh-section {
  margin-top: clamp(6px, 0.8vw, 10px);
}

.hh-section[hidden] { display: none; }

.hh-actions {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 1.2vw, 14px);
  flex-wrap: wrap;
}

.hh-actions[hidden] { display: none; }

/* Inline parchment form (create household / send invite) */
.hh-inline-form {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vw, 14px);
  padding: clamp(12px, 1.4vw, 16px) clamp(14px, 1.5vw, 18px);
  background: linear-gradient(180deg, #fdf5e2 0%, #f1e4c3 100%);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 0 0 1px rgba(200, 162, 92, .15);
}

.hh-inline-form[hidden] { display: none; }

/* "How would you like to start?" checkbox group in the create form */
.hh-copy-group {
  display: flex;
  flex-direction: column;
  gap: clamp(7px, 0.9vw, 10px);
  padding-top: clamp(4px, 0.5vw, 6px);
  border-top: 1px dashed var(--paper-edge);
}

/* ---------- Workspace selector ---------- */
.hh-workspace {
  margin-top: clamp(10px, 1.2vw, 16px);
}

.hh-workspace[hidden] { display: none; }

.hh-workspace-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 14px);
  padding: clamp(10px, 1.2vw, 14px) clamp(12px, 1.4vw, 18px);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  background: linear-gradient(180deg, #fdf5e2 0%, #f1e4c3 100%);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r);
  box-shadow:
    0 2px 6px rgba(var(--shadow-card) / .16),
    inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: box-shadow .2s ease, transform .2s cubic-bezier(.22,1,.36,1);
}

.hh-workspace-toggle:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 14px rgba(var(--shadow-card) / .22),
    inset 0 1px 0 rgba(255, 255, 255, .65);
}

.hh-workspace-toggle:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

.hh-workspace-label {
  flex: none;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(.72rem, .9vw, .84rem);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.hh-workspace-name {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: var(--ink-title);
  font-size: clamp(.98rem, 1.25vw, 1.16rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hh-workspace-chevron {
  flex: none;
  width: clamp(16px, 1.6vw, 20px);
  height: clamp(16px, 1.6vw, 20px);
  transition: transform .2s ease;
}

.hh-workspace-toggle[aria-expanded="true"] .hh-workspace-chevron {
  transform: rotate(90deg);
}

.hh-workspace-list {
  list-style: none;
  margin-top: 8px;
  padding: clamp(8px, 1vw, 10px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(180deg, #fdf5e2 0%, #f1e4c3 100%);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}

.hh-workspace-list[hidden] { display: none; }

.hh-workspace-option {
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: clamp(8px, 1vw, 11px) clamp(10px, 1.2vw, 14px);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: background .18s ease, border-color .18s ease;
}

.hh-workspace-option:hover {
  background: rgba(200, 162, 92, .14);
}

.hh-workspace-option.is-active {
  border-color: var(--gold);
  background: rgba(200, 162, 92, .18);
}

.hh-workspace-option:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 1px;
}

.hh-ws-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.hh-ws-type {
  flex: none;
  font-style: italic;
  color: var(--ink-muted);
  font-size: clamp(.84rem, 1vw, .95rem);
}

/* ---------- Member grid ---------- */
.hh-members {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(72px, 8vw, 96px), 1fr));
  gap: clamp(8px, 1vw, 14px);
  margin-top: clamp(8px, 1vw, 12px);
}

.hh-member {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.hh-member-avatar {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 30%, #fdf6e6, #e9d7ae);
  border: 2px solid var(--gold);
  font-family: "Cinzel", serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  color: var(--ink-title);
  box-shadow:
    0 2px 6px rgba(var(--shadow-card) / .24),
    inset 0 0 0 1px rgba(255, 255, 255, .45),
    inset 0 0 6px rgba(122, 78, 30, .18);
}

/* the current chef ("you") — gilded seal ring so the tile reads as intentional */
.hh-member.is-you .hh-member-avatar {
  border-color: var(--gold-soft);
  box-shadow:
    0 0 0 2px rgba(244, 197, 122, .55),
    0 4px 14px rgba(var(--shadow-card) / .3),
    inset 0 0 0 1px rgba(255, 255, 255, .5);
}

.hh-member.is-you .hh-member-avatar::after {
  content: "You";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 3px 0 2px;
  text-align: center;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(.5rem, .8vw, .66rem);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #5a3410;
  background: linear-gradient(180deg, rgba(244, 214, 150, .82), rgba(230, 190, 116, .92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}

.hh-member-name {
  max-width: 100%;
  font-weight: 600;
  color: var(--ink);
  font-size: clamp(.86rem, 1.05vw, 1rem);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hh-member-role {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(.6rem, .78vw, .72rem);
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* ---------- Invite rows (pending + invitations for me) ---------- */
.hh-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vw, 12px);
  margin-top: clamp(8px, 1vw, 12px);
}

.hh-invite-item {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 14px);
  padding: clamp(9px, 1vw, 13px) clamp(12px, 1.3vw, 18px);
  background: linear-gradient(180deg, #fdf5e2 0%, #f1e4c3 100%);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r);
  box-shadow:
    0 2px 6px rgba(var(--shadow-card) / .14),
    inset 0 1px 0 rgba(255, 255, 255, .55);
}

.hh-invite-text {
  flex: 1;
  min-width: 0;
  color: var(--ink-body);
  font-size: clamp(.95rem, 1.15vw, 1.08rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.hh-invite-text .hh-invite-name {
  color: var(--name);
  font-style: italic;
  font-weight: 600;
}

/* ---------- Footer + inline confirm ---------- */
.hh-footer {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 1.2vw, 14px);
  flex-wrap: wrap;
  margin-top: clamp(8px, 1vw, 14px);
  padding-top: clamp(10px, 1.2vw, 14px);
  border-top: 1px dashed var(--paper-edge);
}

.hh-confirm {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vw, 14px);
  padding: clamp(12px, 1.4vw, 16px);
  border: 1px solid #dda491;
  border-radius: var(--r);
  background: linear-gradient(180deg, #fbeee8 0%, #f5ddd3 100%);
}

.hh-confirm[hidden] { display: none; }

.hh-confirm-text {
  color: #7a2718;
  font-size: clamp(.95rem, 1.15vw, 1.08rem);
  line-height: 1.35;
  text-align: center;
}

/* =====================================================================
   Right page — section subhead (shared)
   ===================================================================== */
.section-subhead {
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: var(--ink-title);
  font-size: clamp(1.02rem, 1.5vw, 1.34rem);
  letter-spacing: .02em;
  margin: clamp(10px, 1.2vw, 14px) 0 clamp(6px, 0.8vw, 10px);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
  padding-bottom: 6px;
  border-bottom: 1.5px solid transparent;
  border-image: linear-gradient(90deg, var(--gold-deep) 0%, rgba(200, 162, 92, .15) 55%, transparent 100%) 1;
}

/* =====================================================================
   Account function panels — overlay + parchment modal
   ===================================================================== */
.acc-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 40px);
  background: radial-gradient(120% 100% at 50% 40%, rgba(20, 11, 4, .58), rgba(12, 6, 2, .78));
  backdrop-filter: blur(2px);
  animation: accFade .22s ease both;
}

.acc-overlay[hidden] {
  display: none;
}

@keyframes accFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.acc-modal {
  position: relative;
  width: min(560px, 94vw);
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.6vw, 34px) clamp(20px, 2.8vw, 38px) clamp(18px, 2.4vw, 30px);
  border-radius: var(--r);
  color: var(--ink);

  background:
    linear-gradient(180deg, var(--paper-hi) 0%, var(--paper) 54%, var(--paper-lo) 100%);
  border: 1px solid var(--paper-edge);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, .5),
    inset 0 1px 0 rgba(255, 255, 255, .6),
    inset 0 0 0 1px rgba(200, 162, 92, .28);
  animation: accModalIn .3s cubic-bezier(.2, .7, .25, 1) both;
}

@keyframes accModalIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.acc-modal-close {
  position: absolute;
  top: clamp(-12px, -0.8vw, -8px);
  right: clamp(-12px, -0.8vw, -8px);
  width: clamp(38px, 3.2vw, 46px);
  height: clamp(38px, 3.2vw, 46px);
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  transition: transform .18s ease, filter .18s ease;
}

.acc-modal-close svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5));
}

.acc-modal-close:hover,
.acc-modal-close:focus-visible {
  transform: scale(1.08) rotate(4deg);
  filter: brightness(1.08);
  outline: none;
}

.acc-modal-head {
  text-align: center;
  margin-bottom: clamp(8px, 1vw, 14px);
}

.acc-modal-title {
  font-family: "Cinzel", serif;
  font-weight: 800;
  color: var(--ink-title);
  letter-spacing: .02em;
  line-height: 1.14;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
  font-size: clamp(1.3rem, 2vw, 1.9rem);
}

.acc-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: clamp(16px, 2vw, 24px) 4px clamp(16px, 2vw, 24px) 0;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}

.acc-modal-body::-webkit-scrollbar { width: 8px; }
.acc-modal-body::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 8px;
}

/* ---------- Inline status message ---------- */
.acc-status {
  margin: 0 0 clamp(10px, 1.2vw, 14px);
  padding: clamp(8px, 1vw, 11px) clamp(12px, 1.4vw, 16px);
  border-radius: 10px;
  font-size: clamp(.95rem, 1.15vw, 1.08rem);
  line-height: 1.3;
  text-align: center;
  border: 1px solid transparent;
}

.acc-status[hidden] { display: none; }

.acc-status.is-success {
  color: #2f5122;
  background: linear-gradient(180deg, #e7f2d4, #d8ecc0);
  border-color: #b6d493;
}

.acc-status.is-error {
  color: #7a2718;
  background: linear-gradient(180deg, #f6ddd4, #f0ccc0);
  border-color: #dda491;
}

.acc-status.is-info {
  color: var(--ink-body);
  background: linear-gradient(180deg, #f2e7c8, #e9dab4);
  border-color: var(--paper-edge);
}

/* ---------- Panels ---------- */
.acc-panel {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.5vw, 18px);
  padding: 0 clamp(16px, 2vw, 24px);
  min-height: 1px;
}

.acc-panel[hidden] { display: none; }

.acc-form {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.2vw, 16px);
  width: 100%;
}

.acc-lead {
  font-style: italic;
  color: var(--ink-body);
  font-size: clamp(1rem, 1.25vw, 1.16rem);
  line-height: 1.35;
  text-align: center;
}

/* ---------- Form fields ---------- */
.acc-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.acc-label {
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: var(--ink-title);
  font-size: clamp(.86rem, 1.05vw, 1rem);
  letter-spacing: .03em;
}

.acc-input {
  width: 100%;
  padding: clamp(10px, 1.1vw, 13px) clamp(12px, 1.3vw, 16px);
  font: inherit;
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  color: var(--ink);
  background: linear-gradient(180deg, #fffaec, #f6ecd0);
  border: 1px solid var(--paper-edge);
  border-radius: 10px;
  box-shadow:
    inset 0 2px 4px rgba(122, 78, 30, .12),
    inset 0 0 0 1px rgba(255, 255, 255, .5);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.acc-input::placeholder { color: var(--ink-muted); opacity: .7; }

/* Input paired with an inline Change button */
.acc-input-row {
  display: flex;
  align-items: stretch;
  gap: clamp(8px, 1vw, 12px);
}

.acc-input-row .acc-input { flex: 1 1 auto; min-width: 0; }

.acc-change-btn {
  flex: none;
  padding: 0 clamp(14px, 1.6vw, 20px);
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(.82rem, 1vw, .96rem);
  letter-spacing: .03em;
  color: #4a2c0f;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(180deg, #f6d99a 0%, #e6be74 46%, #c78a3a 100%);
  border: 1px solid #a06f2c;
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    0 2px 6px rgba(var(--shadow-card) / .24);
  transition: transform .16s cubic-bezier(.22,1,.36,1), filter .16s ease, box-shadow .16s ease;
}

.acc-change-btn:hover:not([disabled]) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.acc-change-btn:active:not([disabled]) { transform: translateY(0); filter: brightness(.97); }
.acc-change-btn:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

/* Editing state — the Change button becomes a Cancel affordance */
.acc-change-btn.is-editing {
  color: #7a2718;
  background: linear-gradient(180deg, #f2ddd4, #e7c6ba);
  border-color: #c08a7a;
}

/* Locked (cooldown active) */
.acc-change-btn[disabled] {
  cursor: not-allowed;
  opacity: .6;
  filter: grayscale(.35);
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
}

.acc-input:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow:
    inset 0 2px 4px rgba(122, 78, 30, .12),
    0 0 0 3px rgba(200, 162, 92, .3);
}

.acc-input:read-only {
  color: var(--ink-muted);
  background: linear-gradient(180deg, #f1e7cd, #e7dab9);
  cursor: not-allowed;
}

.acc-hint {
  font-style: italic;
  color: var(--ink-muted);
  font-size: clamp(.82rem, 1vw, .95rem);
  line-height: 1.3;
}

/* ---------- Actions / buttons ---------- */
.acc-actions {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 1.2vw, 14px);
  margin-top: clamp(4px, 0.6vw, 8px);
}

.acc-actions--stack {
  flex-direction: column;
  align-items: stretch;
}

.acc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: clamp(11px, 1.2vw, 14px) clamp(20px, 2.4vw, 30px);
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(.95rem, 1.15vw, 1.08rem);
  letter-spacing: .03em;
  text-decoration: none;
  color: #4a2c0f;
  cursor: pointer;

  background: linear-gradient(180deg, #f6d99a 0%, #e6be74 46%, #c78a3a 100%);
  border: 1px solid #a06f2c;
  border-radius: 11px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    0 3px 10px rgba(var(--shadow-card) / .3);
  transition: transform .18s cubic-bezier(.22,1,.36,1), box-shadow .18s ease, filter .18s ease;
}

.acc-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    0 7px 16px rgba(var(--shadow-card) / .36);
}

.acc-btn:active { transform: translateY(0); filter: brightness(.98); }

.acc-btn:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

.acc-btn[disabled] {
  cursor: not-allowed;
  opacity: .55;
  filter: grayscale(.3);
  transform: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
}

.acc-btn.is-busy { cursor: progress; opacity: .8; }

.acc-btn--danger {
  color: #f7e7dd;
  background: linear-gradient(180deg, #c0563f 0%, #a23c28 100%);
  border-color: #7a2718;
}

/* ---------- Notifications toggles ---------- */
.acc-toggle-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vw, 12px);
}

.acc-toggle {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 18px);
  padding: clamp(10px, 1.1vw, 14px) clamp(12px, 1.4vw, 18px);
  cursor: pointer;
  background: linear-gradient(180deg, #fdf5e2 0%, #f1e4c3 100%);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 0 0 1px rgba(200, 162, 92, .15);
  transition: box-shadow .2s ease;
}

.acc-toggle:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    inset 0 0 0 1px rgba(200, 162, 92, .32);
}

.acc-toggle-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.acc-toggle-title {
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: var(--ink);
  font-size: clamp(.98rem, 1.2vw, 1.14rem);
}

.acc-toggle-sub {
  font-style: italic;
  color: var(--ink-muted);
  font-size: clamp(.86rem, 1.05vw, 1rem);
}

/* visually-hidden checkbox drives the track */
.acc-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.acc-toggle-track {
  flex: none;
  position: relative;
  width: clamp(46px, 4.4vw, 54px);
  height: clamp(26px, 2.5vw, 30px);
  border-radius: 999px;
  background: linear-gradient(180deg, #d8c193, #c2a670);
  border: 1px solid #a88f5f;
  box-shadow: inset 0 2px 4px rgba(122, 78, 30, .3);
  transition: background .22s ease, box-shadow .22s ease;
}

.acc-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  width: clamp(20px, 2vw, 24px);
  height: clamp(20px, 2vw, 24px);
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 34%, #fffaef, #ecdcb9);
  box-shadow: 0 1px 3px rgba(var(--shadow-card) / .4), inset 0 1px 0 rgba(255, 255, 255, .7);
  transition: left .22s cubic-bezier(.22,1,.36,1), background .22s ease;
}

.acc-toggle-input:checked + .acc-toggle-track {
  background: linear-gradient(180deg, #6fae4f, #4f8a34);
  border-color: #3f6e2a;
  box-shadow: inset 0 2px 4px rgba(30, 60, 20, .35);
}

.acc-toggle-input:checked + .acc-toggle-track .acc-toggle-thumb {
  left: calc(100% - clamp(20px, 2vw, 24px) - 3px);
  background: radial-gradient(circle at 50% 34%, #ffffff, #eaf6df);
}

.acc-toggle-input:focus-visible + .acc-toggle-track {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

/* ---------- Privacy info row ---------- */
.acc-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(11px, 1.2vw, 15px) clamp(14px, 1.5vw, 18px);
  background: linear-gradient(180deg, #fdf5e2 0%, #f1e4c3 100%);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}

.acc-info-value {
  font-weight: 600;
  color: var(--name);
  font-size: clamp(1rem, 1.2vw, 1.14rem);
  overflow-wrap: anywhere;
  text-align: right;
}

/* ---------- Privacy info list ---------- */
.acc-info-list {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.8vw, 10px);
}

/* ---------- Ghost / secondary button ---------- */
.acc-btn--ghost {
  color: var(--ink-title);
  background: linear-gradient(180deg, #fdf5e2 0%, #efe1c0 100%);
  border: 1px solid var(--paper-edge);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    0 2px 6px rgba(var(--shadow-card) / .16);
}

/* ---------- Danger zone ---------- */
.acc-danger {
  margin-top: clamp(8px, 1vw, 12px);
  padding: clamp(14px, 1.6vw, 20px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vw, 12px);
  border: 1px solid #dda491;
  border-radius: var(--r);
  background: linear-gradient(180deg, #fbeee8 0%, #f5ddd3 100%);
}

.acc-danger-title {
  font-family: "Cinzel", serif;
  font-weight: 800;
  color: #7a2718;
  font-size: clamp(1rem, 1.3vw, 1.2rem);
  letter-spacing: .02em;
}

.acc-danger-confirm {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vw, 14px);
  padding-top: clamp(6px, 0.8vw, 10px);
  border-top: 1px dashed rgba(122, 39, 24, .3);
}

.acc-danger-confirm[hidden] {
  display: none !important;
}

.acc-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  color: var(--ink-body);
  font-size: clamp(.92rem, 1.1vw, 1.04rem);
  line-height: 1.35;
}

.acc-check input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #a23c28;
  cursor: pointer;
}

/* ---------- Help sub-tabs + sub-views ---------- */
.acc-subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: clamp(10px, 1.2vw, 16px);
  border-bottom: 1px solid var(--paper-edge);
}

.acc-subtab {
  flex: 1;
  padding: clamp(8px, 1vw, 11px) clamp(10px, 1.2vw, 14px);
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(.9rem, 1.1vw, 1.02rem);
  color: var(--ink-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}

.acc-subtab:hover { color: var(--ink-title); }

.acc-subtab.is-active {
  color: var(--ink-title);
  border-bottom-color: var(--gold-deep);
}

.acc-subtab:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }

.acc-subview {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.5vw, 18px);
}

.acc-subview[hidden] { display: none; }

.acc-section-title {
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: var(--ink-title);
  font-size: clamp(1.02rem, 1.3vw, 1.2rem);
  letter-spacing: .02em;
  margin-top: clamp(4px, 0.6vw, 8px);
}

/* ---------- Help FAQ (accordion) ---------- */
.acc-faq {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vw, 12px);
}

.acc-faq details {
  background: linear-gradient(180deg, #fdf5e2 0%, #f1e4c3 100%);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
  overflow: hidden;
}

.acc-faq summary {
  padding: clamp(11px, 1.2vw, 15px) clamp(14px, 1.5vw, 18px);
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: var(--ink-title);
  font-size: clamp(.98rem, 1.18vw, 1.12rem);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.acc-faq summary::-webkit-details-marker { display: none; }

.acc-faq summary::after {
  content: "+";
  font-family: "Cinzel", serif;
  color: var(--gold-deep);
  font-size: 1.2em;
  line-height: 1;
  transition: transform .2s ease;
}

.acc-faq details[open] summary::after { transform: rotate(45deg); }

.acc-faq summary:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: -2px; }

.acc-faq details p {
  margin: 0;
  padding: 0 clamp(14px, 1.5vw, 18px) clamp(12px, 1.3vw, 16px);
  color: var(--ink-body);
  font-size: clamp(.98rem, 1.15vw, 1.1rem);
  line-height: 1.4;
}

/* ---------- FAQ Footer (support CTA) ---------- */
.acc-faq-footer {
  margin-top: clamp(20px, 2vw, 28px);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vw, 14px);
  align-items: center;
}

.acc-faq-footer p {
  margin: 0;
  color: var(--ink-body);
  font-size: clamp(.98rem, 1.15vw, 1.1rem);
  line-height: 1.4;
}

.acc-faq-footer p:first-child {
  font-weight: 700;
  color: var(--ink-title);
}

/* ---------- Support ticket form ---------- */
.acc-ticket-form {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vw, 14px);
  width: 100%;
}

/* Ensure the form has proper padding when inside the modal */
.acc-panel .acc-ticket-form {
  margin: 0;
  padding: 0;
}

.acc-panel .acc-section-title {
  margin: 0 0 clamp(12px, 1.5vw, 16px);
}

.hh-manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(18px, 2vw, 28px);
}

.hh-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 28px;
  padding: clamp(22px, 2.4vw, 28px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .08);
}

.hh-card--full {
  grid-column: 1 / -1;
}

.hh-card--danger {
  background: #fff6f5;
  border-color: rgba(220, 38, 65, .18);
}

.hh-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: clamp(16px, 1.4vw, 20px);
}

.hh-card-title {
  font-family: "Cinzel", serif;
  font-size: clamp(1.05rem, 1.4vw, 1.24rem);
  font-weight: 700;
  color: var(--ink-title);
}

.hh-card-sub {
  color: var(--ink-body);
  font-size: clamp(.86rem, 1vw, .94rem);
}

.hh-card-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}

.hh-card-row:last-child {
  border-bottom: none;
}

.hh-card-label {
  color: var(--ink-body);
  font-size: clamp(.95rem, 1.02vw, 1rem);
}

.hh-card-value {
  color: var(--ink-title);
  font-weight: 600;
}

.hh-code {
  font-family: "Inter", sans-serif;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 12px;
  padding: 10px 12px;
}

.hh-small-btn {
  min-width: 100px;
}

.hh-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.hh-member-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 20px;
}

.hh-avatar {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #f7d07a, #f3c06b);
  color: #422b0a;
  font-weight: 700;
}

.hh-member-name {
  display: block;
  color: var(--ink-title);
  font-weight: 700;
}

.hh-member-role {
  color: var(--ink-body);
  font-size: .92rem;
}

.hh-card-text {
  margin: 0;
  color: var(--ink-body);
  line-height: 1.7;
}

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

.hh-activity-list li {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--ink-body);
  line-height: 1.55;
}

.hh-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
}

.hh-stats-grid span {
  display: block;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 18px;
  padding: 16px 14px;
  text-align: center;
}

.hh-stats-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
}

.acc-actions--stacked {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.acc-actions--wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.acc-textarea {
  resize: vertical;
  min-height: 92px;
  font-family: inherit;
  line-height: 1.4;
}

select.acc-input {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(180deg, #fffaec, #f6ecd0),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23a06f2c' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat, no-repeat;
  background-position: center, right 14px center;
  padding-right: 34px;
}

/* ---------- My Tickets list ---------- */
.acc-tickets {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vw, 12px);
}

.acc-tickets-empty {
  font-style: italic;
  color: var(--ink-muted);
  text-align: center;
  padding: clamp(14px, 2vw, 22px);
}

.acc-ticket {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: clamp(11px, 1.2vw, 15px) clamp(14px, 1.5vw, 18px);
  background: linear-gradient(180deg, #fdf5e2 0%, #f1e4c3 100%);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55);
}

.acc-ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.acc-ticket-no {
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: var(--ink-muted);
  font-size: clamp(.82rem, 1vw, .94rem);
  letter-spacing: .04em;
}

.acc-ticket-subject {
  font-weight: 600;
  color: var(--ink);
  font-size: clamp(1rem, 1.2vw, 1.12rem);
}

.acc-ticket-meta {
  font-style: italic;
  color: var(--ink-muted);
  font-size: clamp(.85rem, 1vw, .96rem);
}

.acc-ticket-reply {
  margin-top: 8px;
  padding: clamp(9px, 1vw, 12px) clamp(12px, 1.3vw, 16px);
  border-left: 3px solid var(--gold-deep);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff8e8, #f6ead0);
}

.acc-ticket-reply-head {
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: var(--gold-deep);
  font-size: clamp(.78rem, .95vw, .9rem);
  letter-spacing: .03em;
  margin-bottom: 3px;
}

.acc-ticket-reply-body {
  margin: 0;
  color: var(--ink-body);
  font-size: clamp(.96rem, 1.15vw, 1.08rem);
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Ticket conversation thread ---------- */
.acc-ticket-head {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
}

.acc-ticket-head:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; }

.acc-ticket.is-open {
  box-shadow:
    inset 0 0 0 1px rgba(200, 162, 92, .5),
    inset 0 1px 0 rgba(255, 255, 255, .55);
}

.acc-ticket-thread {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--paper-edge);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.acc-thread-msgs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acc-msg {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--paper-edge);
}

.acc-msg--user  { background: linear-gradient(180deg, #fffaec, #f4e8ca); }
.acc-msg--admin {
  background: linear-gradient(180deg, #fff8e8, #f2e2c0);
  border-left: 3px solid var(--gold-deep);
}

.acc-msg-who {
  font-family: "Cinzel", serif;
  font-weight: 700;
  color: var(--ink-muted);
  font-size: clamp(.72rem, .9vw, .82rem);
  letter-spacing: .03em;
  margin-bottom: 2px;
}

.acc-msg-body {
  margin: 0;
  color: var(--ink-body);
  font-size: clamp(.95rem, 1.15vw, 1.06rem);
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.acc-reply-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acc-reply-form .acc-textarea { min-height: 60px; }

.acc-badge {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(.7rem, .85vw, .8rem);
  letter-spacing: .04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.acc-badge--open            { color: #2f5122; background: #e0eecb; border-color: #b6d493; }
.acc-badge--in_progress     { color: #7a5410; background: #f6e8c4; border-color: #dcc07f; }
.acc-badge--waiting_for_user{ color: #7a3f10; background: #f6dcc4; border-color: #dca87f; }
.acc-badge--resolved        { color: #2f4d51; background: #d3e7e9; border-color: #9fc9cd; }
.acc-badge--closed          { color: #5a4a3a; background: #e6ddce; border-color: #c9b79f; }

/* ---------- Legal links ---------- */
.acc-legal {
  margin-top: clamp(10px, 1.2vw, 16px);
  padding-top: clamp(10px, 1.2vw, 14px);
  border-top: 1px solid var(--paper-edge);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-muted);
  font-size: clamp(.9rem, 1.1vw, 1.02rem);
}

.acc-legal a {
  color: var(--gold-deep);
  text-decoration: none;
  font-weight: 600;
}

.acc-legal a:hover { text-decoration: underline; }

/* =====================================================================
   Responsive — stack the spread, dock the rail
   ===================================================================== */
@media (max-width: 900px) {
  .account-page {
    padding: 78px clamp(14px, 4vw, 28px) 120px;
    padding-left: clamp(14px, 4vw, 28px);
  }

  .book {
    flex-direction: column;
    width: min(600px, 96vw);
  }

  .book-spine {
    display: none;
  }

  .page-left,
  .page-right {
    border-radius: 10px;
    box-shadow: none;
  }

  .side-rail {
    top: auto;
    bottom: 0;
    left: 0;
    transform: none;
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    gap: 6px;
    padding: 10px 6px;
    border-radius: 22px 22px 0 0;
    border-width: 2px 0 0;
  }

  .rail-label {
    font-size: .6rem;
  }
}

@media (max-width: 420px) {
  .hh-members {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .rail-label {
    display: none;
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .book {
    animation: none;
  }

  * {
    transition-duration: .01ms !important;
  }
}

/* ---------- Background music (kitchen prefs inside Notifications) ---------- */
#notificationsPanel .acc-section-title {
  margin-top: clamp(16px, 1.8vw, 24px);
}

.music-controls {
  margin-top: clamp(10px, 1.2vw, 16px);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.4vw, 18px);
}

.music-row {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.4vw, 18px);
}

.music-label {
  min-width: 92px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(.95rem, 1.1vw, 1.05rem);
  color: var(--ink);
}

.music-toggle {
  position: relative;
  width: clamp(52px, 5vw, 58px);
  height: clamp(29px, 2.8vw, 32px);
  border-radius: 999px;
  border: 2px solid rgba(95, 61, 34, .35);
  background: linear-gradient(180deg, #d8c193, #c2a670);
  box-shadow: inset 0 2px 4px rgba(122, 78, 30, .3);
  cursor: pointer;
  padding: 0;
  transition: background .22s ease, border-color .22s ease;
}

.music-toggle .music-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: clamp(21px, 2vw, 24px);
  height: clamp(21px, 2vw, 24px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 34%, #fffaef, #ecdcb9);
  box-shadow: 0 1px 3px rgba(var(--shadow-card) / .4), inset 0 1px 0 rgba(255, 255, 255, .7);
  transition: transform .22s cubic-bezier(.22,1,.36,1);
}

.music-toggle.is-on {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold-deep));
  border-color: #8a5a36;
}

.music-toggle.is-on .music-toggle-knob {
  transform: translateX(clamp(24px, 2.4vw, 27px));
}

.music-toggle:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

.music-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft));
  outline: none;
  cursor: pointer;
}

.music-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: clamp(20px, 2vw, 22px);
  height: clamp(20px, 2vw, 22px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 34%, #fffaef, #ecdcb9);
  border: 2px solid #8a5a36;
  box-shadow: 0 2px 6px rgba(33, 18, 9, .3);
}

.music-slider::-moz-range-thumb {
  width: clamp(20px, 2vw, 22px);
  height: clamp(20px, 2vw, 22px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 34%, #fffaef, #ecdcb9);
  border: 2px solid #8a5a36;
  box-shadow: 0 2px 6px rgba(33, 18, 9, .3);
}

.music-slider:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

.music-volume {
  min-width: 44px;
  text-align: right;
  font-weight: 700;
  color: var(--gold-deep);
}

.music-note {
  margin-top: clamp(10px, 1.2vw, 14px);
  font-size: clamp(.84rem, 1vw, .95rem);
  font-style: italic;
  line-height: 1.5;
  color: var(--ink-muted);
}
