/*
  Design tokens for the wedding photo app (handoff: "Blush & Gold" light,
  "Candlelight" dark). Theme resolution:
    - no data-theme on <html>   -> follows the phone (prefers-color-scheme)
    - data-theme="light"/"dark" -> forced, set by public/js/theme.js
  The dark values appear twice (media query + forced dark): keep them in sync.
  Everything downstream reads these variables, so re-theming is editing here.
*/
:root,
:root[data-theme="light"] {
  color-scheme: light;
  --color-bg: #fbf3ef;
  --color-bg-alt: #f6e6e1;            /* NEW value: tile/placeholder fill */
  --color-surface: #ffffff;
  --color-text: #3e2a2e;
  --color-text-muted: #8a6f72;
  --color-text-faint: #b49a9c;        /* NEW: placeholders, inactive tabs */
  --color-border: #ebd6d0;
  --color-accent: #c2566a;
  --color-accent-hover: #a94558;
  --color-accent-soft: #f6dde2;
  --color-accent-contrast: #ffffff;
  --color-gold: #b8873a;              /* NEW: rules, sparkles, "&" */
  --color-gold-contrast: #2a1b10;     /* NEW: text on gold (send button, NEW badge) */
  --color-danger: #b3443f;
  --color-danger-hover: #99332f;
  --color-danger-soft: #f7e0de;

  /* NEW: welcome-screen gradient */
  --welcome-bg: linear-gradient(165deg, #f9d9de 0%, #fbf3ef 45%, #f8e4cc 100%);
  --glow-1: #f2a3b0;  --glow-1-opacity: .6;
  --glow-2: #f1c98a;  --glow-2-opacity: .55;
  --glow-3: #e9a7c9;  --glow-3-opacity: .4;

  /* NEW: photo feed is always dark, in both themes */
  --feed-bg: #1f1416;
  --feed-surface: #2c1e21;
  --feed-border: #4a3438;
  --feed-text: #fbf1ec;
  --feed-text-muted: #c9afaf;
  --feed-comment-name: #f2b8c0;

  --shadow-soft: 0 8px 24px rgba(148, 103, 110, 0.14);
  --shadow-lift: 0 14px 36px rgba(148, 103, 110, 0.18);
  --shadow-accent: 0 0 0 6px rgb(194 86 106 / .2), 0 10px 30px rgb(194 86 106 / .4); /* NEW: FAB + primary button */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: #1e1216;
    --color-bg-alt: #2c1b21;
    --color-surface: #2c1b21;
    --color-text: #fbf1ec;
    --color-text-muted: #c9afaf;
    --color-text-faint: #97797c;
    --color-border: #4a3038;
    --color-accent: #e8909a;
    --color-accent-hover: #f0a8b0;
    --color-accent-soft: #4a2a32;
    --color-accent-contrast: #1e1216;
    --color-gold: #e9c98b;
    --color-gold-contrast: #2a1b10;
    --color-danger: #e08b86;
    --color-danger-hover: #eaa29e;
    --color-danger-soft: #44282a;
    --welcome-bg: #1e1216;
    --glow-1: #e8909a;  --glow-1-opacity: .45;
    --glow-2: #e9c98b;  --glow-2-opacity: .35;
    --glow-3: transparent; --glow-3-opacity: 0;
    --feed-bg: #1e1216;
    --feed-surface: #2c1b21;
    --feed-border: #4a3038;
    --feed-text: #fbf1ec;
    --feed-text-muted: #c9afaf;
    --feed-comment-name: #e8909a;
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 14px 36px rgba(0, 0, 0, 0.45);
    --shadow-accent: 0 0 0 6px rgb(232 144 154 / .2), 0 10px 30px rgb(232 144 154 / .4);
  }
}

/* Forced dark: same values as the media block above (keep in sync) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #1e1216;
  --color-bg-alt: #2c1b21;
  --color-surface: #2c1b21;
  --color-text: #fbf1ec;
  --color-text-muted: #c9afaf;
  --color-text-faint: #97797c;
  --color-border: #4a3038;
  --color-accent: #e8909a;
  --color-accent-hover: #f0a8b0;
  --color-accent-soft: #4a2a32;
  --color-accent-contrast: #1e1216;
  --color-gold: #e9c98b;
  --color-gold-contrast: #2a1b10;
  --color-danger: #e08b86;
  --color-danger-hover: #eaa29e;
  --color-danger-soft: #44282a;
  --welcome-bg: #1e1216;
  --glow-1: #e8909a;  --glow-1-opacity: .45;
  --glow-2: #e9c98b;  --glow-2-opacity: .35;
  --glow-3: transparent; --glow-3-opacity: 0;
  --feed-bg: #1e1216;
  --feed-surface: #2c1b21;
  --feed-border: #4a3038;
  --feed-text: #fbf1ec;
  --feed-text-muted: #c9afaf;
  --feed-comment-name: #e8909a;
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lift: 0 14px 36px rgba(0, 0, 0, 0.45);
  --shadow-accent: 0 0 0 6px rgb(232 144 154 / .2), 0 10px 30px rgb(232 144 154 / .4);
}

:root {
  /* Shape (unchanged from current app, plus pill + photo radii) */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Type */
  --font-names: "Parisienne", cursive;                 /* couple names only */
  --font-ornament: "Cormorant Garamond", Georgia, serif; /* "&" and monogram only */
  --font-display: "Playfair Display", Georgia, serif;  /* headings, italic 600 */
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --content-width: 640px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
}

* {
  box-sizing: border-box;
}

/*
  The UA sheet's [hidden] rule loses to any class that sets `display`, so
  el.hidden = true silently does nothing on, say, a .btn. Make it stick.
*/
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 var(--space-1);
}

p {
  margin: 0 0 var(--space-2);
}

a {
  color: var(--color-accent);
}

/* Screen-reader-only text: keeps the file input focusable and submittable */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/*
  The couple's names. Size, colour and line-height are the caller's; the "&"
  is always upright Cormorant in gold, whatever it sits inside.
*/
.names {
  font-family: var(--font-names);
  font-weight: 400;
}

.names__amp {
  font-family: var(--font-ornament);
  font-weight: 500;
  font-style: normal;
  font-size: 0.78em;
  color: var(--color-gold);
}

/* Page shell for the plain pages (admin login, errors): centered column */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: var(--space-3) var(--space-2);
}

.page--centered {
  align-items: center;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
}

.site-brand {
  text-align: center;
  margin-bottom: var(--space-3);
}

.site-brand__name {
  font-family: var(--font-names);
  font-size: 2.4rem;
  line-height: 1.3;
  color: var(--color-accent);
  margin: 0;
}

.divider {
  width: 48px;
  height: 2px;
  background: var(--color-gold);
  opacity: 0.6;
  border: none;
  margin: var(--space-2) auto;
}

.card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: var(--space-4) var(--space-3);
}

.card + .card {
  margin-top: var(--space-2);
}

.card h1 {
  font-size: 1.6rem;
  text-align: center;
}

.card > p {
  text-align: center;
  color: var(--color-text-muted);
}

.field {
  margin-bottom: var(--space-3);
}

.field label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

input[type="text"],
input[type="password"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.05s ease;
  /* Comfortable touch target on mobile */
  min-height: 48px;
}

.btn:hover {
  background: var(--color-accent-hover);
}

.btn:active {
  transform: scale(0.98);
}

/* Sits next to other content rather than filling its container */
.btn--inline {
  width: auto;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  min-height: 36px;
}

/* Irreversible actions — outlined rather than filled, paired with a confirm() */
.btn--danger {
  background: transparent;
  color: var(--color-danger);
  border: 1.5px solid var(--color-danger);
}

.btn--danger:hover {
  background: var(--color-danger);
  color: var(--color-accent-contrast);
}

/* Secondary action that should not compete with the primary one */
.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
}

.btn--ghost:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.alert {
  margin: 0 0 var(--space-3);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--color-danger-soft);
  color: var(--color-danger);
  font-size: 0.9rem;
  text-align: center;
}

/* ---- Welcome ---------------------------------------------------------- */

.welcome {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--welcome-bg);
}

.welcome__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.welcome__glow--1 {
  top: -90px;
  left: -100px;
  width: 300px;
  height: 300px;
  background: var(--glow-1);
  opacity: var(--glow-1-opacity);
}

.welcome__glow--2 {
  top: 140px;
  right: -120px;
  width: 260px;
  height: 260px;
  background: var(--glow-2);
  opacity: var(--glow-2-opacity);
}

.welcome__glow--3 {
  bottom: -60px;
  left: -40px;
  width: 280px;
  height: 220px;
  background: var(--glow-3);
  opacity: var(--glow-3-opacity);
}

.welcome__sparkle {
  position: absolute;
  color: var(--color-gold);
  pointer-events: none;
}

.welcome__sparkle--1 {
  top: 11%;
  left: 18%;
  font-size: 12px;
}

.welcome__sparkle--2 {
  top: 20%;
  right: 16%;
  font-size: 9px;
}

.welcome__sparkle--3 {
  top: 7%;
  right: 30%;
  font-size: 8px;
  color: var(--color-accent);
}

.welcome__hero {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 24px;
  text-align: center;
}

.welcome__monogram {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border: 1.5px solid var(--color-gold);
  border-radius: 50%;
  color: var(--color-gold);
  font-family: var(--font-ornament);
  font-style: italic;
  font-weight: 600;
  font-size: 24px;
  white-space: nowrap;
}

.welcome__eyebrow {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.welcome__names {
  margin: 0;
  color: var(--color-accent);
  font-size: 50px;
  font-weight: 400;
  line-height: 1.15;
  text-wrap: balance;
}

.welcome__rule {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-gold);
  font-size: 11px;
}

.welcome__rule span {
  width: 40px;
  height: 1px;
  background: var(--color-gold);
}

.welcome__date {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 19px;
}

.welcome__form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0 24px calc(32px + env(safe-area-inset-bottom, 0px));
}

.welcome__label {
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 700;
}

.welcome__input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;
}

.welcome__input::placeholder {
  color: var(--color-text-faint);
}

.welcome__input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.welcome__button {
  height: 56px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--color-accent) 33%, transparent);
  transition: background 0.15s ease, transform 0.05s ease;
}

.welcome__button:hover {
  background: var(--color-accent-hover);
}

.welcome__button:active {
  transform: scale(0.98);
}

.welcome__note {
  margin: 0;
  color: var(--color-text-faint);
  font-size: 13px;
  text-align: center;
}

/* Emoji button and name field side by side, the way they show up together */
.welcome__identity {
  display: flex;
  gap: 10px;
}

.welcome__emoji {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.05s ease;
}

/* Disabled only until public/js/welcome.js runs; it should not look broken */
.welcome__emoji:disabled {
  color: inherit;
  cursor: default;
}

.welcome__emoji:not(:disabled):active {
  transform: scale(0.94);
}

.welcome__emoji:focus-visible {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.emoji-dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  overflow: hidden;
}

.emoji-dialog::backdrop {
  background: rgb(0 0 0 / 0.45);
}

.emoji-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 16px;
}

.emoji-dialog__title {
  font-weight: 800;
}

.emoji-dialog__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: none;
  color: var(--color-text-muted);
  font-size: 16px;
  cursor: pointer;
}

/* emoji-picker-element's own custom properties, set to the app's tokens */
.emoji-dialog emoji-picker {
  width: 100%;
  height: min(380px, 60dvh);
  --background: var(--color-surface);
  --border-color: var(--color-border);
  --border-size: 0;
  --indicator-color: var(--color-accent);
  --input-border-color: var(--color-border);
  --input-font-color: var(--color-text);
  --input-placeholder-color: var(--color-text-faint);
  --outline-color: var(--color-accent);
  --category-font-color: var(--color-text-muted);
  --button-active-background: var(--color-accent-soft);
  --button-hover-background: var(--color-accent-soft);
}

/* ---- Gallery header ---------------------------------------------------- */

.gallery__shell {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
}

.gallery--empty .gallery__shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.gh {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 20px 12px;
}

.gh__text {
  flex: 1;
  min-width: 0;
}

/*
  Parisienne's capitals swash out past the left edge of their glyph box, and
  overflow: hidden (needed for the ellipsis) would clip the "G". The padding
  gives the swash room inside the clip; the negative margin cancels it so the
  names still line up with the subtitle.
*/
.gh__names {
  margin: 0 -0.3em;
  padding: 0 0.3em;
  overflow: hidden;
  color: var(--color-accent);
  font-family: var(--font-names);
  font-size: 26px;
  font-weight: 400;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
  The names are the way home: a plain link to /gallery, styled as the heading
  and not selectable, so a long-press reads as a tap rather than a text grab.
*/
.gh__home {
  color: inherit;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.gh__sub {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* The guest's own "🦊 Gio", a quiet link back to /welcome to change it */
.gh__me {
  color: var(--color-text);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.gh__me:hover {
  text-decoration: underline;
}

.theme-toggle {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.theme-toggle {
  border: 1.5px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 17px;
  line-height: 1;
}

.theme-toggle__sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle__moon {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-toggle__sun {
    display: inline;
  }
}

:root[data-theme="dark"] .theme-toggle__moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle__sun {
  display: inline;
}

.gh__admin {
  flex: none;
  margin: 0;
}

/* ---- Sort tabs --------------------------------------------------------- */

.sort-tabs {
  display: flex;
  gap: 18px;
  padding: 0 20px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sort-tabs::-webkit-scrollbar {
  display: none;
}

.sort-tabs__tab {
  flex: none;
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
  color: var(--color-text-faint);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.sort-tabs__tab--active {
  border-bottom-color: var(--color-gold);
  color: var(--color-text);
}

/* ---- Photo grid -------------------------------------------------------- */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.photo-grid--empty {
  display: none;
}

/*
  Desktop only: the 640px reading column would make six tiles thumbnail-sized,
  so the gallery opens up and the grid goes to six columns. Phones and tablets
  below 900px keep three.
*/
@media (min-width: 900px) {
  .gallery__shell {
    max-width: 1200px;
  }

  .photo-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.photo-grid__tile {
  display: block;
  /* Anchor for the badges and the NEW pill */
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--color-bg-alt);
  /* Long-press must not pop the iOS image callout or text selection */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.photo-grid__tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*
  Counts sit straight on the photo with a shadow rather than in a pill: white
  text with a soft dark halo reads over a white dress and a dark dance floor.
*/
.photo-grid__badges {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}

.photo-grid__badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Video tiles: the thumbnail is a still frame, this says it plays */
.photo-grid__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.photo-grid__tile--selected .photo-grid__play {
  opacity: 0.75;
}

.photo-grid__new {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-gold);
  color: var(--color-gold-contrast);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
}

.photo-grid__more {
  margin: var(--space-3) 0;
  text-align: center;
}

.photo-grid__more--loading {
  opacity: 0.5;
}

/* Multi-select (public/js/select.js) */
.photo-grid__check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-size: 14px;
  font-weight: 800;
}

.photo-grid__tile--selected {
  outline: 3px solid var(--color-accent);
  outline-offset: -3px;
}

.photo-grid__tile--selected img {
  opacity: 0.75;
}

.photo-grid__tile--selected .photo-grid__check {
  display: flex;
}

.photo-grid__tile--selected .photo-grid__new {
  display: none;
}

.select-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 20px 14px;
  border-bottom: 1.5px solid var(--color-border);
  background: var(--color-bg);
}

.select-bar__count {
  font-size: 17px;
  font-weight: 800;
}

.select-bar__cancel {
  padding: 6px 4px;
  border: none;
  background: none;
  color: var(--color-accent);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* ---- Empty gallery ------------------------------------------------------ */

.empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 0 40px 140px;
  text-align: center;
}

.empty__frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 130px;
  height: 160px;
  padding: 0 12px;
  border: 1.5px dashed var(--color-accent);
  border-radius: var(--radius-lg);
  color: var(--color-accent);
  font-size: 13px;
}

.empty__sparkle {
  position: absolute;
  color: var(--color-gold);
}

.empty__sparkle--1 {
  top: -9px;
  right: -9px;
  font-size: 14px;
}

.empty__sparkle--2 {
  bottom: -7px;
  left: -9px;
  font-size: 10px;
}

.empty__title {
  margin: 0;
  font-size: 30px;
  font-style: italic;
  line-height: 1.1;
}

.empty__body {
  margin: 0;
  max-width: 300px;
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1.45;
}

/* ---- Upload ------------------------------------------------------------- */

/*
  Upload affordance, anchored bottom-right. The no-JS submit button sits above
  the round FAB; with JavaScript it is hidden and picking photos uploads at
  once.
*/
.upload {
  position: fixed;
  right: 20px;
  /* Clear the iOS home bar rather than sitting under it */
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
  margin: 0;
}

.upload__submit {
  width: auto;
  font-size: 0.9rem;
  padding: 0.6rem 1.1rem;
  min-height: 40px;
}

.fab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  box-shadow: var(--shadow-accent);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.05s ease;
}

.fab:hover {
  background: var(--color-accent-hover);
}

.fab:active {
  transform: scale(0.95);
}

.fab__icon {
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  /* The glyph sits low in the line box; nudge it back to optical centre */
  margin-top: -0.1rem;
}

/* The input is visually hidden, so mirror its focus ring onto the label */
.upload__input:focus-visible + .fab,
.upload__input:focus-visible + .add-pill {
  outline: 3px solid var(--color-accent-soft);
  outline-offset: 3px;
}

/* Mid-upload the picker is disabled, so stop advertising it as tappable */
.upload--busy .fab,
.upload--busy .add-pill {
  opacity: 0.6;
  cursor: progress;
}

/* Empty gallery: a centred pill instead of the corner FAB */
.upload--pill {
  right: 0;
  left: 0;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  align-items: center;
  pointer-events: none;
}

.upload--pill > * {
  pointer-events: auto;
}

.add-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 60px;
  padding: 0 28px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-size: 17px;
  font-weight: 800;
  box-shadow: var(--shadow-accent);
  cursor: pointer;
}

.add-pill__icon {
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

/* While photos are selected the corner button becomes "download" */
.selecting .upload {
  display: none;
}

.fab--download {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  background: var(--color-gold);
  color: var(--color-gold-contrast);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.fab--download:hover {
  background: var(--color-gold);
  filter: brightness(1.06);
}

.fab__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 1.35rem;
  padding: 0 0.3rem;
  border-radius: var(--radius-pill);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.35rem;
  text-align: center;
}

/* Progress card shown between header and grid while photos upload */
.upload-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 2px 14px 14px;
  padding: 14px;
  overflow: hidden;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.upload-card--closing {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transition: height 0.2s ease, margin 0.2s ease, padding 0.2s ease, opacity 0.2s ease;
}

.upload-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-card__ring {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(var(--color-accent) 0 var(--pct, 0%), var(--color-border) var(--pct, 0%) 100%);
}

.upload-card__ring-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-surface);
  font-size: 11px;
  font-weight: 800;
}

.upload-card__text {
  flex: 1;
  min-width: 0;
}

.upload-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.upload-card__sub {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

.upload-card__cancel {
  padding: 6px 2px;
  border: none;
  background: none;
  color: var(--color-text-faint);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.upload-card__thumbs {
  display: flex;
  gap: 6px;
}

.upload-card__thumb {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  /* Keeps the z-indexes below local to the thumb */
  isolation: isolate;
  border-radius: 10px;
  background: var(--color-bg-alt) center / cover no-repeat;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.upload-card__thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.55);
}

.upload-card__thumb--done::before {
  background: rgba(0, 0, 0, 0.25);
}

.upload-card__thumb > span {
  position: relative;
  z-index: 2;
}

/* A video has no image to use as a background; a muted <video> shows its first frame */
.upload-card__thumb > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-card__error {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-danger-soft);
  color: var(--color-danger);
  font-size: 13px;
  font-weight: 700;
}

/* ---- Photo feed ---------------------------------------------------------- */

/* Stops the gallery scrolling behind the feed */
.feed-open {
  overflow: hidden;
}

.feed {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--feed-bg);
  color: var(--feed-text);
}

.feed__scroller {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.feed__scroller::-webkit-scrollbar {
  display: none;
}

.feed__slide {
  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  /* Panning and pinching only, so a double-tap is ours rather than a zoom */
  touch-action: manipulation;
}

.feed__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.2s ease;
  -webkit-touch-callout: none;
}

/* Photos whose shape is far from the screen's are shown whole instead of cropped */
.feed__image--contain {
  object-fit: contain;
}

/* Desktop: keep the photo inside the 520px UI column and letterbox it, never crop or widen it */
@media (min-width: 521px) {
  .feed__image {
    left: 50%;
    right: auto;
    width: 520px;
    transform: translateX(-50%);
    object-fit: contain;
  }
}

/*
  While the original downloads the feed shows the 800px thumbnail blown up.
  Blurring it makes the swap read as the photo sharpening rather than as one
  image flickering into a different one.
*/
.feed__image--loading {
  filter: blur(8px);
}

.feed__bar,
.feed__ui {
  max-width: 520px;
  margin: 0 auto;
}

.feed__bar {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  pointer-events: none;
}

.feed__bar > * {
  pointer-events: auto;
}

.feed__back,
.feed__counter {
  flex: none;
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
}

.feed__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
}

.feed__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: 21px;
  line-height: 1.3;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

.feed__counter {
  min-width: 40px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.feed__ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.feed__rail {
  position: absolute;
  right: 10px;
  bottom: calc(100% - 66px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed__rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0;
  pointer-events: auto;
}

.feed__round {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-size: 20px;
  text-decoration: none;
  line-height: 1;
  cursor: pointer;
}

.feed__round--on {
  background: var(--color-accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--color-accent) 25%, transparent);
}

.feed__round--pop {
  animation: feed-pop 0.25s ease-out;
}

@keyframes feed-pop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

.feed__rail-count {
  min-height: 1.2em;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.feed__bottom {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 76px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to bottom, transparent, var(--feed-bg) 24%);
  pointer-events: none;
}

.feed__uploader,
.feed__comments,
.feed__more,
.feed__compose {
  pointer-events: auto;
}

.feed__uploader {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Leaves the reaction rail clear of the text */
  padding-right: 64px;
}

.feed__avatar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--color-gold);
  color: var(--color-gold-contrast);
  font-size: 14px;
  font-weight: 800;
}

/* The uploader's emoji is its own picture; no gold disc behind it */
.feed__avatar--emoji {
  background: none;
  font-size: 24px;
  line-height: 1;
}

.feed__uploader-name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed__uploader-time {
  flex: none;
  color: var(--feed-text-muted);
  font-size: 13px;
}

.feed__comments {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 64px;
}

.feed__comment {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.feed__comment b {
  color: var(--feed-comment-name);
}

.feed__more {
  align-self: flex-start;
  padding: 0;
  border: none;
  background: none;
  color: var(--feed-text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.feed__compose {
  display: flex;
  gap: 8px;
  margin: 0;
}

.feed__input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 18px;
  border: 1.5px solid var(--feed-border);
  border-radius: var(--radius-pill);
  background: var(--feed-surface);
  color: var(--feed-text);
  font-family: var(--font-body);
  /* 16px stops iOS zooming the page when the field is focused */
  font-size: 16px;
}

.feed__input::placeholder {
  color: var(--feed-text-muted);
}

.feed__input:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: none;
}

.feed__send {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-gold);
  color: var(--color-gold-contrast);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

.feed__float {
  position: absolute;
  z-index: 2;
  font-size: 72px;
  line-height: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: feed-float 0.6s ease-out forwards;
}

@keyframes feed-float {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 40px)) scale(1.1);
  }
}

.feed__toast {
  position: absolute;
  bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 6;
  max-width: calc(100% - 32px);
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  transform: translateX(-50%);
}

/* Sheets over the feed: the full thread, and the admin options */
.sheet {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.sheet__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  max-height: 85%;
  margin: 0 auto;
  padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 24px 24px 0 0;
  background: var(--color-surface);
  color: var(--color-text);
}

.sheet__panel--tall {
  height: 85%;
}

.sheet__head {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  justify-content: flex-end;
  min-height: 48px;
}

.sheet__handle {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
  transform: translateX(-50%);
}

.sheet__close {
  padding: 8px 4px;
  border: none;
  background: none;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.sheet__status {
  flex: none;
  margin: 0 0 var(--space-1);
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

/* The thread scrolls; the head and status line above it stay put */
.sheet__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sheet__panel .thread__title {
  font-size: 1rem;
}

.sheet__action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  margin-top: 10px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: none;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.sheet__action--danger {
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.sheet__panel form {
  margin: 0;
}

/* ---- Photo page (the no-JS view of one photo) ------------------------------ */

.photo-page {
  padding: 0 var(--space-2) var(--space-3);
}

.photo-page .gh {
  padding-right: 4px;
  padding-left: 4px;
}


/* ---- Reactions on the photo page ---- */

.reaction-bar {
  display: flex;
  gap: var(--space-1);
  margin: var(--space-2) 0;
}

.reaction-bar form {
  margin: 0;
}

.reaction-bar__button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-text);
  font-family: inherit;
  font-size: 1.1rem;
  cursor: pointer;
}

.reaction-bar__button--on {
  border-color: var(--color-accent);
  background: var(--color-accent-soft);
}

.reaction-bar__count {
  font-size: 0.9rem;
  font-weight: 700;
}


/*
  Photo page: the full-resolution image above its thread. This is where a tile
  tap lands with JavaScript off, and the permalink a guest can send to someone.
*/
.photo-full {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-bg-alt);
}

.photo-full__image {
  display: block;
  width: 100%;
  height: auto;
}

.photo-full__hint {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

/* A video's own page: the video and its overlays (public/js/video.js) */
.photo-full__stage {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000000;
}

.photo-full__stage .photo-full__image {
  max-height: 80vh;
  max-height: 80dvh;
  margin: 0 auto;
}

.photo-full__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.photo-full__actions .photo-full__hint {
  margin: 0;
}

/*
  Video overlays, the same on the feed and the video page: a play icon while
  paused, a "2×" pill while held, and the speaker button.
*/
.vp {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.vp video {
  -webkit-touch-callout: none;
}

.vp__paused {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.vp__speed {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  transform: translateX(-50%);
  pointer-events: none;
}

.vp__sound {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  cursor: pointer;
}

/* In the feed the bottom is taken by comments and the rail, so these move up under the top bar */
.feed__slide .vp__speed {
  top: calc(env(safe-area-inset-top, 0px) + 64px);
}

.feed__slide .vp__sound {
  top: calc(env(safe-area-inset-top, 0px) + 60px);
  right: 16px;
  bottom: auto;
}

@media (min-width: 521px) {
  .feed__slide .vp__sound {
    right: calc(50% - 260px + 16px);
  }
}


/* Comment thread, shared by the photo page and the feed's sheet */
.thread__title {
  font-size: 1.15rem;
  text-align: left;
}

.thread__empty {
  margin: var(--space-2) 0 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.comment-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding: 0;
}

/*
  A reply level: a hairline on the left standing in for indentation, which
  keeps the text column wide on a phone. .comment-list--flush is the clamp —
  past a few levels deep the server stops adding indentation, so a long
  back-and-forth does not taper to one word per line. The nesting itself is
  unbounded; only the inset stops growing.
*/
.comment-list--nested {
  gap: var(--space-2);
  margin: var(--space-1) 0 0;
  padding-left: var(--space-2);
  border-left: 2px solid var(--color-border);
}

.comment-list--flush {
  padding-left: 0;
  border-left: none;
}

.comment__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 var(--space-1);
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.comment__author {
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 700;
  /* A display name is whatever a guest typed; it must not widen the column */
  overflow-wrap: anywhere;
}

/* Shown only where indentation has stopped growing and the nesting no longer
   says who a reply is answering */
.comment__context {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-style: italic;
}

.comment__body {
  /* Keeps the line breaks a guest typed, without trusting any markup */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0.2rem 0 0;
}

.comment__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: 0.1rem;
}

.comment__moderate {
  margin: 0;
}

/*
  "Reply", "See replies" and "Delete". Two of the three are <summary> elements
  and one is a submit button, so this styles all three the same way and takes
  the disclosure triangle off the summaries.
*/
.comment__action {
  display: inline-block;
  padding: 0.3rem 0;
  border: none;
  background: none;
  color: var(--color-accent);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.comment__action::-webkit-details-marker {
  display: none;
}

.comment__action--danger {
  color: var(--color-danger);
}

.comment__action:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.comment__replies {
  margin-top: 0.1rem;
}

/* Open replies sit beneath the comment, not beside its action row */
.comment__reply[open] {
  width: 100%;
}

.comment-form {
  margin: var(--space-1) 0 0;
}

.comment-form__input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  /* Horizontal resizing would break out of the panel */
  resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.comment-form__input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-soft);
}

.comment-form__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.comment-form__byline {
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.comment-form__byline strong {
  color: var(--color-text);
}

