:root {
  --bg: #020202;
  --panel: #0a0a0a;
  --line: rgba(255, 255, 255, 0.14);
  --text: #f4f0e7;
  --muted: #9b97a3;
  --accent: #e3c56e;
  --success: #6dcc8c;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --theme-page-bg: #020202;
  --theme-form-bg: #0a0a0a;
  --theme-text: #f4f0e7;
  --theme-border: #3f3a2c;
  --theme-submit-bg: #e3c56e;
  --theme-submit-text: #231c09;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--theme-page-bg);
  color: var(--theme-text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

html {
  scrollbar-color: #8f8f8f #050505;
  scrollbar-width: thin;
}

body::-webkit-scrollbar,
.rich-editor::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

body::-webkit-scrollbar-track,
.rich-editor::-webkit-scrollbar-track {
  background: var(--theme-page-bg);
  border-left: 1px solid var(--theme-submit-bg);
}

body::-webkit-scrollbar-thumb,
.rich-editor::-webkit-scrollbar-thumb {
  background: #8a8a8a;
  border-radius: 0;
  border: 2px solid var(--theme-page-bg);
}

body.is-lightbox-open {
  overflow: hidden;
}

.tv-body {
  overflow: hidden;
  color: #f5f5f2;
  --tv-bg: #050505;
  --tv-text: #f5f5f2;
  --tv-muted: #9a9a9a;
  --tv-accent: #d7b75a;
  --tv-surface: rgba(255, 255, 255, 0.03);
  background:
    radial-gradient(circle at top, rgba(227, 197, 110, 0.14), transparent 28%),
    radial-gradient(circle at bottom, rgba(255, 255, 255, 0.04), transparent 26%),
    var(--tv-bg);
  --tv-line: rgba(255, 255, 255, 0.08);
  --tv-line-strong: rgba(255, 255, 255, 0.11);
}

.tv-app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 30px;
}

.tv-header,
.tv-stage-shell,
.tv-footer {
  border: 1px solid var(--tv-line);
  background: var(--tv-surface);
  box-shadow: var(--shadow);
}

.tv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px;
}

.tv-header__tribute {
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.tv-header__portrait {
  width: 104px;
  height: 104px;
  border: 1px solid var(--tv-line);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
  flex: none;
}

.tv-header__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tv-header__copy {
  display: grid;
  gap: 10px;
}

.tv-header__eyebrow {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.tv-header__title {
  margin: 0;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.tv-header__text {
  margin: 0;
  color: var(--tv-muted);
  font-size: 1.08rem;
  max-width: 720px;
}

.tv-header__meta {
  display: grid;
  gap: 12px;
  justify-items: end;
  text-align: right;
}

.tv-status {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--tv-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--tv-text);
  font-weight: 600;
  font-size: 0.92rem;
}

.tv-header__submeta {
  display: grid;
  gap: 4px;
  color: var(--tv-muted);
  font-size: 0.94rem;
}

.tv-stage-shell {
  min-height: 0;
  padding: 26px;
  display: grid;
}

.tv-stage {
  min-height: 0;
  display: grid;
}

.tv-empty-state,
.tv-slide {
  min-height: 100%;
}

.tv-empty-state {
  display: grid;
  place-items: center;
  gap: 12px;
  text-align: center;
  color: var(--tv-muted);
  padding: 40px;
}

.tv-empty-state strong {
  color: var(--tv-text);
  font-size: 1.5rem;
}

.tv-slide {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 28px;
  align-content: center;
}

.tv-slide__body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(340px, 0.78fr);
  gap: 26px;
  align-items: center;
}

.tv-slide__text-wrap {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.tv-slide__text-wrap--meta-only {
  align-content: center;
  min-height: 220px;
}

.tv-slide__text {
  min-height: 0;
  padding: 34px 38px;
  border: 1px solid var(--tv-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.02) 100%);
  font-size: clamp(34px, 3.9vw, 58px);
  line-height: 1.28;
  max-height: min(58vh, 640px);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tv-slide__byline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--tv-muted);
  font-size: 1rem;
  padding-left: 6px;
  line-height: 1;
}

.tv-slide__byline-name {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  font-size: clamp(28px, 2.8vw, 44px);
  line-height: 1;
  letter-spacing: 0.01em;
}

.tv-slide__byline-separator {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.28);
  align-self: center;
  transform: translateY(4px);
}

.tv-slide__byline-date {
  display: inline-flex;
  align-items: center;
  font-size: clamp(16px, 1.35vw, 20px);
  line-height: 1;
  align-self: center;
  transform: translateY(4px);
}

.tv-slide__media {
  min-height: 100%;
  padding: 22px;
  border: 1px solid var(--tv-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.024) 100%);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tv-slide__media--empty {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%),
    #080808;
}

.tv-slide__placeholder {
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: grid;
  place-items: center;
  gap: 18px;
  align-content: center;
  text-align: center;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.05), transparent 58%),
    rgba(0, 0, 0, 0.16);
}

.tv-slide__placeholder-image {
  width: min(240px, 42%);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--tv-line);
  opacity: 0.34;
  filter: grayscale(0.1);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.tv-slide__placeholder-mark {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 1px solid var(--tv-line);
  color: rgba(255, 255, 255, 0.48);
  font-size: 40px;
  background: rgba(255, 255, 255, 0.03);
}

.tv-slide__placeholder-text {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.96rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tv-slide__media img {
  width: 100%;
  height: 100%;
  max-height: 56vh;
  object-fit: contain;
}

.tv-footer {
  display: grid;
  gap: 12px;
  padding: 16px 24px;
}

.tv-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tv-progress__dot {
  width: 12px;
  height: 12px;
  border: 1px solid var(--tv-line);
  background: rgba(255, 255, 255, 0.16);
}

.tv-progress__dot.is-active {
  width: 34px;
  background: rgba(189, 194, 204, 0.72);
  border-color: rgba(189, 194, 204, 0.72);
}

.tv-footer__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--tv-muted);
  font-size: 0.95rem;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 0 56px;
}

.panel-eyebrow {
  margin: 0 0 8px;
  color: #e3c56e;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.panel-title {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
}

.panel-intro {
  margin: 0 0 24px;
  max-width: 840px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

body.is-embedded .app-shell {
  width: min(100%, calc(100% - 12px));
  padding-top: 4px;
  padding-bottom: 18px;
}

body.is-embedded .composer,
body.is-embedded .feed-section {
  border-radius: 0;
}

body.is-embedded .feed-section {
  margin-top: 14px;
}

body.is-embedded .section-divider {
  margin-bottom: 16px;
}

body.is-embedded::-webkit-scrollbar-track {
  border-left-color: rgba(227, 197, 110, 0.95);
}

.composer,
.feed-section {
  background: var(--theme-form-bg);
  border: 1px solid var(--theme-border);
  border-radius: 0;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.feed-section {
  margin-top: 24px;
  padding-top: 10px;
}

.section-divider {
  height: 1px;
  background: var(--theme-border);
  margin-bottom: 24px;
}

.field-row,
.comment-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 10px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.memorial-admin-form {
  display: grid;
  gap: 22px;
}

.admin-accordion {
  border: 1px solid color-mix(in srgb, var(--theme-border) 86%, white 4%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.038) 0%, rgba(255, 255, 255, 0.02) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.admin-accordion--composer {
  margin-top: 10px;
}

.admin-accordion[open] {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 14px 30px rgba(0, 0, 0, 0.12);
}

.admin-accordion__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
}

.admin-accordion__summary::-webkit-details-marker {
  display: none;
}

.admin-accordion__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f3ede2;
}

.admin-accordion__icon {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  flex: 0 0 auto;
}

.admin-accordion[open] .admin-accordion__icon {
  transform: rotate(225deg);
}

.admin-accordion__content {
  padding: 0 22px 22px;
}

.admin-section {
  border: 1px solid color-mix(in srgb, var(--theme-border) 86%, white 4%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.038) 0%, rgba(255, 255, 255, 0.02) 100%);
  padding: 22px;
  display: grid;
  gap: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.admin-section--theme-builder {
  gap: 24px;
}

.admin-section__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-section__header--compact {
  margin-bottom: 2px;
}

.admin-section__title,
.admin-section__subtitle {
  margin: 0;
  line-height: 1.15;
}

.admin-section__title {
  font-size: 1.12rem;
  font-weight: 700;
}

.admin-section__subtitle {
  font-size: 1rem;
  font-weight: 700;
}

.admin-section__text {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 680px;
}

.admin-grid {
  display: grid;
  gap: 18px;
}

.admin-grid--memorial {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

.app-shell--admin-login {
  min-height: 100vh;
  align-content: center;
}

.admin-login-shell {
  max-width: 640px;
  margin: 0 auto;
}

.admin-login-panel {
  gap: 28px;
  padding: 28px;
}

.admin-grid--login {
  grid-template-columns: 1fr;
  gap: 16px;
  max-width: 420px;
}

.admin-login-form {
  gap: 24px;
}

.admin-login-form .field {
  gap: 8px;
  margin-bottom: 0;
}

.admin-login-form .field span {
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

.admin-login-form input[type="text"],
.admin-login-form input[type="password"] {
  min-height: 56px;
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 82%, white 8%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 245, 245, 0.96) 100%);
  color: #161616;
  font-size: 1.02rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.admin-login-form input[type="text"]::placeholder,
.admin-login-form input[type="password"]::placeholder {
  color: #848484;
}

.admin-login-form input[type="text"]:focus,
.admin-login-form input[type="password"]:focus {
  border-color: color-mix(in srgb, var(--theme-submit-bg) 72%, white 12%);
  box-shadow: 0 0 0 3px rgba(227, 197, 110, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.admin-login-form .admin-submit-bar {
  padding: 18px 20px;
  justify-content: flex-start;
}

.admin-login-form .admin-submit-bar__copy strong {
  font-size: 1rem;
}

.admin-login-form .admin-submit-bar__copy span {
  color: var(--muted);
}

.admin-login-form .primary-button {
  min-width: 180px;
}

.admin-login-form .form-actions {
  justify-content: flex-start;
}

.admin-theme-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.admin-theme-builder {
  display: grid;
  gap: 16px;
}

.admin-theme-preview-wrap {
  display: grid;
  gap: 14px;
  align-content: start;
}

.theme-grid--builder {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field span {
  color: var(--muted);
  font-weight: 600;
}

.admin-section .field {
  margin-bottom: 0;
}

.field-help {
  color: var(--muted);
  line-height: 1.45;
}

input[type="text"],
input[type="tel"],
input[type="date"],
.field select,
.field input[type="color"],
.rich-editor,
textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--theme-border);
  border-radius: 0;
  background: #efefef;
  color: #111;
  padding: 14px 16px;
  font: inherit;
  line-height: 1.2;
  outline: none;
}

input[type="text"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
.field select:focus,
.field input[type="color"]:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--theme-submit-bg) 70%, white 10%);
  box-shadow: 0 0 0 3px rgba(227, 197, 110, 0.14);
}

.field input[type="file"] {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--theme-border);
  background: rgba(255, 255, 255, 0.04);
  color: #d6d2db;
  padding: 8px 10px;
}

.field input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 82%, white 6%);
  background: rgba(255, 255, 255, 0.08);
  color: var(--theme-text);
  padding: 10px 14px;
  font-weight: 600;
  cursor: pointer;
}

.field--file {
  padding: 16px;
  border: 1px dashed color-mix(in srgb, var(--theme-border) 76%, white 8%);
  background: rgba(255, 255, 255, 0.03);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.theme-grid--builder .field {
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 78%, white 6%);
  background: rgba(255, 255, 255, 0.03);
}

.theme-grid--builder .field span {
  min-height: 40px;
  line-height: 1.4;
}

.theme-grid--builder .field input[type="color"] {
  min-height: 60px;
  padding: 8px;
  background: #f3f1ec;
}

.panel-tabs {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 72%, white 8%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 14px 30px rgba(0, 0, 0, 0.18);
}

.panel-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  color: #b5b0bd;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  letter-spacing: 0.01em;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.panel-tab:hover {
  color: #f3ede2;
  background: rgba(255, 255, 255, 0.06);
}

.panel-tab.is-active {
  color: #231c09;
  background: var(--theme-submit-bg);
  border-color: var(--theme-submit-bg);
  box-shadow: 0 12px 26px rgba(227, 197, 110, 0.28);
}

.panel-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  margin-left: 10px;
  padding: 0 7px;
  background: rgba(0, 0, 0, 0.16);
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.panel-tab.is-active .panel-tab-count {
  background: rgba(0, 0, 0, 0.14);
}

.panel-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.panel-section-header__eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.panel-section-header__title {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.04;
}

.panel-section-header__text {
  margin: 8px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.panel-section-header__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 78%, white 6%);
  background: rgba(255, 255, 255, 0.04);
  color: #f3ede2;
  font-weight: 700;
  white-space: nowrap;
}

.memorial-filter-bar {
  margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 78%, white 6%);
  background: rgba(255, 255, 255, 0.03);
  padding: 18px;
}

.memorial-filter-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

.memorial-filter-form .field {
  min-width: 0;
}

.memorial-filter-form input[type="text"],
.memorial-filter-form input[type="date"],
.memorial-filter-form select {
  min-height: 50px;
  font-size: 1rem;
}

.memorial-filter-form__actions {
  display: grid;
  grid-template-rows: 22px 50px;
  align-items: end;
  gap: 10px;
  align-self: stretch;
}

.memorial-filter-form__actions::before {
  content: "";
  display: block;
}

.memorial-filter-icon-button {
  width: 50px;
  min-width: 50px;
  height: 50px;
  min-height: 50px;
  padding: 0;
  justify-content: center;
  cursor: pointer;
  border-color: var(--theme-submit-bg);
  color: var(--theme-submit-bg);
}

.memorial-filter-icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.memorial-filter-export-bar {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.memorial-filter-export-copy {
  display: grid;
  gap: 4px;
}

.memorial-filter-export-copy strong {
  font-size: 0.98rem;
  color: #f4f0e7;
}

.memorial-filter-export-copy span {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.memorial-filter-export-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.field input[type="color"] {
  min-height: 46px;
  padding: 6px;
  cursor: pointer;
}

.theme-preview {
  margin-top: 0;
  min-height: 100%;
  padding: 20px;
  border: 1px solid;
  display: grid;
  align-content: start;
}

.theme-preview__panel {
  border: 1px solid;
  padding: 18px;
  display: grid;
  gap: 12px;
  min-height: 100%;
}

.theme-preview__eyebrow {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}

.theme-preview__title {
  font-size: 1.1rem;
  line-height: 1.2;
}

.theme-preview__text {
  margin: 0;
  opacity: 0.86;
  font-size: 0.93rem;
}

.theme-preview__button {
  justify-self: start;
  border: none;
  padding: 12px 18px;
  color: var(--theme-submit-text);
  font-weight: 700;
  cursor: default;
}

.admin-submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 84%, white 4%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0%, rgba(255, 255, 255, 0.014) 100%);
}

.admin-submit-bar__copy {
  display: grid;
  gap: 4px;
}

.admin-submit-bar__copy strong {
  font-size: 1rem;
}

.admin-submit-bar__copy span {
  color: var(--muted);
  line-height: 1.5;
}

.theme-preview--small {
  margin: 0 0 16px;
  padding: 12px;
}

.theme-preview--small .theme-preview__panel {
  padding: 12px;
}

.theme-preview--small .theme-preview__title {
  font-size: 0.95rem;
}

.theme-preview--small .theme-preview__text {
  display: none;
}

.theme-preview--small .theme-preview__button {
  padding: 8px 12px;
}

.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.theme-swatch {
  display: inline-grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 8px;
}

.theme-swatch__color {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.theme-swatch__label {
  font-size: 12px;
  color: var(--muted);
}

.theme-swatches--compact {
  margin-bottom: 0;
  justify-content: flex-end;
}

.theme-manager-card {
  padding: 0;
  overflow: hidden;
}

.theme-manager-accordion {
  display: grid;
}

.theme-manager-accordion__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 22px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032) 0%, rgba(255, 255, 255, 0.016) 100%);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.theme-manager-accordion__summary::-webkit-details-marker {
  display: none;
}

.theme-manager-accordion__summary:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.048) 0%, rgba(255, 255, 255, 0.024) 100%);
}

.theme-manager-accordion__summary-side {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

.theme-manager-accordion__icon {
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  flex: none;
}

.theme-manager-accordion[open] .theme-manager-accordion__icon {
  transform: rotate(225deg);
}

.theme-manager-form {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.theme-manager-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 22px 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032) 0%, rgba(255, 255, 255, 0.016) 100%);
}

.theme-manager-card__header-main {
  display: grid;
  gap: 6px;
}

.theme-manager-card__header-side {
  margin-left: auto;
}

.theme-manager-card__eyebrow {
  margin: 0;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
}

.theme-manager-card__title {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.15;
}

.theme-manager-card__date {
  color: var(--muted);
  font-size: 0.92rem;
}

.theme-manager-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 22px;
  padding: 22px;
}

.theme-manager-main {
  display: grid;
  gap: 18px;
}

.theme-manager-side {
  display: grid;
  align-content: start;
}

.theme-grid--theme-manager {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.theme-grid--theme-manager .field {
  margin-bottom: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--theme-border) 78%, white 6%);
  background: rgba(255, 255, 255, 0.03);
}

.theme-grid--theme-manager .field span {
  min-height: 40px;
  line-height: 1.4;
}

.theme-grid--theme-manager .field input[type="color"] {
  min-height: 60px;
  padding: 8px;
  background: #f3f1ec;
}

.theme-preview--theme-card {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.theme-manager-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 22px 22px;
}

.theme-manager-actions__copy {
  display: grid;
  gap: 4px;
}

.theme-manager-actions__copy strong {
  font-size: 1rem;
}

.theme-manager-actions__copy span {
  color: var(--muted);
  line-height: 1.5;
  max-width: 620px;
}

.pagination-bar {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.pagination-summary {
  color: var(--muted);
  font-size: 0.95rem;
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
}

.pagination-button {
  min-width: 40px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--theme-border);
  border-right: none;
  color: var(--theme-text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.pagination-button:last-child {
  border-right: 1px solid var(--theme-border);
}

.pagination-button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.pagination-button.is-active {
  color: #231c09;
  background: var(--theme-submit-bg);
  border-color: var(--theme-submit-bg);
}

.pagination-button.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

textarea {
  min-height: 170px;
  resize: vertical;
}

.google-login-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 52px;
}

.compact-field {
  margin-bottom: 14px;
}

.post-message-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  width: 100%;
  margin-bottom: -4px;
}

.post-message-header > span {
  display: block;
  min-width: 0;
}

.post-google-login {
  justify-self: end;
  align-self: start;
}

.editor-shell {
  border: 1px solid var(--theme-border);
  border-radius: 0;
  background: #efefef;
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
  background: #e5e5e5;
}

.toolbar-button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 0;
  background: #f5f5f5;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
}

.emoji-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rich-editor {
  min-height: 220px;
  border: none;
  border-radius: 0;
  background: #efefef;
  padding: 16px;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: #7f7f7f;
}

.rich-editor.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 16px 14px;
}

.attachment-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.attachment-status.is-active {
  color: #5f5c56;
}

.attachment-status-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: -2px;
}

.attachment-picker-button {
  width: 45px;
  height: 45px;
  border: none;
  background: transparent;
  color: #8e8e96;
  display: inline-grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}

.attachment-picker-button svg {
  width: 45px;
  height: 45px;
  fill: currentColor;
}

.attachment-picker-button:hover {
  color: var(--accent);
}

.visually-hidden-file-input {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-card {
  width: 120px;
  height: 120px;
  border: 1px dashed rgba(255, 255, 255, 0.7);
  border-radius: 0;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.upload-card strong {
  font-size: 44px;
  line-height: 1;
  color: #d9e1ff;
}

.upload-card:hover {
  border-color: var(--accent);
  background: rgba(227, 197, 110, 0.06);
  transform: translateY(-1px);
}

.upload-card input {
  display: none;
}

.field-help,
.upload-card small {
  color: var(--muted);
}

.form-actions,
.comment-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.primary-button,
.secondary-button,
.ghost-button {
  border-radius: 0;
  padding: 12px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.primary-button {
  background: var(--theme-submit-bg);
  color: var(--theme-submit-text);
  font-weight: 700;
}

.primary-button--large {
  min-width: 180px;
  min-height: 52px;
  padding-inline: 28px;
  font-size: 1rem;
}

.secondary-button,
.ghost-button {
  background: transparent;
  color: var(--theme-submit-bg);
  border-color: var(--theme-submit-bg);
}

.flash-message {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 0;
  border: 1px solid transparent;
}

.flash-message.is-success {
  background: rgba(109, 204, 140, 0.12);
  color: var(--success);
  border-color: rgba(109, 204, 140, 0.22);
}

.flash-message.is-error {
  background: rgba(211, 95, 95, 0.12);
  color: #ffb0b0;
  border-color: rgba(211, 95, 95, 0.22);
}

.created-links {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.created-links__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.created-links__actions,
.memorial-link-box__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.created-links__spacer {
  flex: 1 1 auto;
  min-width: 0;
}

.memorial-album-button {
  min-height: 40px;
  padding: 0;
}

.created-links__label,
.memorial-link-box__meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--theme-border);
  border-radius: 0;
  padding: 14px 16px;
  margin-bottom: 24px;
}

.session-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.logout-text-button {
  border: none;
  background: transparent;
  color: #d2d2d2;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 6px;
  flex: none;
  transition: color 0.16s ease, transform 0.16s ease;
}

.logout-text-button:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.admin-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-panel-toolbar__copy {
  display: flex;
  align-items: center;
  min-width: 0;
}

.admin-panel-toolbar__copy strong {
  font-size: 0.98rem;
  color: #f4f0e7;
  letter-spacing: 0.01em;
}

.logout-text-button--panel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: #f4f0e7;
  text-decoration: none;
}

.logout-text-button--panel:hover {
  background: rgba(255, 255, 255, 0.08);
}

.feed-list {
  display: grid;
  gap: 16px;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 30px 0 20px;
}

.post-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--theme-border);
  border-radius: 0;
  padding: 16px 16px 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.post-header,
.comment-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.post-header-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 0;
  background: linear-gradient(135deg, #f5da8f 0%, #b58a23 100%);
  color: #fff7dd;
  display: grid;
  place-items: center;
  font-weight: 700;
  overflow: hidden;
  position: relative;
}

.comment-card .avatar {
  width: 34px;
  height: 34px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: relative;
  z-index: 2;
}

.avatar-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 6px;
  text-align: center;
  line-height: 1.05;
  z-index: 1;
}

.avatar:not(.avatar--fallback) .avatar-fallback {
  display: none;
}

.avatar-lg {
  width: 56px;
  height: 56px;
}

.author-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.author-meta strong {
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.post-date,
.comment-date,
.reply-toggle {
  color: var(--muted);
}

.post-date,
.comment-date {
  font-size: 13px;
}

.post-body,
.comment-body {
  margin: 10px 0 0 58px;
}

.post-body p,
.comment-body p {
  margin: 0;
  line-height: 1.65;
  color: #d6d2db;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.comment-body {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.post-rich-text {
  color: #d6d2db;
  line-height: 1.58;
  font-size: 0.97rem;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.post-rich-text p,
.post-rich-text ul,
.post-rich-text ol {
  margin: 0 0 12px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.post-rich-text p:last-child,
.post-rich-text ul:last-child,
.post-rich-text ol:last-child {
  margin-bottom: 0;
}

.post-image {
  margin-top: 14px;
  width: 100%;
  max-height: 460px;
  border-radius: 0;
  border: 1px solid var(--theme-border);
  display: block;
  object-fit: contain;
  background: #111;
}

.post-image-button {
  margin-top: 14px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  display: inline-block;
  width: 100%;
  position: relative;
  border-radius: 0;
}

.post-image-button .post-image {
  margin-top: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.post-image-button::after {
  content: 'Clique para ampliar';
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 6px 10px;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.post-image-button:hover .post-image {
  transform: scale(1.01);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.post-image-button:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.post-actions {
  margin: 14px 0 0 58px;
  padding-top: 8px;
  border-top: 1px solid var(--theme-border);
}

.reply-toggle {
  background: none;
  border: none;
  color: #cfcfcf;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 10px;
  letter-spacing: 0.01em;
  border-radius: 0;
}

.reply-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.comments-list {
  margin: 14px 0 0 58px;
  display: grid;
  gap: 10px;
}

.comment-card,
.comment-form {
  padding: 12px 14px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--theme-border);
}

.comment-card {
  backdrop-filter: blur(4px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.comment-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-header {
  align-items: center;
}

.comment-actions-menu {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.comment-action-button {
  border: 1px solid var(--theme-border);
  background: rgba(255, 255, 255, 0.04);
  color: #d9d5de;
  border-radius: 0;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.comment-action-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.comment-action-button.is-danger {
  color: #ffb8b8;
  border-color: rgba(221, 113, 113, 0.28);
}

.comment-action-button.is-danger:hover {
  background: rgba(211, 95, 95, 0.12);
}

.comment-form {
  margin: 12px 0 0 58px;
  background: rgba(255, 255, 255, 0.03);
}

.post-edit-form,
.comment-edit-form {
  margin: 12px 0 0 58px;
  padding: 12px 14px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--theme-border);
}

.comment-form textarea {
  min-height: 84px;
  background: rgba(255, 255, 255, 0.92);
}

.post-edit-form textarea,
.comment-edit-form textarea {
  min-height: 92px;
  background: rgba(255, 255, 255, 0.92);
}

.comment-body {
  margin-left: 0;
}

.comment-card .comment-body p {
  font-size: 0.94rem;
  line-height: 1.5;
}

.comment-form .field {
  margin-bottom: 12px;
}

.comment-form .field span {
  display: none;
}

.comment-form-actions {
  justify-content: flex-end;
}

.comment-form .secondary-button,
.comment-form .primary-button {
  padding: 9px 16px;
}

.is-hidden {
  display: none !important;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  z-index: 1000;
}

.login-required-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.68);
  z-index: 1100;
}

.login-required-modal__dialog {
    width: min(100%, 420px);
    position: relative;
    padding: 34px 26px 28px;
    border: 1px solid var(--theme-border);
    background: #111111;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
    text-align: center;
  }

.login-required-modal__close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border: none;
    background: transparent;
    color: #f5f5f2;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

.login-required-modal__title {
    display: block;
    margin-bottom: 14px;
    color: #f5f5f2;
    font-size: 1.9rem;
    font-weight: 700;
  }

.login-required-modal__text {
    margin: 0;
    color: var(--theme-text-muted);
    line-height: 1.55;
    font-size: 1.15rem;
  }

.login-required-modal__actions {
    display: flex;
    justify-content: center;
    margin-top: 24px;
  }

.login-required-modal__google-slot {
    min-height: 44px;
  }

.lightbox-image {
  max-width: min(96vw, 1280px);
  max-height: 90vh;
  border-radius: 0;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.copy-button {
  margin-left: 8px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.04);
  color: #f4f0e7;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
}

.copy-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.copy-icon-button {
  margin-left: 0;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.copy-icon-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.copy-icon-button.is-copied {
  color: #7ee39e;
  border-color: rgba(126, 227, 158, 0.4);
  background: rgba(126, 227, 158, 0.12);
}

.copy-icon-button.is-copy-error {
  color: #ffb8b8;
  border-color: rgba(221, 113, 113, 0.4);
  background: rgba(221, 113, 113, 0.12);
}

.copy-icon-button.is-loading {
  opacity: 0.72;
  cursor: wait;
}

.memorial-card {
  padding: 18px 20px;
  display: grid;
  gap: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0%, rgba(255, 255, 255, 0.018) 100%);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.memorial-card:hover {
  border-color: color-mix(in srgb, var(--theme-submit-bg) 40%, var(--theme-border));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.memorial-card__header {
  align-items: center;
  gap: 16px;
}

.memorial-card__identity {
  gap: 6px;
}

.memorial-card__identity .author-meta strong {
  font-size: 1.15rem;
  line-height: 1.2;
}

.memorial-key-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #f4f0e7;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.memorial-key-copy-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  border-color: rgba(255, 255, 255, 0.12);
}

.memorial-card__body {
  margin: 0;
  display: grid;
  gap: 16px;
}

.memorial-card__content {
  margin: 0;
}

.memorial-link-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.028) 100%);
  border: 1px solid color-mix(in srgb, var(--theme-border) 84%, white 5%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.memorial-link-box__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.memorial-link-box__row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.16);
}

.memorial-link-box__row--action {
  grid-template-columns: 72px minmax(0, 1fr) 40px;
}

.memorial-link-box__row--exports {
  grid-template-columns: 72px minmax(0, 1fr) auto;
}

.memorial-link-box__value {
  min-width: 0;
  color: #f4f0e7;
  font-size: 0.95rem;
  line-height: 1.45;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.16s ease, opacity 0.16s ease;
  word-break: break-all;
}

a.memorial-link-box__value:hover,
a.memorial-link-box__value:focus-visible {
  color: var(--theme-submit-bg);
  outline: none;
}

.memorial-copy-button {
  flex: none;
  align-self: center;
  justify-self: end;
}

.memorial-album-button {
  grid-column: 3;
  justify-self: end;
  min-width: 40px;
}

.memorial-export-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f4f0e7;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.memorial-export-link:hover,
.memorial-export-link:focus-visible {
  color: var(--theme-submit-bg);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.memorial-export-link.is-disabled {
  opacity: 0.42;
  pointer-events: none;
  cursor: not-allowed;
}

.lead-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.memorial-album-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.memorial-card__actions {
  margin-top: 0;
  justify-content: flex-end;
}

.memorial-card__actions--danger {
  margin-top: 4px;
}

.memorial-edit-panel {
  border: 1px solid var(--theme-border);
  background: rgba(255, 255, 255, 0.03);
}

.memorial-edit-panel[open] {
  padding: 0 14px 14px;
}

.memorial-edit-toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  width: auto;
  margin: 0;
}

.memorial-edit-toggle::-webkit-details-marker {
  display: none;
}

.memorial-edit-form {
  padding-top: 14px;
}

.memorial-delete-button {
  border-color: rgba(214, 96, 96, 0.4);
  color: #f2b2b2;
  background: rgba(120, 18, 18, 0.12);
}

.memorial-delete-button:hover {
  background: rgba(171, 38, 38, 0.16);
  border-color: rgba(214, 96, 96, 0.68);
  color: #ffd6d6;
}

@media (max-width: 760px) {
  .tv-body {
    overflow: auto;
  }

  .tv-app {
    padding: 12px;
    gap: 14px;
  }

  .tv-header,
  .tv-stage-shell,
  .tv-footer {
    padding: 14px;
  }

  .tv-header {
    flex-direction: column;
    align-items: stretch;
  }

  .tv-header__tribute {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .tv-header__portrait {
    width: 72px;
    height: 72px;
  }

  .tv-header__meta {
    justify-items: start;
    text-align: left;
  }

  .tv-slide__body {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tv-slide__text-wrap {
    gap: 10px;
  }

  .tv-slide__text {
    font-size: clamp(22px, 6vw, 32px);
    padding: 18px;
    max-height: 42vh;
  }

  .tv-slide__byline {
    flex-wrap: wrap;
    font-size: 0.92rem;
    padding-left: 2px;
  }

  .tv-slide__media img {
    max-height: 40vh;
  }

  .tv-slide__placeholder {
    min-height: 220px;
    gap: 12px;
  }

  .tv-slide__placeholder-image {
    width: min(160px, 52%);
  }

  .tv-footer__meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-shell {
    width: min(100% - 18px, 980px);
    padding-top: 8px;
    padding-bottom: 28px;
  }

  .composer,
  .feed-section {
    padding: 14px;
    border-radius: 0;
  }

  .comment-field-row {
    grid-template-columns: 1fr;
  }

  .field {
    margin-bottom: 16px;
  }

  .panel-title {
    font-size: clamp(28px, 9vw, 38px);
  }

  .panel-intro {
    margin-bottom: 18px;
    font-size: 0.96rem;
  }

  .memorial-admin-form {
    gap: 16px;
  }

  .admin-accordion__summary {
    padding: 16px;
  }

  .admin-accordion__content {
    padding: 0 16px 16px;
  }

  .admin-section {
    padding: 16px;
    gap: 16px;
  }

  .admin-grid--memorial,
  .admin-theme-layout,
  .theme-grid--builder {
    grid-template-columns: 1fr;
  }

  .field--file {
    padding: 14px;
  }

  .admin-submit-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }

  .admin-submit-bar__copy {
    gap: 6px;
  }

  .panel-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 6px;
  }

  .panel-tab {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    text-align: center;
  }

  .panel-tab-count {
    margin-left: 6px;
  }

  .panel-section-header {
    align-items: stretch;
  }

  .panel-section-header__title {
    font-size: clamp(24px, 8vw, 34px);
  }

  .panel-section-header__badge {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-panel-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .logout-text-button--panel {
    width: 100%;
  }

  .memorial-filter-form {
    grid-template-columns: 1fr;
  }

  .memorial-filter-form__actions {
    width: 100%;
    grid-template-rows: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .memorial-filter-form__actions::before {
    display: none;
  }

  .memorial-filter-form__actions .memorial-filter-icon-button {
    width: 100%;
    min-width: 0;
    height: 56px;
    min-height: 56px;
    justify-content: center;
  }

  .memorial-filter-form__actions .memorial-filter-icon-button svg {
    width: 20px;
    height: 20px;
  }

  .memorial-filter-export-bar {
    align-items: stretch;
  }

  .memorial-filter-export-actions {
    width: 100%;
  }

  .memorial-filter-export-actions .memorial-export-link {
    flex: 1 1 0;
  }

  .theme-manager-card__header,
  .theme-manager-layout,
  .theme-manager-actions,
  .theme-manager-accordion__summary {
    padding-left: 16px;
    padding-right: 16px;
  }

  .theme-manager-card__header,
  .theme-manager-accordion__summary {
    padding-top: 18px;
    padding-bottom: 16px;
  }

  .admin-grid--login {
    grid-template-columns: 1fr;
  }

  .theme-manager-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 18px;
    padding-bottom: 18px;
  }

  .theme-grid--theme-manager {
    grid-template-columns: 1fr;
  }

  .theme-manager-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-bottom: 16px;
  }

  .theme-manager-actions .primary-button {
    width: 100%;
  }

  .theme-manager-accordion__summary-side {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .editor-shell {
    border-radius: 0;
  }

  .editor-toolbar {
    gap: 6px;
    padding: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .editor-toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar-button {
    width: 32px;
    height: 32px;
    border-radius: 0;
    font-size: 14px;
  }

  .emoji-group {
    gap: 6px;
    flex-wrap: nowrap;
  }

  .rich-editor {
    min-height: 160px;
    padding: 14px;
    font-size: 16px;
  }

  .editor-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 0 14px 12px;
    flex-wrap: wrap;
  }

  .user-session {
    flex-wrap: wrap;
    padding: 12px;
    gap: 12px;
    border-radius: 0;
  }

  .session-main {
    gap: 12px;
  }

  .avatar-lg {
    width: 48px;
    height: 48px;
  }

  .post-body,
  .post-actions,
  .post-edit-form,
  .comment-form,
  .comments-list,
  .reply-toggle {
    margin-left: 0;
  }

  .feed-list {
    gap: 12px;
  }

  .post-card {
    padding: 14px;
    border-radius: 0;
  }

  .post-header,
  .comment-header {
    gap: 10px;
  }

  .avatar {
    width: 40px;
    height: 40px;
  }

  .comment-card .avatar {
    width: 30px;
    height: 30px;
  }

  .post-body,
  .comment-body {
    margin-top: 10px;
  }

  .post-rich-text {
    font-size: 0.95rem;
  }

  .post-image-button {
    width: 100%;
  }

  .post-image {
    max-height: 320px;
    border-radius: 0;
  }

  .post-image-button::after {
    right: 10px;
    bottom: 10px;
    font-size: 11px;
    padding: 5px 8px;
    opacity: 1;
    transform: none;
  }

  .post-actions {
    margin-top: 12px;
    padding-top: 6px;
  }

  .reply-toggle {
    width: 100%;
    text-align: left;
    padding: 10px 8px;
  }

  .comments-list {
    margin-top: 10px;
    gap: 8px;
  }

  .comment-card,
  .post-edit-form,
  .comment-form {
    padding: 12px;
    border-radius: 0;
  }

  .memorial-card {
    padding: 14px;
    gap: 14px;
  }

  .memorial-card__header {
    gap: 12px;
  }

  .memorial-link-box {
    padding: 12px;
  }

  .memorial-link-box__row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .memorial-link-box__row--exports {
    grid-template-columns: 1fr;
  }

  .memorial-copy-button {
    width: 100%;
    justify-self: stretch;
  }

  .lead-form-grid {
    grid-template-columns: 1fr;
  }

  .memorial-link-box__actions,
  .created-links__actions {
    width: 100%;
  }

  .memorial-export-link {
    flex: 1 1 100%;
  }

  .memorial-album-button {
    grid-column: 3;
    width: 40px;
    justify-self: end;
    min-width: 40px;
  }

  .memorial-card__actions {
    justify-content: stretch;
  }

  .memorial-delete-button {
    width: 100%;
  }

  .memorial-edit-toggle,
  .theme-preview__button {
    width: 100%;
    justify-self: stretch;
  }

  .theme-swatches {
    gap: 8px;
  }

  .pagination-bar {
    align-items: stretch;
  }

  .pagination-controls {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .comment-actions-menu {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
    justify-content: flex-end;
  }

  .comment-form textarea {
    min-height: 76px;
    font-size: 16px;
  }

  .comment-form-actions {
    justify-content: stretch;
  }

  .comment-form .secondary-button,
  .comment-form .primary-button {
    flex: 1 1 0;
    min-height: 42px;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .primary-button {
    width: 100%;
    min-height: 46px;
  }

  .primary-button--large {
    width: 100%;
    min-width: 0;
    min-height: 48px;
  }

  .empty-state {
    padding: 18px 0 8px;
  }

  .image-lightbox {
    padding: 12px;
  }

  .login-required-modal {
    padding: 16px;
  }

  .login-required-modal__dialog {
      padding: 30px 18px 22px;
    }

    .login-required-modal__title {
      font-size: 1.5rem;
    }

    .login-required-modal__text {
      font-size: 1rem;
    }

  .lightbox-image {
    max-width: 100%;
    max-height: 82vh;
    border-radius: 0;
  }

  .lightbox-close {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .logout-text-button {
    margin-left: auto;
    padding: 6px 0;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 10px, 980px);
    padding-top: 4px;
    padding-bottom: 18px;
  }

  .composer,
  .feed-section {
    padding: 12px;
    border-radius: 0;
  }

  #post-identity-row {
    grid-template-columns: minmax(0, 1fr) 52px;
    gap: 8px;
  }

  .compact-field {
    margin-bottom: 10px;
  }

  .post-message-header {
    align-items: start;
    gap: 10px;
  }

  .google-login-slot {
    min-height: 44px;
  }

  .field > span {
    font-size: 0.95rem;
    line-height: 1.3;
  }

  .user-session {
    align-items: center;
  }

  .session-main {
    min-width: 0;
  }

  .session-main strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .post-card {
    padding: 12px;
    border-radius: 0;
  }

  .post-header,
  .comment-header {
    gap: 8px;
  }

  .author-meta strong {
    font-size: 0.94rem;
  }

  .post-date,
  .comment-date {
    font-size: 12px;
  }

  .post-rich-text,
  .comment-card .comment-body p {
    font-size: 0.92rem;
  }

  .post-image {
    max-height: 260px;
  }

  .comment-card,
  .post-edit-form,
  .comment-form {
    padding: 10px;
    border-radius: 0;
  }

  .memorial-card__identity .author-meta strong {
    font-size: 1rem;
  }

  .memorial-link-box__value {
    font-size: 0.92rem;
  }

  .comment-action-button {
    padding: 6px 9px;
    font-size: 11px;
  }

  .flash-message {
    margin-bottom: 12px;
    padding: 10px 12px;
  }

  .attachment-status,
  .editor-footer .field-help {
    font-size: 0.88rem;
  }
}
