﻿/*
 * Modal overlays, profile, shop, guides, legacy detail modal
 */

/*
 * Profile, modals, viewer, toasts, effects
 */

    /* 个人资料弹窗 */
    #profileModal .modal-card { max-width: 90vw; max-height: 95vh; width: 90%; overflow-y: auto; }
    .profile-avatar {
      display: flex; flex-direction: column; align-items: center; margin-bottom: 1.5rem;
    }
    .avatar-preview {
      width: 100px; height: 100px; border-radius: 50%; background: #f0e0d5;
      border: 3px dashed #c0aa98; display: flex; align-items: center; justify-content: center;
      overflow: hidden; margin-bottom: 0.8rem;
    }
    .avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
    .avatar-preview i { font-size: 2.5rem; color: #b39b88; }
    .avatar-upload-btn {
      background: #ddcdc0; border: none; border-radius: 40px; padding: 0.5rem 1.8rem;
      font-size: 1rem; color: #4e3f36; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; line-height: 1;
    }
    .avatar-upload-btn > *,
    #createModal .form-actions button > *,
    #editModal .form-actions button > *,
    #profileModal .form-actions button > * {
      display: inline-flex;
      align-items: center;
      align-self: center;
      line-height: 1;
      white-space: nowrap;
    }
    .avatar-upload-btn .i18n-inline-suffix,
    #createModal .form-actions button .i18n-inline-suffix,
    #editModal .form-actions button .i18n-inline-suffix,
    #profileModal .form-actions button .i18n-inline-suffix {
      margin-left: -0.2rem;
    }
    .photo-preview {
      cursor: pointer;
    }

    /* ========== 宠物详情弹窗样式 - 极简版 ========== */
    .modal-overlay {
      position: fixed; top:0; left:0; width:100%; height:100%;
      background-color: rgba(230,215,200,0.3);
      backdrop-filter: blur(5px);
      display: flex; align-items: center; justify-content: center;
      z-index: 999; visibility: hidden; opacity: 0;
      transition: 0.3s; padding: 1rem;
    }
    .modal-overlay.show { visibility: visible; opacity: 1; }
    #createModal.is-suspended,
    #editModal.is-suspended,
    #profileModal.is-suspended {
      visibility: hidden;
      opacity: 0;
      pointer-events: none;
    }
    .modal-card {
      background: #fff9f5;
      max-width: 900px; width: 100%; max-height: 85vh; overflow-y: auto;
      border-radius: 40px;
      padding: 2rem;
      box-shadow: 0 8px 32px rgba(140,120,110,0.1);
      position: relative;
      border: 1px solid rgba(255,255,255,0.8);
      backdrop-filter: blur(8px);
    }
    .modal-card::-webkit-scrollbar {
      width: 10px;
    }
    .modal-card::-webkit-scrollbar-track {
      background: linear-gradient(180deg, var(--scrollbar-track) 0%, var(--scrollbar-track-edge) 100%);
      border-radius: 999px;
    }
    .modal-card::-webkit-scrollbar-thumb {
      background: linear-gradient(180deg, var(--scrollbar-thumb-start) 0%, var(--scrollbar-thumb-mid) 52%, var(--scrollbar-thumb-end) 100%);
      border: 2px solid var(--scrollbar-frame);
      border-radius: 999px;
      box-shadow: 0 4px 10px var(--scrollbar-shadow);
    }
    .modal-card::-webkit-scrollbar-thumb:hover {
      background: linear-gradient(180deg, var(--scrollbar-thumb-hover-start) 0%, var(--scrollbar-thumb-hover-mid) 52%, var(--scrollbar-thumb-hover-end) 100%);
    }
    .project-guide-card {
      max-width: 760px;
    }
    .shop-modal-card {
      max-width: 980px;
    }
    .shop-panel {
      display: flex;
      flex-direction: column;
      gap: 1.2rem;
    }
    .shop-panel__header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 1rem;
      padding-right: 2rem;
    }
    .shop-panel__header h2 {
      margin: 0 0 0.35rem;
      color: #5a4c42;
    }
    .shop-panel__header p {
      margin: 0;
      color: #7d6f66;
      line-height: 1.6;
    }
    .shop-balance {
      min-width: 160px;
      padding: 0.8rem 1rem;
      border-radius: 18px;
      background: rgba(255, 248, 241, 0.95);
      border: 1px solid rgba(255, 221, 191, 0.85);
      color: #7a5a3a;
      text-align: right;
    }
    .shop-tabs {
      display: flex;
      gap: 0.8rem;
      flex-wrap: wrap;
    }
    .shop-tab {
      border: 1px solid rgba(255, 196, 196, 0.8);
      background: rgba(255, 250, 245, 0.9);
      color: #6c5850;
      border-radius: 999px;
      padding: 0.55rem 1.1rem;
      cursor: pointer;
    }
    .shop-tab.active {
      background: linear-gradient(135deg, rgba(255, 182, 193, 0.92), rgba(255, 210, 220, 0.95));
      color: #4f403a;
      border-color: transparent;
    }
    .shop-toolbar {
      display: flex;
      justify-content: flex-end;
    }
    .shop-toolbar label {
      display: flex;
      flex-direction: column;
      gap: 0.45rem;
      color: #6c5f56;
      font-weight: 600;
    }
    .shop-toolbar select {
      min-width: 220px;
      border: 1px solid rgba(220, 190, 175, 0.9);
      border-radius: 14px;
      padding: 0.7rem 0.85rem;
      background: rgba(255, 250, 245, 0.95);
      color: #5a4c42;
    }
    .shop-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 1rem;
    }
    .shop-card {
      display: flex;
      flex-direction: column;
      gap: 0.9rem;
      padding: 1.1rem;
      border-radius: 22px;
      background: rgba(255, 252, 249, 0.98);
      border: 1px solid rgba(245, 220, 209, 0.95);
      box-shadow: 0 12px 30px rgba(121, 96, 86, 0.08);
    }
    .shop-card--owned {
      background: rgba(250, 255, 252, 0.98);
      border-color: rgba(194, 231, 214, 0.95);
    }
    .shop-card__icon {
      width: 52px;
      height: 52px;
      border-radius: 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: rgba(255, 239, 231, 0.92);
      font-size: 1.6rem;
    }
    .shop-card__title-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.6rem;
      margin-bottom: 0.35rem;
    }
    .shop-card__title-row h3 {
      margin: 0;
      color: #5a4c42;
      font-size: 1rem;
    }
    .shop-card__rarity {
      border-radius: 999px;
      padding: 0.18rem 0.55rem;
      background: rgba(255, 233, 214, 0.95);
      color: #9a6a4b;
      font-size: 0.78rem;
      white-space: nowrap;
    }
    .shop-card__desc {
      margin: 0;
      color: #7d6f66;
      line-height: 1.65;
      min-height: 3.2em;
    }
    .shop-card__meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      color: #8b786d;
      font-size: 0.92rem;
    }
    .shop-card__actions {
      display: flex;
      gap: 0.6rem;
      flex-wrap: wrap;
    }
    .shop-action-btn {
      border: none;
      border-radius: 14px;
      padding: 0.7rem 0.95rem;
      background: linear-gradient(135deg, rgba(255, 186, 193, 0.95), rgba(255, 214, 221, 0.95));
      color: #5a4640;
      font-weight: 600;
      cursor: pointer;
    }
    .shop-action-btn.is-owned {
      background: rgba(229, 236, 232, 0.95);
      color: #7a7f7d;
      cursor: not-allowed;
    }
    .shop-action-btn.is-apply {
      background: rgba(226, 245, 236, 0.98);
      color: #2f6f55;
    }
    .shop-orders {
      display: flex;
      flex-direction: column;
      gap: 0.8rem;
      padding-top: 0.2rem;
    }
    .shop-orders h3 {
      margin: 0;
      color: #5a4c42;
    }
    .shop-order-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 1rem;
      padding: 0.95rem 1rem;
      border-radius: 16px;
      background: rgba(255, 250, 245, 0.95);
      border: 1px solid rgba(242, 223, 211, 0.9);
      color: #6a5d56;
    }
    .shop-order-item__meta {
      margin-top: 0.25rem;
      font-size: 0.82rem;
      color: #98857b;
    }
    .shop-empty,
    .shop-card__hint {
      padding: 1rem;
      border-radius: 16px;
      background: rgba(255, 250, 245, 0.95);
      border: 1px dashed rgba(235, 204, 188, 0.95);
      color: #8f7b6f;
      line-height: 1.6;
    }
    .site-footer {
      margin-top: auto;
      padding: 2rem 0 0;
      display: grid;
      grid-template-columns: minmax(220px, 1.05fr) minmax(280px, 1.15fr) minmax(220px, 0.9fr);
      align-items: start;
      gap: 1.2rem 2rem;
      color: #8d7c71;
      font-size: 0.92rem;
      border-top: 1px solid rgba(229, 214, 206, 0.88);
    }
    .site-footer__brand {
      display: grid;
      gap: 0.28rem;
      min-width: 0;
    }
    .site-footer__brand strong {
      color: #6a5650;
      font-size: 1rem;
      font-weight: 700;
    }
    .site-footer__brand span {
      color: #9b857c;
      font-size: 0.86rem;
      line-height: 1.6;
    }
    .site-footer__support {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: end;
      gap: 0.7rem;
      min-width: 0;
    }
    .site-footer__support[hidden] {
      display: none;
    }
    .site-footer__support-copy {
      display: grid;
      gap: 0.16rem;
      min-width: 0;
    }
    .site-footer__support-label {
      color: #7c6761;
      font-size: 0.85rem;
      font-weight: 600;
    }
    .site-footer__support-copy p {
      margin: 0;
      color: #9d8880;
      font-size: 0.79rem;
      line-height: 1.5;
    }
    .site-footer__support button {
      flex: 0 0 auto;
      min-height: auto;
      padding: 0.08rem 0;
      border: none;
      background: transparent;
      color: #8c6674;
      font: inherit;
      font-size: 0.84rem;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      transition: color 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
      opacity: 0.9;
    }
    .site-footer__support button:hover {
      background: transparent;
      color: #765563;
      opacity: 1;
      transform: translateY(-1px);
    }
    .site-footer__info {
      display: grid;
      align-content: start;
      justify-items: start;
      gap: 0.2rem;
      min-width: 0;
    }
    .site-footer__info-label {
      color: #9b857c;
      font-size: 0.76rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }
    .site-footer__domain {
      color: #6f5a54;
      font-size: 0.93rem;
      font-weight: 700;
      line-height: 1.4;
      word-break: break-word;
    }
    .site-footer__info p {
      margin: 0;
      color: #a08b83;
      font-size: 0.78rem;
      line-height: 1.55;
    }
    .site-footer__links {
      display: flex;
      margin-top: 0.3rem;
      gap: 0.8rem;
      flex-wrap: wrap;
    }
    .site-footer__links button {
      border: 1px solid rgba(226, 205, 194, 0.95);
      border-radius: 999px;
      padding: 0.5rem 0.95rem;
      background: rgba(255, 250, 245, 0.95);
      color: #6d5d55;
      cursor: pointer;
    }
    @media (max-width: 720px) {
      .site-footer {
        grid-template-columns: 1fr;
        align-items: stretch;
      }
      .site-footer__support {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 0.3rem;
      }
      .site-footer__support button {
        width: auto;
      }
    }
    .guide-modal__header {
      margin-bottom: 1.2rem;
      padding-right: 2rem;
    }
    .guide-modal__meta {
      margin-bottom: 0.45rem;
      color: #a27f72;
      font-size: 0.82rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      text-transform: uppercase;
    }
    .guide-modal__header h2 {
      margin: 0 0 0.4rem;
      color: #5a4c42;
      font-size: 1.7rem;
    }
    .guide-modal__header p,
    .guide-modal__section p {
      margin: 0;
      color: #7a665b;
      line-height: 1.7;
    }
    .guide-modal__section ul {
      margin: 0.65rem 0 0;
      padding-left: 1.2rem;
      color: #7a665b;
      line-height: 1.7;
    }
    .guide-modal__section li + li {
      margin-top: 0.35rem;
    }
    .guide-modal__section + .guide-modal__section {
      margin-top: 0.9rem;
    }
    .guide-modal__section {
      padding: 1rem 1.1rem;
      border-radius: 22px;
      background: rgba(255,255,255,0.62);
      border: 1px solid rgba(239,225,216,0.95);
      box-shadow: 0 8px 18px rgba(140,120,110,0.05);
    }
    .guide-modal__section h3 {
      margin: 0 0 0.45rem;
      color: #5a4c42;
      font-size: 1rem;
    }
    .delete-confirm-card {
      max-width: 540px;
      border-radius: 28px;
      padding: 1.8rem 1.6rem 1.45rem;
    }
    .delete-confirm {
      display: grid;
      gap: 1rem;
    }
    .delete-confirm__header {
      display: grid;
      gap: 0.38rem;
      padding-right: 1.8rem;
    }
    .delete-confirm__header h3 {
      margin: 0;
      color: #584942;
      font-size: 1.42rem;
      line-height: 1.25;
    }
    .delete-confirm__header p {
      margin: 0;
      color: #7e6b62;
      font-size: 0.94rem;
      line-height: 1.7;
    }
    .delete-confirm__list {
      display: grid;
      gap: 0.55rem;
      margin: 0;
      padding: 0;
      list-style: none;
    }
    .delete-confirm__list li {
      display: flex;
      align-items: baseline;
      gap: 0.52rem;
      padding: 0.72rem 0.9rem;
      border-radius: 12px;
      background: rgba(255, 250, 247, 0.96);
      border: 1px solid rgba(234, 219, 211, 0.94);
      color: #67564e;
      line-height: 1.6;
    }
    .delete-confirm__list li::before {
      content: '！';
      position: static;
      flex: 0 0 auto;
      color: #bf6d82;
      font-size: 1.12rem;
      font-weight: 900;
      line-height: 1.45;
      transform: translateY(0.02em);
    }
    .delete-confirm__warning {
      margin: 0;
      color: #9b5f6b;
      font-size: 0.88rem;
      line-height: 1.65;
    }
    .delete-confirm__actions {
      display: flex;
      justify-content: flex-end;
      gap: 0.7rem;
      flex-wrap: wrap;
      padding-top: 0.25rem;
    }
    .delete-confirm__actions button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.5rem;
      min-height: 42px;
      padding: 0.72rem 1rem;
      border-radius: 8px;
      border: 1px solid rgba(208, 190, 180, 0.92);
      background: rgba(255, 255, 255, 0.94);
      color: #5a4b43;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    }
    .delete-confirm__actions button:hover {
      background: rgba(250, 244, 240, 0.98);
      border-color: rgba(198, 178, 168, 0.98);
      color: #5f5049;
      transform: translateY(-1px);
    }
    .delete-confirm__actions .danger {
      border-color: rgba(214, 164, 164, 0.96);
      background: rgba(255, 245, 245, 0.96);
      color: #a25a65;
      font-size: 0.92rem;
    }
    .delete-confirm__actions .danger:hover {
      background: rgba(255, 238, 238, 0.98);
      border-color: rgba(198, 137, 148, 0.98);
      color: #8f4755;
      box-shadow: 0 10px 20px rgba(201, 148, 156, 0.16);
    }
    @media (max-width: 640px) {
      .delete-confirm-card {
        padding: 1.55rem 1.05rem 1.1rem;
      }
      .delete-confirm__actions button {
        width: 100%;
      }
    }
    .guide-modal__doc {
      margin-top: 0.65rem !important;
      font-size: 0.92rem;
      color: #8d7468 !important;
    }

    .modal-close {
      position: absolute; top: 16px; right: 20px; font-size: 2rem;
      color: #b29f92; cursor: pointer; background: none; border: none;
      z-index: 10;
    }

    .detail-header {
      display: flex; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap;
    }
    .detail-photo-frame {
      width: 140px; height: 140px; border-radius: 50%; padding: 6px;
      background: linear-gradient(145deg, #fad9cb, #ffe6db); flex-shrink: 0;
    }
    .detail-photo { width: 100%; height: 100%; border-radius: 50%; object-fit: contain; border: 3px solid white; }
    .detail-info { flex: 1; min-width: 280px; }
    .info-grid {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 0.6rem;
      margin-top: 0.3rem;
    }
    .info-item { display: flex; align-items: baseline; font-size: 0.9rem; }
    .info-label { width: 100px; font-weight: 600; color: #7f6e62; font-size: 0.9rem; }
    .info-value { font-size: 1rem; color: #3a3a3a; }
    .pet-name-large { font-size: 2rem; font-weight: 500; color: #4e6b5c; margin-bottom: 0.3rem; }

    .bio-section {
      margin: 1rem 0;
      padding: 1.2rem 1.5rem;
      background: rgba(255, 245, 235, 0.5);
      border-radius: 24px;
      border: 1px solid rgba(255,255,255,0.6);
    }
    .bio-title {
      font-size: 1.2rem; color: #5d6d5e; margin-bottom: 0.5rem;
      display: flex; align-items: center; gap: 8px;
      font-weight: 500;
    }
    .bio-content {
      font-size: 1.1rem; color: #5a4c42; line-height: 1.6; white-space: pre-line;
      text-align: left;
    }
    .bio-section:last-child .bio-content {
      text-align: center;
      font-size: 1.4rem;
      font-weight: 500;
      line-height: 1.4;
      font-family: 'Noto Serif SC', '楷体', 'KaiTi', serif;
      font-style: normal;
    }

    /* 祭拜区域与回忆录统一背景 */
    .worship-section-detail {
      background: rgba(255, 255, 255, 0.9);
      border-radius: 24px;
      padding: 1.5rem;
      margin: 1.2rem 0;
      border: 1px solid rgba(255, 240, 230, 0.8);
      box-shadow: 0 4px 16px rgba(140, 120, 110, 0.08);
      transition: all 0.3s ease;
    }
    
    .worship-section-detail:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(140, 120, 110, 0.12);
    }
    
    .memories-section,
    .add-memory {
      background: rgba(255, 250, 245, 0.38);
      border-radius: 24px;
      padding: 1.2rem 1.5rem;
      margin: 1.2rem 0;
      border: 1px solid rgba(255,255,255,0.52);
      box-shadow: 0 8px 18px rgba(140,120,110,0.05);
      backdrop-filter: blur(8px);
    }

    .worship-stats {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      margin-bottom: 1rem;
      gap: 1rem;
    }
    .worship-total {
      font-size: 1.3rem;
      color: #5d6d5e;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 0.5rem 1rem;
      background: rgba(255, 245, 235, 0.6);
      border-radius: 20px;
      border: 1px solid rgba(255, 230, 220, 0.8);
    }
    .worship-total i {
      color: #ff69b4;
      margin-right: 0;
      font-size: 1.1rem;
    }
    .worship-button {
      background: linear-gradient(145deg, #ff69b4, #ff1493);
      border: 2px solid #ff1493;
      border-radius: 24px;
      padding: 0.8rem 2.2rem;
      font-size: 1.4rem;
      color: white;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 12px;
      transition: all 0.3s ease;
      box-shadow: 0 4px 15px rgba(255, 105, 180, 0.4);
      font-weight: 600;
      text-shadow: 0 1px 2px rgba(0,0,0,0.2);
      min-width: 160px;
      justify-content: center;
    }
    .worship-button:disabled {
      background: #c0a898;
      cursor: not-allowed;
      opacity: 0.6;
      box-shadow: none;
      border-color: #a89888;
    }
    .worship-button:hover:not(:disabled) {
      background: linear-gradient(145deg, #ff85c2, #ff69b4);
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(255, 105, 180, 0.5);
      border-color: #ff69b4;
    }
    .worship-button:active:not(:disabled) {
      transform: translateY(0);
    }
    .worship-button span {
      font-size: 1.7rem;
      text-shadow: none;
      display: inline-block;
      transition: transform 0.3s ease;
    }
    .worship-button:hover:not(:disabled) span {
      transform: scale(1.15) rotate(8deg);
    }
    .worship-remaining {
      background: rgba(255, 255, 255, 0.25);
      padding: 6px 12px;
      border-radius: 14px;
      font-size: 1.1rem;
      font-weight: 700;
      backdrop-filter: blur(10px);
      min-width: 24px;
      text-align: center;
      border: 1px solid rgba(255, 255, 255, 0.3);
    }
    .worship-button:disabled .worship-remaining {
      background: rgba(255, 255, 255, 0.15);
    }

    .worship-records {
      max-height: 150px; overflow-y: auto; margin-top: 0.5rem; padding-right: 0.5rem;
    }
    .worship-records::-webkit-scrollbar {
      width: 8px;
    }
    .worship-records::-webkit-scrollbar-track {
      background: linear-gradient(180deg, var(--scrollbar-track) 0%, var(--scrollbar-track-edge) 100%);
      border-radius: 999px;
    }
    .worship-records::-webkit-scrollbar-thumb {
      background: linear-gradient(180deg, var(--scrollbar-thumb-start) 0%, var(--scrollbar-thumb-mid) 52%, var(--scrollbar-thumb-end) 100%);
      border: 1px solid var(--scrollbar-frame);
      border-radius: 999px;
    }
    .worship-records::-webkit-scrollbar-thumb:hover {
      background: linear-gradient(180deg, var(--scrollbar-thumb-hover-start) 0%, var(--scrollbar-thumb-hover-mid) 52%, var(--scrollbar-thumb-hover-end) 100%);
    }
    .record-item {
      background: rgba(255, 250, 245, 0.9);
      border-radius: 12px;
      padding: 0.5rem;
      margin-bottom: 0.4rem;
      display: flex;
      align-items: center;
      gap: 8px;
      border: 1px solid rgba(255, 240, 230, 0.6);
      font-size: 0.8rem;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
      transition: all 0.2s ease;
      flex-wrap: wrap;
    }
    .record-item:hover {
      transform: translateY(-1px);
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
      background: rgba(255, 248, 240, 1);
    }
    .record-avatar {
      width: 32px; height: 32px; border-radius: 50%;
      object-fit: cover;
      background: linear-gradient(145deg, #ffdfd0, #ffe0d8);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1rem;
      color: #ff69b4;
      border: 2px solid rgba(255, 255, 255, 0.8);
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
      flex-shrink: 0;
    }
    .record-user {
      font-weight: 600;
      color: #5a4c42;
      min-width: 70px;
      flex-shrink: 0;
    }
    .record-time {
      font-size: 0.8rem;
      color: #8b7a6b;
      flex: 1;
      min-width: 120px;
    }
    .record-gift {
      background: rgba(255, 236, 230, 0.8);
      border-radius: 16px;
      padding: 0.25rem 0.6rem;
      font-size: 0.8rem;
      color: #7e5a4b;
      display: flex;
      align-items: center;
      gap: 3px;
      font-weight: 500;
      border: 1px solid rgba(255, 220, 210, 0.6);
      flex-shrink: 0;
    }

    .memories-section {
      position: relative;
    }
    .memories-header {
      display: flex; justify-content: space-between; align-items: center;
      margin-bottom: 1rem;
    }
    .memories-title {
      font-size: 1.2rem; color: #5d6d5e; margin-bottom: 0;
      display: flex; align-items: center; gap: 8px;
      font-weight: 500;
    }
    .memories-sort {
      display: flex; gap: 0.5rem;
    }
    .sort-btn {
      background: rgba(200, 180, 165, 0.3); border: 1px solid rgba(180, 160, 145, 0.5);
      border-radius: 20px; padding: 0.4rem 0.8rem; font-size: 0.85rem;
      color: #5a4c42; cursor: pointer; transition: all 0.2s ease;
    }
    .sort-btn:hover {
      background: rgba(180, 160, 145, 0.4);
      transform: translateY(-1px);
    }
    .sort-btn.active {
      background: #b3c7b0; color: #2f463a;
      border-color: #a6b9a2;
    }
    .memory-item {
      background: rgba(255, 255, 255, 0.74); border-radius: 20px; padding: 1.5rem;
      margin-bottom: 1.25rem; border: 1px solid rgba(255, 240, 230, 0.66);
      box-shadow: 0 10px 20px rgba(140, 120, 110, 0.05);
      backdrop-filter: blur(8px);
      transition: all 0.3s ease;
      position: relative;
    }
    .memory-item:hover {
      transform: translateY(-2px);
      box-shadow: 0 12px 24px rgba(140, 120, 110, 0.08);
    }
    .memory-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      margin-bottom: 1rem;
    }
    .memory-date {
      font-size: 0.8rem;
      color: #9b8a7a;
      font-weight: 400;
      font-style: italic;
    }
    .memory-actions {
      display: flex;
      gap: 0.5rem;
    }
    .memory-like-btn {
      background: none;
      border: none;
      color: #d4b7a5;
      cursor: pointer;
      font-size: 0.9rem;
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 0.2rem 0.4rem;
      border-radius: 12px;
      transition: all 0.2s ease;
    }
    .memory-like-btn:hover {
      color: #ff69b4;
      background: rgba(255, 182, 193, 0.1);
    }
    .memory-like-btn.liked {
      color: #ff69b4;
    }
    .memory-text {
      font-size: 1.1rem;
      margin: 0 0 1rem 0;
      line-height: 1.6;
      color: #4a3c32;
    }
    .memory-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 1rem;
      padding-top: 1rem;
      border-top: 1px solid rgba(220, 200, 180, 0.2);
      font-size: 0.85rem;
      color: #8b7a6b;
    }
    .memory-time {
      font-style: italic;
    }
    .memory-stats {
      display: flex;
      gap: 1rem;
      align-items: center;
    }
    .memory-stat {
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .comments-header {
      margin-bottom: 0.8rem;
      text-align: center;
    }
    .toggle-comments {
      background: none;
      border: none;
      color: #8b7a6b;
      cursor: pointer;
      font-size: 0.85rem;
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 0.3rem 0.8rem;
      border-radius: 16px;
      transition: all 0.2s ease;
      margin: 0 auto;
    }
    .toggle-comments:hover {
      color: #ff69b4;
      background: rgba(255, 182, 193, 0.1);
    }
    .comment-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 0.8rem;
      padding: 0.8rem;
      background: rgba(255, 245, 235, 0.5);
      border-radius: 16px;
      font-size: 0.9rem;
    }
    .comment-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      overflow: hidden;
      flex-shrink: 0;
      background: linear-gradient(145deg, #ffdfd0, #ffe0d8);
    }
    .comment-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .avatar-placeholder {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.2rem;
      font-weight: 600;
      color: #ff69b4;
      background: rgba(255, 182, 193, 0.2);
    }
    .comment-content {
      flex: 1;
      min-width: 0;
    }
    .comment-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 0.4rem;
      flex-wrap: wrap;
      gap: 8px;
    }
    .comment-user {
      font-weight: 600;
      color: #5a4c42;
      flex-shrink: 0;
    }
    .comment-time {
      font-size: 0.8rem;
      color: #8b7a6b;
      flex-shrink: 0;
    }
    .comment-text {
      color: #4a3c32;
      line-height: 1.5;
      word-break: break-word;
    }
    .add-comment {
      margin-top: 0.8rem;
      display: flex;
      gap: 0.5rem;
    }
    .comment-input {
      flex: 1;
      padding: 0.6rem;
      border: 1px solid rgba(220, 200, 180, 0.6);
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.8);
      font-size: 0.9rem;
    }
    .comment-submit {
      background: #ff69b4;
      border: none;
      color: white;
      padding: 0.6rem 1rem;
      border-radius: 16px;
      cursor: pointer;
      font-size: 0.9rem;
      transition: all 0.2s ease;
    }
    .comment-submit:hover {
      background: #ff85c2;
      transform: translateY(-1px);
    }
    .memory-photo {
      max-width: 100%; max-height: 200px; border-radius: 12px; margin-top: 0.8rem;
      cursor: pointer; transition: all 0.3s ease;
      border: 3px solid rgba(255, 255, 255, 0.8);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    .memory-photo:hover {
      transform: scale(1.02);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .add-memory textarea {
      width: 100%; border: 1px solid #d4bbaa; border-radius: 16px; padding: 0.8rem;
      margin-bottom: 0.8rem; background: rgba(255,255,255,0.6); font-size: 1rem;
      min-height: 100px; resize: vertical;
    }
    .photo-upload-row {
      display: flex; align-items: center; gap: 10px; margin-bottom: 0.8rem;
      flex-wrap: wrap;
    }
    .file-label {
      background: #cfbcae; padding: 0.4rem 1.2rem; border-radius: 30px; cursor: pointer;
      display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
    }
    .file-name {
      color: #6b5e55; font-size: 0.9rem; word-break: break-word; flex: 1;
    }
    .photo-preview-mini {
      max-width: 80px; max-height: 80px; border-radius: 12px; margin-top: 0.3rem;
      border: 2px solid rgba(255,255,255,0.6);
    }
    .save-memory-btn {
      display: flex; justify-content: flex-end;
    }
    .save-memory-btn button {
      background: #b3c7b0; border: none; border-radius: 30px; padding: 0.5rem 2rem;
      font-size: 1rem; cursor: pointer; color: #2f463a;
    }

    .action-buttons {
      display: flex; gap: 0.8rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap;
    }
    .action-btn {
      background: rgba(200,180,165,0.3); border: none; border-radius: 40px;
      padding: 0.5rem 1.5rem; font-size: 1rem; color: #5a4c42; cursor: pointer;
      display: flex; align-items: center; gap: 6px; transition: 0.2s;
    }
    .action-btn:hover { background: rgba(180,160,145,0.5); transform: scale(1.02); }
    .share-btn { background: #c3d2c0; color: #2f463a; }

    /* 创建/编辑弹窗样式 */
    #createModal .modal-card, #editModal .modal-card, #profileModal .modal-card {
      background: #fff9f5;
      border: none;
      box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    }
    #createModal .modal-card::-webkit-scrollbar,
    #editModal .modal-card::-webkit-scrollbar,
    #profileModal .modal-card::-webkit-scrollbar {
      width: 10px;
    }
    #createModal .modal-card::-webkit-scrollbar-thumb,
    #editModal .modal-card::-webkit-scrollbar-thumb,
    #profileModal .modal-card::-webkit-scrollbar-thumb {
      background: linear-gradient(180deg, var(--scrollbar-thumb-start) 0%, var(--scrollbar-thumb-mid) 52%, var(--scrollbar-thumb-end) 100%);
      border: 2px solid var(--scrollbar-frame);
      border-radius: 999px;
      box-shadow: 0 4px 10px var(--scrollbar-shadow);
    }

    .memorial-editor-view {
      padding: 2.25rem 0 4rem;
    }
    .memorial-editor-shell {
      width: min(100%, 920px);
      margin: 0 auto;
      display: grid;
      gap: 1rem;
    }
    .memorial-editor-toolbar {
      display: flex;
      align-items: center;
      justify-content: flex-start;
    }
    .memorial-editor-view .memorial-editor-toolbar {
      display: none;
    }
    .memorial-editor-back {
      display: inline-flex;
      align-items: center;
      gap: 0.6rem;
      min-height: 42px;
      padding: 0.74rem 1rem;
      border: 1px solid rgba(223, 206, 198, 0.92);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.86);
      color: #5f5048;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    }
    .memorial-editor-back:hover {
      background: rgba(255, 250, 246, 0.96);
      border-color: rgba(201, 177, 166, 0.96);
      transform: translateY(-1px);
    }
    .memorial-editor-back i {
      color: #b27d71;
    }
    .memorial-editor-view .modal-overlay {
      position: static;
      inset: auto;
      width: auto;
      height: auto;
      padding: 0;
      overflow: visible;
      visibility: visible;
      opacity: 1;
      background: none;
      backdrop-filter: none;
    }
    .memorial-editor-view .modal-card {
      margin: 0 auto;
      max-height: none;
      overflow: visible;
      transition: transform 0.22s ease, opacity 0.22s ease, filter 0.22s ease;
    }
    #createView #createModal .create-modal-card,
    #editView #editModal .edit-modal-card {
      max-height: none;
      height: auto;
      overflow: visible;
      overflow-y: visible;
    }
    .memorial-editor-view .modal-close {
      display: inline-flex;
    }
    #createView #createModal,
    #editView #editModal {
      background: none;
      backdrop-filter: none;
    }

    #createModal {
      background: rgba(46, 35, 29, 0.26);
      backdrop-filter: blur(12px);
    }
    #createModal .create-modal-card {
      width: min(96vw, 1080px);
      max-height: min(90vh, 980px);
      padding: 1.25rem;
      border-radius: 8px;
      border: 1px solid rgba(225, 214, 205, 0.96);
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(252, 247, 242, 0.98) 100%);
      box-shadow: 0 24px 72px rgba(74, 58, 47, 0.16);
      overflow: auto;
    }
    #createModal .modal-close {
      top: 1rem;
      right: 1rem;
      width: 38px;
      height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      border: 1px solid rgba(222, 210, 200, 0.92);
      background: rgba(255, 255, 255, 0.9);
      color: #7a675d;
      transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    }
    #createModal .modal-close:hover {
      background: rgba(248, 240, 234, 0.98);
      border-color: rgba(214, 193, 180, 0.96);
      color: #4e3f36;
    }
    #createModal .memorial-form {
      display: grid;
      gap: 1.5rem;
      min-width: 0;
    }
    #createModal .memorial-form__hero {
      display: grid;
      grid-template-columns: minmax(228px, 268px) minmax(0, 1fr);
      gap: 1.5rem;
      align-items: stretch;
      padding-right: 2.25rem;
      padding-bottom: 1.25rem;
      border-bottom: 1px solid rgba(230, 218, 208, 0.94);
    }
    #createModal .memorial-form__media-panel {
      display: grid;
      gap: 0.85rem;
      align-content: start;
      justify-items: center;
      padding: 1rem;
      border: 1px solid rgba(230, 219, 210, 0.96);
      border-radius: 8px;
      background:
        linear-gradient(180deg, rgba(255, 250, 246, 0.98) 0%, rgba(247, 242, 237, 0.98) 100%);
    }
    #createModal .memorial-form__avatar-preview {
      width: min(100%, 216px);
      aspect-ratio: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      margin-inline: auto;
      border-radius: 50%;
      border: 3px solid rgba(255, 255, 255, 0.94);
      background:
        linear-gradient(135deg, rgba(243, 230, 224, 0.94) 0%, rgba(236, 244, 238, 0.94) 100%);
      color: #9b7a71;
      box-shadow: 0 16px 34px rgba(88, 69, 60, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.82);
    }
    #createModal .memorial-form__avatar-preview img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
    }
    #createModal .memorial-form__avatar-preview i {
      font-size: 1.65rem;
    }
    #createModal .photo-upload-btn {
      width: 100%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.55rem;
      min-height: 44px;
      padding: 0.8rem 1rem;
      border: 1px solid rgba(205, 186, 176, 0.94);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.9);
      color: #5c4d44;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    }
    #createModal .photo-upload-btn:hover {
      background: rgba(252, 246, 241, 0.98);
      border-color: rgba(190, 167, 155, 0.96);
      transform: translateY(-1px);
    }
    #createModal .photo-note {
      color: #88776e;
      font-size: 0.84rem;
      line-height: 1.65;
      text-align: center;
    }
    #createModal .memorial-form__intro {
      display: grid;
      gap: 1.1rem;
      align-content: start;
      min-width: 0;
      padding: 0.15rem 0;
    }
    #createModal .memorial-form__header {
      display: grid;
      gap: 0.45rem;
      margin: 0;
    }
    #createModal .memorial-form__eyebrow {
      color: #96736b;
      font-size: 0.82rem;
      font-weight: 700;
      letter-spacing: 0;
    }
    #createModal .create-header h2 {
      margin: 0;
      color: #342c28;
      font-size: 2rem;
      line-height: 1.08;
      letter-spacing: 0;
      font-weight: 800;
    }
    #createModal .create-header p {
      margin: 0;
      color: #6f625a;
      font-size: 0.96rem;
      line-height: 1.7;
      max-width: 34rem;
    }
    #createModal .create-header p i {
      color: #b58274;
      margin-right: 0.38rem;
    }
    #createModal .memorial-form__summary {
      list-style: none;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 0.9rem;
      padding: 0;
      margin: 0;
    }
    #createModal .memorial-form__summary li {
      min-width: 0;
      padding-top: 0.9rem;
      border-top: 1px solid rgba(229, 218, 209, 0.94);
    }
    #createModal .memorial-form__summary span {
      display: block;
      color: #907f75;
      font-size: 0.8rem;
      line-height: 1.4;
    }
    #createModal .memorial-form__summary strong {
      display: block;
      margin-top: 0.32rem;
      color: #3e3530;
      font-size: 0.96rem;
      line-height: 1.45;
      font-weight: 700;
    }
    #createModal .memorial-form__body {
      display: grid;
      gap: 1.1rem;
      min-width: 0;
    }
    #createModal .form-section {
      display: grid;
      gap: 1rem;
      min-width: 0;
      padding-top: 1rem;
      border-top: 1px solid rgba(231, 220, 211, 0.92);
    }
    #createModal .form-section:first-child {
      border-top: none;
      padding-top: 0;
    }
    #createModal .section-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.9rem;
      flex-wrap: wrap;
      color: #3e3530;
      font-size: 1rem;
      line-height: 1.4;
      font-weight: 800;
    }
    #createModal .section-title > i,
    #createModal .section-title .fas:first-child {
      color: #b58274;
    }
    #createModal .form-row {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 1rem;
    }
    #createModal .form-group {
      display: grid;
      gap: 0.45rem;
      min-width: 0;
    }
    #createModal .form-group label {
      color: #6b5c54;
      font-size: 0.9rem;
      line-height: 1.45;
      font-weight: 700;
    }
    #createPetForm input:not([type="hidden"]),
    #createPetForm textarea,
    #createPetForm select {
      width: 100%;
      margin: 0;
      padding: 0.92rem 1rem;
      border-radius: 8px;
      border: 1px solid rgba(214, 197, 188, 0.9);
      background: rgba(255, 255, 255, 0.94);
      color: #473c36;
      font: inherit;
      line-height: 1.45;
      transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    }
    #createPetForm textarea {
      min-height: 108px;
      resize: vertical;
    }
    #createPetForm input:not([type="hidden"]):focus,
    #createPetForm textarea:focus,
    #createPetForm select:focus {
      outline: none;
      border-color: rgba(193, 145, 128, 0.94);
      box-shadow: 0 0 0 3px rgba(193, 145, 128, 0.12);
      background: rgba(255, 255, 255, 0.98);
    }
    #createModal .memorial-select__trigger,
    #createModal .memorial-date-picker__trigger {
      background: rgba(255, 255, 255, 0.94);
    }
    #createModal .field-meta {
      align-items: center;
    }
    #createModal .auth-field__hint,
    #createModal .field-counter {
      color: #8d7b71;
    }
    #createModal .ai-generate-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      padding: 0.56rem 0.82rem;
      border: 1px solid rgba(209, 190, 180, 0.94);
      border-radius: 8px;
      background: rgba(255, 250, 246, 0.95);
      color: #5a4b43;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.18s ease, border-color 0.18s ease;
    }
    #createModal .ai-generate-btn:hover {
      background: rgba(250, 242, 236, 0.98);
      border-color: rgba(190, 167, 155, 0.96);
    }
    #createModal .form-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 0.85rem;
      flex-wrap: wrap;
      padding-top: 1.15rem;
      border-top: 1px solid rgba(231, 220, 211, 0.92);
    }
    #createModal .form-actions button,
    #editModal .form-actions button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.55rem;
      min-height: 44px;
      min-width: 124px;
      padding: 0.8rem 1.1rem;
      border-radius: 8px;
      border: 1px solid rgba(208, 190, 180, 0.92);
      background: rgba(255, 255, 255, 0.92);
      color: #5a4b43;
      font: inherit;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
      box-shadow: none;
      transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    }
    #createModal .form-actions button i,
    #editModal .form-actions button i {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      font-size: 0.95em;
      transform: translateY(-0.02em);
    }
    #createModal .form-actions button:hover,
    #editModal .form-actions button:hover {
      background: rgba(251, 246, 242, 0.98);
      border-color: rgba(196, 175, 164, 0.96);
      color: #564841;
      transform: translateY(-1px);
    }
    #createModal .form-actions button:focus-visible,
    #editModal .form-actions button:focus-visible {
      outline: none;
      border-color: rgba(193, 145, 128, 0.94);
      box-shadow: 0 0 0 3px rgba(193, 145, 128, 0.14);
    }
    #createModal #cancelCreateBtn,
    #editModal #cancelEditBtn {
      background: rgba(255, 255, 255, 0.94);
      color: #6b5c55;
      border-color: rgba(216, 199, 190, 0.96);
    }
    #createModal #cancelCreateBtn:hover,
    #editModal #cancelEditBtn:hover {
      background: rgba(250, 244, 240, 0.98);
      color: #5f5049;
      border-color: rgba(198, 178, 168, 0.98);
    }
    #createModal .form-actions .primary,
    #editModal .form-actions .primary {
      border-color: rgba(196, 126, 140, 0.98);
      background: #d88895;
      color: #fffaf8;
      box-shadow: 0 10px 22px rgba(216, 136, 149, 0.22);
    }
    #createModal .form-actions .primary:hover,
    #editModal .form-actions .primary:hover {
      background: #cf7888;
      border-color: rgba(186, 111, 126, 0.98);
      color: #fffaf8;
      box-shadow: 0 12px 24px rgba(207, 120, 136, 0.24);
    }
    #editModal .form-actions .danger {
      min-height: 38px;
      min-width: 112px;
      padding: 0.62rem 0.9rem;
      border-color: rgba(214, 164, 164, 0.96);
      background: rgba(255, 247, 247, 0.92);
      color: #a25a65;
      font-size: 0.88rem;
      font-weight: 600;
      opacity: 0.9;
    }
    #editModal .form-actions .danger:hover {
      background: rgba(255, 238, 238, 0.98);
      border-color: rgba(198, 137, 148, 0.98);
      color: #8f4755;
      box-shadow: 0 10px 20px rgba(201, 148, 156, 0.16);
      opacity: 1;
    }

    #editModal {
      background: rgba(46, 35, 29, 0.26);
      backdrop-filter: blur(12px);
    }
    #editModal .edit-modal-card {
      width: min(96vw, 1080px);
      max-height: min(90vh, 980px);
      padding: 1.25rem;
      border-radius: 8px;
      border: 1px solid rgba(225, 214, 205, 0.96);
      background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(252, 247, 242, 0.98) 100%);
      box-shadow: 0 24px 72px rgba(74, 58, 47, 0.16);
      overflow: auto;
    }
    #editModal .modal-close {
      top: 1rem;
      right: 1rem;
      width: 38px;
      height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
      border: 1px solid rgba(222, 210, 200, 0.92);
      background: rgba(255, 255, 255, 0.9);
      color: #7a675d;
      transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
    }
    #editModal .modal-close:hover {
      background: rgba(248, 240, 234, 0.98);
      border-color: rgba(214, 193, 180, 0.96);
      color: #4e3f36;
    }
    #editModal .edit-form {
      display: grid;
      gap: 1.5rem;
      min-width: 0;
    }
    #editModal .edit-form__hero {
      display: grid;
      grid-template-columns: minmax(228px, 268px) minmax(0, 1fr);
      gap: 1.5rem;
      align-items: stretch;
      padding-right: 2.25rem;
      padding-bottom: 1.25rem;
      border-bottom: 1px solid rgba(230, 218, 208, 0.94);
    }
    #editModal .photo-upload-area--edit {
      display: grid;
      gap: 0.85rem;
      align-content: start;
      justify-items: center;
      padding: 1rem;
      border: 1px solid rgba(230, 219, 210, 0.96);
      border-radius: 8px;
      background:
        linear-gradient(180deg, rgba(255, 250, 246, 0.98) 0%, rgba(247, 242, 237, 0.98) 100%);
    }
    #editModal .photo-preview {
      width: min(100%, 216px);
      aspect-ratio: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      margin-inline: auto;
      border-radius: 50%;
      border: 3px solid rgba(255, 255, 255, 0.94);
      background:
        linear-gradient(135deg, rgba(243, 230, 224, 0.94) 0%, rgba(236, 244, 238, 0.94) 100%);
      color: #9b7a71;
      box-shadow: 0 16px 34px rgba(88, 69, 60, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.82);
    }
    #editModal .photo-preview img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
    }
    #editModal .photo-preview i {
      font-size: 1.65rem;
    }
    #editModal .photo-upload-btn {
      width: 100%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.55rem;
      min-height: 44px;
      padding: 0.8rem 1rem;
      border: 1px solid rgba(205, 186, 176, 0.94);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.9);
      color: #5c4d44;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    }
    #editModal .photo-upload-btn:hover {
      background: rgba(252, 246, 241, 0.98);
      border-color: rgba(190, 167, 155, 0.96);
      transform: translateY(-1px);
    }
    #editModal .photo-note {
      color: #88776e;
      font-size: 0.84rem;
      line-height: 1.65;
      text-align: center;
    }
    #editModal .edit-form__intro {
      display: grid;
      gap: 1.1rem;
      align-content: start;
      min-width: 0;
      padding: 0.15rem 0;
    }
    #editModal .edit-form__header {
      display: grid;
      gap: 0.45rem;
      margin: 0;
    }
    #editModal .edit-form__eyebrow {
      color: #96736b;
      font-size: 0.82rem;
      font-weight: 700;
      letter-spacing: 0;
    }
    #editModal .create-header h2 {
      margin: 0;
      color: #342c28;
      font-size: 2rem;
      line-height: 1.08;
      letter-spacing: 0;
      font-weight: 800;
    }
    #editModal .create-header p {
      margin: 0;
      color: #6f625a;
      font-size: 0.96rem;
      line-height: 1.7;
      max-width: 34rem;
    }
    #editModal .create-header p i {
      color: #b58274;
      margin-right: 0.38rem;
    }
    #editModal .edit-form__summary {
      list-style: none;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 0.9rem;
      padding: 0;
      margin: 0;
    }
    #editModal .edit-form__summary li {
      min-width: 0;
      padding-top: 0.9rem;
      border-top: 1px solid rgba(229, 218, 209, 0.94);
    }
    #editModal .edit-form__summary span {
      display: block;
      color: #907f75;
      font-size: 0.8rem;
      line-height: 1.4;
    }
    #editModal .edit-form__summary strong {
      display: block;
      margin-top: 0.32rem;
      color: #3e3530;
      font-size: 0.96rem;
      line-height: 1.45;
      font-weight: 700;
    }
    #editModal .edit-form__body {
      display: grid;
      gap: 1.1rem;
      min-width: 0;
    }
    #editModal .form-section {
      display: grid;
      gap: 1rem;
      min-width: 0;
      padding-top: 1rem;
      border-top: 1px solid rgba(231, 220, 211, 0.92);
    }
    #editModal .form-section:first-child {
      border-top: none;
      padding-top: 0;
    }
    #editModal .section-title {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.9rem;
      flex-wrap: wrap;
      color: #3e3530;
      font-size: 1rem;
      line-height: 1.4;
      font-weight: 800;
    }
    #editModal .section-title > i,
    #editModal .section-title .fas:first-child {
      color: #b58274;
    }
    #editModal .form-row {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 1rem;
    }
    #editModal .form-group {
      display: grid;
      gap: 0.45rem;
      min-width: 0;
    }
    #editModal .form-group label {
      color: #6b5c54;
      font-size: 0.9rem;
      line-height: 1.45;
      font-weight: 700;
    }
    #editPetForm input:not([type="hidden"]),
    #editPetForm textarea,
    #editPetForm select {
      width: 100%;
      margin: 0;
      padding: 0.92rem 1rem;
      border-radius: 8px;
      border: 1px solid rgba(214, 197, 188, 0.9);
      background: rgba(255, 255, 255, 0.94);
      color: #473c36;
      font: inherit;
      line-height: 1.45;
      transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    }
    #editPetForm textarea {
      min-height: 108px;
      resize: vertical;
    }
    #editPetForm input:not([type="hidden"]):focus,
    #editPetForm textarea:focus,
    #editPetForm select:focus {
      outline: none;
      border-color: rgba(193, 145, 128, 0.94);
      box-shadow: 0 0 0 3px rgba(193, 145, 128, 0.12);
      background: rgba(255, 255, 255, 0.98);
    }
    #editModal .memorial-select__trigger,
    #editModal .memorial-date-picker__trigger {
      background: rgba(255, 255, 255, 0.94);
    }
    #editModal .field-meta {
      align-items: center;
    }
    #editModal .auth-field__hint,
    #editModal .field-counter {
      color: #8d7b71;
    }
    #editModal .ai-generate-btn {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      padding: 0.56rem 0.82rem;
      border: 1px solid rgba(209, 190, 180, 0.94);
      border-radius: 8px;
      background: rgba(255, 250, 246, 0.95);
      color: #5a4b43;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.18s ease, border-color 0.18s ease;
    }
    #editModal .ai-generate-btn:hover {
      background: rgba(250, 242, 236, 0.98);
      border-color: rgba(190, 167, 155, 0.96);
    }
    #editModal .form-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 0.85rem;
      flex-wrap: wrap;
      padding-top: 1.15rem;
      border-top: 1px solid rgba(231, 220, 211, 0.92);
    }
    #createModal .create-modal-card,
    #editModal .edit-modal-card {
      width: min(96vw, 860px);
    }
    #createModal .memorial-form,
    #editModal .edit-form {
      gap: 1.35rem;
    }
    #createModal .memorial-form__hero,
    #editModal .edit-form__hero {
      width: min(100%, 760px);
      margin-inline: auto;
      grid-template-columns: 1fr;
      gap: 0.75rem;
      align-items: start;
      padding-right: 0;
      padding-bottom: 1rem;
      border-bottom: none;
    }
    #createModal .memorial-form__intro,
    #editModal .edit-form__intro {
      gap: 0.75rem;
      padding: 0;
      max-width: 40rem;
    }
    #createModal .memorial-form__header,
    #editModal .edit-form__header {
      gap: 0.4rem;
    }
    #createModal .create-header h2,
    #editModal .create-header h2 {
      font-size: 1.86rem;
      line-height: 1.12;
    }
    #createModal .create-header p,
    #editModal .create-header p {
      max-width: none;
      font-size: 0.94rem;
      line-height: 1.68;
    }
    #createModal .memorial-form__summary,
    #editModal .edit-form__summary {
      display: none;
    }
    #createModal .memorial-form__body,
    #editModal .edit-form__body {
      width: min(100%, 760px);
      margin-inline: auto;
      grid-template-columns: minmax(228px, 244px) minmax(0, 1fr);
      column-gap: 1.5rem;
      row-gap: 1.45rem;
      align-items: start;
    }
    #createModal .memorial-photo-field,
    #editModal .memorial-photo-field {
      display: grid;
      gap: 0.65rem;
    }
    #createModal .memorial-form__photo-field--lead,
    #editModal .memorial-form__photo-field--lead {
      grid-column: 1;
      grid-row: 1;
      align-self: start;
      margin-top: -0.2rem;
      gap: 0.5rem;
    }
    #createModal .memorial-form__photo-field--lead .memorial-photo-field__row,
    #editModal .memorial-form__photo-field--lead .memorial-photo-field__row {
      flex-direction: column;
      align-items: stretch;
      gap: 0.85rem;
      padding: 1rem;
    }
    #createModal .memorial-form__photo-field--lead .memorial-photo-field__preview,
    #editModal .memorial-form__photo-field--lead .memorial-photo-field__preview {
      width: 124px;
      height: 124px;
      flex: 0 0 124px;
      align-self: center;
    }
    #createModal .memorial-form__photo-field--lead .memorial-photo-field__actions,
    #editModal .memorial-form__photo-field--lead .memorial-photo-field__actions {
      width: 100%;
    }
    #createModal .memorial-form__photo-field--lead .memorial-photo-field__button,
    #editModal .memorial-form__photo-field--lead .memorial-photo-field__button {
      width: 100%;
      justify-content: center;
    }
    #createModal .memorial-photo-field__head,
    #editModal .memorial-photo-field__head {
      display: grid;
      gap: 0.3rem;
    }
    #createModal .memorial-photo-field__label,
    #editModal .memorial-photo-field__label {
      color: #6a5750;
      font-size: 0.92rem;
      line-height: 1.45;
      font-weight: 700;
    }
    #createModal .memorial-photo-field__hint,
    #editModal .memorial-photo-field__hint {
      color: #8b756d;
      font-size: 0.82rem;
      line-height: 1.55;
    }
    #createModal .memorial-photo-field__row,
    #editModal .memorial-photo-field__row {
      display: flex;
      align-items: center;
      gap: 0.95rem;
      padding: 0.95rem;
      border: 1px solid rgba(232, 209, 203, 0.84);
      border-radius: 8px;
      background: rgba(255, 250, 248, 0.72);
    }
    #createModal .memorial-photo-field__preview,
    #editModal .memorial-photo-field__preview {
      width: 104px;
      height: 104px;
      flex: 0 0 104px;
      margin: 0;
      border-width: 1px;
      border-color: rgba(255, 183, 205, 0.72);
      background: linear-gradient(135deg, rgba(255, 244, 248, 0.98), rgba(255, 255, 255, 0.96));
      color: #b46f88;
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    #createModal .memorial-photo-field__actions,
    #editModal .memorial-photo-field__actions {
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 0.4rem;
    }
    #createModal .photo-upload-btn,
    #editModal .photo-upload-btn {
      width: auto;
      min-width: 0;
      padding: 0.72rem 1rem;
      border: none;
      background: linear-gradient(135deg, #ff92c7, #ff69b4);
      color: #fff;
      line-height: 1.1;
      box-shadow: 0 10px 22px rgba(255, 105, 180, 0.18);
      transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    }
    #createModal .photo-upload-btn:hover,
    #editModal .photo-upload-btn:hover {
      background: linear-gradient(135deg, #ff92c7, #ff69b4);
      color: #fff;
      filter: saturate(1.04);
      box-shadow: 0 12px 24px rgba(255, 105, 180, 0.22);
      border-color: transparent;
      transform: translateY(-1px);
    }
    #createModal .photo-upload-btn:focus-visible,
    #editModal .photo-upload-btn:focus-visible {
      outline: none;
      background: linear-gradient(135deg, #ff92c7, #ff69b4);
      color: #fff;
      box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.16), 0 10px 22px rgba(255, 105, 180, 0.18);
    }
    #createModal .photo-note,
    #editModal .photo-note {
      color: #8b756d;
      font-size: 0.82rem;
      line-height: 1.55;
      text-align: left;
    }
    #createModal .form-section,
    #editModal .form-section {
      gap: 0.8rem;
      padding-top: 0;
      border-top: none;
    }
    #createModal .form-section--identity,
    #editModal .form-section--identity {
      grid-column: 2;
      grid-row: 1;
      gap: 0.7rem;
    }
    #createModal .form-section--timeline,
    #editModal .form-section--timeline {
      grid-column: 1 / -1;
      grid-row: 2;
      gap: 0.7rem;
    }
    #createModal .form-section--story,
    #editModal .form-section--story,
    #createModal .form-section--traits,
    #editModal .form-section--traits,
    #createModal .form-actions,
    #editModal .form-actions {
      grid-column: 1 / -1;
    }
    #createModal .form-section--core .section-title,
    #editModal .form-section--core .section-title {
      display: none;
    }
    #createModal .form-section + .form-section,
    #editModal .form-section + .form-section {
      margin-top: -0.1rem;
    }
    #createModal .section-title,
    #editModal .section-title {
      gap: 0.7rem;
      color: #564840;
      font-size: 0.96rem;
      line-height: 1.45;
      font-weight: 800;
    }
    #createModal .section-title > i,
    #editModal .section-title > i {
      display: none;
    }
    #createModal .section-title .required-star,
    #editModal .section-title .required-star {
      color: #aa8275;
      font-size: 0.78rem;
    }
    #createModal .form-section--story .section-title,
    #editModal .form-section--story .section-title {
      color: #4e4039;
      font-size: 1rem;
    }
    #createModal .form-section--traits .section-title,
    #editModal .form-section--traits .section-title {
      color: #695851;
      font-size: 0.92rem;
    }
    #createModal .form-group,
    #editModal .form-group {
      gap: 0.4rem;
    }
    #createModal .form-group label,
    #editModal .form-group label {
      color: #6a5750;
      font-size: 0.9rem;
      line-height: 1.45;
      font-weight: 700;
    }
    #createModal .form-actions,
    #editModal .form-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      flex-wrap: wrap;
      padding-top: 0.35rem;
      border-top: none;
    }
    #createModal .form-actions__meta,
    #editModal .form-actions__meta {
      display: inline-flex;
      align-items: center;
      gap: 0.65rem;
      min-width: 0;
    }
    #editModal .form-actions__meta {
      gap: 0.55rem;
      flex-wrap: wrap;
    }
    #createModal .memorial-visibility-field,
    #editModal .memorial-visibility-field {
      flex: 0 0 auto;
    }
    #createModal .memorial-visibility-field .memorial-select,
    #editModal .memorial-visibility-field .memorial-select {
      width: 188px;
      flex: 0 0 188px;
    }
    #createModal .form-actions__buttons,
    #editModal .form-actions__buttons {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 0.85rem;
      flex-wrap: wrap;
      margin-left: auto;
    }
    #createModal .memorial-visibility-field label,
    #editModal .memorial-visibility-field label {
      color: #8d7b71;
      font-size: 0.82rem;
      line-height: 1.45;
      font-weight: 700;
      white-space: nowrap;
    }
    #createModal .memorial-visibility-field select,
    #editModal .memorial-visibility-field select {
      width: 168px;
      padding: 0.66rem 2.4rem 0.66rem 0.85rem;
      border: 1px solid rgba(225, 210, 202, 0.92);
      background-color: rgba(255, 252, 250, 0.98);
      color: #6a5750;
      font-size: 0.84rem;
      box-shadow: none;
    }
    #createModal .memorial-visibility-field select:focus,
    #editModal .memorial-visibility-field select:focus {
      border-color: rgba(207, 127, 153, 0.62);
      box-shadow: 0 0 0 3px rgba(207, 127, 153, 0.1);
    }
    #createModal .memorial-visibility-field .memorial-select__trigger,
    #editModal .memorial-visibility-field .memorial-select__trigger {
      padding: 0.66rem 2.2rem 0.66rem 0.85rem;
      border-color: rgba(225, 210, 202, 0.92);
      background: rgba(255, 252, 250, 0.98);
      color: #6a5750;
      font-size: 0.84rem;
      font-weight: 500;
      line-height: 1.35;
      box-shadow: none;
      white-space: nowrap;
    }
    #createModal .memorial-visibility-field .memorial-select__trigger::after,
    #editModal .memorial-visibility-field .memorial-select__trigger::after {
      right: 0.85rem;
      width: 0.45rem;
      height: 0.45rem;
      opacity: 0.54;
    }
    #createModal .memorial-visibility-field .memorial-select__trigger:hover,
    #editModal .memorial-visibility-field .memorial-select__trigger:hover {
      background: rgba(255, 249, 247, 1);
      border-color: rgba(214, 198, 190, 0.96);
    }
    #createModal .memorial-visibility-field .memorial-select.is-open .memorial-select__trigger,
    #editModal .memorial-visibility-field .memorial-select.is-open .memorial-select__trigger,
    #createModal .memorial-visibility-field .memorial-select__trigger:focus,
    #editModal .memorial-visibility-field .memorial-select__trigger:focus {
      border-color: rgba(212, 194, 186, 0.98);
      background: rgba(255, 253, 252, 1);
      box-shadow: 0 0 0 2px rgba(216, 198, 191, 0.14);
    }
    #createModal .memorial-visibility-field .memorial-select__panel,
    #editModal .memorial-visibility-field .memorial-select__panel {
      left: auto;
      right: 0;
      width: 188px;
      padding: 0.45rem;
      border-color: rgba(228, 212, 205, 0.92);
      background: rgba(255, 253, 251, 0.99);
      box-shadow: 0 14px 26px rgba(138, 108, 112, 0.12);
    }
    #createModal .memorial-visibility-field .memorial-select__list,
    #editModal .memorial-visibility-field .memorial-select__list {
      gap: 0.3rem;
    }
    #createModal .memorial-visibility-field .memorial-select__option,
    #editModal .memorial-visibility-field .memorial-select__option {
      padding: 0.7rem 0.75rem;
      border-color: rgba(233, 221, 216, 0.96);
      background: rgba(255, 255, 255, 0.98);
      color: #6f5f58;
      font-size: 0.84rem;
      font-weight: 500;
      line-height: 1.35;
      white-space: nowrap;
      text-align: center;
    }
    #createModal .memorial-visibility-field .memorial-select__option:hover,
    #editModal .memorial-visibility-field .memorial-select__option:hover {
      background: rgba(250, 245, 242, 1);
      border-color: rgba(218, 204, 197, 0.98);
      color: #5f514a;
      transform: none;
    }
    #createModal .memorial-visibility-field .memorial-select__option.is-selected,
    #editModal .memorial-visibility-field .memorial-select__option.is-selected {
      background: rgba(248, 241, 237, 1);
      border-color: rgba(210, 194, 187, 0.98);
      color: #655851;
      box-shadow: inset 0 0 0 1px rgba(228, 214, 208, 0.84);
    }
    #createModal .memorial-visibility-field .memorial-select__option.is-selected::after,
    #editModal .memorial-visibility-field .memorial-select__option.is-selected::after {
      display: none;
    }
    #editModal .form-actions__meta .danger {
      margin-right: 0.35rem;
    }
    #editModal .memorial-visibility-field label {
      font-size: 0.76rem;
      color: #96847a;
    }
    #editModal .memorial-visibility-field .memorial-select {
      width: 156px;
      flex: 0 0 156px;
    }
    #editModal .memorial-visibility-field select {
      width: 156px;
      padding: 0.56rem 2.15rem 0.56rem 0.78rem;
      font-size: 0.84rem;
      min-height: 0;
    }
    #editModal .memorial-visibility-field .memorial-select__trigger {
      padding: 0.56rem 2rem 0.56rem 0.78rem;
      font-size: 0.84rem;
      min-height: 0;
    }
    #editModal .memorial-visibility-field .memorial-select__trigger::after {
      right: 0.72rem;
      width: 0.4rem;
      height: 0.4rem;
    }
    #editModal .memorial-visibility-field .memorial-select__panel {
      width: 156px;
    }
    #createPetForm input:not([type="hidden"]),
    #createPetForm textarea,
    #createPetForm select,
    #editPetForm input:not([type="hidden"]),
    #editPetForm textarea,
    #editPetForm select {
      padding: 0.88rem 1rem;
      border: 1px solid rgba(232, 209, 203, 0.9);
      background: rgba(255, 255, 255, 0.98);
    }
    #createPetForm input:not([type="hidden"]):focus,
    #createPetForm textarea:focus,
    #createPetForm select:focus,
    #editPetForm input:not([type="hidden"]):focus,
    #editPetForm textarea:focus,
    #editPetForm select:focus {
      border-color: rgba(207, 127, 153, 0.72);
      box-shadow: 0 0 0 3px rgba(207, 127, 153, 0.12);
    }
    #profileModal {
      background: rgba(46, 35, 29, 0.24);
      backdrop-filter: blur(12px);
    }
    #profileModal .modal-card {
      width: min(96vw, 760px);
      max-height: 90vh;
      padding: 1.35rem;
      border-radius: 24px;
      box-shadow: 0 20px 44px rgba(72, 51, 42, 0.16);
    }
    #profileModal .modal-close {
      top: 0.9rem;
      right: 1rem;
    }
    #profileModal .profile-editor-shell {
      width: min(100%, 680px);
      margin: 0 auto;
      display: grid;
      gap: 1.25rem;
    }
    #profileModal .profile-editor-header {
      display: grid;
      gap: 0.35rem;
      padding-right: 2.2rem;
    }
    #profileModal .profile-editor-header h2 {
      margin: 0;
      color: #4f4139;
      font-size: 1.84rem;
      line-height: 1.12;
      font-weight: 800;
    }
    #profileModal .profile-editor-form {
      display: grid;
    }
    #profileModal .profile-editor-main {
      display: grid;
      grid-template-columns: minmax(216px, 228px) minmax(0, 1fr);
      column-gap: 1.45rem;
      align-items: start;
    }
    #profileModal .profile-avatar {
      margin: 0;
      display: grid;
      gap: 0.65rem;
      align-self: start;
    }
    #profileModal .profile-avatar__frame {
      display: grid;
      gap: 0.9rem;
      justify-items: center;
      padding: 1rem;
      border: 1px solid rgba(232, 209, 203, 0.84);
      border-radius: 8px;
      background: rgba(255, 250, 248, 0.72);
    }
    #profileModal .avatar-preview {
      width: 124px;
      height: 124px;
      margin: 0;
      border: 1px solid rgba(232, 209, 203, 0.9);
      background: linear-gradient(135deg, rgba(255, 244, 248, 0.98), rgba(255, 255, 255, 0.96));
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
      color: #b46f88;
      text-decoration: none;
    }
    #profileModal .avatar-preview--interactive {
      cursor: pointer;
      transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    }
    #profileModal .avatar-preview--interactive:hover {
      border-color: rgba(206, 176, 165, 0.96);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 10px 18px rgba(132, 103, 96, 0.08);
      transform: translateY(-1px);
    }
    #profileModal .avatar-preview--interactive:focus-visible {
      outline: none;
      border-color: rgba(193, 145, 128, 0.94);
      box-shadow: 0 0 0 3px rgba(193, 145, 128, 0.14);
    }
    #profileModal .avatar-preview img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: cover;
    }
    #profileModal .avatar-upload-btn {
      width: 100%;
      min-height: 44px;
      justify-content: center;
      padding: 0.76rem 1rem;
      border: 1px solid rgba(208, 190, 180, 0.92);
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.92);
      color: #5a4b43;
      font: inherit;
      font-weight: 700;
      line-height: 1.1;
      transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
    }
    #profileModal .avatar-upload-btn:hover {
      background: rgba(250, 243, 238, 0.98);
      border-color: rgba(188, 165, 154, 0.96);
      color: #5a4b43;
      transform: translateY(-1px);
    }
    #profileModal .avatar-upload-btn:focus-visible {
      outline: none;
      border-color: rgba(193, 145, 128, 0.94);
      box-shadow: 0 0 0 3px rgba(193, 145, 128, 0.14);
    }
    #profileModal .profile-editor-fields {
      display: grid;
      gap: 1rem;
      min-width: 0;
      align-self: start;
    }
    #profileModal .profile-form-group {
      display: grid;
      gap: 0.45rem;
      min-width: 0;
    }
    #profileModal .profile-location-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 0.85rem;
    }
    #profileModal .profile-form-group label {
      color: #6a5750;
      font-size: 0.9rem;
      line-height: 1.45;
      font-weight: 700;
    }
    #profileModal .field-meta {
      align-items: center;
    }
    #profileModal .field-counter {
      color: #8d7b71;
    }
    #profileForm input:not([type="hidden"]),
    #profileForm textarea {
      width: 100%;
      margin: 0;
      padding: 0.88rem 1rem;
      border-radius: 8px;
      border: 1px solid rgba(232, 209, 203, 0.9);
      background: rgba(255, 255, 255, 0.98);
      color: #473c36;
      font: inherit;
      line-height: 1.45;
      transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    }
    #profileForm textarea {
      min-height: 132px;
      resize: vertical;
    }
    #profileForm input:not([type="hidden"]):focus,
    #profileForm textarea:focus {
      outline: none;
      border-color: rgba(207, 127, 153, 0.72);
      box-shadow: 0 0 0 3px rgba(207, 127, 153, 0.12);
      background: rgba(255, 255, 255, 1);
    }
    #profileModal .profile-form-actions {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.85rem;
      flex-wrap: wrap;
      margin-top: 0.2rem;
      padding-top: 0.95rem;
      border-top: 1px solid rgba(232, 220, 214, 0.82);
    }
    #profileModal .profile-form-actions__secondary,
    #profileModal .profile-form-actions__primary {
      display: flex;
      align-items: center;
      gap: 0.85rem;
      flex-wrap: wrap;
    }
    #profileModal .profile-form-actions__secondary {
      flex: 1 1 auto;
      justify-content: flex-start;
      margin-right: auto;
    }
    #profileModal .profile-form-actions__primary {
      margin-left: auto;
      justify-content: flex-end;
    }
    #profileModal .form-actions button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.55rem;
      min-height: 44px;
      padding: 0.8rem 1.1rem;
      border-radius: 8px;
      border: 1px solid rgba(208, 190, 180, 0.92);
      background: rgba(255, 255, 255, 0.9);
      color: #5a4b43;
      font: inherit;
      font-weight: 700;
      cursor: pointer;
      box-shadow: none;
      transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    }
    #profileModal .form-actions button i {
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      font-size: 0.95em;
      transform: translateY(-0.02em);
    }
    #profileModal .form-actions button:hover {
      background: rgba(251, 246, 242, 0.98);
      border-color: rgba(196, 175, 164, 0.96);
      transform: translateY(-1px);
    }
    #profileModal #cancelProfileBtn {
      background: rgba(255, 255, 255, 0.94);
      color: #6b5c55;
      border-color: rgba(216, 199, 190, 0.96);
    }
    #profileModal #cancelProfileBtn:hover {
      background: rgba(250, 244, 240, 0.98);
      color: #5f5049;
      border-color: rgba(198, 178, 168, 0.98);
    }
    #profileModal .form-actions .primary {
      border-color: rgba(196, 126, 140, 0.98);
      background: #d88895;
      color: #fffaf8;
      box-shadow: 0 10px 22px rgba(216, 136, 149, 0.22);
    }
    #profileModal .form-actions .primary:hover {
      background: #cf7888;
      border-color: rgba(186, 111, 126, 0.98);
      box-shadow: 0 12px 24px rgba(207, 120, 136, 0.24);
    }
    #profileModal .profile-form-actions__secondary button {
      justify-content: flex-start;
      min-width: auto;
      padding-left: 0.25rem;
      padding-right: 0.25rem;
      background: transparent;
      border-color: transparent;
      color: #a06f78;
      box-shadow: none;
    }
    #profileModal .profile-form-actions__secondary button i {
      color: #b07d86;
    }
    #profileModal .profile-form-actions__secondary button:hover {
      background: rgba(255, 243, 246, 0.92);
      border-color: rgba(239, 208, 216, 0.9);
      color: #8d5e68;
      box-shadow: none;
    }
    @media (max-width: 900px) {
      .memorial-editor-view {
        padding: 1.6rem 0 3rem;
      }
      .memorial-editor-shell {
        gap: 0.85rem;
      }
      #createModal .memorial-form__body,
      #editModal .edit-form__body {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 1.2rem;
      }
      #createModal .memorial-form__photo-field--lead,
      #editModal .memorial-form__photo-field--lead,
      #createModal .form-section--identity,
      #editModal .form-section--identity,
      #createModal .form-section--timeline,
      #editModal .form-section--timeline,
      #createModal .form-section--story,
      #editModal .form-section--story,
      #createModal .form-section--traits,
      #editModal .form-section--traits,
      #createModal .form-actions,
      #editModal .form-actions {
        grid-column: auto;
        grid-row: auto;
      }
      #createModal .create-modal-card {
        width: min(96vw, 760px);
      }
      #createModal .memorial-form__hero {
        padding-right: 0;
      }
      #createModal .memorial-photo-field__row {
        flex-direction: column;
        align-items: flex-start;
      }
      #editModal .edit-modal-card {
        width: min(96vw, 760px);
      }
      #editModal .edit-form__hero {
        padding-right: 0;
      }
      #editModal .memorial-photo-field__row {
        flex-direction: column;
        align-items: flex-start;
      }
      #profileModal .profile-editor-main {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 1.2rem;
      }
      #profileModal .profile-location-grid {
        grid-template-columns: 1fr;
      }
      #profileModal .profile-avatar {
        justify-items: center;
      }
      #profileModal .profile-avatar__frame {
        width: min(100%, 280px);
      }
    }
    @media (max-width: 640px) {
      .memorial-editor-back {
        width: 100%;
        justify-content: center;
      }
      #createModal .create-modal-card {
        padding: 1rem;
      }
      #createModal .create-header h2 {
        font-size: 1.6rem;
      }
      #createModal .form-row {
        grid-template-columns: 1fr;
      }
      #createModal .form-actions {
        justify-content: stretch;
      }
      #createModal .form-actions__meta,
      #editModal .form-actions__meta {
        width: 100%;
        justify-content: space-between;
      }
      #createModal .form-actions__buttons,
      #editModal .form-actions__buttons {
        width: 100%;
        margin-left: 0;
      }
      #createModal .memorial-photo-field__actions,
      #editModal .memorial-photo-field__actions {
        width: 100%;
      }
      #createModal .photo-upload-btn,
      #editModal .photo-upload-btn {
        width: 100%;
      }
      #createModal .form-actions button {
        width: 100%;
      }
      #editModal .edit-modal-card {
        padding: 1rem;
      }
      #editModal .create-header h2 {
        font-size: 1.6rem;
      }
      #editModal .form-row {
        grid-template-columns: 1fr;
      }
      #editModal .form-actions {
        justify-content: stretch;
      }
      #editModal .form-actions button {
        width: 100%;
      }
      #profileModal .modal-card {
        padding: 1rem;
      }
      #profileModal .profile-editor-header h2 {
        font-size: 1.58rem;
      }
      #profileModal .profile-form-actions {
        justify-content: stretch;
      }
      #profileModal .profile-form-actions__secondary,
      #profileModal .profile-form-actions__primary {
        width: 100%;
      }
      #profileModal .profile-form-actions__secondary {
        justify-content: flex-start;
      }
      #profileModal .form-actions button {
        width: 100%;
      }
      #profileModal .profile-form-actions__secondary button {
        width: auto;
      }
    }

